@tantainnovative/ndpr-toolkit 5.7.2 → 5.7.4
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 +41 -1
- package/README.md +62 -16
- package/bin/ndpr.mjs +4 -3
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-426DIR5C.js +1 -0
- package/dist/{chunk-2OSZT7KI.js → chunk-55EAP4U7.js} +4 -4
- package/dist/chunk-5JS3L4XF.js +1 -0
- package/dist/chunk-7E5A7YVH.mjs +6 -0
- package/dist/{chunk-FVZUR7QN.mjs → chunk-7FCI5BPU.mjs} +1 -1
- package/dist/{chunk-JTM463ES.mjs → chunk-7LGOY2A3.mjs} +1 -1
- package/dist/chunk-C6F5JJV6.mjs +1 -0
- package/dist/chunk-CHUOSZST.js +2 -0
- package/dist/{chunk-OVXDSUQU.js → chunk-CLTIKUTQ.js} +1 -1
- package/dist/chunk-CUUM5U6W.js +2 -0
- package/dist/{chunk-IVSNHT24.mjs → chunk-DHRFX6AY.mjs} +0 -0
- package/dist/{chunk-IT5VIC2P.mjs → chunk-EH73TDZL.mjs} +1 -1
- package/dist/chunk-H5WABWMB.mjs +1 -0
- package/dist/chunk-HLPZALYL.mjs +1 -0
- package/dist/chunk-ISCFIAKJ.js +2 -0
- package/dist/chunk-J5JG3K7E.js +1 -0
- package/dist/chunk-JNEQIRM5.mjs +1 -0
- package/dist/{chunk-7BJXI2HI.mjs → chunk-K5WLRGDN.mjs} +1 -1
- package/dist/chunk-L5Z77INN.mjs +2 -0
- package/dist/chunk-LP3R2BBL.js +1 -0
- package/dist/chunk-OMACLDXI.mjs +2 -0
- package/dist/chunk-QX6RIR6I.mjs +1 -0
- package/dist/{chunk-T63MYPKE.js → chunk-RKG2FHSP.js} +1 -1
- package/dist/{chunk-OLTLB5MP.mjs → chunk-RNV6D6MV.mjs} +1 -1
- package/dist/{chunk-WJ4DAOKE.js → chunk-RP4JSZ6V.js} +2 -2
- package/dist/chunk-TSA2C2YC.js +1 -0
- package/dist/chunk-UFQLC3KP.mjs +1 -0
- package/dist/{chunk-YFBDJ4FH.js → chunk-USD363RW.js} +1 -1
- package/dist/{chunk-PQ5IPUJN.mjs → chunk-VSUV2ZAY.mjs} +1 -1
- package/dist/{chunk-VEWLYTRA.js → chunk-VT5KQCMY.js} +1 -1
- package/dist/chunk-WCC4EHKU.js +1 -0
- package/dist/{chunk-JS7SYL5P.js → chunk-XNCCIRT6.js} +0 -0
- package/dist/{chunk-QKXGVT2Q.js → chunk-XWOO2LT5.js} +1 -1
- package/dist/chunk-YSCHSH6V.mjs +2 -0
- package/dist/consent.d.mts +1 -1
- package/dist/consent.d.ts +1 -1
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +15 -5
- package/dist/core.d.ts +15 -5
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +30 -4
- package/dist/cross-border.d.ts +30 -4
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dsr.d.mts +2 -0
- package/dist/dsr.d.ts +2 -0
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/headless.d.mts +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +17 -5
- package/dist/index.d.ts +17 -5
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets-dsr.d.mts +2 -0
- package/dist/presets-dsr.d.ts +2 -0
- package/dist/presets-dsr.js +1 -1
- package/dist/presets-dsr.mjs +1 -1
- package/dist/presets-policy.js +1 -1
- package/dist/presets-policy.mjs +1 -1
- package/dist/presets.d.mts +2 -0
- package/dist/presets.d.ts +2 -0
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/server.d.mts +15 -5
- package/dist/server.d.ts +15 -5
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/unstyled.d.mts +2 -0
- package/dist/unstyled.d.ts +2 -0
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/package.json +25 -12
- package/dist/chunk-5ZMYNOMR.mjs +0 -2
- package/dist/chunk-6UGLAVRM.mjs +0 -6
- package/dist/chunk-B6BRD5SL.mjs +0 -1
- package/dist/chunk-C5UYAOYX.mjs +0 -1
- package/dist/chunk-DKLJ5DYN.js +0 -1
- package/dist/chunk-EAV4BZKO.mjs +0 -2
- package/dist/chunk-FRHFIEWZ.js +0 -2
- package/dist/chunk-HCZDQWHY.js +0 -2
- package/dist/chunk-HHK5LHEG.js +0 -1
- package/dist/chunk-IRRUYR6M.js +0 -1
- package/dist/chunk-KDAZQO3N.mjs +0 -1
- package/dist/chunk-LHQG25Y2.js +0 -2
- package/dist/chunk-ME77GU4Q.mjs +0 -2
- package/dist/chunk-R3ZKV2J7.mjs +0 -1
- package/dist/chunk-SJDDNB6M.js +0 -1
- package/dist/chunk-T32YQT4Y.js +0 -1
- package/dist/chunk-TVA6D6S4.js +0 -1
- package/dist/chunk-XOH4WXOZ.mjs +0 -1
- package/dist/chunk-ZSRO4L3C.mjs +0 -1
package/dist/presets.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{a as NDPRConsent}from'./chunk-2T5MY2Q6.mjs';export{a as NDPRSubjectRights}from'./chunk-OLTLB5MP.mjs';export{a as NDPRPrivacyPolicy}from'./chunk-FVZUR7QN.mjs';import'./chunk-IT5VIC2P.mjs';import {a as a$7}from'./chunk-AVV47UX7.mjs';import {a}from'./chunk-5ZMYNOMR.mjs';import {a as a$2}from'./chunk-RW7V7DDR.mjs';import {a as a$4}from'./chunk-6UGLAVRM.mjs';import {a as a$5}from'./chunk-2ASQQYJR.mjs';import'./chunk-4QQJEO3F.mjs';import'./chunk-JTM463ES.mjs';import'./chunk-IVSNHT24.mjs';import {a as a$6}from'./chunk-6A7M4CGJ.mjs';import'./chunk-WJSUVPYX.mjs';import'./chunk-3ELNTFUX.mjs';import'./chunk-7BJXI2HI.mjs';import'./chunk-LWIKDDSU.mjs';import'./chunk-XP5PL6K7.mjs';import'./chunk-PYSYBUIV.mjs';import'./chunk-QNXLY5EJ.mjs';import'./chunk-ZY4RCV5C.mjs';import'./chunk-EAV4BZKO.mjs';import'./chunk-EWVK45Z3.mjs';import {a as a$1}from'./chunk-YZHEEGGK.mjs';import {a as a$8}from'./chunk-LRRENTT5.mjs';import'./chunk-ITCY2Z66.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-PHA3YMFO.mjs';import'./chunk-5LJ652AH.mjs';import'./chunk-DBZSN4WP.mjs';import {d,b,a as a$3,c}from'./chunk-ZJYULEER.mjs';import {jsx}from'react/jsx-runtime';import {useState,useEffect}from'react';var W=[{id:"unauthorized_access",name:"Unauthorized Access",description:"Unauthorized access to personal data",defaultSeverity:"high"},{id:"data_loss",name:"Data Loss",description:"Loss of personal data",defaultSeverity:"high"},{id:"data_theft",name:"Data Theft",description:"Theft of personal data",defaultSeverity:"critical"},{id:"system_breach",name:"System Breach",description:"Breach of system containing personal data",defaultSeverity:"critical"},{id:"accidental_disclosure",name:"Accidental Disclosure",description:"Unintended disclosure of personal data",defaultSeverity:"medium"}],Y=({categories:p=W,adapter:o,classNames:P,unstyled:h,onSubmit:a$1=()=>{},copy:r,description:c,submitTo:s,submitOptions:i,onSubmitError:f,onSubmitSuccess:R})=>{var e;let d$1=n=>d(null,null,function*(){var u,N;if(s){let C=typeof(i==null?void 0:i.headers)=="function"?i.headers():(u=i==null?void 0:i.headers)!=null?u:{};try{let A=yield fetch(s,{method:"POST",headers:a$3({"Content-Type":"application/json"},C),credentials:(N=i==null?void 0:i.credentials)!=null?N:"same-origin",body:JSON.stringify(n)});if(!A.ok)f==null||f({response:A});else if(R){let v;try{let D=yield A.clone().text();D&&(v=JSON.parse(D));}catch(D){}R({response:A,data:n,body:v});}}catch(A){f==null||f({error:A});}}else o&&o.save(n);a$1(n);}),t=(e=r==null?void 0:r.description)!=null?e:c;return jsx(a,{categories:p,onSubmit:d$1,classNames:P,unstyled:h,title:r==null?void 0:r.title,description:t,submitButtonText:r==null?void 0:r.submitButton})};var j=[{id:"project_overview",title:"Project Overview",description:"Provide basic details about the processing activity being assessed.",order:0,questions:[{id:"project_name",text:"What is the name of the project or processing activity?",type:"text",required:true},{id:"project_description",text:"Describe the nature and purpose of the processing.",guidance:"Include what personal data will be collected, why it is needed, and how it will be used.",type:"textarea",required:true},{id:"data_controller",text:"Who is the data controller responsible for this processing?",type:"text",required:true}]},{id:"necessity",title:"Necessity & Proportionality",description:"Assess whether the processing is necessary and proportionate to the purposes.",order:1,questions:[{id:"lawful_basis",text:"What is the lawful basis for processing under the NDPA 2023?",type:"select",required:true,options:[{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_task",label:"Public Task (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}]},{id:"data_minimisation",text:"Is the processing limited to what is necessary for the specified purpose?",type:"radio",required:true,options:[{value:"yes",label:"Yes \u2014 only minimum data is collected",riskLevel:"low"},{value:"partial",label:"Partially \u2014 some additional data may be collected",riskLevel:"medium"},{value:"no",label:"No \u2014 more data is collected than strictly necessary",riskLevel:"high"}]}]},{id:"risk_identification",title:"Risk Identification",description:"Identify and assess risks to data subjects arising from the processing.",order:2,questions:[{id:"sensitive_data",text:"Does the processing involve sensitive personal data (e.g., health, biometric, financial, children's data)?",type:"radio",required:true,options:[{value:"no",label:"No sensitive data",riskLevel:"low"},{value:"yes_protected",label:"Yes, with appropriate safeguards",riskLevel:"medium"},{value:"yes_unprotected",label:"Yes, without adequate safeguards",riskLevel:"high"}]},{id:"scale",text:"What is the scale of processing?",type:"radio",required:true,options:[{value:"small",label:"Small scale (fewer than 1,000 individuals)",riskLevel:"low"},{value:"medium",label:"Medium scale (1,000 to 100,000 individuals)",riskLevel:"medium"},{value:"large",label:"Large scale (over 100,000 individuals)",riskLevel:"high"}]},{id:"cross_border",text:"Will data be transferred outside Nigeria?",type:"radio",required:true,options:[{value:"no",label:"No international transfers",riskLevel:"low"},{value:"adequate",label:"Yes, to countries with adequate protection",riskLevel:"medium"},{value:"inadequate",label:"Yes, to countries without adequate protection",riskLevel:"high"}]}]},{id:"mitigation",title:"Risk Mitigation & Measures",description:"Document the measures taken to address identified risks.",order:3,questions:[{id:"security_measures",text:"What technical and organisational security measures are in place?",guidance:"Include encryption, access controls, pseudonymisation, staff training, etc.",type:"textarea",required:true},{id:"retention_period",text:"What is the data retention period?",guidance:"Specify how long data will be kept and the criteria used to determine this.",type:"text",required:true},{id:"dpo_consulted",text:"Has the Data Protection Officer (DPO) been consulted on this assessment?",type:"radio",required:false,options:[{value:"yes",label:"Yes",riskLevel:"low"},{value:"no",label:"No",riskLevel:"medium"},{value:"na",label:"Not applicable \u2014 no DPO appointed",riskLevel:"medium"}]}]}];function J(p,o){let P=[],h=s=>{let i=o[s.id];if(i!=null&&s.riskLevel)if(["select","radio","checkbox"].includes(s.type)&&s.options)(Array.isArray(i)?i:[i]).forEach(R=>{var t;let d=(t=s.options)==null?void 0:t.find(e=>e.value===R);if(d!=null&&d.riskLevel){let e=d.riskLevel,n=e==="low"?1:e==="medium"?3:5,u=e==="low"?1:e==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:`${s.text} - ${d.label}`,likelihood:n,impact:u,score:n*u,level:e,mitigated:false,relatedQuestionIds:[s.id]});}});else {let f=s.riskLevel,R=f==="low"?1:f==="medium"?3:5,d=f==="low"?1:f==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:s.text,likelihood:R,impact:d,score:R*d,level:f,mitigated:false,relatedQuestionIds:[s.id]});}};p.forEach(s=>s.questions.forEach(h));let a=Date.now(),r={id:`dpia_${a}`,title:"",processingDescription:"",startedAt:a,completedAt:a,assessor:{name:"",role:"",email:""},answers:o,risks:P,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},c=a$8(r);return r.overallRiskLevel=c.overallRiskLevel,r.canProceed=c.canProceed,r.conclusion=c.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",r.recommendations=c.recommendations,r}var V=({sections:p=j,adapter:o,classNames:P,unstyled:h,onResult:a,copy:r,submitTo:c,submitOptions:s,onSubmitError:i,onSubmitSuccess:f})=>{let[R,d$1]=useState({}),[t,e]=useState(0),n=(v,D)=>{d$1(w=>b(a$3({},w),{[v]:D}));},u=v=>d(null,null,function*(){var D,w;if(c){let q=typeof(s==null?void 0:s.headers)=="function"?s.headers():(D=s==null?void 0:s.headers)!=null?D:{};try{let y=yield fetch(c,{method:"POST",headers:a$3({"Content-Type":"application/json"},q),credentials:(w=s==null?void 0:s.credentials)!=null?w:"same-origin",body:JSON.stringify(v)});if(!y.ok)i==null||i({response:y});else if(f){let x;try{let B=yield y.clone().text();B&&(x=JSON.parse(B));}catch(B){}f({response:y,data:v,body:x});}}catch(y){i==null||i({error:y});}}else o&&o.save(v);a==null||a(J(p,v));}),N=()=>{t<p.length-1?e(v=>v+1):u(R);},C=()=>{t>0&&e(v=>v-1);},A=Math.round((t+1)/p.length*100);return jsx(a$1,{sections:p,answers:R,onAnswerChange:n,currentSectionIndex:t,onNextSection:N,onPrevSection:C,progress:A,classNames:P,unstyled:h,submitButtonText:r==null?void 0:r.submitButton,nextButtonText:r==null?void 0:r.nextButton,prevButtonText:r==null?void 0:r.prevButton})};var X=({initialData:p,adapter:o,classNames:P,unstyled:h,copy:a})=>{let r=p!=null?p:[],[c,s]=useState(()=>{if(o){let t=o.load();if(t&&!(t instanceof Promise))return t}return r});useEffect(()=>{if(!o)return;let t=false;return d(null,null,function*(){try{let e=yield o.load();!t&&e&&s(e);}catch(e){}}),()=>{t=true;}},[o]);let i=t=>{o&&o.save(t);};return jsx(a$2,{activities:c,onAdd:t=>{let e=Date.now(),n=b(a$3({},t),{id:`activity-${e}`,createdAt:e,updatedAt:e}),u=[...c,n];s(u),i(u);},onUpdate:(t,e)=>{let n=c.map(u=>u.id===t?b(a$3(a$3({},u),e),{updatedAt:Date.now()}):u);s(n),i(n);},onArchive:t=>{let e=c.map(n=>n.id===t?b(a$3({},n),{status:"inactive",updatedAt:Date.now()}):n);s(e),i(e);},classNames:P,unstyled:h,title:a==null?void 0:a.title,description:a==null?void 0:a.description})};var te=({initialData:p,adapter:o,classNames:P,unstyled:h,copy:a})=>{let r=p!=null?p:[],[c,s]=useState(()=>{if(o){let t=o.load();if(t&&!(t instanceof Promise))return t}return r});useEffect(()=>{if(!o)return;let t=false;return d(null,null,function*(){try{let e=yield o.load();!t&&e&&s(e);}catch(e){}}),()=>{t=true;}},[o]);let i=t=>{o&&o.save(t);};return jsx(a$4,{transfers:c,onAdd:t=>{let e=Date.now(),n=b(a$3({},t),{id:`transfer-${e}`,createdAt:e,updatedAt:e}),u=[...c,n];s(u),i(u);},onUpdate:(t,e)=>{let n=c.map(u=>u.id===t?b(a$3(a$3({},u),e),{updatedAt:Date.now()}):u);s(n),i(n);},onArchive:t=>{let e=c.filter(n=>n.id!==t);s(e),i(e);},classNames:P,unstyled:h,title:a==null?void 0:a.title,description:a==null?void 0:a.description})};var ae={id:"ndpr-ropa-default",organizationName:"Your Organisation",organizationContact:"",organizationAddress:"",records:[],lastUpdated:Date.now(),version:"1.0"},ie=({initialData:p,adapter:o,classNames:P,unstyled:h,copy:a})=>{let[r,c]=useState(p!=null?p:ae);useEffect(()=>{if(!o)return;let d$1=false;return d(null,null,function*(){let e=yield o.load();!d$1&&e&&c(e);}),()=>{d$1=true;}},[o]);let s=d=>{o&&o.save(d);};return jsx(a$5,{ropa:r,onAdd:d=>{let t=b(a$3({},r),{records:[...r.records,d],lastUpdated:Date.now()});c(t),s(t);},onUpdate:(d,t)=>{let e=b(a$3({},r),{records:r.records.map(n=>n.id===d?b(a$3(a$3({},n),t),{updatedAt:Date.now()}):n),lastUpdated:Date.now()});c(e),s(e);},onArchive:d=>{let t=b(a$3({},r),{records:r.records.map(e=>e.id===d?b(a$3({},e),{status:"archived",updatedAt:Date.now()}):e),lastUpdated:Date.now()});c(t),s(t);},classNames:P,unstyled:h,title:a==null?void 0:a.title,description:a==null?void 0:a.description})};var de=P=>{var h=P,{input:p}=h,o=c(h,["input"]);let a=a$6(p);return jsx(a$7,a$3({report:a},o))};export{Y as NDPRBreachReport,de as NDPRComplianceDashboard,te as NDPRCrossBorder,V as NDPRDPIA,X as NDPRLawfulBasis,ie as NDPRROPA};
|
|
2
|
+
export{a as NDPRConsent}from'./chunk-2T5MY2Q6.mjs';export{a as NDPRSubjectRights}from'./chunk-RNV6D6MV.mjs';export{a as NDPRPrivacyPolicy}from'./chunk-7FCI5BPU.mjs';import'./chunk-EH73TDZL.mjs';import {a as a$7}from'./chunk-AVV47UX7.mjs';import {a}from'./chunk-YSCHSH6V.mjs';import {a as a$2}from'./chunk-RW7V7DDR.mjs';import {a as a$4}from'./chunk-7E5A7YVH.mjs';import {a as a$5}from'./chunk-2ASQQYJR.mjs';import'./chunk-4QQJEO3F.mjs';import'./chunk-7LGOY2A3.mjs';import'./chunk-DHRFX6AY.mjs';import {a as a$6}from'./chunk-6A7M4CGJ.mjs';import'./chunk-WJSUVPYX.mjs';import'./chunk-3ELNTFUX.mjs';import'./chunk-K5WLRGDN.mjs';import'./chunk-LWIKDDSU.mjs';import'./chunk-XP5PL6K7.mjs';import'./chunk-PYSYBUIV.mjs';import'./chunk-QNXLY5EJ.mjs';import'./chunk-ZY4RCV5C.mjs';import'./chunk-OMACLDXI.mjs';import'./chunk-EWVK45Z3.mjs';import {a as a$1}from'./chunk-YZHEEGGK.mjs';import {a as a$8}from'./chunk-LRRENTT5.mjs';import'./chunk-ITCY2Z66.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-PHA3YMFO.mjs';import'./chunk-5LJ652AH.mjs';import'./chunk-DBZSN4WP.mjs';import {d,b,a as a$3,c}from'./chunk-ZJYULEER.mjs';import {jsx}from'react/jsx-runtime';import {useState,useEffect}from'react';var W=[{id:"unauthorized_access",name:"Unauthorized Access",description:"Unauthorized access to personal data",defaultSeverity:"high"},{id:"data_loss",name:"Data Loss",description:"Loss of personal data",defaultSeverity:"high"},{id:"data_theft",name:"Data Theft",description:"Theft of personal data",defaultSeverity:"critical"},{id:"system_breach",name:"System Breach",description:"Breach of system containing personal data",defaultSeverity:"critical"},{id:"accidental_disclosure",name:"Accidental Disclosure",description:"Unintended disclosure of personal data",defaultSeverity:"medium"}],Y=({categories:p=W,adapter:o,classNames:P,unstyled:h,onSubmit:a$1=()=>{},copy:r,description:c,submitTo:s,submitOptions:i,onSubmitError:f,onSubmitSuccess:R})=>{var e;let d$1=n=>d(null,null,function*(){var u,N;if(s){let C=typeof(i==null?void 0:i.headers)=="function"?i.headers():(u=i==null?void 0:i.headers)!=null?u:{};try{let A=yield fetch(s,{method:"POST",headers:a$3({"Content-Type":"application/json"},C),credentials:(N=i==null?void 0:i.credentials)!=null?N:"same-origin",body:JSON.stringify(n)});if(!A.ok)f==null||f({response:A});else if(R){let v;try{let D=yield A.clone().text();D&&(v=JSON.parse(D));}catch(D){}R({response:A,data:n,body:v});}}catch(A){f==null||f({error:A});}}else o&&o.save(n);a$1(n);}),t=(e=r==null?void 0:r.description)!=null?e:c;return jsx(a,{categories:p,onSubmit:d$1,classNames:P,unstyled:h,title:r==null?void 0:r.title,description:t,submitButtonText:r==null?void 0:r.submitButton})};var j=[{id:"project_overview",title:"Project Overview",description:"Provide basic details about the processing activity being assessed.",order:0,questions:[{id:"project_name",text:"What is the name of the project or processing activity?",type:"text",required:true},{id:"project_description",text:"Describe the nature and purpose of the processing.",guidance:"Include what personal data will be collected, why it is needed, and how it will be used.",type:"textarea",required:true},{id:"data_controller",text:"Who is the data controller responsible for this processing?",type:"text",required:true}]},{id:"necessity",title:"Necessity & Proportionality",description:"Assess whether the processing is necessary and proportionate to the purposes.",order:1,questions:[{id:"lawful_basis",text:"What is the lawful basis for processing under the NDPA 2023?",type:"select",required:true,options:[{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_task",label:"Public Task (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}]},{id:"data_minimisation",text:"Is the processing limited to what is necessary for the specified purpose?",type:"radio",required:true,options:[{value:"yes",label:"Yes \u2014 only minimum data is collected",riskLevel:"low"},{value:"partial",label:"Partially \u2014 some additional data may be collected",riskLevel:"medium"},{value:"no",label:"No \u2014 more data is collected than strictly necessary",riskLevel:"high"}]}]},{id:"risk_identification",title:"Risk Identification",description:"Identify and assess risks to data subjects arising from the processing.",order:2,questions:[{id:"sensitive_data",text:"Does the processing involve sensitive personal data (e.g., health, biometric, financial, children's data)?",type:"radio",required:true,options:[{value:"no",label:"No sensitive data",riskLevel:"low"},{value:"yes_protected",label:"Yes, with appropriate safeguards",riskLevel:"medium"},{value:"yes_unprotected",label:"Yes, without adequate safeguards",riskLevel:"high"}]},{id:"scale",text:"What is the scale of processing?",type:"radio",required:true,options:[{value:"small",label:"Small scale (fewer than 1,000 individuals)",riskLevel:"low"},{value:"medium",label:"Medium scale (1,000 to 100,000 individuals)",riskLevel:"medium"},{value:"large",label:"Large scale (over 100,000 individuals)",riskLevel:"high"}]},{id:"cross_border",text:"Will data be transferred outside Nigeria?",type:"radio",required:true,options:[{value:"no",label:"No international transfers",riskLevel:"low"},{value:"adequate",label:"Yes, to countries with adequate protection",riskLevel:"medium"},{value:"inadequate",label:"Yes, to countries without adequate protection",riskLevel:"high"}]}]},{id:"mitigation",title:"Risk Mitigation & Measures",description:"Document the measures taken to address identified risks.",order:3,questions:[{id:"security_measures",text:"What technical and organisational security measures are in place?",guidance:"Include encryption, access controls, pseudonymisation, staff training, etc.",type:"textarea",required:true},{id:"retention_period",text:"What is the data retention period?",guidance:"Specify how long data will be kept and the criteria used to determine this.",type:"text",required:true},{id:"dpo_consulted",text:"Has the Data Protection Officer (DPO) been consulted on this assessment?",type:"radio",required:false,options:[{value:"yes",label:"Yes",riskLevel:"low"},{value:"no",label:"No",riskLevel:"medium"},{value:"na",label:"Not applicable \u2014 no DPO appointed",riskLevel:"medium"}]}]}];function J(p,o){let P=[],h=s=>{let i=o[s.id];if(i!=null&&s.riskLevel)if(["select","radio","checkbox"].includes(s.type)&&s.options)(Array.isArray(i)?i:[i]).forEach(R=>{var t;let d=(t=s.options)==null?void 0:t.find(e=>e.value===R);if(d!=null&&d.riskLevel){let e=d.riskLevel,n=e==="low"?1:e==="medium"?3:5,u=e==="low"?1:e==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:`${s.text} - ${d.label}`,likelihood:n,impact:u,score:n*u,level:e,mitigated:false,relatedQuestionIds:[s.id]});}});else {let f=s.riskLevel,R=f==="low"?1:f==="medium"?3:5,d=f==="low"?1:f==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:s.text,likelihood:R,impact:d,score:R*d,level:f,mitigated:false,relatedQuestionIds:[s.id]});}};p.forEach(s=>s.questions.forEach(h));let a=Date.now(),r={id:`dpia_${a}`,title:"",processingDescription:"",startedAt:a,completedAt:a,assessor:{name:"",role:"",email:""},answers:o,risks:P,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},c=a$8(r);return r.overallRiskLevel=c.overallRiskLevel,r.canProceed=c.canProceed,r.conclusion=c.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",r.recommendations=c.recommendations,r}var V=({sections:p=j,adapter:o,classNames:P,unstyled:h,onResult:a,copy:r,submitTo:c,submitOptions:s,onSubmitError:i,onSubmitSuccess:f})=>{let[R,d$1]=useState({}),[t,e]=useState(0),n=(v,D)=>{d$1(w=>b(a$3({},w),{[v]:D}));},u=v=>d(null,null,function*(){var D,w;if(c){let q=typeof(s==null?void 0:s.headers)=="function"?s.headers():(D=s==null?void 0:s.headers)!=null?D:{};try{let y=yield fetch(c,{method:"POST",headers:a$3({"Content-Type":"application/json"},q),credentials:(w=s==null?void 0:s.credentials)!=null?w:"same-origin",body:JSON.stringify(v)});if(!y.ok)i==null||i({response:y});else if(f){let x;try{let B=yield y.clone().text();B&&(x=JSON.parse(B));}catch(B){}f({response:y,data:v,body:x});}}catch(y){i==null||i({error:y});}}else o&&o.save(v);a==null||a(J(p,v));}),N=()=>{t<p.length-1?e(v=>v+1):u(R);},C=()=>{t>0&&e(v=>v-1);},A=Math.round((t+1)/p.length*100);return jsx(a$1,{sections:p,answers:R,onAnswerChange:n,currentSectionIndex:t,onNextSection:N,onPrevSection:C,progress:A,classNames:P,unstyled:h,submitButtonText:r==null?void 0:r.submitButton,nextButtonText:r==null?void 0:r.nextButton,prevButtonText:r==null?void 0:r.prevButton})};var X=({initialData:p,adapter:o,classNames:P,unstyled:h,copy:a})=>{let r=p!=null?p:[],[c,s]=useState(()=>{if(o){let t=o.load();if(t&&!(t instanceof Promise))return t}return r});useEffect(()=>{if(!o)return;let t=false;return d(null,null,function*(){try{let e=yield o.load();!t&&e&&s(e);}catch(e){}}),()=>{t=true;}},[o]);let i=t=>{o&&o.save(t);};return jsx(a$2,{activities:c,onAdd:t=>{let e=Date.now(),n=b(a$3({},t),{id:`activity-${e}`,createdAt:e,updatedAt:e}),u=[...c,n];s(u),i(u);},onUpdate:(t,e)=>{let n=c.map(u=>u.id===t?b(a$3(a$3({},u),e),{updatedAt:Date.now()}):u);s(n),i(n);},onArchive:t=>{let e=c.map(n=>n.id===t?b(a$3({},n),{status:"inactive",updatedAt:Date.now()}):n);s(e),i(e);},classNames:P,unstyled:h,title:a==null?void 0:a.title,description:a==null?void 0:a.description})};var te=({initialData:p,adapter:o,classNames:P,unstyled:h,copy:a})=>{let r=p!=null?p:[],[c,s]=useState(()=>{if(o){let t=o.load();if(t&&!(t instanceof Promise))return t}return r});useEffect(()=>{if(!o)return;let t=false;return d(null,null,function*(){try{let e=yield o.load();!t&&e&&s(e);}catch(e){}}),()=>{t=true;}},[o]);let i=t=>{o&&o.save(t);};return jsx(a$4,{transfers:c,onAdd:t=>{let e=Date.now(),n=b(a$3({},t),{id:`transfer-${e}`,createdAt:e,updatedAt:e}),u=[...c,n];s(u),i(u);},onUpdate:(t,e)=>{let n=c.map(u=>u.id===t?b(a$3(a$3({},u),e),{updatedAt:Date.now()}):u);s(n),i(n);},onArchive:t=>{let e=c.filter(n=>n.id!==t);s(e),i(e);},classNames:P,unstyled:h,title:a==null?void 0:a.title,description:a==null?void 0:a.description})};var ae={id:"ndpr-ropa-default",organizationName:"Your Organisation",organizationContact:"",organizationAddress:"",records:[],lastUpdated:Date.now(),version:"1.0"},ie=({initialData:p,adapter:o,classNames:P,unstyled:h,copy:a})=>{let[r,c]=useState(p!=null?p:ae);useEffect(()=>{if(!o)return;let d$1=false;return d(null,null,function*(){let e=yield o.load();!d$1&&e&&c(e);}),()=>{d$1=true;}},[o]);let s=d=>{o&&o.save(d);};return jsx(a$5,{ropa:r,onAdd:d=>{let t=b(a$3({},r),{records:[...r.records,d],lastUpdated:Date.now()});c(t),s(t);},onUpdate:(d,t)=>{let e=b(a$3({},r),{records:r.records.map(n=>n.id===d?b(a$3(a$3({},n),t),{updatedAt:Date.now()}):n),lastUpdated:Date.now()});c(e),s(e);},onArchive:d=>{let t=b(a$3({},r),{records:r.records.map(e=>e.id===d?b(a$3({},e),{status:"archived",updatedAt:Date.now()}):e),lastUpdated:Date.now()});c(t),s(t);},classNames:P,unstyled:h,title:a==null?void 0:a.title,description:a==null?void 0:a.description})};var de=P=>{var h=P,{input:p}=h,o=c(h,["input"]);let a=a$6(p);return jsx(a$7,a$3({report:a},o))};export{Y as NDPRBreachReport,de as NDPRComplianceDashboard,te as NDPRCrossBorder,V as NDPRDPIA,X as NDPRLawfulBasis,ie as NDPRROPA};
|
package/dist/server.d.mts
CHANGED
|
@@ -762,7 +762,7 @@ export declare interface ConsentStorageOptions {
|
|
|
762
762
|
path?: string;
|
|
763
763
|
/**
|
|
764
764
|
* Expiration days for the cookie
|
|
765
|
-
* @default
|
|
765
|
+
* @default 180
|
|
766
766
|
*/
|
|
767
767
|
expires?: number;
|
|
768
768
|
/**
|
|
@@ -1665,10 +1665,20 @@ export declare type Industry = 'fintech' | 'healthcare' | 'ecommerce' | 'saas' |
|
|
|
1665
1665
|
|
|
1666
1666
|
/**
|
|
1667
1667
|
* Returns whether NDPC approval is required for a given transfer mechanism.
|
|
1668
|
-
*
|
|
1669
|
-
*
|
|
1670
|
-
*
|
|
1671
|
-
*
|
|
1668
|
+
*
|
|
1669
|
+
* Standard contractual clauses do NOT require NDPC pre-approval. NDPA Section
|
|
1670
|
+
* 41(1)(a) permits transfer where the recipient is subject to contractual clauses
|
|
1671
|
+
* affording an adequate level of protection, with only a duty to record the basis
|
|
1672
|
+
* and adequacy of protection (Section 41(2)). The Commission "may" determine the
|
|
1673
|
+
* adequacy of standard contractual clauses (Section 42(4)) and "may" approve
|
|
1674
|
+
* instruments proposed to it (Section 42(5)) — permissive avenues, not
|
|
1675
|
+
* preconditions. Per Section 42(6), the absence of a Commission determination
|
|
1676
|
+
* does not imply adequacy, so unapproved clauses must be self-assessed against
|
|
1677
|
+
* Section 42(1)–(2); validateTransfer surfaces this as a warning.
|
|
1678
|
+
*
|
|
1679
|
+
* Binding corporate rules are group instruments typically submitted for approval
|
|
1680
|
+
* under Section 42(5), and an 'ndpc_authorization' is by definition a Section
|
|
1681
|
+
* 42(5)-approved instrument.
|
|
1672
1682
|
*
|
|
1673
1683
|
* @param mechanism The transfer mechanism
|
|
1674
1684
|
* @returns Whether NDPC approval is typically required
|
package/dist/server.d.ts
CHANGED
|
@@ -762,7 +762,7 @@ export declare interface ConsentStorageOptions {
|
|
|
762
762
|
path?: string;
|
|
763
763
|
/**
|
|
764
764
|
* Expiration days for the cookie
|
|
765
|
-
* @default
|
|
765
|
+
* @default 180
|
|
766
766
|
*/
|
|
767
767
|
expires?: number;
|
|
768
768
|
/**
|
|
@@ -1665,10 +1665,20 @@ export declare type Industry = 'fintech' | 'healthcare' | 'ecommerce' | 'saas' |
|
|
|
1665
1665
|
|
|
1666
1666
|
/**
|
|
1667
1667
|
* Returns whether NDPC approval is required for a given transfer mechanism.
|
|
1668
|
-
*
|
|
1669
|
-
*
|
|
1670
|
-
*
|
|
1671
|
-
*
|
|
1668
|
+
*
|
|
1669
|
+
* Standard contractual clauses do NOT require NDPC pre-approval. NDPA Section
|
|
1670
|
+
* 41(1)(a) permits transfer where the recipient is subject to contractual clauses
|
|
1671
|
+
* affording an adequate level of protection, with only a duty to record the basis
|
|
1672
|
+
* and adequacy of protection (Section 41(2)). The Commission "may" determine the
|
|
1673
|
+
* adequacy of standard contractual clauses (Section 42(4)) and "may" approve
|
|
1674
|
+
* instruments proposed to it (Section 42(5)) — permissive avenues, not
|
|
1675
|
+
* preconditions. Per Section 42(6), the absence of a Commission determination
|
|
1676
|
+
* does not imply adequacy, so unapproved clauses must be self-assessed against
|
|
1677
|
+
* Section 42(1)–(2); validateTransfer surfaces this as a warning.
|
|
1678
|
+
*
|
|
1679
|
+
* Binding corporate rules are group instruments typically submitted for approval
|
|
1680
|
+
* under Section 42(5), and an 'ndpc_authorization' is by definition a Section
|
|
1681
|
+
* 42(5)-approved instrument.
|
|
1672
1682
|
*
|
|
1673
1683
|
* @param mechanism The transfer mechanism
|
|
1674
1684
|
* @returns Whether NDPC approval is typically required
|
package/dist/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkPYM5Z3SB_js=require('./chunk-PYM5Z3SB.js'),chunkLP5KXMBY_js=require('./chunk-LP5KXMBY.js'),chunk6GG3XWI6_js=require('./chunk-6GG3XWI6.js'),
|
|
1
|
+
'use strict';var chunkPYM5Z3SB_js=require('./chunk-PYM5Z3SB.js'),chunkLP5KXMBY_js=require('./chunk-LP5KXMBY.js'),chunk6GG3XWI6_js=require('./chunk-6GG3XWI6.js'),chunkISCFIAKJ_js=require('./chunk-ISCFIAKJ.js'),chunkXNCCIRT6_js=require('./chunk-XNCCIRT6.js'),chunkVFRGCBJY_js=require('./chunk-VFRGCBJY.js'),chunk7TTXS7JX_js=require('./chunk-7TTXS7JX.js'),chunk3YTAOT5O_js=require('./chunk-3YTAOT5O.js'),chunkY346CURW_js=require('./chunk-Y346CURW.js'),chunkF54TBNVF_js=require('./chunk-F54TBNVF.js'),chunkCIEWD57T_js=require('./chunk-CIEWD57T.js'),chunkUSD363RW_js=require('./chunk-USD363RW.js'),chunkWZYCBW2R_js=require('./chunk-WZYCBW2R.js'),chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunk3IA3KDII_js=require('./chunk-3IA3KDII.js'),chunkC2KEXHRX_js=require('./chunk-C2KEXHRX.js'),chunkLP3R2BBL_js=require('./chunk-LP3R2BBL.js'),chunkPEUAA5EC_js=require('./chunk-PEUAA5EC.js'),chunkUXUMYP4L_js=require('./chunk-UXUMYP4L.js'),chunkR2ZZMATR_js=require('./chunk-R2ZZMATR.js'),chunkTQZWJGJ2_js=require('./chunk-TQZWJGJ2.js'),chunkZVOIR4QH_js=require('./chunk-ZVOIR4QH.js'),chunk7563FVMY_js=require('./chunk-7563FVMY.js'),chunkVWED6UTN_js=require('./chunk-VWED6UTN.js');require('./chunk-RFPLZDIO.js');Object.defineProperty(exports,"apiAdapter",{enumerable:true,get:function(){return chunkPYM5Z3SB_js.a}});Object.defineProperty(exports,"composeAdapters",{enumerable:true,get:function(){return chunkPYM5Z3SB_js.c}});Object.defineProperty(exports,"memoryAdapter",{enumerable:true,get:function(){return chunkPYM5Z3SB_js.b}});Object.defineProperty(exports,"arabicLocale",{enumerable:true,get:function(){return chunkLP5KXMBY_js.e}});Object.defineProperty(exports,"frenchLocale",{enumerable:true,get:function(){return chunkLP5KXMBY_js.f}});Object.defineProperty(exports,"hausaLocale",{enumerable:true,get:function(){return chunkLP5KXMBY_js.c}});Object.defineProperty(exports,"igboLocale",{enumerable:true,get:function(){return chunkLP5KXMBY_js.b}});Object.defineProperty(exports,"pidginLocale",{enumerable:true,get:function(){return chunkLP5KXMBY_js.d}});Object.defineProperty(exports,"yorubaLocale",{enumerable:true,get:function(){return chunkLP5KXMBY_js.a}});Object.defineProperty(exports,"ORG_POLICY_TEMPLATE_REGISTRY",{enumerable:true,get:function(){return chunk6GG3XWI6_js.a}});Object.defineProperty(exports,"createOrgTemplate",{enumerable:true,get:function(){return chunk6GG3XWI6_js.b}});Object.defineProperty(exports,"templateContextFor",{enumerable:true,get:function(){return chunk6GG3XWI6_js.b}});Object.defineProperty(exports,"formatNdprAuditReport",{enumerable:true,get:function(){return chunkISCFIAKJ_js.b}});Object.defineProperty(exports,"runNdprAudit",{enumerable:true,get:function(){return chunkISCFIAKJ_js.a}});Object.defineProperty(exports,"exportDOCX",{enumerable:true,get:function(){return chunkXNCCIRT6_js.d}});Object.defineProperty(exports,"exportHTML",{enumerable:true,get:function(){return chunkXNCCIRT6_js.a}});Object.defineProperty(exports,"exportMarkdown",{enumerable:true,get:function(){return chunkXNCCIRT6_js.b}});Object.defineProperty(exports,"exportPDF",{enumerable:true,get:function(){return chunkXNCCIRT6_js.c}});Object.defineProperty(exports,"classifyDCPMI",{enumerable:true,get:function(){return chunkVFRGCBJY_js.c}});Object.defineProperty(exports,"generateComplianceAuditReturn",{enumerable:true,get:function(){return chunkVFRGCBJY_js.d}});Object.defineProperty(exports,"getComplianceScore",{enumerable:true,get:function(){return chunk7TTXS7JX_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunk3YTAOT5O_js.a}});Object.defineProperty(exports,"assessBreachNotification",{enumerable:true,get:function(){return chunkY346CURW_js.a}});Object.defineProperty(exports,"DEFAULT_POLICY_SECTIONS",{enumerable:true,get:function(){return chunkF54TBNVF_js.c}});Object.defineProperty(exports,"DEFAULT_POLICY_VARIABLES",{enumerable:true,get:function(){return chunkF54TBNVF_js.d}});Object.defineProperty(exports,"createBusinessPolicyTemplate",{enumerable:true,get:function(){return chunkF54TBNVF_js.e}});Object.defineProperty(exports,"findUnfilledTokens",{enumerable:true,get:function(){return chunkF54TBNVF_js.a}});Object.defineProperty(exports,"generatePolicyText",{enumerable:true,get:function(){return chunkF54TBNVF_js.b}});Object.defineProperty(exports,"DEFAULT_DATA_CATEGORIES",{enumerable:true,get:function(){return chunkCIEWD57T_js.d}});Object.defineProperty(exports,"UNFILLED_PREFIX",{enumerable:true,get:function(){return chunkCIEWD57T_js.a}});Object.defineProperty(exports,"UNFILLED_SUFFIX",{enumerable:true,get:function(){return chunkCIEWD57T_js.b}});Object.defineProperty(exports,"assemblePolicy",{enumerable:true,get:function(){return chunkCIEWD57T_js.c}});Object.defineProperty(exports,"createDefaultContext",{enumerable:true,get:function(){return chunkCIEWD57T_js.e}});Object.defineProperty(exports,"evaluatePolicyCompliance",{enumerable:true,get:function(){return chunkCIEWD57T_js.f}});Object.defineProperty(exports,"assessTransferRisk",{enumerable:true,get:function(){return chunkUSD363RW_js.i}});Object.defineProperty(exports,"getTransferMechanismDescription",{enumerable:true,get:function(){return chunkUSD363RW_js.g}});Object.defineProperty(exports,"isNDPCApprovalRequired",{enumerable:true,get:function(){return chunkUSD363RW_js.f}});Object.defineProperty(exports,"validateTransfer",{enumerable:true,get:function(){return chunkUSD363RW_js.h}});Object.defineProperty(exports,"assessComplianceGaps",{enumerable:true,get:function(){return chunkWZYCBW2R_js.c}});Object.defineProperty(exports,"generateLawfulBasisSummary",{enumerable:true,get:function(){return chunkWZYCBW2R_js.d}});Object.defineProperty(exports,"getLawfulBasisDescription",{enumerable:true,get:function(){return chunkWZYCBW2R_js.b}});Object.defineProperty(exports,"validateProcessingActivity",{enumerable:true,get:function(){return chunkWZYCBW2R_js.a}});Object.defineProperty(exports,"exportROPAToCSV",{enumerable:true,get:function(){return chunk4CVBQC66_js.c}});Object.defineProperty(exports,"generateROPASummary",{enumerable:true,get:function(){return chunk4CVBQC66_js.b}});Object.defineProperty(exports,"identifyComplianceGaps",{enumerable:true,get:function(){return chunk4CVBQC66_js.d}});Object.defineProperty(exports,"validateProcessingRecord",{enumerable:true,get:function(){return chunk4CVBQC66_js.a}});Object.defineProperty(exports,"appendAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.c}});Object.defineProperty(exports,"createAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.a}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunk3IA3KDII_js.b}});Object.defineProperty(exports,"cookieAdapter",{enumerable:true,get:function(){return chunkC2KEXHRX_js.b}});Object.defineProperty(exports,"sessionStorageAdapter",{enumerable:true,get:function(){return chunkC2KEXHRX_js.a}});Object.defineProperty(exports,"validateConsentOptionsStructured",{enumerable:true,get:function(){return chunkLP3R2BBL_js.b}});Object.defineProperty(exports,"validateConsentStructured",{enumerable:true,get:function(){return chunkLP3R2BBL_js.a}});Object.defineProperty(exports,"KNOWN_COOKIES",{enumerable:true,get:function(){return chunkPEUAA5EC_js.a}});Object.defineProperty(exports,"scanCookies",{enumerable:true,get:function(){return chunkPEUAA5EC_js.b}});Object.defineProperty(exports,"sanitizeInput",{enumerable:true,get:function(){return chunkUXUMYP4L_js.a}});Object.defineProperty(exports,"formatDSRRequestStructured",{enumerable:true,get:function(){return chunkR2ZZMATR_js.b}});Object.defineProperty(exports,"validateDsrSubmissionStructured",{enumerable:true,get:function(){return chunkR2ZZMATR_js.a}});Object.defineProperty(exports,"assessDPIARisk",{enumerable:true,get:function(){return chunkTQZWJGJ2_js.a}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_LONG",{enumerable:true,get:function(){return chunkZVOIR4QH_js.b}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_SHORT",{enumerable:true,get:function(){return chunkZVOIR4QH_js.a}});Object.defineProperty(exports,"legalDisclaimerBlock",{enumerable:true,get:function(){return chunkZVOIR4QH_js.c}});Object.defineProperty(exports,"defaultLocale",{enumerable:true,get:function(){return chunk7563FVMY_js.a}});Object.defineProperty(exports,"mergeLocale",{enumerable:true,get:function(){return chunk7563FVMY_js.b}});Object.defineProperty(exports,"localStorageAdapter",{enumerable:true,get:function(){return chunkVWED6UTN_js.a}});
|
package/dist/server.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as apiAdapter,c as composeAdapters,b as memoryAdapter}from'./chunk-F3YIUWR3.mjs';export{e as arabicLocale,f as frenchLocale,c as hausaLocale,b as igboLocale,d as pidginLocale,a as yorubaLocale}from'./chunk-KUI5W44P.mjs';export{a as ORG_POLICY_TEMPLATE_REGISTRY,b as createOrgTemplate,b as templateContextFor}from'./chunk-4QQJEO3F.mjs';export{b as formatNdprAuditReport,a as runNdprAudit}from'./chunk-
|
|
1
|
+
export{a as apiAdapter,c as composeAdapters,b as memoryAdapter}from'./chunk-F3YIUWR3.mjs';export{e as arabicLocale,f as frenchLocale,c as hausaLocale,b as igboLocale,d as pidginLocale,a as yorubaLocale}from'./chunk-KUI5W44P.mjs';export{a as ORG_POLICY_TEMPLATE_REGISTRY,b as createOrgTemplate,b as templateContextFor}from'./chunk-4QQJEO3F.mjs';export{b as formatNdprAuditReport,a as runNdprAudit}from'./chunk-L5Z77INN.mjs';export{d as exportDOCX,a as exportHTML,b as exportMarkdown,c as exportPDF}from'./chunk-DHRFX6AY.mjs';export{c as classifyDCPMI,d as generateComplianceAuditReturn}from'./chunk-MGXWQW5I.mjs';export{a as getComplianceScore}from'./chunk-6A7M4CGJ.mjs';export{a as calculateBreachSeverity}from'./chunk-WTGKZX7J.mjs';export{a as assessBreachNotification}from'./chunk-WJSUVPYX.mjs';export{c as DEFAULT_POLICY_SECTIONS,d as DEFAULT_POLICY_VARIABLES,e as createBusinessPolicyTemplate,a as findUnfilledTokens,b as generatePolicyText}from'./chunk-UZBRO7WP.mjs';export{d as DEFAULT_DATA_CATEGORIES,a as UNFILLED_PREFIX,b as UNFILLED_SUFFIX,c as assemblePolicy,e as createDefaultContext,f as evaluatePolicyCompliance}from'./chunk-3ELNTFUX.mjs';export{i as assessTransferRisk,g as getTransferMechanismDescription,f as isNDPCApprovalRequired,h as validateTransfer}from'./chunk-K5WLRGDN.mjs';export{c as assessComplianceGaps,d as generateLawfulBasisSummary,b as getLawfulBasisDescription,a as validateProcessingActivity}from'./chunk-LWIKDDSU.mjs';export{c as exportROPAToCSV,b as generateROPASummary,d as identifyComplianceGaps,a as validateProcessingRecord}from'./chunk-XP5PL6K7.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-V7UFP6QU.mjs';export{b as cookieAdapter,a as sessionStorageAdapter}from'./chunk-XC3DLYEG.mjs';export{b as validateConsentOptionsStructured,a as validateConsentStructured}from'./chunk-QX6RIR6I.mjs';export{a as KNOWN_COOKIES,b as scanCookies}from'./chunk-ZY4RCV5C.mjs';export{a as sanitizeInput}from'./chunk-EWVK45Z3.mjs';export{b as formatDSRRequestStructured,a as validateDsrSubmissionStructured}from'./chunk-RRVML7CU.mjs';export{a as assessDPIARisk}from'./chunk-LRRENTT5.mjs';export{b as LEGAL_DISCLAIMER_LONG,a as LEGAL_DISCLAIMER_SHORT,c as legalDisclaimerBlock}from'./chunk-ITCY2Z66.mjs';export{a as defaultLocale,b as mergeLocale}from'./chunk-5LJ652AH.mjs';export{a as localStorageAdapter}from'./chunk-DBZSN4WP.mjs';import'./chunk-ZJYULEER.mjs';
|
package/dist/unstyled.d.mts
CHANGED
|
@@ -422,6 +422,8 @@ declare interface DSRFormSubmission {
|
|
|
422
422
|
};
|
|
423
423
|
/** Additional information provided for the selected request type */
|
|
424
424
|
additionalInfo?: Record<string, string | number | boolean | null>;
|
|
425
|
+
/** Free-text details entered in the "Additional Information" textarea */
|
|
426
|
+
description?: string;
|
|
425
427
|
/** Timestamp (ms) when the form was submitted */
|
|
426
428
|
submittedAt: number;
|
|
427
429
|
}
|
package/dist/unstyled.d.ts
CHANGED
|
@@ -422,6 +422,8 @@ declare interface DSRFormSubmission {
|
|
|
422
422
|
};
|
|
423
423
|
/** Additional information provided for the selected request type */
|
|
424
424
|
additionalInfo?: Record<string, string | number | boolean | null>;
|
|
425
|
+
/** Free-text details entered in the "Additional Information" textarea */
|
|
426
|
+
description?: string;
|
|
425
427
|
/** Timestamp (ms) when the form was submitted */
|
|
426
428
|
submittedAt: number;
|
|
427
429
|
}
|
package/dist/unstyled.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var chunkC32TMS75_js=require('./chunk-C32TMS75.js'),chunk7PV64WEZ_js=require('./chunk-7PV64WEZ.js');require('./chunk-YMKN3YQL.js'),require('./chunk-PEUAA5EC.js');var
|
|
2
|
+
'use strict';var chunkC32TMS75_js=require('./chunk-C32TMS75.js'),chunk7PV64WEZ_js=require('./chunk-7PV64WEZ.js');require('./chunk-YMKN3YQL.js'),require('./chunk-PEUAA5EC.js');var chunkCHUOSZST_js=require('./chunk-CHUOSZST.js');require('./chunk-UXUMYP4L.js'),require('./chunk-AME4HJR4.js'),require('./chunk-I5ZDNSX5.js'),require('./chunk-7563FVMY.js');var chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),P=require('react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var P__default=/*#__PURE__*/_interopDefault(P);function e(C,R){let n=d=>{var s=d,{unstyled:l=true}=s,c=chunkRFPLZDIO_js.c(s,["unstyled"]);return P__default.default.createElement(C,chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{unstyled:l}))};return n.displayName=R,n}var u=e(chunk7PV64WEZ_js.a,"UnstyledConsentBanner"),y=e(chunkC32TMS75_js.a,"UnstyledConsentManager"),S=e(chunkCHUOSZST_js.a,"UnstyledDSRRequestForm");exports.ConsentBanner=u;exports.ConsentManager=y;exports.DSRRequestForm=S;
|
package/dist/unstyled.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {a as a$2}from'./chunk-CNCEP66F.mjs';import {a as a$1}from'./chunk-PYSYBUIV.mjs';import'./chunk-QNXLY5EJ.mjs';import'./chunk-ZY4RCV5C.mjs';import {a as a$3}from'./chunk-
|
|
2
|
+
import {a as a$2}from'./chunk-CNCEP66F.mjs';import {a as a$1}from'./chunk-PYSYBUIV.mjs';import'./chunk-QNXLY5EJ.mjs';import'./chunk-ZY4RCV5C.mjs';import {a as a$3}from'./chunk-OMACLDXI.mjs';import'./chunk-EWVK45Z3.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-PHA3YMFO.mjs';import'./chunk-5LJ652AH.mjs';import {c,b,a}from'./chunk-ZJYULEER.mjs';import P from'react';function e(C,R){let n=d=>{var s=d,{unstyled:l=true}=s,c$1=c(s,["unstyled"]);return P.createElement(C,b(a({},c$1),{unstyled:l}))};return n.displayName=R,n}var u=e(a$1,"UnstyledConsentBanner"),y=e(a$2,"UnstyledConsentManager"),S=e(a$3,"UnstyledDSRRequestForm");export{u as ConsentBanner,y as ConsentManager,S as DSRRequestForm};
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tantainnovative/ndpr-toolkit",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"packageManager": "pnpm@10.34.1",
|
|
6
6
|
"description": "Nigeria Data Protection Toolkit — enterprise-grade compliance components for the Nigeria Data Protection Act (NDPA) 2023",
|
|
7
|
+
"//": "pnpm.overrides is intentionally duplicated in pnpm-workspace.yaml — keep both in sync; see the comment there (pnpm/pnpm#10614, pnpm/pnpm#11536)",
|
|
7
8
|
"pnpm": {
|
|
8
9
|
"overrides": {
|
|
9
10
|
"handlebars": ">=4.7.9",
|
|
@@ -11,11 +12,12 @@
|
|
|
11
12
|
"glob": "^7.2.3",
|
|
12
13
|
"tar": ">=7.5.10",
|
|
13
14
|
"brace-expansion": ">=5.0.6",
|
|
14
|
-
"js-yaml": "
|
|
15
|
+
"js-yaml": "4.2.0",
|
|
15
16
|
"yaml": ">=2.8.3",
|
|
16
17
|
"picomatch": ">=2.3.2",
|
|
17
18
|
"flatted": ">=3.4.2",
|
|
18
|
-
"dompurify": ">=3.4.
|
|
19
|
+
"dompurify": ">=3.4.11",
|
|
20
|
+
"esbuild": ">=0.28.1",
|
|
19
21
|
"@protobufjs/utf8": ">=1.1.1",
|
|
20
22
|
"fast-xml-parser": ">=5.7.0",
|
|
21
23
|
"fast-xml-builder": ">=1.1.7",
|
|
@@ -33,7 +35,10 @@
|
|
|
33
35
|
"prepublishOnly": "pnpm build:lib",
|
|
34
36
|
"start": "next start",
|
|
35
37
|
"lint": "eslint .",
|
|
36
|
-
"test": "jest
|
|
38
|
+
"test": "jest",
|
|
39
|
+
"test:serial": "jest --runInBand",
|
|
40
|
+
"test:coverage": "jest --coverage --coverageReporters=text-summary --coverageReporters=lcov --collectCoverageFrom='packages/ndpr-toolkit/src/**/*.ts' --collectCoverageFrom='packages/ndpr-toolkit/src/**/*.tsx' --collectCoverageFrom='!packages/ndpr-toolkit/src/**/*.d.ts' --collectCoverageFrom='!packages/ndpr-toolkit/src/__tests__/**'",
|
|
41
|
+
"verify:ci": "pnpm lint && pnpm exec tsc --noEmit && pnpm test:serial && pnpm build:lib && pnpm verify:tarball --skip-build",
|
|
37
42
|
"export": "next export",
|
|
38
43
|
"build:static": "next build",
|
|
39
44
|
"deploy": "next build && touch out/.nojekyll && gh-pages -d out",
|
|
@@ -314,8 +319,10 @@
|
|
|
314
319
|
"clsx": "^2.1.1",
|
|
315
320
|
"docx": ">=8.0.0",
|
|
316
321
|
"jspdf": "^4.2.1",
|
|
322
|
+
"lucide-react": "^1.17.0",
|
|
317
323
|
"react": "^18.0.0 || ^19.0.0",
|
|
318
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
324
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
325
|
+
"tailwind-merge": "^3.6.0"
|
|
319
326
|
},
|
|
320
327
|
"peerDependenciesMeta": {
|
|
321
328
|
"@radix-ui/react-label": {
|
|
@@ -341,6 +348,12 @@
|
|
|
341
348
|
},
|
|
342
349
|
"jspdf": {
|
|
343
350
|
"optional": true
|
|
351
|
+
},
|
|
352
|
+
"lucide-react": {
|
|
353
|
+
"optional": true
|
|
354
|
+
},
|
|
355
|
+
"tailwind-merge": {
|
|
356
|
+
"optional": true
|
|
344
357
|
}
|
|
345
358
|
},
|
|
346
359
|
"devDependencies": {
|
|
@@ -356,11 +369,11 @@
|
|
|
356
369
|
"@radix-ui/react-switch": "^1.3.0",
|
|
357
370
|
"@radix-ui/react-tabs": "^1.1.14",
|
|
358
371
|
"@tailwindcss/postcss": "^4.3.0",
|
|
359
|
-
"@tantainnovative/ndpr-toolkit": "^5.7.
|
|
372
|
+
"@tantainnovative/ndpr-toolkit": "^5.7.2",
|
|
360
373
|
"@testing-library/dom": "^10.4.1",
|
|
361
374
|
"@testing-library/jest-dom": "^6.9.1",
|
|
362
375
|
"@testing-library/react": "^16.3.2",
|
|
363
|
-
"@types/jest": "^
|
|
376
|
+
"@types/jest": "^30.0.0",
|
|
364
377
|
"@types/react": "^19.2.17",
|
|
365
378
|
"@types/react-dom": "^19.2.3",
|
|
366
379
|
"@typescript-eslint/eslint-plugin": "^8.60.1",
|
|
@@ -373,13 +386,12 @@
|
|
|
373
386
|
"eslint-plugin-react": "^7.37.5",
|
|
374
387
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
375
388
|
"gh-pages": "^6.3.0",
|
|
376
|
-
"gray-matter": "^4.0.3",
|
|
377
389
|
"husky": "^9.1.7",
|
|
378
|
-
"jest": "^
|
|
390
|
+
"jest": "^30.4.2",
|
|
379
391
|
"jest-environment-jsdom": "^30.4.1",
|
|
380
392
|
"jspdf": "^4.2.1",
|
|
381
|
-
"lint-staged": "^
|
|
382
|
-
"lucide-react": "
|
|
393
|
+
"lint-staged": "^17.0.7",
|
|
394
|
+
"lucide-react": "1.17.0",
|
|
383
395
|
"next": "^16.2.7",
|
|
384
396
|
"postcss": "^8.5.15",
|
|
385
397
|
"posthog-js": "^1.381.0",
|
|
@@ -392,6 +404,7 @@
|
|
|
392
404
|
"ts-jest": "^29.4.11",
|
|
393
405
|
"tsup": "^8.5.1",
|
|
394
406
|
"tw-animate-css": "^1.4.0",
|
|
395
|
-
"typescript": "^
|
|
407
|
+
"typescript": "^6.0.3",
|
|
408
|
+
"yaml": "^2.9.0"
|
|
396
409
|
}
|
|
397
410
|
}
|
package/dist/chunk-5ZMYNOMR.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-WJSUVPYX.mjs';import {a as a$3}from'./chunk-EWVK45Z3.mjs';import {a as a$1}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-PHA3YMFO.mjs';import {a as a$2,b}from'./chunk-ZJYULEER.mjs';import {useState,useMemo}from'react';import {jsxs,jsx}from'react/jsx-runtime';var Ct=({categories:Je,onSubmit:Qe,onValidationError:z,title:Y,description:H,submitButtonText:U,className:te="",buttonClassName:re="",classNames:d={},unstyled:c$1=false,isSubmitting:C=false,showConfirmation:Xe=true,confirmationMessage:Ve="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:et=true,maxAttachments:G=5,maxFileSize:Z=5*1024*1024,allowedFileTypes:K=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:r,onReset:W,showCompleteness:tt=true})=>{var ke,qe,je,Te,Ie,Be,Ee,Me,$e,Oe,Le,ze,Ye,He;let J=c(),rt=(ke=Y!=null?Y:J.breach.title)!=null?ke:"Report a Data Breach",it=(qe=H!=null?H:J.breach.description)!=null?qe:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",at=(je=U!=null?U:J.breach.submitReport)!=null?je:"Submit Report",ie=t=>{if(!t)return "";let o=new Date(t),p=s=>String(s).padStart(2,"0");return `${o.getFullYear()}-${p(o.getMonth()+1)}-${p(o.getDate())}T${p(o.getHours())}:${p(o.getMinutes())}`},[S,ae]=useState((r==null?void 0:r.title)||""),[D,ne]=useState((r==null?void 0:r.description)||""),[A,oe]=useState((r==null?void 0:r.category)||""),[h,se]=useState(ie(r==null?void 0:r.discoveredAt)),[v,de]=useState(ie(r==null?void 0:r.occurredAt)),[T,me]=useState(((Te=r==null?void 0:r.reporter)==null?void 0:Te.name)||""),[R,ce]=useState(((Ie=r==null?void 0:r.reporter)==null?void 0:Ie.email)||""),[I,le]=useState(((Be=r==null?void 0:r.reporter)==null?void 0:Be.department)||""),[B,pe]=useState(((Ee=r==null?void 0:r.reporter)==null?void 0:Ee.phone)||""),[E,ge]=useState((r==null?void 0:r.affectedSystems)||[]),[nt,fe]=useState(((Me=r==null?void 0:r.affectedSystems)==null?void 0:Me.join(", "))||""),[w,be]=useState((r==null?void 0:r.dataTypes)||[]),[b$1,he]=useState((r==null?void 0:r.estimatedAffectedSubjects)!=null?String(r.estimatedAffectedSubjects):""),[N,ve]=useState((r==null?void 0:r.approximateRecordCount)!=null?String(r.approximateRecordCount):""),[u,Ne]=useState((($e=r==null?void 0:r.dataSubjectCategories)==null?void 0:$e.join(", "))||""),[P,ue]=useState((Oe=r==null?void 0:r.involvesSensitiveData)!=null?Oe:false),[F,ye]=useState((r==null?void 0:r.likelyConsequences)||""),[k,_e]=useState((r==null?void 0:r.mitigationMeasures)||""),[y,xe]=useState(((Le=r==null?void 0:r.dpoContact)==null?void 0:Le.name)||""),[_,Ce]=useState(((ze=r==null?void 0:r.dpoContact)==null?void 0:ze.email)||""),[M,Se]=useState(((Ye=r==null?void 0:r.dpoContact)==null?void 0:Ye.phone)||""),[Q,De]=useState((He=r==null?void 0:r.isPhasedReport)!=null?He:false),[X,Ae]=useState((r==null?void 0:r.supplementsReportId)||""),[$,Re]=useState((r==null?void 0:r.status)||"ongoing"),[q,we]=useState((r==null?void 0:r.initialActions)||""),[O,V]=useState([]),[ot,ee]=useState(false),[a$4,j]=useState({}),g=useMemo(()=>{let t={id:"",title:S,description:D,category:A,discoveredAt:h?new Date(h).getTime():NaN,occurredAt:v?new Date(v).getTime():void 0,reportedAt:0,reporter:{name:T,email:R,department:I,phone:B||void 0},affectedSystems:E,dataTypes:w,estimatedAffectedSubjects:b$1?Number(b$1):void 0,approximateRecordCount:N?Number(N):void 0,dataSubjectCategories:u?u.split(",").map(o=>o.trim()).filter(Boolean):void 0,involvesSensitiveData:P,likelyConsequences:F||void 0,mitigationMeasures:k||void 0,dpoContact:y||_?{name:y,email:_,phone:M||void 0}:void 0,status:$,initialActions:q||void 0};return a(t,{highRisk:P})},[S,D,A,h,v,E,w,b$1,N,u,P,F,k,y,_,$,q]),Pe=[...g.notificationToCommission,...g.dataSubjectCommunication],Fe=Pe.length,st=Fe-g.missing.length,dt=()=>{ae(""),ne(""),oe(""),se(""),de(""),me(""),ce(""),le(""),pe(""),ge([]),fe(""),be([]),he(""),ve(""),Ne(""),ue(false),ye(""),_e(""),xe(""),Ce(""),Se(""),De(false),Ae(""),Re("ongoing"),we(""),V([]),ee(false),j({}),W==null||W();},mt=t=>{let o=t.target.value;fe(o);let p=o.split(",").map(s=>s.trim()).filter(Boolean);ge(p);},ct=t=>{be(o=>o.includes(t)?o.filter(p=>p!==t):[...o,t]);},lt=t=>{var Ue;let o=t.target.files;if(!o)return;let p=[],s={};if(O.length+o.length>G){s.attachments=`Maximum of ${G} files allowed`,j(f=>a$2(a$2({},f),s));return}for(let f=0;f<o.length;f++){let L=o[f];if(L.size>Z){s.attachments=`File ${L.name} exceeds the maximum size of ${Z/(1024*1024)}MB`;continue}let Ge="."+((Ue=L.name.split(".").pop())==null?void 0:Ue.toLowerCase());if(!K.includes(Ge)){s.attachments=`File type ${Ge} is not allowed`;continue}p.push(L);}p.length>0&&V(f=>[...f,...p]),Object.keys(s).length>0?j(f=>a$2(a$2({},f),s)):j(f=>b(a$2({},f),{attachments:""}));},pt=t=>{V(o=>o.filter((p,s)=>s!==t));},gt=()=>{let t={};return S.trim()||(t.breachTitle="Breach title is required"),D.trim()||(t.description="Description is required"),A||(t.category="Category is required"),h||(t.discoveredAt="Discovery date is required"),T.trim()||(t.reporterName="Reporter name is required"),R.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(R)||(t.reporterEmail="Reporter email is invalid"):t.reporterEmail="Reporter email is required",I.trim()||(t.reporterDepartment="Reporter department is required"),E.length===0&&(t.affectedSystems="At least one affected system is required"),w.length===0&&(t.dataTypes="At least one data type is required"),b$1&&isNaN(Number(b$1))&&(t.estimatedAffectedSubjects="Estimated affected subjects must be a number"),j(t),t},ft=t=>{t.preventDefault();let o=gt();if(Object.keys(o).length>0){z==null||z(o);return}let p={title:a$3(S),description:a$3(D),category:A,discoveredAt:new Date(h).getTime(),occurredAt:v?new Date(v).getTime():void 0,reportedAt:Date.now(),reporter:{name:a$3(T),email:a$3(R),department:a$3(I),phone:B?a$3(B):void 0},affectedSystems:E.map(s=>a$3(s)),dataTypes:w,estimatedAffectedSubjects:b$1?Number(b$1):void 0,approximateRecordCount:N?Number(N):void 0,dataSubjectCategories:u?u.split(",").map(s=>a$3(s.trim())).filter(Boolean):void 0,involvesSensitiveData:P,likelyConsequences:F?a$3(F):void 0,mitigationMeasures:k?a$3(k):void 0,dpoContact:y||_?{name:a$3(y),email:a$3(_),phone:M?a$3(M):void 0}:void 0,isPhasedReport:Q||void 0,supplementsReportId:X?a$3(X):void 0,status:$,initialActions:q?a$3(q):void 0,attachments:O.map(s=>({name:s.name,type:s.type,size:s.size,file:s}))};Qe(p),Xe&&ee(true);};if(ot)return jsxs("div",{"data-ndpr-component":"breach-report-form",className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${te}`,children:[jsx("h2",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Submitted"}),jsx("p",{className:"ndpr-text-success",children:Ve}),jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold ndpr-text-warning mb-2",children:"Important: Next Steps"}),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."})]}),jsx("button",{onClick:()=>ee(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${re}`,children:"Report Another Breach"})]});let bt=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxs("div",{className:a$1(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${te}`,d.root,c$1),children:[jsx("h2",{className:a$1("ndpr-section-heading",d.title,c$1),children:rt}),jsx("p",{className:"ndpr-card__subtitle",children:it}),tt&&jsxs("div",{"data-ndpr-section":"breach-completeness",className:a$1("ndpr-alert ndpr-alert--info mb-4",d.completeness,c$1),children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info",children:"NDPC notification readiness"}),jsxs("span",{className:"text-sm font-semibold ndpr-text-info",children:[g.completeness,"%"]})]}),jsx("div",{role:"progressbar","aria-valuenow":g.completeness,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Breach notification completeness",className:"h-2 w-full rounded bg-gray-200 dark:bg-gray-700 overflow-hidden mb-2",children:jsx("div",{className:"h-full bg-[rgb(var(--ndpr-primary))]",style:{width:`${g.completeness}%`}})}),jsxs("p",{className:"text-sm ndpr-text-info",children:[st," of ",Fe," mandated items provided (GAID 2025 Art. 33(5) / NDPA S. 40(2))."]}),Number.isFinite(g.timing.deadline)?g.timing.overdue?jsxs("p",{className:"text-sm ndpr-text-warning mt-1",children:["72-hour deadline passed ",Math.abs(g.timing.hoursRemaining),"h ago \u2014 notify the NDPC now and state the reason for the delay (NDPA S. 40(2))."]}):jsxs("p",{className:"text-sm ndpr-text-info mt-1",children:[Math.max(0,g.timing.hoursRemaining),"h remaining to notify the NDPC (72-hour window, NDPA S. 40(2))."]}):jsx("p",{className:"text-sm ndpr-text-muted mt-1",children:"Set the discovery date to start the 72-hour clock."}),g.dataSubjectCommunicationRequired&&jsx("p",{className:"text-sm ndpr-text-warning mt-1",children:"High risk: affected data subjects must be notified in plain, clear language (NDPA S. 40(3))."}),g.missing.length>0&&jsxs("details",{className:"mt-2",children:[jsxs("summary",{className:"text-sm ndpr-text-info cursor-pointer",children:[g.missing.length," item(s) still needed"]}),jsx("ul",{className:"mt-1 list-disc pl-5",children:Pe.filter(t=>!t.satisfied).map(t=>jsxs("li",{className:"text-xs ndpr-text-muted",children:[t.label," ",jsxs("span",{className:"opacity-70",children:["(",t.section,")"]})]},t.id))})]})]}),jsx("form",{onSubmit:ft,className:a$1("",d.form,c$1),children:jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{className:a$1("",d.fieldGroup,c$1),children:[jsx("h3",{className:"ndpr-section-heading",children:"Breach Information"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"breachTitle",className:a$1("ndpr-form-field__label",d.label,c$1),children:["Breach Title/Summary ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"breachTitle",value:S,onChange:t=>ae(t.target.value),className:a$1("ndpr-form-field__input",d.input,c$1),required:true,"aria-invalid":!!a$4.breachTitle,"aria-describedby":a$4.breachTitle?"breachTitle-error":void 0}),a$4.breachTitle&&jsx("p",{id:"breachTitle-error",role:"alert",className:"ndpr-form-field__error",children:a$4.breachTitle})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"category",className:a$1("ndpr-form-field__label",d.label,c$1),children:["Breach Category ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxs("select",{id:"category",value:A,onChange:t=>oe(t.target.value),className:a$1("ndpr-form-field__input",d.select,c$1),required:true,"aria-invalid":!!a$4.category,"aria-describedby":a$4.category?"category-error":void 0,children:[jsx("option",{value:"",children:"Select a category"}),Je.map(t=>jsx("option",{value:t.id,children:t.name},t.id))]}),a$4.category&&jsx("p",{id:"category-error",role:"alert",className:"ndpr-form-field__error",children:a$4.category})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"description",className:a$1("ndpr-form-field__label",d.label,c$1),children:["Detailed Description ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"description",value:D,onChange:t=>ne(t.target.value),rows:4,className:a$1("ndpr-form-field__input",d.textarea,c$1),required:true,"aria-invalid":!!a$4.description,"aria-describedby":a$4.description?"description-error":void 0}),a$4.description&&jsx("p",{id:"description-error",role:"alert",className:"ndpr-form-field__error",children:a$4.description})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"discoveredAt",className:"ndpr-form-field__label",children:["Date Discovered ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"datetime-local",id:"discoveredAt",value:h,onChange:t=>se(t.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$4.discoveredAt,"aria-describedby":a$4.discoveredAt?"discoveredAt-error":void 0}),a$4.discoveredAt&&jsx("p",{id:"discoveredAt-error",role:"alert",className:"ndpr-form-field__error",children:a$4.discoveredAt})]}),jsxs("div",{children:[jsx("label",{htmlFor:"occurredAt",className:"ndpr-form-field__label",children:"Date Occurred (if known)"}),jsx("input",{type:"datetime-local",id:"occurredAt",value:v,onChange:t=>de(t.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Reporter Information"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"reporterName",className:"ndpr-form-field__label",children:["Your Name ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"reporterName",value:T,onChange:t=>me(t.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$4.reporterName,"aria-describedby":a$4.reporterName?"reporterName-error":void 0}),a$4.reporterName&&jsx("p",{id:"reporterName-error",role:"alert",className:"ndpr-form-field__error",children:a$4.reporterName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterEmail",className:"ndpr-form-field__label",children:["Your Email ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"email",id:"reporterEmail",value:R,onChange:t=>ce(t.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$4.reporterEmail,"aria-describedby":a$4.reporterEmail?"reporterEmail-error":void 0}),a$4.reporterEmail&&jsx("p",{id:"reporterEmail-error",role:"alert",className:"ndpr-form-field__error",children:a$4.reporterEmail})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterDepartment",className:"ndpr-form-field__label",children:["Your Department ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"reporterDepartment",value:I,onChange:t=>le(t.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$4.reporterDepartment,"aria-describedby":a$4.reporterDepartment?"reporterDepartment-error":void 0}),a$4.reporterDepartment&&jsx("p",{id:"reporterDepartment-error",role:"alert",className:"ndpr-form-field__error",children:a$4.reporterDepartment})]}),jsxs("div",{children:[jsx("label",{htmlFor:"reporterPhone",className:"ndpr-form-field__label",children:"Your Phone Number (Optional)"}),jsx("input",{type:"tel",id:"reporterPhone",value:B,onChange:t=>pe(t.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Impact Information"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"affectedSystems",className:"ndpr-form-field__label",children:["Affected Systems/Applications ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"affectedSystems",value:nt,onChange:mt,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$4.affectedSystems,"aria-describedby":a$4.affectedSystems?"affectedSystems-error":void 0}),a$4.affectedSystems&&jsx("p",{id:"affectedSystems-error",role:"alert",className:"ndpr-form-field__error",children:a$4.affectedSystems})]}),jsxs("div",{children:[jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"ndpr-form-field__label",children:"Estimated Number of Affected Data Subjects"}),jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:b$1,onChange:t=>he(t.target.value),placeholder:"e.g. 100",className:"ndpr-form-field__input","aria-invalid":!!a$4.estimatedAffectedSubjects,"aria-describedby":a$4.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),a$4.estimatedAffectedSubjects&&jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"ndpr-form-field__error",children:a$4.estimatedAffectedSubjects})]}),jsxs("fieldset",{className:"md:col-span-2","aria-invalid":!!a$4.dataTypes,"aria-describedby":a$4.dataTypes?"dataTypes-error":void 0,children:[jsxs("legend",{className:"ndpr-form-field__label",children:["Types of Data Involved ",jsx("span",{className:"ndpr-form-field__required","aria-hidden":"true",children:"*"}),jsx("span",{className:"sr-only",children:"(required)"})]}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:bt.map(t=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`dataType_${t.id}`,checked:w.includes(t.id),onChange:()=>ct(t.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:`dataType_${t.id}`,className:"ml-2 text-sm ndpr-text-muted",children:t.label})]},t.id))}),a$4.dataTypes&&jsx("p",{id:"dataTypes-error",role:"alert",className:"ndpr-form-field__error",children:a$4.dataTypes})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"status",className:"ndpr-form-field__label",children:["Current Status ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxs("select",{id:"status",value:$,onChange:t=>Re(t.target.value),className:a$1("ndpr-form-field__input",d.select,c$1),required:true,children:[jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"approximateRecordCount",className:"ndpr-form-field__label",children:"Approximate Number of Records Concerned"}),jsx("input",{type:"text",id:"approximateRecordCount",value:N,onChange:t=>ve(t.target.value),placeholder:"e.g. 5000",className:"ndpr-form-field__input"}),jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required for the NDPC report (NDPA Section 40(2))."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSubjectCategories",className:"ndpr-form-field__label",children:"Categories of Data Subjects Affected"}),jsx("input",{type:"text",id:"dataSubjectCategories",value:u,onChange:t=>Ne(t.target.value),placeholder:"e.g. customers, employees, minors",className:"ndpr-form-field__input"}),jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Comma-separated. Required for the NDPC report (NDPA Section 40(2))."})]}),jsxs("div",{className:"md:col-span-2 flex items-center",children:[jsx("input",{id:"involvesSensitiveData",type:"checkbox",checked:P,onChange:t=>ue(t.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"involvesSensitiveData",className:"ml-2 text-sm ndpr-text-muted",children:"Sensitive personal data (NDPA Section 30) is involved"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"likelyConsequences",className:"ndpr-form-field__label",children:"Likely Consequences for Data Subjects"}),jsx("textarea",{id:"likelyConsequences",value:F,onChange:t=>ye(t.target.value),placeholder:"e.g. identity theft, financial loss, reputational damage, discrimination",rows:3,className:a$1("ndpr-form-field__input",d.textarea,c$1)}),jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required content for NDPC report and Section 40(3) communications to data subjects."})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"mitigationMeasures",className:"ndpr-form-field__label",children:"Mitigation Measures"}),jsx("textarea",{id:"mitigationMeasures",value:k,onChange:t=>_e(t.target.value),placeholder:"Measures taken or proposed to mitigate possible adverse effects (NDPA Section 40(3))",rows:3,className:a$1("ndpr-form-field__input",d.textarea,c$1)})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("h4",{className:"ndpr-section-heading text-sm mt-4",children:"Data Protection Officer (NDPC contact)"}),jsx("p",{className:"text-xs ndpr-text-muted mb-2",children:"Defaults to organisation-level DPO if left blank."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dpoName",className:"ndpr-form-field__label",children:"DPO Name"}),jsx("input",{type:"text",id:"dpoName",value:y,onChange:t=>xe(t.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dpoEmail",className:"ndpr-form-field__label",children:"DPO Email"}),jsx("input",{type:"email",id:"dpoEmail",value:_,onChange:t=>Ce(t.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dpoPhone",className:"ndpr-form-field__label",children:"DPO Phone"}),jsx("input",{type:"tel",id:"dpoPhone",value:M,onChange:t=>Se(t.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{className:"md:col-span-2 flex items-center mt-2",children:[jsx("input",{id:"isPhasedReport",type:"checkbox",checked:Q,onChange:t=>De(t.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),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)"})]}),Q&&jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"supplementsReportId",className:"ndpr-form-field__label",children:"Supplements Report ID (if applicable)"}),jsx("input",{type:"text",id:"supplementsReportId",value:X,onChange:t=>Ae(t.target.value),placeholder:"Prior report ID this report supplements",className:"ndpr-form-field__input"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"initialActions",className:"ndpr-form-field__label",children:"Initial Actions Taken"}),jsx("textarea",{id:"initialActions",value:q,onChange:t=>we(t.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:a$1("ndpr-form-field__input",d.textarea,c$1)})]})]})]}),et&&jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Attachments"}),jsxs("div",{className:"ndpr-form-field",children:[jsx("label",{htmlFor:"breach-attachments",className:"ndpr-form-field__label",children:"Upload Supporting Files (Optional)"}),jsxs("p",{className:"text-xs ndpr-text-muted mb-2",children:["Max ",G," files, ",Z/(1024*1024),"MB each. Allowed types: ",K.join(", ")]}),jsx("input",{id:"breach-attachments",type:"file",onChange:lt,multiple:true,className:"ndpr-form-field__input",accept:K.join(",")}),a$4.attachments&&jsx("p",{id:"attachments-error",role:"alert",className:"ndpr-form-field__error",children:a$4.attachments})]}),O.length>0&&jsxs("div",{className:"ndpr-form-field",children:[jsx("h4",{className:"ndpr-form-field__label",children:"Attached Files:"}),jsx("ul",{className:"ndpr-form-section",children:O.map((t,o)=>jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxs("div",{className:"flex items-center",children:[jsx("svg",{"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:jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsx("span",{className:"text-sm ndpr-text-muted",children:t.name}),jsxs("span",{className:"ml-2 text-xs ndpr-text-muted",children:["(",(t.size/1024).toFixed(1)," KB)"]})]}),jsxs("button",{type:"button",onClick:()=>pt(o),"aria-label":`Remove attachment ${t.name}`,className:"text-red-500 hover:ndpr-text-destructive p-2 min-w-[44px] min-h-[44px] flex items-center justify-center",children:[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: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"})}),jsx("span",{className:"sr-only",children:"Remove"})]})]},o))})]})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--info",d.notice,c$1),children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),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."})]}),jsxs("div",{className:"mt-6 relative flex gap-3",children:[C&&d.loadingOverlay&&jsx("div",{className:d.loadingOverlay}),jsx("button",{type:"submit",disabled:C,className:a$1(`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 ${re} ${C?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c$1),children:C?"Submitting...":at}),jsx("button",{type:"button",onClick:dt,disabled:C,className:a$1("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$1),children:"Reset"})]})]})})]})};
|
|
2
|
-
export{Ct as a};
|
package/dist/chunk-6UGLAVRM.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import {e,g,h,f}from'./chunk-7BJXI2HI.mjs';import {a as a$1}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-PHA3YMFO.mjs';import {b,a}from'./chunk-ZJYULEER.mjs';import {useState,useMemo,useEffect,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var z=[{value:"adequacy_decision",label:"Adequacy Decision (Section 42)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 41(1)(a))"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 41(1)(a))"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 42(5))"},{value:"explicit_consent",label:"Explicit Consent (Section 43(1)(a))"},{value:"contract_performance",label:"Contract Performance (Section 43(1)(b))"},{value:"public_interest",label:"Public Interest (Section 43(1)(d))"},{value:"legal_claims",label:"Legal Claims (Section 43(1)(e))"},{value:"vital_interests",label:"Vital Interests (Section 43(1)(f))"}],ae=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],ne=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],ie=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],ye={low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--destructive"},Se={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"},ke={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"},de={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:""},Be=({transfers:g$1,onAdd:y,onUpdate:S,onArchive:k,summary:B,title:M,description:P,className:pe="",buttonClassName:I="",showSummary:oe=true,showTIA:le=true,classNames:r,unstyled:d})=>{var J,X;let $=c(),se=(J=M!=null?M:$.crossBorder.title)!=null?J:"Cross-Border Data Transfer Manager",ce=(X=P!=null?P:$.crossBorder.description)!=null?X:"Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VIII (Sections 41-43).",[f$1,T]=useState(null),[V,D]=useState(false),[h$1,U]=useState(null),[i,N]=useState(de),[C,G]=useState(null),[R,ue]=useState("all"),[q,me]=useState("all"),x=useMemo(()=>{let t=[...g$1];return R!=="all"&&(t=t.filter(a=>a.status===R)),q!=="all"&&(t=t.filter(a=>a.transferMechanism===q)),t.sort((a,o)=>o.updatedAt-a.updatedAt),t},[g$1,R,q]);useEffect(()=>{x.length>0&&!f$1&&T(x[0].id);},[x,f$1]);let H=useMemo(()=>{var t;return f$1&&(t=g$1.find(a=>a.id===f$1))!=null?t:null},[g$1,f$1]),A=useCallback(t=>new Date(t).toLocaleDateString(),[]),_=useCallback(()=>{N(de),U(null),G(null);},[]),ve=useCallback(()=>{_(),D(true);},[_]),fe=useCallback(t=>{var a,o,u,v;U(t.id),N({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)||""}),D(true);},[]),l=useCallback((t,a$1)=>{N(o=>b(a({},o),{[t]:a$1}));},[]),K=useCallback(()=>{let t=e(i.transferMechanism),a=Date.now();return {destinationCountry:i.destinationCountry.trim(),destinationCountryCode:i.destinationCountryCode.trim()||void 0,adequacyStatus:i.adequacyStatus,transferMechanism:i.transferMechanism,dataCategories:i.dataCategories.split(",").map(o=>o.trim()).filter(Boolean),includesSensitiveData:i.includesSensitiveData,estimatedDataSubjects:i.estimatedDataSubjects?parseInt(i.estimatedDataSubjects,10):void 0,recipientOrganization:i.recipientOrganization.trim(),recipientContact:{name:i.recipientContactName.trim(),email:i.recipientContactEmail.trim(),phone:i.recipientContactPhone.trim()||void 0,address:i.recipientContactAddress.trim()||void 0},purpose:i.purpose.trim(),safeguards:i.safeguards.split(`
|
|
3
|
-
`).map(o=>o.trim()).filter(Boolean),riskAssessment:i.riskAssessment.trim(),riskLevel:i.riskLevel,frequency:i.frequency,status:t&&!i.ndpcApprovalApproved?"pending_approval":i.status,tiaCompleted:i.tiaCompleted,tiaReference:i.tiaReference.trim()||void 0,ndpcApproval:t?{required:true,applied:i.ndpcApprovalApplied,approved:i.ndpcApprovalApproved||void 0,referenceNumber:i.ndpcApprovalReference.trim()||void 0,appliedAt:i.ndpcApprovalApplied?a:void 0,approvedAt:i.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},[i]),be=useCallback(()=>{let t=K(),a$1=a({id:h$1||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),o=g(a$1);G(o),o.isValid&&(h$1?S==null||S(h$1,t):y==null||y(t),_(),D(false));},[K,h$1,S,y,_]),Y=useCallback(()=>{_(),D(false);},[_]),ge=useCallback(t=>{k==null||k(t),f$1===t&&T(null);},[k,f$1]),Q=useCallback(t=>jsxs("span",{className:a$1(`px-2 py-1 rounded text-xs font-medium ${ye[t]}`,r==null?void 0:r.riskBadge,d),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),[r==null?void 0:r.riskBadge,d]),W=useCallback(t=>jsx("span",{className:a$1(`px-2 py-1 rounded text-xs font-medium ${Se[t]}`,r==null?void 0:r.statusBadge,d),children:ke[t]}),[r==null?void 0:r.statusBadge,d]),he=useCallback(t=>{var u;e(t);let o=((u=z.find(v=>v.value===t))==null?void 0:u.label)||t;return jsx("span",{className:"px-2 py-1 rounded text-xs font-medium ndpr-badge ndpr-badge--info",children:o})},[]),w=useMemo(()=>{var v,c;if(B)return B;let t=0,a=[],o=[],u=[];for(let s of g$1){let O=s.status==="active";O&&t++,(s.status==="pending_approval"||(v=s.ndpcApproval)!=null&&v.required&&!((c=s.ndpcApproval)!=null&&c.approved))&&a.push(s),s.riskLevel==="high"&&O&&o.push(s),!s.tiaCompleted&&O&&u.push(s);}return {totalActiveTransfers:t,pendingApproval:a,highRiskTransfers:o,missingTIA:u,byMechanism:{},byAdequacy:{},dueForReview:[],lastUpdated:Date.now()}},[B,g$1]),Ce=()=>jsxs("div",{"data-ndpr-component":"cross-border-transfer-manager",role:"status","aria-label":"Transfer compliance summary",className:a$1("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,d),children:[jsxs("div",{className:a$1("ndpr-alert ndpr-alert--info",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:w.totalActiveTransfers}),jsx("p",{className:"text-sm ndpr-text-info",children:"Active Transfers"})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--info",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:w.pendingApproval.length}),jsx("p",{className:"text-sm ndpr-text-info",children:"Pending Approval"})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--destructive",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-destructive",children:w.highRiskTransfers.length}),jsx("p",{className:"text-sm ndpr-text-destructive",children:"High Risk"})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--warning",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:w.missingTIA.length}),jsx("p",{className:"text-sm ndpr-text-warning",children:"Missing TIA"})]})]}),_e=()=>{let t=e(i.transferMechanism);return jsxs("div",{className:a$1("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",r==null?void 0:r.form,d),children:[jsxs("div",{className:a$1("flex justify-between items-center mb-4",r==null?void 0:r.header,d),children:[jsx("h3",{className:"ndpr-section-heading",children:h$1?"Edit Transfer":"Add New Transfer"}),jsx("button",{onClick:Y,"aria-label":"Cancel form",className:"text-gray-600 hover:ndpr-text-muted dark:hover:text-gray-200",children:"Cancel"})]}),C&&!C.isValid&&jsxs("div",{id:"cb-form-errors",role:"alert",className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:C.errors.map((a,o)=>jsx("li",{children:a},o))})]}),C&&C.warnings.length>0&&jsxs("div",{id:"cb-form-warnings",role:"alert",className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings:"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:C.warnings.map((a,o)=>jsx("li",{children:a},o))})]}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"cb-destinationCountry",className:"ndpr-form-field__label",children:["Destination Country ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-destinationCountry",type:"text",value:i.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:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-destinationCountryCode",className:"ndpr-form-field__label",children:"Country Code (ISO)"}),jsx("input",{id:"cb-destinationCountryCode",type:"text",value:i.destinationCountryCode,onChange:a=>l("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,"aria-label":"Country code in ISO format",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientOrganization",className:"ndpr-form-field__label",children:["Recipient Organization ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-recipientOrganization",type:"text",value:i.recipientOrganization,onChange:a=>l("recipientOrganization",a.target.value),placeholder:"Organization name","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-transferMechanism",className:"ndpr-form-field__label",children:["Transfer Mechanism ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("select",{id:"cb-transferMechanism",value:i.transferMechanism,onChange:a=>l("transferMechanism",a.target.value),"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:z.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-adequacyStatus",className:"ndpr-form-field__label",children:"Adequacy Status"}),jsx("select",{id:"cb-adequacyStatus",value:i.adequacyStatus,onChange:a=>l("adequacyStatus",a.target.value),"aria-label":"Select adequacy status of destination country",className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:ae.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-riskLevel",className:"ndpr-form-field__label",children:"Risk Level"}),jsxs("select",{id:"cb-transfer-riskLevel",value:i.riskLevel,onChange:a=>l("riskLevel",a.target.value),className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsx("option",{value:"low",children:"Low"}),jsx("option",{value:"medium",children:"Medium"}),jsx("option",{value:"high",children:"High"})]})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-dataCategories",className:"ndpr-form-field__label",children:["Data Categories ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-dataCategories",type:"text",value:i.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:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)}),jsx("p",{id:"cb-dataCategories-help",className:"text-xs text-gray-500 mt-1",children:"Separate categories with commas"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:i.includesSensitiveData,onChange:a=>l("includesSensitiveData",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"includesSensitiveData",className:"ndpr-text-sm ndpr-font-medium",children:"Includes sensitive personal data"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-estimatedDataSubjects",className:"ndpr-form-field__label",children:"Estimated Data Subjects"}),jsx("input",{id:"cb-transfer-estimatedDataSubjects",type:"number",value:i.estimatedDataSubjects,onChange:a=>l("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientContactName",className:"ndpr-form-field__label",children:["Recipient Contact Name ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-recipientContactName",type:"text",value:i.recipientContactName,onChange:a=>l("recipientContactName",a.target.value),placeholder:"Contact person name","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientContactEmail",className:"ndpr-form-field__label",children:["Recipient Contact Email ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-recipientContactEmail",type:"email",value:i.recipientContactEmail,onChange:a=>l("recipientContactEmail",a.target.value),placeholder:"contact@example.com","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-recipientContactPhone",className:"ndpr-form-field__label",children:"Recipient Contact Phone"}),jsx("input",{id:"cb-transfer-recipientContactPhone",type:"text",value:i.recipientContactPhone,onChange:a=>l("recipientContactPhone",a.target.value),placeholder:"Phone number",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-recipientContactAddress",className:"ndpr-form-field__label",children:"Recipient Contact Address"}),jsx("input",{id:"cb-transfer-recipientContactAddress",type:"text",value:i.recipientContactAddress,onChange:a=>l("recipientContactAddress",a.target.value),placeholder:"Address",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-purpose",className:"ndpr-form-field__label",children:["Purpose of Transfer ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"cb-purpose",value:i.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:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-safeguards",className:"ndpr-form-field__label",children:["Safeguards ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"cb-safeguards",value:i.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:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)}),jsx("p",{id:"cb-safeguards-help",className:"text-xs text-gray-500 mt-1",children:"Enter one safeguard per line"})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-riskAssessment",className:"ndpr-form-field__label",children:["Risk Assessment Summary ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"cb-riskAssessment",value:i.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:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-frequency",className:"ndpr-form-field__label",children:"Transfer Frequency"}),jsx("select",{id:"cb-transfer-frequency",value:i.frequency,onChange:a=>l("frequency",a.target.value),className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:ne.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-status",className:"ndpr-form-field__label",children:"Status"}),jsx("select",{id:"cb-transfer-status",value:i.status,onChange:a=>l("status",a.target.value),className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:ie.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]})]}),t&&jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h4",{className:"text-sm font-medium ndpr-text-info mb-3",children:"NDPC Approval Required"}),jsx("p",{className:"text-xs ndpr-text-info mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:i.ndpcApprovalApplied,onChange:a=>l("ndpcApprovalApplied",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"ndpcApprovalApplied",className:"ndpr-text-sm",children:"Application submitted"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:i.ndpcApprovalApproved,onChange:a=>l("ndpcApprovalApproved",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"ndpcApprovalApproved",className:"ndpr-text-sm",children:"Approval granted"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"cb-transfer-ndpcApprovalReference",className:"ndpr-form-field__label",children:"NDPC Reference Number"}),jsx("input",{id:"cb-transfer-ndpcApprovalReference",type:"text",value:i.ndpcApprovalReference,onChange:a=>l("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]})]})]}),le&&jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"tiaCompleted",checked:i.tiaCompleted,onChange:a=>l("tiaCompleted",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"tiaCompleted",className:"ndpr-text-sm",children:"TIA completed"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-tiaReference",className:"ndpr-form-field__label",children:"TIA Reference"}),jsx("input",{id:"cb-transfer-tiaReference",type:"text",value:i.tiaReference,onChange:a=>l("tiaReference",a.target.value),placeholder:"Document reference",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]})]})]}),jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsx("button",{onClick:Y,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"}),jsx("button",{onClick:be,className:a$1(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:h$1?"Update Transfer":"Add Transfer"})]})]})},xe=t=>{var u,v;let a=h(t),o=g(t);return jsxs("div",{role:"status","aria-label":"Transfer details",className:a$1("",r==null?void 0:r.detailPanel,d),children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("h3",{className:"ndpr-section-heading",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxs("div",{className:"flex gap-2",children:[W(t.status),Q(t.riskLevel)]})]}),!o.isValid&&jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Compliance Issues"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:o.errors.map((c,s)=>jsx("li",{children:c},s))})]}),o.warnings.length>0&&jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:o.warnings.map((c,s)=>jsx("li",{children:c},s))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Destination:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=ae.find(c=>c.value===t.adequacyStatus))==null?void 0:u.label]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Frequency:"})," ",(v=ne.find(c=>c.value===t.frequency))==null?void 0:v.label]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Start Date:"})," ",A(t.startDate)]}),t.endDate&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"End Date:"})," ",A(t.endDate)]}),t.reviewDate&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",A(t.reviewDate)]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.includesSensitiveData?"Yes":"No"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Transfer Mechanism"}),jsx("div",{className:"ndpr-panel",children:jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:f(t.transferMechanism)})})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Purpose"}),jsx("p",{className:"text-sm ndpr-text-muted bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:t.purpose})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Data Categories"}),jsx("div",{className:"flex flex-wrap gap-1",children:t.dataCategories.map((c,s)=>jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:c},s))})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Safeguards"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-muted",children:t.safeguards.map((c,s)=>jsx("li",{children:c},s))})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Risk Assessment"}),jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:t.riskAssessment}),jsxs("div",{className:"mt-2",role:"status","aria-label":"Automated risk assessment result",children:[jsxs("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:["Automated Assessment (Score: ",a.riskScore,")"]}),a.factors.length>0&&jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:a.factors.map((c,s)=>jsx("li",{children:c},s))}),a.recommendations.length>0&&jsxs("div",{className:"mt-2",children:[jsx("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:"Recommendations:"}),jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:a.recommendations.map((c,s)=>jsx("li",{children:c},s))})]})]})]})]}),t.ndpcApproval&&jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"NDPC Approval"}),jsxs("div",{className:a$1(`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:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",t.ndpcApproval.approved?"Approved":t.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),t.ndpcApproval.referenceNumber&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Applied:"})," ",A(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Approved:"})," ",A(t.ndpcApproval.approvedAt)]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Transfer Impact Assessment"}),jsxs("div",{className:`p-3 rounded-md ${t.tiaCompleted?"ndpr-alert ndpr-alert--success":"ndpr-alert ndpr-alert--warning"}`,children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxs("div",{className:"flex gap-3 mt-6",children:[jsx("button",{onClick:()=>fe(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))] ${I}`,children:"Edit"}),jsx("button",{onClick:()=>ge(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 jsxs("div",{className:a$1(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${pe}`,r==null?void 0:r.root,d),children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.title,d),children:se}),jsx("p",{className:"ndpr-card__subtitle",children:ce}),oe&&Ce(),!V&&jsx("div",{className:"mb-6",children:jsx("button",{onClick:ve,className:a$1(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:"Add Transfer"})}),V&&_e(),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"cbStatusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxs("select",{id:"cbStatusFilter",value:R,onChange:t=>ue(t.target.value),"aria-label":"Filter transfers by status",className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsx("option",{value:"all",children:"All Statuses"}),ie.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cbMechanismFilter",className:"ndpr-form-field__label",children:"Mechanism Filter"}),jsxs("select",{id:"cbMechanismFilter",value:q,onChange:t=>me(t.target.value),"aria-label":"Filter transfers by mechanism",className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsx("option",{value:"all",children:"All Mechanisms"}),z.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),x.length===0?jsx("p",{className:"ndpr-card__subtitle",children:"No cross-border transfers found."}):jsx("div",{className:a$1("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,d),children:x.map(t=>{var a,o;return jsxs("div",{className:a$1(`p-3 rounded-md cursor-pointer ${f$1===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:()=>T(t.id),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),T(t.id));},children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),Q(t.riskLevel)]}),jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:t.recipientOrganization}),jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:he(t.transferMechanism)}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[W(t.status),((a=t.ndpcApproval)==null?void 0:a.required)&&!((o=t.ndpcApproval)!=null&&o.approved)&&jsx("span",{className:"text-xs ndpr-text-info",children:"NDPC Pending"})]})]},t.id)})})]}),jsx("div",{className:"md:col-span-2",children:H?xe(H):jsx("div",{className:"ndpr-empty-state",children:jsx("p",{className:"ndpr-card__subtitle",children:"Select a transfer to view details"})})})]})]})};export{Be as a};
|
package/dist/chunk-B6BRD5SL.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {d,a as a$1}from'./chunk-LWIKDDSU.mjs';import {a as a$2}from'./chunk-DBZSN4WP.mjs';import {b,a}from'./chunk-ZJYULEER.mjs';import {useRef,useState,useEffect,useCallback}from'react';function F(v,c){return c?a$2(v):{load:()=>null,save:()=>{},remove:()=>{}}}function z({initialActivities:v=[],adapter:c,storageKey:b$1="ndpr_lawful_basis_activities",useLocalStorage:x=true,onAdd:g,onUpdate:A,onRemove:y}={}){let p=c!=null?c:F(b$1,x),f=useRef(p);f.current=p;let[o,u]=useState(v),[R,l]=useState(true);useEffect(()=>{let t=false;try{let i=f.current.load();i instanceof Promise?i.then(e=>{t||(e&&u(e),l(!1));},()=>{t||l(!1);}):(i&&u(i),l(!1));}catch(i){t||l(false);}return ()=>{t=true;}},[]);let a$2=useCallback(t=>{Promise.resolve(f.current.save(t)).catch(i=>{console.warn("[ndpr-toolkit] Failed to save lawful basis activities:",i);});},[]),_=()=>"lb_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),h=useCallback(t=>{let i=Date.now(),e=b(a({},t),{id:_(),createdAt:i,updatedAt:i});return u(s=>{let r=[...s,e];return a$2(r),r}),g&&g(e),e},[g,a$2]),O=useCallback((t,i)=>{let e=null;return u(s=>{let r=s.findIndex(k=>k.id===t);if(r===-1)return s;e=b(a(a({},s[r]),i),{id:s[r].id,updatedAt:Date.now()});let P=[...s];return P[r]=e,a$2(P),P}),e&&A&&A(e),e},[A,a$2]),D=useCallback(t=>{u(i=>{let e=i.filter(s=>s.id!==t);return a$2(e),e}),y&&y(t);},[y,a$2]),I=useCallback(t=>o.find(i=>i.id===t)||null,[o]),U=useCallback(()=>d(o),[o]),V=useCallback(t=>a$1(t),[]);return {activities:o,addActivity:h,updateActivity:O,removeActivity:D,getActivity:I,getSummary:U,validateActivity:V,isLoading:R}}export{z as a};
|
package/dist/chunk-C5UYAOYX.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {c,d}from'./chunk-MGXWQW5I.mjs';import {a as a$1}from'./chunk-6A7M4CGJ.mjs';import {a}from'./chunk-WJSUVPYX.mjs';import {useMemo}from'react';function u(t,e){return useMemo(()=>a(t,e),[t,e])}function M({input:t}){let e=JSON.stringify(t);return useMemo(()=>a$1(t),[e])}function D(t,e){return useMemo(()=>c(t,e),[t.dataSubjectsInSixMonths,t.isDesignated,e])}function P(t,e){return useMemo(()=>d(t,e),[t.commencementDate,t.asOf,t.tier,e])}export{u as a,M as b,D as c,P as d};
|
package/dist/chunk-DKLJ5DYN.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';function i(e){let t=[];if((!e.consents||Object.keys(e.consents).length===0)&&t.push({field:"consents",code:"consents_required",message:"Consent settings must include at least one consent option"}),e.timestamp?(typeof e.timestamp!="number"||isNaN(e.timestamp))&&t.push({field:"timestamp",code:"timestamp_invalid",message:"Consent timestamp must be a valid number"}):t.push({field:"timestamp",code:"timestamp_required",message:"Consent timestamp is required"}),e.version||t.push({field:"version",code:"version_required",message:"Consent version is required"}),e.method||t.push({field:"method",code:"method_required",message:"Consent collection method is required"}),e.hasInteracted===void 0&&t.push({field:"hasInteracted",code:"has_interacted_required",message:"User interaction status is required"}),e.timestamp){let r=new Date;r.setMonth(r.getMonth()-13);let s=r.getTime();e.timestamp<s&&t.push({field:"timestamp",code:"consent_stale",message:"Consent is older than 13 months and should be refreshed"});}return t.length>0?{valid:false,errors:t}:{valid:true,errors:[],data:e}}function n(e){let t=[];return (!e||e.length===0)&&t.push({field:"options",code:"options_required",message:"At least one consent option is required"}),e==null||e.forEach((r,s)=>{(!r.purpose||r.purpose.trim()==="")&&t.push({field:`options[${s}].purpose`,code:"purpose_required",message:`Consent option "${r.id}" is missing a purpose. NDPA Section 26 requires consent to be specific to a stated purpose.`});}),t.length>0?{valid:false,errors:t}:{valid:true,errors:[],data:e}}exports.a=i;exports.b=n;
|
package/dist/chunk-EAV4BZKO.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-EWVK45Z3.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-PHA3YMFO.mjs';import {b,a as a$1}from'./chunk-ZJYULEER.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var Tr=({requestTypes:y,onSubmit:nr,onValidationError:F,title:T,description:C,submitButtonText:$,className:q="",buttonClassName:dr="",showConfirmation:pr=true,confirmationMessage:ar="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:O=true,identifierTypes:D=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:ur=true,labels:v={},classNames:r,unstyled:e=false,isSubmitting:A=false,defaultValues:p,onReset:I})=>{var W,J,K,Q,X,V,N,s,rr;if(!Array.isArray(y))throw new Error("[ndpr-toolkit] <DSRRequestForm requestTypes={...} /> requires an array of RequestType[]. See https://ndprtoolkit.com.ng/docs/components/dsr#requesttypes \u2014 or use the `<NDPRSubjectRights />` preset which ships sensible defaults.");let x=c(),br=(W=T!=null?T:x.dsr.title)!=null?W:"Submit a Data Subject Request",fr=(J=C!=null?C:x.dsr.description)!=null?J:"Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part VI.",lr=(K=$!=null?$:x.dsr.submitRequest)!=null?K:"Submit Request",[c$1,z]=useState((p==null?void 0:p.requestType)||""),[P,B]=useState(((Q=p==null?void 0:p.dataSubject)==null?void 0:Q.fullName)||""),[S,M]=useState(((X=p==null?void 0:p.dataSubject)==null?void 0:X.email)||""),[k,Z]=useState(((V=p==null?void 0:p.dataSubject)==null?void 0:V.phone)||""),[G,L]=useState(((N=p==null?void 0:p.dataSubject)==null?void 0:N.identifierType)||((s=D[0])==null?void 0:s.id)||""),[w,Y]=useState(((rr=p==null?void 0:p.dataSubject)==null?void 0:rr.identifierValue)||""),[l,j]=useState((p==null?void 0:p.additionalInfo)||{}),[_r,E]=useState(false),[d,H]=useState({}),mr=()=>{var i;z(""),B(""),M(""),Z(""),L(((i=D[0])==null?void 0:i.id)||""),Y(""),j({}),E(false),H({}),I==null||I();},a$3=y.find(i=>i.id===c$1),gr=i=>{z(i.target.value),j({});},h=(i,b$1)=>{j(_=>b(a$1({},_),{[i]:b$1}));},vr=()=>{let i={};return P.trim()||(i.fullName="Full name is required"),S.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(S)||(i.email="Email is invalid"):i.email="Email is required",c$1||(i.requestType="Please select a request type"),O&&!w.trim()&&(i.identifierValue="Identifier value is required"),a$3!=null&&a$3.requiresAdditionalInfo&&a$3.additionalFields&&a$3.additionalFields.forEach(b=>{b.required&&!l[b.id]&&(i[`additional_${b.id}`]=`${b.label} is required`);}),H(i),i},hr=i=>{i.preventDefault();let b=vr();if(Object.keys(b).length>0){F==null||F(b);return}let _=Object.keys(l).length>0?Object.fromEntries(Object.entries(l).map(([u,m])=>[u,typeof m=="string"?a$2(m):m])):void 0,R={requestType:c$1,dataSubject:{fullName:a$2(P),email:a$2(S),phone:k?a$2(k):void 0,identifierType:G,identifierValue:a$2(w)},additionalInfo:_,submittedAt:Date.now()};nr(R),pr&&E(true);},U=`ndpr-dsr-form__button ndpr-dsr-form__button--primary ${dr}`.trim(),qr="ndpr-dsr-form__button ndpr-dsr-form__button--secondary";return _r?jsxs("div",{"data-ndpr-component":"dsr-request-form","data-ndpr-state":"submitted",className:a(`ndpr-dsr-form__success${q?` ${q}`:""}`,r==null?void 0:r.successMessage,e),"aria-live":"polite",children:[jsx("h2",{className:a("ndpr-dsr-form__success-title",r==null?void 0:r.title,e),children:"Request Submitted"}),jsx("p",{className:a("ndpr-dsr-form__success-body",r==null?void 0:r.description,e),children:ar}),jsx("button",{onClick:()=>E(false),className:a(U,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),e),children:"Submit Another Request"})]}):jsxs("div",{"data-ndpr-component":"dsr-request-form",className:a(`ndpr-dsr-form${q?` ${q}`:""}`,r==null?void 0:r.root,e),children:[jsx("h2",{className:a("ndpr-dsr-form__title",r==null?void 0:r.title,e),children:br}),jsx("p",{className:a("ndpr-dsr-form__description",r==null?void 0:r.description,e),children:fr}),jsx("form",{onSubmit:hr,className:a("",r==null?void 0:r.form,e),children:jsxs("div",{className:a("ndpr-dsr-form__sections",r==null?void 0:r.fieldGroup,e),children:[jsxs("div",{children:[jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Personal Information"}),jsxs("div",{className:e?"":"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"fullName",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:[v.name||"Full Name"," ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"fullName",value:P,onChange:i=>B(i.target.value),className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:true,"aria-required":"true","aria-invalid":!!d.fullName,"aria-describedby":d.fullName?"fullName-error":void 0}),d.fullName&&jsx("p",{id:"fullName-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.fullName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"email",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:[v.email||"Email Address"," ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"email",id:"email",value:S,onChange:i=>M(i.target.value),className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:true,"aria-required":"true","aria-invalid":!!d.email,"aria-describedby":d.email?"email-error":void 0}),d.email&&jsx("p",{id:"email-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.email})]}),ur&&jsxs("div",{children:[jsx("label",{htmlFor:"phone",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:"Phone Number (Optional)"}),jsx("input",{type:"tel",id:"phone",value:k,onChange:i=>Z(i.target.value),className:a("ndpr-form-field__input",r==null?void 0:r.input,e)})]})]})]}),jsxs("div",{children:[jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Request Details"}),jsxs("div",{className:e?"":"ndpr-form-field",children:[jsxs("label",{htmlFor:"requestType",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:[v.requestType||"Request Type"," ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsxs("select",{id:"requestType",value:c$1,onChange:gr,className:a("ndpr-form-field__select",r==null?void 0:r.select,e),required:true,"aria-required":"true","aria-invalid":!!d.requestType,"aria-describedby":d.requestType?"requestType-error":void 0,children:[jsx("option",{value:"",children:"Select a request type"}),y.map(i=>jsx("option",{value:i.id,children:i.name},i.id))]}),d.requestType&&jsx("p",{id:"requestType-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.requestType})]}),a$3&&jsxs("div",{className:e?"":"ndpr-dsr-form__type-info",children:[jsx("p",{children:a$3.description}),jsxs("p",{children:["Estimated completion time: ",a$3.estimatedCompletionTime," ",a$3.estimatedCompletionTime===1?"day":"days"]})]}),jsxs("div",{className:e?"":"ndpr-form-field",children:[jsx("label",{htmlFor:"requestDescription",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:v.description||"Additional Information"}),jsx("textarea",{id:"requestDescription",className:a("ndpr-form-field__textarea",r==null?void 0:r.textarea,e),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),O&&jsxs("div",{children:[jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Identity Verification"}),jsx("p",{className:e?"":"ndpr-form-section__hint",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxs("div",{className:e?"":"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"identifierType",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:["Identifier Type ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsx("select",{id:"identifierType",value:G,onChange:i=>L(i.target.value),className:a("ndpr-form-field__select",r==null?void 0:r.select,e),required:true,"aria-required":"true",children:D.map(i=>jsx("option",{value:i.id,children:i.label},i.id))})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"identifierValue",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:["Identifier Value ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"identifierValue",value:w,onChange:i=>Y(i.target.value),className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:true,"aria-required":"true","aria-invalid":!!d.identifierValue,"aria-describedby":d.identifierValue?"identifierValue-error":void 0}),d.identifierValue&&jsx("p",{id:"identifierValue-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.identifierValue})]})]})]}),(a$3==null?void 0:a$3.requiresAdditionalInfo)&&a$3.additionalFields&&a$3.additionalFields.length>0&&jsxs("div",{children:[jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Additional Information"}),jsx("div",{className:e?"":"ndpr-form-section",children:a$3.additionalFields.map(i=>{var b,_,R;return jsxs("div",{children:[jsxs("label",{htmlFor:i.id,className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:[i.label," ",i.required&&jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),i.type==="text"&&jsx("input",{type:"text",id:i.id,value:String((b=l[i.id])!=null?b:""),onChange:u=>h(i.id,u.target.value),placeholder:i.placeholder,className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0}),i.type==="textarea"&&jsx("textarea",{id:i.id,value:String((_=l[i.id])!=null?_:""),onChange:u=>h(i.id,u.target.value),placeholder:i.placeholder,className:a("ndpr-form-field__textarea",r==null?void 0:r.textarea,e),rows:4,required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0}),i.type==="select"&&i.options&&jsxs("select",{id:i.id,value:String((R=l[i.id])!=null?R:""),onChange:u=>h(i.id,u.target.value),className:a("ndpr-form-field__select",r==null?void 0:r.select,e),required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0,children:[jsx("option",{value:"",children:i.placeholder||"Select an option"}),i.options.map(u=>jsx("option",{value:u,children:u},u))]}),i.type==="checkbox"&&jsxs("div",{className:e?"":"ndpr-form-field__checkbox-row",children:[jsx("input",{type:"checkbox",id:i.id,checked:!!l[i.id],onChange:u=>h(i.id,u.target.checked),className:e?"":"ndpr-form-field__checkbox",required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0}),jsx("label",{htmlFor:i.id,className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:i.placeholder||i.label})]}),i.type==="file"&&jsx("input",{type:"file",id:i.id,onChange:u=>{var ir;let m=(ir=u.target.files)==null?void 0:ir[0];m&&h(i.id,m.name);},className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0}),d[`additional_${i.id}`]&&jsx("p",{id:`additional-${i.id}-error`,role:"alert",className:e?"":"ndpr-form-field__error",children:d[`additional_${i.id}`]})]},i.id)})})]}),jsxs("div",{className:e?"":"ndpr-dsr-form__notice",children:[jsx("h3",{className:e?"":"ndpr-dsr-form__notice-title",children:"Privacy Notice"}),jsx("p",{className:e?"":"ndpr-dsr-form__notice-body",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxs("div",{className:e?"":"ndpr-dsr-form__actions",children:[A&&(r==null?void 0:r.loadingOverlay)&&jsx("div",{className:r.loadingOverlay}),jsx("button",{type:"submit",disabled:A,className:a(U,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),e),children:A?"Submitting...":v.submit||lr}),jsx("button",{type:"button",onClick:mr,className:a(qr,void 0,e),children:"Reset"})]})]})})]})};
|
|
2
|
-
export{Tr as a};
|