@tantainnovative/ndpr-toolkit 3.2.1 → 3.3.1
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 +37 -4
- package/dist/{DPIAQuestionnaire-BkejviPj.d.mts → DPIAQuestionnaire-VXBoWFMC.d.ts} +3 -3
- package/dist/{DPIAQuestionnaire-DdSqXG3x.d.ts → DPIAQuestionnaire-jkt1Veb6.d.mts} +3 -3
- package/dist/{DSRRequestForm-BY8PogCU.d.mts → DSRRequestForm-D8rPTNmU.d.ts} +2 -2
- package/dist/{DSRRequestForm-CHUg9cZh.d.ts → DSRRequestForm-DRouEr9j.d.mts} +2 -2
- package/dist/{DSRTracker-Dr_aT0pg.d.ts → DSRTracker-Bl__d4df.d.ts} +1 -1
- package/dist/{DSRTracker-C6u_jAaK.d.mts → DSRTracker-CSVDfgQQ.d.mts} +1 -1
- package/dist/{StepIndicator-D9ZATz_O.d.ts → StepIndicator-CgrlokSV.d.ts} +1 -1
- package/dist/{StepIndicator-D-nwRTyo.d.mts → StepIndicator-W8S_QjgO.d.mts} +1 -1
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-25OOUES4.js +2 -0
- package/dist/chunk-2AW7KAZO.mjs +2 -0
- package/dist/chunk-4JKTIR33.mjs +2 -0
- package/dist/chunk-5BUS6AI7.js +2 -0
- package/dist/chunk-5ECDPRSZ.js +7 -0
- package/dist/chunk-5X32J5IA.mjs +2 -0
- package/dist/chunk-6FGCGLH5.mjs +2 -0
- package/dist/chunk-6YN73KR7.mjs +2 -0
- package/dist/chunk-75TJPK2N.mjs +2 -0
- package/dist/{chunk-NXQMU36Z.mjs → chunk-7D2OIPHH.mjs} +2 -2
- package/dist/chunk-C4YM4UMI.js +2 -0
- package/dist/{chunk-EH2I4L7M.mjs → chunk-CDZDT2OS.mjs} +14 -10
- package/dist/chunk-CYU6YUJQ.mjs +81 -0
- package/dist/chunk-DCJK5OZT.mjs +2 -0
- package/dist/chunk-EKHBORAH.js +81 -0
- package/dist/chunk-ENIMJ6SQ.js +2 -0
- package/dist/chunk-FLKJSGR7.mjs +94 -0
- package/dist/chunk-FWLPJ5YI.js +94 -0
- package/dist/chunk-GMLCWGNJ.js +7 -0
- package/dist/chunk-GXLSOZCH.mjs +2 -0
- package/dist/{chunk-NRQELKAE.js → chunk-JKKRPS4P.js} +2 -2
- package/dist/chunk-LETEUS5X.mjs +2 -0
- package/dist/chunk-M2TPT5GB.js +2 -0
- package/dist/chunk-MCWV7S2G.js +2 -0
- package/dist/chunk-NBSVFQ5G.js +2 -0
- package/dist/chunk-OPYQIJKY.js +2 -0
- package/dist/chunk-OYR3L4XS.mjs +7 -0
- package/dist/chunk-QF6XNKU6.mjs +2 -0
- package/dist/{chunk-256APOQM.js → chunk-QJ3JNHO7.js} +2 -2
- package/dist/{chunk-Q7VHB64E.mjs → chunk-QNCGRCAX.mjs} +2 -2
- package/dist/chunk-TI2M7H6R.mjs +7 -0
- package/dist/{chunk-KVOGOLIR.js → chunk-TXXWCB5O.js} +14 -10
- package/dist/{chunk-44W4H2EY.js → chunk-UGY5ZYUG.js} +2 -2
- package/dist/chunk-UO6QPJLH.js +2 -0
- package/dist/chunk-UX6ZZNEM.mjs +3 -0
- package/dist/chunk-XFUEZ3MP.mjs +2 -0
- package/dist/chunk-XHSHPB74.js +2 -0
- package/dist/chunk-XSEZDQLB.js +2 -0
- package/dist/chunk-YCX6BFOQ.js +2 -0
- package/dist/chunk-YURSF2YO.mjs +2 -0
- package/dist/chunk-YZXUAIYN.js +3 -0
- package/dist/chunk-Z6IIMLZU.mjs +2 -0
- package/dist/chunk-ZT7KNFAU.mjs +2 -0
- package/dist/chunk-ZYLDLGFL.js +2 -0
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +25 -9
- package/dist/core.d.ts +25 -9
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +70 -3
- package/dist/cross-border.d.ts +70 -3
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/{dpia-B0Pok5us.d.ts → dpia-D82hUrJe.d.ts} +1 -1
- package/dist/{dpia-CUfOmzvX.d.mts → dpia-DQDFw2_l.d.mts} +1 -1
- package/dist/{dpia-5OQVA1R_.d.mts → dpia-c9GiiOq0.d.mts} +2 -2
- package/dist/{dpia-5OQVA1R_.d.ts → dpia-c9GiiOq0.d.ts} +2 -2
- package/dist/dpia.d.mts +9 -9
- package/dist/dpia.d.ts +9 -9
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/{dsr-D_eTNc4S.d.mts → dsr-CIx5sd7e.d.ts} +2 -2
- package/dist/{dsr-pNtVb1BK.d.ts → dsr-XZ_HqTlA.d.mts} +2 -2
- package/dist/{dsr-Cm9lzWG7.d.mts → dsr-yKbqX531.d.mts} +1 -1
- package/dist/{dsr-Cm9lzWG7.d.ts → dsr-yKbqX531.d.ts} +1 -1
- package/dist/dsr.d.mts +9 -9
- package/dist/dsr.d.ts +9 -9
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +8 -8
- package/dist/hooks.d.ts +8 -8
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/{policy-engine-DSQpT55_.d.ts → policy-engine-C6nC2t3a.d.ts} +1 -1
- package/dist/{policy-engine-C-tShzZH.d.mts → policy-engine-DefZcX3R.d.mts} +1 -1
- package/dist/{policy-sections-CfNVBLCh.d.mts → policy-sections-Bylm31kZ.d.mts} +1 -1
- package/dist/{policy-sections-DqH0iZRf.d.ts → policy-sections-DFDPVCCg.d.ts} +1 -1
- package/dist/policy.d.mts +6 -6
- package/dist/policy.d.ts +6 -6
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +5 -5
- package/dist/presets.d.ts +5 -5
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/{sanitize-9mOO_cJW.d.mts → sanitize-B0AzEm1D.d.mts} +14 -1
- package/dist/{sanitize-9mOO_cJW.d.ts → sanitize-B0AzEm1D.d.ts} +14 -1
- package/dist/{useAdaptivePolicyWizard-N4eUM4Tj.d.mts → useAdaptivePolicyWizard-A1PyOy6P.d.mts} +1 -1
- package/dist/{useAdaptivePolicyWizard-B9Op2gYM.d.ts → useAdaptivePolicyWizard-LVIKhAxw.d.ts} +1 -1
- package/dist/{useCrossBorderTransfer-BGNZt2lk.d.mts → useCrossBorderTransfer-DixjLjN1.d.mts} +1 -1
- package/dist/{useCrossBorderTransfer-COqjgjsu.d.ts → useCrossBorderTransfer-DvSq06lv.d.ts} +1 -1
- package/dist/{useDPIA-DzWye8JB.d.mts → useDPIA-B6180UQn.d.mts} +9 -5
- package/dist/{useDPIA-Dl16Te3r.d.ts → useDPIA-CTqbNbww.d.ts} +9 -5
- package/dist/{useDSR-C1LksCfP.d.mts → useDSR-WvHk8_iu.d.mts} +2 -2
- package/dist/{useDSR-DZel52O1.d.ts → useDSR-wH4H6hSM.d.ts} +2 -2
- package/dist/{useDefaultPrivacyPolicy-C-mG-A5S.d.ts → useDefaultPrivacyPolicy-DvCbeEl1.d.ts} +5 -1
- package/dist/{useDefaultPrivacyPolicy-BsYttRey.d.mts → useDefaultPrivacyPolicy-ySWU7nc-.d.mts} +5 -1
- package/package.json +7 -5
- package/dist/chunk-2FWCVWKN.js +0 -2
- package/dist/chunk-3DJGO6WG.js +0 -2
- package/dist/chunk-3UWT64FI.mjs +0 -2
- package/dist/chunk-4JUDKBA2.mjs +0 -7
- package/dist/chunk-4XCL62MJ.mjs +0 -2
- package/dist/chunk-555WWZ3W.js +0 -2
- package/dist/chunk-6BXUVS6E.js +0 -81
- package/dist/chunk-6RQGQZT2.js +0 -2
- package/dist/chunk-CL53OI3I.js +0 -7
- package/dist/chunk-E63VPR7U.js +0 -2
- package/dist/chunk-ELKEZEV5.mjs +0 -2
- package/dist/chunk-ER7X6E36.js +0 -2
- package/dist/chunk-FDDI426Y.mjs +0 -2
- package/dist/chunk-FOXZRRMW.mjs +0 -2
- package/dist/chunk-FY5G6DGZ.js +0 -7
- package/dist/chunk-GOD4LA2J.mjs +0 -2
- package/dist/chunk-I23WPZNQ.mjs +0 -94
- package/dist/chunk-IQF726GS.js +0 -2
- package/dist/chunk-IR7VCBWV.mjs +0 -2
- package/dist/chunk-K45S6YQV.mjs +0 -2
- package/dist/chunk-KBAFOVE3.js +0 -2
- package/dist/chunk-KBP26GLC.js +0 -2
- package/dist/chunk-MDWG2KDA.mjs +0 -2
- package/dist/chunk-NN233SGA.mjs +0 -3
- package/dist/chunk-NPI5T6NH.mjs +0 -7
- package/dist/chunk-NUDVUAD4.mjs +0 -81
- package/dist/chunk-PM7O5IGE.mjs +0 -2
- package/dist/chunk-QH6YUVJS.js +0 -2
- package/dist/chunk-QKK5S54L.mjs +0 -2
- package/dist/chunk-QY7PD5XB.js +0 -94
- package/dist/chunk-TVW6KBVV.mjs +0 -2
- package/dist/chunk-UDNRAQLE.js +0 -3
- package/dist/chunk-UNKXYVXY.js +0 -2
- package/dist/chunk-V37BM2LF.js +0 -2
- package/dist/chunk-V3MXWGXU.mjs +0 -2
- package/dist/chunk-VK27WVV3.js +0 -2
- package/dist/chunk-XQ4M5FHC.mjs +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b,d,a as a$1,c}from'./chunk-SHMJNRHO.mjs';import {a as a$2}from'./chunk-AYKLAEOU.mjs';import {a,b as b$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useMemo,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var _=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],ee=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],Oe=[{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 je(){let d=Date.now();return {id:`proc_${d}_${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:d,updatedAt:d}}function te(d){return d?new Date(d).toLocaleDateString():"N/A"}var $e=({ropa:d$1,onAddRecord:w,onUpdateRecord:R,onArchiveRecord:D,title:re="Record of Processing Activities (ROPA)",description:ae="Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",className:ie="",buttonClassName:F="",classNames:e,unstyled:o})=>{let[v,x]=useState("list"),[S,oe]=useState(""),[P,ne]=useState("all"),[A,de]=useState("all"),[l,f]=useState(null),[U,k]=useState([]),[I,$]=useState(""),[M,H]=useState(""),[L,V]=useState(""),[E,J]=useState(""),[O,z]=useState(""),[j,G]=useState(""),[q,W]=useState(""),p=useMemo(()=>b(d$1),[d$1]),y=useMemo(()=>d(d$1),[d$1]),K=useMemo(()=>{let r=[...d$1.records];if(P!=="all"&&(r=r.filter(i=>i.status===P)),A!=="all"&&(r=r.filter(i=>i.lawfulBasis===A)),S){let i=S.toLowerCase();r=r.filter(u=>u.name.toLowerCase().includes(i)||u.description.toLowerCase().includes(i)||u.dataCategories.some(m=>m.toLowerCase().includes(i))||u.department&&u.department.toLowerCase().includes(i));}return r},[d$1.records,P,A,S]);useEffect(()=>{l&&($(l.purposes.join(", ")),H(l.dataCategories.join(", ")),V((l.sensitiveDataCategories||[]).join(", ")),J(l.dataSubjectCategories.join(", ")),z(l.recipients.join(", ")),G(l.securityMeasures.join(", ")),W((l.systemsUsed||[]).join(", ")));},[l==null?void 0:l.id]);let le=useCallback(()=>{let r=je();r.controllerDetails.name=d$1.organizationName,r.controllerDetails.contact=d$1.organizationContact,r.controllerDetails.address=d$1.organizationAddress,d$1.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=d$1.ndpcRegistrationNumber),d$1.dpoDetails&&(r.controllerDetails.dpoContact=d$1.dpoDetails.email),f(r),k([]),x("form");},[d$1.organizationName,d$1.organizationContact,d$1.organizationAddress,d$1.ndpcRegistrationNumber,d$1.dpoDetails]),ue=useCallback(r=>{f(a({},r)),k([]),x("form");},[]),b$2=r=>r.split(",").map(i=>i.trim()).filter(i=>i.length>0),ge=useCallback(()=>{if(!l)return;let r=b$1(a({},l),{purposes:b$2(I),dataCategories:b$2(M),sensitiveDataCategories:b$2(L),dataSubjectCategories:b$2(E),recipients:b$2(O),securityMeasures:b$2(j),systemsUsed:b$2(q),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let i=a$1(r);if(!i.valid){k(i.errors);return}d$1.records.find(m=>m.id===r.id)?R==null||R(r.id,r):w==null||w(r),f(null),k([]),x("list");},[l,I,M,L,E,O,j,q,d$1.records,R,w]),se=useCallback(r=>{D==null||D(r);},[D]),ce=useCallback(()=>{let r=c(d$1),i=new Blob([r],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(i),m=document.createElement("a");m.href=u,m.download=`ropa_${d$1.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(u),100);},[d$1]),Q=useCallback(()=>{f(null),k([]),x("list");},[]),s=useCallback((r,i)=>{f(u=>u&&b$1(a({},u),{[r]:i}));},[]),T=useCallback((r,i)=>{f(u=>u&&b$1(a({},u),{controllerDetails:b$1(a({},u.controllerDetails),{[r]:i})}));},[]),pe=useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),me=useCallback(r=>{oe(r.target.value);},[]),be=useCallback(r=>{ne(r.target.value);},[]),ve=useCallback(r=>{de(r.target.value);},[]),xe=useCallback(r=>{$(r.target.value);},[]),fe=useCallback(r=>{H(r.target.value);},[]),ye=useCallback(r=>{V(r.target.value);},[]),he=useCallback(r=>{J(r.target.value);},[]),ke=useCallback(r=>{z(r.target.value);},[]),Ce=useCallback(r=>{G(r.target.value);},[]),we=useCallback(r=>{W(r.target.value);},[]),Re=useCallback(()=>x("list"),[]),De=useCallback(()=>x("summary"),[]),Se=useCallback(r=>{let i={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},u={active:"Active",inactive:"Inactive",archived:"Archived"};return jsx("span",{className:a$2(`px-2 py-1 rounded text-xs font-medium ${i[r]}`,e==null?void 0:e.statusBadge,o),children:u[r]})},[e==null?void 0:e.statusBadge,o]),Pe=useCallback(r=>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"}[r]}),[]),Ae=()=>jsxs("div",{className:a$2("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,o),children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Organization"}),jsx("p",{className:"text-sm font-semibold",children:d$1.organizationName})]}),d$1.dpoDetails&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Data Protection Officer"}),jsx("p",{className:"text-sm font-semibold",children:d$1.dpoDetails.name}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:d$1.dpoDetails.email})]}),d$1.ndpcRegistrationNumber&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"NDPC Registration No."}),jsx("p",{className:"text-sm font-semibold",children:d$1.ndpcRegistrationNumber})]})]}),jsxs("div",{className:"mt-2 text-xs text-gray-600 dark:text-gray-400",children:["Version ",d$1.version," | Last Updated: ",te(d$1.lastUpdated)]})]}),Be=()=>jsxs("div",{className:a$2("mb-6",e==null?void 0:e.summary,o),children:[jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxs("div",{className:a$2("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:p.totalRecords}),jsx("p",{className:"text-xs text-blue-600 dark:text-blue-400",children:"Total Records"})]}),jsxs("div",{className:a$2("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-green-700 dark:text-green-300",children:p.activeRecords}),jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"Active"})]}),jsxs("div",{className:a$2("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-purple-700 dark:text-purple-300",children:p.crossBorderRecords}),jsx("p",{className:"text-xs text-purple-600 dark:text-purple-400",children:"Cross-Border"})]}),jsxs("div",{className:a$2("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-orange-700 dark:text-orange-300",children:y.length}),jsx("p",{className:"text-xs text-orange-600 dark:text-orange-400",children:"Records with Gaps"})]})]}),jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm font-medium mb-2",children:"By Lawful Basis"}),_.map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:r.label.split(" (")[0]}),jsx("span",{className:"font-medium",children:p.byLawfulBasis[r.value]||0})]},r.value))]}),jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm font-medium mb-2",children:"Risk Indicators"}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Sensitive Data"}),jsx("span",{className:"font-medium",children:p.sensitiveDataRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"DPIA Required"}),jsx("span",{className:"font-medium",children:p.dpiaRequiredRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Automated Decisions"}),jsx("span",{className:"font-medium",children:p.automatedDecisionRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Due for Review"}),jsx("span",{className:`font-medium ${p.recordsDueForReview.length>0?"text-red-600 dark:text-red-400":""}`,children:p.recordsDueForReview.length})]})]}),p.topDepartments.length>0&&jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm font-medium mb-2",children:"Top Departments"}),p.topDepartments.slice(0,5).map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:r.department}),jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]}),y.length>0&&jsxs("div",{className:a$2("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,o),role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-2",children:"Compliance Gaps Detected"}),y.slice(0,5).map(r=>jsxs("div",{className:"mb-2",children:[jsx("p",{className:"text-xs font-medium text-red-700 dark:text-red-300",children:r.recordName}),jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((i,u)=>jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:i},u))})]},r.recordId)),y.length>5&&jsxs("p",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:["...and ",y.length-5," more record(s) with gaps."]})]})]}),Fe=()=>jsxs("div",{children:[jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"ropaSearch",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"ropaSearch",value:S,onChange:me,placeholder:"Search records...",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaStatusFilter",className:"block text-sm font-medium mb-1",children:"Status"}),jsxs("select",{id:"ropaStatusFilter",value:P,onChange:be,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:[jsx("option",{value:"all",children:"All Statuses"}),ee.map(r=>jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaBasisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxs("select",{id:"ropaBasisFilter",value:A,onChange:ve,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:[jsx("option",{value:"all",children:"All Bases"}),_.map(r=>jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxs("div",{className:"flex items-end space-x-2",children:[jsx("button",{onClick:le,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),o),children:"Add Record"}),jsx("button",{onClick:ce,"aria-label":"Export ROPA records as CSV",className:a$2(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${F}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),o),children:"Export CSV"})]})]}),K.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm text-center py-8",children:"No processing records found."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a$2("w-full text-sm text-left",e==null?void 0:e.table,o),children:[jsx("thead",{className:a$2("text-xs uppercase bg-gray-50 dark:bg-gray-700",e==null?void 0:e.tableHeader,o),children:jsxs("tr",{children:[jsx("th",{className:"px-4 py-3",children:"Name"}),jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsx("th",{className:"px-4 py-3",children:"Data Categories"}),jsx("th",{className:"px-4 py-3",children:"Status"}),jsx("th",{className:"px-4 py-3",children:"Last Reviewed"}),jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsx("tbody",{children:K.map(r=>{let i=pe(r),u=y.some(m=>m.recordId===r.id);return jsxs("tr",{className:a$2(`border-b dark:border-gray-600 ${i?"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`,e==null?void 0:e.tableRow,o),children:[jsx("td",{className:"px-4 py-3",children:jsxs("div",{children:[jsx("p",{className:"font-medium",children:r.name}),r.department&&jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:r.department}),i&&jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-medium",children:"Review Overdue"})]})}),jsx("td",{className:"px-4 py-3",children:Pe(r.lawfulBasis)}),jsx("td",{className:"px-4 py-3",children:jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsx("td",{className:"px-4 py-3",children:Se(r.status)}),jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:te(r.lastReviewedAt)}),jsx("td",{className:"px-4 py-3",children:jsxs("div",{className:"flex space-x-2",children:[jsx("button",{onClick:()=>ue(r),"aria-label":`Edit record: ${r.name}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsx("button",{onClick:()=>se(r.id),"aria-label":`Archive record: ${r.name}`,className:"text-gray-600 dark:text-gray-400 hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Ie=useMemo(()=>l?!d$1.records.find(r=>r.id===l.id):true,[l,d$1.records]),Me=()=>{if(!l)return null;let r=Ie;return jsxs("div",{className:a$2("",e==null?void 0:e.form,o),children:[jsxs("div",{className:a$2("flex justify-between items-center mb-4",e==null?void 0:e.header,o),children:[jsx("h3",{className:"text-lg font-medium",children:r?"Add Processing Record":"Edit Processing Record"}),jsx("button",{onClick:Q,className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 text-sm",children:"Cancel"})]}),U.length>0&&jsxs("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-md",role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside",children:U.map((i,u)=>jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:i},u))})]}),jsxs("div",{className:"space-y-6",children:[jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Basic Information"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"recordName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsx("input",{type:"text",id:"recordName",value:l.name,onChange:i=>s("name",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Customer Account Management"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordDepartment",className:"block text-sm font-medium mb-1",children:"Department"}),jsx("input",{type:"text",id:"recordDepartment",value:l.department||"",onChange:i=>s("department",i.target.value||void 0),className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Marketing"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"recordDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsx("textarea",{id:"recordDescription",value:l.description,onChange:i=>s("description",i.target.value),rows:3,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Describe what personal data processing is performed..."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordStatus",className:"block text-sm font-medium mb-1",children:"Status *"}),jsx("select",{id:"recordStatus",value:l.status,onChange:i=>s("status",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:ee.map(i=>jsx("option",{value:i.value,children:i.label},i.value))})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Controller Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"controllerName",className:"block text-sm font-medium mb-1",children:"Controller Name *"}),jsx("input",{type:"text",id:"controllerName",value:l.controllerDetails.name,onChange:i=>T("name",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"controllerContact",className:"block text-sm font-medium mb-1",children:"Controller Contact *"}),jsx("input",{type:"text",id:"controllerContact",value:l.controllerDetails.contact,onChange:i=>T("contact",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"controllerAddress",className:"block text-sm font-medium mb-1",children:"Controller Address *"}),jsx("input",{type:"text",id:"controllerAddress",value:l.controllerDetails.address,onChange:i=>T("address",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Lawful Basis (NDPA Section 25)"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis *"}),jsx("select",{id:"lawfulBasis",value:l.lawfulBasis,onChange:i=>s("lawfulBasis",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:_.map(i=>jsx("option",{value:i.value,children:i.label},i.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasisJustification",className:"block text-sm font-medium mb-1",children:"Justification *"}),jsx("textarea",{id:"lawfulBasisJustification",value:l.lawfulBasisJustification,onChange:i=>s("lawfulBasisJustification",i.target.value),rows:2,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Data Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Purposes * (comma-separated)"}),jsx("input",{type:"text",id:"purposes",value:I,onChange:xe,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Account management, Service delivery"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories * (comma-separated)"}),jsx("input",{type:"text",id:"dataCategories",value:M,onChange:fe,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Name, Email, Phone number"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveData",className:"block text-sm font-medium mb-1",children:"Sensitive Data Categories (comma-separated)"}),jsx("input",{type:"text",id:"sensitiveData",value:L,onChange:ye,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Health data, Biometric data"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"subjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories * (comma-separated)"}),jsx("input",{type:"text",id:"subjectCategories",value:E,onChange:he,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Customers, Employees"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients * (comma-separated)"}),jsx("input",{type:"text",id:"recipients",value:O,onChange:ke,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSource",className:"block text-sm font-medium mb-1",children:"Data Source *"}),jsx("select",{id:"dataSource",value:l.dataSource,onChange:i=>s("dataSource",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,o),children:Oe.map(i=>jsx("option",{value:i.value,children:i.label},i.value))})]}),l.dataSource==="third_party"&&jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"thirdPartyDetails",className:"block text-sm font-medium mb-1",children:"Third-Party Source Details *"}),jsx("input",{type:"text",id:"thirdPartyDetails",value:l.thirdPartySourceDetails||"",onChange:i=>s("thirdPartySourceDetails",i.target.value||void 0),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Describe the third-party data source..."})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Retention and Security"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsx("input",{type:"text",id:"retentionPeriod",value:l.retentionPeriod,onChange:i=>s("retentionPeriod",i.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., 5 years after account closure"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsx("input",{type:"text",id:"retentionJustification",value:l.retentionJustification||"",onChange:i=>s("retentionJustification",i.target.value||void 0),className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Why this retention period is necessary..."})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"securityMeasures",className:"block text-sm font-medium mb-1",children:"Security Measures * (comma-separated)"}),jsx("input",{type:"text",id:"securityMeasures",value:j,onChange:Ce,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"systemsUsed",className:"block text-sm font-medium mb-1",children:"Systems Used (comma-separated)"}),jsx("input",{type:"text",id:"systemsUsed",value:q,onChange:we,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Risk Indicators"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"dpiaRequired",checked:l.dpiaRequired,onChange:i=>s("dpiaRequired",i.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsx("label",{htmlFor:"dpiaRequired",className:"text-sm font-medium",children:"DPIA Required"})]}),l.dpiaRequired&&jsxs("div",{children:[jsx("label",{htmlFor:"dpiaReference",className:"block text-sm font-medium mb-1",children:"DPIA Reference *"}),jsx("input",{type:"text",id:"dpiaReference",value:l.dpiaReference||"",onChange:i=>s("dpiaReference",i.target.value||void 0),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Reference to the completed DPIA"})]}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:l.automatedDecisionMaking,onChange:i=>s("automatedDecisionMaking",i.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsx("label",{htmlFor:"automatedDecisionMaking",className:"text-sm font-medium",children:"Automated Decision-Making"})]}),l.automatedDecisionMaking&&jsxs("div",{children:[jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"block text-sm font-medium mb-1",children:"Automated Decision-Making Details *"}),jsx("textarea",{id:"automatedDecisionMakingDetails",value:l.automatedDecisionMakingDetails||"",onChange:i=>s("automatedDecisionMakingDetails",i.target.value||void 0),rows:2,"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Review Schedule"}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:jsxs("div",{children:[jsx("label",{htmlFor:"nextReviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsx("input",{type:"date",id:"nextReviewDate",value:l.nextReviewDate?new Date(l.nextReviewDate).toISOString().slice(0,10):"",onChange:i=>s("nextReviewDate",i.target.value?new Date(i.target.value).getTime():void 0),className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,o)})]})})]}),jsxs("div",{className:"flex justify-end space-x-3",children:[jsx("button",{onClick:Q,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-sm",children:"Cancel"}),jsx("button",{onClick:ge,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),o),children:r?"Add Record":"Save Changes"})]})]})]})},Le=()=>jsxs("div",{className:"flex space-x-4 mb-6 border-b border-gray-200 dark:border-gray-600",children:[jsx("button",{onClick:Re,className:`pb-2 text-sm font-medium ${v==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsx("button",{onClick:De,className:`pb-2 text-sm font-medium ${v==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxs("div",{className:a$2(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ie}`,e==null?void 0:e.root,o),children:[jsx("h2",{className:a$2("text-xl font-bold mb-2",e==null?void 0:e.title,o),children:re}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ae}),Ae(),v!=="form"&&Le(),v==="list"&&Fe(),v==="summary"&&Be(),v==="form"&&Me()]})};export{$e as a};//# sourceMappingURL=chunk-YURSF2YO.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-YURSF2YO.mjs.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use strict';var chunkTXXWCB5O_js=require('./chunk-TXXWCB5O.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),Gr=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Gr__default=/*#__PURE__*/_interopDefault(Gr);var br=["Organization","Data Collection","Processing","Review & Export"],vr=({currentStep:d,classNames:p,unstyled:r})=>jsxRuntime.jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:chunkE64TU6IU_js.a("w-full flex items-center justify-between px-2 py-4",p==null?void 0:p.root,r),children:br.map((o,n)=>{let t=n+1,i=t<d,a=t===d,v=n===br.length-1;return jsxRuntime.jsxs(Gr__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsxRuntime.jsx("div",{"aria-current":a?"step":void 0,"aria-label":`Step ${t}: ${o}${i?" (completed)":a?" (current)":""}`,className:chunkE64TU6IU_js.a(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":a?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?p==null?void 0:p.stepCompleted:a?p==null?void 0:p.stepCurrent:p==null?void 0:p.stepUpcoming,r),children:i?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("span",{className:"text-xs leading-none",children:t})}),jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(["text-xs font-medium hidden sm:block",i||a?"text-[rgb(var(--ndpr-primary))]":"text-gray-400 dark:text-gray-500"].join(" "),p==null?void 0:p.stepLabel,r),children:o})]}),!v&&jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Vr="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",A=({id:d,label:p,required:r,description:o,children:n,classNames:t,unstyled:i})=>{let a=o?`${d}-desc`:void 0;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col",t==null?void 0:t.field,i),children:[jsxRuntime.jsxs("label",{htmlFor:d,className:chunkE64TU6IU_js.a(Vr,t==null?void 0:t.label,i),children:[p,r&&jsxRuntime.jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),o&&jsxRuntime.jsx("p",{id:a,className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:o}),n]})},yr=({context:d,onUpdateOrg:p,classNames:r,unstyled:o})=>{var i,a,x;let n=Gr.useId(),t=d.org;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-about",className:chunkE64TU6IU_js.a("space-y-6",r==null?void 0:r.root,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Organisation Details"}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:["Tell us about your organisation. Fields marked ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,o),children:[jsxRuntime.jsx(A,{id:`${n}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-org-name`,type:"text",value:t.name,onChange:v=>p({name:v.target.value}),placeholder:"Acme Corporation",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${n}-website`,label:"Website",required:true,classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-website`,type:"url",value:t.website,onChange:v=>p({website:v.target.value}),placeholder:"https://example.com",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${n}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-privacy-email`,type:"email",value:t.privacyEmail,onChange:v=>p({privacyEmail:v.target.value}),placeholder:"privacy@example.com",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${n}-industry`,label:"Industry",classNames:r,unstyled:o,children:jsxRuntime.jsxs("select",{id:`${n}-industry`,value:t.industry,onChange:v=>p({industry:v.target.value}),className:chunkE64TU6IU_js.a($,r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"fintech",children:"Fintech"}),jsxRuntime.jsx("option",{value:"healthcare",children:"Healthcare"}),jsxRuntime.jsx("option",{value:"ecommerce",children:"E-commerce"}),jsxRuntime.jsx("option",{value:"saas",children:"SaaS"}),jsxRuntime.jsx("option",{value:"education",children:"Education"}),jsxRuntime.jsx("option",{value:"government",children:"Government"}),jsxRuntime.jsx("option",{value:"other",children:"Other"})]})}),jsxRuntime.jsx(A,{id:`${n}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-dpo-name`,type:"text",value:(i=t.dpoName)!=null?i:"",onChange:v=>p({dpoName:v.target.value}),placeholder:"Jane Smith",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o)})}),jsxRuntime.jsx(A,{id:`${n}-dpo-email`,label:"DPO Email",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-dpo-email`,type:"email",value:(a=t.dpoEmail)!=null?a:"",onChange:v=>p({dpoEmail:v.target.value}),placeholder:"dpo@example.com",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o)})}),jsxRuntime.jsx(A,{id:`${n}-address`,label:"Registered Address",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-address`,type:"text",value:(x=t.address)!=null?x:"",onChange:v=>p({address:v.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o)})}),jsxRuntime.jsx(A,{id:`${n}-org-size`,label:"Organisation Size",classNames:r,unstyled:o,children:jsxRuntime.jsxs("select",{id:`${n}-org-size`,value:t.orgSize,onChange:v=>p({orgSize:v.target.value}),className:chunkE64TU6IU_js.a($,r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsxRuntime.jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsxRuntime.jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsxRuntime.jsx(A,{id:`${n}-country`,label:"Country of Operation",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{id:`${n}-country`,type:"text",value:t.country,onChange:v=>p({country:v.target.value}),placeholder:"Nigeria",className:chunkE64TU6IU_js.a($,r==null?void 0:r.input,o)})})]})]})};var Xr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Yr=["identity","financial","behavioral","sensitive","children"],Jr=["sensitive","children"],lr=({categories:d,onToggle:p,classNames:r,unstyled:o})=>{let n=Yr.reduce((t,i)=>{let a=d.filter(x=>x.group===i);return a.length>0&&(t[i]=a),t},{});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-data",className:chunkE64TU6IU_js.a("space-y-8",r==null?void 0:r.root,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Data Categories"}),jsxRuntime.jsx("p",{id:"data-categories-desc",className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(n).map(([t,i])=>{let a=Jr.includes(t);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-3",r==null?void 0:r.group,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-2",r==null?void 0:r.groupHeader,o),children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-sm font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",r==null?void 0:r.groupTitle,o),children:Xr[t]}),a&&jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("text-xs font-medium text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,o),children:"Sensitive"})]}),a&&jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-amber-700 dark:text-amber-400",r==null?void 0:r.sensitiveWarning,o),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,o),children:i.map(x=>jsxRuntime.jsx("button",{type:"button",onClick:()=>p(x.id),"aria-pressed":x.selected,className:chunkE64TU6IU_js.a(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",x.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,o),children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",x.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,o),"aria-hidden":"true",children:x.selected&&jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",r==null?void 0:r.cardLabel,o),children:x.label}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,o),children:x.dataPoints.join(", ")})]})]})},x.id))})]},t)})]})};var Qr=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",gr=({id:d,checked:p,onChange:r})=>jsxRuntime.jsx("button",{id:d,type:"button",role:"switch","aria-checked":p,onClick:()=>r(!p),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",p?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsxRuntime.jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),fr=({context:d,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:o,onRemoveProcessor:n,classNames:t,unstyled:i})=>{let a=Gr.useId(),[x,v]=Gr.useState({name:"",purpose:"",country:""}),[k,g]=Gr.useState(false),u=()=>{let{name:b,purpose:h,country:m}=x;!b.trim()||!h.trim()||!m.trim()||(o({name:b.trim(),purpose:h.trim(),country:m.trim()}),v({name:"",purpose:"",country:""}),g(false));};return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-processing",className:chunkE64TU6IU_js.a("space-y-6",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.heading,i),children:"Processing Details"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxRuntime.jsxs("section",{className:chunkE64TU6IU_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsxRuntime.jsx("h3",{id:"purposes-heading",className:chunkE64TU6IU_js.a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",t==null?void 0:t.purposeList,i),children:Qr.map(b=>{let h=d.purposes.includes(b.value),m=`${a}-purpose-${b.value}`,z=`${a}-purpose-desc-${b.value}`;return jsxRuntime.jsxs("label",{htmlFor:m,className:chunkE64TU6IU_js.a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsxRuntime.jsx("input",{id:m,type:"checkbox",checked:h,onChange:()=>p(b.value),"aria-describedby":z,className:chunkE64TU6IU_js.a("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.purposeLabel,i),children:b.label}),jsxRuntime.jsx("p",{id:z,className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",t==null?void 0:t.purposeDescription,i),children:b.description})]})]},b.value)})})]}),jsxRuntime.jsxs("section",{className:chunkE64TU6IU_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{id:"thirdparty-heading",className:chunkE64TU6IU_js.a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsxRuntime.jsx(gr,{id:`${a}-thirdparty-toggle`,checked:d.thirdPartyProcessors.length>0||k,onChange:b=>{b?g(true):(d.thirdPartyProcessors.forEach((h,m)=>n(0)),g(false));}})]}),(d.thirdPartyProcessors.length>0||k)&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",t==null?void 0:t.processorSection,i),children:[d.thirdPartyProcessors.length>0&&jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxRuntime.jsxs("table",{className:"w-full text-sm",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{className:chunkE64TU6IU_js.a("text-left text-xs font-medium text-gray-500 dark:text-gray-400 border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsxRuntime.jsx("th",{className:"pb-2"})]})}),jsxRuntime.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:d.thirdPartyProcessors.map((b,h)=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:chunkE64TU6IU_js.a("py-2 pr-4 text-gray-900 dark:text-gray-100",t==null?void 0:t.tableCell,i),children:b.name}),jsxRuntime.jsx("td",{className:chunkE64TU6IU_js.a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:b.purpose}),jsxRuntime.jsx("td",{className:chunkE64TU6IU_js.a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:b.country}),jsxRuntime.jsx("td",{className:"py-2",children:jsxRuntime.jsx("button",{type:"button",onClick:()=>n(h),className:chunkE64TU6IU_js.a("text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${b.name}`,children:"Remove"})})]},h))})]})}),k?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${a}-proc-name`,className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Processor Name"}),jsxRuntime.jsx("input",{id:`${a}-proc-name`,type:"text",placeholder:"Processor name",value:x.name,onChange:b=>v(h=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},h),{name:b.target.value})),"aria-required":"true",className:chunkE64TU6IU_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${a}-proc-purpose`,className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Purpose"}),jsxRuntime.jsx("input",{id:`${a}-proc-purpose`,type:"text",placeholder:"Purpose",value:x.purpose,onChange:b=>v(h=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},h),{purpose:b.target.value})),"aria-required":"true",className:chunkE64TU6IU_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${a}-proc-country`,className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Country"}),jsxRuntime.jsx("input",{id:`${a}-proc-country`,type:"text",placeholder:"Country",value:x.country,onChange:b=>v(h=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},h),{country:b.target.value})),"aria-required":"true",className:chunkE64TU6IU_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:u,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>g(false),className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxRuntime.jsxs("button",{type:"button",onClick:()=>g(true),className:chunkE64TU6IU_js.a("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsxRuntime.jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxRuntime.jsxs("section",{className:chunkE64TU6IU_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsxRuntime.jsx("h3",{id:"disclosures-heading",className:chunkE64TU6IU_js.a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",t==null?void 0:t.disclosureList,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${a}-cross-border-label`,className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsxRuntime.jsx("p",{id:`${a}-cross-border-desc`,className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsxRuntime.jsx(gr,{id:`${a}-cross-border-toggle`,checked:d.hasCrossBorderTransfer,onChange:b=>r({hasCrossBorderTransfer:b})})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${a}-automated-label`,className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsxRuntime.jsx("p",{id:`${a}-automated-desc`,className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or AI to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsxRuntime.jsx(gr,{id:`${a}-automated-toggle`,checked:d.hasAutomatedDecisions,onChange:b=>r({hasAutomatedDecisions:b})})]})]})]})]})};var kr=({section:d,index:p,isCustom:r,isEditing:o,editedContent:n,onEdit:t,onSaveEdit:i,onCancelEdit:a,onMoveUp:x,onMoveDown:v,onDelete:k,classNames:g,unstyled:u})=>{let[b,h]=Gr.useState(n!=null?n:d.template);return Gr.useEffect(()=>{n!==void 0&&h(n);},[n]),Gr.useEffect(()=>{o&&h(n!=null?n:d.template);},[o,n,d.template]),jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-section-card",className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,u),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start justify-between gap-2",g==null?void 0:g.header,u),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,u),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 text-xs font-semibold flex items-center justify-center",g==null?void 0:g.sectionNumber,u),"aria-hidden":"true",children:p+1}),jsxRuntime.jsxs("h4",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",g==null?void 0:g.sectionTitle,u),children:[d.title,r&&jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("ml-2 text-xs font-normal text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",g==null?void 0:g.customBadge,u),children:"Custom"})]})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,u),children:[x&&jsxRuntime.jsx("button",{type:"button",onClick:x,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.moveButton,u),"aria-label":`Move "${d.title}" up`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),v&&jsxRuntime.jsx("button",{type:"button",onClick:v,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.moveButton,u),"aria-label":`Move "${d.title}" down`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!o&&jsxRuntime.jsx("button",{type:"button",onClick:t,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,u),"aria-label":`Edit "${d.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&k&&jsxRuntime.jsx("button",{type:"button",onClick:k,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,u),"aria-label":`Delete "${d.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),o?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-2",g==null?void 0:g.editArea,u),children:[jsxRuntime.jsx("textarea",{value:b,onChange:m=>h(m.target.value),rows:8,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",g==null?void 0:g.textarea,u),"aria-label":`Edit content for ${d.title}`}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex gap-2",g==null?void 0:g.editActions,u),children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>i(b),className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",g==null?void 0:g.saveButton,u),children:"Save"}),jsxRuntime.jsx("button",{type:"button",onClick:a,className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",g==null?void 0:g.cancelButton,u),children:"Cancel"})]})]}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("text-sm text-gray-600 dark:text-gray-300 leading-relaxed line-clamp-4 whitespace-pre-wrap",g==null?void 0:g.content,u),children:d.template})]})};var Cr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",wr=({onAdd:d,nextOrder:p,classNames:r,unstyled:o})=>{let n=Gr.useId(),[t,i]=Gr.useState(""),[a,x]=Gr.useState(""),[v,k]=Gr.useState(""),g=()=>{if(!t.trim()){k("Section title is required.");return}if(!a.trim()){k("Section content is required.");return}k(""),d({title:t.trim(),content:a.trim(),order:p}),i(""),x("");};return jsxRuntime.jsxs("div",{"data-ndpr-component":"custom-section-form",className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",r==null?void 0:r.root,o),children:[jsxRuntime.jsx("h4",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Add Custom Section"}),v&&jsxRuntime.jsx("p",{role:"alert",className:chunkE64TU6IU_js.a("text-xs text-red-600 dark:text-red-400",r==null?void 0:r.error,o),children:v}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-3",r==null?void 0:r.fields,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${n}-custom-section-title`,className:chunkE64TU6IU_js.a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Section Title ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("input",{id:`${n}-custom-section-title`,type:"text",value:t,onChange:u=>{i(u.target.value),v&&k("");},placeholder:"e.g. Cookie Policy",className:chunkE64TU6IU_js.a(Cr,r==null?void 0:r.input,o),"aria-required":"true"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${n}-custom-section-content`,className:chunkE64TU6IU_js.a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Content ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("textarea",{id:`${n}-custom-section-content`,value:a,onChange:u=>{x(u.target.value),v&&k("");},placeholder:"Write the section content here...",rows:5,className:chunkE64TU6IU_js.a(`${Cr} resize-y`,r==null?void 0:r.textarea,o),"aria-required":"true"})]})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("flex items-center gap-2",r==null?void 0:r.footer,o),children:jsxRuntime.jsx("button",{type:"button",onClick:g,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",r==null?void 0:r.addButton,o),children:"Add Section"})})]})};var mr={compliant:{bg:"bg-green-50 dark:bg-green-900/20",text:"text-green-700 dark:text-green-300",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"text-amber-700 dark:text-amber-300",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"bg-red-50 dark:bg-red-900/20",text:"text-red-700 dark:text-red-300",border:"border-red-200 dark:border-red-700"}},sr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:d,label:p,description:r,actionLabel:o,loading:n,onClick:t,classNames:i,unstyled:a})=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,a),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-3",i==null?void 0:i.formatHeader,a),children:[jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,a),"aria-hidden":"true",children:d}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100",i==null?void 0:i.formatLabel,a),children:p}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",i==null?void 0:i.formatDescription,a),children:r})]})]}),jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:n,className:chunkE64TU6IU_js.a("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,a),children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):o})]}),Sr=({complianceResult:d,onExportPDF:p,onExportDOCX:r,onExportHTML:o,onExportMarkdown:n,classNames:t,unstyled:i})=>{var h;let[a,x]=Gr.useState(false),[v,k]=Gr.useState(false),g=(h=mr[d.rating])!=null?h:mr.not_compliant,u=()=>chunkMQFZHA2D_js.d(null,null,function*(){x(true);try{yield p();}finally{x(false);}}),b=()=>chunkMQFZHA2D_js.d(null,null,function*(){k(true);try{yield r();}finally{k(false);}});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-export-panel",className:chunkE64TU6IU_js.a("space-y-6",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${d.percentage}%`,children:[d.percentage,"%"]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:sr[d.rating]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.complianceDetail,i),children:[d.score," / ",d.maxScore," points \u2022"," ",d.gaps.length," gap",d.gaps.length!==1?"s":""," remaining"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100 mb-3",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:a,onClick:u,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:v,onClick:b,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsxRuntime.jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsxRuntime.jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:o,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-gray-500 dark:text-gray-300",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:n,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:d,customSections:p,sectionOverrides:r,complianceResult:o,onEditSection:n,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:a,onExportPDF:x,onExportDOCX:v,onExportHTML:k,onExportMarkdown:g,classNames:u,unstyled:b})=>{let[h,m]=Gr.useState(null),[z,J]=Gr.useState(false),Z=new Set(p.map(f=>f.id)),er=(f,D)=>{n(f,D),m(null);},or=d.length>0?Math.max(...d.map(f=>{var D;return (D=f.order)!=null?D:0}))+1:1;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-review",className:chunkE64TU6IU_js.a("space-y-6",u==null?void 0:u.root,b),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",u==null?void 0:u.heading,b),children:"Review & Export"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",u==null?void 0:u.subheading,b),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",u==null?void 0:u.sectionList,b),"aria-live":"polite",children:d.map((f,D)=>jsxRuntime.jsx(kr,{section:r[f.id]?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},f),{template:r[f.id]}):f,index:D,isCustom:Z.has(f.id),isEditing:h===f.id,editedContent:r[f.id],onEdit:()=>m(f.id),onSaveEdit:ir=>er(f.id,ir),onCancelEdit:()=>m(null),onMoveUp:D>0?()=>a(f.id,"up"):void 0,onMoveDown:D<d.length-1?()=>a(f.id,"down"):void 0,onDelete:Z.has(f.id)?()=>i(f.id):void 0,classNames:u,unstyled:b},f.id))}),!z&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>J(true),className:chunkE64TU6IU_js.a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",u==null?void 0:u.addSectionButton,b),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",u==null?void 0:u.addSectionIcon,b),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),z&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-2",u==null?void 0:u.customFormWrapper,b),children:[jsxRuntime.jsx(wr,{onAdd:f=>{t(f),J(false);},nextOrder:or,classNames:u,unstyled:b}),jsxRuntime.jsx("button",{type:"button",onClick:()=>J(false),className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 hover:underline",u==null?void 0:u.cancelCustomForm,b),children:"Cancel"})]}),jsxRuntime.jsx("hr",{className:chunkE64TU6IU_js.a("border-gray-200 dark:border-gray-700",u==null?void 0:u.divider,b)}),jsxRuntime.jsx(Sr,{complianceResult:o,onExportPDF:x,onExportDOCX:v,onExportHTML:k,onExportMarkdown:g,classNames:u,unstyled:b})]})};var Dr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"text-green-600 dark:text-green-400"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"text-amber-600 dark:text-amber-400"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"text-red-600 dark:text-red-400"}},tt={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Fr=({score:d,maxScore:p,rating:r,classNames:o,unstyled:n})=>{var k,g;let t=p>0?Math.round(d/p*100):0,i=(k=Dr[r])!=null?k:Dr.not_compliant,a=36,x=2*Math.PI*a,v=x-t/100*x;return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:chunkE64TU6IU_js.a("flex flex-col items-center gap-2",o==null?void 0:o.root,n),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("relative w-24 h-24",o==null?void 0:o.svgWrapper,n),children:[jsxRuntime.jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:a,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:a,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:x,strokeDashoffset:v,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("absolute inset-0 flex flex-col items-center justify-center",o==null?void 0:o.centerText,n),children:jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a(`text-xl font-bold leading-none ${i.text}`,o==null?void 0:o.scoreValue,n),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-xs font-semibold text-center ${i.text}`,o==null?void 0:o.ratingLabel,n),children:(g=tt[r])!=null?g:r}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 text-center",o==null?void 0:o.scoreDetail,n),children:[d," / ",p," pts"]})]})};var ot={critical:"text-red-600 dark:text-red-400",important:"text-amber-600 dark:text-amber-400",recommended:"text-blue-600 dark:text-blue-400"},Er=({gap:d,isPassed:p,onFix:r,classNames:o,unstyled:n})=>{let[t,i]=Gr.useState(false);return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:chunkE64TU6IU_js.a("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",o==null?void 0:o.root,n),children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!p&&i(a=>!a),className:chunkE64TU6IU_js.a("w-full flex items-start gap-2 text-left group",o==null?void 0:o.row,n),"aria-expanded":p?void 0:t,"aria-disabled":p,children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",p?"bg-green-500":d.severity==="critical"?"bg-red-500":d.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),o==null?void 0:o.statusIcon,n),"aria-hidden":"true",children:p?jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-xs font-medium ${p?"text-gray-700 dark:text-gray-300":"text-gray-900 dark:text-gray-100"}`,o==null?void 0:o.requirementLabel,n),children:d.requirement}),!p&&jsxRuntime.jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-400 dark:text-gray-500 mt-0.5",o==null?void 0:o.ndpaSection,n),children:["NDPA ",d.ndpaSection]})]})]}),!p&&t&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-2 ml-6 space-y-2",o==null?void 0:o.detail,n),children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-xs ${ot[d.severity]}`,o==null?void 0:o.message,n),children:d.message}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{r(d.requirementId),i(false);},className:chunkE64TU6IU_js.a("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",o==null?void 0:o.fixButton,n),children:d.fixLabel})]})]})};function nt(d,p){let r=p.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),o=d.map(t=>({gap:t,isPassed:false})),n={critical:0,important:1,recommended:2};return o.sort((t,i)=>n[t.gap.severity]-n[i.gap.severity]),[...o,...r]}var $r=({complianceResult:d,onFix:p,classNames:r,unstyled:o})=>{let[n,t]=Gr.useState(false),i=nt(d.gaps,d.passed);return jsxRuntime.jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,o),"aria-label":"NDPA compliance checker",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.title,o),children:"NDPA Compliance"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(a=>!a),className:chunkE64TU6IU_js.a("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,o),"aria-expanded":!n,"aria-label":n?"Expand compliance checker":"Collapse compliance checker",children:jsxRuntime.jsx("svg",{className:`w-4 h-4 transition-transform ${n?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!n&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 space-y-4",r==null?void 0:r.body,o),children:[jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("flex justify-center",r==null?void 0:r.ringWrapper,o),children:jsxRuntime.jsx(Fr,{score:d.score,maxScore:d.maxScore,rating:d.rating,classNames:r,unstyled:o})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,o),children:[{count:d.gaps.filter(a=>a.severity==="critical").length,label:"Critical",color:"text-red-600 dark:text-red-400"},{count:d.gaps.filter(a=>a.severity==="important").length,label:"Important",color:"text-amber-600 dark:text-amber-400"},{count:d.passed.length,label:"Passed",color:"text-green-600 dark:text-green-400"}].map(({count:a,label:x,color:v})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-base font-bold ${v}`,r==null?void 0:r.statValue,o),children:a}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",r==null?void 0:r.statLabel,o),children:x})]},x))}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,o),children:i.length===0?jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 text-center py-4",r==null?void 0:r.emptyState,o),children:"No requirements to display."}):i.map(({gap:a,isPassed:x})=>jsxRuntime.jsx(Er,{gap:a,isPassed:x,onFix:p,classNames:r,unstyled:o},a.requirementId))})]})]})};function dt(d){let p=Date.now()-d;return p<1e4?"just now":p<6e4?`${Math.floor(p/1e3)}s ago`:p<36e5?`${Math.floor(p/6e4)}m ago`:new Date(d).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Ir=({lastSavedAt:d,isSaving:p,hasError:r,classNames:o,unstyled:n})=>{let t="idle";if(p?t="saving":r?t="error":d!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${d?dt(d):""}`;return jsxRuntime.jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:chunkE64TU6IU_js.a(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"text-gray-400 dark:text-gray-500":"text-green-600 dark:text-green-400"}`,o==null?void 0:o.root,n),children:[t==="saving"&&jsxRuntime.jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("text-xs font-medium",o==null?void 0:o.text,n),children:i})]})};var me=({adapter:d,onComplete:p,classNames:r,unstyled:o})=>{let{currentStep:n,nextStep:t,prevStep:i,canProceed:a,context:x,updateOrg:v,updateContext:k,toggleDataCategory:g,togglePurpose:u,addProcessor:b,removeProcessor:h,sections:m,customSections:z,sectionOverrides:J,editSectionContent:Z,addCustomSection:er,removeCustomSection:or,reorderSections:f,complianceResult:D,applyFix:ir,handleExportPDF:Tr,handleExportDOCX:Mr,handleExportHTML:Br,handleExportMarkdown:zr,lastSavedAt:jr,isLoading:qr}=chunkTXXWCB5O_js.e({adapter:d,onComplete:p}),nr=(F,K)=>{let _=URL.createObjectURL(F),H=document.createElement("a");H.href=_,H.download=K,H.click(),URL.revokeObjectURL(_);},Or=()=>chunkMQFZHA2D_js.d(null,null,function*(){let F=yield Tr();nr(F,"privacy-policy.pdf");}),_r=()=>chunkMQFZHA2D_js.d(null,null,function*(){let F=yield Mr();nr(F,"privacy-policy.docx");}),Hr=()=>{let F=Br();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/html"}),_=URL.createObjectURL(K),H=window.open(_,"_blank");H?H.addEventListener("load",()=>URL.revokeObjectURL(_)):URL.revokeObjectURL(_);});},Wr=()=>{let F=zr();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/markdown"});nr(K,"privacy-policy.md");});};return qr?jsxRuntime.jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkE64TU6IU_js.a("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,o),"aria-busy":"true","aria-label":"Loading policy wizard",children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsxRuntime.jsx("span",{className:"text-sm",children:"Loading\u2026"})]}):jsxRuntime.jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkE64TU6IU_js.a("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,o),children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center justify-between mb-6",r==null?void 0:r.topBar,o),children:[jsxRuntime.jsx("h1",{className:chunkE64TU6IU_js.a("text-2xl font-bold text-gray-900 dark:text-gray-100",r==null?void 0:r.wizardTitle,o),children:"Privacy Policy Builder"}),jsxRuntime.jsx(Ir,{lastSavedAt:jr,isSaving:false,hasError:false,classNames:r,unstyled:o})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,o),children:jsxRuntime.jsx(vr,{currentStep:n,classNames:r,unstyled:o})}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,o),children:[jsxRuntime.jsxs("main",{"aria-live":"polite",className:chunkE64TU6IU_js.a("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,o),children:[n===1&&jsxRuntime.jsx(yr,{context:x,onUpdateOrg:v,classNames:r,unstyled:o}),n===2&&jsxRuntime.jsx(lr,{categories:x.dataCategories,onToggle:g,classNames:r,unstyled:o}),n===3&&jsxRuntime.jsx(fr,{context:x,onTogglePurpose:u,onUpdateContext:k,onAddProcessor:b,onRemoveProcessor:h,classNames:r,unstyled:o}),n===4&&jsxRuntime.jsx(Lr,{sections:m,customSections:z,sectionOverrides:J,complianceResult:D,onEditSection:Z,onAddCustomSection:er,onRemoveCustomSection:or,onReorderSection:f,onExportPDF:Or,onExportDOCX:_r,onExportHTML:Hr,onExportMarkdown:Wr,classNames:r,unstyled:o}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,o),children:[jsxRuntime.jsx("button",{type:"button",onClick:i,disabled:n===1,className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,o),children:"Back"}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a("text-xs text-gray-400 dark:text-gray-500",r==null?void 0:r.stepCounter,o),children:["Step ",n," of 4"]})}),n<4?jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:!a,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,o),children:"Next"}):jsxRuntime.jsx("span",{})]})]}),jsxRuntime.jsx("aside",{className:chunkE64TU6IU_js.a("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,o),children:jsxRuntime.jsx($r,{complianceResult:D,onFix:ir,classNames:r,unstyled:o})})]})]})})};
|
|
2
|
+
exports.a=me;//# sourceMappingURL=chunk-YZXUAIYN.js.map
|
|
3
|
+
//# sourceMappingURL=chunk-YZXUAIYN.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {g}from'./chunk-75TJPK2N.mjs';import {a as a$1}from'./chunk-6WIP33TW.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function j(m,l){return l?a$1(m):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialTransfers:m=[],adapter:l,storageKey:R="ndpr_cross_border_transfers",useLocalStorage:q=true,onAdd:g$1,onUpdate:C,onRemove:B}={}){let y=l!=null?l:j(R,q),v=useRef(y);v.current=y;let[i,u]=useState(m),[x,T]=useState(true);useEffect(()=>{let r=false;try{let e=v.current.load();e instanceof Promise?e.then(t=>{r||(t&&u(t),T(!1));},()=>{r||T(!1);}):(e&&u(e),T(!1));}catch(e){r||T(false);}return ()=>{r=true;}},[]);let f=useCallback(r=>{Promise.resolve(v.current.save(r)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save cross-border transfers:",e);});},[]),M=()=>"cbt_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),D=useCallback(r=>{let e=Date.now(),t=b(a({},r),{id:M(),createdAt:e,updatedAt:e});return u(a=>{let n=[...a,t];return f(n),n}),g$1&&g$1(t),t},[g$1,f]),k=useCallback((r,e)=>{let t=null;return u(a$1=>{let n=a$1.findIndex(A=>A.id===r);if(n===-1)return a$1;t=b(a(a({},a$1[n]),e),{updatedAt:Date.now()});let o=[...a$1];return o[n]=t,f(o),o}),t&&C&&C(t),t},[C,f]),I=useCallback(r=>{let e=false;u(t=>{if(t.findIndex(o=>o.id===r)===-1)return t;e=true;let n=t.filter(o=>o.id!==r);return f(n),n}),e&&B&&B(r);},[B,f]),L=useCallback(r=>i.find(e=>e.id===r)||null,[i]),U=useCallback(()=>{let r=Date.now(),e=i.filter(s=>s.status==="active"),t=["adequacy_decision","standard_clauses","binding_corporate_rules","ndpc_authorization","explicit_consent","contract_performance","public_interest","legal_claims","vital_interests"],a={};for(let s of t)a[s]=e.filter(c=>c.transferMechanism===s).length;let n=["adequate","inadequate","pending_review","unknown"],o={};for(let s of n)o[s]=e.filter(c=>c.adequacyStatus===s).length;let A=i.filter(s=>{var c,S;return s.status==="pending_approval"||((c=s.ndpcApproval)==null?void 0:c.required)&&!((S=s.ndpcApproval)!=null&&S.approved)}),P=720*60*60*1e3,V=i.filter(s=>s.reviewDate&&s.reviewDate<=r+P&&s.status==="active"),F=i.filter(s=>!s.tiaCompleted&&s.status==="active"),z=i.filter(s=>s.riskLevel==="high"&&s.status==="active");return {totalActiveTransfers:e.length,byMechanism:a,byAdequacy:o,pendingApproval:A,dueForReview:V,missingTIA:F,highRiskTransfers:z,lastUpdated:r}},[i]),O=useCallback(r=>g(r),[]);return {transfers:i,addTransfer:D,updateTransfer:k,removeTransfer:I,getTransfer:L,getSummary:U,validateTransfer:O,isLoading:x}}export{Q as a};//# sourceMappingURL=chunk-Z6IIMLZU.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-Z6IIMLZU.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {d,c,a as a$1,b as b$1}from'./chunk-TXBZPCGF.mjs';import {a as a$2}from'./chunk-AYKLAEOU.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useState,useMemo,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var q={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},Q=[{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"}],X=[{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"}],Ce=({activities:c$1,onAddActivity:F,onUpdateActivity:_,onArchiveActivity:j,title:Z="Lawful Basis Tracker",description:ee="Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",className:te="",buttonClassName:m="",showSummary:re=true,showComplianceGaps:ie=true,classNames:r,unstyled:o})=>{let[h,v]=useState("list"),[a$3,w]=useState(q),[f,I]=useState(null),[J,ae]=useState(null),[A,ne]=useState("all"),[B,oe]=useState("all"),[S,de]=useState(""),[g,k]=useState([]),V=useMemo(()=>{let e=[...c$1];if(A!=="all"&&(e=e.filter(l=>l.status===A)),B!=="all"&&(e=e.filter(l=>l.lawfulBasis===B)),S){let l=S.toLowerCase();e=e.filter(u=>u.name.toLowerCase().includes(l)||u.description.toLowerCase().includes(l)||u.purposes.some(N=>N.toLowerCase().includes(l)));}return e.sort((l,u)=>u.updatedAt-l.updatedAt),e},[c$1,A,B,S]),C=useCallback(e=>new Date(e).toLocaleDateString(),[]),P=useMemo(()=>d(c$1),[c$1]),x=useMemo(()=>c(c$1),[c$1]),D=useCallback(e=>e.split(",").map(l=>l.trim()).filter(l=>l.length>0),[]),le=useCallback(()=>{w(q),I(null),k([]),v("form");},[]),M=useCallback(e=>{w({name:e.name,description:e.description,lawfulBasis:e.lawfulBasis,lawfulBasisJustification:e.lawfulBasisJustification,dataCategories:e.dataCategories.join(", "),involvesSensitiveData:e.involvesSensitiveData,sensitiveDataCondition:e.sensitiveDataCondition||"",dataSubjectCategories:e.dataSubjectCategories.join(", "),purposes:e.purposes.join(", "),retentionPeriod:e.retentionPeriod,retentionJustification:e.retentionJustification||"",recipients:(e.recipients||[]).join(", "),crossBorderTransfer:e.crossBorderTransfer,reviewDate:e.reviewDate?new Date(e.reviewDate).toISOString().split("T")[0]:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""}),I(e.id),k([]),v("form");},[]),se=useCallback(()=>{let e={name:a$3.name,description:a$3.description,lawfulBasis:a$3.lawfulBasis,lawfulBasisJustification:a$3.lawfulBasisJustification,dataCategories:D(a$3.dataCategories),involvesSensitiveData:a$3.involvesSensitiveData,sensitiveDataCondition:a$3.sensitiveDataCondition||void 0,dataSubjectCategories:D(a$3.dataSubjectCategories),purposes:D(a$3.purposes),retentionPeriod:a$3.retentionPeriod,retentionJustification:a$3.retentionJustification||void 0,recipients:a$3.recipients?D(a$3.recipients):void 0,crossBorderTransfer:a$3.crossBorderTransfer,reviewDate:a$3.reviewDate?new Date(a$3.reviewDate).getTime():void 0,status:"active"},l=b(a({},e),{id:f||"temp",createdAt:Date.now(),updatedAt:Date.now()}),u=a$1(l);if(!u.isValid){k(u.errors);return}f&&_?_(f,e):F&&F(e),w(q),I(null),k([]),v("list");},[a$3,f,_,F,D]),G=useCallback(e=>{j&&j(e);},[j]),ue=useCallback(e=>{ae(e),v("detail");},[]),n=useMemo(()=>J?c$1.find(e=>e.id===J):null,[c$1,J]),H=useCallback(e=>{let l={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"},u={active:"Active",inactive:"Inactive",under_review:"Under Review",archived:"Archived"};return jsx("span",{className:a$2(`px-2 py-1 rounded text-xs font-medium ${l[e]}`,r==null?void 0:r.statusBadge,o),children:u[e]})},[r==null?void 0:r.statusBadge,o]),U=useCallback(e=>{let l={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"},u={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 ${l[e]}`,children:u[e]})},[]),Y=useCallback(e=>e.dpoApproval?e.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"}),[]),pe=()=>jsxs("div",{className:a$2("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",r==null?void 0:r.summary,o),role:"status","aria-label":"Compliance summary",children:[jsxs("div",{className:a$2("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:P.totalActivities}),jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Total Activities"})]}),jsxs("div",{className:a$2("bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-orange-800 dark:text-orange-200",children:P.sensitiveDataActivities}),jsx("p",{className:"text-sm text-orange-600 dark:text-orange-300",children:"Sensitive Data"})]}),jsxs("div",{className:a$2("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:P.crossBorderActivities}),jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Cross-Border Transfers"})]}),jsxs("div",{className:a$2("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:P.activitiesWithoutApproval.length}),jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"Pending Approval"})]})]}),R=useMemo(()=>x.filter(e=>e.severity==="high"),[x]),E=useMemo(()=>x.filter(e=>e.severity==="medium"),[x]),ge=()=>x.length===0?jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg mb-6",role:"status","aria-label":"No compliance gaps",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."})]}):jsxs("div",{className:"mb-6",role:"status","aria-label":`${x.length} compliance gaps detected`,children:[R.length>0&&jsxs("div",{className:a$2("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-3",r==null?void 0:r.gapAlert,o),children:[jsxs("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:["High Priority (",R.length,")"]}),jsx("ul",{className:"space-y-1",children:R.map((e,l)=>jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:e.description},l))})]}),E.length>0&&jsxs("div",{className:a$2("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.gapAlert,o),children:[jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-2",children:["Medium Priority (",E.length,")"]}),jsx("ul",{className:"space-y-1",children:E.map((e,l)=>jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:e.description},l))})]})]}),W=useCallback(()=>{v("list"),k([]);},[]),ce=useCallback(()=>{v("list");},[]),s=useCallback((e,l)=>{w(u=>b(a({},u),{[e]:l}));},[]),be=useCallback(e=>{w(l=>b(a({},l),{involvesSensitiveData:e,sensitiveDataCondition:e?l.sensitiveDataCondition:""}));},[]),me=()=>jsxs("div",{className:a$2("",r==null?void 0:r.form,o),children:[jsxs("div",{className:a$2("flex justify-between items-center mb-4",r==null?void 0:r.header,o),children:[jsx("h3",{className:"text-lg font-medium",children:f?"Edit Processing Activity":"New Processing Activity"}),jsx("button",{onClick:W,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 ${m}`,children:"Cancel"})]}),g.length>0&&jsxs("div",{id:"form-errors",className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-4",role:"alert",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:g.map((e,l)=>jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:e},l))})]}),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:e=>s("name",e.target.value),placeholder:"e.g., Customer Account Management","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),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:e=>s("description",e.target.value),placeholder:"Describe what processing is performed...",rows:3,"aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),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:e=>s("lawfulBasis",e.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Q.map(e=>jsx("option",{value:e.value,children:e.label},e.value))}),jsx("p",{className:"mt-1 text-xs text-gray-600 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:e=>s("lawfulBasisJustification",e.target.value),placeholder:"Document why this lawful basis applies to this processing activity...",rows:3,"aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),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:e=>s("liaPurposeTest",e.target.value),placeholder:"Describe the legitimate interest being pursued...",rows:2,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),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:e=>s("liaNecessityTest",e.target.value),placeholder:"Explain why this processing is necessary for the stated purpose...",rows:2,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),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:e=>s("liaBalancingTest",e.target.value),placeholder:"Assess the impact on data subjects' rights and interests...",rows:2,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),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:e=>s("liaSafeguards",e.target.value),placeholder:"List safeguards (comma-separated)...",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),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:e=>s("liaConclusion",e.target.value),placeholder:"State your overall conclusion...",rows:2,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),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:e=>s("dataCategories",e.target.value),placeholder:"e.g., Name, Email, Phone Number (comma-separated)","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsx("div",{children:jsxs("label",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",checked:a$3.involvesSensitiveData,onChange:e=>be(e.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),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:e=>s("sensitiveDataCondition",e.target.value),"aria-required":"true",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"",children:"Select a condition..."}),X.map(e=>jsx("option",{value:e.value,children:e.label},e.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:e=>s("dataSubjectCategories",e.target.value),placeholder:"e.g., Customers, Employees, Vendors (comma-separated)","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),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:e=>s("purposes",e.target.value),placeholder:"e.g., Account management, Service delivery (comma-separated)","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),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:e=>s("retentionPeriod",e.target.value),placeholder:"e.g., 3 years after account closure","aria-required":"true","aria-describedby":g.length>0?"form-errors":void 0,className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),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:e=>s("retentionJustification",e.target.value),placeholder:"Reason for the retention period",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]}),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:e=>s("recipients",e.target.value),placeholder:"e.g., Payment processor, Cloud provider (comma-separated)",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsx("div",{children:jsxs("label",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",checked:a$3.crossBorderTransfer,onChange:e=>s("crossBorderTransfer",e.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),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:e=>s("reviewDate",e.target.value),className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[jsx("button",{onClick:W,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 ${m}`,children:"Cancel"}),jsx("button",{onClick:se,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:f?"Update Activity":"Create Activity"})]})]})]}),ve=()=>{var l;if(!n)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-600 dark:text-gray-400",children:"Activity not found."})});let e=a$1(n);return jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("div",{children:[jsx("button",{onClick:ce,className:"text-sm text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline mb-2","aria-label":"Back to activities list",children:"Back to list"}),jsx("h3",{className:"text-lg font-medium",children:n.name})]}),jsxs("div",{className:"flex space-x-2",children:[U(n.lawfulBasis),H(n.status),Y(n)]})]}),e.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:e.warnings.map((u,N)=>jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:u},N))})]}),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:"})," ",n.description]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",b$1(n.lawfulBasis)]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Justification:"})," ",n.lawfulBasisJustification]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Categories:"})," ",n.dataCategories.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",n.dataSubjectCategories.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Purposes:"})," ",n.purposes.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Retention Period:"})," ",n.retentionPeriod,n.retentionJustification&&jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:[" ","(",n.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:"})," ",n.involvesSensitiveData?"Yes":"No",n.sensitiveDataCondition&&jsxs("span",{children:[" ","(Condition:"," ",((l=X.find(u=>u.value===n.sensitiveDataCondition))==null?void 0:l.label)||n.sensitiveDataCondition,")"]})]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",n.crossBorderTransfer?"Yes":"No"]}),n.recipients&&n.recipients.length>0&&jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Recipients:"})," ",n.recipients.join(", ")]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Created:"})," ",C(n.createdAt)]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Last Updated:"})," ",C(n.updatedAt)]}),n.reviewDate&&jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",C(n.reviewDate),n.reviewDate<Date.now()&&jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:" (Overdue)"})]})]})]}),n.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:"})," ",n.dpoApproval.approved?"Approved":"Not Approved"]}),jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Approved By:"})," ",n.dpoApproval.approvedBy]}),jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Date:"})," ",C(n.dpoApproval.approvedAt)]}),n.dpoApproval.notes&&jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Notes:"})," ",n.dpoApproval.notes]})]}),jsxs("div",{className:"flex space-x-3",children:[jsx("button",{onClick:()=>M(n),"aria-label":`Edit ${n.name}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,children:"Edit"}),n.status!=="archived"&&jsx("button",{onClick:()=>G(n.id),"aria-label":`Archive ${n.name}`,className:`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 ${m}`,children:"Archive"})]})]})},fe=()=>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:B,onChange:e=>oe(e.target.value),"aria-label":"Filter by lawful basis",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"all",children:"All Bases"}),Q.map(e=>jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"statusFilterSelect",className:"block text-sm font-medium mb-1",children:"Status"}),jsxs("select",{id:"statusFilterSelect",value:A,onChange:e=>ne(e.target.value),"aria-label":"Filter by status",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),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:S,onChange:e=>de(e.target.value),placeholder:"Search activities...",className:a$2("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsx("div",{className:"flex items-end",children:jsx("button",{onClick:le,className:a$2(`w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Add Activity"})})]}),V.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-600 dark:text-gray-400 text-sm",children:"No processing activities found."})}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a$2("w-full text-sm text-left",r==null?void 0:r.table,o),children:[jsx("thead",{className:a$2("text-xs uppercase bg-gray-50 dark:bg-gray-700",r==null?void 0:r.tableHeader,o),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:V.map(e=>jsxs("tr",{className:a$2("border-b border-gray-200 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700",r==null?void 0:r.tableRow,o),children:[jsxs("td",{className:"px-4 py-3",children:[jsx("button",{onClick:()=>ue(e.id),className:"font-medium text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-left",children:e.name}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 truncate max-w-xs",children:e.description})]}),jsx("td",{className:"px-4 py-3",children:U(e.lawfulBasis)}),jsx("td",{className:"px-4 py-3",children:H(e.status)}),jsx("td",{className:"px-4 py-3",children:Y(e)}),jsx("td",{className:"px-4 py-3",children:jsx("span",{className:`text-xs ${e.involvesSensitiveData?"text-orange-600 dark:text-orange-400 font-medium":"text-gray-600 dark:text-gray-400"}`,children:e.involvesSensitiveData?"Yes":"No"})}),jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:C(e.updatedAt)}),jsx("td",{className:"px-4 py-3",children:jsxs("div",{className:"flex space-x-2",children:[jsx("button",{onClick:()=>M(e),"aria-label":`Edit ${e.name}`,className:"text-xs text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:"Edit"}),e.status!=="archived"&&jsx("button",{onClick:()=>G(e.id),"aria-label":`Archive ${e.name}`,className:"text-xs text-gray-600 dark:text-gray-400 hover:underline",children:"Archive"})]})})]},e.id))})]})})]});return jsxs("div",{className:a$2(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${te}`,r==null?void 0:r.root,o),children:[jsx("h2",{className:a$2("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:Z}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ee}),re&&h==="list"&&pe(),ie&&h==="list"&&ge(),h==="list"&&fe(),h==="form"&&me(),h==="detail"&&ve()]})};export{Ce as a};//# sourceMappingURL=chunk-ZT7KNFAU.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-ZT7KNFAU.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkJKKRPS4P_js=require('./chunk-JKKRPS4P.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var oe=({requests:w,onSelectRequest:P,onUpdateStatus:I,onAssignRequest:V,title:H="Data Subject Request Dashboard",description:X="Track and manage data subject requests in compliance with NDPA Part IV requirements.",className:J="",buttonClassName:F="",showRequestDetails:Y=true,showRequestTimeline:z=true,showDeadlineAlerts:B=true,assignees:i=[],classNames:l,unstyled:k=false})=>{let[y,f]=react.useState(null),[D,O]=react.useState(w),[j,M]=react.useState("all"),[C,T]=react.useState("all"),[A,_]=react.useState(""),[$,G]=react.useState("createdAt"),[U,Z]=react.useState("desc"),[S,Q]=react.useState("");react.useEffect(()=>{let e=[...w];if(j!=="all"&&(e=e.filter(r=>r.status===j)),C!=="all"&&(e=e.filter(r=>r.type===C)),A){let r=A.toLowerCase();e=e.filter(p=>p.subject.name.toLowerCase().includes(r)||p.subject.email.toLowerCase().includes(r)||p.description&&p.description.toLowerCase().includes(r));}e.sort((r,p)=>{let h=0;switch($){case "createdAt":h=r.createdAt-p.createdAt;break;case "dueDate":h=(r.dueDate||0)-(p.dueDate||0);break;case "type":h=r.type.localeCompare(p.type);break;case "status":h=r.status.localeCompare(p.status);break;default:h=r.createdAt-p.createdAt;}return U==="asc"?h:-h}),O(e);},[w,j,C,A,$,U]),react.useEffect(()=>{D.length>0&&(y&&D.some(r=>r.id===y)||f(D[0].id));},[D,y]);let E=e=>{f(e),P&&P(e);},L=e=>{y&&I&&I(y,e);},W=()=>{y&&S&&V&&(V(y,S),Q(""));},R=e=>new Date(e).toLocaleDateString(),q=e=>{let r=Date.now(),p=(e-r)/(1440*60*1e3);return Math.ceil(p)},m=y?w.find(e=>e.id===y):null,t=e=>{let r={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"},p={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${r[e]}`,children:p[e]})},s=e=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.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"}[e]}`,l==null?void 0:l.statusBadge,k),children:e==="inProgress"?"In Progress":e==="awaitingVerification"?"Awaiting Verification":e.charAt(0).toUpperCase()+e.slice(1)}),g=e=>{if(!e.dueDate)return null;let r=q(e.dueDate);return r<=0?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",role:"alert","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Deadline Passed"}),jsxRuntime.jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The response deadline has passed. Immediate action is required."})]}):r<=3?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",role:"alert","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Deadline Approaching"}),jsxRuntime.jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",r," day",r!==1?"s":""," remaining until the response deadline."]})]}):r<=7?jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Deadline Approaching"}),jsxRuntime.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:[r," days remaining until the response deadline."]})]}):jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Deadline Tracking"}),jsxRuntime.jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:[r," days remaining until the response deadline."]})]})},x=e=>{let r=[{title:"Request Received",date:e.createdAt,completed:true,description:`Request was received on ${R(e.createdAt)}.`}];return e.verifiedAt?r.push({title:"Identity Verified",date:e.verifiedAt,completed:true,description:`Data subject's identity was verified on ${R(e.verifiedAt)}.`}):e.status==="awaitingVerification"&&r.push({title:"Identity Verification",date:Date.now(),completed:false,description:"Awaiting verification of data subject's identity."}),(e.status==="inProgress"||e.status==="completed"||e.status==="rejected")&&r.push({title:"Processing Started",date:e.updatedAt,completed:true,description:`Request processing started on ${R(e.updatedAt)}.`}),e.status==="completed"?r.push({title:"Request Completed",date:e.completedAt||Date.now(),completed:true,description:`Request was completed on ${R(e.completedAt||Date.now())}.`}):e.status==="rejected"&&r.push({title:"Request Rejected",date:e.completedAt||Date.now(),completed:true,description:`Request was rejected on ${R(e.completedAt||Date.now())}.${e.rejectionReason?` Reason: ${e.rejectionReason}`:""}`}),e.dueDate&&r.push({title:"Response Deadline",date:e.dueDate,completed:Date.now()>e.dueDate,description:`Response is due by ${R(e.dueDate)}.`}),jsxRuntime.jsxs("div",{className:"mt-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),jsxRuntime.jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:r.map((p,h)=>jsxRuntime.jsxs("li",{className:"mb-6 ml-4",children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${p.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:p.date?R(p.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:p.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:p.description})]},h))})]})},o=()=>[{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(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value)),u=()=>[{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(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value)),v=()=>[{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value));return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${J}`,l==null?void 0:l.root,k),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",l==null?void 0:l.header,k),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",l==null?void 0:l.title,k),children:H}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:X})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",l==null?void 0:l.filters,k),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsx("select",{id:"statusFilter",value:j,onChange:e=>M(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:u()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"typeFilter",className:"block text-sm font-medium mb-1",children:"Request Type Filter"}),jsxRuntime.jsx("select",{id:"typeFilter",value:C,onChange:e=>T(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:o()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxRuntime.jsxs("select",{id:"sortBy",value:$,onChange:e=>G(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"createdAt",children:"Date Received"}),jsxRuntime.jsx("option",{value:"dueDate",children:"Due Date"}),jsxRuntime.jsx("option",{value:"type",children:"Request Type"}),jsxRuntime.jsx("option",{value:"status",children:"Status"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchTerm",value:A,onChange:e=>_(e.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-[rgb(var(--ndpr-ring))]"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"DSR Requests"}),D.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data subject requests found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",l==null?void 0:l.requestList,k),children:D.map(e=>{let r=e.dueDate?q(e.dueDate):null,p=null;return r!==null&&(r<=0?p=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):r<=3?p=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):r<=7&&(p=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Soon"}))),jsxRuntime.jsxs("div",{role:"button",tabIndex:0,"aria-label":`View request from ${e.subject.name}`,"aria-selected":y===e.id,className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${y===e.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,l==null?void 0:l.requestItem,k),onClick:()=>E(e.id),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),E(e.id));},children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:e.subject.name}),t(e.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:e.subject.email}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Received: ",R(e.createdAt)]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:s(e.status)}),jsxRuntime.jsx("div",{children:p})]})]},e.id)})})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("md:col-span-2",l==null?void 0:l.detailPanel,k),children:m?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:m.subject.name}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[t(m.type),s(m.status)]})]}),B&&m.dueDate&&jsxRuntime.jsx("div",{className:"mb-4",children:g(m)}),Y&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Email:"})," ",m.subject.email]}),m.subject.phone&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Phone:"})," ",m.subject.phone]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Received:"})," ",R(m.createdAt)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.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"}[m.type]||m.type]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",m.status==="inProgress"?"In Progress":m.status==="awaitingVerification"?"Awaiting Verification":m.status.charAt(0).toUpperCase()+m.status.slice(1)]}),m.dueDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Due Date:"})," ",R(m.dueDate)]})]})]}),m.description&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Request Details:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:m.description})]}),m.additionalInfo&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Additional Information:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:typeof m.additionalInfo=="object"?JSON.stringify(m.additionalInfo,null,2):String(m.additionalInfo||"No additional information provided")})]})]}),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{id:"update-status-heading",className:"text-md font-medium mb-2",children:"Update Status"}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("select",{"aria-label":"Update request status",value:m.status,onChange:e=>L(e.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-[rgb(var(--ndpr-ring))]",children:v()}),jsxRuntime.jsx("button",{onClick:()=>L(m.status),"aria-label":"Apply status update",className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${F}`,children:"Update"})]})]}),i.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{id:"assign-request-heading",className:"text-md font-medium mb-2",children:"Assign Request"}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsxs("select",{"aria-label":"Select assignee",value:S,onChange:e=>Q(e.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-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"",children:"Select Assignee"}),i.map(e=>jsxRuntime.jsx("option",{value:e,children:e},e))]}),jsxRuntime.jsx("button",{onClick:W,disabled:!S,"aria-label":"Assign request to selected person",className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:bg-gray-300 disabled:text-gray-500 ${F}`,children:"Assign"})]})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Request Summary"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:jsxRuntime.jsx("pre",{children:JSON.stringify(chunkJKKRPS4P_js.a(m),null,2)})})})]}),z&&x(m)]}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a request to view details"})})})]})]})};var ue=({requests:w,onSelectRequest:P,title:I="DSR Request Tracker",description:V="Track the status and progress of data subject requests as required by NDPA Part IV.",className:H="",buttonClassName:X="",showSummaryStats:J=true,showTypeBreakdown:F=true,showStatusBreakdown:Y=true,showTimelineChart:z=true,showOverdueRequests:B=true,classNames:i,unstyled:l=false})=>{let[k,y]=react.useState("30days"),[f,D]=react.useState(w),[O,j]=react.useState([]),[M,C]=react.useState([]);react.useEffect(()=>{let t=Date.now(),s;switch(k){case "7days":s=w.filter(o=>t-o.createdAt<=10080*60*1e3);break;case "30days":s=w.filter(o=>t-o.createdAt<=720*60*60*1e3);break;case "90days":s=w.filter(o=>t-o.createdAt<=2160*60*60*1e3);break;default:s=[...w];}D(s);let g=s.filter(o=>o.dueDate&&t>o.dueDate&&o.status!=="completed"&&o.status!=="rejected");j(g);let x=s.filter(o=>o.dueDate&&t<o.dueDate&&o.dueDate-t<=10080*60*1e3&&o.status!=="completed"&&o.status!=="rejected");C(x);},[w,k]);let T=t=>{P&&P(t);},A=t=>new Date(t).toLocaleDateString(),_=t=>{let s=Date.now(),g=(t-s)/(1440*60*1e3);return Math.ceil(g)},$=()=>{let t=f.filter(g=>g.status==="completed"&&g.completedAt&&g.createdAt);if(t.length===0)return null;let s=t.reduce((g,x)=>{let o=((x.completedAt||0)-x.createdAt)/864e5;return g+o},0);return Number((s/t.length).toFixed(1))},G=()=>{let t=f.filter(g=>(g.status==="completed"||g.status==="rejected")&&g.completedAt&&g.dueDate);if(t.length===0)return null;let s=t.filter(g=>(g.completedAt||0)<=(g.dueDate||0));return Math.round(s.length/t.length*100)},U=()=>{let t={};return f.forEach(s=>{t[s.type]=(t[s.type]||0)+1;}),{information:t.information||0,access:t.access||0,rectification:t.rectification||0,erasure:t.erasure||0,restriction:t.restriction||0,portability:t.portability||0,objection:t.objection||0,automated_decision_making:t.automated_decision_making||0}},Z=()=>{let t={};return f.forEach(s=>{t[s.status]=(t[s.status]||0)+1;}),{pending:t.pending||0,awaitingVerification:t.awaitingVerification||0,inProgress:t.inProgress||0,completed:t.completed||0,rejected:t.rejected||0}},S=t=>{let s={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"},g={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${s[t]}`,children:g[t]})},E=()=>{let t=f.length,s=f.filter(u=>u.status!=="completed"&&u.status!=="rejected").length;f.filter(u=>u.status==="completed"||u.status==="rejected").length;let x=$(),o=G();return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",i==null?void 0:i.stats,l),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,l),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Total Requests"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:t})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,l),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Pending Requests"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:s})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,l),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Avg. Response Time"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:x!==null?`${x} days`:"N/A"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,l),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Compliance Rate"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:o!==null?`${o}%`:"N/A"})]})]})},L=()=>{let t=U(),s=f.length,g=Object.entries(t).sort(([,x],[,o])=>o-x).map(([x])=>x);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",i==null?void 0:i.table,l),children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-lg font-medium mb-4",i==null?void 0:i.tableHeader,l),children:"Request Types"}),s===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsx("div",{className:"space-y-4",children:g.map(x=>{let o=t[x],u=Math.round(o/s*100);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[S(x),jsxRuntime.jsxs("span",{className:"ml-2 text-sm",children:[o," requests"]})]}),jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:[u,"%"]})]}),jsxRuntime.jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-600 rounded-full h-2.5",children:jsxRuntime.jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${u}%`}})})]},x)})})]})},W=()=>{let t=Z(),s=f.length,g=["pending","awaitingVerification","inProgress","completed","rejected"],x={pending:"bg-yellow-500",awaitingVerification:"bg-purple-500",inProgress:"bg-blue-500",completed:"bg-green-500",rejected:"bg-red-500"};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",i==null?void 0:i.table,l),children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-lg font-medium mb-4",i==null?void 0:i.tableHeader,l),children:"Request Status"}),s===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"flex h-4 mb-2",children:g.map(o=>{let u=t[o],v=u/s*100;return v>0?jsxRuntime.jsx("div",{className:`${x[o]} first:rounded-l-full last:rounded-r-full`,style:{width:`${v}%`},title:`${o}: ${u} (${Math.round(v)}%)`},o):null})}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 mt-4",children:g.map(o=>{let u=t[o],v=Math.round(u/s*100);return jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:`w-3 h-3 rounded-full ${x[o]} mr-2`}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium",children:o==="inProgress"?"In Progress":o==="awaitingVerification"?"Awaiting Verification":o.charAt(0).toUpperCase()+o.slice(1)}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:[u," (",v,"%)"]})]})]},o)})})]})]})},R=()=>{let t={};f.forEach(u=>{let v=new Date(u.createdAt),e=`${v.getFullYear()}-${String(v.getMonth()+1).padStart(2,"0")}`;t[e]=(t[e]||0)+1;});let g=Object.keys(t).sort().slice(-6),x=Math.max(...Object.values(t).filter(u=>u>0),1),o=u=>{let[v,e]=u.split("-");return `${e}/${v.slice(2)}`};return jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),g.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsxs("div",{className:"h-40",children:[jsxRuntime.jsx("div",{className:"flex h-32 items-end justify-between space-x-2",children:g.map(u=>{let v=t[u],e=`${v/x*100}%`;return jsxRuntime.jsx("div",{className:"flex flex-col items-center flex-1",children:jsxRuntime.jsx("div",{className:"w-full bg-[rgb(var(--ndpr-primary))] rounded-t",style:{height:e},title:`${o(u)}: ${v} requests`})},u)})}),jsxRuntime.jsx("div",{className:"flex justify-between mt-2",children:g.map(u=>jsxRuntime.jsx("div",{className:"text-xs text-center",children:o(u)},u))})]})]})},q=()=>jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6","aria-live":"polite",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Overdue Requests"}),O.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No overdue requests."}):jsxRuntime.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:O.map(t=>jsxRuntime.jsxs("div",{role:"button",tabIndex:0,"aria-label":`View overdue request from ${t.subject.name}`,className:chunkE64TU6IU_js.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",i==null?void 0:i.tableRow,l),onClick:()=>T(t.id),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),T(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.subject.name}),S(t.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.subject.email}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",A(t.dueDate||0)]}),jsxRuntime.jsxs("p",{className:"text-xs font-bold text-red-600 dark:text-red-400",children:["Overdue by ",Math.abs(_(t.dueDate||0))," days"]})]})]},t.id))})]}),m=()=>jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6","aria-live":"polite",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Upcoming Deadlines"}),M.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No upcoming deadlines in the next 7 days."}):jsxRuntime.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:M.map(t=>{let s=_(t.dueDate||0);return jsxRuntime.jsxs("div",{role:"button",tabIndex:0,"aria-label":`View upcoming deadline for ${t.subject.name}`,className:chunkE64TU6IU_js.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",i==null?void 0:i.tableRow,l),onClick:()=>T(t.id),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),T(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.subject.name}),S(t.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.subject.email}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",A(t.dueDate||0)]}),jsxRuntime.jsxs("p",{className:`text-xs font-bold ${s<=3?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`,children:["Due in ",s," days"]})]})]},t.id)})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${H}`,i==null?void 0:i.root,l),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col md:flex-row md:justify-between md:items-center mb-6",i==null?void 0:i.header,l),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",i==null?void 0:i.title,l),children:I}),jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:V})]}),jsxRuntime.jsxs("div",{className:"mt-4 md:mt-0",children:[jsxRuntime.jsx("label",{htmlFor:"timeframe",className:"block text-sm font-medium mb-1",children:"Timeframe"}),jsxRuntime.jsxs("select",{id:"timeframe",value:k,onChange:t=>y(t.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-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"7days",children:"Last 7 Days"}),jsxRuntime.jsx("option",{value:"30days",children:"Last 30 Days"}),jsxRuntime.jsx("option",{value:"90days",children:"Last 90 Days"}),jsxRuntime.jsx("option",{value:"all",children:"All Time"})]})]})]}),J&&E(),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{children:[F&&L(),Y&&W()]}),jsxRuntime.jsxs("div",{children:[z&&R(),B&&q(),B&&m()]})]})]})};exports.a=oe;exports.b=ue;//# sourceMappingURL=chunk-ZYLDLGFL.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-ZYLDLGFL.js.map
|
package/dist/consent.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkQJ3JNHO7_js=require('./chunk-QJ3JNHO7.js'),chunkNBSVFQ5G_js=require('./chunk-NBSVFQ5G.js'),chunkMJGOLP5M_js=require('./chunk-MJGOLP5M.js'),chunk7SMLHZ4B_js=require('./chunk-7SMLHZ4B.js');require('./chunk-A4PK7JB2.js');var chunkHO5M7M4M_js=require('./chunk-HO5M7M4M.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js');require('./chunk-ELKB2AFZ.js');var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var R=react.createContext(null);function s(){let t=react.useContext(R);if(!t)throw new Error("Consent compound components must be wrapped in <Consent.Provider>. Example: <Consent.Provider options={...}><Consent.Banner /></Consent.Provider>");return t}var x=({options:t,adapter:e,version:p,onChange:r,children:c})=>{let d=chunk7SMLHZ4B_js.a({options:t,adapter:e,version:p,onChange:r}),o=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},d),{options:t});return jsxRuntime.jsx(R.Provider,{value:o,children:c})};var v=({classNames:t,unstyled:e})=>{let{options:p,settings:r}=s(),[c,d]=react.useState(()=>{let o={};return p.forEach(a=>{var i,A;o[a.id]=(A=(i=r==null?void 0:r.consents[a.id])!=null?i:a.defaultValue)!=null?A:false;}),o});return jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",t==null?void 0:t.root,e),"data-ndpr-component":"consent-option-list",children:p.map(o=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start",t==null?void 0:t.optionItem,e),children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`consent-${o.id}`,type:"checkbox",checked:c[o.id]||false,onChange:a=>d(i=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{[o.id]:a.target.checked})),disabled:o.required,className:chunkE64TU6IU_js.a("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,e),"aria-label":o.label})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${o.id}`,className:chunkE64TU6IU_js.a("font-medium",t==null?void 0:t.optionLabel,e),children:[o.label," ",o.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,e),children:o.description})]})]},o.id))})};var b=({children:t,className:e,unstyled:p})=>{let{acceptAll:r}=s();return jsxRuntime.jsx("button",{onClick:r,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e,p),"data-ndpr-component":"consent-accept-button",children:t!=null?t:"Accept All"})};var y=({children:t,className:e,unstyled:p})=>{let{rejectAll:r}=s();return jsxRuntime.jsx("button",{onClick:r,className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600",e,p),"data-ndpr-component":"consent-reject-button",children:t!=null?t:"Reject All"})};var B=({children:t,className:e,unstyled:p,consents:r})=>{let{updateConsent:c,options:d}=s();return jsxRuntime.jsx("button",{onClick:()=>{if(r)c(r);else {let a={};d.forEach(i=>{a[i.id]=i.required||false;}),c(a);}},className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e,p),"data-ndpr-component":"consent-save-button",children:t!=null?t:"Save Preferences"})};var D={Provider:x,OptionList:v,AcceptButton:b,RejectButton:y,SaveButton:B,Banner:chunkNBSVFQ5G_js.a,Settings:chunkQJ3JNHO7_js.a,Storage:chunkQJ3JNHO7_js.b};Object.defineProperty(exports,"ConsentManager",{enumerable:true,get:function(){return chunkQJ3JNHO7_js.a}});Object.defineProperty(exports,"ConsentStorage",{enumerable:true,get:function(){return chunkQJ3JNHO7_js.b}});Object.defineProperty(exports,"ConsentBanner",{enumerable:true,get:function(){return chunkNBSVFQ5G_js.a}});Object.defineProperty(exports,"appendAuditEntry",{enumerable:true,get:function(){return chunkMJGOLP5M_js.c}});Object.defineProperty(exports,"createAuditEntry",{enumerable:true,get:function(){return chunkMJGOLP5M_js.a}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunkMJGOLP5M_js.b}});Object.defineProperty(exports,"useConsent",{enumerable:true,get:function(){return chunk7SMLHZ4B_js.a}});Object.defineProperty(exports,"validateConsent",{enumerable:true,get:function(){return chunkHO5M7M4M_js.a}});Object.defineProperty(exports,"validateConsentOptions",{enumerable:true,get:function(){return chunkHO5M7M4M_js.b}});Object.defineProperty(exports,"resolveClass",{enumerable:true,get:function(){return chunkE64TU6IU_js.a}});exports.Consent=D;exports.ConsentAcceptButton=b;exports.ConsentOptionList=v;exports.ConsentProvider=x;exports.ConsentRejectButton=y;exports.ConsentSaveButton=B;exports.useConsentCompound=s;//# sourceMappingURL=consent.js.map
|
|
2
2
|
//# sourceMappingURL=consent.js.map
|
package/dist/consent.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b as b$1,a}from'./chunk-
|
|
1
|
+
import {b as b$1,a}from'./chunk-QNCGRCAX.mjs';export{a as ConsentManager,b as ConsentStorage}from'./chunk-QNCGRCAX.mjs';import {a as a$1}from'./chunk-4JKTIR33.mjs';export{a as ConsentBanner}from'./chunk-4JKTIR33.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-P3PULLYP.mjs';import {a as a$2}from'./chunk-VWPGIES4.mjs';export{a as useConsent}from'./chunk-VWPGIES4.mjs';import'./chunk-R3OYAJI6.mjs';export{a as validateConsent,b as validateConsentOptions}from'./chunk-U62QYKVG.mjs';import {a as a$4}from'./chunk-AYKLAEOU.mjs';export{a as resolveClass}from'./chunk-AYKLAEOU.mjs';import'./chunk-6WIP33TW.mjs';import {b as b$2,a as a$3}from'./chunk-WWT2ZSNU.mjs';import {createContext,useContext,useState}from'react';import {jsx,jsxs}from'react/jsx-runtime';var R=createContext(null);function s(){let t=useContext(R);if(!t)throw new Error("Consent compound components must be wrapped in <Consent.Provider>. Example: <Consent.Provider options={...}><Consent.Banner /></Consent.Provider>");return t}var x=({options:t,adapter:e,version:p,onChange:r,children:c})=>{let d=a$2({options:t,adapter:e,version:p,onChange:r}),o=b$2(a$3({},d),{options:t});return jsx(R.Provider,{value:o,children:c})};var v=({classNames:t,unstyled:e})=>{let{options:p,settings:r}=s(),[c,d]=useState(()=>{let o={};return p.forEach(a=>{var i,A;o[a.id]=(A=(i=r==null?void 0:r.consents[a.id])!=null?i:a.defaultValue)!=null?A:false;}),o});return jsx("div",{className:a$4("space-y-3",t==null?void 0:t.root,e),"data-ndpr-component":"consent-option-list",children:p.map(o=>jsxs("div",{className:a$4("flex items-start",t==null?void 0:t.optionItem,e),children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`consent-${o.id}`,type:"checkbox",checked:c[o.id]||false,onChange:a=>d(i=>b$2(a$3({},i),{[o.id]:a.target.checked})),disabled:o.required,className:a$4("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,e),"aria-label":o.label})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:`consent-${o.id}`,className:a$4("font-medium",t==null?void 0:t.optionLabel,e),children:[o.label," ",o.required&&jsx("span",{className:"text-red-500",children:"*"})]}),jsx("p",{className:a$4("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,e),children:o.description})]})]},o.id))})};var b=({children:t,className:e,unstyled:p})=>{let{acceptAll:r}=s();return jsx("button",{onClick:r,className:a$4("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e,p),"data-ndpr-component":"consent-accept-button",children:t!=null?t:"Accept All"})};var y=({children:t,className:e,unstyled:p})=>{let{rejectAll:r}=s();return jsx("button",{onClick:r,className:a$4("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",e,p),"data-ndpr-component":"consent-reject-button",children:t!=null?t:"Reject All"})};var B=({children:t,className:e,unstyled:p,consents:r})=>{let{updateConsent:c,options:d}=s();return jsx("button",{onClick:()=>{if(r)c(r);else {let a={};d.forEach(i=>{a[i.id]=i.required||false;}),c(a);}},className:a$4("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e,p),"data-ndpr-component":"consent-save-button",children:t!=null?t:"Save Preferences"})};var D={Provider:x,OptionList:v,AcceptButton:b,RejectButton:y,SaveButton:B,Banner:a$1,Settings:a,Storage:b$1};export{D as Consent,b as ConsentAcceptButton,v as ConsentOptionList,x as ConsentProvider,y as ConsentRejectButton,B as ConsentSaveButton,s as useConsentCompound};//# sourceMappingURL=consent.mjs.map
|
|
2
2
|
//# sourceMappingURL=consent.mjs.map
|
package/dist/core.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { C as ConsentOption, a as ConsentSettings, b as ConsentStorageOptions, L as LawfulBasisType } from './consent-CmVzqZUk.mjs';
|
|
2
|
-
export { D as DSRRequest, a as DSRStatus, b as DSRType, R as RequestStatus, c as RequestType } from './dsr-
|
|
3
|
-
export { D as DPIAQuestion, a as DPIAResult, b as DPIARisk, c as DPIASection } from './dpia-
|
|
2
|
+
export { D as DSRRequest, a as DSRStatus, b as DSRType, R as RequestStatus, c as RequestType } from './dsr-yKbqX531.mjs';
|
|
3
|
+
export { D as DPIAQuestion, a as DPIAResult, b as DPIARisk, c as DPIASection } from './dpia-c9GiiOq0.mjs';
|
|
4
4
|
export { B as BreachCategory, a as BreachReport, N as NotificationRequirement, R as RegulatoryNotification, b as RiskAssessment } from './breach-Eu9byel8.mjs';
|
|
5
5
|
export { O as OrganizationInfo, P as PolicySection, a as PolicyTemplate, b as PolicyVariable, c as PrivacyPolicy } from './privacy-Ca6te9Ir.mjs';
|
|
6
6
|
export { L as LawfulBasis, a as LawfulBasisSummary, b as LegitimateInterestAssessment, P as ProcessingActivity, S as SensitiveDataCondition } from './lawful-basis-Cv1VmDLn.mjs';
|
|
@@ -9,22 +9,38 @@ export { P as ProcessingRecord, R as ROPASummary, a as RecordOfProcessingActivit
|
|
|
9
9
|
export { L as LawfulBasisComplianceGap, a as LawfulBasisValidationResult, b as assessComplianceGaps, g as generateLawfulBasisSummary, c as getLawfulBasisDescription, v as validateProcessingActivity } from './lawful-basis-C2eGaoHM.mjs';
|
|
10
10
|
export { T as TransferRiskResult, a as TransferValidationResult, b as assessTransferRisk, g as getTransferMechanismDescription, i as isNDPCApprovalRequired, v as validateTransfer } from './cross-border-BBi9rZyO.mjs';
|
|
11
11
|
export { R as ROPAComplianceGap, a as ROPAValidationResult, e as exportROPAToCSV, g as generateROPASummary, i as identifyComplianceGaps, v as validateProcessingRecord } from './ropa-NIgxd8uP.mjs';
|
|
12
|
-
import { b as NDPRLocale, d as defaultLocale } from './sanitize-
|
|
13
|
-
export { N as NDPRConfig, a as NDPRProvider, s as sanitizeInput, u as useNDPRConfig, c as useNDPRLocale } from './sanitize-
|
|
12
|
+
import { b as NDPRLocale, d as defaultLocale } from './sanitize-B0AzEm1D.mjs';
|
|
13
|
+
export { N as NDPRConfig, a as NDPRProvider, s as sanitizeInput, u as useNDPRConfig, c as useNDPRLocale } from './sanitize-B0AzEm1D.mjs';
|
|
14
14
|
export { C as ConsentAuditEntry, a as appendAuditEntry, c as createAuditEntry, g as getAuditLog, v as validateConsent, b as validateConsentOptions } from './consent-audit-BdByjYlM.mjs';
|
|
15
|
-
export { f as formatDSRRequest } from './dsr-
|
|
16
|
-
export { a as assessDPIARisk } from './dpia-
|
|
15
|
+
export { f as formatDSRRequest } from './dsr-XZ_HqTlA.mjs';
|
|
16
|
+
export { a as assessDPIARisk } from './dpia-DQDFw2_l.mjs';
|
|
17
17
|
export { c as calculateBreachSeverity } from './breach-B_-6lDqS.mjs';
|
|
18
18
|
export { D as DEFAULT_POLICY_SECTIONS, a as DEFAULT_POLICY_VARIABLES, c as createBusinessPolicyTemplate, g as generatePolicyText } from './policy-templates-DMsPwOSZ.mjs';
|
|
19
|
-
export { C as ComplianceGap,
|
|
20
|
-
export { a as assemblePolicy, e as evaluatePolicyCompliance } from './policy-sections-
|
|
19
|
+
export { C as ComplianceGap, b as ComplianceResult, a as CustomSection, d as DataCategory, P as PolicyDraft, T as TemplateContext, e as ThirdPartyProcessor, f as createDefaultContext } from './policy-engine-DefZcX3R.mjs';
|
|
20
|
+
export { a as assemblePolicy, e as evaluatePolicyCompliance } from './policy-sections-Bylm31kZ.mjs';
|
|
21
21
|
export { C as ComplianceInput, a as ComplianceRating, b as ComplianceReport, E as EffortLevel, M as ModuleScore, R as Recommendation, c as RecommendationPriority, d as RegulatoryReference, g as getComplianceScore } from './compliance-score-racQe_E_.mjs';
|
|
22
22
|
import 'react';
|
|
23
23
|
|
|
24
|
+
declare const yorubaLocale: Required<{
|
|
25
|
+
[K in keyof NDPRLocale]: Required<NonNullable<NDPRLocale[K]>>;
|
|
26
|
+
}>;
|
|
27
|
+
|
|
28
|
+
declare const igboLocale: Required<{
|
|
29
|
+
[K in keyof NDPRLocale]: Required<NonNullable<NDPRLocale[K]>>;
|
|
30
|
+
}>;
|
|
31
|
+
|
|
32
|
+
declare const hausaLocale: Required<{
|
|
33
|
+
[K in keyof NDPRLocale]: Required<NonNullable<NDPRLocale[K]>>;
|
|
34
|
+
}>;
|
|
35
|
+
|
|
36
|
+
declare const pidginLocale: Required<{
|
|
37
|
+
[K in keyof NDPRLocale]: Required<NonNullable<NDPRLocale[K]>>;
|
|
38
|
+
}>;
|
|
39
|
+
|
|
24
40
|
/**
|
|
25
41
|
* Deep merges a partial locale with the default English locale.
|
|
26
42
|
* Any missing keys fall back to English.
|
|
27
43
|
*/
|
|
28
44
|
declare function mergeLocale(partial?: NDPRLocale): typeof defaultLocale;
|
|
29
45
|
|
|
30
|
-
export { NDPRLocale, defaultLocale, mergeLocale };
|
|
46
|
+
export { NDPRLocale, defaultLocale, hausaLocale, igboLocale, mergeLocale, pidginLocale, yorubaLocale };
|