@tantainnovative/ndpr-toolkit 5.1.1 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.md +1 -1
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/{chunk-BRJKIF7E.mjs → chunk-2ASQQYJR.mjs} +1 -1
- package/dist/{chunk-3SIYRGJF.js → chunk-2MGLU3FY.js} +3 -3
- package/dist/{chunk-CSE36REY.js → chunk-2OSZT7KI.js} +1 -1
- package/dist/{chunk-MAD7QYRK.js → chunk-37VR2MXL.js} +1 -1
- package/dist/{chunk-3H6FYU3Z.mjs → chunk-5E56KT7E.mjs} +1 -1
- package/dist/{chunk-V5TZJJWU.mjs → chunk-5LJ652AH.mjs} +1 -1
- package/dist/{chunk-F5MGMNQF.js → chunk-6KQADEFS.js} +1 -1
- package/dist/{chunk-D2UWB5OI.js → chunk-6MO3GS3B.js} +1 -1
- package/dist/{chunk-WPH6CJDL.mjs → chunk-6UGLAVRM.mjs} +1 -1
- package/dist/{chunk-TTMGFC6C.js → chunk-7563FVMY.js} +1 -1
- package/dist/{chunk-SBSYHCPK.mjs → chunk-AS2M5OTX.mjs} +1 -1
- package/dist/chunk-BHUJWWCO.js +1 -0
- package/dist/{chunk-42UJFTII.js → chunk-C32TMS75.js} +1 -1
- package/dist/{chunk-6A6VI7ZP.mjs → chunk-C77CRJLD.mjs} +1 -1
- package/dist/{chunk-3I6FYA5C.js → chunk-C7OOUURS.js} +1 -1
- package/dist/{chunk-BPMVJOHH.mjs → chunk-CNCEP66F.mjs} +1 -1
- package/dist/{chunk-WCTFED27.js → chunk-DRQURLN5.js} +1 -1
- package/dist/{chunk-L3FR4PQE.mjs → chunk-EAV4BZKO.mjs} +1 -1
- package/dist/{chunk-J7BIJ45O.mjs → chunk-EF5CLD4V.mjs} +1 -1
- package/dist/{chunk-4FXRJH37.js → chunk-ERCGW2DJ.js} +1 -1
- package/dist/{chunk-UZNWXJ2W.js → chunk-FRHFIEWZ.js} +1 -1
- package/dist/{chunk-ELK6VFKC.mjs → chunk-HDPXARLC.mjs} +1 -1
- package/dist/{chunk-I2ZBMR7F.mjs → chunk-HMKXK23C.mjs} +1 -1
- package/dist/{chunk-YDKWD6MQ.js → chunk-I5ZDNSX5.js} +1 -1
- package/dist/{chunk-RDALAH3Y.js → chunk-JVMHWM3I.js} +1 -1
- package/dist/{chunk-PSPYIRIF.mjs → chunk-KUI5W44P.mjs} +1 -1
- package/dist/{chunk-6YFPDGNB.js → chunk-LP5KXMBY.js} +1 -1
- package/dist/{chunk-N72RNTGP.mjs → chunk-MIQQYXTE.mjs} +1 -1
- package/dist/{chunk-WVHMY2BV.mjs → chunk-OLTLB5MP.mjs} +1 -1
- package/dist/{chunk-FRQFU44F.mjs → chunk-PHA3YMFO.mjs} +1 -1
- package/dist/{chunk-ZD2W3YU2.js → chunk-PXUX4FYM.js} +1 -1
- package/dist/{chunk-37VFK5SR.js → chunk-QG72X7G4.js} +1 -1
- package/dist/{chunk-NBOJ2KGN.mjs → chunk-RW7V7DDR.mjs} +1 -1
- package/dist/{chunk-3E4IH7CE.js → chunk-SMEZAQNJ.js} +1 -1
- package/dist/{chunk-B2EXRSYG.mjs → chunk-TWWGNFPF.mjs} +1 -1
- package/dist/{chunk-ASEUTU45.js → chunk-TYR5PFYD.js} +1 -1
- package/dist/{chunk-KH3EQJQE.js → chunk-VEWLYTRA.js} +1 -1
- package/dist/{chunk-63WM5PHZ.js → chunk-VTBHDHYK.js} +1 -1
- package/dist/{chunk-DK7P5JEG.mjs → chunk-WLZTATLL.mjs} +1 -1
- package/dist/chunk-XAB5C2JG.mjs +1 -0
- package/dist/{chunk-7RBO42IW.mjs → chunk-YX7DEHPA.mjs} +1 -1
- package/dist/{chunk-ZQHGIOYP.mjs → chunk-YZHEEGGK.mjs} +1 -1
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border-lite.d.mts +1 -1
- package/dist/cross-border-lite.d.ts +1 -1
- package/dist/cross-border-lite.js +1 -1
- package/dist/cross-border-lite.mjs +1 -1
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/headless.d.mts +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis-lite.d.mts +1 -1
- package/dist/lawful-basis-lite.d.ts +1 -1
- package/dist/lawful-basis-lite.js +1 -1
- package/dist/lawful-basis-lite.mjs +1 -1
- package/dist/lawful-basis.d.mts +1 -1
- package/dist/lawful-basis.d.ts +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy.d.mts +5 -4
- package/dist/policy.d.ts +5 -4
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets-consent.js +1 -1
- package/dist/presets-consent.mjs +1 -1
- package/dist/presets-dsr.js +1 -1
- package/dist/presets-dsr.mjs +1 -1
- package/dist/presets-policy.d.mts +1 -1
- package/dist/presets-policy.d.ts +1 -1
- package/dist/presets-policy.js +1 -1
- package/dist/presets-policy.mjs +1 -1
- package/dist/presets.d.mts +2 -2
- package/dist/presets.d.ts +2 -2
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa-lite.js +1 -1
- package/dist/ropa-lite.mjs +1 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/package.json +11 -6
- package/dist/chunk-FC3PTJFL.js +0 -1
- package/dist/chunk-IQO3SIAG.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-5LJ652AH.mjs';import {c}from'./chunk-ZJYULEER.mjs';import {createContext,useMemo,useContext,Component}from'react';import {jsx,jsxs}from'react/jsx-runtime';var p=createContext({}),l=class extends Component{constructor(e){super(e);this.reset=()=>{this.setState({error:null});};this.state={error:null};}static getDerivedStateFromError(e){return {error:e}}componentDidCatch(e,r){var o,n;(n=(o=this.props).onError)==null||n.call(o,e,r);}render(){var r;let{error:e}=this.state;if(e){let{fallback:o}=this.props;return typeof o=="function"?o(e,this.reset):o!==void 0?o:jsxs("div",{role:"alert",style:{padding:"16px",border:"1px solid #e53e3e",borderRadius:"4px",backgroundColor:"#fff5f5",color:"#c53030"},children:[jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px"},children:(r=this.props.errorTitle)!=null?r:"Something went wrong"}),jsx("p",{style:{margin:0,fontSize:"14px"},children:e.message})]})}return this.props.children}},x=o=>{var n=o,{children:t,fallback:c$1,onError:e}=n,r=c(n,["children","fallback","onError"]);var u;let m=useMemo(()=>{if(!r.theme)return;let i={};return r.theme.primary&&(i["--ndpr-primary"]=r.theme.primary),r.theme.primaryHover&&(i["--ndpr-primary-hover"]=r.theme.primaryHover),r.theme.primaryForeground&&(i["--ndpr-primary-foreground"]=r.theme.primaryForeground),Object.keys(i).length>0?i:void 0},[r.theme]),y=(u=useMemo(()=>b(r.locale),[r.locale]).common.error)!=null?u:"Something went wrong";return jsx(p.Provider,{value:r,children:jsx(l,{fallback:c$1,onError:e,errorTitle:y,children:m?jsx("div",{style:m,children:t}):t})})};function C(){return useContext(p)}function S(){let{locale:t}=useContext(p);return useMemo(()=>b(t),[t])}export{x as a,C as b,S as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkL2VO3MEJ_js=require('./chunk-L2VO3MEJ.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),
|
|
1
|
+
'use strict';var chunkL2VO3MEJ_js=require('./chunk-L2VO3MEJ.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkI5ZDNSX5_js=require('./chunk-I5ZDNSX5.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime');var Vn=({options:d,onSave:bn,title:A,description:y,acceptAllButtonText:P,rejectAllButtonText:E,customizeButtonText:D,saveButtonText:z,position:pn="bottom",variant:a="bar",zIndex:x=9999,version:C="1.0",show:h,manageStorage:L=true,storageKey:w="ndpr_consent",className:V="",buttonClassName:j="",primaryButtonClassName:ln="",secondaryButtonClassName:fn="",classNames:n,unstyled:o,onAnalytics:k})=>{var U,X,Z,T,m,N,nn,tn,en;let c=chunkI5ZDNSX5_js.c(),gn=(U=A!=null?A:c.consent.title)!=null?U:"We Value Your Privacy",vn=(X=y!=null?y:c.consent.description)!=null?X:"We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",_n=(Z=P!=null?P:c.consent.acceptAll)!=null?Z:"Accept All",Cn=(T=E!=null?E:c.consent.rejectAll)!=null?T:"Reject All",hn=(m=D!=null?D:c.consent.customize)!=null?m:"Customize",an=(N=z!=null?z:c.consent.savePreferences)!=null?N:"Save Preferences",kn=(nn=c.consent.selectAll)!=null?nn:"Select All",Sn=(tn=c.consent.deselectAll)!=null?tn:"Deselect All",[b,u]=react.useState(false),[f,I]=react.useState(false),[S,B]=react.useState({}),[s,Bn]=react.useState(false),Rn=chunkL2VO3MEJ_js.a({active:b}),$=react.useRef(null),q=react.useRef(false);react.useEffect(()=>{Bn(true);},[]);let p=react.useCallback((t,e)=>{k==null||k(chunkRFPLZDIO_js.a({action:t,timestamp:Date.now(),version:C},e!==void 0?{categories:e}:{}));},[k,C]);react.useEffect(()=>{let t={};if(d.forEach(e=>{t[e.id]=e.defaultValue||false;}),B(t),h===void 0)if(!L)u(true);else {let e=localStorage.getItem(w);if(e)try{JSON.parse(e).version!==C?u(!0):u(!1);}catch(G){u(true);}else u(true);}else u(h);},[d,w,C,L]),react.useEffect(()=>{h!==void 0&&u(h);},[h]);let An=()=>{let t={};d.forEach(e=>{t[e.id]=true;}),p("accepted_all",t),H(t);},J=()=>{let t={};d.forEach(e=>{t[e.id]=e.required||false;}),p("rejected_all",t),H(t);},yn=(t,e)=>{B(G=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},G),{[t]:e}));},Pn=()=>{let t={};d.forEach(e=>{t[e.id]=true;}),B(t);},En=()=>{let t={};d.forEach(e=>{t[e.id]=e.required||false;}),B(t);},W=d.length>0&&d.every(t=>S[t.id]),Dn=()=>{p("customized",S),H(S);},H=t=>{let e={consents:t,timestamp:Date.now(),version:C,method:f?"customize":"banner",hasInteracted:true};L&&localStorage.setItem(w,JSON.stringify(e)),bn(e),u(false),I(false);};if(react.useEffect(()=>{if(!b)return;let t=e=>{e.key==="Escape"&&(p("dismissed"),J());};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[b,p,d,f]),react.useEffect(()=>{b&&!q.current&&(q.current=true,p("shown")),b||(q.current=false);},[b,p]),react.useEffect(()=>{if(f&&$.current){let t=$.current;t.style.maxHeight="0px",t.style.opacity="0",t.offsetHeight,t.style.maxHeight=`${t.scrollHeight}px`,t.style.opacity="1";}},[f]),!b)return null;let g=a==="modal"?"center":pn,Y=g==="inline",O=g==="center",v=["ndpr-consent-banner"];a!=="bar"&&v.push(`ndpr-consent-banner--${a}`),g==="top"?v.push("ndpr-consent-banner--top"):g==="bottom"?v.push("ndpr-consent-banner--bottom"):g==="inline"&&v.push("ndpr-consent-banner--inline"),V&&v.push(V);let zn=v.join(" "),K=`ndpr-consent-banner__button ndpr-consent-banner__button--primary ${j} ${ln}`.trim(),Ln=`ndpr-consent-banner__button ndpr-consent-banner__button--secondary ${j} ${fn}`.trim(),wn=`ndpr-consent-banner__button ndpr-consent-banner__button--ghost ${j}`.trim(),jn=(n==null?void 0:n.primaryButton)||(n==null?void 0:n.acceptButton)||K,Q=(n==null?void 0:n.secondaryButton)||(n==null?void 0:n.rejectButton)||Ln,In=(n==null?void 0:n.customizeButton)||wn,$n=(n==null?void 0:n.saveButton)||K,F=jsxRuntime.jsx("div",{ref:Rn,tabIndex:-1,"data-ndpr-component":"consent-banner","data-ndpr-variant":a,"data-ndpr-position":g,className:chunkAME4HJR4_js.a(zn,n==null?void 0:n.root,o),style:!Y&&!O?{zIndex:x}:void 0,role:"dialog","aria-modal":O||void 0,"aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__container",n==null?void 0:n.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkAME4HJR4_js.a("ndpr-consent-banner__title",n==null?void 0:n.title,o),children:gn}),jsxRuntime.jsx("p",{id:"consent-banner-description",className:chunkAME4HJR4_js.a("ndpr-consent-banner__description",n==null?void 0:n.description,o),children:vn}),f&&jsxRuntime.jsxs("div",{ref:$,className:chunkAME4HJR4_js.a("ndpr-consent-banner__customize-panel",n==null?void 0:n.customizePanel,o),children:[jsxRuntime.jsx("div",{className:o?"":"ndpr-consent-banner__select-all-row",children:jsxRuntime.jsx("button",{type:"button",onClick:W?En:Pn,className:chunkAME4HJR4_js.a("ndpr-consent-banner__select-all-button",n==null?void 0:n.selectAllButton,o),children:W?Sn:kn})}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__options-list",n==null?void 0:n.optionsList,o),children:d.map(t=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__option",n==null?void 0:n.optionItem,o),children:[jsxRuntime.jsx("input",{id:`consent-${t.id}`,type:"checkbox",checked:S[t.id]||false,onChange:e=>yn(t.id,e.target.checked),disabled:t.required,className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-checkbox",n==null?void 0:n.optionCheckbox,o)}),jsxRuntime.jsxs("div",{className:o?"":"ndpr-consent-banner__option-text",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${t.id}`,className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-label",n==null?void 0:n.optionLabel,o),children:[t.label,t.required&&jsxRuntime.jsx("span",{className:o?"":"ndpr-consent-banner__required-marker",children:" *"})]}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-description",n==null?void 0:n.optionDescription,o),children:t.description})]})]},t.id))}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__buttons",n==null?void 0:n.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:Dn,className:chunkAME4HJR4_js.a($n,n==null?void 0:n.saveButton,o),children:an}),jsxRuntime.jsx("button",{onClick:()=>I(false),className:chunkAME4HJR4_js.a(Q,n==null?void 0:n.rejectButton,o),children:(en=c.common.back)!=null?en:"Back"})]})]}),!f&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__buttons",n==null?void 0:n.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:An,className:chunkAME4HJR4_js.a(jn,n==null?void 0:n.acceptButton,o),children:_n}),jsxRuntime.jsx("button",{onClick:J,className:chunkAME4HJR4_js.a(Q,n==null?void 0:n.rejectButton,o),children:Cn}),jsxRuntime.jsx("button",{onClick:()=>I(true),className:chunkAME4HJR4_js.a(In,n==null?void 0:n.customizeButton,o),children:hn})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__footer-text",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(Y)return F;if(O){let t=jsxRuntime.jsx("div",{className:o?"":"ndpr-consent-banner__overlay",style:{zIndex:x},children:F});return s?reactDom.createPortal(t,document.body):null}return s?reactDom.createPortal(F,document.body):null};exports.a=Vn;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var chunkZVOIR4QH_js=require('./chunk-ZVOIR4QH.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkYDKWD6MQ_js=require('./chunk-YDKWD6MQ.js'),T=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var T__default=/*#__PURE__*/_interopDefault(T);var G=({result:s,sections:c,showFullReport:g=true,allowPrint:v=true,allowExport:f=true,onExport:b,className:w="",buttonClassName:x="",classNames:h={},unstyled:k=false})=>{var I;let N=(I=chunkYDKWD6MQ_js.c().dpia.reportTitle)!=null?I:"Data Protection Impact Assessment Report",m=T.useMemo(()=>new Date().toLocaleDateString(),[]),r=(a,n)=>{let i=n?h[n]:void 0;return !i&&n==="printButton"&&(i=h.primaryButton),chunkAME4HJR4_js.a(a,i,k)},o=a=>new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),R=a=>{let n=s.answers[a];return n==null?"Not answered":typeof n=="boolean"?n?"Yes":"No":Array.isArray(n)?n.join(", "):String(n)},p=()=>{window.print();},u=a=>{b&&b(a);},A=a=>jsxRuntime.jsx("span",{className:r(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[a]}`,"riskBadge"),children:a.charAt(0).toUpperCase()+a.slice(1)});return jsxRuntime.jsxs("div",{"data-ndpr-component":"dpia-report",className:`${r("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${w}`,children:[jsxRuntime.jsxs("div",{className:r("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:r("ndpr-card__title","title"),children:N}),jsxRuntime.jsx("h2",{className:"text-xl ndpr-text-muted mb-4",children:s.title})]}),(v||f)&&jsxRuntime.jsxs("div",{className:"flex space-x-2 print:hidden",children:[v&&jsxRuntime.jsx("button",{onClick:p,className:`${r("px-3 py-1 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600","printButton")} ${x}`,children:jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),f&&jsxRuntime.jsx("div",{className:"relative inline-block",children:jsxRuntime.jsx("button",{onClick:()=>u("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${x}`,children:jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessor:"})," ",s.assessor.name,", ",s.assessor.role]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",s.assessor.email]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Started:"})," ",o(s.startedAt)]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Completed:"})," ",s.completedAt?o(s.completedAt):"In progress"]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next review:"})," ",s.reviewDate?o(s.reviewDate):"Not scheduled"]})]})]})]}),jsxRuntime.jsxs("div",{className:r("mb-8","summary"),children:[jsxRuntime.jsx("h2",{className:"ndpr-section-heading",children:"Executive Summary"}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),A(s.overallRiskLevel)]}),jsxRuntime.jsxs("div",{className:r("mb-2","conclusion"),children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Conclusion:"})," ",s.conclusion]}),jsxRuntime.jsxs("div",{role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",s.canProceed?"Yes":"No"]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium ndpr-text-foreground mb-2",children:"Processing Activity Description"}),jsxRuntime.jsx("p",{className:"ndpr-text-muted mb-4",children:s.processingDescription}),s.recommendations&&s.recommendations.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium ndpr-text-foreground mb-2",children:"Key Recommendations"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 ndpr-text-muted",children:s.recommendations.map((a,n)=>jsxRuntime.jsx("li",{className:r("","recommendation"),children:a},n))})]})]})]}),jsxRuntime.jsxs("div",{className:"mb-8",children:[jsxRuntime.jsx("h2",{className:"ndpr-section-heading",children:"Identified Risks"}),s.risks.length===0?jsxRuntime.jsx("p",{className:"ndpr-text-muted",children:"No risks identified."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:r("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsxRuntime.jsx("thead",{className:"ndpr-panel",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Risk"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Likelihood"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Impact"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Risk Level"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Mitigated"})]})}),jsxRuntime.jsx("tbody",{className:"ndpr-table",children:s.risks.map(a=>jsxRuntime.jsxs("tr",{className:r("","riskRow"),children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:a.description}),jsxRuntime.jsxs("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:[a.likelihood," / 5"]}),jsxRuntime.jsxs("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:[a.impact," / 5"]}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:A(a.level)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:a.mitigated?jsxRuntime.jsx("span",{className:"ndpr-text-success",children:"Yes"}):jsxRuntime.jsx("span",{className:"ndpr-text-destructive",children:"No"})})]},a.id))})]})})]}),g&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"ndpr-section-heading",children:"Full Assessment Details"}),c.map(a=>{let n=a.questions.filter(i=>s.answers[i.id]!==void 0);return n.length===0?null:jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium ndpr-text-foreground mb-2",children:a.title}),jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsxRuntime.jsx("thead",{className:"ndpr-panel",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Question"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Answer"})]})}),jsxRuntime.jsx("tbody",{className:"ndpr-table",children:n.map(i=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:i.text}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm ndpr-text-muted",children:R(i.id)})]},i.id))})]})})]},a.id)})]}),jsxRuntime.jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm ndpr-text-muted",children:[jsxRuntime.jsx("p",{children:"This DPIA was conducted in accordance with NDPA 2023 Section 28."}),jsxRuntime.jsxs("p",{children:["DPIA Report Version: ",s.version]}),jsxRuntime.jsxs("p",{children:["Generated on: ",m]}),jsxRuntime.jsx("p",{className:"mt-2 italic",role:"note",children:chunkZVOIR4QH_js.a})]})]})};var Y=({steps:s,onStepClick:c,clickable:g=true,orientation:v="horizontal",className:f="",activeStepClassName:b="",completedStepClassName:w="",incompleteStepClassName:x="",classNames:h={},unstyled:k=false})=>{let d=(r,o)=>chunkAME4HJR4_js.a(r,o?h[o]:void 0,k),N=r=>{g&&c&&c(r);},m=v==="vertical";return jsxRuntime.jsx("div",{"data-ndpr-component":"dpia-step-indicator",role:"navigation","aria-label":"Step progress",className:`${d(m?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${f}`,children:s.map((r,o)=>{let C=o===s.length-1,D=r.active?d(`font-medium ${b||"ndpr-text-primary"}`,"label"):r.completed?d(w||"ndpr-text-success","label"):d(x||"ndpr-card__subtitle","label"),R=r.active?d("flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)] ndpr-text-primary border-2 border-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]","stepActive"):r.completed?d("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 ndpr-text-success border-2 border-green-600 dark:border-green-400","stepCompleted"):d("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 ndpr-text-muted border-2 border-gray-300 dark:border-gray-600","stepPending"),p=g&&!!c;return jsxRuntime.jsxs(T__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:d(`${m?"flex items-start":"flex flex-col items-center"} ${g?"cursor-pointer":""}`,"step"),role:p?"button":void 0,tabIndex:p?0:void 0,"aria-label":p?`Go to step ${o+1}: ${r.label}`:void 0,onClick:p?()=>N(r.id):void 0,onKeyDown:p?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),N(r.id));}:void 0,"aria-current":r.active?"step":void 0,children:[jsxRuntime.jsx("div",{className:`
|
|
1
|
+
'use strict';var chunkZVOIR4QH_js=require('./chunk-ZVOIR4QH.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkI5ZDNSX5_js=require('./chunk-I5ZDNSX5.js'),T=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var T__default=/*#__PURE__*/_interopDefault(T);var G=({result:s,sections:c,showFullReport:g=true,allowPrint:v=true,allowExport:f=true,onExport:b,className:w="",buttonClassName:x="",classNames:h={},unstyled:k=false})=>{var I;let N=(I=chunkI5ZDNSX5_js.c().dpia.reportTitle)!=null?I:"Data Protection Impact Assessment Report",m=T.useMemo(()=>new Date().toLocaleDateString(),[]),r=(a,n)=>{let i=n?h[n]:void 0;return !i&&n==="printButton"&&(i=h.primaryButton),chunkAME4HJR4_js.a(a,i,k)},o=a=>new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),R=a=>{let n=s.answers[a];return n==null?"Not answered":typeof n=="boolean"?n?"Yes":"No":Array.isArray(n)?n.join(", "):String(n)},p=()=>{window.print();},u=a=>{b&&b(a);},A=a=>jsxRuntime.jsx("span",{className:r(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[a]}`,"riskBadge"),children:a.charAt(0).toUpperCase()+a.slice(1)});return jsxRuntime.jsxs("div",{"data-ndpr-component":"dpia-report",className:`${r("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${w}`,children:[jsxRuntime.jsxs("div",{className:r("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:r("ndpr-card__title","title"),children:N}),jsxRuntime.jsx("h2",{className:"text-xl ndpr-text-muted mb-4",children:s.title})]}),(v||f)&&jsxRuntime.jsxs("div",{className:"flex space-x-2 print:hidden",children:[v&&jsxRuntime.jsx("button",{onClick:p,className:`${r("px-3 py-1 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600","printButton")} ${x}`,children:jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),f&&jsxRuntime.jsx("div",{className:"relative inline-block",children:jsxRuntime.jsx("button",{onClick:()=>u("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${x}`,children:jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessor:"})," ",s.assessor.name,", ",s.assessor.role]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",s.assessor.email]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Started:"})," ",o(s.startedAt)]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Completed:"})," ",s.completedAt?o(s.completedAt):"In progress"]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next review:"})," ",s.reviewDate?o(s.reviewDate):"Not scheduled"]})]})]})]}),jsxRuntime.jsxs("div",{className:r("mb-8","summary"),children:[jsxRuntime.jsx("h2",{className:"ndpr-section-heading",children:"Executive Summary"}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),A(s.overallRiskLevel)]}),jsxRuntime.jsxs("div",{className:r("mb-2","conclusion"),children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Conclusion:"})," ",s.conclusion]}),jsxRuntime.jsxs("div",{role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",s.canProceed?"Yes":"No"]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium ndpr-text-foreground mb-2",children:"Processing Activity Description"}),jsxRuntime.jsx("p",{className:"ndpr-text-muted mb-4",children:s.processingDescription}),s.recommendations&&s.recommendations.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium ndpr-text-foreground mb-2",children:"Key Recommendations"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 ndpr-text-muted",children:s.recommendations.map((a,n)=>jsxRuntime.jsx("li",{className:r("","recommendation"),children:a},n))})]})]})]}),jsxRuntime.jsxs("div",{className:"mb-8",children:[jsxRuntime.jsx("h2",{className:"ndpr-section-heading",children:"Identified Risks"}),s.risks.length===0?jsxRuntime.jsx("p",{className:"ndpr-text-muted",children:"No risks identified."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:r("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsxRuntime.jsx("thead",{className:"ndpr-panel",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Risk"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Likelihood"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Impact"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Risk Level"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Mitigated"})]})}),jsxRuntime.jsx("tbody",{className:"ndpr-table",children:s.risks.map(a=>jsxRuntime.jsxs("tr",{className:r("","riskRow"),children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:a.description}),jsxRuntime.jsxs("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:[a.likelihood," / 5"]}),jsxRuntime.jsxs("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:[a.impact," / 5"]}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:A(a.level)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:a.mitigated?jsxRuntime.jsx("span",{className:"ndpr-text-success",children:"Yes"}):jsxRuntime.jsx("span",{className:"ndpr-text-destructive",children:"No"})})]},a.id))})]})})]}),g&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"ndpr-section-heading",children:"Full Assessment Details"}),c.map(a=>{let n=a.questions.filter(i=>s.answers[i.id]!==void 0);return n.length===0?null:jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium ndpr-text-foreground mb-2",children:a.title}),jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsxRuntime.jsx("thead",{className:"ndpr-panel",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Question"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Answer"})]})}),jsxRuntime.jsx("tbody",{className:"ndpr-table",children:n.map(i=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:i.text}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm ndpr-text-muted",children:R(i.id)})]},i.id))})]})})]},a.id)})]}),jsxRuntime.jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm ndpr-text-muted",children:[jsxRuntime.jsx("p",{children:"This DPIA was conducted in accordance with NDPA 2023 Section 28."}),jsxRuntime.jsxs("p",{children:["DPIA Report Version: ",s.version]}),jsxRuntime.jsxs("p",{children:["Generated on: ",m]}),jsxRuntime.jsx("p",{className:"mt-2 italic",role:"note",children:chunkZVOIR4QH_js.a})]})]})};var Y=({steps:s,onStepClick:c,clickable:g=true,orientation:v="horizontal",className:f="",activeStepClassName:b="",completedStepClassName:w="",incompleteStepClassName:x="",classNames:h={},unstyled:k=false})=>{let d=(r,o)=>chunkAME4HJR4_js.a(r,o?h[o]:void 0,k),N=r=>{g&&c&&c(r);},m=v==="vertical";return jsxRuntime.jsx("div",{"data-ndpr-component":"dpia-step-indicator",role:"navigation","aria-label":"Step progress",className:`${d(m?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${f}`,children:s.map((r,o)=>{let C=o===s.length-1,D=r.active?d(`font-medium ${b||"ndpr-text-primary"}`,"label"):r.completed?d(w||"ndpr-text-success","label"):d(x||"ndpr-card__subtitle","label"),R=r.active?d("flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)] ndpr-text-primary border-2 border-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]","stepActive"):r.completed?d("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 ndpr-text-success border-2 border-green-600 dark:border-green-400","stepCompleted"):d("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 ndpr-text-muted border-2 border-gray-300 dark:border-gray-600","stepPending"),p=g&&!!c;return jsxRuntime.jsxs(T__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:d(`${m?"flex items-start":"flex flex-col items-center"} ${g?"cursor-pointer":""}`,"step"),role:p?"button":void 0,tabIndex:p?0:void 0,"aria-label":p?`Go to step ${o+1}: ${r.label}`:void 0,onClick:p?()=>N(r.id):void 0,onKeyDown:p?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),N(r.id));}:void 0,"aria-current":r.active?"step":void 0,children:[jsxRuntime.jsx("div",{className:`
|
|
2
2
|
flex items-center justify-center
|
|
3
3
|
${m?"mr-4":""}
|
|
4
4
|
`,children:jsxRuntime.jsx("div",{className:R,children:r.icon?r.icon:r.completed?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):jsxRuntime.jsx("span",{children:o+1})})}),jsxRuntime.jsxs("div",{className:`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d,c as c$1,a as a$1,b as b$1}from'./chunk-LWIKDDSU.mjs';import {a as a$2}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-FRQFU44F.mjs';import {b,a}from'./chunk-ZJYULEER.mjs';import {useState,useMemo,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var V={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},re=[{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"}],ae=[{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"}],Ae={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--neutral",under_review:"ndpr-badge ndpr-badge--warning",archived:"ndpr-badge ndpr-badge--destructive"},Be={active:"Active",inactive:"Inactive",under_review:"Under Review",archived:"Archived"},De={consent:"ndpr-badge ndpr-badge--info",contract:"ndpr-badge ndpr-badge--info",legal_obligation:"ndpr-badge ndpr-badge--info",vital_interests:"ndpr-badge ndpr-badge--destructive",public_interest:"ndpr-badge ndpr-badge--warning",legitimate_interests:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},Se={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"},je=({activities:g,onAdd:B,onUpdate:D,onArchive:S,title:j,description:E,className:ne="",buttonClassName:m="",showSummary:le=true,showComplianceGaps:oe=true,classNames:i,unstyled:l})=>{var X,Z;let M=c(),de=(X=j!=null?j:M.lawfulBasis.title)!=null?X:"Lawful Basis Tracker",se=(Z=E!=null?E:M.lawfulBasis.description)!=null?Z:"Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",[x,f]=useState("list"),[a$3,w]=useState(V),[b$2,J]=useState(null),[R,pe]=useState(null),[P,ue]=useState("all"),[k,ce]=useState("all"),[L,ge]=useState(""),[c$2,C]=useState([]),H=useMemo(()=>{let e=[...g];if(P!=="all"&&(e=e.filter(d=>d.status===P)),k!=="all"&&(e=e.filter(d=>d.lawfulBasis===k)),L){let d=L.toLowerCase();e=e.filter(p=>p.name.toLowerCase().includes(d)||p.description.toLowerCase().includes(d)||p.purposes.some($=>$.toLowerCase().includes(d)));}return e.sort((d,p)=>p.updatedAt-d.updatedAt),e},[g,P,k,L]),y=useCallback(e=>new Date(e).toLocaleDateString(),[]),T=useMemo(()=>d(g),[g]),h=useMemo(()=>c$1(g),[g]),A=useCallback(e=>e.split(",").map(d=>d.trim()).filter(d=>d.length>0),[]),ve=useCallback(()=>{w(V),J(null),C([]),f("form");},[]),U=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:""}),J(e.id),C([]),f("form");},[]),me=useCallback(()=>{let e={name:a$3.name,description:a$3.description,lawfulBasis:a$3.lawfulBasis,lawfulBasisJustification:a$3.lawfulBasisJustification,dataCategories:A(a$3.dataCategories),involvesSensitiveData:a$3.involvesSensitiveData,sensitiveDataCondition:a$3.sensitiveDataCondition||void 0,dataSubjectCategories:A(a$3.dataSubjectCategories),purposes:A(a$3.purposes),retentionPeriod:a$3.retentionPeriod,retentionJustification:a$3.retentionJustification||void 0,recipients:a$3.recipients?A(a$3.recipients):void 0,crossBorderTransfer:a$3.crossBorderTransfer,reviewDate:a$3.reviewDate?new Date(a$3.reviewDate).getTime():void 0,status:"active"},d=b(a({},e),{id:b$2||"temp",createdAt:Date.now(),updatedAt:Date.now()}),p=a$1(d);if(!p.isValid){C(p.errors);return}b$2?D==null||D(b$2,e):B==null||B(e),w(V),J(null),C([]),f("list");},[a$3,b$2,D,B,A]),Y=useCallback(e=>{S==null||S(e);},[S]),fe=useCallback(e=>{pe(e),f("detail");},[]),n=useMemo(()=>R?g.find(e=>e.id===R):null,[g,R]),W=useCallback(e=>jsx("span",{className:a$2(`px-2 py-1 rounded text-xs font-medium ${Ae[e]}`,i==null?void 0:i.statusBadge,l),children:Be[e]}),[i==null?void 0:i.statusBadge,l]),z=useCallback(e=>jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${De[e]}`,children:Se[e]}),[]),K=useCallback(e=>e.dpoApproval?e.dpoApproval.approved?jsx("span",{className:"ndpr-badge ndpr-badge--success",children:"Approved"}):jsx("span",{className:"ndpr-badge ndpr-badge--warning",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"}),[]),be=()=>jsxs("div",{"data-ndpr-component":"lawful-basis-tracker",className:a$2("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",i==null?void 0:i.summary,l),role:"status","aria-label":"Compliance summary",children:[jsxs("div",{className:a$2("ndpr-alert ndpr-alert--info",i==null?void 0:i.summaryCard,l),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:T.totalActivities}),jsx("p",{className:"text-sm ndpr-text-info",children:"Total Activities"})]}),jsxs("div",{className:a$2("bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",i==null?void 0:i.summaryCard,l),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:T.sensitiveDataActivities}),jsx("p",{className:"text-sm ndpr-text-warning",children:"Sensitive Data"})]}),jsxs("div",{className:a$2("ndpr-alert ndpr-alert--info",i==null?void 0:i.summaryCard,l),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:T.crossBorderActivities}),jsx("p",{className:"text-sm ndpr-text-info",children:"Cross-Border Transfers"})]}),jsxs("div",{className:a$2("ndpr-alert ndpr-alert--destructive",i==null?void 0:i.summaryCard,l),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-destructive",children:T.activitiesWithoutApproval.length}),jsx("p",{className:"text-sm ndpr-text-destructive",children:"Pending Approval"})]})]}),N=useMemo(()=>h.filter(e=>e.severity==="high"),[h]),O=useMemo(()=>h.filter(e=>e.severity==="medium"),[h]),he=()=>h.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 ndpr-text-success font-medium",children:"No compliance gaps detected."}),jsx("p",{className:"text-xs ndpr-text-success mt-1",children:"All processing activities appear to be properly documented."})]}):jsxs("div",{className:"mb-6",role:"status","aria-label":`${h.length} compliance gaps detected`,children:[N.length>0&&jsxs("div",{className:a$2("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-3",i==null?void 0:i.gapAlert,l),children:[jsxs("p",{className:"text-sm ndpr-text-destructive font-medium mb-2",children:["High Priority (",N.length,")"]}),jsx("ul",{className:"space-y-1",children:N.map((e,d)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:e.description},d))})]}),O.length>0&&jsxs("div",{className:a$2("ndpr-alert ndpr-alert--warning",i==null?void 0:i.gapAlert,l),children:[jsxs("p",{className:"text-sm ndpr-text-warning font-medium mb-2",children:["Medium Priority (",O.length,")"]}),jsx("ul",{className:"space-y-1",children:O.map((e,d)=>jsx("li",{className:"text-xs ndpr-text-warning",children:e.description},d))})]})]}),Q=useCallback(()=>{f("list"),C([]);},[]),_e=useCallback(()=>{f("list");},[]),s=useCallback((e,d)=>{w(p=>b(a({},p),{[e]:d}));},[]),xe=useCallback(e=>{w(d=>b(a({},d),{involvesSensitiveData:e,sensitiveDataCondition:e?d.sensitiveDataCondition:""}));},[]),we=()=>jsxs("div",{className:a$2("",i==null?void 0:i.form,l),children:[jsxs("div",{className:a$2("flex justify-between items-center mb-4",i==null?void 0:i.header,l),children:[jsx("h3",{className:"ndpr-section-heading",children:b$2?"Edit Processing Activity":"New Processing Activity"}),jsx("button",{onClick:Q,className:`px-4 py-2 ndpr-text-muted bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${m}`,children:"Cancel"})]}),c$2.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 ndpr-text-destructive font-medium mb-2",children:"Please correct the following errors:"}),jsx("ul",{className:"list-disc list-inside space-y-1",children:c$2.map((e,d)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:e},d))})]}),jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{children:[jsx("label",{htmlFor:"activityName",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"activityDescription",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.select,l),children:re.map(e=>jsx("option",{value:e.value,children:e.label},e.value))}),jsx("p",{className:"mt-1 text-xs ndpr-text-muted",children:b$1(a$3.lawfulBasis)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"justification",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),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:"ndpr-form-section",children:[jsxs("div",{children:[jsx("label",{htmlFor:"liaPurpose",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaNecessity",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaBalancing",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaSafeguards",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaConclusion",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsx("div",{children:jsxs("label",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",checked:a$3.involvesSensitiveData,onChange:e=>xe(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:"ndpr-text-sm ndpr-font-medium",children:"Involves Sensitive Personal Data (NDPA Section 27)"})]})}),a$3.involvesSensitiveData&&jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveCondition",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.select,l),children:[jsx("option",{value:"",children:"Select a condition..."}),ae.map(e=>jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSubjectCategories",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),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:"ndpr-text-sm ndpr-font-medium",children:"Involves Cross-Border Transfer Outside Nigeria"})]})}),jsxs("div",{children:[jsx("label",{htmlFor:"reviewDate",className:"ndpr-form-field__label",children:"Next Review Date"}),jsx("input",{type:"date",id:"reviewDate",value:a$3.reviewDate,onChange:e=>s("reviewDate",e.target.value),className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[jsx("button",{onClick:Q,className:`px-4 py-2 ndpr-text-muted bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${m}`,children:"Cancel"}),jsx("button",{onClick:me,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,(i==null?void 0:i.primaryButton)||(i==null?void 0:i.submitButton),l),children:b$2?"Update Activity":"Create Activity"})]})]})]}),Ce=()=>{var d;if(!n)return jsx("div",{className:"ndpr-empty-state",children:jsx("p",{className:"ndpr-card__subtitle",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:_e,className:"text-sm ndpr-text-primary hover:underline mb-2","aria-label":"Back to activities list",children:"Back to list"}),jsx("h3",{className:"ndpr-section-heading",children:n.name})]}),jsxs("div",{className:"ndpr-card__footer",children:[z(n.lawfulBasis),W(n.status),K(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 ndpr-text-warning font-medium mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside space-y-1",children:e.warnings.map((p,$)=>jsx("li",{className:"text-xs ndpr-text-warning",children:p},$))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Description:"})," ",n.description]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",b$1(n.lawfulBasis)]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Justification:"})," ",n.lawfulBasisJustification]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Categories:"})," ",n.dataCategories.join(", ")]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",n.dataSubjectCategories.join(", ")]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Purposes:"})," ",n.purposes.join(", ")]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Retention Period:"})," ",n.retentionPeriod,n.retentionJustification&&jsxs("span",{className:"ndpr-card__subtitle",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:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",n.involvesSensitiveData?"Yes":"No",n.sensitiveDataCondition&&jsxs("span",{children:[" ","(Condition:"," ",((d=ae.find(p=>p.value===n.sensitiveDataCondition))==null?void 0:d.label)||n.sensitiveDataCondition,")"]})]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",n.crossBorderTransfer?"Yes":"No"]}),n.recipients&&n.recipients.length>0&&jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Recipients:"})," ",n.recipients.join(", ")]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Created:"})," ",y(n.createdAt)]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Last Updated:"})," ",y(n.updatedAt)]}),n.reviewDate&&jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",y(n.reviewDate),n.reviewDate<Date.now()&&jsx("span",{className:"ndpr-text-destructive 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:"ndpr-section-heading",children:"DPO Approval"}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",n.dpoApproval.approved?"Approved":"Not Approved"]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Approved By:"})," ",n.dpoApproval.approvedBy]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Date:"})," ",y(n.dpoApproval.approvedAt)]}),n.dpoApproval.notes&&jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Notes:"})," ",n.dpoApproval.notes]})]}),jsxs("div",{className:"flex space-x-3",children:[jsx("button",{onClick:()=>U(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:()=>Y(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"})]})]})},ye=()=>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:"ndpr-form-field__label",children:"Lawful Basis"}),jsxs("select",{id:"basisFilter",value:k,onChange:e=>ce(e.target.value),"aria-label":"Filter by lawful basis",className:a$2("ndpr-form-field__input",i==null?void 0:i.select,l),children:[jsx("option",{value:"all",children:"All Bases"}),re.map(e=>jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"statusFilterSelect",className:"ndpr-form-field__label",children:"Status"}),jsxs("select",{id:"statusFilterSelect",value:P,onChange:e=>ue(e.target.value),"aria-label":"Filter by status",className:a$2("ndpr-form-field__input",i==null?void 0:i.select,l),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:"ndpr-form-field__label",children:"Search"}),jsx("input",{type:"text",id:"searchInput",value:L,onChange:e=>ge(e.target.value),placeholder:"Search activities...",className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsx("div",{className:"flex items-end",children:jsx("button",{onClick:ve,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}`,(i==null?void 0:i.primaryButton)||(i==null?void 0:i.submitButton),l),children:"Add Activity"})})]}),H.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:"ndpr-card__subtitle",children:"No processing activities found."})}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a$2("w-full text-sm text-left",i==null?void 0:i.table,l),children:[jsx("thead",{className:a$2("ndpr-table__head",i==null?void 0:i.tableHeader,l),children:jsxs("tr",{children:[jsx("th",{className:"ndpr-table__cell",children:"Activity"}),jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsx("th",{className:"ndpr-table__cell",children:"DPO Approval"}),jsx("th",{className:"ndpr-table__cell",children:"Sensitive Data"}),jsx("th",{className:"ndpr-table__cell",children:"Last Updated"}),jsx("th",{className:"ndpr-table__cell",children:"Actions"})]})}),jsx("tbody",{children:H.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",i==null?void 0:i.tableRow,l),children:[jsxs("td",{className:"ndpr-table__cell",children:[jsx("button",{onClick:()=>fe(e.id),className:"font-medium ndpr-text-primary hover:underline text-left",children:e.name}),jsx("p",{className:"text-xs ndpr-text-muted mt-1 truncate max-w-xs",children:e.description})]}),jsx("td",{className:"ndpr-table__cell",children:z(e.lawfulBasis)}),jsx("td",{className:"ndpr-table__cell",children:W(e.status)}),jsx("td",{className:"ndpr-table__cell",children:K(e)}),jsx("td",{className:"ndpr-table__cell",children:jsx("span",{className:`text-xs ${e.involvesSensitiveData?"ndpr-text-warning font-medium":"ndpr-card__subtitle"}`,children:e.involvesSensitiveData?"Yes":"No"})}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:y(e.updatedAt)}),jsx("td",{className:"ndpr-table__cell",children:jsxs("div",{className:"ndpr-card__footer",children:[jsx("button",{onClick:()=>U(e),"aria-label":`Edit ${e.name}`,className:"text-xs ndpr-text-primary hover:underline",children:"Edit"}),e.status!=="archived"&&jsx("button",{onClick:()=>Y(e.id),"aria-label":`Archive ${e.name}`,className:"text-xs ndpr-text-muted hover:underline",children:"Archive"})]})})]},e.id))})]})})]});return jsxs("div",{className:a$2(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ne}`,i==null?void 0:i.root,l),children:[jsx("h2",{className:a$2("ndpr-section-heading",i==null?void 0:i.title,l),children:de}),jsx("p",{className:"ndpr-card__subtitle",children:se}),le&&x==="list"&&be(),oe&&x==="list"&&he(),x==="list"&&ye(),x==="form"&&we(),x==="detail"&&Ce()]})};export{je as a};
|
|
1
|
+
import {d,c as c$1,a as a$1,b as b$1}from'./chunk-LWIKDDSU.mjs';import {a as a$2}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-PHA3YMFO.mjs';import {b,a}from'./chunk-ZJYULEER.mjs';import {useState,useMemo,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var V={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},re=[{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"}],ae=[{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"}],Ae={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--neutral",under_review:"ndpr-badge ndpr-badge--warning",archived:"ndpr-badge ndpr-badge--destructive"},Be={active:"Active",inactive:"Inactive",under_review:"Under Review",archived:"Archived"},De={consent:"ndpr-badge ndpr-badge--info",contract:"ndpr-badge ndpr-badge--info",legal_obligation:"ndpr-badge ndpr-badge--info",vital_interests:"ndpr-badge ndpr-badge--destructive",public_interest:"ndpr-badge ndpr-badge--warning",legitimate_interests:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},Se={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"},je=({activities:g,onAdd:B,onUpdate:D,onArchive:S,title:j,description:E,className:ne="",buttonClassName:m="",showSummary:le=true,showComplianceGaps:oe=true,classNames:i,unstyled:l})=>{var X,Z;let M=c(),de=(X=j!=null?j:M.lawfulBasis.title)!=null?X:"Lawful Basis Tracker",se=(Z=E!=null?E:M.lawfulBasis.description)!=null?Z:"Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",[x,f]=useState("list"),[a$3,w]=useState(V),[b$2,J]=useState(null),[R,pe]=useState(null),[P,ue]=useState("all"),[k,ce]=useState("all"),[L,ge]=useState(""),[c$2,C]=useState([]),H=useMemo(()=>{let e=[...g];if(P!=="all"&&(e=e.filter(d=>d.status===P)),k!=="all"&&(e=e.filter(d=>d.lawfulBasis===k)),L){let d=L.toLowerCase();e=e.filter(p=>p.name.toLowerCase().includes(d)||p.description.toLowerCase().includes(d)||p.purposes.some($=>$.toLowerCase().includes(d)));}return e.sort((d,p)=>p.updatedAt-d.updatedAt),e},[g,P,k,L]),y=useCallback(e=>new Date(e).toLocaleDateString(),[]),T=useMemo(()=>d(g),[g]),h=useMemo(()=>c$1(g),[g]),A=useCallback(e=>e.split(",").map(d=>d.trim()).filter(d=>d.length>0),[]),ve=useCallback(()=>{w(V),J(null),C([]),f("form");},[]),U=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:""}),J(e.id),C([]),f("form");},[]),me=useCallback(()=>{let e={name:a$3.name,description:a$3.description,lawfulBasis:a$3.lawfulBasis,lawfulBasisJustification:a$3.lawfulBasisJustification,dataCategories:A(a$3.dataCategories),involvesSensitiveData:a$3.involvesSensitiveData,sensitiveDataCondition:a$3.sensitiveDataCondition||void 0,dataSubjectCategories:A(a$3.dataSubjectCategories),purposes:A(a$3.purposes),retentionPeriod:a$3.retentionPeriod,retentionJustification:a$3.retentionJustification||void 0,recipients:a$3.recipients?A(a$3.recipients):void 0,crossBorderTransfer:a$3.crossBorderTransfer,reviewDate:a$3.reviewDate?new Date(a$3.reviewDate).getTime():void 0,status:"active"},d=b(a({},e),{id:b$2||"temp",createdAt:Date.now(),updatedAt:Date.now()}),p=a$1(d);if(!p.isValid){C(p.errors);return}b$2?D==null||D(b$2,e):B==null||B(e),w(V),J(null),C([]),f("list");},[a$3,b$2,D,B,A]),Y=useCallback(e=>{S==null||S(e);},[S]),fe=useCallback(e=>{pe(e),f("detail");},[]),n=useMemo(()=>R?g.find(e=>e.id===R):null,[g,R]),W=useCallback(e=>jsx("span",{className:a$2(`px-2 py-1 rounded text-xs font-medium ${Ae[e]}`,i==null?void 0:i.statusBadge,l),children:Be[e]}),[i==null?void 0:i.statusBadge,l]),z=useCallback(e=>jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${De[e]}`,children:Se[e]}),[]),K=useCallback(e=>e.dpoApproval?e.dpoApproval.approved?jsx("span",{className:"ndpr-badge ndpr-badge--success",children:"Approved"}):jsx("span",{className:"ndpr-badge ndpr-badge--warning",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"}),[]),be=()=>jsxs("div",{"data-ndpr-component":"lawful-basis-tracker",className:a$2("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",i==null?void 0:i.summary,l),role:"status","aria-label":"Compliance summary",children:[jsxs("div",{className:a$2("ndpr-alert ndpr-alert--info",i==null?void 0:i.summaryCard,l),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:T.totalActivities}),jsx("p",{className:"text-sm ndpr-text-info",children:"Total Activities"})]}),jsxs("div",{className:a$2("bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",i==null?void 0:i.summaryCard,l),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:T.sensitiveDataActivities}),jsx("p",{className:"text-sm ndpr-text-warning",children:"Sensitive Data"})]}),jsxs("div",{className:a$2("ndpr-alert ndpr-alert--info",i==null?void 0:i.summaryCard,l),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:T.crossBorderActivities}),jsx("p",{className:"text-sm ndpr-text-info",children:"Cross-Border Transfers"})]}),jsxs("div",{className:a$2("ndpr-alert ndpr-alert--destructive",i==null?void 0:i.summaryCard,l),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-destructive",children:T.activitiesWithoutApproval.length}),jsx("p",{className:"text-sm ndpr-text-destructive",children:"Pending Approval"})]})]}),N=useMemo(()=>h.filter(e=>e.severity==="high"),[h]),O=useMemo(()=>h.filter(e=>e.severity==="medium"),[h]),he=()=>h.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 ndpr-text-success font-medium",children:"No compliance gaps detected."}),jsx("p",{className:"text-xs ndpr-text-success mt-1",children:"All processing activities appear to be properly documented."})]}):jsxs("div",{className:"mb-6",role:"status","aria-label":`${h.length} compliance gaps detected`,children:[N.length>0&&jsxs("div",{className:a$2("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-3",i==null?void 0:i.gapAlert,l),children:[jsxs("p",{className:"text-sm ndpr-text-destructive font-medium mb-2",children:["High Priority (",N.length,")"]}),jsx("ul",{className:"space-y-1",children:N.map((e,d)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:e.description},d))})]}),O.length>0&&jsxs("div",{className:a$2("ndpr-alert ndpr-alert--warning",i==null?void 0:i.gapAlert,l),children:[jsxs("p",{className:"text-sm ndpr-text-warning font-medium mb-2",children:["Medium Priority (",O.length,")"]}),jsx("ul",{className:"space-y-1",children:O.map((e,d)=>jsx("li",{className:"text-xs ndpr-text-warning",children:e.description},d))})]})]}),Q=useCallback(()=>{f("list"),C([]);},[]),_e=useCallback(()=>{f("list");},[]),s=useCallback((e,d)=>{w(p=>b(a({},p),{[e]:d}));},[]),xe=useCallback(e=>{w(d=>b(a({},d),{involvesSensitiveData:e,sensitiveDataCondition:e?d.sensitiveDataCondition:""}));},[]),we=()=>jsxs("div",{className:a$2("",i==null?void 0:i.form,l),children:[jsxs("div",{className:a$2("flex justify-between items-center mb-4",i==null?void 0:i.header,l),children:[jsx("h3",{className:"ndpr-section-heading",children:b$2?"Edit Processing Activity":"New Processing Activity"}),jsx("button",{onClick:Q,className:`px-4 py-2 ndpr-text-muted bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${m}`,children:"Cancel"})]}),c$2.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 ndpr-text-destructive font-medium mb-2",children:"Please correct the following errors:"}),jsx("ul",{className:"list-disc list-inside space-y-1",children:c$2.map((e,d)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:e},d))})]}),jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{children:[jsx("label",{htmlFor:"activityName",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"activityDescription",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.select,l),children:re.map(e=>jsx("option",{value:e.value,children:e.label},e.value))}),jsx("p",{className:"mt-1 text-xs ndpr-text-muted",children:b$1(a$3.lawfulBasis)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"justification",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),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:"ndpr-form-section",children:[jsxs("div",{children:[jsx("label",{htmlFor:"liaPurpose",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaNecessity",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaBalancing",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaSafeguards",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaConclusion",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsx("div",{children:jsxs("label",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",checked:a$3.involvesSensitiveData,onChange:e=>xe(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:"ndpr-text-sm ndpr-font-medium",children:"Involves Sensitive Personal Data (NDPA Section 30)"})]})}),a$3.involvesSensitiveData&&jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveCondition",className:"ndpr-form-field__label",children:"Sensitive Data Condition (NDPA Section 30) *"}),jsxs("select",{id:"sensitiveCondition",value:a$3.sensitiveDataCondition,onChange:e=>s("sensitiveDataCondition",e.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",i==null?void 0:i.select,l),children:[jsx("option",{value:"",children:"Select a condition..."}),ae.map(e=>jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSubjectCategories",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"ndpr-form-field__label",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":c$2.length>0?"form-errors":void 0,className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"ndpr-form-field__label",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("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),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:"ndpr-text-sm ndpr-font-medium",children:"Involves Cross-Border Transfer Outside Nigeria"})]})}),jsxs("div",{children:[jsx("label",{htmlFor:"reviewDate",className:"ndpr-form-field__label",children:"Next Review Date"}),jsx("input",{type:"date",id:"reviewDate",value:a$3.reviewDate,onChange:e=>s("reviewDate",e.target.value),className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[jsx("button",{onClick:Q,className:`px-4 py-2 ndpr-text-muted bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${m}`,children:"Cancel"}),jsx("button",{onClick:me,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,(i==null?void 0:i.primaryButton)||(i==null?void 0:i.submitButton),l),children:b$2?"Update Activity":"Create Activity"})]})]})]}),Ce=()=>{var d;if(!n)return jsx("div",{className:"ndpr-empty-state",children:jsx("p",{className:"ndpr-card__subtitle",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:_e,className:"text-sm ndpr-text-primary hover:underline mb-2","aria-label":"Back to activities list",children:"Back to list"}),jsx("h3",{className:"ndpr-section-heading",children:n.name})]}),jsxs("div",{className:"ndpr-card__footer",children:[z(n.lawfulBasis),W(n.status),K(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 ndpr-text-warning font-medium mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside space-y-1",children:e.warnings.map((p,$)=>jsx("li",{className:"text-xs ndpr-text-warning",children:p},$))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Description:"})," ",n.description]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",b$1(n.lawfulBasis)]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Justification:"})," ",n.lawfulBasisJustification]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Categories:"})," ",n.dataCategories.join(", ")]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",n.dataSubjectCategories.join(", ")]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Purposes:"})," ",n.purposes.join(", ")]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Retention Period:"})," ",n.retentionPeriod,n.retentionJustification&&jsxs("span",{className:"ndpr-card__subtitle",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:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",n.involvesSensitiveData?"Yes":"No",n.sensitiveDataCondition&&jsxs("span",{children:[" ","(Condition:"," ",((d=ae.find(p=>p.value===n.sensitiveDataCondition))==null?void 0:d.label)||n.sensitiveDataCondition,")"]})]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",n.crossBorderTransfer?"Yes":"No"]}),n.recipients&&n.recipients.length>0&&jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Recipients:"})," ",n.recipients.join(", ")]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Created:"})," ",y(n.createdAt)]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Last Updated:"})," ",y(n.updatedAt)]}),n.reviewDate&&jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",y(n.reviewDate),n.reviewDate<Date.now()&&jsx("span",{className:"ndpr-text-destructive 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:"ndpr-section-heading",children:"DPO Approval"}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",n.dpoApproval.approved?"Approved":"Not Approved"]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Approved By:"})," ",n.dpoApproval.approvedBy]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Date:"})," ",y(n.dpoApproval.approvedAt)]}),n.dpoApproval.notes&&jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Notes:"})," ",n.dpoApproval.notes]})]}),jsxs("div",{className:"flex space-x-3",children:[jsx("button",{onClick:()=>U(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:()=>Y(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"})]})]})},ye=()=>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:"ndpr-form-field__label",children:"Lawful Basis"}),jsxs("select",{id:"basisFilter",value:k,onChange:e=>ce(e.target.value),"aria-label":"Filter by lawful basis",className:a$2("ndpr-form-field__input",i==null?void 0:i.select,l),children:[jsx("option",{value:"all",children:"All Bases"}),re.map(e=>jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"statusFilterSelect",className:"ndpr-form-field__label",children:"Status"}),jsxs("select",{id:"statusFilterSelect",value:P,onChange:e=>ue(e.target.value),"aria-label":"Filter by status",className:a$2("ndpr-form-field__input",i==null?void 0:i.select,l),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:"ndpr-form-field__label",children:"Search"}),jsx("input",{type:"text",id:"searchInput",value:L,onChange:e=>ge(e.target.value),placeholder:"Search activities...",className:a$2("ndpr-form-field__input",i==null?void 0:i.input,l)})]}),jsx("div",{className:"flex items-end",children:jsx("button",{onClick:ve,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}`,(i==null?void 0:i.primaryButton)||(i==null?void 0:i.submitButton),l),children:"Add Activity"})})]}),H.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:"ndpr-card__subtitle",children:"No processing activities found."})}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a$2("w-full text-sm text-left",i==null?void 0:i.table,l),children:[jsx("thead",{className:a$2("ndpr-table__head",i==null?void 0:i.tableHeader,l),children:jsxs("tr",{children:[jsx("th",{className:"ndpr-table__cell",children:"Activity"}),jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsx("th",{className:"ndpr-table__cell",children:"DPO Approval"}),jsx("th",{className:"ndpr-table__cell",children:"Sensitive Data"}),jsx("th",{className:"ndpr-table__cell",children:"Last Updated"}),jsx("th",{className:"ndpr-table__cell",children:"Actions"})]})}),jsx("tbody",{children:H.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",i==null?void 0:i.tableRow,l),children:[jsxs("td",{className:"ndpr-table__cell",children:[jsx("button",{onClick:()=>fe(e.id),className:"font-medium ndpr-text-primary hover:underline text-left",children:e.name}),jsx("p",{className:"text-xs ndpr-text-muted mt-1 truncate max-w-xs",children:e.description})]}),jsx("td",{className:"ndpr-table__cell",children:z(e.lawfulBasis)}),jsx("td",{className:"ndpr-table__cell",children:W(e.status)}),jsx("td",{className:"ndpr-table__cell",children:K(e)}),jsx("td",{className:"ndpr-table__cell",children:jsx("span",{className:`text-xs ${e.involvesSensitiveData?"ndpr-text-warning font-medium":"ndpr-card__subtitle"}`,children:e.involvesSensitiveData?"Yes":"No"})}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:y(e.updatedAt)}),jsx("td",{className:"ndpr-table__cell",children:jsxs("div",{className:"ndpr-card__footer",children:[jsx("button",{onClick:()=>U(e),"aria-label":`Edit ${e.name}`,className:"text-xs ndpr-text-primary hover:underline",children:"Edit"}),e.status!=="archived"&&jsx("button",{onClick:()=>Y(e.id),"aria-label":`Archive ${e.name}`,className:"text-xs ndpr-text-muted hover:underline",children:"Archive"})]})})]},e.id))})]})})]});return jsxs("div",{className:a$2(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ne}`,i==null?void 0:i.root,l),children:[jsx("h2",{className:a$2("ndpr-section-heading",i==null?void 0:i.title,l),children:de}),jsx("p",{className:"ndpr-card__subtitle",children:se}),le&&x==="list"&&be(),oe&&x==="list"&&he(),x==="list"&&ye(),x==="form"&&we(),x==="detail"&&Ce()]})};export{je as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk6KQADEFS_js=require('./chunk-6KQADEFS.js'),chunkNUOHT3LO_js=require('./chunk-NUOHT3LO.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var C=d=>{var o=d,{template:e,templateOverrides:r,initialContext:t,copy:s}=o,l=chunkRFPLZDIO_js.c(o,["template","templateOverrides","initialContext","copy"]);let n=react.useMemo(()=>{if(t)return t;if(e)return chunkNUOHT3LO_js.b(e,r)},[t,e,r]);return jsxRuntime.jsx(chunk6KQADEFS_js.a,chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},l),{initialContext:n}))};exports.a=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-HDPXARLC.mjs';import {b}from'./chunk-CWY2FMIC.mjs';import {c,b as b$1,a as a$1}from'./chunk-ZJYULEER.mjs';import {useMemo}from'react';import {jsx}from'react/jsx-runtime';var C=d=>{var o=d,{template:e,templateOverrides:r,initialContext:t,copy:s}=o,l=c(o,["template","templateOverrides","initialContext","copy"]);let n=useMemo(()=>{if(t)return t;if(e)return b(e,r)},[t,e,r]);return jsx(a,b$1(a$1({},l),{initialContext:n}))};export{C as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkR2ZZMATR_js=require('./chunk-R2ZZMATR.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkYDKWD6MQ_js=require('./chunk-YDKWD6MQ.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var pe=({requests:w,onSelectRequest:I,onUpdateStatus:j,onAssignRequest:C,title:V,description:M,className:X="",buttonClassName:L="",showRequestDetails:Z=true,showRequestTimeline:ee=true,showDeadlineAlerts:U=true,assignees:i=[],classNames:l,unstyled:R=false})=>{var u,v;let E=chunkYDKWD6MQ_js.c(),te=(u=V!=null?V:E.dsr.dashboardTitle)!=null?u:"Data Subject Request Dashboard",_=(v=M!=null?M:E.dsr.dashboardDescription)!=null?v:"Track and manage data subject requests in compliance with NDPA Part IV requirements.",[f,y]=react.useState(null),[D,q]=react.useState(w),[T,K]=react.useState("all"),[P,$]=react.useState("all"),[A,H]=react.useState(""),[F,ae]=react.useState("createdAt"),[W,de]=react.useState("desc"),[S,re]=react.useState("");react.useEffect(()=>{let e=[...w];if(T!=="all"&&(e=e.filter(r=>r.status===T)),P!=="all"&&(e=e.filter(r=>r.type===P)),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(F){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 W==="asc"?h:-h}),q(e);},[w,T,P,A,F,W]),react.useEffect(()=>{D.length>0&&(f&&D.some(r=>r.id===f)||y(D[0].id));},[D,f]);let J=e=>{y(e),I&&I(e);},Y=e=>{f&&j&&j(f,e);},ie=()=>{f&&S&&C&&(C(f,S),re(""));},k=e=>new Date(e).toLocaleDateString(),z=e=>{let r=Date.now(),p=(e-r)/(1440*60*1e3);return Math.ceil(p)},m=f?w.find(e=>e.id===f):null,B=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",withdraw_consent:"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-200"},p={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making",withdraw_consent:"Withdraw Consent"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${r[e]}`,children:p[e]})},O=e=>jsxRuntime.jsx("span",{className:chunkAME4HJR4_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,R),children:e==="inProgress"?"In Progress":e==="awaitingVerification"?"Awaiting Verification":e.charAt(0).toUpperCase()+e.slice(1)}),t=e=>{if(!e.dueDate)return null;let r=z(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."]})]})},s=e=>{let r=[{title:"Request Received",date:e.createdAt,completed:true,description:`Request was received on ${k(e.createdAt)}.`}];return e.verifiedAt?r.push({title:"Identity Verified",date:e.verifiedAt,completed:true,description:`Data subject's identity was verified on ${k(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 ${k(e.updatedAt)}.`}),e.status==="completed"?r.push({title:"Request Completed",date:e.completedAt||Date.now(),completed:true,description:`Request was completed on ${k(e.completedAt||Date.now())}.`}):e.status==="rejected"&&r.push({title:"Request Rejected",date:e.completedAt||Date.now(),completed:true,description:`Request was rejected on ${k(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 ${k(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?k(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))})]})},g=()=>[{value:"all",label:"All Types"},{value:"information",label:"Information (NDPA Section 27)"},{value:"access",label:"Access (NDPA Section 34(1)(a))"},{value:"rectification",label:"Rectification (NDPA Section 34(1)(c))"},{value:"erasure",label:"Erasure (NDPA Section 34(1)(d))"},{value:"restriction",label:"Restriction (NDPA Section 34(1)(e))"},{value:"portability",label:"Portability (NDPA Section 38)"},{value:"objection",label:"Objection (NDPA Section 36)"},{value:"automated_decision_making",label:"Automated Decision-Making (NDPA Section 37)"},{value:"withdraw_consent",label:"Withdraw Consent (NDPA Section 35)"}].map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value)),x=()=>[{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)),o=()=>[{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:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${X}`,l==null?void 0:l.root,R),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",l==null?void 0:l.header,R),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("text-xl font-bold mb-2",l==null?void 0:l.title,R),children:te}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:_})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",l==null?void 0:l.filters,R),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:T,onChange:e=>K(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:x()})]}),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:P,onChange:e=>$(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:g()})]}),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:F,onChange:e=>ae(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=>H(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:chunkAME4HJR4_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",l==null?void 0:l.requestList,R),children:D.map(e=>{let r=e.dueDate?z(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":f===e.id,className:chunkAME4HJR4_js.a(`p-3 rounded-md cursor-pointer ${f===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,R),onClick:()=>J(e.id),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),J(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}),B(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: ",k(e.createdAt)]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:O(e.status)}),jsxRuntime.jsx("div",{children:p})]})]},e.id)})})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("md:col-span-2",l==null?void 0:l.detailPanel,R),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:[B(m.type),O(m.status)]})]}),U&&m.dueDate&&jsxRuntime.jsx("div",{className:"mb-4",children:t(m)}),Z&&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:"})," ",k(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:"})," ",k(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=>Y(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:o()}),jsxRuntime.jsx("button",{onClick:()=>Y(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))] ${L}`,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=>re(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:ie,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 ${L}`,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(chunkR2ZZMATR_js.b(m).formattedRequest,null,2)})})})]}),ee&&s(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 ke=({requests:w,onSelectRequest:I,title:j,description:C,className:V="",buttonClassName:M="",showSummaryStats:X=true,showTypeBreakdown:L=true,showStatusBreakdown:Z=true,showTimelineChart:ee=true,showOverdueRequests:U=true,classNames:i,unstyled:l=false})=>{var B,O;let R=chunkYDKWD6MQ_js.c(),E=(B=j!=null?j:R.dsr.trackerTitle)!=null?B:"DSR Request Tracker",te=(O=C!=null?C:R.dsr.trackerDescription)!=null?O:"Track the status and progress of data subject requests as required by NDPA Part IV.",[_,f]=react.useState("30days"),[y,D]=react.useState(w),[q,T]=react.useState([]),[K,P]=react.useState([]);react.useEffect(()=>{let t=Date.now(),s;switch(_){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");T(g);let x=s.filter(o=>o.dueDate&&t<o.dueDate&&o.dueDate-t<=10080*60*1e3&&o.status!=="completed"&&o.status!=="rejected");P(x);},[w,_]);let $=t=>{I&&I(t);},A=t=>new Date(t).toLocaleDateString(),H=t=>{let s=Date.now(),g=(t-s)/(1440*60*1e3);return Math.ceil(g)},F=()=>{let t=y.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))},ae=()=>{let t=y.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)},W=()=>{let t={};return y.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,withdraw_consent:t.withdraw_consent||0}},de=()=>{let t={};return y.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",withdraw_consent:"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-200"},g={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making",withdraw_consent:"Withdraw Consent"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${s[t]}`,children:g[t]})},J=()=>{let t=y.length,s=y.filter(u=>u.status!=="completed"&&u.status!=="rejected").length;y.filter(u=>u.status==="completed"||u.status==="rejected").length;let x=F(),o=ae();return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_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:chunkAME4HJR4_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:chunkAME4HJR4_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:chunkAME4HJR4_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:chunkAME4HJR4_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"})]})]})},Y=()=>{let t=W(),s=y.length,g=Object.entries(t).sort(([,x],[,o])=>o-x).map(([x])=>x);return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_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:chunkAME4HJR4_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)})})]})},ie=()=>{let t=de(),s=y.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:chunkAME4HJR4_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:chunkAME4HJR4_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)})})]})]})},k=()=>{let t={};y.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))})]})]})},z=()=>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"}),q.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:q.map(t=>jsxRuntime.jsxs("div",{role:"button",tabIndex:0,"aria-label":`View overdue request from ${t.subject.name}`,className:chunkAME4HJR4_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.id),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),$(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(H(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"}),K.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:K.map(t=>{let s=H(t.dueDate||0);return jsxRuntime.jsxs("div",{role:"button",tabIndex:0,"aria-label":`View upcoming deadline for ${t.subject.name}`,className:chunkAME4HJR4_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.id),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),$(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:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${V}`,i==null?void 0:i.root,l),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_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:chunkAME4HJR4_js.a("text-xl font-bold mb-2",i==null?void 0:i.title,l),children:E}),jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:te})]}),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:_,onChange:t=>f(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"})]})]})]}),X&&J(),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{children:[L&&Y(),Z&&ie()]}),jsxRuntime.jsxs("div",{children:[ee&&k(),U&&z(),U&&m()]})]})]})};exports.a=pe;exports.b=ke;
|
|
1
|
+
'use strict';var chunkR2ZZMATR_js=require('./chunk-R2ZZMATR.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkI5ZDNSX5_js=require('./chunk-I5ZDNSX5.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var pe=({requests:w,onSelectRequest:I,onUpdateStatus:j,onAssignRequest:C,title:V,description:M,className:X="",buttonClassName:L="",showRequestDetails:Z=true,showRequestTimeline:ee=true,showDeadlineAlerts:U=true,assignees:i=[],classNames:l,unstyled:R=false})=>{var u,v;let E=chunkI5ZDNSX5_js.c(),te=(u=V!=null?V:E.dsr.dashboardTitle)!=null?u:"Data Subject Request Dashboard",_=(v=M!=null?M:E.dsr.dashboardDescription)!=null?v:"Track and manage data subject requests in compliance with NDPA Part IV requirements.",[f,y]=react.useState(null),[D,q]=react.useState(w),[T,K]=react.useState("all"),[P,$]=react.useState("all"),[A,H]=react.useState(""),[F,ae]=react.useState("createdAt"),[W,de]=react.useState("desc"),[S,re]=react.useState("");react.useEffect(()=>{let e=[...w];if(T!=="all"&&(e=e.filter(r=>r.status===T)),P!=="all"&&(e=e.filter(r=>r.type===P)),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(F){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 W==="asc"?h:-h}),q(e);},[w,T,P,A,F,W]),react.useEffect(()=>{D.length>0&&(f&&D.some(r=>r.id===f)||y(D[0].id));},[D,f]);let J=e=>{y(e),I&&I(e);},Y=e=>{f&&j&&j(f,e);},ie=()=>{f&&S&&C&&(C(f,S),re(""));},k=e=>new Date(e).toLocaleDateString(),z=e=>{let r=Date.now(),p=(e-r)/(1440*60*1e3);return Math.ceil(p)},m=f?w.find(e=>e.id===f):null,B=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",withdraw_consent:"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-200"},p={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making",withdraw_consent:"Withdraw Consent"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${r[e]}`,children:p[e]})},O=e=>jsxRuntime.jsx("span",{className:chunkAME4HJR4_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,R),children:e==="inProgress"?"In Progress":e==="awaitingVerification"?"Awaiting Verification":e.charAt(0).toUpperCase()+e.slice(1)}),t=e=>{if(!e.dueDate)return null;let r=z(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."]})]})},s=e=>{let r=[{title:"Request Received",date:e.createdAt,completed:true,description:`Request was received on ${k(e.createdAt)}.`}];return e.verifiedAt?r.push({title:"Identity Verified",date:e.verifiedAt,completed:true,description:`Data subject's identity was verified on ${k(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 ${k(e.updatedAt)}.`}),e.status==="completed"?r.push({title:"Request Completed",date:e.completedAt||Date.now(),completed:true,description:`Request was completed on ${k(e.completedAt||Date.now())}.`}):e.status==="rejected"&&r.push({title:"Request Rejected",date:e.completedAt||Date.now(),completed:true,description:`Request was rejected on ${k(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 ${k(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?k(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))})]})},g=()=>[{value:"all",label:"All Types"},{value:"information",label:"Information (NDPA Section 27)"},{value:"access",label:"Access (NDPA Section 34(1)(a))"},{value:"rectification",label:"Rectification (NDPA Section 34(1)(c))"},{value:"erasure",label:"Erasure (NDPA Section 34(1)(d))"},{value:"restriction",label:"Restriction (NDPA Section 34(1)(e))"},{value:"portability",label:"Portability (NDPA Section 38)"},{value:"objection",label:"Objection (NDPA Section 36)"},{value:"automated_decision_making",label:"Automated Decision-Making (NDPA Section 37)"},{value:"withdraw_consent",label:"Withdraw Consent (NDPA Section 35)"}].map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value)),x=()=>[{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)),o=()=>[{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:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${X}`,l==null?void 0:l.root,R),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",l==null?void 0:l.header,R),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("text-xl font-bold mb-2",l==null?void 0:l.title,R),children:te}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:_})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",l==null?void 0:l.filters,R),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:T,onChange:e=>K(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:x()})]}),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:P,onChange:e=>$(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:g()})]}),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:F,onChange:e=>ae(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=>H(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:chunkAME4HJR4_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",l==null?void 0:l.requestList,R),children:D.map(e=>{let r=e.dueDate?z(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":f===e.id,className:chunkAME4HJR4_js.a(`p-3 rounded-md cursor-pointer ${f===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,R),onClick:()=>J(e.id),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),J(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}),B(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: ",k(e.createdAt)]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:O(e.status)}),jsxRuntime.jsx("div",{children:p})]})]},e.id)})})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("md:col-span-2",l==null?void 0:l.detailPanel,R),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:[B(m.type),O(m.status)]})]}),U&&m.dueDate&&jsxRuntime.jsx("div",{className:"mb-4",children:t(m)}),Z&&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:"})," ",k(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:"})," ",k(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=>Y(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:o()}),jsxRuntime.jsx("button",{onClick:()=>Y(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))] ${L}`,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=>re(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:ie,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 ${L}`,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(chunkR2ZZMATR_js.b(m).formattedRequest,null,2)})})})]}),ee&&s(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 ke=({requests:w,onSelectRequest:I,title:j,description:C,className:V="",buttonClassName:M="",showSummaryStats:X=true,showTypeBreakdown:L=true,showStatusBreakdown:Z=true,showTimelineChart:ee=true,showOverdueRequests:U=true,classNames:i,unstyled:l=false})=>{var B,O;let R=chunkI5ZDNSX5_js.c(),E=(B=j!=null?j:R.dsr.trackerTitle)!=null?B:"DSR Request Tracker",te=(O=C!=null?C:R.dsr.trackerDescription)!=null?O:"Track the status and progress of data subject requests as required by NDPA Part IV.",[_,f]=react.useState("30days"),[y,D]=react.useState(w),[q,T]=react.useState([]),[K,P]=react.useState([]);react.useEffect(()=>{let t=Date.now(),s;switch(_){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");T(g);let x=s.filter(o=>o.dueDate&&t<o.dueDate&&o.dueDate-t<=10080*60*1e3&&o.status!=="completed"&&o.status!=="rejected");P(x);},[w,_]);let $=t=>{I&&I(t);},A=t=>new Date(t).toLocaleDateString(),H=t=>{let s=Date.now(),g=(t-s)/(1440*60*1e3);return Math.ceil(g)},F=()=>{let t=y.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))},ae=()=>{let t=y.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)},W=()=>{let t={};return y.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,withdraw_consent:t.withdraw_consent||0}},de=()=>{let t={};return y.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",withdraw_consent:"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-200"},g={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making",withdraw_consent:"Withdraw Consent"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${s[t]}`,children:g[t]})},J=()=>{let t=y.length,s=y.filter(u=>u.status!=="completed"&&u.status!=="rejected").length;y.filter(u=>u.status==="completed"||u.status==="rejected").length;let x=F(),o=ae();return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_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:chunkAME4HJR4_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:chunkAME4HJR4_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:chunkAME4HJR4_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:chunkAME4HJR4_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"})]})]})},Y=()=>{let t=W(),s=y.length,g=Object.entries(t).sort(([,x],[,o])=>o-x).map(([x])=>x);return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_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:chunkAME4HJR4_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)})})]})},ie=()=>{let t=de(),s=y.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:chunkAME4HJR4_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:chunkAME4HJR4_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)})})]})]})},k=()=>{let t={};y.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))})]})]})},z=()=>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"}),q.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:q.map(t=>jsxRuntime.jsxs("div",{role:"button",tabIndex:0,"aria-label":`View overdue request from ${t.subject.name}`,className:chunkAME4HJR4_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.id),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),$(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(H(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"}),K.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:K.map(t=>{let s=H(t.dueDate||0);return jsxRuntime.jsxs("div",{role:"button",tabIndex:0,"aria-label":`View upcoming deadline for ${t.subject.name}`,className:chunkAME4HJR4_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.id),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),$(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:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${V}`,i==null?void 0:i.root,l),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_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:chunkAME4HJR4_js.a("text-xl font-bold mb-2",i==null?void 0:i.title,l),children:E}),jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:te})]}),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:_,onChange:t=>f(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"})]})]})]}),X&&J(),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{children:[L&&Y(),Z&&ie()]}),jsxRuntime.jsxs("div",{children:[ee&&k(),U&&z(),U&&m()]})]})]})};exports.a=pe;exports.b=ke;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkFRHFIEWZ_js=require('./chunk-FRHFIEWZ.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),jsxRuntime=require('react/jsx-runtime');var q=[{id:"access",name:"Access My Data",description:"Request a copy of your personal data held by us",ndpaSection:"Section 34(1)(a)\u2013(b)",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"rectification",name:"Correct My Data",description:"Request corrections to inaccurate personal data",ndpaSection:"Section 34(1)(c)",estimatedCompletionTime:30,requiresAdditionalInfo:true,additionalFields:[{id:"correction_details",label:"What data needs to be corrected?",type:"textarea",required:true,placeholder:"Please describe the inaccurate data and what the correct information should be"}]},{id:"erasure",name:"Delete My Data",description:"Request deletion of your personal data",ndpaSection:"Section 34(1)(d), Section 34(2)",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"portability",name:"Export My Data",description:"Receive your data in a portable format",ndpaSection:"Section 38",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"restrict",name:"Restrict Processing",description:"Request restriction of data processing",ndpaSection:"Section 34(1)(e)",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"object",name:"Object to Processing",description:"Object to processing of your personal data",ndpaSection:"Section 36",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"withdraw_consent",name:"Withdraw My Consent",description:"Withdraw consent previously given for processing",ndpaSection:"Section 35",estimatedCompletionTime:30,requiresAdditionalInfo:false}],C=({requestTypes:R=q,adapter:s,classNames:y,unstyled:S,onSubmit:u=()=>{},submitTo:n,submitOptions:e,onSubmitError:t,onSubmitSuccess:r})=>jsxRuntime.jsx(chunkFRHFIEWZ_js.a,{requestTypes:R,onSubmit:a=>chunkRFPLZDIO_js.d(null,null,function*(){var d,c;if(n){let h=typeof(e==null?void 0:e.headers)=="function"?e.headers():(d=e==null?void 0:e.headers)!=null?d:{};try{let o=yield fetch(n,{method:"POST",headers:chunkRFPLZDIO_js.a({"Content-Type":"application/json"},h),credentials:(c=e==null?void 0:e.credentials)!=null?c:"same-origin",body:JSON.stringify(a)});if(!o.ok)t==null||t({response:o});else if(r){let l;try{let i=yield o.clone().text();i&&(l=JSON.parse(i));}catch(i){}r({response:o,data:a,body:l});}}catch(o){t==null||t({error:o});}}else s&&s.save(a);u(a);}),classNames:y,unstyled:S});exports.a=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkPXUX4FYM_js=require('./chunk-PXUX4FYM.js'),jsxRuntime=require('react/jsx-runtime');var m=[{id:"essential",label:"Essential Cookies",description:"Required for basic site functionality. Cannot be disabled.",required:true,purpose:"Site operation"},{id:"analytics",label:"Analytics",description:"Help us understand how visitors use our site to improve the experience.",required:false,purpose:"Usage analytics"},{id:"marketing",label:"Marketing",description:"Used to deliver relevant advertisements and track campaign effectiveness.",required:false,purpose:"Targeted advertising"},{id:"preferences",label:"Preferences",description:"Remember your settings and preferences for a personalised experience.",required:false,purpose:"Personalisation"}],g=({options:t,adapter:n,position:a="bottom",classNames:o,unstyled:l,onSave:s,copy:e})=>{let d=t!=null?t:m;return jsxRuntime.jsx(chunkPXUX4FYM_js.a,{options:d,onSave:i=>{n&&n.save(i),s==null||s(i);},position:a,classNames:o,unstyled:l,manageStorage:!n,title:e==null?void 0:e.title,description:e==null?void 0:e.description,acceptAllButtonText:e==null?void 0:e.acceptAll,rejectAllButtonText:e==null?void 0:e.rejectAll,customizeButtonText:e==null?void 0:e.customize,saveButtonText:e==null?void 0:e.save})};exports.a=g;
|