@tantainnovative/ndpr-toolkit 2.4.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +226 -246
- package/dist/BreachReportForm-DpRrBoxU.d.ts +158 -0
- package/dist/BreachReportForm-yJ2Zl6gz.d.mts +158 -0
- package/dist/ConsentBanner-CDRT0o2k.d.mts +146 -0
- package/dist/ConsentBanner-Vxyt8SCX.d.ts +146 -0
- package/dist/{cross-border-entry-BrWVPly6.d.ts → CrossBorderTransferManager-D5Lc0e46.d.ts} +4 -5
- package/dist/{cross-border-entry-cCTvpwnT.d.mts → CrossBorderTransferManager-DkZhv9vD.d.mts} +4 -5
- package/dist/DPIAQuestionnaire-BkejviPj.d.mts +123 -0
- package/dist/DPIAQuestionnaire-DdSqXG3x.d.ts +123 -0
- package/dist/DSRRequestForm-BY8PogCU.d.mts +146 -0
- package/dist/DSRRequestForm-CHUg9cZh.d.ts +146 -0
- package/dist/DSRTracker-C6u_jAaK.d.mts +163 -0
- package/dist/DSRTracker-Dr_aT0pg.d.ts +163 -0
- package/dist/{lawful-basis-entry-CxZrofwG.d.mts → LawfulBasisTracker-CBqOxX1D.d.mts} +3 -5
- package/dist/{lawful-basis-entry-15qjKcNO.d.ts → LawfulBasisTracker-Cg30NbDA.d.ts} +3 -5
- package/dist/NDPRDashboard-CLJpEg0X.d.mts +44 -0
- package/dist/NDPRDashboard-DDWNd2Ah.d.ts +44 -0
- package/dist/{policy-E0fXZkda.d.mts → PolicyExporter-Bgi6nz82.d.mts} +5 -7
- package/dist/{policy-D2_jh5-T.d.ts → PolicyExporter-BnvuFncj.d.ts} +5 -7
- package/dist/{ropa-entry-B0D7X1GV.d.ts → ROPAManager-BS4eB8Hw.d.mts} +4 -5
- package/dist/{ropa-entry-DiOThOc2.d.mts → ROPAManager-qxTrXLkD.d.ts} +4 -5
- package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +282 -0
- package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +282 -0
- package/dist/StepIndicator-D-nwRTyo.d.mts +171 -0
- package/dist/StepIndicator-D9ZATz_O.d.ts +171 -0
- package/dist/adapters.d.mts +25 -0
- package/dist/adapters.d.ts +25 -0
- package/dist/adapters.js +2 -0
- package/dist/adapters.mjs +2 -0
- package/dist/breach.d.mts +36 -431
- package/dist/breach.d.ts +36 -431
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-27NYSWUG.mjs +2 -0
- package/dist/chunk-2ORDHJRD.js +2 -0
- package/dist/chunk-2W7ARAW2.js +2 -0
- package/dist/chunk-3F34NACG.js +2 -0
- package/dist/chunk-3UWT64FI.mjs +2 -0
- package/dist/chunk-3V23O4ZJ.js +2 -0
- package/dist/chunk-3XAUN5IM.mjs +3 -0
- package/dist/chunk-44W4H2EY.js +2 -0
- package/dist/chunk-5VMHKNJY.js +2 -0
- package/dist/chunk-6D3ZUGBB.mjs +2 -0
- package/dist/chunk-6E54NSAO.mjs +2 -0
- package/dist/chunk-7F5F5YWI.mjs +2 -0
- package/dist/chunk-DQLDX5X6.js +316 -0
- package/dist/chunk-FR7ZYZXB.js +2 -0
- package/dist/chunk-FY5G6DGZ.js +7 -0
- package/dist/chunk-G26I6MP5.mjs +2 -0
- package/dist/chunk-GCQRHMTQ.mjs +144 -0
- package/dist/chunk-GPJVTGHR.mjs +2 -0
- package/dist/chunk-GVANK6PL.js +3 -0
- package/dist/chunk-HNZK7LY3.mjs +2 -0
- package/dist/chunk-IKEPXHCZ.js +2 -0
- package/dist/chunk-IQQW52EF.js +2 -0
- package/dist/chunk-ISSGO2YT.mjs +72 -0
- package/dist/chunk-JZKH5RMC.js +3 -0
- package/dist/chunk-KHRBU5K7.js +2 -0
- package/dist/chunk-LFNA6WYQ.mjs +2 -0
- package/dist/chunk-LU4PFST7.js +144 -0
- package/dist/chunk-NPI5T6NH.mjs +7 -0
- package/dist/chunk-NPLXE43Q.mjs +2 -0
- package/dist/chunk-P7BSBCB3.js +2 -0
- package/dist/chunk-PEH5GIMN.js +2 -0
- package/dist/chunk-RSUDIFZV.mjs +2 -0
- package/dist/chunk-SBNAMPAP.mjs +2 -0
- package/dist/chunk-SVCRYM4I.mjs +2 -0
- package/dist/chunk-TKBZRULW.mjs +316 -0
- package/dist/chunk-TVW6KBVV.mjs +2 -0
- package/dist/chunk-U6VWHC46.js +72 -0
- package/dist/chunk-UK656RCG.js +2 -0
- package/dist/chunk-UNKXYVXY.js +2 -0
- package/dist/chunk-UOSEH6DC.js +2 -0
- package/dist/chunk-V37BM2LF.js +2 -0
- package/dist/chunk-V3MXWGXU.mjs +2 -0
- package/dist/chunk-VDZKGCAF.js +2 -0
- package/dist/chunk-WLSW4Z4W.mjs +2 -0
- package/dist/chunk-XSK4BSZJ.mjs +2 -0
- package/dist/chunk-YJCGEOLO.mjs +2 -0
- package/dist/chunk-ZCZ5RRZO.js +2 -0
- package/dist/chunk-ZQSX5ZHB.mjs +3 -0
- package/dist/compliance-score-racQe_E_.d.mts +115 -0
- package/dist/compliance-score-racQe_E_.d.ts +115 -0
- package/dist/consent.d.mts +67 -295
- package/dist/consent.d.ts +67 -295
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +14 -48
- package/dist/core.d.ts +14 -48
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border-BBi9rZyO.d.mts +54 -0
- package/dist/cross-border-Dy-U9Hu6.d.ts +54 -0
- package/dist/{cross-border-BMcqLvjC.d.mts → cross-border-UyT00llA.d.mts} +1 -52
- package/dist/{cross-border-BMcqLvjC.d.ts → cross-border-UyT00llA.d.ts} +1 -52
- package/dist/cross-border.d.mts +32 -4
- package/dist/cross-border.d.ts +32 -4
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dpia.d.mts +28 -284
- package/dist/dpia.d.ts +28 -284
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.d.mts +29 -300
- package/dist/dsr.d.ts +29 -300
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +23 -10
- package/dist/hooks.d.ts +23 -10
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +28 -19
- package/dist/index.d.ts +28 -19
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.d.mts +31 -4
- package/dist/lawful-basis.d.ts +31 -4
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy-engine-C-tShzZH.d.mts +154 -0
- package/dist/policy-engine-DSQpT55_.d.ts +154 -0
- package/dist/policy-sections-CfNVBLCh.d.mts +54 -0
- package/dist/policy-sections-DqH0iZRf.d.ts +54 -0
- package/dist/policy.d.mts +117 -4
- package/dist/policy.d.ts +117 -4
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +114 -0
- package/dist/presets.d.ts +114 -0
- package/dist/presets.js +2 -0
- package/dist/presets.mjs +2 -0
- package/dist/{ropa-Li6UlL5H.d.ts → ropa-BDTM06tr.d.ts} +1 -49
- package/dist/{ropa-DP7pPPql.d.mts → ropa-CFHuT7jE.d.mts} +1 -49
- package/dist/ropa-CyynscU6.d.ts +51 -0
- package/dist/ropa-NIgxd8uP.d.mts +51 -0
- package/dist/ropa.d.mts +30 -4
- package/dist/ropa.d.ts +30 -4
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/sanitize-9mOO_cJW.d.mts +147 -0
- package/dist/sanitize-9mOO_cJW.d.ts +147 -0
- package/dist/styling-B7CBzYG7.d.ts +165 -0
- package/dist/styling-uJLsBbER.d.mts +165 -0
- package/dist/types-DK2CoKOC.d.mts +10 -0
- package/dist/types-DK2CoKOC.d.ts +10 -0
- package/dist/unstyled.d.mts +4 -4
- package/dist/unstyled.d.ts +4 -4
- package/dist/useAdaptivePolicyWizard-B9Op2gYM.d.ts +52 -0
- package/dist/useAdaptivePolicyWizard-N4eUM4Tj.d.mts +52 -0
- package/dist/{useBreach-BBSoIcZO.d.mts → useBreach-CPr86Yan.d.mts} +18 -2
- package/dist/{useBreach-lFLbSyAN.d.ts → useBreach-DkVXvtJK.d.ts} +18 -2
- package/dist/{useConsent-D0pAfTlb.d.ts → useConsent-DCNkIJHR.d.mts} +12 -2
- package/dist/{useConsent-DOt2Njst.d.mts → useConsent-dOcELSfX.d.ts} +12 -2
- package/dist/{useCrossBorderTransfer-DmtACeqW.d.ts → useCrossBorderTransfer-BGNZt2lk.d.mts} +15 -3
- package/dist/{useCrossBorderTransfer-BZVFCXfr.d.mts → useCrossBorderTransfer-COqjgjsu.d.ts} +15 -3
- package/dist/{useDPIA-DBsg2yZx.d.ts → useDPIA-Dl16Te3r.d.ts} +13 -2
- package/dist/{useDPIA-Da7-Q_yW.d.mts → useDPIA-DzWye8JB.d.mts} +13 -2
- package/dist/{useDSR-YYZ6FYFs.d.mts → useDSR-C1LksCfP.d.mts} +13 -2
- package/dist/{useDSR-CYI7WCXr.d.ts → useDSR-DZel52O1.d.ts} +13 -2
- package/dist/{useDefaultPrivacyPolicy-CUluF_ic.d.mts → useDefaultPrivacyPolicy-BsYttRey.d.mts} +13 -2
- package/dist/{useDefaultPrivacyPolicy-B7kTHbZh.d.ts → useDefaultPrivacyPolicy-C-mG-A5S.d.ts} +13 -2
- package/dist/{useLawfulBasis-CpWuHtyh.d.mts → useLawfulBasis-CKJ-kw84.d.mts} +13 -2
- package/dist/{useLawfulBasis-CCWF9waR.d.ts → useLawfulBasis-DFTmu1ca.d.ts} +13 -2
- package/dist/{useROPA-BhJ3kvHp.d.ts → useROPA-BSSU1rfx.d.ts} +14 -2
- package/dist/{useROPA-DLFdjkxP.d.mts → useROPA-C2hjaBTz.d.mts} +14 -2
- package/package.json +24 -3
- package/dist/chunk-2XFAV267.mjs +0 -2
- package/dist/chunk-32UIWTGD.js +0 -72
- package/dist/chunk-3YCV2BA6.js +0 -2
- package/dist/chunk-4A354HL3.js +0 -2
- package/dist/chunk-5ZBO2UPH.js +0 -2
- package/dist/chunk-6GGGTRDZ.mjs +0 -2
- package/dist/chunk-BZTTQS4A.mjs +0 -7
- package/dist/chunk-EKVTLHBQ.js +0 -2
- package/dist/chunk-GMLNWS2N.mjs +0 -2
- package/dist/chunk-IBEKLDBY.mjs +0 -2
- package/dist/chunk-ILCNDOBU.js +0 -2
- package/dist/chunk-K3GMTMQ6.js +0 -2
- package/dist/chunk-L52PDW6O.mjs +0 -2
- package/dist/chunk-LI6WJ3LZ.js +0 -2
- package/dist/chunk-LXRXDTPI.js +0 -2
- package/dist/chunk-NW4A3JW6.mjs +0 -2
- package/dist/chunk-OITITR6K.mjs +0 -2
- package/dist/chunk-PDJGTQMY.mjs +0 -2
- package/dist/chunk-T44JQT2O.mjs +0 -2
- package/dist/chunk-TCJCE6WN.js +0 -2
- package/dist/chunk-VMJBW3EF.mjs +0 -2
- package/dist/chunk-WSHSHIIM.mjs +0 -2
- package/dist/chunk-WW3X3ELF.js +0 -2
- package/dist/chunk-XMYUYQH7.mjs +0 -72
- package/dist/chunk-ZNTMZ6NM.js +0 -7
- package/dist/chunk-ZU73VG3X.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$2}from'./chunk-FXTZDKDC.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var lr=({requestTypes:I,onSubmit:Q,onValidationError:q,title:X="Submit a Data Subject Request",description:V="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitButtonText:s="Submit Request",className:A="",buttonClassName:D="",showConfirmation:N=true,confirmationMessage:rr="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:_=true,identifierTypes:k=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:er=true,labels:y={},classNames:r,unstyled:o=false,isSubmitting:f=false,defaultValues:g,onReset:S})=>{var G,Y,H,L,U,W;let[c,P]=useState((g==null?void 0:g.requestType)||""),[R,j]=useState(((G=g==null?void 0:g.dataSubject)==null?void 0:G.fullName)||""),[x,E]=useState(((Y=g==null?void 0:g.dataSubject)==null?void 0:Y.email)||""),[F,O]=useState(((H=g==null?void 0:g.dataSubject)==null?void 0:H.phone)||""),[B,z]=useState(((L=g==null?void 0:g.dataSubject)==null?void 0:L.identifierType)||((U=k[0])==null?void 0:U.id)||""),[T,M]=useState(((W=g==null?void 0:g.dataSubject)==null?void 0:W.identifierValue)||""),[b$1,w]=useState((g==null?void 0:g.additionalInfo)||{}),[ir,$]=useState(false),[d,Z]=useState({}),tr=()=>{var e;P(""),j(""),E(""),O(""),z(((e=k[0])==null?void 0:e.id)||""),M(""),w({}),$(false),Z({}),S==null||S();},u=I.find(e=>e.id===c),or=e=>{P(e.target.value),w({});},v=(e,a)=>{w(l=>b(a$1({},l),{[e]:a}));},nr=()=>{let e={};return R.trim()||(e.fullName="Full name is required"),x.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(x)||(e.email="Email is invalid"):e.email="Email is required",c||(e.requestType="Please select a request type"),_&&!T.trim()&&(e.identifierValue="Identifier value is required"),u!=null&&u.requiresAdditionalInfo&&u.additionalFields&&u.additionalFields.forEach(a=>{a.required&&!b$1[a.id]&&(e[`additional_${a.id}`]=`${a.label} is required`);}),Z(e),e},dr=e=>{e.preventDefault();let a=nr();if(Object.keys(a).length>0){q==null||q(a);return}let l=Object.keys(b$1).length>0?Object.fromEntries(Object.entries(b$1).map(([ar,C])=>[ar,typeof C=="string"?a$2(C):C])):void 0,h={requestType:c,dataSubject:{fullName:a$2(R),email:a$2(x),phone:F?a$2(F):void 0,identifierType:B,identifierValue:a$2(T)},additionalInfo:l,submittedAt:Date.now()};Q(h),N&&$(true);};return ir?jsxs("div",{className:a(`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${A}`,r==null?void 0:r.successMessage,o),children:[jsx("h2",{className:a("text-lg font-bold text-green-800 dark:text-green-200 mb-2",r==null?void 0:r.title,o),children:"Request Submitted"}),jsx("p",{className:a("text-green-700 dark:text-green-300",r==null?void 0:r.description,o),children:rr}),jsx("button",{onClick:()=>$(false),className:a(`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${D}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Submit Another Request"})]}):jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${A}`,r==null?void 0:r.root,o),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:X}),jsx("p",{className:a("mb-6 text-gray-600 dark:text-gray-300",r==null?void 0:r.description,o),children:V}),jsx("form",{onSubmit:dr,className:a("",r==null?void 0:r.form,o),children:jsxs("div",{className:a("space-y-4",r==null?void 0:r.fieldGroup,o),children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Personal Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"fullName",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.name||"Full Name"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"fullName",value:R,onChange:e=>j(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-invalid":!!d.fullName,"aria-describedby":d.fullName?"fullName-error":void 0}),d.fullName&&jsx("p",{id:"fullName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.fullName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"email",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.email||"Email Address"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",id:"email",value:x,onChange:e=>E(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-invalid":!!d.email,"aria-describedby":d.email?"email-error":void 0}),d.email&&jsx("p",{id:"email-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.email})]}),er&&jsxs("div",{children:[jsx("label",{htmlFor:"phone",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:"Phone Number (Optional)"}),jsx("input",{type:"tel",id:"phone",value:F,onChange:e=>O(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Request Details"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"requestType",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.requestType||"Request Type"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"requestType",value:c,onChange:or,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,"aria-invalid":!!d.requestType,"aria-describedby":d.requestType?"requestType-error":void 0,children:[jsx("option",{value:"",children:"Select a request type"}),I.map(e=>jsx("option",{value:e.id,children:e.name},e.id))]}),d.requestType&&jsx("p",{id:"requestType-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.requestType})]}),u&&jsxs("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:u.description}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Estimated completion time: ",u.estimatedCompletionTime," ",u.estimatedCompletionTime===1?"day":"days"]})]}),jsxs("div",{className:"mb-4",children:[jsx("label",{htmlFor:"requestDescription",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:y.description||"Additional Information"}),jsx("textarea",{id:"requestDescription",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),_&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Identity Verification"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"identifierType",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Type ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{id:"identifierType",value:B,onChange:e=>z(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,children:k.map(e=>jsx("option",{value:e.id,children:e.label},e.id))})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"identifierValue",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Value ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"identifierValue",value:T,onChange:e=>M(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-invalid":!!d.identifierValue,"aria-describedby":d.identifierValue?"identifierValue-error":void 0}),d.identifierValue&&jsx("p",{id:"identifierValue-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.identifierValue})]})]})]}),(u==null?void 0:u.requiresAdditionalInfo)&&u.additionalFields&&u.additionalFields.length>0&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsx("div",{className:"space-y-4",children:u.additionalFields.map(e=>jsxs("div",{children:[jsxs("label",{htmlFor:e.id,className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[e.label," ",e.required&&jsx("span",{className:"text-red-500",children:"*"})]}),e.type==="text"&&jsx("input",{type:"text",id:e.id,value:b$1[e.id]||"",onChange:a=>v(e.id,a.target.value),placeholder:e.placeholder,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="textarea"&&jsx("textarea",{id:e.id,value:b$1[e.id]||"",onChange:a=>v(e.id,a.target.value),placeholder:e.placeholder,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="select"&&e.options&&jsxs("select",{id:e.id,value:b$1[e.id]||"",onChange:a=>v(e.id,a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0,children:[jsx("option",{value:"",children:e.placeholder||"Select an option"}),e.options.map(a=>jsx("option",{value:a,children:a},a))]}),e.type==="checkbox"&&jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{type:"checkbox",id:e.id,checked:!!b$1[e.id],onChange:a=>v(e.id,a.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0})}),jsx("div",{className:"ml-3 text-sm",children:jsx("label",{htmlFor:e.id,className:"text-gray-700 dark:text-gray-300",children:e.placeholder||e.label})})]}),e.type==="file"&&jsx("input",{type:"file",id:e.id,onChange:a=>{var h;let l=(h=a.target.files)==null?void 0:h[0];l&&v(e.id,l);},className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),d[`additional_${e.id}`]&&jsx("p",{id:`additional-${e.id}-error`,role:"alert",className:"mt-1 text-sm text-red-500",children:d[`additional_${e.id}`]})]},e.id))})]}),jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-sm font-semibold mb-2",children:"Privacy Notice"}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxs("div",{className:"mt-6 flex gap-3 relative",children:[f&&(r==null?void 0:r.loadingOverlay)&&jsx("div",{className:r.loadingOverlay}),jsx("button",{type:"submit",disabled:f,className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${D} ${f?"opacity-50 cursor-not-allowed":""}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:f?"Submitting...":y.submit||s}),jsx("button",{type:"button",onClick:tr,className:a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,o),children:"Reset"})]})]})})]})};export{lr as a};//# sourceMappingURL=chunk-6D3ZUGBB.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-6D3ZUGBB.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a,d}from'./chunk-CAB7O3GR.mjs';import {a as a$2}from'./chunk-SBNAMPAP.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect}from'react';function _(f,s){return s?a$2(f):{load:()=>null,save:()=>{},remove:()=>{}}}function z({templates:f,initialPolicy:s,adapter:y,storageKey:T="ndpr_privacy_policy",useLocalStorage:I=true,onGenerate:p}){let P=y!=null?y:_(T,I),o=useRef(P);o.current=P;let[a$2,d]=useState(s||null),[u,g]=useState(null),[m,h]=useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[w,v]=useState(true);useEffect(()=>{if(s){v(false);return}let e=false;try{let n=o.current.load(),i=t=>{if(t){if(d(t),t.templateId){let l=f.find(U=>U.id===t.templateId);l&&g(l);}t.organizationInfo&&h(t.organizationInfo);}v(!1);};n instanceof Promise?n.then(t=>{e||i(t);},()=>{e||v(!1);}):i(n);}catch(n){e||v(false);}return ()=>{e=true;}},[s,f]);let x=e=>{Promise.resolve(o.current.save(e)).catch(n=>{console.warn("[ndpr-toolkit] Failed to save policy:",n);});},E=e=>{let n=f.find(l=>l.id===e);if(!n)return false;g(n);n.sections.map(l=>b(a$1({},l),{customContent:void 0}));return Object.keys(n.variables).forEach(l=>{n.variables[l].defaultValue||"";}),true},q=e=>{h(n=>a$1(a$1({},n),e));},N=(e,n)=>{u&&(a$2?d(i=>i&&b(a$1({},i),{sections:i.sections.map(t=>t.id===e?b(a$1({},t),{included:n}):t)})):g(i=>i&&b(a$1({},i),{sections:i.sections.map(t=>t.id===e?b(a$1({},t),{included:n}):t)})));},D=(e,n)=>{u&&(a$2?d(i=>i&&b(a$1({},i),{sections:i.sections.map(t=>t.id===e?b(a$1({},t),{customContent:n}):t)})):g(i=>i&&b(a$1({},i),{sections:i.sections.map(t=>t.id===e?b(a$1({},t),{customContent:n}):t)})));},C=(e,n)=>{a$2&&d(i=>i&&b(a$1({},i),{variableValues:b(a$1({},i.variableValues),{[e]:n})}));},R=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {policy:a$2,selectedTemplate:u,organizationInfo:m,selectTemplate:E,updateOrganizationInfo:q,toggleSection:N,updateSectionContent:D,updateVariableValue:C,generatePolicy:()=>{if(!u)throw new Error("No template selected");let e=Date.now(),n={id:(a$2==null?void 0:a$2.id)||R(),title:`Privacy Policy for ${m.name}`,templateId:u.id,organizationInfo:m,sections:u.sections.map(i=>{var t;return b(a$1({},i),{customContent:(t=a$2==null?void 0:a$2.sections.find(l=>l.id===i.id))==null?void 0:t.customContent})}),variableValues:(a$2==null?void 0:a$2.variableValues)||{},effectiveDate:e,lastUpdated:e,version:"1.0"};return d(n),x(n),p&&p(n),n},getPolicyText:()=>{if(!a$2)return {fullText:"",sectionTexts:{},missingVariables:[]};let e=a(a$2.sections,a$2.organizationInfo);return typeof e=="string"?{fullText:e,sectionTexts:{full:e},missingVariables:[]}:e},resetPolicy:()=>{d(null),g(null),h({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(o.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove policy:",e);});},isValid:()=>{let e=[];if(u||e.push("No template selected"),m.name||e.push("Organization name is required"),m.website||e.push("Organization website is required"),m.privacyEmail||e.push("Privacy contact email is required"),u){let n=u.sections.filter(t=>t.required),i=(a$2==null?void 0:a$2.sections.filter(t=>t.included))||[];n.forEach(t=>{i.some(l=>l.id===t.id)||e.push(`Required section "${t.title}" must be included`);});}return u&&a$2&&Object.entries(u.variables).forEach(([n,i])=>{i.required&&!a$2.variableValues[n]&&e.push(`Required variable "${i.name}" must have a value`);}),{valid:e.length===0,errors:e}},isLoading:w}}function W(f={}){let{orgInfo:s,storageKey:y,useLocalStorage:T}=f,{sections:I,variables:p}=d();if(s)for(let o of p)s.name&&o.name==="orgName"&&(o.value=s.name),s.email&&o.name==="privacyEmail"&&(o.value=s.email),s.dpoName&&o.name==="dpoName"&&(o.value=s.dpoName);let P={id:"default-business",name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:I,variables:Object.fromEntries(p.map(o=>[o.name,{name:o.name,description:o.description,required:o.required,defaultValue:o.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true};return z({templates:[P],storageKey:y,useLocalStorage:T})}export{z as a,W as b};//# sourceMappingURL=chunk-6E54NSAO.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-6E54NSAO.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-AYKLAEOU.mjs';import {a,b}from'./chunk-WWT2ZSNU.mjs';import {useState,useRef,useCallback,useEffect}from'react';import {createPortal}from'react-dom';import {jsx,jsxs}from'react/jsx-runtime';var lt=({options:d,onSave:J,title:M="We Value Your Privacy",description:W="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.",acceptAllButtonText:Y="Accept All",rejectAllButtonText:K="Reject All",customizeButtonText:Q="Customize",saveButtonText:U="Save Preferences",position:A="bottom",zIndex:T=9999,version:f="1.0",show:p,manageStorage:R=true,storageKey:E="ndpr_consent",className:X="",buttonClassName:y="",primaryButtonClassName:q="",secondaryButtonClassName:Z="",classNames:t,unstyled:o,onAnalytics:h})=>{let[g,u]=useState(false),[v,a$2]=useState(false),[C,B]=useState({}),z=useRef(null),$=useRef(null),j=useRef(false),b$1=useCallback((e,n)=>{h==null||h(a({action:e,timestamp:Date.now(),version:f},n!==void 0?{categories:n}:{}));},[h,f]);useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),B(e),p===void 0)if(!R)u(true);else {let n=localStorage.getItem(E);if(n)try{JSON.parse(n).version!==f?u(!0):u(!1);}catch(D){u(true);}else u(true);}else u(p);},[d,E,f,R]),useEffect(()=>{p!==void 0&&u(p);},[p]);let s=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),b$1("accepted_all",e),P(e);},N=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),b$1("rejected_all",e),P(e);},tt=(e,n)=>{B(D=>b(a({},D),{[e]:n}));},et=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),B(e);},nt=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),B(e);},H=d.length>0&&d.every(e=>C[e.id]),rt=()=>{b$1("customized",C),P(C);},P=e=>{let n={consents:e,timestamp:Date.now(),version:f,method:v?"customize":"banner",hasInteracted:true};R&&localStorage.setItem(E,JSON.stringify(n)),J(n),u(false),a$2(false);},_=useCallback(()=>{b$1("dismissed"),u(false),a$2(false);},[b$1]);if(useEffect(()=>{if(!g)return;let e=n=>{n.key==="Escape"&&_();};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[g,_]),useEffect(()=>{g&&!j.current&&(j.current=true,b$1("shown")),g||(j.current=false);},[g,b$1]),useEffect(()=>{g&&z.current&&z.current.focus();},[g]),useEffect(()=>{if(v&&$.current){let e=$.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[v]),!g)return null;let ot=(t==null?void 0:t.primaryButton)||(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y} ${q}`,m=(t==null?void 0:t.secondaryButton)||(t==null?void 0:t.rejectButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${y} ${Z}`,it=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${y}`,dt=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y} ${q}`,k=A==="inline",w=A==="center",x;k||w?x="":A==="top"?x="fixed inset-x-0 top-0":x="fixed inset-x-0 bottom-0";let S=jsx("div",{ref:z,tabIndex:-1,"data-ndpr-component":"consent-banner",className:a$1(`${k?"":x} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${w?"max-w-lg w-full":""} ${X}`,t==null?void 0:t.root,o),style:!k&&!w?{zIndex:T}:void 0,role:"dialog","aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxs("div",{className:a$1("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsx("h2",{id:"consent-banner-title",className:a$1("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:M}),jsx("p",{id:"consent-banner-description",className:a$1("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:W}),v&&jsxs("div",{ref:$,className:a$1("mb-4 p-3 sm:p-4 rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",t==null?void 0:t.customizePanel,o),style:{overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out"},children:[jsx("div",{className:"mb-3 flex items-center justify-end",children:jsx("button",{type:"button",onClick:H?nt:et,className:a$1("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:H?"Deselect All":"Select All"})}),jsx("div",{className:a$1("space-y-3",t==null?void 0:t.optionsList,o),children:d.map(e=>jsxs("div",{className:a$1("flex items-start",t==null?void 0:t.optionItem,o),children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`consent-${e.id}`,type:"checkbox",checked:C[e.id]||false,onChange:n=>tt(e.id,n.target.checked),disabled:e.required,className:a$1("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,o)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:`consent-${e.id}`,className:a$1("font-medium",t==null?void 0:t.optionLabel,o),children:[e.label," ",e.required&&jsx("span",{className:"text-red-500",children:"*"})]}),jsx("p",{className:a$1("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:e.description})]})]},e.id))}),jsxs("div",{className:a$1("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:rt,className:a$1(dt,t==null?void 0:t.saveButton,o),children:U}),jsx("button",{onClick:()=>a$2(false),className:a$1(m,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!v&&jsxs("div",{className:a$1("flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:s,className:a$1(ot,t==null?void 0:t.acceptButton,o),children:Y}),jsx("button",{onClick:N,className:a$1(m,t==null?void 0:t.rejectButton,o),children:K}),jsx("button",{onClick:()=>a$2(true),className:a$1(it,t==null?void 0:t.customizeButton,o),children:Q})]}),jsx("div",{className:a$1("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(k)return S;if(w){let e=jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:T},children:[jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsx("div",{className:"relative",children:S})]});return typeof document!="undefined"?createPortal(e,document.body):e}return typeof document!="undefined"?createPortal(S,document.body):S};export{lt as a};//# sourceMappingURL=chunk-7F5F5YWI.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-7F5F5YWI.mjs.map
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
'use strict';var chunkLU4PFST7_js=require('./chunk-LU4PFST7.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function R(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function le(r){return r.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function Ne(r){let m=r.split(`
|
|
2
|
+
`),v=[],e=false;for(let a of m){let s=a.trimEnd();s.startsWith("- ")||s.startsWith("\u2022 ")?(e||(v.push("<ul>"),e=true),v.push(` <li>${R(s.replace(/^[-•]\s*/,""))}</li>`)):(e&&(v.push("</ul>"),e=false),s.trim()===""||v.push(`<p>${R(s)}</p>`));}return e&&v.push("</ul>"),v.join(`
|
|
3
|
+
`)}var Ie=`
|
|
4
|
+
/* \u2500\u2500 Reset & Base \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
6
|
+
|
|
7
|
+
/* \u2500\u2500 Design tokens \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
8
|
+
:root {
|
|
9
|
+
--color-bg: #ffffff;
|
|
10
|
+
--color-surface: #f9fafb;
|
|
11
|
+
--color-border: #e5e7eb;
|
|
12
|
+
--color-text: #111827;
|
|
13
|
+
--color-text-muted: #6b7280;
|
|
14
|
+
--color-accent: #16a34a;
|
|
15
|
+
--color-accent-light: #dcfce7;
|
|
16
|
+
--color-heading: #064e3b;
|
|
17
|
+
--color-link: #15803d;
|
|
18
|
+
--color-link-hover: #166534;
|
|
19
|
+
--font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
20
|
+
--font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
|
|
21
|
+
--radius: 8px;
|
|
22
|
+
--shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
23
|
+
--max-width: 860px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (prefers-color-scheme: dark) {
|
|
27
|
+
:root {
|
|
28
|
+
--color-bg: #0f172a;
|
|
29
|
+
--color-surface: #1e293b;
|
|
30
|
+
--color-border: #334155;
|
|
31
|
+
--color-text: #f1f5f9;
|
|
32
|
+
--color-text-muted: #94a3b8;
|
|
33
|
+
--color-accent: #22c55e;
|
|
34
|
+
--color-accent-light: #14532d;
|
|
35
|
+
--color-heading: #86efac;
|
|
36
|
+
--color-link: #4ade80;
|
|
37
|
+
--color-link-hover: #86efac;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* \u2500\u2500 Layout \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
42
|
+
html { font-size: 16px; scroll-behavior: smooth; }
|
|
43
|
+
|
|
44
|
+
body {
|
|
45
|
+
font-family: var(--font-sans);
|
|
46
|
+
background: var(--color-bg);
|
|
47
|
+
color: var(--color-text);
|
|
48
|
+
line-height: 1.7;
|
|
49
|
+
padding: 2rem 1.25rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.policy-wrapper {
|
|
53
|
+
max-width: var(--max-width);
|
|
54
|
+
margin: 0 auto;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* \u2500\u2500 Header \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
58
|
+
.policy-header {
|
|
59
|
+
background: var(--color-surface);
|
|
60
|
+
border: 1px solid var(--color-border);
|
|
61
|
+
border-radius: var(--radius);
|
|
62
|
+
padding: 2.5rem 2.5rem 2rem;
|
|
63
|
+
margin-bottom: 2rem;
|
|
64
|
+
box-shadow: var(--shadow);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.policy-header h1 {
|
|
68
|
+
font-size: 2rem;
|
|
69
|
+
font-weight: 700;
|
|
70
|
+
color: var(--color-heading);
|
|
71
|
+
line-height: 1.2;
|
|
72
|
+
margin-bottom: 0.75rem;
|
|
73
|
+
letter-spacing: -0.025em;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.policy-meta {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
gap: 0.5rem 1.5rem;
|
|
80
|
+
font-size: 0.875rem;
|
|
81
|
+
color: var(--color-text-muted);
|
|
82
|
+
margin-top: 0.5rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.policy-meta span { white-space: nowrap; }
|
|
86
|
+
|
|
87
|
+
.compliance-badge {
|
|
88
|
+
display: inline-flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
gap: 0.35rem;
|
|
91
|
+
background: var(--color-accent-light);
|
|
92
|
+
color: var(--color-accent);
|
|
93
|
+
font-size: 0.75rem;
|
|
94
|
+
font-weight: 600;
|
|
95
|
+
padding: 0.25rem 0.75rem;
|
|
96
|
+
border-radius: 9999px;
|
|
97
|
+
margin-top: 1rem;
|
|
98
|
+
letter-spacing: 0.01em;
|
|
99
|
+
border: 1px solid var(--color-accent);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* \u2500\u2500 Navigation / TOC \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
103
|
+
.policy-toc {
|
|
104
|
+
background: var(--color-surface);
|
|
105
|
+
border: 1px solid var(--color-border);
|
|
106
|
+
border-left: 4px solid var(--color-accent);
|
|
107
|
+
border-radius: var(--radius);
|
|
108
|
+
padding: 1.5rem 2rem;
|
|
109
|
+
margin-bottom: 2.5rem;
|
|
110
|
+
box-shadow: var(--shadow);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.policy-toc h2 {
|
|
114
|
+
font-size: 1rem;
|
|
115
|
+
font-weight: 700;
|
|
116
|
+
text-transform: uppercase;
|
|
117
|
+
letter-spacing: 0.08em;
|
|
118
|
+
color: var(--color-text-muted);
|
|
119
|
+
margin-bottom: 1rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.policy-toc ol {
|
|
123
|
+
list-style: decimal;
|
|
124
|
+
padding-left: 1.25rem;
|
|
125
|
+
column-count: 1;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@media (min-width: 600px) {
|
|
129
|
+
.policy-toc ol { column-count: 2; column-gap: 2rem; }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.policy-toc li { margin-bottom: 0.35rem; break-inside: avoid; }
|
|
133
|
+
|
|
134
|
+
.policy-toc a {
|
|
135
|
+
color: var(--color-link);
|
|
136
|
+
text-decoration: none;
|
|
137
|
+
font-size: 0.9375rem;
|
|
138
|
+
transition: color 0.15s ease;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.policy-toc a:hover { color: var(--color-link-hover); text-decoration: underline; }
|
|
142
|
+
|
|
143
|
+
/* \u2500\u2500 Article / Sections \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
144
|
+
article.policy-body { display: flex; flex-direction: column; gap: 2.5rem; }
|
|
145
|
+
|
|
146
|
+
.policy-section {
|
|
147
|
+
background: var(--color-surface);
|
|
148
|
+
border: 1px solid var(--color-border);
|
|
149
|
+
border-radius: var(--radius);
|
|
150
|
+
padding: 2rem 2.5rem;
|
|
151
|
+
box-shadow: var(--shadow);
|
|
152
|
+
scroll-margin-top: 1.5rem;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.policy-section h2 {
|
|
156
|
+
font-size: 1.25rem;
|
|
157
|
+
font-weight: 700;
|
|
158
|
+
color: var(--color-heading);
|
|
159
|
+
margin-bottom: 1.25rem;
|
|
160
|
+
padding-bottom: 0.75rem;
|
|
161
|
+
border-bottom: 2px solid var(--color-accent-light);
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: baseline;
|
|
164
|
+
gap: 0.5rem;
|
|
165
|
+
line-height: 1.3;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.section-number {
|
|
169
|
+
font-size: 0.75rem;
|
|
170
|
+
font-weight: 700;
|
|
171
|
+
background: var(--color-accent);
|
|
172
|
+
color: #fff;
|
|
173
|
+
width: 1.5rem;
|
|
174
|
+
height: 1.5rem;
|
|
175
|
+
display: inline-flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
justify-content: center;
|
|
178
|
+
border-radius: 50%;
|
|
179
|
+
flex-shrink: 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.policy-section p {
|
|
183
|
+
margin-bottom: 0.875rem;
|
|
184
|
+
font-size: 0.9375rem;
|
|
185
|
+
color: var(--color-text);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.policy-section p:last-child { margin-bottom: 0; }
|
|
189
|
+
|
|
190
|
+
.policy-section ul {
|
|
191
|
+
margin: 0.75rem 0 0.875rem 1.5rem;
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
gap: 0.35rem;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.policy-section ul li {
|
|
198
|
+
font-size: 0.9375rem;
|
|
199
|
+
color: var(--color-text);
|
|
200
|
+
position: relative;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.policy-section ul li::marker { color: var(--color-accent); }
|
|
204
|
+
|
|
205
|
+
/* \u2500\u2500 Footer \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
206
|
+
.policy-footer {
|
|
207
|
+
margin-top: 3rem;
|
|
208
|
+
padding: 1.5rem 2rem;
|
|
209
|
+
border-top: 1px solid var(--color-border);
|
|
210
|
+
text-align: center;
|
|
211
|
+
font-size: 0.8125rem;
|
|
212
|
+
color: var(--color-text-muted);
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
gap: 0.35rem;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.policy-footer a { color: var(--color-link); text-decoration: none; }
|
|
219
|
+
.policy-footer a:hover { text-decoration: underline; }
|
|
220
|
+
|
|
221
|
+
/* \u2500\u2500 Print styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
222
|
+
@media print {
|
|
223
|
+
:root {
|
|
224
|
+
--color-bg: #fff;
|
|
225
|
+
--color-surface: #fff;
|
|
226
|
+
--color-border: #d1d5db;
|
|
227
|
+
--color-text: #000;
|
|
228
|
+
--color-text-muted: #374151;
|
|
229
|
+
--color-accent: #16a34a;
|
|
230
|
+
--color-accent-light: #f0fdf4;
|
|
231
|
+
--color-heading: #064e3b;
|
|
232
|
+
--color-link: #15803d;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
body { padding: 0; font-size: 10pt; }
|
|
236
|
+
.policy-wrapper { max-width: 100%; }
|
|
237
|
+
|
|
238
|
+
.policy-toc { break-inside: avoid; }
|
|
239
|
+
.policy-section { break-inside: avoid; box-shadow: none; border: 1px solid #d1d5db; }
|
|
240
|
+
|
|
241
|
+
.policy-toc ol { column-count: 2; }
|
|
242
|
+
.policy-footer { border-top: 1px solid #d1d5db; }
|
|
243
|
+
|
|
244
|
+
a { color: inherit; text-decoration: none; }
|
|
245
|
+
}
|
|
246
|
+
`.trim();function te(r,m){var L;let v=(m==null?void 0:m.includeStyles)!==false,e=(L=m==null?void 0:m.customCSS)!=null?L:"",a=r.sections.filter(D=>D.included),s=R(r.organizationInfo.name||"Organisation"),t=R(r.title||"Privacy Policy"),l=R(r.version||"1.0"),c=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),y=r.lastUpdated?new Date(r.lastUpdated).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):c,w=r.organizationInfo.website?`<a href="${R(r.organizationInfo.website)}" target="_blank" rel="noopener">${R(r.organizationInfo.website)}</a>`:"",x=r.organizationInfo.privacyEmail?`<a href="mailto:${R(r.organizationInfo.privacyEmail)}">${R(r.organizationInfo.privacyEmail)}</a>`:"",k=`
|
|
247
|
+
<nav class="policy-toc" aria-label="Table of Contents">
|
|
248
|
+
<h2>Table of Contents</h2>
|
|
249
|
+
<ol>
|
|
250
|
+
${a.map((D,f)=>` <li><a href="#${le(D.title)}">${R(D.title)}</a></li>`).join(`
|
|
251
|
+
`)}
|
|
252
|
+
</ol>
|
|
253
|
+
</nav>`,A=a.map((D,f)=>{let P=le(D.title),p=D.template||D.defaultContent||"",E=Ne(p);return ` <section class="policy-section" id="${P}" aria-labelledby="section-heading-${P}">
|
|
254
|
+
<h2 id="section-heading-${P}">
|
|
255
|
+
<span class="section-number" aria-hidden="true">${f+1}</span>
|
|
256
|
+
${R(D.title)}
|
|
257
|
+
</h2>
|
|
258
|
+
${E}
|
|
259
|
+
</section>`}).join(`
|
|
260
|
+
|
|
261
|
+
`),N=v?`<style>
|
|
262
|
+
${Ie}
|
|
263
|
+
${e?`
|
|
264
|
+
/* \u2500\u2500 Custom styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
265
|
+
${e}`:""}
|
|
266
|
+
</style>`:e?`<style>${e}</style>`:"";return `<!DOCTYPE html>
|
|
267
|
+
<html lang="en">
|
|
268
|
+
<head>
|
|
269
|
+
<meta charset="UTF-8" />
|
|
270
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
271
|
+
<meta name="description" content="Privacy Policy for ${s}" />
|
|
272
|
+
<meta name="generator" content="NDPA Toolkit" />
|
|
273
|
+
<title>${t} \u2014 ${s}</title>
|
|
274
|
+
${N}
|
|
275
|
+
</head>
|
|
276
|
+
<body>
|
|
277
|
+
<div class="policy-wrapper">
|
|
278
|
+
|
|
279
|
+
<header class="policy-header">
|
|
280
|
+
<h1>${t}</h1>
|
|
281
|
+
<div class="policy-meta">
|
|
282
|
+
<span><strong>Organisation:</strong> ${s}</span>
|
|
283
|
+
<span><strong>Effective:</strong> ${c}</span>
|
|
284
|
+
<span><strong>Version:</strong> ${l}</span>
|
|
285
|
+
${y!==c?`<span><strong>Last updated:</strong> ${y}</span>`:""}
|
|
286
|
+
</div>
|
|
287
|
+
<div>
|
|
288
|
+
<span class="compliance-badge" role="img" aria-label="NDPA compliant">✓ NDPA 2023 Compliant</span>
|
|
289
|
+
</div>
|
|
290
|
+
</header>
|
|
291
|
+
|
|
292
|
+
${k}
|
|
293
|
+
|
|
294
|
+
<article class="policy-body" aria-label="Policy content">
|
|
295
|
+
|
|
296
|
+
${A}
|
|
297
|
+
|
|
298
|
+
</article>
|
|
299
|
+
|
|
300
|
+
<footer class="policy-footer" role="contentinfo">
|
|
301
|
+
<div>${s}${w?` — ${w}`:""}</div>
|
|
302
|
+
${x?`<div>Privacy contact: ${x}</div>`:""}
|
|
303
|
+
<div>Effective ${c} • Version ${l}</div>
|
|
304
|
+
<div>Generated by <strong>NDPA Toolkit</strong> — Nigeria Data Protection Act 2023</div>
|
|
305
|
+
</footer>
|
|
306
|
+
|
|
307
|
+
</div>
|
|
308
|
+
</body>
|
|
309
|
+
</html>`}function Me(r){return r.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function oe(r){let m=r.sections.filter(l=>l.included),v=r.title||"Privacy Policy",e=r.organizationInfo.name||"Organisation",a=r.version||"1.0",s=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),t=[];return t.push(`# ${v}`),t.push(""),t.push(`_Effective: ${s} | Version: ${a} | ${e}_`),t.push(""),r.organizationInfo.website&&t.push(`**Website:** ${r.organizationInfo.website} `),r.organizationInfo.privacyEmail&&t.push(`**Privacy contact:** ${r.organizationInfo.privacyEmail} `),(r.organizationInfo.website||r.organizationInfo.privacyEmail)&&t.push(""),t.push("> This privacy policy is compliant with the **Nigeria Data Protection Act (NDPA) 2023**."),t.push(""),t.push("---"),t.push(""),m.length>0&&(t.push("## Table of Contents"),t.push(""),m.forEach((l,c)=>{let y=Me(`${c+1} ${l.title}`);t.push(`${c+1}. [${l.title}](#${y})`);}),t.push(""),t.push("---"),t.push("")),m.forEach((l,c)=>{t.push(`## ${c+1}. ${l.title}`),t.push("");let y=(l.template||l.defaultContent||"").trim();if(y){let w=y.split(`
|
|
310
|
+
`);for(let x of w){let S=x.trimEnd();S.startsWith("-")||S.startsWith("\u2022")||S===""?t.push(S.replace(/^•/,"-")):t.push(S);}}t.push(""),t.push("---"),t.push("");}),t.push(`_Generated by **NDPA Toolkit** — ${e} • Version ${a}_`),t.push(""),t.join(`
|
|
311
|
+
`)}function re(r,m){return chunkMQFZHA2D_js.d(this,null,function*(){var D;let v;try{let f=yield import('jspdf');v=(D=f.jsPDF)!=null?D:f.default;}catch(f){throw new Error('The "jspdf" package is required for PDF export. Install it with: pnpm add jspdf')}let e=new v({unit:"mm",format:"a4"}),a=e.internal.pageSize.getWidth(),s=e.internal.pageSize.getHeight(),t=20,l=a-t*2,c=t,y=r.organizationInfo.name||"",w=r.title||"Privacy Policy",x=r.version||"1.0",S=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString():new Date().toLocaleDateString(),k=()=>{e.setFontSize(8),e.setFont("helvetica","italic"),e.setTextColor(150,150,150),e.text(y?`${y} \u2014 ${w}`:w,t,12),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,14,a-t,14),e.setTextColor(0,0,0);},A=f=>{c+f>s-t-10&&(e.addPage(),c=t+8,k());};if((m==null?void 0:m.includeCoverPage)!==false){e.setFillColor(22,163,74),e.rect(0,0,a,12,"F"),e.setFontSize(28),e.setFont("helvetica","bold"),e.setTextColor(22,163,74);let f=e.splitTextToSize(w,l-10),P=72;f.forEach(E=>{e.text(E,a/2,P,{align:"center"}),P+=11;}),e.setDrawColor(22,163,74),e.setLineWidth(.6);let p=P+6;if(e.line(a/2-30,p,a/2+30,p),e.setFontSize(14),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),e.text(y,a/2,p+14,{align:"center"}),e.setFontSize(10),e.setTextColor(100,100,100),e.text(`Effective Date: ${S}`,a/2,p+26,{align:"center"}),e.text(`Version ${x}`,a/2,p+34,{align:"center"}),(m==null?void 0:m.includeComplianceBadge)!==false){let E=p+52,u="Compliant with the Nigeria Data Protection Act (NDPA) 2023";e.setFontSize(8.5),e.setFont("helvetica","bold"),e.setTextColor(255,255,255);let d=e.getTextWidth(u),z=7,H=3.5,I=(a-d-z*2)/2;e.setFillColor(22,163,74),e.roundedRect(I,E-H-1,d+z*2,7+H,2,2,"F"),e.text(u,a/2,E+1.5,{align:"center"}),e.setTextColor(0,0,0);}e.setFillColor(22,163,74),e.rect(0,s-12,a,12,"F"),e.addPage(),c=t+8,k();}let N=r.sections.filter(f=>f.included);(m==null?void 0:m.includeTOC)!==false&&(e.setFontSize(18),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text("Table of Contents",t,c+4),e.setDrawColor(22,163,74),e.setLineWidth(.5),e.line(t,c+8,t+80,c+8),c+=18,e.setFontSize(10.5),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),N.forEach((f,P)=>{A(7);let p=`${P+1}. ${f.title}`;e.text(p,t+4,c),c+=6.5;}),e.addPage(),c=t+8,k()),N.forEach((f,P)=>{A(18),e.setFillColor(22,163,74),e.circle(t+3.5,c-1.5,3.8,"F"),e.setFontSize(8),e.setFont("helvetica","bold"),e.setTextColor(255,255,255),e.text(String(P+1),t+3.5,c-.5,{align:"center"}),e.setFontSize(13),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text(f.title,t+11,c),c+=3,e.setDrawColor(200,200,200),e.setLineWidth(.25),e.line(t+11,c,a-t,c),c+=6;let p=(f.template||f.defaultContent||"").trim();if(p){let E=p.split(`
|
|
312
|
+
`);e.setFontSize(9.5),e.setFont("helvetica","normal"),e.setTextColor(50,50,50),E.forEach(u=>{let d=u.trimEnd();if(d===""){c+=3;return}let z=d.startsWith("-")||d.startsWith("\u2022"),H=z?t+8:t+4,I=z?d.replace(/^[-•]\s*/,""):d,O=l-(z?12:8);e.splitTextToSize(I,O).forEach((X,Z)=>{A(5),z&&Z===0&&(e.setFillColor(22,163,74),e.circle(t+4,c-1,.9,"F")),e.text(X,H,c),c+=5;});});}c+=10;});let L=e.getNumberOfPages();for(let f=1;f<=L;f++)e.setPage(f),e.setFontSize(7.5),e.setFont("helvetica","normal"),e.setTextColor(160,160,160),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,s-12,a-t,s-12),e.text(y?`${y} \u2014 Privacy Policy`:"Privacy Policy",t,s-8),e.text(`Page ${f} of ${L}`,a-t,s-8,{align:"right"}),e.setTextColor(0,0,0);return e.setProperties({title:w,author:y,subject:"Privacy Policy \u2014 NDPA 2023 Compliant",keywords:"privacy policy, NDPA, Nigeria, data protection"}),e.output("blob")})}function ne(r,m){return chunkMQFZHA2D_js.d(this,null,function*(){let v;try{v=yield import('docx');}catch(u){throw new Error('The "docx" package is required for Word export. Install it with: pnpm add docx')}let{Document:e,Paragraph:a,TextRun:s,HeadingLevel:t,Packer:l,Header:c,Footer:y,PageNumber:w,AlignmentType:x,BorderStyle:S,ShadingType:k,TableOfContents:A}=v,N=r.organizationInfo.name||"",L=r.title||"Privacy Policy",D=r.version||"1.0",f=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),P=r.sections.filter(u=>u.included),p=[];if(p.push(new a({children:[new s({text:L,bold:true,size:52,color:"064e3b"})],heading:t.TITLE,spacing:{after:160},alignment:x.CENTER})),p.push(new a({children:[new s({text:`${N}${N?" \u2022 ":""}Version ${D} \u2022 Effective ${f}`,size:20,color:"6b7280",italics:true})],spacing:{after:120},alignment:x.CENTER})),p.push(new a({children:[new s({text:"Compliant with the Nigeria Data Protection Act (NDPA) 2023",size:18,color:"16a34a",bold:true})],spacing:{after:400},alignment:x.CENTER})),p.push(new a({children:[],spacing:{after:200},border:{bottom:{color:"16a34a",style:S.SINGLE,size:6,space:1}}})),(m==null?void 0:m.includeTOC)!==false){if(p.push(new a({children:[new s({text:"Table of Contents",bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200}})),typeof A=="function")try{p.push(new A("Table of Contents",{hyperlink:!0,headingStyleRange:"1-1"}));}catch(u){P.forEach((d,z)=>{p.push(new a({children:[new s({text:`${z+1}. ${d.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});}else P.forEach((u,d)=>{p.push(new a({children:[new s({text:`${d+1}. ${u.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});p.push(new a({children:[],pageBreakBefore:true}));}P.forEach((u,d)=>{p.push(new a({children:[new s({text:`${d+1}. ${u.title}`,bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200},border:{bottom:{color:"dcfce7",style:S.SINGLE,size:4,space:1}}}));let z=(u.template||u.defaultContent||"").trim();z&&z.split(`
|
|
313
|
+
`).forEach(I=>{let O=I.trimEnd();if(O===""){p.push(new a({children:[],spacing:{after:60}}));return}let B=O.startsWith("- ")||O.startsWith("\u2022 "),X=B?O.replace(/^[-•]\s*/,""):O;B?p.push(new a({children:[new s({text:X,size:22})],spacing:{after:80},bullet:{level:0}})):p.push(new a({children:[new s({text:X,size:22})],spacing:{after:100}}));});}),p.push(new a({children:[new s({text:`Generated by NDPA Toolkit \u2014 ${N}${N?" \u2014 ":""}Privacy Policy v${D}`,size:16,color:"9ca3af",italics:true})],spacing:{before:600},alignment:x.CENTER}));let E=new e({title:L,description:"Privacy Policy \u2014 NDPA 2023 Compliant",styles:{paragraphStyles:[{id:"Normal",name:"Normal",run:{font:"Calibri",size:22}}]},sections:[{headers:{default:new c({children:[new a({children:[new s({text:N||"Privacy Policy",size:16,color:"9ca3af"})],alignment:x.RIGHT})]})},footers:{default:new y({children:[new a({children:[new s({text:"Page ",size:16,color:"9ca3af"}),new s({children:[w.CURRENT],size:16,color:"9ca3af"}),new s({text:" of ",size:16,color:"9ca3af"}),new s({children:[w.TOTAL_PAGES],size:16,color:"9ca3af"})],alignment:x.CENTER})]})},children:p}]});return l.toBlob(E)})}var de=10,pe="ndpr_policy_draft",Re=2e3;function me(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function ue(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function U(r,m,v){let e=Date.now();return {id:v,title:`Privacy Policy${r.org.name?` \u2014 ${r.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:r.org.name,website:r.org.website,privacyEmail:r.org.privacyEmail,address:r.org.address,dpoName:r.org.dpoName,dpoEmail:r.org.dpoEmail,industry:r.org.industry},sections:m,variableValues:{},effectiveDate:e,lastUpdated:e,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function ot(r={}){var ie,ae;let{onComplete:m,onComplianceChange:v}=r,e=react.useRef((ie=r.adapter)!=null?ie:chunkUK656RCG_js.a(pe));e.current=(ae=r.adapter)!=null?ae:chunkUK656RCG_js.a(pe);let a=react.useRef(ue()),[s,t]=react.useState(1),[l,c]=react.useState(chunkLU4PFST7_js.b),[y,w]=react.useState([]),[x,S]=react.useState({}),[k,A]=react.useState([]),[N,L]=react.useState(false),[D,f]=react.useState(null),[P,p]=react.useState(true),E=react.useRef(null);react.useEffect(()=>{let o=false,n=i=>{i&&(a.current=i.id,c(i.templateContext),w(i.customSections),S(i.sectionOverrides),A(i.sectionOrder),t(i.currentStep),f(i.lastSavedAt),L(true));};try{let i=e.current.load();i instanceof Promise?i.then(h=>{o||(n(h),p(!1));},()=>{o||p(!1);}):(n(i),p(!1));}catch(i){o||p(false);}return ()=>{o=true;}},[]);let u=react.useMemo(()=>{let n=chunkLU4PFST7_js.d(l).map(g=>x[g.id]?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},g),{template:x[g.id]}):g),i=y.map(g=>{var T;return {id:g.id,title:g.title,template:(T=x[g.id])!=null?T:g.content,order:g.order,required:false,included:true}}),h=[...n,...i];if(k.length>0){let g=new Map(k.map((T,$)=>[T,$]));return [...h].sort((T,$)=>{let F=g.has(T.id)?g.get(T.id):h.length,W=g.has($.id)?g.get($.id):h.length;return F-W})}return [...h].sort((g,T)=>{var $,F;return (($=g.order)!=null?$:0)-((F=T.order)!=null?F:0)})},[l,y,x,k]),d=react.useMemo(()=>!l.org.name&&!l.org.privacyEmail?null:U(l,u,a.current),[l,u]),z=react.useMemo(()=>U(chunkLU4PFST7_js.b(),[],a.current),[]),H=react.useMemo(()=>chunkLU4PFST7_js.c(d!=null?d:z,l),[d,l,z]),I=H.percentage,O=H.gaps,B=react.useRef({score:-1,gaps:[]});react.useEffect(()=>{let o=B.current;v&&(I!==o.score||O!==o.gaps)&&v(I,O),B.current={score:I,gaps:O};},[I,O,v]);let X=react.useMemo(()=>{switch(s){case 1:return l.org.name.trim().length>0&&l.org.privacyEmail.trim().length>0;case 2:return l.dataCategories.some(o=>o.selected);case 3:return l.purposes.length>0;case 4:return true;default:return false}},[s,l]),Z=react.useCallback(o=>{t(Math.min(Math.max(1,o),4));},[]),fe=react.useCallback(()=>{t(o=>Math.min(o+1,4));},[]),ge=react.useCallback(()=>{t(o=>Math.max(o-1,1));},[]),he=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n),o));},[]),ye=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{org:chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n.org),o)}));},[]),ve=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{dataCategories:n.dataCategories.map(i=>i.id===o?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{selected:!i.selected}):i)}));},[]),xe=react.useCallback(o=>{c(n=>{let i=n.purposes.includes(o);return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{purposes:i?n.purposes.filter(h=>h!==o):[...n.purposes,o]})});},[]),be=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{thirdPartyProcessors:[...n.thirdPartyProcessors,o]}));},[]),Pe=react.useCallback(o=>{c(n=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{thirdPartyProcessors:n.thirdPartyProcessors.filter((i,h)=>h!==o)}));},[]),we=react.useCallback(o=>{w(n=>n.length>=de?n:[...n,chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},o),{id:me(),required:false})]);},[]),Ce=react.useCallback((o,n)=>{w(i=>i.map(h=>h.id===o?chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},h),n):h));},[]),Se=react.useCallback(o=>{w(n=>n.filter(i=>i.id!==o)),A(n=>n.filter(i=>i!==o)),S(n=>{let i=chunkMQFZHA2D_js.a({},n);return delete i[o],i});},[]),De=react.useCallback((o,n)=>{A(i=>{let h=i.length>0?i:u.map(F=>F.id),g=h.indexOf(o);if(g===-1){let F=u.map(Le=>Le.id),W=F.indexOf(o);if(W===-1)return i;let Y=n==="up"?W-1:W+1;if(Y<0||Y>=F.length)return F;let j=[...F];return [j[W],j[Y]]=[j[Y],j[W]],j}let T=n==="up"?g-1:g+1;if(T<0||T>=h.length)return h;let $=[...h];return [$[g],$[T]]=[$[T],$[g]],$});},[u]),Te=react.useCallback((o,n)=>{S(i=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{[o]:n}));},[]),Ee=react.useCallback(o=>{let n=O.find(i=>i.requirementId===o);if(n)switch(n.fixType){case "fill_field":{let h=["data-categories-disclosed"],g=["purpose-of-processing"];h.includes(o)?t(2):g.includes(o)?t(3):(t(1));break}case "add_section":{if(!n.suggestedContent)break;w(i=>i.length>=de?i:[...i,{id:me(),title:n.requirement,content:n.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!n.suggestedContent)break;let i="data-subject-rights";S(h=>{var T,$,F;let g=(F=($=h[i])!=null?$:(T=u.find(W=>W.id===i))==null?void 0:T.template)!=null?F:"";return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},h),{[i]:`${g}
|
|
314
|
+
|
|
315
|
+
${n.suggestedContent}`.trim()})});break}}},[O,u]),V=react.useCallback(o=>({id:a.current,templateContext:l,customSections:y,sectionOverrides:x,sectionOrder:k,currentStep:o,lastSavedAt:Date.now(),status:"draft"}),[l,y,x,k]),$e=react.useCallback(()=>chunkMQFZHA2D_js.d(null,null,function*(){let o=V(s);try{yield Promise.resolve(e.current.save(o)),f(o.lastSavedAt),L(!0);}catch(n){console.warn("[ndpr-toolkit] Failed to save draft:",n);}}),[V,s]),ze=react.useCallback(()=>{Promise.resolve(e.current.remove()).catch(o=>{console.warn("[ndpr-toolkit] Failed to remove draft:",o);}),a.current=ue(),c(chunkLU4PFST7_js.b()),w([]),S({}),A([]),t(1),L(false),f(null);},[]);react.useEffect(()=>{if(!P)return E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{let o=V(s);Promise.resolve(e.current.save(o)).then(()=>{f(o.lastSavedAt),L(true);}).catch(n=>{console.warn("[ndpr-toolkit] Auto-save failed:",n);});},Re),()=>{E.current&&clearTimeout(E.current);}},[l,y,x,k,s,P,V]),react.useEffect(()=>{s===4&&d&&m&&m(d);},[s,d,m]);let Oe=react.useCallback(o=>chunkMQFZHA2D_js.d(null,null,function*(){let n=d!=null?d:U(l,u,a.current);return re(n,o)}),[d,l,u]),Fe=react.useCallback(o=>chunkMQFZHA2D_js.d(null,null,function*(){let n=d!=null?d:U(l,u,a.current);return ne(n,o)}),[d,l,u]),ke=react.useCallback(o=>{let n=d!=null?d:U(l,u,a.current);return te(n,o)},[d,l,u]),Ae=react.useCallback(()=>{let o=d!=null?d:U(l,u,a.current);return oe(o)},[d,l,u]);return {currentStep:s,goToStep:Z,nextStep:fe,prevStep:ge,canProceed:X,context:l,updateContext:he,updateOrg:ye,toggleDataCategory:ve,togglePurpose:xe,addProcessor:be,removeProcessor:Pe,policy:d,sections:u,customSections:y,addCustomSection:we,updateCustomSection:Ce,removeCustomSection:Se,reorderSections:De,editSectionContent:Te,sectionOverrides:x,complianceScore:I,complianceResult:H,complianceGaps:O,applyFix:Ee,handleExportPDF:Oe,handleExportDOCX:Fe,handleExportHTML:ke,handleExportMarkdown:Ae,isDraftSaved:N,lastSavedAt:D,saveDraft:$e,discardDraft:ze,isLoading:P}}exports.a=te;exports.b=oe;exports.c=re;exports.d=ne;exports.e=ot;//# sourceMappingURL=chunk-DQLDX5X6.js.map
|
|
316
|
+
//# sourceMappingURL=chunk-DQLDX5X6.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var G=({options:l,settings:u,onSave:v,title:h="Manage Your Privacy Settings",description:x="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",saveButtonText:m="Save Preferences",resetButtonText:y="Reset to Defaults",version:k="1.0",className:S="",buttonClassName:i="",primaryButtonClassName:a="",secondaryButtonClassName:w="",classNames:e,unstyled:s,showSuccessMessage:R=true,successMessage:B="Your preferences have been saved.",successMessageDuration:D=3e3})=>{let[p,n]=react.useState({}),[o,d]=react.useState(false);react.useEffect(()=>{if(u&&u.consents)n(u.consents);else {let t={};l.forEach(c=>{t[c.id]=c.defaultValue||false;}),n(t);}},[l,u]);let b=(t,c)=>{n(L=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},L),{[t]:c}));},I=()=>{let t={consents:p,timestamp:Date.now(),version:k,method:"manager",hasInteracted:true};v(t),R&&(d(true),setTimeout(()=>{d(false);},D));},M=()=>{let t={};l.forEach(c=>{t[c.id]=c.defaultValue||false;}),n(t);},O=(e==null?void 0:e.primaryButton)||(e==null?void 0:e.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${i} ${a}`,C=(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.resetButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${i} ${w}`;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 ${S}`,e==null?void 0:e.root,s),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",e==null?void 0:e.title,s),children:h}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,s),children:x}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-6",e==null?void 0:e.optionsList,s),children:l.map(t=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("border-b border-gray-200 dark:border-gray-700 pb-4 last:border-0",e==null?void 0:e.optionItem,s),children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:t.label}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:t.description})]}),jsxRuntime.jsx("div",{className:"ml-4 flex-shrink-0",children:jsxRuntime.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",className:"sr-only peer",checked:p[t.id]||false,onChange:c=>b(t.id,c.target.checked),disabled:t.required}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(`w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-[rgb(var(--ndpr-ring)/0.3)] rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-[rgb(var(--ndpr-primary))] ${t.required?"opacity-60":""}`,e==null?void 0:e.toggle,s)}),jsxRuntime.jsxs("span",{className:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300",children:[p[t.id]?"Enabled":"Disabled",t.required&&jsxRuntime.jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},t.id))}),o&&jsxRuntime.jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md",children:B}),jsxRuntime.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsxRuntime.jsx("button",{onClick:I,className:chunkE64TU6IU_js.a(O,e==null?void 0:e.saveButton,s),children:m}),jsxRuntime.jsx("button",{onClick:M,className:chunkE64TU6IU_js.a(C,e==null?void 0:e.resetButton,s),children:y})]}),jsxRuntime.jsxs("div",{className:"mt-4 text-xs text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsxs("p",{children:["Last updated: ",u?new Date(u.timestamp).toLocaleString():"Never"]}),jsxRuntime.jsxs("p",{children:["Version: ",k]})]})]})};var X=({settings:l,storageOptions:u={},onLoad:v,onSave:h,autoSave:x=true,autoLoad:m=true,classNames:y,unstyled:k,children:S})=>{let{storageKey:i="ndpr_consent",storageType:a="localStorage",cookieOptions:w={}}=u,[e,s]=react.useState(false);react.useEffect(()=>{m&&!e&&R();},[m,e]),react.useEffect(()=>{x&&e&&B(l);},[l,x,e]);let R=()=>{let n=null;try{if(a==="localStorage"&&typeof window!="undefined"){let o=localStorage.getItem(i);o&&(n=JSON.parse(o));}else if(a==="sessionStorage"&&typeof window!="undefined"){let o=sessionStorage.getItem(i);o&&(n=JSON.parse(o));}else if(a==="cookie"&&typeof document!="undefined"){let d=document.cookie.split(";").find(b=>b.trim().startsWith(`${i}=`));if(d){let b=d.split("=")[1];n=JSON.parse(decodeURIComponent(b));}}s(!0),v&&v(n);}catch(o){console.error("Error loading consent settings:",o),s(true),v&&v(null);}return n},B=n=>{try{let o=JSON.stringify(n);if(a==="localStorage"&&typeof window!="undefined")localStorage.setItem(i,o);else if(a==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(i,o);else if(a==="cookie"&&typeof document!="undefined"){let{domain:d,path:b="/",expires:I=365,secure:M=!0,sameSite:O="Lax"}=w,C=new Date;C.setDate(C.getDate()+I);let t=`${i}=${encodeURIComponent(o)}; path=${b}; expires=${C.toUTCString()}`;d&&(t+=`; domain=${d}`),M&&(t+="; secure"),t+=`; samesite=${O}`,document.cookie=t;}return h&&h(n),!0}catch(o){return console.error("Error saving consent settings:",o),false}},D=()=>{try{if(a==="localStorage"&&typeof window!="undefined")localStorage.removeItem(i);else if(a==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(i);else if(a==="cookie"&&typeof document!="undefined"){let{domain:n,path:o="/"}=w,d=`${i}=; path=${o}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;n&&(d+=`; domain=${n}`),document.cookie=d;}return !0}catch(n){return console.error("Error clearing consent settings:",n),false}},p=chunkE64TU6IU_js.a("",y==null?void 0:y.root,k);if(typeof S=="function"){let n=S({loadSettings:R,saveSettings:B,clearSettings:D,loaded:e});return p?jsxRuntime.jsx("div",{className:p,children:n}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:n})}return p?jsxRuntime.jsx("div",{className:p,children:S}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:S})};exports.a=G;exports.b=X;//# sourceMappingURL=chunk-FR7ZYZXB.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-FR7ZYZXB.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),jsxRuntime=require('react/jsx-runtime'),D=require('react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var D__default=/*#__PURE__*/_interopDefault(D);var S=({result:r,sections:m,showFullReport:p=true,allowPrint:x=true,allowExport:y=true,onExport:v,className:u="",buttonClassName:b="",classNames:k={},unstyled:N=false})=>{let i=(a,s)=>{let d=s?k[s]:void 0;return !d&&s==="printButton"&&(d=k.primaryButton),chunkE64TU6IU_js.a(a,d,N)},g=a=>new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),l=a=>{let s=r.answers[a];return s==null?"Not answered":typeof s=="boolean"?s?"Yes":"No":Array.isArray(s)?s.join(", "):String(s)},w=()=>{window.print();},C=a=>{v&&v(a);},h=a=>jsxRuntime.jsx("span",{className:i(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[a]}`,"riskBadge"),children:a.charAt(0).toUpperCase()+a.slice(1)});return jsxRuntime.jsxs("div",{className:`${i("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${u}`,children:[jsxRuntime.jsxs("div",{className:i("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:i("text-2xl font-bold text-gray-900 dark:text-white mb-2","title"),children:"Data Protection Impact Assessment Report"}),jsxRuntime.jsx("h2",{className:"text-xl text-gray-700 dark:text-gray-300 mb-4",children:r.title})]}),(x||y)&&jsxRuntime.jsxs("div",{className:"flex space-x-2 print:hidden",children:[x&&jsxRuntime.jsx("button",{onClick:w,className:`${i("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")} ${b}`,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"]})}),y&&jsxRuntime.jsx("div",{className:"relative inline-block",children:jsxRuntime.jsx("button",{onClick:()=>C("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${b}`,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:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessor:"})," ",r.assessor.name,", ",r.assessor.role]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",r.assessor.email]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Started:"})," ",g(r.startedAt)]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Completed:"})," ",r.completedAt?g(r.completedAt):"In progress"]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next review:"})," ",r.reviewDate?g(r.reviewDate):"Not scheduled"]})]})]})]}),jsxRuntime.jsxs("div",{className:i("mb-8","summary"),children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Executive Summary"}),jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),h(r.overallRiskLevel)]}),jsxRuntime.jsxs("div",{className:i("mb-2","conclusion"),children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Conclusion:"})," ",r.conclusion]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",r.canProceed?"Yes":"No"]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Processing Activity Description"}),jsxRuntime.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:r.processingDescription}),r.recommendations&&r.recommendations.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Key Recommendations"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 text-gray-700 dark:text-gray-300",children:r.recommendations.map((a,s)=>jsxRuntime.jsx("li",{className:i("","recommendation"),children:a},s))})]})]})]}),jsxRuntime.jsxs("div",{className:"mb-8",children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Identified Risks"}),r.risks.length===0?jsxRuntime.jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"No risks identified."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:i("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Likelihood"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Impact"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk Level"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Mitigated"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:r.risks.map(a=>jsxRuntime.jsxs("tr",{className:i("","riskRow"),children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:a.description}),jsxRuntime.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.likelihood," / 5"]}),jsxRuntime.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.impact," / 5"]}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:h(a.level)}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:a.mitigated?jsxRuntime.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Yes"}):jsxRuntime.jsx("span",{className:"text-red-600 dark:text-red-400",children:"No"})})]},a.id))})]})})]}),p&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Full Assessment Details"}),m.map(a=>{let s=a.questions.filter(d=>r.answers[d.id]!==void 0);return s.length===0?null:jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white 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:"bg-gray-50 dark:bg-gray-700",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Question"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Answer"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:s.map(d=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:d.text}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-600 dark:text-gray-400",children:l(d.id)})]},d.id))})]})})]},a.id)})]}),jsxRuntime.jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxRuntime.jsxs("p",{children:["DPIA Report Version: ",r.version]}),jsxRuntime.jsxs("p",{children:["Generated on: ",new Date().toLocaleDateString()]})]})]})};var F=({steps:r,onStepClick:m,clickable:p=true,orientation:x="horizontal",className:y="",activeStepClassName:v="",completedStepClassName:u="",incompleteStepClassName:b="",classNames:k={},unstyled:N=false})=>{let i=(n,l)=>chunkE64TU6IU_js.a(n,l?k[l]:void 0,N),g=n=>{p&&m&&m(n);},c=x==="vertical";return jsxRuntime.jsx("div",{className:`${i(c?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${y}`,children:r.map((n,l)=>{let w=l===r.length-1,C=n.active?i(`font-medium ${v||"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]"}`,"label"):n.completed?i(u||"text-green-600 dark:text-green-400","label"):i(b||"text-gray-600 dark:text-gray-400","label"),h=n.active?i("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)] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] border-2 border-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]","stepActive"):n.completed?i("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-400 border-2 border-green-600 dark:border-green-400","stepCompleted"):i("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-2 border-gray-300 dark:border-gray-600","stepPending");return jsxRuntime.jsxs(D__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:i(`${c?"flex items-start":"flex flex-col items-center"} ${p?"cursor-pointer":""}`,"step"),onClick:()=>g(n.id),children:[jsxRuntime.jsx("div",{className:`
|
|
2
|
+
flex items-center justify-center
|
|
3
|
+
${c?"mr-4":""}
|
|
4
|
+
`,children:jsxRuntime.jsx("div",{className:h,children:n.icon?n.icon:n.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:l+1})})}),jsxRuntime.jsxs("div",{className:`
|
|
5
|
+
${c?"flex-1":"mt-2 text-center"}
|
|
6
|
+
`,children:[jsxRuntime.jsx("div",{className:`text-sm font-medium ${C}`,children:n.label}),n.description&&jsxRuntime.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:n.description})]})]}),!w&&jsxRuntime.jsx("div",{className:i(c?"ml-4 h-8 border-l-2 border-gray-300 dark:border-gray-600":"w-full border-t-2 border-gray-300 dark:border-gray-600 hidden sm:block","connector")})]},n.id)})})};exports.a=S;exports.b=F;//# sourceMappingURL=chunk-FY5G6DGZ.js.map
|
|
7
|
+
//# sourceMappingURL=chunk-FY5G6DGZ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$2,b}from'./chunk-YJCGEOLO.mjs';import {a}from'./chunk-GIV2OHE6.mjs';import {a as a$1}from'./chunk-SBNAMPAP.mjs';import {useRef,useState,useEffect,useCallback}from'react';function F(n){if(!n)return a$1("ndpr_consent");let{storageKey:o="ndpr_consent",storageType:i="localStorage"}=n;return i==="sessionStorage"?a$2(o):i==="cookie"?b(o,n.cookieOptions):a$1(o)}function k(n,o,i,r,a$1,g,l){if(n){i(n);let{valid:s,errors:c}=a(n);r(s),a$1(c),g(!(s&&n.version===o));}else g(true);l(false);}function z({options:n,adapter:o,storageOptions:i,version:r="1.0",onChange:a$1}){let g=o!=null?o:F(i),l=useRef(g);l.current=g;let[s,c]=useState(null),[y,d]=useState(false),[E,C]=useState(false),[w,S]=useState([]),[I,v]=useState(true);useEffect(()=>{let e=false;try{let t=l.current.load();t instanceof Promise?t.then(m=>{e||k(m,r,c,C,S,d,v);},()=>{e||(d(!0),v(!1));}):k(t,r,c,C,S,d,v);}catch(t){e||(d(true),v(false));}return ()=>{e=true;}},[r]);let h=useCallback(e=>{let{valid:t,errors:m}=a(e);C(t),S(m),a$1==null||a$1(e),Promise.resolve(l.current.save(e)).catch(P=>{console.warn("[ndpr-toolkit] Failed to save consent:",P);});},[a$1]),f=useCallback(e=>{let t={consents:e,timestamp:Date.now(),version:r,method:"explicit",hasInteracted:true};c(t),h(t),d(false);},[r,h]),L=useCallback(()=>{let e={};n.forEach(t=>{e[t.id]=true;}),f(e);},[n,f]),U=useCallback(()=>{let e={};n.forEach(t=>{e[t.id]=t.required||false;}),f(e);},[n,f]),V=useCallback(e=>!!(s!=null&&s.consents[e]),[s]),j=useCallback(()=>{c(null),d(true),C(false),S([]),Promise.resolve(l.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove consent:",e);});},[]);return {settings:s,hasConsent:V,updateConsent:f,acceptAll:L,rejectAll:U,shouldShowBanner:y,isValid:E,validationErrors:w,resetConsent:j,isLoading:I}}export{z as a};//# sourceMappingURL=chunk-G26I6MP5.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-G26I6MP5.mjs.map
|