@tantainnovative/ndpr-toolkit 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/dist/{breach-6z0r-KuE.d.mts → breach-B_-6lDqS.d.mts} +1 -1
- package/dist/{breach-BFfnvtRk.d.ts → breach-CzXqSsaY.d.ts} +1 -1
- package/dist/{breach-BtFbDOmV.d.mts → breach-Eu9byel8.d.mts} +1 -1
- package/dist/{breach-BtFbDOmV.d.ts → breach-Eu9byel8.d.ts} +1 -1
- package/dist/breach.d.mts +81 -5
- package/dist/breach.d.ts +81 -5
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-4RGDNVR5.mjs +72 -0
- package/dist/chunk-6LM3RAFO.js +7 -0
- package/dist/chunk-7DNQSOER.js +2 -0
- package/dist/chunk-A7DRHSDQ.mjs +2 -0
- package/dist/chunk-FC6EG34C.js +72 -0
- package/dist/chunk-FDB6KZUD.mjs +2 -0
- package/dist/chunk-FZUCKGIM.mjs +7 -0
- package/dist/chunk-G3JNFZPT.js +2 -0
- package/dist/chunk-HXCRMA4J.mjs +2 -0
- package/dist/chunk-IC7VOOKJ.mjs +2 -0
- package/dist/chunk-ICUZG6CD.mjs +2 -0
- package/dist/chunk-IW5PHOG7.mjs +7 -0
- package/dist/chunk-JKEAPTYP.js +7 -0
- package/dist/chunk-N52S64SU.js +2 -0
- package/dist/chunk-SKAMVXBI.mjs +94 -0
- package/dist/chunk-VURIXCGY.js +2 -0
- package/dist/chunk-VXRY3V42.js +94 -0
- package/dist/chunk-YBPHGEL2.js +2 -0
- package/dist/consent.d.mts +68 -2
- package/dist/consent.d.ts +68 -2
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +10 -10
- package/dist/core.d.ts +10 -10
- package/dist/{cross-border-BrIy1ieh.d.ts → cross-border-BMcqLvjC.d.mts} +1 -1
- package/dist/{cross-border-BrIy1ieh.d.mts → cross-border-BMcqLvjC.d.ts} +1 -1
- package/dist/cross-border-entry-BfF7jw5o.d.mts +84 -0
- package/dist/cross-border-entry-CtX8_o-_.d.ts +84 -0
- package/dist/cross-border.d.mts +4 -58
- package/dist/cross-border.d.ts +4 -58
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/{dpia-vWfE_9bO.d.mts → dpia-5OQVA1R_.d.mts} +1 -1
- package/dist/{dpia-vWfE_9bO.d.ts → dpia-5OQVA1R_.d.ts} +1 -1
- package/dist/{dpia-fdtTd2DI.d.ts → dpia-B0Pok5us.d.ts} +1 -1
- package/dist/{dpia-B9ZZJG5a.d.mts → dpia-CUfOmzvX.d.mts} +1 -1
- package/dist/dpia.d.mts +105 -5
- package/dist/dpia.d.ts +105 -5
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/{dsr-pQzQ3H1O.d.mts → dsr-Cm9lzWG7.d.mts} +1 -1
- package/dist/{dsr-pQzQ3H1O.d.ts → dsr-Cm9lzWG7.d.ts} +1 -1
- package/dist/{dsr-whPkiI0_.d.mts → dsr-D_eTNc4S.d.mts} +1 -1
- package/dist/{dsr-jq5NUEdz.d.ts → dsr-pNtVb1BK.d.ts} +1 -1
- package/dist/dsr.d.mts +66 -5
- package/dist/dsr.d.ts +66 -5
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +13 -13
- package/dist/hooks.d.ts +13 -13
- package/dist/index.d.mts +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{lawful-basis-v04AhbK2.d.ts → lawful-basis-BEyI0kGg.d.ts} +2 -2
- package/dist/{lawful-basis-D-oXFizg.d.mts → lawful-basis-C2eGaoHM.d.mts} +2 -2
- package/dist/{lawful-basis-CWtvDG1x.d.mts → lawful-basis-Cv1VmDLn.d.mts} +1 -1
- package/dist/{lawful-basis-CWtvDG1x.d.ts → lawful-basis-Cv1VmDLn.d.ts} +1 -1
- package/dist/lawful-basis-entry-BeSX7u0U.d.ts +81 -0
- package/dist/lawful-basis-entry-CMPPM9Rh.d.mts +81 -0
- package/dist/lawful-basis.d.mts +5 -55
- package/dist/lawful-basis.d.ts +5 -55
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy-dmsRlqgM.d.ts +283 -0
- package/dist/policy-kZN23hrR.d.mts +283 -0
- package/dist/policy.d.mts +3 -193
- package/dist/policy.d.ts +3 -193
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/{ropa-Rb4dsFSz.d.mts → ropa-DP7pPPql.d.mts} +2 -2
- package/dist/{ropa-BebGfqKQ.d.ts → ropa-Li6UlL5H.d.ts} +2 -2
- package/dist/ropa-entry-CZJ91ymk.d.mts +71 -0
- package/dist/ropa-entry-DIEQ9WFs.d.ts +71 -0
- package/dist/ropa.d.mts +5 -45
- package/dist/ropa.d.ts +5 -45
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/dist/{useBreach-WrZzJilM.d.mts → useBreach-BBSoIcZO.d.mts} +1 -1
- package/dist/{useBreach-vrh_XMpI.d.ts → useBreach-lFLbSyAN.d.ts} +1 -1
- package/dist/{useCrossBorderTransfer-TVnY8_UX.d.mts → useCrossBorderTransfer-BZVFCXfr.d.mts} +1 -1
- package/dist/{useCrossBorderTransfer-D4FQYfFt.d.ts → useCrossBorderTransfer-DmtACeqW.d.ts} +1 -1
- package/dist/{useDPIA-DFDHBLSa.d.ts → useDPIA-DBsg2yZx.d.ts} +1 -1
- package/dist/{useDPIA-FqPofFaV.d.mts → useDPIA-Da7-Q_yW.d.mts} +1 -1
- package/dist/{useDSR-DAqqOBXb.d.ts → useDSR-CYI7WCXr.d.ts} +1 -1
- package/dist/{useDSR-OXM5Q9rf.d.mts → useDSR-YYZ6FYFs.d.mts} +1 -1
- package/dist/{useLawfulBasis-RILM_xsx.d.ts → useLawfulBasis-CCWF9waR.d.ts} +2 -2
- package/dist/{useLawfulBasis-DNQ8YszQ.d.mts → useLawfulBasis-CpWuHtyh.d.mts} +2 -2
- package/dist/{useROPA-Bcs6cRdi.d.ts → useROPA-BhJ3kvHp.d.ts} +1 -1
- package/dist/{useROPA-nmcSiUYv.d.mts → useROPA-DLFdjkxP.d.mts} +1 -1
- package/package.json +33 -17
- package/dist/breach.js.map +0 -1
- package/dist/breach.mjs.map +0 -1
- package/dist/chunk-2SYNHRP6.mjs.map +0 -1
- package/dist/chunk-2XHD22J7.mjs +0 -7
- package/dist/chunk-2XHD22J7.mjs.map +0 -1
- package/dist/chunk-3YCV2BA6.js.map +0 -1
- package/dist/chunk-4A354HL3.js.map +0 -1
- package/dist/chunk-4DKT6IB6.js +0 -94
- package/dist/chunk-4DKT6IB6.js.map +0 -1
- package/dist/chunk-5ZBO2UPH.js.map +0 -1
- package/dist/chunk-6GGGTRDZ.mjs.map +0 -1
- package/dist/chunk-6JFTAYXV.mjs +0 -2
- package/dist/chunk-6JFTAYXV.mjs.map +0 -1
- package/dist/chunk-6JVYYLS7.js +0 -2
- package/dist/chunk-6JVYYLS7.js.map +0 -1
- package/dist/chunk-6SGG6WPA.mjs +0 -2
- package/dist/chunk-6SGG6WPA.mjs.map +0 -1
- package/dist/chunk-AQEGDEQM.js +0 -7
- package/dist/chunk-AQEGDEQM.js.map +0 -1
- package/dist/chunk-C2IJWCZQ.mjs +0 -2
- package/dist/chunk-C2IJWCZQ.mjs.map +0 -1
- package/dist/chunk-CMZTI7SG.js.map +0 -1
- package/dist/chunk-DB3JH4DS.mjs.map +0 -1
- package/dist/chunk-FFW7RUAG.mjs +0 -94
- package/dist/chunk-FFW7RUAG.mjs.map +0 -1
- package/dist/chunk-FK3CSFLJ.js +0 -2
- package/dist/chunk-FK3CSFLJ.js.map +0 -1
- package/dist/chunk-GIV2OHE6.mjs.map +0 -1
- package/dist/chunk-GMLNWS2N.mjs.map +0 -1
- package/dist/chunk-IQF726GS.js.map +0 -1
- package/dist/chunk-IWUUVRLJ.js.map +0 -1
- package/dist/chunk-JUN6YPLL.mjs +0 -72
- package/dist/chunk-JUN6YPLL.mjs.map +0 -1
- package/dist/chunk-L3FKTBGV.js +0 -72
- package/dist/chunk-L3FKTBGV.js.map +0 -1
- package/dist/chunk-L52PDW6O.mjs.map +0 -1
- package/dist/chunk-LI6WJ3LZ.js.map +0 -1
- package/dist/chunk-LXRXDTPI.js.map +0 -1
- package/dist/chunk-MQFZHA2D.js.map +0 -1
- package/dist/chunk-OITITR6K.mjs.map +0 -1
- package/dist/chunk-PDJGTQMY.mjs.map +0 -1
- package/dist/chunk-PGSA2O5P.mjs.map +0 -1
- package/dist/chunk-PM7CMTMB.js.map +0 -1
- package/dist/chunk-PYEX7DFR.mjs.map +0 -1
- package/dist/chunk-QKK5S54L.mjs.map +0 -1
- package/dist/chunk-RB26MIRI.js +0 -2
- package/dist/chunk-RB26MIRI.js.map +0 -1
- package/dist/chunk-RGYK4VAY.mjs.map +0 -1
- package/dist/chunk-RHWW5FDP.js +0 -16
- package/dist/chunk-RHWW5FDP.js.map +0 -1
- package/dist/chunk-RYZEIDNR.js.map +0 -1
- package/dist/chunk-SLNMKGQ2.mjs +0 -2
- package/dist/chunk-SLNMKGQ2.mjs.map +0 -1
- package/dist/chunk-SSGJREE3.js.map +0 -1
- package/dist/chunk-SWF3YVE5.js.map +0 -1
- package/dist/chunk-T44JQT2O.mjs.map +0 -1
- package/dist/chunk-TDDAYVKK.js.map +0 -1
- package/dist/chunk-TXBZPCGF.mjs.map +0 -1
- package/dist/chunk-UUWVBENC.js +0 -2
- package/dist/chunk-UUWVBENC.js.map +0 -1
- package/dist/chunk-UYP64PV7.mjs.map +0 -1
- package/dist/chunk-VMJBW3EF.mjs.map +0 -1
- package/dist/chunk-WW3X3ELF.js.map +0 -1
- package/dist/chunk-WWT2ZSNU.mjs.map +0 -1
- package/dist/chunk-XMKA6GVK.mjs +0 -16
- package/dist/chunk-XMKA6GVK.mjs.map +0 -1
- package/dist/chunk-Y34DQYS7.js.map +0 -1
- package/dist/chunk-ZU73VG3X.js.map +0 -1
- package/dist/consent.js.map +0 -1
- package/dist/consent.mjs.map +0 -1
- package/dist/core.js.map +0 -1
- package/dist/core.mjs.map +0 -1
- package/dist/cross-border.js.map +0 -1
- package/dist/cross-border.mjs.map +0 -1
- package/dist/dpia.js.map +0 -1
- package/dist/dpia.mjs.map +0 -1
- package/dist/dsr.js.map +0 -1
- package/dist/dsr.mjs.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/hooks.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/lawful-basis.js.map +0 -1
- package/dist/lawful-basis.mjs.map +0 -1
- package/dist/policy.js.map +0 -1
- package/dist/policy.mjs.map +0 -1
- package/dist/ropa.js.map +0 -1
- package/dist/ropa.mjs.map +0 -1
- package/dist/unstyled.js.map +0 -1
- package/dist/unstyled.mjs.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkSWF3YVE5_js=require('./chunk-SWF3YVE5.js'),chunkVURIXCGY_js=require('./chunk-VURIXCGY.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var I=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],Z=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],ke=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}];function we(){let l=Date.now();return {id:`proc_${l}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:l,updatedAt:l}}function ee(l){return l?new Date(l).toLocaleDateString():"N/A"}var Pe=({ropa:l,onAddRecord:R,onUpdateRecord:S,onArchiveRecord:P,title:te="Record of Processing Activities (ROPA)",description:re="Maintain a comprehensive record of all data processing activities as required by the NDPA 2023.",className:ae="",buttonClassName:A="",classNames:t,unstyled:d})=>{let[b,x]=react.useState("list"),[w,ie]=react.useState(""),[C,oe]=react.useState("all"),[D,de]=react.useState("all"),[n,f]=react.useState(null),[M,h]=react.useState([]),[O,L]=react.useState(""),[j,_]=react.useState(""),[E,T]=react.useState(""),[U,$]=react.useState(""),[J,q]=react.useState(""),[V,G]=react.useState(""),[z,H]=react.useState(""),c=react.useMemo(()=>chunkSWF3YVE5_js.b(l),[l]),v=react.useMemo(()=>chunkSWF3YVE5_js.d(l),[l]),W=react.useMemo(()=>{let a=[...l.records];if(C!=="all"&&(a=a.filter(r=>r.status===C)),D!=="all"&&(a=a.filter(r=>r.lawfulBasis===D)),w){let r=w.toLowerCase();a=a.filter(u=>u.name.toLowerCase().includes(r)||u.description.toLowerCase().includes(r)||u.dataCategories.some(m=>m.toLowerCase().includes(r))||u.department&&u.department.toLowerCase().includes(r));}return a},[l.records,C,D,w]);react.useEffect(()=>{n&&(L(n.purposes.join(", ")),_(n.dataCategories.join(", ")),T((n.sensitiveDataCategories||[]).join(", ")),$(n.dataSubjectCategories.join(", ")),q(n.recipients.join(", ")),G(n.securityMeasures.join(", ")),H((n.systemsUsed||[]).join(", ")));},[n==null?void 0:n.id]);let ne=()=>{let a=we();a.controllerDetails.name=l.organizationName,a.controllerDetails.contact=l.organizationContact,a.controllerDetails.address=l.organizationAddress,l.ndpcRegistrationNumber&&(a.controllerDetails.registrationNumber=l.ndpcRegistrationNumber),l.dpoDetails&&(a.controllerDetails.dpoContact=l.dpoDetails.email),f(a),h([]),x("form");},le=a=>{f(chunkMQFZHA2D_js.a({},a)),h([]),x("form");},p=a=>a.split(",").map(r=>r.trim()).filter(r=>r.length>0),ue=()=>{if(!n)return;let a=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{purposes:p(O),dataCategories:p(j),sensitiveDataCategories:p(E),dataSubjectCategories:p(U),recipients:p(J),securityMeasures:p(V),systemsUsed:p(z),updatedAt:Date.now()});a.sensitiveDataCategories&&a.sensitiveDataCategories.length===0&&(a.sensitiveDataCategories=void 0),a.systemsUsed&&a.systemsUsed.length===0&&(a.systemsUsed=void 0);let r=chunkSWF3YVE5_js.a(a);if(!r.valid){h(r.errors);return}l.records.find(m=>m.id===a.id)?S==null||S(a.id,a):R==null||R(a),f(null),h([]),x("list");},se=a=>{P==null||P(a);},ge=()=>{let a=chunkSWF3YVE5_js.c(l),r=new Blob([a],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(r),m=document.createElement("a");m.href=u,m.download=`ropa_${l.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(u),100);},K=()=>{f(null),h([]),x("list");},s=(a,r)=>{n&&f(u=>u&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{[a]:r}));},F=(a,r)=>{n&&f(u=>u&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{controllerDetails:chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u.controllerDetails),{[a]:r})}));},ce=a=>!!a.nextReviewDate&&a.nextReviewDate<=Date.now(),me=a=>{let r={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},u={active:"Active",inactive:"Inactive",archived:"Archived"};return jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a(`px-2 py-1 rounded text-xs font-medium ${r[a]}`,t==null?void 0:t.statusBadge,d),children:u[a]})},pe=a=>jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",children:{consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"}[a]}),be=()=>jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",t==null?void 0:t.orgInfo,d),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Organization"}),jsxRuntime.jsx("p",{className:"text-sm font-semibold",children:l.organizationName})]}),l.dpoDetails&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Data Protection Officer"}),jsxRuntime.jsx("p",{className:"text-sm font-semibold",children:l.dpoDetails.name}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l.dpoDetails.email})]}),l.ndpcRegistrationNumber&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"NDPC Registration No."}),jsxRuntime.jsx("p",{className:"text-sm font-semibold",children:l.ndpcRegistrationNumber})]})]}),jsxRuntime.jsxs("div",{className:"mt-2 text-xs text-gray-500 dark:text-gray-400",children:["Version ",l.version," | Last Updated: ",ee(l.lastUpdated)]})]}),xe=()=>jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6",t==null?void 0:t.summary,d),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",t==null?void 0:t.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:c.totalRecords}),jsxRuntime.jsx("p",{className:"text-xs text-blue-600 dark:text-blue-400",children:"Total Records"})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",t==null?void 0:t.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-green-700 dark:text-green-300",children:c.activeRecords}),jsxRuntime.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"Active"})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",t==null?void 0:t.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-700 dark:text-purple-300",children:c.crossBorderRecords}),jsxRuntime.jsx("p",{className:"text-xs text-purple-600 dark:text-purple-400",children:"Cross-Border"})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",t==null?void 0:t.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-orange-700 dark:text-orange-300",children:v.length}),jsxRuntime.jsx("p",{className:"text-xs text-orange-600 dark:text-orange-400",children:"Records with Gaps"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-2",children:"By Lawful Basis"}),I.map(a=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:a.label.split(" (")[0]}),jsxRuntime.jsx("span",{className:"font-medium",children:c.byLawfulBasis[a.value]||0})]},a.value))]}),jsxRuntime.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-2",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Sensitive Data"}),jsxRuntime.jsx("span",{className:"font-medium",children:c.sensitiveDataRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"DPIA Required"}),jsxRuntime.jsx("span",{className:"font-medium",children:c.dpiaRequiredRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Automated Decisions"}),jsxRuntime.jsx("span",{className:"font-medium",children:c.automatedDecisionRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Due for Review"}),jsxRuntime.jsx("span",{className:`font-medium ${c.recordsDueForReview.length>0?"text-red-600 dark:text-red-400":""}`,children:c.recordsDueForReview.length})]})]}),c.topDepartments.length>0&&jsxRuntime.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-2",children:"Top Departments"}),c.topDepartments.slice(0,5).map(a=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:a.department}),jsxRuntime.jsx("span",{className:"font-medium",children:a.count})]},a.department))]})]}),v.length>0&&jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",t==null?void 0:t.complianceGap,d),children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-2",children:"Compliance Gaps Detected"}),v.slice(0,5).map(a=>jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-red-700 dark:text-red-300",children:a.recordName}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:a.gaps.map((r,u)=>jsxRuntime.jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:r},u))})]},a.recordId)),v.length>5&&jsxRuntime.jsxs("p",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:["...and ",v.length-5," more record(s) with gaps."]})]})]}),fe=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaSearch",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"ropaSearch",value:w,onChange:a=>ie(a.target.value),placeholder:"Search records...",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaStatusFilter",className:"block text-sm font-medium mb-1",children:"Status"}),jsxRuntime.jsxs("select",{id:"ropaStatusFilter",value:C,onChange:a=>oe(a.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.select,d),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),Z.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaBasisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"ropaBasisFilter",value:D,onChange:a=>de(a.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.select,d),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),I.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label.split(" (")[0]},a.value))]})]}),jsxRuntime.jsxs("div",{className:"flex items-end space-x-2",children:[jsxRuntime.jsx("button",{onClick:ne,className:chunkVURIXCGY_js.a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 text-sm ${A}`,t==null?void 0:t.submitButton,d),children:"Add Record"}),jsxRuntime.jsx("button",{onClick:ge,className:chunkVURIXCGY_js.a(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${A}`,t==null?void 0:t.exportButton,d),children:"Export CSV"})]})]}),W.length===0?jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm text-center py-8",children:"No processing records found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkVURIXCGY_js.a("w-full text-sm text-left",t==null?void 0:t.table,d),children:[jsxRuntime.jsx("thead",{className:chunkVURIXCGY_js.a("text-xs uppercase bg-gray-50 dark:bg-gray-700",t==null?void 0:t.tableHeader,d),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Name"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Data Categories"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Status"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Last Reviewed"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:W.map(a=>{let r=ce(a),u=v.some(m=>m.recordId===a.id);return jsxRuntime.jsxs("tr",{className:chunkVURIXCGY_js.a(`border-b dark:border-gray-600 ${r?"bg-red-50 dark:bg-red-900/10":u?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,t==null?void 0:t.tableRow,d),children:[jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:a.name}),a.department&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:a.department}),r&&jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-medium",children:"Review Overdue"})]})}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:pe(a.lawfulBasis)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 max-w-xs truncate",children:a.dataCategories.join(", ")})}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:me(a.status)}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-xs text-gray-500 dark:text-gray-400",children:ee(a.lastReviewedAt)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("button",{onClick:()=>le(a),className:"text-blue-600 dark:text-blue-400 hover:underline text-xs",children:"Edit"}),a.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>se(a.id),className:"text-gray-600 dark:text-gray-400 hover:underline text-xs",children:"Archive"})]})})]},a.id)})})]})})]}),ve=()=>{if(!n)return null;let a=!l.records.find(r=>r.id===n.id);return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("",t==null?void 0:t.form,d),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("flex justify-between items-center mb-4",t==null?void 0:t.header,d),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:a?"Add Processing Record":"Edit Processing Record"}),jsxRuntime.jsx("button",{onClick:K,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 text-sm",children:"Cancel"})]}),M.length>0&&jsxRuntime.jsxs("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:M.map((r,u)=>jsxRuntime.jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:r},u))})]}),jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Basic Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"recordName",value:n.name,onChange:r=>s("name",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"e.g., Customer Account Management"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordDepartment",className:"block text-sm font-medium mb-1",children:"Department"}),jsxRuntime.jsx("input",{type:"text",id:"recordDepartment",value:n.department||"",onChange:r=>s("department",r.target.value||void 0),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"e.g., Marketing"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"recordDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"recordDescription",value:n.description,onChange:r=>s("description",r.target.value),rows:3,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"Describe what personal data processing is performed..."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordStatus",className:"block text-sm font-medium mb-1",children:"Status *"}),jsxRuntime.jsx("select",{id:"recordStatus",value:n.status,onChange:r=>s("status",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.select,d),children:Z.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Controller Details"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerName",className:"block text-sm font-medium mb-1",children:"Controller Name *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerName",value:n.controllerDetails.name,onChange:r=>F("name",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerContact",className:"block text-sm font-medium mb-1",children:"Controller Contact *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerContact",value:n.controllerDetails.contact,onChange:r=>F("contact",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"controllerAddress",className:"block text-sm font-medium mb-1",children:"Controller Address *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerAddress",value:n.controllerDetails.address,onChange:r=>F("address",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d)})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Lawful Basis (NDPA Section 25)"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:n.lawfulBasis,onChange:r=>s("lawfulBasis",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.select,d),children:I.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasisJustification",className:"block text-sm font-medium mb-1",children:"Justification *"}),jsxRuntime.jsx("textarea",{id:"lawfulBasisJustification",value:n.lawfulBasisJustification,onChange:r=>s("lawfulBasisJustification",r.target.value),rows:2,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Data Details"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Purposes * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:O,onChange:r=>L(r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"e.g., Account management, Service delivery"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:j,onChange:r=>_(r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"e.g., Name, Email, Phone number"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveData",className:"block text-sm font-medium mb-1",children:"Sensitive Data Categories (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"sensitiveData",value:E,onChange:r=>T(r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"e.g., Health data, Biometric data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"subjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"subjectCategories",value:U,onChange:r=>$(r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"e.g., Customers, Employees"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:J,onChange:r=>q(r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSource",className:"block text-sm font-medium mb-1",children:"Data Source *"}),jsxRuntime.jsx("select",{id:"dataSource",value:n.dataSource,onChange:r=>s("dataSource",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.select,d),children:ke.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))})]}),n.dataSource==="third_party"&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"thirdPartyDetails",className:"block text-sm font-medium mb-1",children:"Third-Party Source Details *"}),jsxRuntime.jsx("input",{type:"text",id:"thirdPartyDetails",value:n.thirdPartySourceDetails||"",onChange:r=>s("thirdPartySourceDetails",r.target.value||void 0),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"Describe the third-party data source..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Retention and Security"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:n.retentionPeriod,onChange:r=>s("retentionPeriod",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"e.g., 5 years after account closure"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:n.retentionJustification||"",onChange:r=>s("retentionJustification",r.target.value||void 0),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"Why this retention period is necessary..."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"securityMeasures",className:"block text-sm font-medium mb-1",children:"Security Measures * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"securityMeasures",value:V,onChange:r=>G(r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"systemsUsed",className:"block text-sm font-medium mb-1",children:"Systems Used (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"systemsUsed",value:z,onChange:r=>H(r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"dpiaRequired",checked:n.dpiaRequired,onChange:r=>s("dpiaRequired",r.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsxRuntime.jsx("label",{htmlFor:"dpiaRequired",className:"text-sm font-medium",children:"DPIA Required"})]}),n.dpiaRequired&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpiaReference",className:"block text-sm font-medium mb-1",children:"DPIA Reference *"}),jsxRuntime.jsx("input",{type:"text",id:"dpiaReference",value:n.dpiaReference||"",onChange:r=>s("dpiaReference",r.target.value||void 0),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"Reference to the completed DPIA"})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:n.automatedDecisionMaking,onChange:r=>s("automatedDecisionMaking",r.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMaking",className:"text-sm font-medium",children:"Automated Decision-Making"})]}),n.automatedDecisionMaking&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"block text-sm font-medium mb-1",children:"Automated Decision-Making Details *"}),jsxRuntime.jsx("textarea",{id:"automatedDecisionMakingDetails",value:n.automatedDecisionMakingDetails||"",onChange:r=>s("automatedDecisionMakingDetails",r.target.value||void 0),rows:2,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Review Schedule"}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"nextReviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"nextReviewDate",value:n.nextReviewDate?new Date(n.nextReviewDate).toISOString().slice(0,10):"",onChange:r=>s("nextReviewDate",r.target.value?new Date(r.target.value).getTime():void 0),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d)})]})})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3",children:[jsxRuntime.jsx("button",{onClick:K,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-sm",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:ue,className:chunkVURIXCGY_js.a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 text-sm ${A}`,t==null?void 0:t.submitButton,d),children:a?"Add Record":"Save Changes"})]})]})]})},ye=()=>jsxRuntime.jsxs("div",{className:"flex space-x-4 mb-6 border-b border-gray-200 dark:border-gray-600",children:[jsxRuntime.jsx("button",{onClick:()=>x("list"),className:`pb-2 text-sm font-medium ${b==="list"?"border-b-2 border-blue-500 text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsxRuntime.jsx("button",{onClick:()=>x("summary"),className:`pb-2 text-sm font-medium ${b==="summary"?"border-b-2 border-blue-500 text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,t==null?void 0:t.root,d),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",t==null?void 0:t.title,d),children:te}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:re}),be(),b!=="form"&&ye(),b==="list"&&fe(),b==="summary"&&xe(),b==="form"&&ve()]})};exports.a=Pe;//# sourceMappingURL=chunk-G3JNFZPT.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-G3JNFZPT.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-2SYNHRP6.mjs';import {a}from'./chunk-FDB6KZUD.mjs';import {b,a as a$2}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var ge=({requestTypes:S,onSubmit:E,title:U="Submit a Data Subject Request",description:H="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA).",submitButtonText:Q="Submit Request",className:X="",buttonClassName:Y="",showConfirmation:G=true,confirmationMessage:Z="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:J=true,identifierTypes:M=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:l=true,labels:u={},classNames:e,unstyled:p=false})=>{var x;let[R,T]=useState(""),[$,I]=useState(""),[j,V]=useState(""),[O,q]=useState(""),[_,L]=useState(((x=M[0])==null?void 0:x.id)||""),[N,K]=useState(""),[C,A]=useState({}),[ee,W]=useState(false),[D,te]=useState({}),h=S.find(t=>t.id===R),z=t=>{T(t.target.value),A({});},f=(t,a)=>{A(v=>b(a$2({},v),{[t]:a}));},i=()=>{let t={};return $.trim()||(t.fullName="Full name is required"),j.trim()?/\S+@\S+\.\S+/.test(j)||(t.email="Email is invalid"):t.email="Email is required",R||(t.requestType="Please select a request type"),J&&!N.trim()&&(t.identifierValue="Identifier value is required"),h!=null&&h.requiresAdditionalInfo&&h.additionalFields&&h.additionalFields.forEach(a=>{a.required&&!C[a.id]&&(t[`additional_${a.id}`]=`${a.label} is required`);}),te(t),Object.keys(t).length===0},m=t=>{if(t.preventDefault(),!i())return;let a={requestType:R,dataSubject:{fullName:$,email:j,phone:O||void 0,identifierType:_,identifierValue:N},additionalInfo:Object.keys(C).length>0?C:void 0,submittedAt:Date.now()};E(a),G&&W(true);};return ee?jsxs("div",{className:a(`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${X}`,e==null?void 0:e.successMessage,p),children:[jsx("h2",{className:a("text-lg font-bold text-green-800 dark:text-green-200 mb-2",e==null?void 0:e.title,p),children:"Request Submitted"}),jsx("p",{className:a("text-green-700 dark:text-green-300",e==null?void 0:e.description,p),children:Z}),jsx("button",{onClick:()=>W(false),className:a(`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${Y}`,e==null?void 0:e.submitButton,p),children:"Submit Another Request"})]}):jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${X}`,e==null?void 0:e.root,p),children:[jsx("h2",{className:a("text-xl font-bold mb-2",e==null?void 0:e.title,p),children:U}),jsx("p",{className:a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,p),children:H}),jsx("form",{onSubmit:m,className:a("",e==null?void 0:e.form,p),children:jsxs("div",{className:a("space-y-4",e==null?void 0:e.fieldGroup,p),children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Personal Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"fullName",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:[u.name||"Full Name"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"fullName",value:$,onChange:t=>I(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.input,p),required:true}),D.fullName&&jsx("p",{className:"mt-1 text-sm text-red-500",children:D.fullName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"email",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:[u.email||"Email Address"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",id:"email",value:j,onChange:t=>V(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.input,p),required:true}),D.email&&jsx("p",{className:"mt-1 text-sm text-red-500",children:D.email})]}),l&&jsxs("div",{children:[jsx("label",{htmlFor:"phone",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:"Phone Number (Optional)"}),jsx("input",{type:"tel",id:"phone",value:O,onChange:t=>q(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.input,p)})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Request Details"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"requestType",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:[u.requestType||"Request Type"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"requestType",value:R,onChange:z,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.select,p),required:true,children:[jsx("option",{value:"",children:"Select a request type"}),S.map(t=>jsx("option",{value:t.id,children:t.name},t.id))]}),D.requestType&&jsx("p",{className:"mt-1 text-sm text-red-500",children:D.requestType})]}),h&&jsxs("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:h.description}),jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Estimated completion time: ",h.estimatedCompletionTime," ",h.estimatedCompletionTime===1?"day":"days"]})]}),jsxs("div",{className:"mb-4",children:[jsx("label",{htmlFor:"requestDescription",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:u.description||"Additional Information"}),jsx("textarea",{id:"requestDescription",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.textarea,p),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),J&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Identity Verification"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"identifierType",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:["Identifier Type ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{id:"identifierType",value:_,onChange:t=>L(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.select,p),required:true,children:M.map(t=>jsx("option",{value:t.id,children:t.label},t.id))})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"identifierValue",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:["Identifier Value ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"identifierValue",value:N,onChange:t=>K(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.input,p),required:true}),D.identifierValue&&jsx("p",{className:"mt-1 text-sm text-red-500",children:D.identifierValue})]})]})]}),(h==null?void 0:h.requiresAdditionalInfo)&&h.additionalFields&&h.additionalFields.length>0&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsx("div",{className:"space-y-4",children:h.additionalFields.map(t=>jsxs("div",{children:[jsxs("label",{htmlFor:t.id,className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:[t.label," ",t.required&&jsx("span",{className:"text-red-500",children:"*"})]}),t.type==="text"&&jsx("input",{type:"text",id:t.id,value:C[t.id]||"",onChange:a=>f(t.id,a.target.value),placeholder:t.placeholder,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.input,p),required:t.required}),t.type==="textarea"&&jsx("textarea",{id:t.id,value:C[t.id]||"",onChange:a=>f(t.id,a.target.value),placeholder:t.placeholder,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.textarea,p),rows:4,required:t.required}),t.type==="select"&&t.options&&jsxs("select",{id:t.id,value:C[t.id]||"",onChange:a=>f(t.id,a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.select,p),required:t.required,children:[jsx("option",{value:"",children:t.placeholder||"Select an option"}),t.options.map(a=>jsx("option",{value:a,children:a},a))]}),t.type==="checkbox"&&jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{type:"checkbox",id:t.id,checked:!!C[t.id],onChange:a=>f(t.id,a.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",required:t.required})}),jsx("div",{className:"ml-3 text-sm",children:jsx("label",{htmlFor:t.id,className:"text-gray-700 dark:text-gray-300",children:t.placeholder||t.label})})]}),t.type==="file"&&jsx("input",{type:"file",id:t.id,onChange:a=>{var w;let v=(w=a.target.files)==null?void 0:w[0];v&&f(t.id,v);},className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.input,p),required:t.required}),D[`additional_${t.id}`]&&jsx("p",{className:"mt-1 text-sm text-red-500",children:D[`additional_${t.id}`]})]},t.id))})]}),jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-sm font-semibold mb-2",children:"Privacy Notice"}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300",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."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${Y}`,e==null?void 0:e.submitButton,p),children:u.submit||Q})})]})})]})};var ye=({requests:S,onSelectRequest:E,onUpdateStatus:U,onAssignRequest:H,title:Q="Data Subject Request Dashboard",description:X="Track and manage data subject requests in compliance with NDPA requirements.",className:Y="",buttonClassName:G="",showRequestDetails:Z=true,showRequestTimeline:J=true,showDeadlineAlerts:M=true,assignees:l=[],classNames:u,unstyled:e=false})=>{let[p,R]=useState(null),[T,$]=useState(S),[I,j]=useState("all"),[V,O]=useState("all"),[q,_]=useState(""),[L,N]=useState("createdAt"),[K,C]=useState("desc"),[A,ee]=useState("");useEffect(()=>{let r=[...S];if(I!=="all"&&(r=r.filter(n=>n.status===I)),V!=="all"&&(r=r.filter(n=>n.type===V)),q){let n=q.toLowerCase();r=r.filter(k=>k.subject.name.toLowerCase().includes(n)||k.subject.email.toLowerCase().includes(n)||k.description&&k.description.toLowerCase().includes(n));}r.sort((n,k)=>{let P=0;switch(L){case "createdAt":P=n.createdAt-k.createdAt;break;case "dueDate":P=(n.dueDate||0)-(k.dueDate||0);break;case "type":P=n.type.localeCompare(k.type);break;case "status":P=n.status.localeCompare(k.status);break;default:P=n.createdAt-k.createdAt;}return K==="asc"?P:-P}),$(r);},[S,I,V,q,L,K]),useEffect(()=>{T.length>0&&!p&&R(T[0].id);},[T,p]);let W=r=>{R(r),E&&E(r);},D=r=>{p&&U&&U(p,r);},te=()=>{p&&A&&H&&(H(p,A),ee(""));},h=r=>new Date(r).toLocaleDateString(),z=r=>{let n=Date.now(),k=(r-n)/(1440*60*1e3);return Math.ceil(k)},f=p?S.find(r=>r.id===p):null,i=r=>{let n={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},k={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${n[r]}`,children:k[r]})},m=r=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{pending:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",inProgress:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",completed:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",rejected:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",awaitingVerification:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"}[r]}`,u==null?void 0:u.statusBadge,e),children:r==="inProgress"?"In Progress":r==="awaitingVerification"?"Awaiting Verification":r.charAt(0).toUpperCase()+r.slice(1)}),x=r=>{if(!r.dueDate)return null;let n=z(r.dueDate);return n<=0?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Deadline Passed"}),jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The response deadline has passed. Immediate action is required."})]}):n<=3?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Deadline Approaching"}),jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",n," day",n!==1?"s":""," remaining until the response deadline."]})]}):n<=7?jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Deadline Approaching"}),jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:[n," days remaining until the response deadline."]})]}):jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Deadline Tracking"}),jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:[n," days remaining until the response deadline."]})]})},t=r=>{let n=[{title:"Request Received",date:r.createdAt,completed:true,description:`Request was received on ${h(r.createdAt)}.`}];return r.verifiedAt?n.push({title:"Identity Verified",date:r.verifiedAt,completed:true,description:`Data subject's identity was verified on ${h(r.verifiedAt)}.`}):r.status==="awaitingVerification"&&n.push({title:"Identity Verification",date:Date.now(),completed:false,description:"Awaiting verification of data subject's identity."}),(r.status==="inProgress"||r.status==="completed"||r.status==="rejected")&&n.push({title:"Processing Started",date:r.updatedAt,completed:true,description:`Request processing started on ${h(r.updatedAt)}.`}),r.status==="completed"?n.push({title:"Request Completed",date:r.completedAt||Date.now(),completed:true,description:`Request was completed on ${h(r.completedAt||Date.now())}.`}):r.status==="rejected"&&n.push({title:"Request Rejected",date:r.completedAt||Date.now(),completed:true,description:`Request was rejected on ${h(r.completedAt||Date.now())}.${r.rejectionReason?` Reason: ${r.rejectionReason}`:""}`}),r.dueDate&&n.push({title:"Response Deadline",date:r.dueDate,completed:Date.now()>r.dueDate,description:`Response is due by ${h(r.dueDate)}.`}),jsxs("div",{className:"mt-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:n.map((k,P)=>jsxs("li",{className:"mb-6 ml-4",children:[jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${k.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500",children:k.date?h(k.date):"Pending"}),jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:k.title}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:k.description})]},P))})]})},a$2=()=>[{value:"all",label:"All Types"},{value:"information",label:"Information (NDPA Section 29)"},{value:"access",label:"Access (NDPA Section 30)"},{value:"rectification",label:"Rectification (NDPA Section 31)"},{value:"erasure",label:"Erasure (NDPA Section 32)"},{value:"restriction",label:"Restriction (NDPA Section 33)"},{value:"portability",label:"Portability (NDPA Section 34)"},{value:"objection",label:"Objection (NDPA Section 35)"},{value:"automated_decision_making",label:"Automated Decision-Making (NDPA Section 36)"}].map(n=>jsx("option",{value:n.value,children:n.label},n.value)),v=()=>[{value:"all",label:"All Statuses"},{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(n=>jsx("option",{value:n.value,children:n.label},n.value)),w=()=>[{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(n=>jsx("option",{value:n.value,children:n.label},n.value));return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Y}`,u==null?void 0:u.root,e),children:[jsxs("div",{className:a("",u==null?void 0:u.header,e),children:[jsx("h2",{className:a("text-xl font-bold mb-2",u==null?void 0:u.title,e),children:Q}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:X})]}),jsxs("div",{className:a("mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",u==null?void 0:u.filters,e),children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsx("select",{id:"statusFilter",value:I,onChange:r=>j(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:v()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"typeFilter",className:"block text-sm font-medium mb-1",children:"Request Type Filter"}),jsx("select",{id:"typeFilter",value:V,onChange:r=>O(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:a$2()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxs("select",{id:"sortBy",value:L,onChange:r=>N(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[jsx("option",{value:"createdAt",children:"Date Received"}),jsx("option",{value:"dueDate",children:"Due Date"}),jsx("option",{value:"type",children:"Request Type"}),jsx("option",{value:"status",children:"Status"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:q,onChange:r=>_(r.target.value),placeholder:"Search requests...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]}),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:"DSR Requests"}),T.length===0?jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No data subject requests found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",u==null?void 0:u.requestList,e),children:T.map(r=>{let n=r.dueDate?z(r.dueDate):null,k=null;return n!==null&&(n<=0?k=jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):n<=3?k=jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):n<=7&&(k=jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Soon"}))),jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${p===r.id?"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,u==null?void 0:u.requestItem,e),onClick:()=>W(r.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:r.subject.name}),i(r.type)]}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:r.subject.email}),jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:["Received: ",h(r.createdAt)]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:m(r.status)}),jsx("div",{children:k})]})]},r.id)})})]}),jsx("div",{className:a("md:col-span-2",u==null?void 0:u.detailPanel,e),children:f?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"text-lg font-medium",children:f.subject.name}),jsxs("div",{className:"flex space-x-2",children:[i(f.type),m(f.status)]})]}),M&&f.dueDate&&jsx("div",{className:"mb-4",children:x(f)}),Z&&jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Email:"})," ",f.subject.email]}),f.subject.phone&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Phone:"})," ",f.subject.phone]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Received:"})," ",h(f.createdAt)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Request Type:"})," ",{information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"}[f.type]||f.type]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",f.status==="inProgress"?"In Progress":f.status==="awaitingVerification"?"Awaiting Verification":f.status.charAt(0).toUpperCase()+f.status.slice(1)]}),f.dueDate&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Due Date:"})," ",h(f.dueDate)]})]})]}),f.description&&jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium",children:"Request Details:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:f.description})]}),f.additionalInfo&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium",children:"Additional Information:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:typeof f.additionalInfo=="object"?JSON.stringify(f.additionalInfo,null,2):String(f.additionalInfo||"No additional information provided")})]})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("h3",{className:"text-md font-medium mb-2",children:"Update Status"}),jsxs("div",{className:"flex space-x-2",children:[jsx("select",{value:f.status,onChange:r=>D(r.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:w()}),jsx("button",{onClick:()=>D(f.status),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${G}`,children:"Update"})]})]}),l.length>0&&jsxs("div",{children:[jsx("h3",{className:"text-md font-medium mb-2",children:"Assign Request"}),jsxs("div",{className:"flex space-x-2",children:[jsxs("select",{value:A,onChange:r=>ee(r.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[jsx("option",{value:"",children:"Select Assignee"}),l.map(r=>jsx("option",{value:r,children:r},r))]}),jsx("button",{onClick:te,disabled:!A,className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:bg-gray-300 disabled:text-gray-500 ${G}`,children:"Assign"})]})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Request Summary"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:jsx("pre",{children:JSON.stringify(a$1(f),null,2)})})})]}),J&&t(f)]}):jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Select a request to view details"})})})]})]})};var Se=({requests:S,onSelectRequest:E,title:U="DSR Request Tracker",description:H="Track the status and progress of data subject requests.",className:Q="",buttonClassName:X="",showSummaryStats:Y=true,showTypeBreakdown:G=true,showStatusBreakdown:Z=true,showTimelineChart:J=true,showOverdueRequests:M=true,classNames:l,unstyled:u=false})=>{let[e,p]=useState("30days"),[R,T]=useState(S),[$,I]=useState([]),[j,V]=useState([]);useEffect(()=>{let i=Date.now(),m;switch(e){case "7days":m=S.filter(a=>i-a.createdAt<=10080*60*1e3);break;case "30days":m=S.filter(a=>i-a.createdAt<=720*60*60*1e3);break;case "90days":m=S.filter(a=>i-a.createdAt<=2160*60*60*1e3);break;default:m=[...S];}T(m);let x=m.filter(a=>a.dueDate&&i>a.dueDate&&a.status!=="completed"&&a.status!=="rejected");I(x);let t=m.filter(a=>a.dueDate&&i<a.dueDate&&a.dueDate-i<=10080*60*1e3&&a.status!=="completed"&&a.status!=="rejected");V(t);},[S,e]);let O=i=>{E&&E(i);},q=i=>new Date(i).toLocaleDateString(),_=i=>{let m=Date.now(),x=(i-m)/(1440*60*1e3);return Math.ceil(x)},L=()=>{let i=R.filter(x=>x.status==="completed"&&x.completedAt&&x.createdAt);if(i.length===0)return null;let m=i.reduce((x,t)=>{let a=((t.completedAt||0)-t.createdAt)/864e5;return x+a},0);return Number((m/i.length).toFixed(1))},N=()=>{let i=R.filter(x=>(x.status==="completed"||x.status==="rejected")&&x.completedAt&&x.dueDate);if(i.length===0)return null;let m=i.filter(x=>(x.completedAt||0)<=(x.dueDate||0));return Math.round(m.length/i.length*100)},K=()=>{let i={};return R.forEach(m=>{i[m.type]=(i[m.type]||0)+1;}),{information:i.information||0,access:i.access||0,rectification:i.rectification||0,erasure:i.erasure||0,restriction:i.restriction||0,portability:i.portability||0,objection:i.objection||0,automated_decision_making:i.automated_decision_making||0}},C=()=>{let i={};return R.forEach(m=>{i[m.status]=(i[m.status]||0)+1;}),{pending:i.pending||0,awaitingVerification:i.awaitingVerification||0,inProgress:i.inProgress||0,completed:i.completed||0,rejected:i.rejected||0}},A=i=>{let m={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},x={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${m[i]}`,children:x[i]})},W=()=>{let i=R.length,m=R.filter(v=>v.status!=="completed"&&v.status!=="rejected").length;R.filter(v=>v.status==="completed"||v.status==="rejected").length;let t=L(),a$1=N();return jsxs("div",{className:a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",l==null?void 0:l.stats,u),children:[jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,u),children:[jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Total Requests"}),jsx("p",{className:"text-2xl font-bold",children:i})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,u),children:[jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Pending Requests"}),jsx("p",{className:"text-2xl font-bold",children:m})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,u),children:[jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Avg. Response Time"}),jsx("p",{className:"text-2xl font-bold",children:t!==null?`${t} days`:"N/A"})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,u),children:[jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Compliance Rate"}),jsx("p",{className:"text-2xl font-bold",children:a$1!==null?`${a$1}%`:"N/A"})]})]})},D=()=>{let i=K(),m=R.length,x=Object.entries(i).sort(([,t],[,a])=>a-t).map(([t])=>t);return jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",l==null?void 0:l.table,u),children:[jsx("h3",{className:a("text-lg font-medium mb-4",l==null?void 0:l.tableHeader,u),children:"Request Types"}),m===0?jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsx("div",{className:"space-y-4",children:x.map(t=>{let a=i[t],v=Math.round(a/m*100);return jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-center mb-1",children:[jsxs("div",{className:"flex items-center",children:[A(t),jsxs("span",{className:"ml-2 text-sm",children:[a," requests"]})]}),jsxs("span",{className:"text-sm font-medium",children:[v,"%"]})]}),jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-600 rounded-full h-2.5",children:jsx("div",{className:"bg-blue-600 h-2.5 rounded-full",style:{width:`${v}%`}})})]},t)})})]})},te=()=>{let i=C(),m=R.length,x=["pending","awaitingVerification","inProgress","completed","rejected"],t={pending:"bg-yellow-500",awaitingVerification:"bg-purple-500",inProgress:"bg-blue-500",completed:"bg-green-500",rejected:"bg-red-500"};return jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",l==null?void 0:l.table,u),children:[jsx("h3",{className:a("text-lg font-medium mb-4",l==null?void 0:l.tableHeader,u),children:"Request Status"}),m===0?jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxs("div",{children:[jsx("div",{className:"flex h-4 mb-2",children:x.map(a=>{let v=i[a],w=v/m*100;return w>0?jsx("div",{className:`${t[a]} first:rounded-l-full last:rounded-r-full`,style:{width:`${w}%`},title:`${a}: ${v} (${Math.round(w)}%)`},a):null})}),jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 mt-4",children:x.map(a=>{let v=i[a],w=Math.round(v/m*100);return jsxs("div",{className:"flex items-center",children:[jsx("div",{className:`w-3 h-3 rounded-full ${t[a]} mr-2`}),jsxs("div",{children:[jsx("p",{className:"text-xs font-medium",children:a==="inProgress"?"In Progress":a==="awaitingVerification"?"Awaiting Verification":a.charAt(0).toUpperCase()+a.slice(1)}),jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[v," (",w,"%)"]})]})]},a)})})]})]})},h=()=>{let i={};R.forEach(v=>{let w=new Date(v.createdAt),r=`${w.getFullYear()}-${String(w.getMonth()+1).padStart(2,"0")}`;i[r]=(i[r]||0)+1;});let x=Object.keys(i).sort().slice(-6),t=Math.max(...Object.values(i).filter(v=>v>0),1),a=v=>{let[w,r]=v.split("-");return `${r}/${w.slice(2)}`};return jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),x.length===0?jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxs("div",{className:"h-40",children:[jsx("div",{className:"flex h-32 items-end justify-between space-x-2",children:x.map(v=>{let w=i[v],r=`${w/t*100}%`;return jsx("div",{className:"flex flex-col items-center flex-1",children:jsx("div",{className:"w-full bg-blue-500 rounded-t",style:{height:r},title:`${a(v)}: ${w} requests`})},v)})}),jsx("div",{className:"flex justify-between mt-2",children:x.map(v=>jsx("div",{className:"text-xs text-center",children:a(v)},v))})]})]})},z=()=>jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Overdue Requests"}),$.length===0?jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No overdue requests."}):jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:$.map(i=>jsxs("div",{className:a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md cursor-pointer hover:bg-red-100 dark:hover:bg-red-900/30",l==null?void 0:l.tableRow,u),onClick:()=>O(i.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:i.subject.name}),A(i.type)]}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:i.subject.email}),jsxs("div",{className:"flex justify-between items-center",children:[jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Due: ",q(i.dueDate||0)]}),jsxs("p",{className:"text-xs font-bold text-red-600 dark:text-red-400",children:["Overdue by ",Math.abs(_(i.dueDate||0))," days"]})]})]},i.id))})]}),f=()=>jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Upcoming Deadlines"}),j.length===0?jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No upcoming deadlines in the next 7 days."}):jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:j.map(i=>{let m=_(i.dueDate||0);return jsxs("div",{className:a("p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-md cursor-pointer hover:bg-yellow-100 dark:hover:bg-yellow-900/30",l==null?void 0:l.tableRow,u),onClick:()=>O(i.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:i.subject.name}),A(i.type)]}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:i.subject.email}),jsxs("div",{className:"flex justify-between items-center",children:[jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Due: ",q(i.dueDate||0)]}),jsxs("p",{className:`text-xs font-bold ${m<=3?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`,children:["Due in ",m," days"]})]})]},i.id)})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,l==null?void 0:l.root,u),children:[jsxs("div",{className:a("flex flex-col md:flex-row md:justify-between md:items-center mb-6",l==null?void 0:l.header,u),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-bold mb-2",l==null?void 0:l.title,u),children:U}),jsx("p",{className:"text-gray-600 dark:text-gray-300",children:H})]}),jsxs("div",{className:"mt-4 md:mt-0",children:[jsx("label",{htmlFor:"timeframe",className:"block text-sm font-medium mb-1",children:"Timeframe"}),jsxs("select",{id:"timeframe",value:e,onChange:i=>p(i.target.value),className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[jsx("option",{value:"7days",children:"Last 7 Days"}),jsx("option",{value:"30days",children:"Last 30 Days"}),jsx("option",{value:"90days",children:"Last 90 Days"}),jsx("option",{value:"all",children:"All Time"})]})]})]}),Y&&W(),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxs("div",{children:[G&&D(),Z&&te()]}),jsxs("div",{children:[J&&h(),M&&z(),M&&f()]})]})]})};export{ge as a,ye as b,Se as c};//# sourceMappingURL=chunk-HXCRMA4J.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-HXCRMA4J.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {d,c,b as b$1,a as a$2}from'./chunk-TXBZPCGF.mjs';import {a}from'./chunk-FDB6KZUD.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var F={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},H=[{value:"consent",label:"Consent"},{value:"contract",label:"Contract"},{value:"legal_obligation",label:"Legal Obligation"},{value:"vital_interests",label:"Vital Interests"},{value:"public_interest",label:"Public Interest"},{value:"legitimate_interests",label:"Legitimate Interests"}],Y=[{value:"explicit_consent",label:"Explicit Consent"},{value:"employment_law",label:"Employment Law"},{value:"vital_interests_incapable",label:"Vital Interests (Incapable)"},{value:"nonprofit_legitimate",label:"Nonprofit Legitimate Activities"},{value:"publicly_available",label:"Publicly Available Data"},{value:"legal_claims",label:"Legal Claims"},{value:"substantial_public_interest",label:"Substantial Public Interest"},{value:"health_purposes",label:"Health Purposes"},{value:"public_health",label:"Public Health"},{value:"archiving_research",label:"Archiving / Research"}],fe=({activities:v,onAddActivity:_,onUpdateActivity:N,onArchiveActivity:j,title:W="Lawful Basis Tracker",description:q="Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",className:z="",buttonClassName:f="",showSummary:K=true,showComplianceGaps:Q=true,classNames:i,unstyled:n})=>{let[y,m]=useState("list"),[a$3,u]=useState(F),[h,S]=useState(null),[I,X]=useState(null),[k,Z]=useState("all"),[C,ee]=useState("all"),[A,te]=useState(""),[J,x]=useState([]),[R,ie]=useState(v);useEffect(()=>{let t=[...v];if(k!=="all"&&(t=t.filter(d=>d.status===k)),C!=="all"&&(t=t.filter(d=>d.lawfulBasis===C)),A){let d=A.toLowerCase();t=t.filter(s=>s.name.toLowerCase().includes(d)||s.description.toLowerCase().includes(d)||s.purposes.some(b=>b.toLowerCase().includes(d)));}t.sort((d,s)=>s.updatedAt-d.updatedAt),ie(t);},[v,k,C,A]);let w=t=>new Date(t).toLocaleDateString(),D=d(v),P=c(v),B=t=>t.split(",").map(d=>d.trim()).filter(d=>d.length>0),re=()=>{u(F),S(null),x([]),m("form");},E=t=>{u({name:t.name,description:t.description,lawfulBasis:t.lawfulBasis,lawfulBasisJustification:t.lawfulBasisJustification,dataCategories:t.dataCategories.join(", "),involvesSensitiveData:t.involvesSensitiveData,sensitiveDataCondition:t.sensitiveDataCondition||"",dataSubjectCategories:t.dataSubjectCategories.join(", "),purposes:t.purposes.join(", "),retentionPeriod:t.retentionPeriod,retentionJustification:t.retentionJustification||"",recipients:(t.recipients||[]).join(", "),crossBorderTransfer:t.crossBorderTransfer,reviewDate:t.reviewDate?new Date(t.reviewDate).toISOString().split("T")[0]:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""}),S(t.id),x([]),m("form");},ae=()=>{let t={name:a$3.name,description:a$3.description,lawfulBasis:a$3.lawfulBasis,lawfulBasisJustification:a$3.lawfulBasisJustification,dataCategories:B(a$3.dataCategories),involvesSensitiveData:a$3.involvesSensitiveData,sensitiveDataCondition:a$3.sensitiveDataCondition||void 0,dataSubjectCategories:B(a$3.dataSubjectCategories),purposes:B(a$3.purposes),retentionPeriod:a$3.retentionPeriod,retentionJustification:a$3.retentionJustification||void 0,recipients:a$3.recipients?B(a$3.recipients):void 0,crossBorderTransfer:a$3.crossBorderTransfer,reviewDate:a$3.reviewDate?new Date(a$3.reviewDate).getTime():void 0,status:"active"},d=b(a$1({},t),{id:h||"temp",createdAt:Date.now(),updatedAt:Date.now()}),s=a$2(d);if(!s.isValid){x(s.errors);return}h&&N?N(h,t):_&&_(t),u(F),S(null),x([]),m("list");},O=t=>{j&&j(t);},oe=t=>{X(t),m("detail");},l=I?v.find(t=>t.id===I):null,V=t=>{let d={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",under_review:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"},s={active:"Active",inactive:"Inactive",under_review:"Under Review",archived:"Archived"};return jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${d[t]}`,i==null?void 0:i.statusBadge,n),children:s[t]})},$=t=>{let d={consent:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",contract:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",legal_obligation:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",vital_interests:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",public_interest:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",legitimate_interests:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},s={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${d[t]}`,children:s[t]})},M=t=>t.dpoApproval?t.dpoApproval.approved?jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Approved"}):jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",children:"Pending Approval"}):jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400",children:"No DPO Review"}),ne=()=>jsxs("div",{className:a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",i==null?void 0:i.summary,n),children:[jsxs("div",{className:a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",i==null?void 0:i.summaryCard,n),children:[jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:D.totalActivities}),jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Total Activities"})]}),jsxs("div",{className:a("bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",i==null?void 0:i.summaryCard,n),children:[jsx("p",{className:"text-2xl font-bold text-orange-800 dark:text-orange-200",children:D.sensitiveDataActivities}),jsx("p",{className:"text-sm text-orange-600 dark:text-orange-300",children:"Sensitive Data"})]}),jsxs("div",{className:a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",i==null?void 0:i.summaryCard,n),children:[jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:D.crossBorderActivities}),jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Cross-Border Transfers"})]}),jsxs("div",{className:a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",i==null?void 0:i.summaryCard,n),children:[jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:D.activitiesWithoutApproval.length}),jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"Pending Approval"})]})]}),le=()=>{if(P.length===0)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg mb-6",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"No compliance gaps detected."}),jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"All processing activities appear to be properly documented."})]});let t=P.filter(s=>s.severity==="high"),d=P.filter(s=>s.severity==="medium");return jsxs("div",{className:"mb-6",children:[t.length>0&&jsxs("div",{className:a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-3",i==null?void 0:i.gapAlert,n),children:[jsxs("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:["High Priority (",t.length,")"]}),jsx("ul",{className:"space-y-1",children:t.map((s,b)=>jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:s.description},b))})]}),d.length>0&&jsxs("div",{className:a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",i==null?void 0:i.gapAlert,n),children:[jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-2",children:["Medium Priority (",d.length,")"]}),jsx("ul",{className:"space-y-1",children:d.map((s,b)=>jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:s.description},b))})]})]})},de=()=>jsxs("div",{className:a("",i==null?void 0:i.form,n),children:[jsxs("div",{className:a("flex justify-between items-center mb-4",i==null?void 0:i.header,n),children:[jsx("h3",{className:"text-lg font-medium",children:h?"Edit Processing Activity":"New Processing Activity"}),jsx("button",{onClick:()=>{m("list"),x([]);},className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${f}`,children:"Cancel"})]}),J.length>0&&jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-4",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:"Please correct the following errors:"}),jsx("ul",{className:"list-disc list-inside space-y-1",children:J.map((t,d)=>jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:t},d))})]}),jsxs("div",{className:"space-y-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"activityName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsx("input",{type:"text",id:"activityName",value:a$3.name,onChange:t=>u(b(a$1({},a$3),{name:t.target.value})),placeholder:"e.g., Customer Account Management",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"activityDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsx("textarea",{id:"activityDescription",value:a$3.description,onChange:t=>u(b(a$1({},a$3),{description:t.target.value})),placeholder:"Describe what processing is performed...",rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis (NDPA Section 25) *"}),jsx("select",{id:"lawfulBasis",value:a$3.lawfulBasis,onChange:t=>u(b(a$1({},a$3),{lawfulBasis:t.target.value})),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.select,n),children:H.map(t=>jsx("option",{value:t.value,children:t.label},t.value))}),jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:b$1(a$3.lawfulBasis)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:"Lawful Basis Justification *"}),jsx("textarea",{id:"justification",value:a$3.lawfulBasisJustification,onChange:t=>u(b(a$1({},a$3),{lawfulBasisJustification:t.target.value})),placeholder:"Document why this lawful basis applies to this processing activity...",rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),a$3.lawfulBasis==="legitimate_interests"&&jsxs("div",{className:"border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 bg-indigo-50 dark:bg-indigo-900/20",children:[jsx("h4",{className:"text-sm font-semibold text-indigo-800 dark:text-indigo-200 mb-3",children:"Legitimate Interest Assessment (LIA)"}),jsx("p",{className:"text-xs text-indigo-600 dark:text-indigo-300 mb-4",children:"NDPA Section 25(1)(f) requires a balancing test when relying on legitimate interests."}),jsxs("div",{className:"space-y-3",children:[jsxs("div",{children:[jsx("label",{htmlFor:"liaPurpose",className:"block text-sm font-medium mb-1",children:"Purpose Test"}),jsx("textarea",{id:"liaPurpose",value:a$3.liaPurposeTest,onChange:t=>u(b(a$1({},a$3),{liaPurposeTest:t.target.value})),placeholder:"Describe the legitimate interest being pursued...",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaNecessity",className:"block text-sm font-medium mb-1",children:"Necessity Test"}),jsx("textarea",{id:"liaNecessity",value:a$3.liaNecessityTest,onChange:t=>u(b(a$1({},a$3),{liaNecessityTest:t.target.value})),placeholder:"Explain why this processing is necessary for the stated purpose...",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaBalancing",className:"block text-sm font-medium mb-1",children:"Balancing Test"}),jsx("textarea",{id:"liaBalancing",value:a$3.liaBalancingTest,onChange:t=>u(b(a$1({},a$3),{liaBalancingTest:t.target.value})),placeholder:"Assess the impact on data subjects' rights and interests...",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaSafeguards",className:"block text-sm font-medium mb-1",children:"Safeguards"}),jsx("input",{type:"text",id:"liaSafeguards",value:a$3.liaSafeguards,onChange:t=>u(b(a$1({},a$3),{liaSafeguards:t.target.value})),placeholder:"List safeguards (comma-separated)...",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaConclusion",className:"block text-sm font-medium mb-1",children:"Conclusion"}),jsx("textarea",{id:"liaConclusion",value:a$3.liaConclusion,onChange:t=>u(b(a$1({},a$3),{liaConclusion:t.target.value})),placeholder:"State your overall conclusion...",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories *"}),jsx("input",{type:"text",id:"dataCategories",value:a$3.dataCategories,onChange:t=>u(b(a$1({},a$3),{dataCategories:t.target.value})),placeholder:"e.g., Name, Email, Phone Number (comma-separated)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsx("div",{children:jsxs("label",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",checked:a$3.involvesSensitiveData,onChange:t=>u(b(a$1({},a$3),{involvesSensitiveData:t.target.checked,sensitiveDataCondition:t.target.checked?a$3.sensitiveDataCondition:""})),className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),jsx("span",{className:"text-sm font-medium",children:"Involves Sensitive Personal Data (NDPA Section 27)"})]})}),a$3.involvesSensitiveData&&jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveCondition",className:"block text-sm font-medium mb-1",children:"Sensitive Data Condition (NDPA Section 27) *"}),jsxs("select",{id:"sensitiveCondition",value:a$3.sensitiveDataCondition,onChange:t=>u(b(a$1({},a$3),{sensitiveDataCondition:t.target.value})),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.select,n),children:[jsx("option",{value:"",children:"Select a condition..."}),Y.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSubjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories *"}),jsx("input",{type:"text",id:"dataSubjectCategories",value:a$3.dataSubjectCategories,onChange:t=>u(b(a$1({},a$3),{dataSubjectCategories:t.target.value})),placeholder:"e.g., Customers, Employees, Vendors (comma-separated)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Processing Purposes *"}),jsx("input",{type:"text",id:"purposes",value:a$3.purposes,onChange:t=>u(b(a$1({},a$3),{purposes:t.target.value})),placeholder:"e.g., Account management, Service delivery (comma-separated)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsx("input",{type:"text",id:"retentionPeriod",value:a$3.retentionPeriod,onChange:t=>u(b(a$1({},a$3),{retentionPeriod:t.target.value})),placeholder:"e.g., 3 years after account closure",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsx("input",{type:"text",id:"retentionJustification",value:a$3.retentionJustification,onChange:t=>u(b(a$1({},a$3),{retentionJustification:t.target.value})),placeholder:"Reason for the retention period",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients"}),jsx("input",{type:"text",id:"recipients",value:a$3.recipients,onChange:t=>u(b(a$1({},a$3),{recipients:t.target.value})),placeholder:"e.g., Payment processor, Cloud provider (comma-separated)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsx("div",{children:jsxs("label",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",checked:a$3.crossBorderTransfer,onChange:t=>u(b(a$1({},a$3),{crossBorderTransfer:t.target.checked})),className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),jsx("span",{className:"text-sm font-medium",children:"Involves Cross-Border Transfer Outside Nigeria"})]})}),jsxs("div",{children:[jsx("label",{htmlFor:"reviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsx("input",{type:"date",id:"reviewDate",value:a$3.reviewDate,onChange:t=>u(b(a$1({},a$3),{reviewDate:t.target.value})),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[jsx("button",{onClick:()=>{m("list"),x([]);},className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${f}`,children:"Cancel"}),jsx("button",{onClick:ae,className:a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${f}`,i==null?void 0:i.submitButton,n),children:h?"Update Activity":"Create Activity"})]})]})]}),se=()=>{var d;if(!l)return jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Activity not found."})});let t=a$2(l);return jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("div",{children:[jsx("button",{onClick:()=>m("list"),className:"text-sm text-blue-600 dark:text-blue-400 hover:underline mb-2",children:"Back to list"}),jsx("h3",{className:"text-lg font-medium",children:l.name})]}),jsxs("div",{className:"flex space-x-2",children:[$(l.lawfulBasis),V(l.status),M(l)]})]}),t.warnings.length>0&&jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md mb-4",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside space-y-1",children:t.warnings.map((s,b)=>jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:s},b))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Description:"})," ",l.description]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",b$1(l.lawfulBasis)]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Justification:"})," ",l.lawfulBasisJustification]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Categories:"})," ",l.dataCategories.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",l.dataSubjectCategories.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Purposes:"})," ",l.purposes.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Retention Period:"})," ",l.retentionPeriod,l.retentionJustification&&jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[" ","(",l.retentionJustification,")"]})]})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",l.involvesSensitiveData?"Yes":"No",l.sensitiveDataCondition&&jsxs("span",{children:[" ","(Condition:"," ",((d=Y.find(s=>s.value===l.sensitiveDataCondition))==null?void 0:d.label)||l.sensitiveDataCondition,")"]})]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",l.crossBorderTransfer?"Yes":"No"]}),l.recipients&&l.recipients.length>0&&jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Recipients:"})," ",l.recipients.join(", ")]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Created:"})," ",w(l.createdAt)]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Last Updated:"})," ",w(l.updatedAt)]}),l.reviewDate&&jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",w(l.reviewDate),l.reviewDate<Date.now()&&jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:" (Overdue)"})]})]})]}),l.dpoApproval&&jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-6",children:[jsx("h4",{className:"text-sm font-semibold mb-2",children:"DPO Approval"}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",l.dpoApproval.approved?"Approved":"Not Approved"]}),jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Approved By:"})," ",l.dpoApproval.approvedBy]}),jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Date:"})," ",w(l.dpoApproval.approvedAt)]}),l.dpoApproval.notes&&jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Notes:"})," ",l.dpoApproval.notes]})]}),jsxs("div",{className:"flex space-x-3",children:[jsx("button",{onClick:()=>E(l),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${f}`,children:"Edit"}),l.status!=="archived"&&jsx("button",{onClick:()=>O(l.id),className:`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 ${f}`,children:"Archive"})]})]})},ue=()=>jsxs("div",{children:[jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"basisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxs("select",{id:"basisFilter",value:C,onChange:t=>ee(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.select,n),children:[jsx("option",{value:"all",children:"All Bases"}),H.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"statusFilterSelect",className:"block text-sm font-medium mb-1",children:"Status"}),jsxs("select",{id:"statusFilterSelect",value:k,onChange:t=>Z(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.select,n),children:[jsx("option",{value:"all",children:"All Statuses"}),jsx("option",{value:"active",children:"Active"}),jsx("option",{value:"inactive",children:"Inactive"}),jsx("option",{value:"under_review",children:"Under Review"}),jsx("option",{value:"archived",children:"Archived"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchInput",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchInput",value:A,onChange:t=>te(t.target.value),placeholder:"Search activities...",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsx("div",{className:"flex items-end",children:jsx("button",{onClick:re,className:a(`w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${f}`,i==null?void 0:i.submitButton,n),children:"Add Activity"})})]}),R.length===0?jsx("div",{className:"flex items-center justify-center h-32 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No processing activities found."})}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a("w-full text-sm text-left",i==null?void 0:i.table,n),children:[jsx("thead",{className:a("text-xs uppercase bg-gray-50 dark:bg-gray-700",i==null?void 0:i.tableHeader,n),children:jsxs("tr",{children:[jsx("th",{className:"px-4 py-3",children:"Activity"}),jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsx("th",{className:"px-4 py-3",children:"Status"}),jsx("th",{className:"px-4 py-3",children:"DPO Approval"}),jsx("th",{className:"px-4 py-3",children:"Sensitive Data"}),jsx("th",{className:"px-4 py-3",children:"Last Updated"}),jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsx("tbody",{children:R.map(t=>jsxs("tr",{className:a("border-b border-gray-200 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700",i==null?void 0:i.tableRow,n),children:[jsxs("td",{className:"px-4 py-3",children:[jsx("button",{onClick:()=>oe(t.id),className:"font-medium text-blue-600 dark:text-blue-400 hover:underline text-left",children:t.name}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1 truncate max-w-xs",children:t.description})]}),jsx("td",{className:"px-4 py-3",children:$(t.lawfulBasis)}),jsx("td",{className:"px-4 py-3",children:V(t.status)}),jsx("td",{className:"px-4 py-3",children:M(t)}),jsx("td",{className:"px-4 py-3",children:jsx("span",{className:`text-xs ${t.involvesSensitiveData?"text-orange-600 dark:text-orange-400 font-medium":"text-gray-500 dark:text-gray-400"}`,children:t.involvesSensitiveData?"Yes":"No"})}),jsx("td",{className:"px-4 py-3 text-xs text-gray-500 dark:text-gray-400",children:w(t.updatedAt)}),jsx("td",{className:"px-4 py-3",children:jsxs("div",{className:"flex space-x-2",children:[jsx("button",{onClick:()=>E(t),className:"text-xs text-blue-600 dark:text-blue-400 hover:underline",children:"Edit"}),t.status!=="archived"&&jsx("button",{onClick:()=>O(t.id),className:"text-xs text-gray-600 dark:text-gray-400 hover:underline",children:"Archive"})]})})]},t.id))})]})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,i==null?void 0:i.root,n),children:[jsx("h2",{className:a("text-xl font-bold mb-2",i==null?void 0:i.title,n),children:W}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:q}),K&&y==="list"&&ne(),Q&&y==="list"&&le(),y==="list"&&ue(),y==="form"&&de(),y==="detail"&&se()]})};export{fe as a};//# sourceMappingURL=chunk-IC7VOOKJ.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-IC7VOOKJ.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-FDB6KZUD.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var et=({options:b$1,onSave:h,title:k="We Value Your Privacy",description:I="We use cookies and similar technologies to provide our services and enhance your experience.",acceptAllButtonText:O="Accept All",rejectAllButtonText:D="Reject All",customizeButtonText:w="Customize",saveButtonText:E="Save Preferences",position:C="bottom",version:c="1.0",show:p,storageKey:y="ndpr_consent",className:e="",buttonClassName:a$2="",primaryButtonClassName:B="",secondaryButtonClassName:A="",classNames:t,unstyled:o})=>{let[i,d]=useState(false),[f,v]=useState(false),[P,T]=useState({});useEffect(()=>{let g={};if(b$1.forEach(u=>{g[u.id]=u.defaultValue||false;}),T(g),p===void 0){let u=localStorage.getItem(y);d(!u);}else d(p);},[b$1,p,y]);let m=()=>{let g={};b$1.forEach(u=>{g[u.id]=true;}),z(g);},R=()=>{let g={};b$1.forEach(u=>{g[u.id]=u.required||false;}),z(g);},r=(g,u)=>{T(H=>b(a$1({},H),{[g]:u}));},x=()=>{z(P);},z=g=>{let u={consents:g,timestamp:Date.now(),version:c,method:f?"customize":"banner",hasInteracted:true};localStorage.setItem(y,JSON.stringify(u)),h(u),d(false),v(false);};if(!i)return null;let F=C==="top"?"top-0 left-0 right-0":C==="center"?"top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 max-w-lg":"bottom-0 left-0 right-0",W=(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${a$2} ${B}`,V=(t==null?void 0:t.rejectButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${a$2} ${A}`,Y=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${a$2}`,_=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${a$2} ${B}`;return jsx("div",{className:a(`fixed z-50 bg-white dark:bg-gray-800 shadow-lg p-4 border border-gray-200 dark:border-gray-700 ${F} ${e}`,t==null?void 0:t.root,o),role:"dialog","aria-labelledby":"consent-banner-title",children:jsxs("div",{className:a("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsx("h2",{id:"consent-banner-title",className:a("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:k}),jsx("p",{className:a("mb-4",t==null?void 0:t.description,o),children:I}),f?jsxs("div",{className:"mb-4",children:[jsx("div",{className:a("space-y-3",t==null?void 0:t.optionsList,o),children:b$1.map(g=>jsxs("div",{className:a("flex items-start",t==null?void 0:t.optionItem,o),children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`consent-${g.id}`,type:"checkbox",checked:P[g.id]||false,onChange:u=>r(g.id,u.target.checked),disabled:g.required,className:a("h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",t==null?void 0:t.optionCheckbox,o)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:`consent-${g.id}`,className:a("font-medium",t==null?void 0:t.optionLabel,o),children:[g.label," ",g.required&&jsx("span",{className:"text-red-500",children:"*"})]}),jsx("p",{className:a("text-gray-500 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:g.description})]})]},g.id))}),jsxs("div",{className:a("mt-4 flex flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:x,className:a(_,t==null?void 0:t.saveButton,o),children:E}),jsx("button",{onClick:()=>v(false),className:a(V,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}):jsxs("div",{className:a("flex flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:m,className:a(W,t==null?void 0:t.acceptButton,o),children:O}),jsx("button",{onClick:R,className:a(V,t==null?void 0:t.rejectButton,o),children:D}),jsx("button",{onClick:()=>v(true),className:a(Y,t==null?void 0:t.customizeButton,o),children:w})]}),jsx("div",{className:a("mt-2 text-xs text-gray-500 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})})};var at=({options:b$1,settings:h,onSave:k,title:I="Manage Your Privacy Settings",description:O="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function.",saveButtonText:D="Save Preferences",resetButtonText:w="Reset to Defaults",version:E="1.0",className:C="",buttonClassName:c="",primaryButtonClassName:p="",secondaryButtonClassName:y="",classNames:e,unstyled:a$2,showSuccessMessage:B=true,successMessage:A="Your preferences have been saved.",successMessageDuration:t=3e3})=>{let[o,i]=useState({}),[d,f]=useState(false);useEffect(()=>{if(h&&h.consents)i(h.consents);else {let r={};b$1.forEach(x=>{r[x.id]=x.defaultValue||false;}),i(r);}},[b$1,h]);let v=(r,x)=>{i(z=>b(a$1({},z),{[r]:x}));},P=()=>{let r={consents:o,timestamp:Date.now(),version:E,method:"manager",hasInteracted:true};k(r),B&&(f(true),setTimeout(()=>{f(false);},t));},T=()=>{let r={};b$1.forEach(x=>{r[x.id]=x.defaultValue||false;}),i(r);},m=(e==null?void 0:e.saveButton)||`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${c} ${p}`,R=(e==null?void 0:e.resetButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${c} ${y}`;return jsxs("div",{className:a(`bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 ${C}`,e==null?void 0:e.root,a$2),children:[jsx("h2",{className:a("text-xl font-bold mb-2",e==null?void 0:e.title,a$2),children:I}),jsx("p",{className:a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,a$2),children:O}),jsx("div",{className:a("space-y-6",e==null?void 0:e.optionsList,a$2),children:b$1.map(r=>jsx("div",{className:a("border-b border-gray-200 dark:border-gray-700 pb-4 last:border-0",e==null?void 0:e.optionItem,a$2),children:jsxs("div",{className:"flex items-start justify-between",children:[jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:r.label}),jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:r.description})]}),jsx("div",{className:"ml-4 flex-shrink-0",children:jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[jsx("input",{type:"checkbox",className:"sr-only peer",checked:o[r.id]||false,onChange:x=>v(r.id,x.target.checked),disabled:r.required}),jsx("div",{className:a(`w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600 ${r.required?"opacity-60":""}`,e==null?void 0:e.toggle,a$2)}),jsxs("span",{className:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300",children:[o[r.id]?"Enabled":"Disabled",r.required&&jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},r.id))}),d&&jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md",children:A}),jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsx("button",{onClick:P,className:a(m,e==null?void 0:e.saveButton,a$2),children:D}),jsx("button",{onClick:T,className:a(R,e==null?void 0:e.resetButton,a$2),children:w})]}),jsxs("div",{className:"mt-4 text-xs text-gray-500 dark:text-gray-400",children:[jsxs("p",{children:["Last updated: ",h?new Date(h.timestamp).toLocaleString():"Never"]}),jsxs("p",{children:["Version: ",E]})]})]})};var st=({settings:b,storageOptions:h={},onLoad:k,onSave:I,autoSave:O=true,autoLoad:D=true,classNames:w,unstyled:E,children:C})=>{let{storageKey:c="ndpr_consent",storageType:p="localStorage",cookieOptions:y={}}=h,[e,a$1]=useState(false);useEffect(()=>{D&&!e&&B();},[D,e]),useEffect(()=>{O&&e&&A(b);},[b,O,e]);let B=()=>{let i=null;try{if(p==="localStorage"&&typeof window!="undefined"){let d=localStorage.getItem(c);d&&(i=JSON.parse(d));}else if(p==="sessionStorage"&&typeof window!="undefined"){let d=sessionStorage.getItem(c);d&&(i=JSON.parse(d));}else if(p==="cookie"&&typeof document!="undefined"){let f=document.cookie.split(";").find(v=>v.trim().startsWith(`${c}=`));if(f){let v=f.split("=")[1];i=JSON.parse(decodeURIComponent(v));}}a$1(!0),k&&k(i);}catch(d){console.error("Error loading consent settings:",d),a$1(true),k&&k(null);}return i},A=i=>{try{let d=JSON.stringify(i);if(p==="localStorage"&&typeof window!="undefined")localStorage.setItem(c,d);else if(p==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(c,d);else if(p==="cookie"&&typeof document!="undefined"){let{domain:f,path:v="/",expires:P=365,secure:T=!0,sameSite:m="Lax"}=y,R=new Date;R.setDate(R.getDate()+P);let r=`${c}=${encodeURIComponent(d)}; path=${v}; expires=${R.toUTCString()}`;f&&(r+=`; domain=${f}`),T&&(r+="; secure"),r+=`; samesite=${m}`,document.cookie=r;}return I&&I(i),!0}catch(d){return console.error("Error saving consent settings:",d),false}},t=()=>{try{if(p==="localStorage"&&typeof window!="undefined")localStorage.removeItem(c);else if(p==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(c);else if(p==="cookie"&&typeof document!="undefined"){let{domain:i,path:d="/"}=y,f=`${c}=; path=${d}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;i&&(f+=`; domain=${i}`),document.cookie=f;}return !0}catch(i){return console.error("Error clearing consent settings:",i),false}},o=a("",w==null?void 0:w.root,E);if(typeof C=="function"){let i=C({loadSettings:B,saveSettings:A,clearSettings:t,loaded:e});return o?jsx("div",{className:o,children:i}):jsx(Fragment,{children:i})}return o?jsx("div",{className:o,children:C}):jsx(Fragment,{children:C})};export{et as a,at as b,st as c};//# sourceMappingURL=chunk-ICUZG6CD.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-ICUZG6CD.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {a as a$1,d,c,b}from'./chunk-QKK5S54L.mjs';import {a}from'./chunk-FDB6KZUD.mjs';import {b as b$1,a as a$2}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var M=[{value:"adequacy_decision",label:"Adequacy Decision (Section 41)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 42)"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 43)"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 44)"},{value:"explicit_consent",label:"Explicit Consent (Section 45(a))"},{value:"contract_performance",label:"Contract Performance (Section 45(b))"},{value:"public_interest",label:"Public Interest (Section 45(c))"},{value:"legal_claims",label:"Legal Claims (Section 45(d))"},{value:"vital_interests",label:"Vital Interests (Section 45(e))"}],H=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],Y=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],Q=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],W={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:""},xe=({transfers:c$1,onAddTransfer:P,onUpdateTransfer:F,onRemoveTransfer:B,summary:G,title:K="Cross-Border Data Transfer Manager",description:J="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VI (Sections 41-45).",className:X="",buttonClassName:T="",showSummary:Z=true,showTIA:ee=true,classNames:a$3,unstyled:o})=>{let[v,D]=useState(null),[I,x]=useState(false),[y,O]=useState(null),[i,R]=useState(W),[f,_]=useState(null),[h,te]=useState("all"),[A,ae]=useState("all"),[k,re]=useState(c$1);useEffect(()=>{let t=[...c$1];h!=="all"&&(t=t.filter(r=>r.status===h)),A!=="all"&&(t=t.filter(r=>r.transferMechanism===A)),t.sort((r,l)=>l.updatedAt-r.updatedAt),re(t);},[c$1,h,A]),useEffect(()=>{k.length>0&&!v&&D(k[0].id);},[k,v]);let j=v?c$1.find(t=>t.id===v):null,C=t=>new Date(t).toLocaleDateString(),w=()=>{R(W),O(null),_(null);},ne=()=>{w(),x(true);},ie=t=>{var r,l,u,b;O(t.id),R({destinationCountry:t.destinationCountry,destinationCountryCode:t.destinationCountryCode||"",adequacyStatus:t.adequacyStatus,transferMechanism:t.transferMechanism,dataCategories:t.dataCategories.join(", "),includesSensitiveData:t.includesSensitiveData,estimatedDataSubjects:((r=t.estimatedDataSubjects)==null?void 0:r.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:((l=t.ndpcApproval)==null?void 0:l.applied)||false,ndpcApprovalApproved:((u=t.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((b=t.ndpcApproval)==null?void 0:b.referenceNumber)||""}),x(true);},p=(t,r)=>{R(l=>b$1(a$2({},l),{[t]:r}));},de=()=>{let t=a$1(i.transferMechanism),r=Date.now();return {destinationCountry:i.destinationCountry.trim(),destinationCountryCode:i.destinationCountryCode.trim()||void 0,adequacyStatus:i.adequacyStatus,transferMechanism:i.transferMechanism,dataCategories:i.dataCategories.split(",").map(l=>l.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(l=>l.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?r:void 0,approvedAt:i.ndpcApprovalApproved?r:void 0}:void 0,startDate:r,reviewDate:r+365*24*60*60*1e3}},oe=()=>{let t=de(),r=a$2({id:y||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),l=c(r);_(l),l.isValid&&(y?F&&F(y,t):P&&P(t),w(),x(false));},le=t=>{B&&B(t),v===t&&D(null);},E=t=>jsxs("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[t]}`,a$3==null?void 0:a$3.riskBadge,o),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),L=t=>{let r={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",suspended:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",terminated:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",pending_approval:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"},l={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"};return jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${r[t]}`,a$3==null?void 0:a$3.statusBadge,o),children:l[t]})},pe=t=>{var u;let r=a$1(t),l=((u=M.find(b=>b.value===t))==null?void 0:u.label)||t;return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${r?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200"}`,children:l})},se=()=>{let t=G||{totalActiveTransfers:c$1.filter(r=>r.status==="active").length,pendingApproval:c$1.filter(r=>{var l,u;return r.status==="pending_approval"||((l=r.ndpcApproval)==null?void 0:l.required)&&!((u=r.ndpcApproval)!=null&&u.approved)}),highRiskTransfers:c$1.filter(r=>r.riskLevel==="high"&&r.status==="active"),missingTIA:c$1.filter(r=>!r.tiaCompleted&&r.status==="active")};return jsxs("div",{className:a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",a$3==null?void 0:a$3.summary,o),children:[jsxs("div",{className:a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",a$3==null?void 0:a$3.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:t.totalActiveTransfers}),jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Active Transfers"})]}),jsxs("div",{className:a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",a$3==null?void 0:a$3.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:t.pendingApproval.length}),jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Pending Approval"})]}),jsxs("div",{className:a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",a$3==null?void 0:a$3.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:t.highRiskTransfers.length}),jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"High Risk"})]}),jsxs("div",{className:a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",a$3==null?void 0:a$3.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-yellow-800 dark:text-yellow-200",children:t.missingTIA.length}),jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-300",children:"Missing TIA"})]})]})},ue=()=>{let t=a$1(i.transferMechanism);return jsxs("div",{className:a("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",a$3==null?void 0:a$3.form,o),children:[jsxs("div",{className:a("flex justify-between items-center mb-4",a$3==null?void 0:a$3.header,o),children:[jsx("h3",{className:"text-lg font-medium",children:y?"Edit Transfer":"Add New Transfer"}),jsx("button",{onClick:()=>{w(),x(false);},className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"Cancel"})]}),f&&!f.isValid&&jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:f.errors.map((r,l)=>jsx("li",{children:r},l))})]}),f&&f.warnings.length>0&&jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings:"}),jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:f.warnings.map((r,l)=>jsx("li",{children:r},l))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Destination Country ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",value:i.destinationCountry,onChange:r=>p("destinationCountry",r.target.value),placeholder:"e.g. United Kingdom",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Country Code (ISO)"}),jsx("input",{type:"text",value:i.destinationCountryCode,onChange:r=>p("destinationCountryCode",r.target.value),placeholder:"e.g. GB",maxLength:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]}),jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Organization ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",value:i.recipientOrganization,onChange:r=>p("recipientOrganization",r.target.value),placeholder:"Organization name",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]}),jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Transfer Mechanism ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{value:i.transferMechanism,onChange:r=>p("transferMechanism",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.select,o),children:M.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Adequacy Status"}),jsx("select",{value:i.adequacyStatus,onChange:r=>p("adequacyStatus",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.select,o),children:H.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Risk Level"}),jsxs("select",{value:i.riskLevel,onChange:r=>p("riskLevel",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.select,o),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",{className:"block text-sm font-medium mb-1",children:["Data Categories ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",value:i.dataCategories,onChange:r=>p("dataCategories",r.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:i.includesSensitiveData,onChange:r=>p("includesSensitiveData",r.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),jsx("label",{htmlFor:"includesSensitiveData",className:"text-sm font-medium",children:"Includes sensitive personal data"})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Estimated Data Subjects"}),jsx("input",{type:"number",value:i.estimatedDataSubjects,onChange:r=>p("estimatedDataSubjects",r.target.value),placeholder:"Number of data subjects",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]}),jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Name ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",value:i.recipientContactName,onChange:r=>p("recipientContactName",r.target.value),placeholder:"Contact person name",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]}),jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Email ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",value:i.recipientContactEmail,onChange:r=>p("recipientContactEmail",r.target.value),placeholder:"contact@example.com",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Phone"}),jsx("input",{type:"text",value:i.recipientContactPhone,onChange:r=>p("recipientContactPhone",r.target.value),placeholder:"Phone number",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Address"}),jsx("input",{type:"text",value:i.recipientContactAddress,onChange:r=>p("recipientContactAddress",r.target.value),placeholder:"Address",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Purpose of Transfer ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{value:i.purpose,onChange:r=>p("purpose",r.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Safeguards ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{value:i.safeguards,onChange:r=>p("safeguards",r.target.value),placeholder:`One safeguard per line, e.g.
|
|
4
|
+
End-to-end encryption
|
|
5
|
+
Access control policies
|
|
6
|
+
Regular security audits`,rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Risk Assessment Summary ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{value:i.riskAssessment,onChange:r=>p("riskAssessment",r.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Transfer Frequency"}),jsx("select",{value:i.frequency,onChange:r=>p("frequency",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.select,o),children:Y.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Status"}),jsx("select",{value:i.status,onChange:r=>p("status",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.select,o),children:Q.map(r=>jsx("option",{value:r.value,children:r.label},r.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 text-blue-800 dark:text-blue-200 mb-3",children:"NDPC Approval Required"}),jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300 mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:i.ndpcApprovalApplied,onChange:r=>p("ndpcApprovalApplied",r.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),jsx("label",{htmlFor:"ndpcApprovalApplied",className:"text-sm",children:"Application submitted"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:i.ndpcApprovalApproved,onChange:r=>p("ndpcApprovalApproved",r.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),jsx("label",{htmlFor:"ndpcApprovalApproved",className:"text-sm",children:"Approval granted"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"NDPC Reference Number"}),jsx("input",{type:"text",value:i.ndpcApprovalReference,onChange:r=>p("ndpcApprovalReference",r.target.value),placeholder:"Reference number (if available)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]})]})]}),ee&&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:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"tiaCompleted",checked:i.tiaCompleted,onChange:r=>p("tiaCompleted",r.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),jsx("label",{htmlFor:"tiaCompleted",className:"text-sm",children:"TIA completed"})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"TIA Reference"}),jsx("input",{type:"text",value:i.tiaReference,onChange:r=>p("tiaReference",r.target.value),placeholder:"Document reference",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.input,o)})]})]})]}),jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsx("button",{onClick:()=>{w(),x(false);},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:oe,className:a(`px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 ${T}`,a$3==null?void 0:a$3.submitButton,o),children:y?"Update Transfer":"Add Transfer"})]})]})},me=t=>{var u,b$1;let r=d(t),l=c(t);return jsxs("div",{className:a("",a$3==null?void 0:a$3.detailPanel,o),children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("h3",{className:"text-lg font-medium",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxs("div",{className:"flex gap-2",children:[L(t.status),E(t.riskLevel)]})]}),!l.isValid&&jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Compliance Issues"}),jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:l.errors.map((s,m)=>jsx("li",{children:s},m))})]}),l.warnings.length>0&&jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:l.warnings.map((s,m)=>jsx("li",{children:s},m))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Destination:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=H.find(s=>s.value===t.adequacyStatus))==null?void 0:u.label]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Frequency:"})," ",(b$1=Y.find(s=>s.value===t.frequency))==null?void 0:b$1.label]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Start Date:"})," ",C(t.startDate)]}),t.endDate&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"End Date:"})," ",C(t.endDate)]}),t.reviewDate&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",C(t.reviewDate)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.includesSensitiveData?"Yes":"No"]})]})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Mechanism"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:b(t.transferMechanism)})})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Purpose"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:t.purpose})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Data Categories"}),jsx("div",{className:"flex flex-wrap gap-1",children:t.dataCategories.map((s,m)=>jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:s},m))})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Safeguards"}),jsx("ul",{className:"list-disc list-inside text-sm text-gray-600 dark:text-gray-300",children:t.safeguards.map((s,m)=>jsx("li",{children:s},m))})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Risk Assessment"}),jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:t.riskAssessment}),jsxs("div",{className:"mt-2",children:[jsxs("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:["Automated Assessment (Score: ",r.riskScore,")"]}),r.factors.length>0&&jsx("ul",{className:"list-disc list-inside text-xs text-gray-500 dark:text-gray-400",children:r.factors.map((s,m)=>jsx("li",{children:s},m))}),r.recommendations.length>0&&jsxs("div",{className:"mt-2",children:[jsx("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Recommendations:"}),jsx("ul",{className:"list-disc list-inside text-xs text-gray-500 dark:text-gray-400",children:r.recommendations.map((s,m)=>jsx("li",{children:s},m))})]})]})]})]}),t.ndpcApproval&&jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"NDPC Approval"}),jsxs("div",{className:a(`p-3 rounded-md ${t.ndpcApproval.approved?"bg-green-50 dark:bg-green-900/20":t.ndpcApproval.applied?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20"}`,a$3==null?void 0:a$3.approvalStatus,o),children:[jsxs("p",{className:"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:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Applied:"})," ",C(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Approved:"})," ",C(t.ndpcApproval.approvedAt)]})]})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Impact Assessment"}),jsxs("div",{className:`p-3 rounded-md ${t.tiaCompleted?"bg-green-50 dark:bg-green-900/20":"bg-yellow-50 dark:bg-yellow-900/20"}`,children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxs("div",{className:"flex gap-3 mt-6",children:[jsx("button",{onClick:()=>ie(t),className:`px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 ${T}`,children:"Edit"}),jsx("button",{onClick:()=>le(t.id),className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${X}`,a$3==null?void 0:a$3.root,o),children:[jsx("h2",{className:a("text-xl font-bold mb-2",a$3==null?void 0:a$3.title,o),children:K}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:J}),Z&&se(),!I&&jsx("div",{className:"mb-6",children:jsx("button",{onClick:ne,className:a(`px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 ${T}`,a$3==null?void 0:a$3.submitButton,o),children:"Add Transfer"})}),I&&ue(),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"cbStatusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxs("select",{id:"cbStatusFilter",value:h,onChange:t=>te(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.select,o),children:[jsx("option",{value:"all",children:"All Statuses"}),Q.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cbMechanismFilter",className:"block text-sm font-medium mb-1",children:"Mechanism Filter"}),jsxs("select",{id:"cbMechanismFilter",value:A,onChange:t=>ae(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a$3==null?void 0:a$3.select,o),children:[jsx("option",{value:"all",children:"All Mechanisms"}),M.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"}),k.length===0?jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No cross-border transfers found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",a$3==null?void 0:a$3.transferList,o),children:k.map(t=>{var r,l;return jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${v===t.id?"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,a$3==null?void 0:a$3.transferItem,o),onClick:()=>D(t.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),E(t.riskLevel)]}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:t.recipientOrganization}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:pe(t.transferMechanism)}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[L(t.status),((r=t.ndpcApproval)==null?void 0:r.required)&&!((l=t.ndpcApproval)!=null&&l.approved)&&jsx("span",{className:"text-xs text-purple-600 dark:text-purple-400",children:"NDPC Pending"})]})]},t.id)})})]}),jsx("div",{className:"md:col-span-2",children:j?me(j):jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Select a transfer to view details"})})})]})]})};export{xe as a};//# sourceMappingURL=chunk-IW5PHOG7.mjs.map
|
|
7
|
+
//# sourceMappingURL=chunk-IW5PHOG7.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var chunkIQF726GS_js=require('./chunk-IQF726GS.js'),chunkVURIXCGY_js=require('./chunk-VURIXCGY.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var M=[{value:"adequacy_decision",label:"Adequacy Decision (Section 41)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 42)"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 43)"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 44)"},{value:"explicit_consent",label:"Explicit Consent (Section 45(a))"},{value:"contract_performance",label:"Contract Performance (Section 45(b))"},{value:"public_interest",label:"Public Interest (Section 45(c))"},{value:"legal_claims",label:"Legal Claims (Section 45(d))"},{value:"vital_interests",label:"Vital Interests (Section 45(e))"}],H=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],Y=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],Q=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],W={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:""},xe=({transfers:c,onAddTransfer:P,onUpdateTransfer:F,onRemoveTransfer:B,summary:G,title:K="Cross-Border Data Transfer Manager",description:J="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VI (Sections 41-45).",className:X="",buttonClassName:T="",showSummary:Z=true,showTIA:ee=true,classNames:a,unstyled:o})=>{let[v,D]=react.useState(null),[I,x]=react.useState(false),[y,O]=react.useState(null),[i,R]=react.useState(W),[f,_]=react.useState(null),[h,te]=react.useState("all"),[A,ae]=react.useState("all"),[k,re]=react.useState(c);react.useEffect(()=>{let t=[...c];h!=="all"&&(t=t.filter(r=>r.status===h)),A!=="all"&&(t=t.filter(r=>r.transferMechanism===A)),t.sort((r,l)=>l.updatedAt-r.updatedAt),re(t);},[c,h,A]),react.useEffect(()=>{k.length>0&&!v&&D(k[0].id);},[k,v]);let j=v?c.find(t=>t.id===v):null,C=t=>new Date(t).toLocaleDateString(),w=()=>{R(W),O(null),_(null);},ne=()=>{w(),x(true);},ie=t=>{var r,l,u,b;O(t.id),R({destinationCountry:t.destinationCountry,destinationCountryCode:t.destinationCountryCode||"",adequacyStatus:t.adequacyStatus,transferMechanism:t.transferMechanism,dataCategories:t.dataCategories.join(", "),includesSensitiveData:t.includesSensitiveData,estimatedDataSubjects:((r=t.estimatedDataSubjects)==null?void 0:r.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:((l=t.ndpcApproval)==null?void 0:l.applied)||false,ndpcApprovalApproved:((u=t.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((b=t.ndpcApproval)==null?void 0:b.referenceNumber)||""}),x(true);},p=(t,r)=>{R(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{[t]:r}));},de=()=>{let t=chunkIQF726GS_js.a(i.transferMechanism),r=Date.now();return {destinationCountry:i.destinationCountry.trim(),destinationCountryCode:i.destinationCountryCode.trim()||void 0,adequacyStatus:i.adequacyStatus,transferMechanism:i.transferMechanism,dataCategories:i.dataCategories.split(",").map(l=>l.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(l=>l.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?r:void 0,approvedAt:i.ndpcApprovalApproved?r:void 0}:void 0,startDate:r,reviewDate:r+365*24*60*60*1e3}},oe=()=>{let t=de(),r=chunkMQFZHA2D_js.a({id:y||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),l=chunkIQF726GS_js.c(r);_(l),l.isValid&&(y?F&&F(y,t):P&&P(t),w(),x(false));},le=t=>{B&&B(t),v===t&&D(null);},E=t=>jsxRuntime.jsxs("span",{className:chunkVURIXCGY_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[t]}`,a==null?void 0:a.riskBadge,o),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),L=t=>{let r={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",suspended:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",terminated:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",pending_approval:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"},l={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"};return jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a(`px-2 py-1 rounded text-xs font-medium ${r[t]}`,a==null?void 0:a.statusBadge,o),children:l[t]})},pe=t=>{var u;let r=chunkIQF726GS_js.a(t),l=((u=M.find(b=>b.value===t))==null?void 0:u.label)||t;return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${r?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200"}`,children:l})},se=()=>{let t=G||{totalActiveTransfers:c.filter(r=>r.status==="active").length,pendingApproval:c.filter(r=>{var l,u;return r.status==="pending_approval"||((l=r.ndpcApproval)==null?void 0:l.required)&&!((u=r.ndpcApproval)!=null&&u.approved)}),highRiskTransfers:c.filter(r=>r.riskLevel==="high"&&r.status==="active"),missingTIA:c.filter(r=>!r.tiaCompleted&&r.status==="active")};return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",a==null?void 0:a.summary,o),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",a==null?void 0:a.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:t.totalActiveTransfers}),jsxRuntime.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Active Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",a==null?void 0:a.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:t.pendingApproval.length}),jsxRuntime.jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Pending Approval"})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",a==null?void 0:a.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:t.highRiskTransfers.length}),jsxRuntime.jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"High Risk"})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",a==null?void 0:a.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-yellow-800 dark:text-yellow-200",children:t.missingTIA.length}),jsxRuntime.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-300",children:"Missing TIA"})]})]})},ue=()=>{let t=chunkIQF726GS_js.a(i.transferMechanism);return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",a==null?void 0:a.form,o),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("flex justify-between items-center mb-4",a==null?void 0:a.header,o),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:y?"Edit Transfer":"Add New Transfer"}),jsxRuntime.jsx("button",{onClick:()=>{w(),x(false);},className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"Cancel"})]}),f&&!f.isValid&&jsxRuntime.jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:f.errors.map((r,l)=>jsxRuntime.jsx("li",{children:r},l))})]}),f&&f.warnings.length>0&&jsxRuntime.jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:f.warnings.map((r,l)=>jsxRuntime.jsx("li",{children:r},l))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Destination Country ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.destinationCountry,onChange:r=>p("destinationCountry",r.target.value),placeholder:"e.g. United Kingdom",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Country Code (ISO)"}),jsxRuntime.jsx("input",{type:"text",value:i.destinationCountryCode,onChange:r=>p("destinationCountryCode",r.target.value),placeholder:"e.g. GB",maxLength:3,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Organization ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.recipientOrganization,onChange:r=>p("recipientOrganization",r.target.value),placeholder:"Organization name",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Transfer Mechanism ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{value:i.transferMechanism,onChange:r=>p("transferMechanism",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.select,o),children:M.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Adequacy Status"}),jsxRuntime.jsx("select",{value:i.adequacyStatus,onChange:r=>p("adequacyStatus",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.select,o),children:H.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Risk Level"}),jsxRuntime.jsxs("select",{value:i.riskLevel,onChange:r=>p("riskLevel",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.select,o),children:[jsxRuntime.jsx("option",{value:"low",children:"Low"}),jsxRuntime.jsx("option",{value:"medium",children:"Medium"}),jsxRuntime.jsx("option",{value:"high",children:"High"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Data Categories ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.dataCategories,onChange:r=>p("dataCategories",r.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:i.includesSensitiveData,onChange:r=>p("includesSensitiveData",r.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),jsxRuntime.jsx("label",{htmlFor:"includesSensitiveData",className:"text-sm font-medium",children:"Includes sensitive personal data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Estimated Data Subjects"}),jsxRuntime.jsx("input",{type:"number",value:i.estimatedDataSubjects,onChange:r=>p("estimatedDataSubjects",r.target.value),placeholder:"Number of data subjects",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Name ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.recipientContactName,onChange:r=>p("recipientContactName",r.target.value),placeholder:"Contact person name",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Email ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",value:i.recipientContactEmail,onChange:r=>p("recipientContactEmail",r.target.value),placeholder:"contact@example.com",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Phone"}),jsxRuntime.jsx("input",{type:"text",value:i.recipientContactPhone,onChange:r=>p("recipientContactPhone",r.target.value),placeholder:"Phone number",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Address"}),jsxRuntime.jsx("input",{type:"text",value:i.recipientContactAddress,onChange:r=>p("recipientContactAddress",r.target.value),placeholder:"Address",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Purpose of Transfer ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{value:i.purpose,onChange:r=>p("purpose",r.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Safeguards ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{value:i.safeguards,onChange:r=>p("safeguards",r.target.value),placeholder:`One safeguard per line, e.g.
|
|
4
|
+
End-to-end encryption
|
|
5
|
+
Access control policies
|
|
6
|
+
Regular security audits`,rows:3,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Risk Assessment Summary ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{value:i.riskAssessment,onChange:r=>p("riskAssessment",r.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Transfer Frequency"}),jsxRuntime.jsx("select",{value:i.frequency,onChange:r=>p("frequency",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.select,o),children:Y.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Status"}),jsxRuntime.jsx("select",{value:i.status,onChange:r=>p("status",r.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.select,o),children:Q.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))})]})]}),t&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-blue-800 dark:text-blue-200 mb-3",children:"NDPC Approval Required"}),jsxRuntime.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300 mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:i.ndpcApprovalApplied,onChange:r=>p("ndpcApprovalApplied",r.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApplied",className:"text-sm",children:"Application submitted"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:i.ndpcApprovalApproved,onChange:r=>p("ndpcApprovalApproved",r.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApproved",className:"text-sm",children:"Approval granted"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"NDPC Reference Number"}),jsxRuntime.jsx("input",{type:"text",value:i.ndpcApprovalReference,onChange:r=>p("ndpcApprovalReference",r.target.value),placeholder:"Reference number (if available)",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]})]})]}),ee&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"tiaCompleted",checked:i.tiaCompleted,onChange:r=>p("tiaCompleted",r.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),jsxRuntime.jsx("label",{htmlFor:"tiaCompleted",className:"text-sm",children:"TIA completed"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"TIA Reference"}),jsxRuntime.jsx("input",{type:"text",value:i.tiaReference,onChange:r=>p("tiaReference",r.target.value),placeholder:"Document reference",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.input,o)})]})]})]}),jsxRuntime.jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{w(),x(false);},className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:oe,className:chunkVURIXCGY_js.a(`px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 ${T}`,a==null?void 0:a.submitButton,o),children:y?"Update Transfer":"Add Transfer"})]})]})},me=t=>{var u,b;let r=chunkIQF726GS_js.d(t),l=chunkIQF726GS_js.c(t);return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("",a==null?void 0:a.detailPanel,o),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("h3",{className:"text-lg font-medium",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[L(t.status),E(t.riskLevel)]})]}),!l.isValid&&jsxRuntime.jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Compliance Issues"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:l.errors.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),l.warnings.length>0&&jsxRuntime.jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:l.warnings.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Destination:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=H.find(s=>s.value===t.adequacyStatus))==null?void 0:u.label]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Frequency:"})," ",(b=Y.find(s=>s.value===t.frequency))==null?void 0:b.label]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Start Date:"})," ",C(t.startDate)]}),t.endDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"End Date:"})," ",C(t.endDate)]}),t.reviewDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",C(t.reviewDate)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.includesSensitiveData?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Mechanism"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:chunkIQF726GS_js.b(t.transferMechanism)})})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Purpose"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:t.purpose})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Data Categories"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:t.dataCategories.map((s,m)=>jsxRuntime.jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:s},m))})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Safeguards"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-gray-600 dark:text-gray-300",children:t.safeguards.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Risk Assessment"}),jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:t.riskAssessment}),jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsxs("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:["Automated Assessment (Score: ",r.riskScore,")"]}),r.factors.length>0&&jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs text-gray-500 dark:text-gray-400",children:r.factors.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))}),r.recommendations.length>0&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Recommendations:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs text-gray-500 dark:text-gray-400",children:r.recommendations.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]})]})]})]}),t.ndpcApproval&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"NDPC Approval"}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`p-3 rounded-md ${t.ndpcApproval.approved?"bg-green-50 dark:bg-green-900/20":t.ndpcApproval.applied?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20"}`,a==null?void 0:a.approvalStatus,o),children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.ndpcApproval.approved?"Approved":t.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),t.ndpcApproval.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Applied:"})," ",C(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved:"})," ",C(t.ndpcApproval.approvedAt)]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:`p-3 rounded-md ${t.tiaCompleted?"bg-green-50 dark:bg-green-900/20":"bg-yellow-50 dark:bg-yellow-900/20"}`,children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-3 mt-6",children:[jsxRuntime.jsx("button",{onClick:()=>ie(t),className:`px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 ${T}`,children:"Edit"}),jsxRuntime.jsx("button",{onClick:()=>le(t.id),className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${X}`,a==null?void 0:a.root,o),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",a==null?void 0:a.title,o),children:K}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:J}),Z&&se(),!I&&jsxRuntime.jsx("div",{className:"mb-6",children:jsxRuntime.jsx("button",{onClick:ne,className:chunkVURIXCGY_js.a(`px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 ${T}`,a==null?void 0:a.submitButton,o),children:"Add Transfer"})}),I&&ue(),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbStatusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"cbStatusFilter",value:h,onChange:t=>te(t.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),Q.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbMechanismFilter",className:"block text-sm font-medium mb-1",children:"Mechanism Filter"}),jsxRuntime.jsxs("select",{id:"cbMechanismFilter",value:A,onChange:t=>ae(t.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",a==null?void 0:a.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Mechanisms"}),M.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),k.length===0?jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No cross-border transfers found."}):jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",a==null?void 0:a.transferList,o),children:k.map(t=>{var r,l;return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`p-3 rounded-md cursor-pointer ${v===t.id?"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,a==null?void 0:a.transferItem,o),onClick:()=>D(t.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),E(t.riskLevel)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:t.recipientOrganization}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:pe(t.transferMechanism)}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[L(t.status),((r=t.ndpcApproval)==null?void 0:r.required)&&!((l=t.ndpcApproval)!=null&&l.approved)&&jsxRuntime.jsx("span",{className:"text-xs text-purple-600 dark:text-purple-400",children:"NDPC Pending"})]})]},t.id)})})]}),jsxRuntime.jsx("div",{className:"md:col-span-2",children:j?me(j):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Select a transfer to view details"})})})]})]})};exports.a=xe;//# sourceMappingURL=chunk-JKEAPTYP.js.map
|
|
7
|
+
//# sourceMappingURL=chunk-JKEAPTYP.js.map
|