@tantainnovative/ndpr-toolkit 3.6.0 → 3.7.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +31 -1
  3. package/dist/chunk-2MIQXECH.mjs +3 -0
  4. package/dist/chunk-3GRGYT3P.js +1 -0
  5. package/dist/chunk-5IOC3VAW.js +1 -0
  6. package/dist/chunk-ATFUSHC2.mjs +2 -0
  7. package/dist/chunk-HXWHL4BD.js +3 -0
  8. package/dist/chunk-R7545FP4.mjs +1 -0
  9. package/dist/chunk-UKLU6BQF.mjs +1 -0
  10. package/dist/{chunk-I2LMQWK3.js → chunk-W7OLQRJP.js} +2 -2
  11. package/dist/core.d.mts +70 -0
  12. package/dist/core.d.ts +70 -0
  13. package/dist/core.js +1 -1
  14. package/dist/core.mjs +1 -1
  15. package/dist/hooks.d.mts +10 -0
  16. package/dist/hooks.d.ts +10 -0
  17. package/dist/hooks.js +1 -1
  18. package/dist/hooks.mjs +1 -1
  19. package/dist/index.d.mts +10 -0
  20. package/dist/index.d.ts +10 -0
  21. package/dist/index.js +1 -1
  22. package/dist/index.mjs +1 -1
  23. package/dist/policy.d.mts +86 -0
  24. package/dist/policy.d.ts +86 -0
  25. package/dist/policy.js +1 -1
  26. package/dist/policy.mjs +1 -1
  27. package/dist/presets-policy.d.mts +71 -0
  28. package/dist/presets-policy.d.ts +71 -0
  29. package/dist/presets-policy.js +1 -1
  30. package/dist/presets-policy.mjs +1 -1
  31. package/dist/presets.d.mts +71 -0
  32. package/dist/presets.d.ts +71 -0
  33. package/dist/presets.js +1 -1
  34. package/dist/presets.mjs +1 -1
  35. package/dist/server.d.mts +70 -0
  36. package/dist/server.d.ts +70 -0
  37. package/dist/server.js +1 -1
  38. package/dist/server.mjs +1 -1
  39. package/package.json +1 -1
  40. package/dist/chunk-BNHQFZHL.mjs +0 -2
  41. package/dist/chunk-O6CUBNXK.mjs +0 -3
  42. package/dist/chunk-RV2VMWZJ.mjs +0 -1
  43. package/dist/chunk-UI536RU2.js +0 -3
  44. package/dist/chunk-W7RBGZCC.js +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,55 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [3.7.0](https://github.com/mr-tanta/ndpr-toolkit/compare/v3.6.1...v3.7.0) (2026-05-24)
6
+
7
+ Phase B — Template + Recipe Library. Closes the dev-feedback content gap (feedback items #7 and #9). New API additions are all backward-compatible — 3.6.x consumers upgrade without changes.
8
+
9
+ ### Features
10
+
11
+ * **5 org-specific privacy-policy templates.** New `templateContextFor(id, overrides?)` factory exported from `/`, `/core`, `/server`, and `/policy`. Pre-fills a complete `TemplateContext` with sector-appropriate data categories, lawful-basis defaults, and the right flags for children/sensitive/financial/cross-border/automated-decisions:
12
+ - **`saas`** — startup-shape, cross-border on (overseas cloud), no sensitive
13
+ - **`ecommerce`** — financial on, cross-border on (payment processors), automated-decisions on (fraud)
14
+ - **`school`** — `hasChildrenData: true` (NDPA Section 31 parental consent), education industry
15
+ - **`healthcare`** — `hasSensitiveData: true` (Section 30 medical/biometric), financial on (insurance)
16
+ - **`procurement`** — government industry, financial on, BVN + gov IDs selected
17
+ * **`<NDPRPrivacyPolicy template="…" />` prop.** Drop a template id and the wizard opens already populated. Optional `templateOverrides` for org name/DPO/address. Existing `adapter` + `onComplete` API unchanged.
18
+ * **`ORG_POLICY_TEMPLATE_REGISTRY` constant** — listing of all 5 templates with id, label, description, and example org types. Useful for building a template-picker UI.
19
+ * **`initialContext` prop** added to `<AdaptivePolicyWizard>` and `useAdaptivePolicyWizard()` — lets advanced consumers bypass the template lookup and seed with a hand-built `TemplateContext`.
20
+
21
+ ### Docs
22
+
23
+ * **5 new recipe pages at `/docs/recipes/*`** — production-tested patterns drawn from real adopter feedback:
24
+ - `ecommerce-consent` — checkout flow, cart-abandonment cookies, marketing-pixel gating with `useConsent`
25
+ - `newsletter-consent` — Section 26 affirmative opt-in (no pre-checked boxes), double opt-in pattern, audit-trail snippet
26
+ - `contact-form-disclosure` — minimum-viable Section 27 notice on a public contact form, data-minimisation guidance
27
+ - `careers-rights` — applicant data lawful basis, retention by candidate outcome, automated CV-screening disclosure (Section 37)
28
+ - `admin-dsr-management` — DPO/staff-side workflow: queue, identity verification, 30-day deadline tracking, audit trail
29
+ * **Recipes section added to docs nav + sitemap.** Each recipe page has full SEO meta and is canonicalised.
30
+
31
+ ### Tests
32
+
33
+ * 12 new tests for the org templates (1 per template + override behaviour + registry consistency). Suite now at **1146 passing**.
34
+
35
+ ## [3.6.1](https://github.com/mr-tanta/ndpr-toolkit/compare/v3.6.0...v3.6.1) (2026-05-24)
36
+
37
+ Phase A of the post-3.6.0 backlog — tooling foundation. Pure plumbing; no API changes on the main library, but `create-ndpr` (scoped) bumps to 0.2.0 and a new unscoped `create-ndpr` alias package ships.
38
+
39
+ ### Companion packages
40
+
41
+ * **`@tantainnovative/create-ndpr@0.2.0`** — scaffolder no longer emits broken Prisma imports when you pick `ORM=None`. Templates now support `{{#if ORM=prisma|drizzle|none}}` conditional blocks. The consent route template emits working code for all three ORMs (Prisma queries, Drizzle queries, or an in-memory stub with TODO comments). Other route templates (still hardcoded to Prisma) are skipped with a clear message when `ORM=none` instead of generating broken output. Also fixes the `StorageAdapter<unknown>` type error in the generated `ndpr-layout.tsx` (now correctly types the apiAdapter as `StorageAdapter<ConsentSettings>` and adds a CSRF header example).
42
+ * **`create-ndpr@1.0.0` (NEW, unscoped)** — 30-line alias that delegates to the scoped CLI via `npx`. Lets `npm create ndpr@latest`, `npx create-ndpr`, `pnpm create ndpr`, and `bun create ndpr` all work alongside the existing `npx @tantainnovative/create-ndpr`.
43
+
44
+ ### Docs
45
+
46
+ * README install block now shows all four idiomatic CLI invocations (`npm create ndpr@latest`, `npx create-ndpr`, the scoped form, pnpm and bun variants).
47
+ * README header now has "Open in StackBlitz" and "Open in CodeSandbox" badges that boot `examples/nextjs-app` zero-install in either environment.
48
+ * New "Bundle size guidance" subsection under "Available Import Paths" explains: (1) prefer narrow subpaths over root, (2) use `/presets/{consent,dsr,policy}` over the full `/presets` barrel when only one preset is needed, (3) the 3 manager components are heavy by design (they're full table+filter+modal UIs) — import from `/hooks` if you only need the hook, (4) `/server` carries zero React for SSR/edge/CI use.
49
+
50
+ ### No library code changes
51
+
52
+ The main `@tantainnovative/ndpr-toolkit` package is unchanged from 3.6.0; the version bump is for changelog clarity and so the repo, npm, and CHANGELOG all reference the same version.
53
+
5
54
  ## [3.6.0](https://github.com/mr-tanta/ndpr-toolkit/compare/v3.5.5...v3.6.0) (2026-05-24)
6
55
 
7
56
  ### Features (developer feedback)
package/README.md CHANGED
@@ -13,6 +13,9 @@ v3 ships **zero-config presets**, **pluggable storage adapters**, **compound com
13
13
 
14
14
  **[Documentation](https://ndprtoolkit.com.ng)** | **[Live Demos](https://ndprtoolkit.com.ng/ndpr-demos)** | **[npm](https://www.npmjs.com/package/@tantainnovative/ndpr-toolkit)** | **[Blog](https://ndprtoolkit.com.ng/blog)** | **[v3.4.0 Release](https://github.com/mr-tanta/ndpr-toolkit/releases/tag/v3.4.0)**
15
15
 
16
+ [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/mr-tanta/ndpr-toolkit/tree/main/examples/nextjs-app)
17
+ [![Open in CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/github/mr-tanta/ndpr-toolkit/main/examples/nextjs-app)
18
+
16
19
  > **What's new in 3.4.0:** components now ship styled defaults via a real stylesheet — Tailwind is no longer required. Add `import "@tantainnovative/ndpr-toolkit/styles";` once in your app entry. Plus a new `/server` subpath for RSC-safe pure-logic imports (validators, generators, scoring) with zero React in the import graph. Backward-compatible at the component API level. Full notes on the [release page](https://github.com/mr-tanta/ndpr-toolkit/releases/tag/v3.4.0).
17
20
 
18
21
  <p align="center">
@@ -112,7 +115,14 @@ bun add @radix-ui/react-switch @radix-ui/react-tabs @radix-ui/react-label @radix
112
115
  Or scaffold instantly with the CLI:
113
116
 
114
117
  ```bash
118
+ # Recommended (idiomatic):
119
+ npm create ndpr@latest
120
+
121
+ # Equivalent — pick whichever fits your muscle memory:
122
+ npx create-ndpr
115
123
  npx @tantainnovative/create-ndpr
124
+ pnpm create ndpr
125
+ bun create ndpr
116
126
  ```
117
127
 
118
128
  ---
@@ -415,7 +425,10 @@ Each component exports its `ClassNames` TypeScript interface for autocomplete. F
415
425
  | `/server` | **Pure validators, generators, scoring, locales, adapters, types — zero React** | `tslib` | **Yes** |
416
426
  | `/core` | Types, utility functions, NDPRProvider | `react`[^core] | Partial |
417
427
  | `/hooks` | React hooks for all 8 modules | `react` | No |
418
- | `/presets` | Zero-config preset components | `react`, Radix peers | No |
428
+ | `/presets` | All zero-config preset components (barrel) | `react`, Radix peers | No |
429
+ | `/presets/consent` | **Just `NDPRConsent`** — narrower barrel for bundle size | `react`, Radix peers | No |
430
+ | `/presets/dsr` | **Just `NDPRSubjectRights`** | `react`, Radix peers | No |
431
+ | `/presets/policy` | **Just `NDPRPrivacyPolicy`** | `react`, Radix peers | No |
419
432
  | `/adapters` | Storage adapters (localStorage, sessionStorage, cookie, api, memory, composeAdapters) | none | Yes |
420
433
  | `/consent` | ConsentBanner, ConsentManager, `Consent.*` compound API, useConsent | `react` | No |
421
434
  | `/dsr` | DSR components + hook | `react` | No |
@@ -430,6 +443,23 @@ Each component exports its `ClassNames` TypeScript interface for autocomplete. F
430
443
 
431
444
  [^core]: `/core` re-exports the React `NDPRProvider` for backward compatibility. For strictly server-side imports use `/server` — it carries the same pure validators with no React surface.
432
445
 
446
+ ### Bundle size guidance
447
+
448
+ The toolkit is published with `sideEffects: ["*.css"]`, so a modern bundler (Vite, Next.js / Webpack, esbuild, Bun) will tree-shake unused exports. A few practical rules to keep your bundle small:
449
+
450
+ 1. **Prefer narrow subpaths over the root.** `import { useConsent } from '@tantainnovative/ndpr-toolkit/hooks'` is tighter than the same import from `.`. The root entry has more transitive exports and bundlers don't always trace them perfectly.
451
+
452
+ 2. **Use the per-preset subpaths when you only need one preset.** `import { NDPRConsent } from '@tantainnovative/ndpr-toolkit/presets/consent'` is ~4 KB; the full `/presets` barrel is ~8 KB. Same for `/presets/dsr` and `/presets/policy`.
453
+
454
+ 3. **The 3 manager components are intentionally heavy** (each is ~50 KB src — full table + filter + modal + wizard UIs):
455
+ - `LawfulBasisTracker` (from `/lawful-basis`)
456
+ - `ROPAManager` (from `/ropa`)
457
+ - `CrossBorderTransferManager` (from `/cross-border`)
458
+
459
+ If your app only needs the hook (e.g. you're rendering ROPA records inside your own admin UI), import from `/hooks` instead of the feature subpath — the hook chunk doesn't drag the manager component into your bundle.
460
+
461
+ 4. **`/server` carries zero React.** For Server Actions, Route Handlers, scheduled jobs, or compliance-score computation in CI, prefer `/server` and you'll pay no React-tree cost.
462
+
433
463
  ---
434
464
 
435
465
  ## NDPA 2023 Overview
@@ -0,0 +1,3 @@
1
+ import {c as c$1,d as d$1,a as a$2,b as b$1}from'./chunk-AOHKVFAS.mjs';import {e,c,f}from'./chunk-RMQ7OLNY.mjs';import {a}from'./chunk-DBZSN4WP.mjs';import {b,a as a$1,d}from'./chunk-ZJYULEER.mjs';import {useRef,useState,useEffect,useMemo,useCallback}from'react';var nt=10,Rt="ndpr_policy_draft",_t=2e3;function st(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function it(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function w(u,A,M){let S=Date.now();return {id:M,title:`Privacy Policy${u.org.name?` \u2014 ${u.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:u.org.name,website:u.org.website,privacyEmail:u.org.privacyEmail,address:u.org.address,dpoName:u.org.dpoName,dpoEmail:u.org.dpoEmail,industry:u.org.industry},sections:A,variableValues:{},effectiveDate:S,lastUpdated:S,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function Ut(u={}){var K;let{onComplete:A,onComplianceChange:M}=u,S=useRef((K=u.adapter)!=null?K:a(Rt));u.adapter&&(S.current=u.adapter);let f$1=useRef(it()),[P,C]=useState(1),[n,v]=useState(()=>{var t;return (t=u.initialContext)!=null?t:e()}),[b$2,O]=useState([]),[x,I]=useState({}),[E,$]=useState([]),[at,q]=useState(false),[ct,z]=useState(null),[N,U]=useState(true),T=useRef(false),R=useRef(null);useEffect(()=>{let t=false,e=r=>{r&&(f$1.current=r.id,v(r.templateContext),O(r.customSections),I(r.sectionOverrides),$(r.sectionOrder),C(r.currentStep),z(r.lastSavedAt),q(true));};try{let r=S.current.load();r instanceof Promise?r.then(i=>{t||(e(i),U(!1));},()=>{t||U(!1);}):(e(r),U(!1));}catch(r){t||U(false);}return ()=>{t=true;}},[]);let d$2=useMemo(()=>{let e=c(n).map(o=>x[o.id]?b(a$1({},o),{template:x[o.id]}):o),r=b$2.map(o=>{var l;return {id:o.id,title:o.title,template:(l=x[o.id])!=null?l:o.content,order:o.order,required:false,included:true}}),i=[...e,...r];if(E.length>0){let o=new Map(E.map((l,p)=>[l,p]));return [...i].sort((l,p)=>{let m=o.has(l.id)?o.get(l.id):i.length,y=o.has(p.id)?o.get(p.id):i.length;return m-y})}return [...i].sort((o,l)=>{var p,m;return ((p=o.order)!=null?p:0)-((m=l.order)!=null?m:0)})},[n,b$2,x,E]),s=useMemo(()=>!n.org.name&&!n.org.privacyEmail?null:w(n,d$2,f$1.current),[n,d$2]),Y=useMemo(()=>w(e(),[],f$1.current),[]),V=useMemo(()=>f(s!=null?s:Y,n),[s,n,Y]),_=V.percentage,D=V.gaps,j=useRef({score:-1,gaps:[]});useEffect(()=>{let t=j.current;M&&(_!==t.score||D!==t.gaps)&&M(_,D),j.current={score:_,gaps:D};},[_,D,M]);let lt=useMemo(()=>{switch(P){case 1:return n.org.name.trim().length>0&&n.org.privacyEmail.trim().length>0;case 2:return n.dataCategories.some(t=>t.selected);case 3:return n.purposes.length>0;case 4:return true;default:return false}},[P,n]),dt=useCallback(t=>{let e=Math.min(Math.max(1,t),4);e<4&&(T.current=false),C(e);},[]),pt=useCallback(()=>{C(t=>Math.min(t+1,4));},[]),ut=useCallback(()=>{T.current=false,C(t=>Math.max(t-1,1));},[]),mt=useCallback(t=>{v(e=>a$1(a$1({},e),t));},[]),gt=useCallback(t=>{v(e=>b(a$1({},e),{org:a$1(a$1({},e.org),t)}));},[]),ft=useCallback(t=>{v(e=>b(a$1({},e),{dataCategories:e.dataCategories.map(r=>r.id===t?b(a$1({},r),{selected:!r.selected}):r)}));},[]),Pt=useCallback(t=>{v(e=>{let r=t,i=e.purposes.includes(r);return b(a$1({},e),{purposes:i?e.purposes.filter(o=>o!==t):[...e.purposes,r]})});},[]),Ct=useCallback(t=>{v(e=>b(a$1({},e),{thirdPartyProcessors:[...e.thirdPartyProcessors,t]}));},[]),yt=useCallback(t=>{v(e=>b(a$1({},e),{thirdPartyProcessors:e.thirdPartyProcessors.filter((r,i)=>i!==t)}));},[]),St=useCallback(t=>{O(e=>e.length>=nt?e:[...e,b(a$1({},t),{id:st(),required:false})]);},[]),vt=useCallback((t,e)=>{O(r=>r.map(i=>i.id===t?a$1(a$1({},i),e):i));},[]),xt=useCallback(t=>{O(e=>e.filter(r=>r.id!==t)),$(e=>e.filter(r=>r!==t)),I(e=>{let r=a$1({},e);return delete r[t],r});},[]),ht=useCallback((t,e)=>{$(r=>{let i=r.length>0?r:d$2.map(m=>m.id),o=i.indexOf(t);if(o===-1){let m=d$2.map(It=>It.id),y=m.indexOf(t);if(y===-1)return r;let G=e==="up"?y-1:y+1;if(G<0||G>=m.length)return m;let k=[...m];return [k[y],k[G]]=[k[G],k[y]],k}let l=e==="up"?o-1:o+1;if(l<0||l>=i.length)return i;let p=[...i];return [p[o],p[l]]=[p[l],p[o]],p});},[d$2]),Dt=useCallback((t,e)=>{I(r=>b(a$1({},r),{[t]:e}));},[]),bt=useCallback(t=>{let e=D.find(r=>r.requirementId===t);if(e)switch(e.fixType){case "fill_field":{T.current=false;let i=["data-categories-disclosed"],o=["purpose-of-processing"];i.includes(t)?C(2):o.includes(t)?C(3):(C(1));break}case "add_section":{if(!e.suggestedContent)break;O(r=>r.length>=nt?r:[...r,{id:st(),title:e.requirement,content:e.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!e.suggestedContent)break;let r="data-subject-rights";I(i=>{var l,p,m;let o=(m=(p=i[r])!=null?p:(l=d$2.find(y=>y.id===r))==null?void 0:l.template)!=null?m:"";return b(a$1({},i),{[r]:`${o}
2
+
3
+ ${e.suggestedContent}`.trim()})});break}}},[D,d$2]),X=useCallback(t=>({id:f$1.current,templateContext:n,customSections:b$2,sectionOverrides:x,sectionOrder:E,currentStep:t,lastSavedAt:Date.now(),status:"draft"}),[n,b$2,x,E]),Ot=useCallback(()=>d(null,null,function*(){let t=X(P);try{yield Promise.resolve(S.current.save(t)),z(t.lastSavedAt),q(!0);}catch(e){console.warn("[ndpr-toolkit] Failed to save draft:",e);}}),[X,P]),Et=useCallback(()=>{Promise.resolve(S.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove draft:",t);}),f$1.current=it(),T.current=false,v(e()),O([]),I({}),$([]),C(1),q(false),z(null);},[]);useEffect(()=>{if(!N)return R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{let t=X(P);Promise.resolve(S.current.save(t)).then(()=>{z(t.lastSavedAt),q(true);}).catch(e=>{console.warn("[ndpr-toolkit] Auto-save failed:",e);});},_t),()=>{R.current&&clearTimeout(R.current);}},[n,b$2,x,E,P,N,X]),useEffect(()=>{P===4&&s&&A&&!T.current&&(T.current=true,A(s));},[P,s,A]);let Tt=useCallback(t=>d(null,null,function*(){let e=s!=null?s:w(n,d$2,f$1.current);return c$1(e,t)}),[s,n,d$2]),wt=useCallback(t=>d(null,null,function*(){let e=s!=null?s:w(n,d$2,f$1.current);return d$1(e,t)}),[s,n,d$2]),At=useCallback(t=>{let e=s!=null?s:w(n,d$2,f$1.current);return a$2(e,t)},[s,n,d$2]),Mt=useCallback(()=>{let t=s!=null?s:w(n,d$2,f$1.current);return b$1(t)},[s,n,d$2]);return {currentStep:P,goToStep:dt,nextStep:pt,prevStep:ut,canProceed:lt,context:n,updateContext:mt,updateOrg:gt,toggleDataCategory:ft,togglePurpose:Pt,addProcessor:Ct,removeProcessor:yt,policy:s,sections:d$2,customSections:b$2,addCustomSection:St,updateCustomSection:vt,removeCustomSection:xt,reorderSections:ht,editSectionContent:Dt,sectionOverrides:x,complianceScore:_,complianceResult:V,complianceGaps:D,applyFix:bt,handleExportPDF:Tt,handleExportDOCX:wt,handleExportHTML:At,handleExportMarkdown:Mt,isDraftSaved:at,lastSavedAt:ct,saveDraft:Ot,discardDraft:Et,isLoading:N}}export{Ut as a};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkQ64735OC_js=require('./chunk-Q64735OC.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js');var x={saas:{id:"saas",label:"SaaS / B2B Software",description:"Multi-tenant cloud software. Account credentials, usage analytics, cross-border transfer to the SaaS vendor, automated processing for features like spam filtering or fraud scoring.",examples:["team collaboration tools","CRM","developer tools","workflow automation"]},ecommerce:{id:"ecommerce",label:"Ecommerce / Online Store",description:"Online retail. Customer identity, payment data, shipping address, cart abandonment cookies, marketing analytics, third-party payment processors.",examples:["online retail","D2C brand","marketplace","food delivery"]},school:{id:"school",label:"School / Education",description:"Educational institution or edtech platform. Student data including minors (NDPA Section 31 \u2014 parental consent required), academic records, attendance, behavioural data for learning analytics.",examples:["K-12 school","edtech app","tutoring platform","online courses"]},healthcare:{id:"healthcare",label:"Healthcare / HealthTech",description:"Medical practice, hospital, telemedicine, or health insurance. Sensitive personal data (NDPA Section 30 \u2014 medical), prescription history, insurance claims, biometric data.",examples:["hospital","telemedicine","pharmacy","health insurance"]},procurement:{id:"procurement",label:"Procurement / B2G",description:"Government procurement, vendor management, public-sector bidding. Vendor company data, tax IDs, beneficial-owner information, contract records, sometimes politically-exposed-person (PEP) data.",examples:["e-procurement portal","vendor registry","government supplier database"]}},a={fullName:"full-name",contactDetails:"contact-details",govIds:"government-ids",credentials:"account-credentials",payment:"payment-info",financialRecords:"financial-records",bvn:"bvn",device:"device-info",usage:"usage-data",location:"location-data",cookies:"cookies",health:"health-data",biometric:"biometric-data",children:"children"};function s(e){let t=new Set(e);return chunkQ64735OC_js.d.map(r=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{selected:t.has(r.id)}))}function h(e,t){var r,c,l,d,p,m;return t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{org:chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e.org),{name:(r=t.orgName)!=null?r:e.org.name,website:(c=t.website)!=null?c:e.org.website,privacyEmail:(l=t.privacyEmail)!=null?l:e.org.privacyEmail,address:(d=t.address)!=null?d:e.org.address,dpoName:(p=t.dpoName)!=null?p:e.org.dpoName,dpoEmail:(m=t.dpoEmail)!=null?m:e.org.dpoEmail})}):e}var f=["service_delivery","analytics","marketing","fraud_prevention"],y=["service_delivery","marketing","analytics","fraud_prevention","legal_compliance"],v=["service_delivery","analytics","legal_compliance"],C=["service_delivery","legal_compliance","research"],T=["service_delivery","legal_compliance","fraud_prevention"];function P(){let e=chunkQ64735OC_js.e();return e.org.industry="saas",e.org.orgSize="startup",e.dataCategories=s([a.fullName,a.contactDetails,a.credentials,a.device,a.usage,a.cookies]),e.purposes=f,e.hasChildrenData=false,e.hasSensitiveData=false,e.hasFinancialData=false,e.hasCrossBorderTransfer=true,e.hasAutomatedDecisions=false,e}function S(){let e=chunkQ64735OC_js.e();return e.org.industry="ecommerce",e.org.orgSize="midsize",e.dataCategories=s([a.fullName,a.contactDetails,a.payment,a.financialRecords,a.device,a.usage,a.location,a.cookies]),e.purposes=y,e.hasChildrenData=false,e.hasSensitiveData=false,e.hasFinancialData=true,e.hasCrossBorderTransfer=true,e.hasAutomatedDecisions=true,e}function D(){let e=chunkQ64735OC_js.e();return e.org.industry="education",e.org.orgSize="midsize",e.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.credentials,a.usage,a.cookies,a.children]),e.purposes=v,e.hasChildrenData=true,e.hasSensitiveData=false,e.hasFinancialData=false,e.hasCrossBorderTransfer=false,e.hasAutomatedDecisions=false,e}function E(){let e=chunkQ64735OC_js.e();return e.org.industry="healthcare",e.org.orgSize="enterprise",e.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.payment,a.health,a.biometric]),e.purposes=C,e.hasChildrenData=false,e.hasSensitiveData=true,e.hasFinancialData=true,e.hasCrossBorderTransfer=false,e.hasAutomatedDecisions=false,e}function O(){let e=chunkQ64735OC_js.e();return e.org.industry="government",e.org.orgSize="enterprise",e.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.financialRecords,a.bvn]),e.purposes=T,e.hasChildrenData=false,e.hasSensitiveData=false,e.hasFinancialData=true,e.hasCrossBorderTransfer=false,e.hasAutomatedDecisions=false,e}var g={saas:P,ecommerce:S,school:D,healthcare:E,procurement:O};function _(e,t){let r=g[e];if(!r)throw new Error(`[ndpr-toolkit] Unknown org template id: ${String(e)}. Expected one of: ${Object.keys(g).join(", ")}.`);return h(r(),t)}exports.a=x;exports.b=_;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkW7OLQRJP_js=require('./chunk-W7OLQRJP.js'),chunk3GRGYT3P_js=require('./chunk-3GRGYT3P.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var u=d=>{var o=d,{template:e,templateOverrides:r,initialContext:t}=o,l=chunkRFPLZDIO_js.c(o,["template","templateOverrides","initialContext"]);let n=react.useMemo(()=>{if(t)return t;if(e)return chunk3GRGYT3P_js.b(e,r)},[t,e,r]);return jsxRuntime.jsx(chunkW7OLQRJP_js.a,chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},l),{initialContext:n}))};exports.a=u;
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-2MIQXECH.mjs';import {a as a$1}from'./chunk-SFGW37LE.mjs';import {d,b,a as a$2}from'./chunk-ZJYULEER.mjs';import Ur,{useId,useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var vr=["Organization","Data Collection","Processing","Review & Export"],lr=({currentStep:n,classNames:p,unstyled:r})=>jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:a$1("w-full flex items-center justify-between px-2 py-4",p==null?void 0:p.root,r),children:vr.map((e,d)=>{let t=d+1,i=t<n,u=t===n,b=d===vr.length-1;return jsxs(Ur.Fragment,{children:[jsxs("div",{className:a$1("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsx("div",{"aria-current":u?"step":void 0,"aria-label":`Step ${t}: ${e}${i?" (completed)":u?" (current)":""}`,className:a$1(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":u?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?p==null?void 0:p.stepCompleted:u?p==null?void 0:p.stepCurrent:p==null?void 0:p.stepUpcoming,r),children:i?jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("span",{className:"text-xs leading-none",children:t})}),jsx("span",{className:a$1(["text-xs font-medium hidden sm:block",i||u?"text-[rgb(var(--ndpr-primary))]":"ndpr-card__subtitle"].join(" "),p==null?void 0:p.stepLabel,r),children:e})]}),!b&&jsx("div",{className:a$1(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Xr="block text-sm font-medium ndpr-text-muted mb-1",A=({id:n,label:p,required:r,description:e,children:d,classNames:t,unstyled:i})=>{let u=e?`${n}-desc`:void 0;return jsxs("div",{className:a$1("flex flex-col",t==null?void 0:t.field,i),children:[jsxs("label",{htmlFor:n,className:a$1(Xr,t==null?void 0:t.label,i),children:[p,r&&jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),e&&jsx("p",{id:u,className:"text-xs ndpr-text-muted mb-1",children:e}),d]})},fr=({context:n,onUpdateOrg:p,classNames:r,unstyled:e})=>{var i,u,l;let d=useId(),t=n.org;return jsxs("div",{"data-ndpr-component":"policy-step-about",className:a$1("ndpr-form-section",r==null?void 0:r.root,e),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Organisation Details"}),jsxs("p",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:["Tell us about your organisation. Fields marked ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxs("div",{className:a$1("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,e),children:[jsx(A,{id:`${d}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${d}-org-name`,type:"text",value:t.name,onChange:b=>p({name:b.target.value}),placeholder:"Acme Corporation",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${d}-website`,label:"Website",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${d}-website`,type:"url",value:t.website,onChange:b=>p({website:b.target.value}),placeholder:"https://example.com",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${d}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${d}-privacy-email`,type:"email",value:t.privacyEmail,onChange:b=>p({privacyEmail:b.target.value}),placeholder:"privacy@example.com",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${d}-industry`,label:"Industry",classNames:r,unstyled:e,children:jsxs("select",{id:`${d}-industry`,value:t.industry,onChange:b=>p({industry:b.target.value}),className:a$1($,r==null?void 0:r.select,e),children:[jsx("option",{value:"fintech",children:"Fintech"}),jsx("option",{value:"healthcare",children:"Healthcare"}),jsx("option",{value:"ecommerce",children:"E-commerce"}),jsx("option",{value:"saas",children:"SaaS"}),jsx("option",{value:"education",children:"Education"}),jsx("option",{value:"government",children:"Government"}),jsx("option",{value:"other",children:"Other"})]})}),jsx(A,{id:`${d}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:e,children:jsx("input",{id:`${d}-dpo-name`,type:"text",value:(i=t.dpoName)!=null?i:"",onChange:b=>p({dpoName:b.target.value}),placeholder:"Jane Smith",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${d}-dpo-email`,label:"DPO Email",classNames:r,unstyled:e,children:jsx("input",{id:`${d}-dpo-email`,type:"email",value:(u=t.dpoEmail)!=null?u:"",onChange:b=>p({dpoEmail:b.target.value}),placeholder:"dpo@example.com",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${d}-address`,label:"Registered Address",classNames:r,unstyled:e,children:jsx("input",{id:`${d}-address`,type:"text",value:(l=t.address)!=null?l:"",onChange:b=>p({address:b.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${d}-org-size`,label:"Organisation Size",classNames:r,unstyled:e,children:jsxs("select",{id:`${d}-org-size`,value:t.orgSize,onChange:b=>p({orgSize:b.target.value}),className:a$1($,r==null?void 0:r.select,e),children:[jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsx(A,{id:`${d}-country`,label:"Country of Operation",classNames:r,unstyled:e,children:jsx("input",{id:`${d}-country`,type:"text",value:t.country,onChange:b=>p({country:b.target.value}),placeholder:"Nigeria",className:a$1($,r==null?void 0:r.input,e)})})]})]})};var Yr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Jr=["identity","financial","behavioral","sensitive","children"],Kr=["sensitive","children"],xr=({categories:n,onToggle:p,classNames:r,unstyled:e})=>{let d=Jr.reduce((t,i)=>{let u=n.filter(l=>l.group===i);return u.length>0&&(t[i]=u),t},{});return jsxs("div",{"data-ndpr-component":"policy-step-data",className:a$1("space-y-8",r==null?void 0:r.root,e),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Data Categories"}),jsx("p",{id:"data-categories-desc",className:a$1("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(d).map(([t,i])=>{let u=Kr.includes(t);return jsxs("div",{className:a$1("space-y-3",r==null?void 0:r.group,e),children:[jsxs("div",{className:a$1("flex items-center gap-2",r==null?void 0:r.groupHeader,e),children:[jsx("h3",{className:a$1("text-sm font-semibold uppercase tracking-wide ndpr-text-muted",r==null?void 0:r.groupTitle,e),children:Yr[t]}),u&&jsx("span",{className:a$1("text-xs font-medium ndpr-text-warning bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,e),children:"Sensitive"})]}),u&&jsx("p",{className:a$1("text-xs ndpr-text-warning",r==null?void 0:r.sensitiveWarning,e),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsx("div",{className:a$1("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,e),children:i.map(l=>jsx("button",{type:"button",onClick:()=>p(l.id),"aria-pressed":l.selected,className:a$1(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",l.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,e),children:jsxs("div",{className:"flex items-start gap-3",children:[jsx("div",{className:a$1(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",l.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,e),"aria-hidden":"true",children:l.selected&&jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a$1("text-sm font-medium ndpr-text-foreground",r==null?void 0:r.cardLabel,e),children:l.label}),jsx("p",{className:a$1("text-xs ndpr-text-muted mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,e),children:l.dataPoints.join(", ")})]})]})},l.id))})]},t)})]})};var Zr=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="ndpr-card ndpr-card--compact",gr=({id:n,checked:p,onChange:r})=>jsx("button",{id:n,type:"button",role:"switch","aria-checked":p,onClick:()=>r(!p),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",p?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),hr=({context:n,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:e,onRemoveProcessor:d,classNames:t,unstyled:i})=>{let u=useId(),[l,b$1]=useState({name:"",purpose:"",country:""}),[C,g]=useState(false),a=()=>{let{name:v,purpose:c,country:m}=l;!v.trim()||!c.trim()||!m.trim()||(e({name:v.trim(),purpose:c.trim(),country:m.trim()}),b$1({name:"",purpose:"",country:""}),g(false));};return jsxs("div",{"data-ndpr-component":"policy-step-processing",className:a$1("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",t==null?void 0:t.heading,i),children:"Processing Details"}),jsx("p",{className:a$1("ndpr-form-field__hint",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsx("h3",{id:"purposes-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsx("p",{className:a$1("ndpr-form-field__hint",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsx("div",{className:a$1("space-y-3",t==null?void 0:t.purposeList,i),children:Zr.map(v=>{let c=n.purposes.includes(v.value),m=`${u}-purpose-${v.value}`,B=`${u}-purpose-desc-${v.value}`;return jsxs("label",{htmlFor:m,className:a$1("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsx("input",{id:m,type:"checkbox",checked:c,onChange:()=>p(v.value),"aria-describedby":B,className:a$1("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxs("div",{children:[jsx("p",{className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.purposeLabel,i),children:v.label}),jsx("p",{id:B,className:a$1("ndpr-form-field__hint",t==null?void 0:t.purposeDescription,i),children:v.description})]})]},v.value)})})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("h3",{id:"thirdparty-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsx(gr,{id:`${u}-thirdparty-toggle`,checked:n.thirdPartyProcessors.length>0||C,onChange:v=>{v?g(true):(n.thirdPartyProcessors.forEach((c,m)=>d(0)),g(false));}})]}),(n.thirdPartyProcessors.length>0||C)&&jsxs("div",{className:a$1("ndpr-form-section",t==null?void 0:t.processorSection,i),children:[n.thirdPartyProcessors.length>0&&jsx("div",{className:a$1("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxs("table",{className:"w-full text-sm",children:[jsx("thead",{children:jsxs("tr",{className:a$1("text-left text-xs font-medium ndpr-text-muted border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsx("th",{className:"pb-2"})]})}),jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:n.thirdPartyProcessors.map((v,c)=>jsxs("tr",{children:[jsx("td",{className:a$1("py-2 pr-4 ndpr-text-foreground",t==null?void 0:t.tableCell,i),children:v.name}),jsx("td",{className:a$1("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:v.purpose}),jsx("td",{className:a$1("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:v.country}),jsx("td",{className:"py-2",children:jsx("button",{type:"button",onClick:()=>d(c),className:a$1("text-red-500 hover:ndpr-text-destructive dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${v.name}`,children:"Remove"})})]},c))})]})}),C?jsxs("div",{className:a$1("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-name`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Processor Name"}),jsx("input",{id:`${u}-proc-name`,type:"text",placeholder:"Processor name",value:l.name,onChange:v=>b$1(c=>b(a$2({},c),{name:v.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-purpose`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Purpose"}),jsx("input",{id:`${u}-proc-purpose`,type:"text",placeholder:"Purpose",value:l.purpose,onChange:v=>b$1(c=>b(a$2({},c),{purpose:v.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-country`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Country"}),jsx("input",{id:`${u}-proc-country`,type:"text",placeholder:"Country",value:l.country,onChange:v=>b$1(c=>b(a$2({},c),{country:v.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsx("button",{type:"button",onClick:a,className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsx("button",{type:"button",onClick:()=>g(false),className:a$1("ndpr-button ndpr-button--secondary ndpr-button--sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxs("button",{type:"button",onClick:()=>g(true),className:a$1("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsx("h3",{id:"disclosures-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxs("div",{className:a$1("ndpr-form-section",t==null?void 0:t.disclosureList,i),children:[jsxs("div",{className:a$1("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{id:`${u}-cross-border-label`,className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsx("p",{id:`${u}-cross-border-desc`,className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsx(gr,{id:`${u}-cross-border-toggle`,checked:n.hasCrossBorderTransfer,onChange:v=>r({hasCrossBorderTransfer:v})})]}),jsxs("div",{className:a$1("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{id:`${u}-automated-label`,className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsx("p",{id:`${u}-automated-desc`,className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or automated systems to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsx(gr,{id:`${u}-automated-toggle`,checked:n.hasAutomatedDecisions,onChange:v=>r({hasAutomatedDecisions:v})})]})]})]})]})};var Cr=({section:n,index:p,isCustom:r,isEditing:e,editedContent:d,onEdit:t,onSaveEdit:i,onCancelEdit:u,onMoveUp:l,onMoveDown:b,onDelete:C,classNames:g,unstyled:a})=>{let[v,c]=useState(d!=null?d:n.template);return useEffect(()=>{d!==void 0&&c(d);},[d]),useEffect(()=>{e&&c(d!=null?d:n.template);},[e,d,n.template]),jsxs("div",{"data-ndpr-component":"policy-section-card",className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,a),children:[jsxs("div",{className:a$1("flex items-start justify-between gap-2",g==null?void 0:g.header,a),children:[jsxs("div",{className:a$1("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,a),children:[jsx("span",{className:a$1("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 ndpr-text-muted text-xs font-semibold flex items-center justify-center",g==null?void 0:g.sectionNumber,a),"aria-hidden":"true",children:p+1}),jsxs("h4",{className:a$1("text-sm font-semibold ndpr-text-foreground truncate",g==null?void 0:g.sectionTitle,a),children:[n.title,r&&jsx("span",{className:a$1("ml-2 text-xs font-normal ndpr-text-muted bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",g==null?void 0:g.customBadge,a),children:"Custom"})]})]}),jsxs("div",{className:a$1("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,a),children:[l&&jsx("button",{type:"button",onClick:l,className:a$1("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${n.title}" up`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),b&&jsx("button",{type:"button",onClick:b,className:a$1("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${n.title}" down`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!e&&jsx("button",{type:"button",onClick:t,className:a$1("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,a),"aria-label":`Edit "${n.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&C&&jsx("button",{type:"button",onClick:C,className:a$1("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,a),"aria-label":`Delete "${n.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),e?jsxs("div",{className:a$1("space-y-2",g==null?void 0:g.editArea,a),children:[jsx("textarea",{value:v,onChange:m=>c(m.target.value),rows:8,className:a$1("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",g==null?void 0:g.textarea,a),"aria-label":`Edit content for ${n.title}`}),jsxs("div",{className:a$1("flex gap-2",g==null?void 0:g.editActions,a),children:[jsx("button",{type:"button",onClick:()=>i(v),className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",g==null?void 0:g.saveButton,a),children:"Save"}),jsx("button",{type:"button",onClick:u,className:a$1("ndpr-button ndpr-button--secondary ndpr-button--sm",g==null?void 0:g.cancelButton,a),children:"Cancel"})]})]}):jsx("div",{className:a$1("text-sm ndpr-text-muted leading-relaxed line-clamp-4 whitespace-pre-wrap",g==null?void 0:g.content,a),children:n.template})]})};var kr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",wr=({onAdd:n,nextOrder:p,classNames:r,unstyled:e})=>{let d=useId(),[t,i]=useState(""),[u,l]=useState(""),[b,C]=useState(""),g=()=>{if(!t.trim()){C("Section title is required.");return}if(!u.trim()){C("Section content is required.");return}C(""),n({title:t.trim(),content:u.trim(),order:p}),i(""),l("");};return jsxs("div",{"data-ndpr-component":"custom-section-form",className:a$1("ndpr-card ndpr-card--compact",r==null?void 0:r.root,e),children:[jsx("h4",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Add Custom Section"}),b&&jsx("p",{role:"alert",className:a$1("text-xs ndpr-text-destructive",r==null?void 0:r.error,e),children:b}),jsxs("div",{className:a$1("space-y-3",r==null?void 0:r.fields,e),children:[jsxs("div",{children:[jsxs("label",{htmlFor:`${d}-custom-section-title`,className:a$1("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Section Title ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("input",{id:`${d}-custom-section-title`,type:"text",value:t,onChange:a=>{i(a.target.value),b&&C("");},placeholder:"e.g. Cookie Policy",className:a$1(kr,r==null?void 0:r.input,e),"aria-required":"true"})]}),jsxs("div",{children:[jsxs("label",{htmlFor:`${d}-custom-section-content`,className:a$1("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Content ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("textarea",{id:`${d}-custom-section-content`,value:u,onChange:a=>{l(a.target.value),b&&C("");},placeholder:"Write the section content here...",rows:5,className:a$1(`${kr} resize-y`,r==null?void 0:r.textarea,e),"aria-required":"true"})]})]}),jsx("div",{className:a$1("flex items-center gap-2",r==null?void 0:r.footer,e),children:jsx("button",{type:"button",onClick:g,className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",r==null?void 0:r.addButton,e),children:"Add Section"})})]})};var mr={compliant:{bg:"ndpr-alert ndpr-alert--success",text:"ndpr-text-success",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"ndpr-text-warning",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"ndpr-alert ndpr-alert--destructive",text:"ndpr-text-destructive",border:"border-red-200 dark:border-red-700"}},rt={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},s=({icon:n,label:p,description:r,actionLabel:e,loading:d,onClick:t,classNames:i,unstyled:u})=>jsxs("div",{className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,u),children:[jsxs("div",{className:a$1("flex items-center gap-3",i==null?void 0:i.formatHeader,u),children:[jsx("div",{className:a$1("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,u),"aria-hidden":"true",children:n}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a$1("ndpr-section-heading",i==null?void 0:i.formatLabel,u),children:p}),jsx("p",{className:a$1("ndpr-form-field__hint",i==null?void 0:i.formatDescription,u),children:r})]})]}),jsx("button",{type:"button",onClick:t,disabled:d,className:a$1("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,u),children:d?jsxs(Fragment,{children:[jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):e})]}),Sr=({complianceResult:n,onExportPDF:p,onExportDOCX:r,onExportHTML:e,onExportMarkdown:d$1,classNames:t,unstyled:i})=>{var c;let[u,l]=useState(false),[b,C]=useState(false),g=(c=mr[n.rating])!=null?c:mr.not_compliant,a=()=>d(null,null,function*(){l(true);try{yield p();}finally{l(false);}}),v=()=>d(null,null,function*(){C(true);try{yield r();}finally{C(false);}});return jsxs("div",{"data-ndpr-component":"policy-export-panel",className:a$1("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxs("div",{className:a$1(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxs("div",{className:a$1(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${n.percentage}%`,children:[n.percentage,"%"]}),jsxs("div",{children:[jsx("p",{className:a$1(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:rt[n.rating]}),jsxs("p",{className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.complianceDetail,i),children:[n.score," / ",n.maxScore," points \u2022"," ",n.gaps.length," gap",n.gaps.length!==1?"s":""," remaining"]})]})]}),jsxs("div",{children:[jsx("h3",{className:a$1("ndpr-section-heading",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxs("div",{className:a$1("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsx(s,{icon:jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:u,onClick:a,classNames:t,unstyled:i}),jsx(s,{icon:jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:b,onClick:v,classNames:t,unstyled:i}),jsx(s,{icon:jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:e,classNames:t,unstyled:i}),jsx(s,{icon:jsx("svg",{className:"w-5 h-5 ndpr-text-muted",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:d$1,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:n,customSections:p,sectionOverrides:r,complianceResult:e,onEditSection:d,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:u,onExportPDF:l,onExportDOCX:b$1,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:v})=>{let[c,m]=useState(null),[B,J]=useState(false),Z=new Set(p.map(h=>h.id)),er=(h,F)=>{d(h,F),m(null);},ir=n.length>0?Math.max(...n.map(h=>{var F;return (F=h.order)!=null?F:0}))+1:1;return jsxs("div",{"data-ndpr-component":"policy-step-review",className:a$1("ndpr-form-section",a==null?void 0:a.root,v),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",a==null?void 0:a.heading,v),children:"Review & Export"}),jsx("p",{className:a$1("ndpr-form-field__hint",a==null?void 0:a.subheading,v),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsx("div",{className:a$1("space-y-3",a==null?void 0:a.sectionList,v),"aria-live":"polite",children:n.map((h,F)=>jsx(Cr,{section:r[h.id]?b(a$2({},h),{template:r[h.id]}):h,index:F,isCustom:Z.has(h.id),isEditing:c===h.id,editedContent:r[h.id],onEdit:()=>m(h.id),onSaveEdit:N=>er(h.id,N),onCancelEdit:()=>m(null),onMoveUp:F>0?()=>u(h.id,"up"):void 0,onMoveDown:F<n.length-1?()=>u(h.id,"down"):void 0,onDelete:Z.has(h.id)?()=>i(h.id):void 0,classNames:a,unstyled:v},h.id))}),!B&&jsxs("button",{type:"button",onClick:()=>J(true),className:a$1("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",a==null?void 0:a.addSectionButton,v),children:[jsx("span",{className:a$1("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",a==null?void 0:a.addSectionIcon,v),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),B&&jsxs("div",{className:a$1("space-y-2",a==null?void 0:a.customFormWrapper,v),children:[jsx(wr,{onAdd:h=>{t(h),J(false);},nextOrder:ir,classNames:a,unstyled:v}),jsx("button",{type:"button",onClick:()=>J(false),className:a$1("text-sm ndpr-text-muted hover:underline",a==null?void 0:a.cancelCustomForm,v),children:"Cancel"})]}),jsx("hr",{className:a$1("border-gray-200 dark:border-gray-700",a==null?void 0:a.divider,v)}),jsx(Sr,{complianceResult:e,onExportPDF:l,onExportDOCX:b$1,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:v})]})};var Dr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"ndpr-text-success"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"ndpr-text-warning"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"ndpr-text-destructive"}},ot={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Fr=({score:n,maxScore:p,rating:r,classNames:e,unstyled:d})=>{var C,g;let t=p>0?Math.round(n/p*100):0,i=(C=Dr[r])!=null?C:Dr.not_compliant,u=36,l=2*Math.PI*u,b=l-t/100*l;return jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:a$1("flex flex-col items-center gap-2",e==null?void 0:e.root,d),children:[jsxs("div",{className:a$1("relative w-24 h-24",e==null?void 0:e.svgWrapper,d),children:[jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:b,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsx("div",{className:a$1("absolute inset-0 flex flex-col items-center justify-center",e==null?void 0:e.centerText,d),children:jsxs("span",{className:a$1(`text-xl font-bold leading-none ${i.text}`,e==null?void 0:e.scoreValue,d),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsx("p",{className:a$1(`text-xs font-semibold text-center ${i.text}`,e==null?void 0:e.ratingLabel,d),children:(g=ot[r])!=null?g:r}),jsxs("p",{className:a$1("text-xs ndpr-text-muted text-center",e==null?void 0:e.scoreDetail,d),children:[n," / ",p," pts"]})]})};var it={critical:"ndpr-text-destructive",important:"ndpr-text-warning",recommended:"ndpr-text-info"},Er=({gap:n,isPassed:p,onFix:r,classNames:e,unstyled:d})=>{let[t,i]=useState(false);return jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:a$1("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",e==null?void 0:e.root,d),children:[jsxs("button",{type:"button",onClick:()=>!p&&i(u=>!u),className:a$1("w-full flex items-start gap-2 text-left group",e==null?void 0:e.row,d),"aria-expanded":p?void 0:t,"aria-disabled":p,children:[jsx("span",{className:a$1(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",p?"bg-green-500":n.severity==="critical"?"bg-red-500":n.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),e==null?void 0:e.statusIcon,d),"aria-hidden":"true",children:p?jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsx("p",{className:a$1(`text-xs font-medium ${p?"ndpr-text-muted":"ndpr-text-foreground"}`,e==null?void 0:e.requirementLabel,d),children:n.requirement}),!p&&jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxs("p",{className:a$1("text-xs text-gray-400 dark:text-gray-500 mt-0.5",e==null?void 0:e.ndpaSection,d),children:["NDPA ",n.ndpaSection]})]})]}),!p&&t&&jsxs("div",{className:a$1("mt-2 ml-6 space-y-2",e==null?void 0:e.detail,d),children:[jsx("p",{className:a$1(`text-xs ${it[n.severity]}`,e==null?void 0:e.message,d),children:n.message}),jsx("button",{type:"button",onClick:()=>{r(n.requirementId),i(false);},className:a$1("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e==null?void 0:e.fixButton,d),children:n.fixLabel})]})]})};function dt(n,p){let r=p.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),e=n.map(t=>({gap:t,isPassed:false})),d={critical:0,important:1,recommended:2};return e.sort((t,i)=>d[t.gap.severity]-d[i.gap.severity]),[...e,...r]}var $r=({complianceResult:n,onFix:p,classNames:r,unstyled:e})=>{let[d,t]=useState(false),i=dt(n.gaps,n.passed);return jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,e),"aria-label":"NDPA compliance checker",children:[jsxs("div",{className:a$1("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,e),children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.title,e),children:"NDPA Compliance"}),jsx("button",{type:"button",onClick:()=>t(u=>!u),className:a$1("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,e),"aria-expanded":!d,"aria-label":d?"Expand compliance checker":"Collapse compliance checker",children:jsx("svg",{className:`w-4 h-4 transition-transform ${d?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!d&&jsxs("div",{className:a$1("p-4 space-y-4",r==null?void 0:r.body,e),children:[jsx("div",{className:a$1("flex justify-center",r==null?void 0:r.ringWrapper,e),children:jsx(Fr,{score:n.score,maxScore:n.maxScore,rating:n.rating,classNames:r,unstyled:e})}),jsx("div",{className:a$1("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,e),children:[{count:n.gaps.filter(u=>u.severity==="critical").length,label:"Critical",color:"ndpr-text-destructive"},{count:n.gaps.filter(u=>u.severity==="important").length,label:"Important",color:"ndpr-text-warning"},{count:n.passed.length,label:"Passed",color:"ndpr-text-success"}].map(({count:u,label:l,color:b})=>jsxs("div",{children:[jsx("p",{className:a$1(`text-base font-bold ${b}`,r==null?void 0:r.statValue,e),children:u}),jsx("p",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.statLabel,e),children:l})]},l))}),jsx("div",{className:a$1("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,e),children:i.length===0?jsx("p",{className:a$1("ndpr-empty-state",r==null?void 0:r.emptyState,e),children:"No requirements to display."}):i.map(({gap:u,isPassed:l})=>jsx(Er,{gap:u,isPassed:l,onFix:p,classNames:r,unstyled:e},u.requirementId))})]})]})};function pt(n){let p=Date.now()-n;return p<1e4?"just now":p<6e4?`${Math.floor(p/1e3)}s ago`:p<36e5?`${Math.floor(p/6e4)}m ago`:new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Tr=({lastSavedAt:n,isSaving:p,hasError:r,classNames:e,unstyled:d})=>{let t="idle";if(p?t="saving":r?t="error":n!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${n?pt(n):""}`;return jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:a$1(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"ndpr-card__subtitle":"ndpr-text-success"}`,e==null?void 0:e.root,d),children:[t==="saving"&&jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsx("span",{className:a$1("text-xs font-medium",e==null?void 0:e.text,d),children:i})]})};var Ro=({adapter:n,onComplete:p,classNames:r,unstyled:e,initialContext:d$1})=>{let{currentStep:t,nextStep:i,prevStep:u,canProceed:l,context:b,updateOrg:C,updateContext:g,toggleDataCategory:a$2,togglePurpose:v,addProcessor:c,removeProcessor:m,sections:B,customSections:J,sectionOverrides:Z,editSectionContent:er,addCustomSection:ir,removeCustomSection:h,reorderSections:F,complianceResult:N,applyFix:Ir,handleExportPDF:_r,handleExportDOCX:Mr,handleExportHTML:Br,handleExportMarkdown:zr,lastSavedAt:jr,isLoading:qr}=a({adapter:n,onComplete:p,initialContext:d$1}),nr=(D,K)=>{let O=URL.createObjectURL(D),H=document.createElement("a");H.href=O,H.download=K,H.click(),URL.revokeObjectURL(O);},Or=()=>d(null,null,function*(){let D=yield _r();nr(D,"privacy-policy.pdf");}),Hr=()=>d(null,null,function*(){let D=yield Mr();nr(D,"privacy-policy.docx");}),Wr=()=>{let D=Br();navigator.clipboard.writeText(D).catch(()=>{let K=new Blob([D],{type:"text/html"}),O=URL.createObjectURL(K),H=window.open(O,"_blank");H?H.addEventListener("load",()=>URL.revokeObjectURL(O)):URL.revokeObjectURL(O);});},Gr=()=>{let D=zr();navigator.clipboard.writeText(D).catch(()=>{let K=new Blob([D],{type:"text/markdown"});nr(K,"privacy-policy.md");});};return qr?jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a$1("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,e),"aria-busy":"true","aria-label":"Loading policy wizard",children:[jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsx("span",{className:"ndpr-text-sm",children:"Loading\u2026"})]}):jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a$1("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,e),children:jsxs("div",{className:a$1("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,e),children:[jsxs("div",{className:a$1("flex items-center justify-between mb-6",r==null?void 0:r.topBar,e),children:[jsx("h1",{className:a$1("text-2xl font-bold ndpr-text-foreground",r==null?void 0:r.wizardTitle,e),children:"Privacy Policy Builder"}),jsx(Tr,{lastSavedAt:jr,isSaving:false,hasError:false,classNames:r,unstyled:e})]}),jsx("div",{className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,e),children:jsx(lr,{currentStep:t,classNames:r,unstyled:e})}),jsxs("div",{className:a$1("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,e),children:[jsxs("main",{"aria-live":"polite",className:a$1("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,e),children:[t===1&&jsx(fr,{context:b,onUpdateOrg:C,classNames:r,unstyled:e}),t===2&&jsx(xr,{categories:b.dataCategories,onToggle:a$2,classNames:r,unstyled:e}),t===3&&jsx(hr,{context:b,onTogglePurpose:v,onUpdateContext:g,onAddProcessor:c,onRemoveProcessor:m,classNames:r,unstyled:e}),t===4&&jsx(Lr,{sections:B,customSections:J,sectionOverrides:Z,complianceResult:N,onEditSection:er,onAddCustomSection:ir,onRemoveCustomSection:h,onReorderSection:F,onExportPDF:Or,onExportDOCX:Hr,onExportHTML:Wr,onExportMarkdown:Gr,classNames:r,unstyled:e}),jsxs("div",{className:a$1("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,e),children:[jsx("button",{type:"button",onClick:u,disabled:t===1,className:a$1("px-4 py-2 bg-gray-200 dark:bg-gray-700 ndpr-text-foreground rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,e),children:"Back"}),jsx("div",{className:"flex items-center gap-2",children:jsxs("span",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.stepCounter,e),children:["Step ",t," of 4"]})}),t<4?jsx("button",{type:"button",onClick:i,disabled:!l,className:a$1("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,e),children:"Next"}):jsx("span",{})]})]}),jsx("aside",{className:a$1("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,e),children:jsx($r,{complianceResult:N,onFix:Ir,classNames:r,unstyled:e})})]})]})})};
2
+ export{Ro as a};
@@ -0,0 +1,3 @@
1
+ 'use strict';var chunkN3MQQUQP_js=require('./chunk-N3MQQUQP.js'),chunkQ64735OC_js=require('./chunk-Q64735OC.js'),chunkVWED6UTN_js=require('./chunk-VWED6UTN.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react');var nt=10,Rt="ndpr_policy_draft",_t=2e3;function st(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function it(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function w(u,A,M){let S=Date.now();return {id:M,title:`Privacy Policy${u.org.name?` \u2014 ${u.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:u.org.name,website:u.org.website,privacyEmail:u.org.privacyEmail,address:u.org.address,dpoName:u.org.dpoName,dpoEmail:u.org.dpoEmail,industry:u.org.industry},sections:A,variableValues:{},effectiveDate:S,lastUpdated:S,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function Ut(u={}){var K;let{onComplete:A,onComplianceChange:M}=u,S=react.useRef((K=u.adapter)!=null?K:chunkVWED6UTN_js.a(Rt));u.adapter&&(S.current=u.adapter);let f=react.useRef(it()),[P,C]=react.useState(1),[n,v]=react.useState(()=>{var t;return (t=u.initialContext)!=null?t:chunkQ64735OC_js.e()}),[b,O]=react.useState([]),[x,I]=react.useState({}),[E,$]=react.useState([]),[at,q]=react.useState(false),[ct,z]=react.useState(null),[N,U]=react.useState(true),T=react.useRef(false),R=react.useRef(null);react.useEffect(()=>{let t=false,e=r=>{r&&(f.current=r.id,v(r.templateContext),O(r.customSections),I(r.sectionOverrides),$(r.sectionOrder),C(r.currentStep),z(r.lastSavedAt),q(true));};try{let r=S.current.load();r instanceof Promise?r.then(i=>{t||(e(i),U(!1));},()=>{t||U(!1);}):(e(r),U(!1));}catch(r){t||U(false);}return ()=>{t=true;}},[]);let d=react.useMemo(()=>{let e=chunkQ64735OC_js.c(n).map(o=>x[o.id]?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{template:x[o.id]}):o),r=b.map(o=>{var l;return {id:o.id,title:o.title,template:(l=x[o.id])!=null?l:o.content,order:o.order,required:false,included:true}}),i=[...e,...r];if(E.length>0){let o=new Map(E.map((l,p)=>[l,p]));return [...i].sort((l,p)=>{let m=o.has(l.id)?o.get(l.id):i.length,y=o.has(p.id)?o.get(p.id):i.length;return m-y})}return [...i].sort((o,l)=>{var p,m;return ((p=o.order)!=null?p:0)-((m=l.order)!=null?m:0)})},[n,b,x,E]),s=react.useMemo(()=>!n.org.name&&!n.org.privacyEmail?null:w(n,d,f.current),[n,d]),Y=react.useMemo(()=>w(chunkQ64735OC_js.e(),[],f.current),[]),V=react.useMemo(()=>chunkQ64735OC_js.f(s!=null?s:Y,n),[s,n,Y]),_=V.percentage,D=V.gaps,j=react.useRef({score:-1,gaps:[]});react.useEffect(()=>{let t=j.current;M&&(_!==t.score||D!==t.gaps)&&M(_,D),j.current={score:_,gaps:D};},[_,D,M]);let lt=react.useMemo(()=>{switch(P){case 1:return n.org.name.trim().length>0&&n.org.privacyEmail.trim().length>0;case 2:return n.dataCategories.some(t=>t.selected);case 3:return n.purposes.length>0;case 4:return true;default:return false}},[P,n]),dt=react.useCallback(t=>{let e=Math.min(Math.max(1,t),4);e<4&&(T.current=false),C(e);},[]),pt=react.useCallback(()=>{C(t=>Math.min(t+1,4));},[]),ut=react.useCallback(()=>{T.current=false,C(t=>Math.max(t-1,1));},[]),mt=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},e),t));},[]),gt=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{org:chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},e.org),t)}));},[]),ft=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{dataCategories:e.dataCategories.map(r=>r.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{selected:!r.selected}):r)}));},[]),Pt=react.useCallback(t=>{v(e=>{let r=t,i=e.purposes.includes(r);return chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{purposes:i?e.purposes.filter(o=>o!==t):[...e.purposes,r]})});},[]),Ct=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{thirdPartyProcessors:[...e.thirdPartyProcessors,t]}));},[]),yt=react.useCallback(t=>{v(e=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{thirdPartyProcessors:e.thirdPartyProcessors.filter((r,i)=>i!==t)}));},[]),St=react.useCallback(t=>{O(e=>e.length>=nt?e:[...e,chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:st(),required:false})]);},[]),vt=react.useCallback((t,e)=>{O(r=>r.map(i=>i.id===t?chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},i),e):i));},[]),xt=react.useCallback(t=>{O(e=>e.filter(r=>r.id!==t)),$(e=>e.filter(r=>r!==t)),I(e=>{let r=chunkRFPLZDIO_js.a({},e);return delete r[t],r});},[]),ht=react.useCallback((t,e)=>{$(r=>{let i=r.length>0?r:d.map(m=>m.id),o=i.indexOf(t);if(o===-1){let m=d.map(It=>It.id),y=m.indexOf(t);if(y===-1)return r;let G=e==="up"?y-1:y+1;if(G<0||G>=m.length)return m;let k=[...m];return [k[y],k[G]]=[k[G],k[y]],k}let l=e==="up"?o-1:o+1;if(l<0||l>=i.length)return i;let p=[...i];return [p[o],p[l]]=[p[l],p[o]],p});},[d]),Dt=react.useCallback((t,e)=>{I(r=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{[t]:e}));},[]),bt=react.useCallback(t=>{let e=D.find(r=>r.requirementId===t);if(e)switch(e.fixType){case "fill_field":{T.current=false;let i=["data-categories-disclosed"],o=["purpose-of-processing"];i.includes(t)?C(2):o.includes(t)?C(3):(C(1));break}case "add_section":{if(!e.suggestedContent)break;O(r=>r.length>=nt?r:[...r,{id:st(),title:e.requirement,content:e.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!e.suggestedContent)break;let r="data-subject-rights";I(i=>{var l,p,m;let o=(m=(p=i[r])!=null?p:(l=d.find(y=>y.id===r))==null?void 0:l.template)!=null?m:"";return chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{[r]:`${o}
2
+
3
+ ${e.suggestedContent}`.trim()})});break}}},[D,d]),X=react.useCallback(t=>({id:f.current,templateContext:n,customSections:b,sectionOverrides:x,sectionOrder:E,currentStep:t,lastSavedAt:Date.now(),status:"draft"}),[n,b,x,E]),Ot=react.useCallback(()=>chunkRFPLZDIO_js.d(null,null,function*(){let t=X(P);try{yield Promise.resolve(S.current.save(t)),z(t.lastSavedAt),q(!0);}catch(e){console.warn("[ndpr-toolkit] Failed to save draft:",e);}}),[X,P]),Et=react.useCallback(()=>{Promise.resolve(S.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove draft:",t);}),f.current=it(),T.current=false,v(chunkQ64735OC_js.e()),O([]),I({}),$([]),C(1),q(false),z(null);},[]);react.useEffect(()=>{if(!N)return R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{let t=X(P);Promise.resolve(S.current.save(t)).then(()=>{z(t.lastSavedAt),q(true);}).catch(e=>{console.warn("[ndpr-toolkit] Auto-save failed:",e);});},_t),()=>{R.current&&clearTimeout(R.current);}},[n,b,x,E,P,N,X]),react.useEffect(()=>{P===4&&s&&A&&!T.current&&(T.current=true,A(s));},[P,s,A]);let Tt=react.useCallback(t=>chunkRFPLZDIO_js.d(null,null,function*(){let e=s!=null?s:w(n,d,f.current);return chunkN3MQQUQP_js.c(e,t)}),[s,n,d]),wt=react.useCallback(t=>chunkRFPLZDIO_js.d(null,null,function*(){let e=s!=null?s:w(n,d,f.current);return chunkN3MQQUQP_js.d(e,t)}),[s,n,d]),At=react.useCallback(t=>{let e=s!=null?s:w(n,d,f.current);return chunkN3MQQUQP_js.a(e,t)},[s,n,d]),Mt=react.useCallback(()=>{let t=s!=null?s:w(n,d,f.current);return chunkN3MQQUQP_js.b(t)},[s,n,d]);return {currentStep:P,goToStep:dt,nextStep:pt,prevStep:ut,canProceed:lt,context:n,updateContext:mt,updateOrg:gt,toggleDataCategory:ft,togglePurpose:Pt,addProcessor:Ct,removeProcessor:yt,policy:s,sections:d,customSections:b,addCustomSection:St,updateCustomSection:vt,removeCustomSection:xt,reorderSections:ht,editSectionContent:Dt,sectionOverrides:x,complianceScore:_,complianceResult:V,complianceGaps:D,applyFix:bt,handleExportPDF:Tt,handleExportDOCX:wt,handleExportHTML:At,handleExportMarkdown:Mt,isDraftSaved:at,lastSavedAt:ct,saveDraft:Ot,discardDraft:Et,isLoading:N}}exports.a=Ut;
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-ATFUSHC2.mjs';import {b}from'./chunk-UKLU6BQF.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 u=d=>{var o=d,{template:e,templateOverrides:r,initialContext:t}=o,l=c(o,["template","templateOverrides","initialContext"]);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{u as a};
@@ -0,0 +1 @@
1
+ import {e,d}from'./chunk-RMQ7OLNY.mjs';import {b,a as a$1}from'./chunk-ZJYULEER.mjs';var x={saas:{id:"saas",label:"SaaS / B2B Software",description:"Multi-tenant cloud software. Account credentials, usage analytics, cross-border transfer to the SaaS vendor, automated processing for features like spam filtering or fraud scoring.",examples:["team collaboration tools","CRM","developer tools","workflow automation"]},ecommerce:{id:"ecommerce",label:"Ecommerce / Online Store",description:"Online retail. Customer identity, payment data, shipping address, cart abandonment cookies, marketing analytics, third-party payment processors.",examples:["online retail","D2C brand","marketplace","food delivery"]},school:{id:"school",label:"School / Education",description:"Educational institution or edtech platform. Student data including minors (NDPA Section 31 \u2014 parental consent required), academic records, attendance, behavioural data for learning analytics.",examples:["K-12 school","edtech app","tutoring platform","online courses"]},healthcare:{id:"healthcare",label:"Healthcare / HealthTech",description:"Medical practice, hospital, telemedicine, or health insurance. Sensitive personal data (NDPA Section 30 \u2014 medical), prescription history, insurance claims, biometric data.",examples:["hospital","telemedicine","pharmacy","health insurance"]},procurement:{id:"procurement",label:"Procurement / B2G",description:"Government procurement, vendor management, public-sector bidding. Vendor company data, tax IDs, beneficial-owner information, contract records, sometimes politically-exposed-person (PEP) data.",examples:["e-procurement portal","vendor registry","government supplier database"]}},a={fullName:"full-name",contactDetails:"contact-details",govIds:"government-ids",credentials:"account-credentials",payment:"payment-info",financialRecords:"financial-records",bvn:"bvn",device:"device-info",usage:"usage-data",location:"location-data",cookies:"cookies",health:"health-data",biometric:"biometric-data",children:"children"};function s(e){let t=new Set(e);return d.map(r=>b(a$1({},r),{selected:t.has(r.id)}))}function h(e,t){var r,c,l,d,p,m;return t?b(a$1({},e),{org:b(a$1({},e.org),{name:(r=t.orgName)!=null?r:e.org.name,website:(c=t.website)!=null?c:e.org.website,privacyEmail:(l=t.privacyEmail)!=null?l:e.org.privacyEmail,address:(d=t.address)!=null?d:e.org.address,dpoName:(p=t.dpoName)!=null?p:e.org.dpoName,dpoEmail:(m=t.dpoEmail)!=null?m:e.org.dpoEmail})}):e}var f=["service_delivery","analytics","marketing","fraud_prevention"],y=["service_delivery","marketing","analytics","fraud_prevention","legal_compliance"],v=["service_delivery","analytics","legal_compliance"],C=["service_delivery","legal_compliance","research"],T=["service_delivery","legal_compliance","fraud_prevention"];function P(){let e$1=e();return e$1.org.industry="saas",e$1.org.orgSize="startup",e$1.dataCategories=s([a.fullName,a.contactDetails,a.credentials,a.device,a.usage,a.cookies]),e$1.purposes=f,e$1.hasChildrenData=false,e$1.hasSensitiveData=false,e$1.hasFinancialData=false,e$1.hasCrossBorderTransfer=true,e$1.hasAutomatedDecisions=false,e$1}function S(){let e$1=e();return e$1.org.industry="ecommerce",e$1.org.orgSize="midsize",e$1.dataCategories=s([a.fullName,a.contactDetails,a.payment,a.financialRecords,a.device,a.usage,a.location,a.cookies]),e$1.purposes=y,e$1.hasChildrenData=false,e$1.hasSensitiveData=false,e$1.hasFinancialData=true,e$1.hasCrossBorderTransfer=true,e$1.hasAutomatedDecisions=true,e$1}function D(){let e$1=e();return e$1.org.industry="education",e$1.org.orgSize="midsize",e$1.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.credentials,a.usage,a.cookies,a.children]),e$1.purposes=v,e$1.hasChildrenData=true,e$1.hasSensitiveData=false,e$1.hasFinancialData=false,e$1.hasCrossBorderTransfer=false,e$1.hasAutomatedDecisions=false,e$1}function E(){let e$1=e();return e$1.org.industry="healthcare",e$1.org.orgSize="enterprise",e$1.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.payment,a.health,a.biometric]),e$1.purposes=C,e$1.hasChildrenData=false,e$1.hasSensitiveData=true,e$1.hasFinancialData=true,e$1.hasCrossBorderTransfer=false,e$1.hasAutomatedDecisions=false,e$1}function O(){let e$1=e();return e$1.org.industry="government",e$1.org.orgSize="enterprise",e$1.dataCategories=s([a.fullName,a.contactDetails,a.govIds,a.financialRecords,a.bvn]),e$1.purposes=T,e$1.hasChildrenData=false,e$1.hasSensitiveData=false,e$1.hasFinancialData=true,e$1.hasCrossBorderTransfer=false,e$1.hasAutomatedDecisions=false,e$1}var g={saas:P,ecommerce:S,school:D,healthcare:E,procurement:O};function _(e,t){let r=g[e];if(!r)throw new Error(`[ndpr-toolkit] Unknown org template id: ${String(e)}. Expected one of: ${Object.keys(g).join(", ")}.`);return h(r(),t)}export{x as a,_ as b};