@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.
- package/CHANGELOG.md +49 -0
- package/README.md +31 -1
- package/dist/chunk-2MIQXECH.mjs +3 -0
- package/dist/chunk-3GRGYT3P.js +1 -0
- package/dist/chunk-5IOC3VAW.js +1 -0
- package/dist/chunk-ATFUSHC2.mjs +2 -0
- package/dist/chunk-HXWHL4BD.js +3 -0
- package/dist/chunk-R7545FP4.mjs +1 -0
- package/dist/chunk-UKLU6BQF.mjs +1 -0
- package/dist/{chunk-I2LMQWK3.js → chunk-W7OLQRJP.js} +2 -2
- package/dist/core.d.mts +70 -0
- package/dist/core.d.ts +70 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/hooks.d.mts +10 -0
- package/dist/hooks.d.ts +10 -0
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/policy.d.mts +86 -0
- package/dist/policy.d.ts +86 -0
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets-policy.d.mts +71 -0
- package/dist/presets-policy.d.ts +71 -0
- package/dist/presets-policy.js +1 -1
- package/dist/presets-policy.mjs +1 -1
- package/dist/presets.d.mts +71 -0
- package/dist/presets.d.ts +71 -0
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/server.d.mts +70 -0
- package/dist/server.d.ts +70 -0
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-BNHQFZHL.mjs +0 -2
- package/dist/chunk-O6CUBNXK.mjs +0 -3
- package/dist/chunk-RV2VMWZJ.mjs +0 -1
- package/dist/chunk-UI536RU2.js +0 -3
- package/dist/chunk-W7RBGZCC.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkUI536RU2_js=require('./chunk-UI536RU2.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),Gr=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Gr__default=/*#__PURE__*/_interopDefault(Gr);var vr=["Organization","Data Collection","Processing","Review & Export"],lr=({currentStep:d,classNames:p,unstyled:r})=>jsxRuntime.jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:chunkAME4HJR4_js.a("w-full flex items-center justify-between px-2 py-4",p==null?void 0:p.root,r),children:vr.map((e,n)=>{let t=n+1,i=t<d,u=t===d,l=n===vr.length-1;return jsxRuntime.jsxs(Gr__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsxRuntime.jsx("div",{"aria-current":u?"step":void 0,"aria-label":`Step ${t}: ${e}${i?" (completed)":u?" (current)":""}`,className:chunkAME4HJR4_js.a(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":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?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("span",{className:"text-xs leading-none",children:t})}),jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(["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})]}),!l&&jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Vr="block text-sm font-medium ndpr-text-muted mb-1",A=({id:d,label:p,required:r,description:e,children:n,classNames:t,unstyled:i})=>{let u=e?`${d}-desc`:void 0;return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col",t==null?void 0:t.field,i),children:[jsxRuntime.jsxs("label",{htmlFor:d,className:chunkAME4HJR4_js.a(Vr,t==null?void 0:t.label,i),children:[p,r&&jsxRuntime.jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),e&&jsxRuntime.jsx("p",{id:u,className:"text-xs ndpr-text-muted mb-1",children:e}),n]})},fr=({context:d,onUpdateOrg:p,classNames:r,unstyled:e})=>{var i,u,b;let n=Gr.useId(),t=d.org;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-about",className:chunkAME4HJR4_js.a("ndpr-form-section",r==null?void 0:r.root,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Organisation Details"}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:["Tell us about your organisation. Fields marked ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,e),children:[jsxRuntime.jsx(A,{id:`${n}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${n}-org-name`,type:"text",value:t.name,onChange:l=>p({name:l.target.value}),placeholder:"Acme Corporation",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${n}-website`,label:"Website",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${n}-website`,type:"url",value:t.website,onChange:l=>p({website:l.target.value}),placeholder:"https://example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${n}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${n}-privacy-email`,type:"email",value:t.privacyEmail,onChange:l=>p({privacyEmail:l.target.value}),placeholder:"privacy@example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${n}-industry`,label:"Industry",classNames:r,unstyled:e,children:jsxRuntime.jsxs("select",{id:`${n}-industry`,value:t.industry,onChange:l=>p({industry:l.target.value}),className:chunkAME4HJR4_js.a($,r==null?void 0:r.select,e),children:[jsxRuntime.jsx("option",{value:"fintech",children:"Fintech"}),jsxRuntime.jsx("option",{value:"healthcare",children:"Healthcare"}),jsxRuntime.jsx("option",{value:"ecommerce",children:"E-commerce"}),jsxRuntime.jsx("option",{value:"saas",children:"SaaS"}),jsxRuntime.jsx("option",{value:"education",children:"Education"}),jsxRuntime.jsx("option",{value:"government",children:"Government"}),jsxRuntime.jsx("option",{value:"other",children:"Other"})]})}),jsxRuntime.jsx(A,{id:`${n}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${n}-dpo-name`,type:"text",value:(i=t.dpoName)!=null?i:"",onChange:l=>p({dpoName:l.target.value}),placeholder:"Jane Smith",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${n}-dpo-email`,label:"DPO Email",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${n}-dpo-email`,type:"email",value:(u=t.dpoEmail)!=null?u:"",onChange:l=>p({dpoEmail:l.target.value}),placeholder:"dpo@example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${n}-address`,label:"Registered Address",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${n}-address`,type:"text",value:(b=t.address)!=null?b:"",onChange:l=>p({address:l.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${n}-org-size`,label:"Organisation Size",classNames:r,unstyled:e,children:jsxRuntime.jsxs("select",{id:`${n}-org-size`,value:t.orgSize,onChange:l=>p({orgSize:l.target.value}),className:chunkAME4HJR4_js.a($,r==null?void 0:r.select,e),children:[jsxRuntime.jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsxRuntime.jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsxRuntime.jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsxRuntime.jsx(A,{id:`${n}-country`,label:"Country of Operation",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${n}-country`,type:"text",value:t.country,onChange:l=>p({country:l.target.value}),placeholder:"Nigeria",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})})]})]})};var Xr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Yr=["identity","financial","behavioral","sensitive","children"],Jr=["sensitive","children"],xr=({categories:d,onToggle:p,classNames:r,unstyled:e})=>{let n=Yr.reduce((t,i)=>{let u=d.filter(b=>b.group===i);return u.length>0&&(t[i]=u),t},{});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-data",className:chunkAME4HJR4_js.a("space-y-8",r==null?void 0:r.root,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Data Categories"}),jsxRuntime.jsx("p",{id:"data-categories-desc",className:chunkAME4HJR4_js.a("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(n).map(([t,i])=>{let u=Jr.includes(t);return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-3",r==null?void 0:r.group,e),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-2",r==null?void 0:r.groupHeader,e),children:[jsxRuntime.jsx("h3",{className:chunkAME4HJR4_js.a("text-sm font-semibold uppercase tracking-wide ndpr-text-muted",r==null?void 0:r.groupTitle,e),children:Xr[t]}),u&&jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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&&jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("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."}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,e),children:i.map(b=>jsxRuntime.jsx("button",{type:"button",onClick:()=>p(b.id),"aria-pressed":b.selected,className:chunkAME4HJR4_js.a(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",b.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:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",b.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:b.selected&&jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",r==null?void 0:r.cardLabel,e),children:b.label}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,e),children:b.dataPoints.join(", ")})]})]})},b.id))})]},t)})]})};var Qr=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 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:d,checked:p,onChange:r})=>jsxRuntime.jsx("button",{id:d,type:"button",role:"switch","aria-checked":p,onClick:()=>r(!p),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",p?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsxRuntime.jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),hr=({context:d,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:e,onRemoveProcessor:n,classNames:t,unstyled:i})=>{let u=Gr.useId(),[b,l]=Gr.useState({name:"",purpose:"",country:""}),[C,g]=Gr.useState(false),a=()=>{let{name:v,purpose:c,country:S}=b;!v.trim()||!c.trim()||!S.trim()||(e({name:v.trim(),purpose:c.trim(),country:S.trim()}),l({name:"",purpose:"",country:""}),g(false));};return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-processing",className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.heading,i),children:"Processing Details"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsxRuntime.jsx("h3",{id:"purposes-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("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."}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-3",t==null?void 0:t.purposeList,i),children:Qr.map(v=>{let c=d.purposes.includes(v.value),S=`${u}-purpose-${v.value}`,B=`${u}-purpose-desc-${v.value}`;return jsxRuntime.jsxs("label",{htmlFor:S,className:chunkAME4HJR4_js.a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsxRuntime.jsx("input",{id:S,type:"checkbox",checked:c,onChange:()=>p(v.value),"aria-describedby":B,className:chunkAME4HJR4_js.a("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.purposeLabel,i),children:v.label}),jsxRuntime.jsx("p",{id:B,className:chunkAME4HJR4_js.a("ndpr-form-field__hint",t==null?void 0:t.purposeDescription,i),children:v.description})]})]},v.value)})})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{id:"thirdparty-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsxRuntime.jsx(gr,{id:`${u}-thirdparty-toggle`,checked:d.thirdPartyProcessors.length>0||C,onChange:v=>{v?g(true):(d.thirdPartyProcessors.forEach((c,S)=>n(0)),g(false));}})]}),(d.thirdPartyProcessors.length>0||C)&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.processorSection,i),children:[d.thirdPartyProcessors.length>0&&jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxRuntime.jsxs("table",{className:"w-full text-sm",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{className:chunkAME4HJR4_js.a("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:[jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsxRuntime.jsx("th",{className:"pb-2"})]})}),jsxRuntime.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:d.thirdPartyProcessors.map((v,c)=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-foreground",t==null?void 0:t.tableCell,i),children:v.name}),jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:v.purpose}),jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:v.country}),jsxRuntime.jsx("td",{className:"py-2",children:jsxRuntime.jsx("button",{type:"button",onClick:()=>n(c),className:chunkAME4HJR4_js.a("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?jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-name`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Processor Name"}),jsxRuntime.jsx("input",{id:`${u}-proc-name`,type:"text",placeholder:"Processor name",value:b.name,onChange:v=>l(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{name:v.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-purpose`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Purpose"}),jsxRuntime.jsx("input",{id:`${u}-proc-purpose`,type:"text",placeholder:"Purpose",value:b.purpose,onChange:v=>l(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{purpose:v.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-country`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Country"}),jsxRuntime.jsx("input",{id:`${u}-proc-country`,type:"text",placeholder:"Country",value:b.country,onChange:v=>l(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{country:v.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:a,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>g(false),className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--secondary ndpr-button--sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxRuntime.jsxs("button",{type:"button",onClick:()=>g(true),className:chunkAME4HJR4_js.a("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsxRuntime.jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsxRuntime.jsx("h3",{id:"disclosures-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.disclosureList,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${u}-cross-border-label`,className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsxRuntime.jsx("p",{id:`${u}-cross-border-desc`,className:chunkAME4HJR4_js.a("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."})]}),jsxRuntime.jsx(gr,{id:`${u}-cross-border-toggle`,checked:d.hasCrossBorderTransfer,onChange:v=>r({hasCrossBorderTransfer:v})})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${u}-automated-label`,className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsxRuntime.jsx("p",{id:`${u}-automated-desc`,className:chunkAME4HJR4_js.a("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."})]}),jsxRuntime.jsx(gr,{id:`${u}-automated-toggle`,checked:d.hasAutomatedDecisions,onChange:v=>r({hasAutomatedDecisions:v})})]})]})]})]})};var Cr=({section:d,index:p,isCustom:r,isEditing:e,editedContent:n,onEdit:t,onSaveEdit:i,onCancelEdit:u,onMoveUp:b,onMoveDown:l,onDelete:C,classNames:g,unstyled:a})=>{let[v,c]=Gr.useState(n!=null?n:d.template);return Gr.useEffect(()=>{n!==void 0&&c(n);},[n]),Gr.useEffect(()=>{e&&c(n!=null?n:d.template);},[e,n,d.template]),jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-section-card",className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,a),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-2",g==null?void 0:g.header,a),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,a),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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}),jsxRuntime.jsxs("h4",{className:chunkAME4HJR4_js.a("text-sm font-semibold ndpr-text-foreground truncate",g==null?void 0:g.sectionTitle,a),children:[d.title,r&&jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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"})]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,a),children:[b&&jsxRuntime.jsx("button",{type:"button",onClick:b,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${d.title}" up`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),l&&jsxRuntime.jsx("button",{type:"button",onClick:l,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${d.title}" down`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!e&&jsxRuntime.jsx("button",{type:"button",onClick:t,className:chunkAME4HJR4_js.a("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,a),"aria-label":`Edit "${d.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&C&&jsxRuntime.jsx("button",{type:"button",onClick:C,className:chunkAME4HJR4_js.a("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,a),"aria-label":`Delete "${d.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),e?jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-2",g==null?void 0:g.editArea,a),children:[jsxRuntime.jsx("textarea",{value:v,onChange:S=>c(S.target.value),rows:8,className:chunkAME4HJR4_js.a("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 ${d.title}`}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex gap-2",g==null?void 0:g.editActions,a),children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>i(v),className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",g==null?void 0:g.saveButton,a),children:"Save"}),jsxRuntime.jsx("button",{type:"button",onClick:u,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--secondary ndpr-button--sm",g==null?void 0:g.cancelButton,a),children:"Cancel"})]})]}):jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("text-sm ndpr-text-muted leading-relaxed line-clamp-4 whitespace-pre-wrap",g==null?void 0:g.content,a),children:d.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:d,nextOrder:p,classNames:r,unstyled:e})=>{let n=Gr.useId(),[t,i]=Gr.useState(""),[u,b]=Gr.useState(""),[l,C]=Gr.useState(""),g=()=>{if(!t.trim()){C("Section title is required.");return}if(!u.trim()){C("Section content is required.");return}C(""),d({title:t.trim(),content:u.trim(),order:p}),i(""),b("");};return jsxRuntime.jsxs("div",{"data-ndpr-component":"custom-section-form",className:chunkAME4HJR4_js.a("ndpr-card ndpr-card--compact",r==null?void 0:r.root,e),children:[jsxRuntime.jsx("h4",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Add Custom Section"}),l&&jsxRuntime.jsx("p",{role:"alert",className:chunkAME4HJR4_js.a("text-xs ndpr-text-destructive",r==null?void 0:r.error,e),children:l}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-3",r==null?void 0:r.fields,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${n}-custom-section-title`,className:chunkAME4HJR4_js.a("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Section Title ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("input",{id:`${n}-custom-section-title`,type:"text",value:t,onChange:a=>{i(a.target.value),l&&C("");},placeholder:"e.g. Cookie Policy",className:chunkAME4HJR4_js.a(kr,r==null?void 0:r.input,e),"aria-required":"true"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${n}-custom-section-content`,className:chunkAME4HJR4_js.a("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Content ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("textarea",{id:`${n}-custom-section-content`,value:u,onChange:a=>{b(a.target.value),l&&C("");},placeholder:"Write the section content here...",rows:5,className:chunkAME4HJR4_js.a(`${kr} resize-y`,r==null?void 0:r.textarea,e),"aria-required":"true"})]})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("flex items-center gap-2",r==null?void 0:r.footer,e),children:jsxRuntime.jsx("button",{type:"button",onClick:g,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",r==null?void 0:r.addButton,e),children:"Add Section"})})]})};var Sr={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"}},sr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:d,label:p,description:r,actionLabel:e,loading:n,onClick:t,classNames:i,unstyled:u})=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,u),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-3",i==null?void 0:i.formatHeader,u),children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,u),"aria-hidden":"true",children:d}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-section-heading",i==null?void 0:i.formatLabel,u),children:p}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",i==null?void 0:i.formatDescription,u),children:r})]})]}),jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:n,className:chunkAME4HJR4_js.a("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,u),children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):e})]}),mr=({complianceResult:d,onExportPDF:p,onExportDOCX:r,onExportHTML:e,onExportMarkdown:n,classNames:t,unstyled:i})=>{var c;let[u,b]=Gr.useState(false),[l,C]=Gr.useState(false),g=(c=Sr[d.rating])!=null?c:Sr.not_compliant,a=()=>chunkRFPLZDIO_js.d(null,null,function*(){b(true);try{yield p();}finally{b(false);}}),v=()=>chunkRFPLZDIO_js.d(null,null,function*(){C(true);try{yield r();}finally{C(false);}});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-export-panel",className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${d.percentage}%`,children:[d.percentage,"%"]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:sr[d.rating]}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.complianceDetail,i),children:[d.score," / ",d.maxScore," points \u2022"," ",d.gaps.length," gap",d.gaps.length!==1?"s":""," remaining"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:u,onClick:a,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:l,onClick:v,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsxRuntime.jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsxRuntime.jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:e,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 ndpr-text-muted",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:n,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:d,customSections:p,sectionOverrides:r,complianceResult:e,onEditSection:n,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:u,onExportPDF:b,onExportDOCX:l,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:v})=>{let[c,S]=Gr.useState(null),[B,J]=Gr.useState(false),Z=new Set(p.map(h=>h.id)),or=(h,D)=>{n(h,D),S(null);},er=d.length>0?Math.max(...d.map(h=>{var D;return (D=h.order)!=null?D:0}))+1:1;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-review",className:chunkAME4HJR4_js.a("ndpr-form-section",a==null?void 0:a.root,v),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",a==null?void 0:a.heading,v),children:"Review & Export"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",a==null?void 0:a.subheading,v),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-3",a==null?void 0:a.sectionList,v),"aria-live":"polite",children:d.map((h,D)=>jsxRuntime.jsx(Cr,{section:r[h.id]?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},h),{template:r[h.id]}):h,index:D,isCustom:Z.has(h.id),isEditing:c===h.id,editedContent:r[h.id],onEdit:()=>S(h.id),onSaveEdit:ir=>or(h.id,ir),onCancelEdit:()=>S(null),onMoveUp:D>0?()=>u(h.id,"up"):void 0,onMoveDown:D<d.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&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>J(true),className:chunkAME4HJR4_js.a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",a==null?void 0:a.addSectionButton,v),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",a==null?void 0:a.addSectionIcon,v),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),B&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-2",a==null?void 0:a.customFormWrapper,v),children:[jsxRuntime.jsx(wr,{onAdd:h=>{t(h),J(false);},nextOrder:er,classNames:a,unstyled:v}),jsxRuntime.jsx("button",{type:"button",onClick:()=>J(false),className:chunkAME4HJR4_js.a("text-sm ndpr-text-muted hover:underline",a==null?void 0:a.cancelCustomForm,v),children:"Cancel"})]}),jsxRuntime.jsx("hr",{className:chunkAME4HJR4_js.a("border-gray-200 dark:border-gray-700",a==null?void 0:a.divider,v)}),jsxRuntime.jsx(mr,{complianceResult:e,onExportPDF:b,onExportDOCX:l,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"}},tt={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Fr=({score:d,maxScore:p,rating:r,classNames:e,unstyled:n})=>{var C,g;let t=p>0?Math.round(d/p*100):0,i=(C=Dr[r])!=null?C:Dr.not_compliant,u=36,b=2*Math.PI*u,l=b-t/100*b;return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:chunkAME4HJR4_js.a("flex flex-col items-center gap-2",e==null?void 0:e.root,n),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("relative w-24 h-24",e==null?void 0:e.svgWrapper,n),children:[jsxRuntime.jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:l,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("absolute inset-0 flex flex-col items-center justify-center",e==null?void 0:e.centerText,n),children:jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a(`text-xl font-bold leading-none ${i.text}`,e==null?void 0:e.scoreValue,n),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs font-semibold text-center ${i.text}`,e==null?void 0:e.ratingLabel,n),children:(g=tt[r])!=null?g:r}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted text-center",e==null?void 0:e.scoreDetail,n),children:[d," / ",p," pts"]})]})};var et={critical:"ndpr-text-destructive",important:"ndpr-text-warning",recommended:"ndpr-text-info"},Er=({gap:d,isPassed:p,onFix:r,classNames:e,unstyled:n})=>{let[t,i]=Gr.useState(false);return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:chunkAME4HJR4_js.a("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",e==null?void 0:e.root,n),children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!p&&i(u=>!u),className:chunkAME4HJR4_js.a("w-full flex items-start gap-2 text-left group",e==null?void 0:e.row,n),"aria-expanded":p?void 0:t,"aria-disabled":p,children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",p?"bg-green-500":d.severity==="critical"?"bg-red-500":d.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),e==null?void 0:e.statusIcon,n),"aria-hidden":"true",children:p?jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs font-medium ${p?"ndpr-text-muted":"ndpr-text-foreground"}`,e==null?void 0:e.requirementLabel,n),children:d.requirement}),!p&&jsxRuntime.jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("text-xs text-gray-400 dark:text-gray-500 mt-0.5",e==null?void 0:e.ndpaSection,n),children:["NDPA ",d.ndpaSection]})]})]}),!p&&t&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mt-2 ml-6 space-y-2",e==null?void 0:e.detail,n),children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs ${et[d.severity]}`,e==null?void 0:e.message,n),children:d.message}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{r(d.requirementId),i(false);},className:chunkAME4HJR4_js.a("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e==null?void 0:e.fixButton,n),children:d.fixLabel})]})]})};function nt(d,p){let r=p.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),e=d.map(t=>({gap:t,isPassed:false})),n={critical:0,important:1,recommended:2};return e.sort((t,i)=>n[t.gap.severity]-n[i.gap.severity]),[...e,...r]}var $r=({complianceResult:d,onFix:p,classNames:r,unstyled:e})=>{let[n,t]=Gr.useState(false),i=nt(d.gaps,d.passed);return jsxRuntime.jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,e),"aria-label":"NDPA compliance checker",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,e),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.title,e),children:"NDPA Compliance"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(u=>!u),className:chunkAME4HJR4_js.a("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,e),"aria-expanded":!n,"aria-label":n?"Expand compliance checker":"Collapse compliance checker",children:jsxRuntime.jsx("svg",{className:`w-4 h-4 transition-transform ${n?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!n&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 space-y-4",r==null?void 0:r.body,e),children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("flex justify-center",r==null?void 0:r.ringWrapper,e),children:jsxRuntime.jsx(Fr,{score:d.score,maxScore:d.maxScore,rating:d.rating,classNames:r,unstyled:e})}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,e),children:[{count:d.gaps.filter(u=>u.severity==="critical").length,label:"Critical",color:"ndpr-text-destructive"},{count:d.gaps.filter(u=>u.severity==="important").length,label:"Important",color:"ndpr-text-warning"},{count:d.passed.length,label:"Passed",color:"ndpr-text-success"}].map(({count:u,label:b,color:l})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-base font-bold ${l}`,r==null?void 0:r.statValue,e),children:u}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.statLabel,e),children:b})]},b))}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,e),children:i.length===0?jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-empty-state",r==null?void 0:r.emptyState,e),children:"No requirements to display."}):i.map(({gap:u,isPassed:b})=>jsxRuntime.jsx(Er,{gap:u,isPassed:b,onFix:p,classNames:r,unstyled:e},u.requirementId))})]})]})};function dt(d){let p=Date.now()-d;return p<1e4?"just now":p<6e4?`${Math.floor(p/1e3)}s ago`:p<36e5?`${Math.floor(p/6e4)}m ago`:new Date(d).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Ir=({lastSavedAt:d,isSaving:p,hasError:r,classNames:e,unstyled:n})=>{let t="idle";if(p?t="saving":r?t="error":d!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${d?dt(d):""}`;return jsxRuntime.jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:chunkAME4HJR4_js.a(`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,n),children:[t==="saving"&&jsxRuntime.jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("text-xs font-medium",e==null?void 0:e.text,n),children:i})]})};var mo=({adapter:d,onComplete:p,classNames:r,unstyled:e})=>{let{currentStep:n,nextStep:t,prevStep:i,canProceed:u,context:b,updateOrg:l,updateContext:C,toggleDataCategory:g,togglePurpose:a,addProcessor:v,removeProcessor:c,sections:S,customSections:B,sectionOverrides:J,editSectionContent:Z,addCustomSection:or,removeCustomSection:er,reorderSections:h,complianceResult:D,applyFix:ir,handleExportPDF:Tr,handleExportDOCX:_r,handleExportHTML:Mr,handleExportMarkdown:Br,lastSavedAt:zr,isLoading:jr}=chunkUI536RU2_js.a({adapter:d,onComplete:p}),nr=(F,K)=>{let O=URL.createObjectURL(F),H=document.createElement("a");H.href=O,H.download=K,H.click(),URL.revokeObjectURL(O);},qr=()=>chunkRFPLZDIO_js.d(null,null,function*(){let F=yield Tr();nr(F,"privacy-policy.pdf");}),Or=()=>chunkRFPLZDIO_js.d(null,null,function*(){let F=yield _r();nr(F,"privacy-policy.docx");}),Hr=()=>{let F=Mr();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/html"}),O=URL.createObjectURL(K),H=window.open(O,"_blank");H?H.addEventListener("load",()=>URL.revokeObjectURL(O)):URL.revokeObjectURL(O);});},Wr=()=>{let F=Br();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/markdown"});nr(K,"privacy-policy.md");});};return jr?jsxRuntime.jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkAME4HJR4_js.a("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:[jsxRuntime.jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsxRuntime.jsx("span",{className:"ndpr-text-sm",children:"Loading\u2026"})]}):jsxRuntime.jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkAME4HJR4_js.a("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,e),children:jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,e),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between mb-6",r==null?void 0:r.topBar,e),children:[jsxRuntime.jsx("h1",{className:chunkAME4HJR4_js.a("text-2xl font-bold ndpr-text-foreground",r==null?void 0:r.wizardTitle,e),children:"Privacy Policy Builder"}),jsxRuntime.jsx(Ir,{lastSavedAt:zr,isSaving:false,hasError:false,classNames:r,unstyled:e})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,e),children:jsxRuntime.jsx(lr,{currentStep:n,classNames:r,unstyled:e})}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,e),children:[jsxRuntime.jsxs("main",{"aria-live":"polite",className:chunkAME4HJR4_js.a("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,e),children:[n===1&&jsxRuntime.jsx(fr,{context:b,onUpdateOrg:l,classNames:r,unstyled:e}),n===2&&jsxRuntime.jsx(xr,{categories:b.dataCategories,onToggle:g,classNames:r,unstyled:e}),n===3&&jsxRuntime.jsx(hr,{context:b,onTogglePurpose:a,onUpdateContext:C,onAddProcessor:v,onRemoveProcessor:c,classNames:r,unstyled:e}),n===4&&jsxRuntime.jsx(Lr,{sections:S,customSections:B,sectionOverrides:J,complianceResult:D,onEditSection:Z,onAddCustomSection:or,onRemoveCustomSection:er,onReorderSection:h,onExportPDF:qr,onExportDOCX:Or,onExportHTML:Hr,onExportMarkdown:Wr,classNames:r,unstyled:e}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,e),children:[jsxRuntime.jsx("button",{type:"button",onClick:i,disabled:n===1,className:chunkAME4HJR4_js.a("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"}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.stepCounter,e),children:["Step ",n," of 4"]})}),n<4?jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:!u,className:chunkAME4HJR4_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,e),children:"Next"}):jsxRuntime.jsx("span",{})]})]}),jsxRuntime.jsx("aside",{className:chunkAME4HJR4_js.a("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,e),children:jsxRuntime.jsx($r,{complianceResult:D,onFix:ir,classNames:r,unstyled:e})})]})]})})};
|
|
2
|
-
exports.a=
|
|
1
|
+
'use strict';var chunkHXWHL4BD_js=require('./chunk-HXWHL4BD.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),Ur=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ur__default=/*#__PURE__*/_interopDefault(Ur);var vr=["Organization","Data Collection","Processing","Review & Export"],lr=({currentStep:n,classNames:p,unstyled:r})=>jsxRuntime.jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:chunkAME4HJR4_js.a("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 jsxRuntime.jsxs(Ur__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsxRuntime.jsx("div",{"aria-current":u?"step":void 0,"aria-label":`Step ${t}: ${e}${i?" (completed)":u?" (current)":""}`,className:chunkAME4HJR4_js.a(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":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?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("span",{className:"text-xs leading-none",children:t})}),jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(["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&&jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 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 jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col",t==null?void 0:t.field,i),children:[jsxRuntime.jsxs("label",{htmlFor:n,className:chunkAME4HJR4_js.a(Xr,t==null?void 0:t.label,i),children:[p,r&&jsxRuntime.jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),e&&jsxRuntime.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=Ur.useId(),t=n.org;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-about",className:chunkAME4HJR4_js.a("ndpr-form-section",r==null?void 0:r.root,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Organisation Details"}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:["Tell us about your organisation. Fields marked ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,e),children:[jsxRuntime.jsx(A,{id:`${d}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-org-name`,type:"text",value:t.name,onChange:b=>p({name:b.target.value}),placeholder:"Acme Corporation",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${d}-website`,label:"Website",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-website`,type:"url",value:t.website,onChange:b=>p({website:b.target.value}),placeholder:"https://example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${d}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-privacy-email`,type:"email",value:t.privacyEmail,onChange:b=>p({privacyEmail:b.target.value}),placeholder:"privacy@example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${d}-industry`,label:"Industry",classNames:r,unstyled:e,children:jsxRuntime.jsxs("select",{id:`${d}-industry`,value:t.industry,onChange:b=>p({industry:b.target.value}),className:chunkAME4HJR4_js.a($,r==null?void 0:r.select,e),children:[jsxRuntime.jsx("option",{value:"fintech",children:"Fintech"}),jsxRuntime.jsx("option",{value:"healthcare",children:"Healthcare"}),jsxRuntime.jsx("option",{value:"ecommerce",children:"E-commerce"}),jsxRuntime.jsx("option",{value:"saas",children:"SaaS"}),jsxRuntime.jsx("option",{value:"education",children:"Education"}),jsxRuntime.jsx("option",{value:"government",children:"Government"}),jsxRuntime.jsx("option",{value:"other",children:"Other"})]})}),jsxRuntime.jsx(A,{id:`${d}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:e,children:jsxRuntime.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:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${d}-dpo-email`,label:"DPO Email",classNames:r,unstyled:e,children:jsxRuntime.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:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${d}-address`,label:"Registered Address",classNames:r,unstyled:e,children:jsxRuntime.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:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${d}-org-size`,label:"Organisation Size",classNames:r,unstyled:e,children:jsxRuntime.jsxs("select",{id:`${d}-org-size`,value:t.orgSize,onChange:b=>p({orgSize:b.target.value}),className:chunkAME4HJR4_js.a($,r==null?void 0:r.select,e),children:[jsxRuntime.jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsxRuntime.jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsxRuntime.jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsxRuntime.jsx(A,{id:`${d}-country`,label:"Country of Operation",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-country`,type:"text",value:t.country,onChange:b=>p({country:b.target.value}),placeholder:"Nigeria",className:chunkAME4HJR4_js.a($,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 jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-data",className:chunkAME4HJR4_js.a("space-y-8",r==null?void 0:r.root,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Data Categories"}),jsxRuntime.jsx("p",{id:"data-categories-desc",className:chunkAME4HJR4_js.a("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 jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-3",r==null?void 0:r.group,e),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-2",r==null?void 0:r.groupHeader,e),children:[jsxRuntime.jsx("h3",{className:chunkAME4HJR4_js.a("text-sm font-semibold uppercase tracking-wide ndpr-text-muted",r==null?void 0:r.groupTitle,e),children:Yr[t]}),u&&jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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&&jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("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."}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("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=>jsxRuntime.jsx("button",{type:"button",onClick:()=>p(l.id),"aria-pressed":l.selected,className:chunkAME4HJR4_js.a(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",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:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a(["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&&jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",r==null?void 0:r.cardLabel,e),children:l.label}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("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})=>jsxRuntime.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:jsxRuntime.jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),hr=({context:n,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:e,onRemoveProcessor:d,classNames:t,unstyled:i})=>{let u=Ur.useId(),[l,b]=Ur.useState({name:"",purpose:"",country:""}),[C,g]=Ur.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({name:"",purpose:"",country:""}),g(false));};return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-processing",className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.heading,i),children:"Processing Details"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsxRuntime.jsx("h3",{id:"purposes-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("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."}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("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 jsxRuntime.jsxs("label",{htmlFor:m,className:chunkAME4HJR4_js.a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsxRuntime.jsx("input",{id:m,type:"checkbox",checked:c,onChange:()=>p(v.value),"aria-describedby":B,className:chunkAME4HJR4_js.a("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.purposeLabel,i),children:v.label}),jsxRuntime.jsx("p",{id:B,className:chunkAME4HJR4_js.a("ndpr-form-field__hint",t==null?void 0:t.purposeDescription,i),children:v.description})]})]},v.value)})})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{id:"thirdparty-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsxRuntime.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)&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.processorSection,i),children:[n.thirdPartyProcessors.length>0&&jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxRuntime.jsxs("table",{className:"w-full text-sm",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{className:chunkAME4HJR4_js.a("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:[jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsxRuntime.jsx("th",{className:"pb-2"})]})}),jsxRuntime.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:n.thirdPartyProcessors.map((v,c)=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-foreground",t==null?void 0:t.tableCell,i),children:v.name}),jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:v.purpose}),jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:v.country}),jsxRuntime.jsx("td",{className:"py-2",children:jsxRuntime.jsx("button",{type:"button",onClick:()=>d(c),className:chunkAME4HJR4_js.a("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?jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-name`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Processor Name"}),jsxRuntime.jsx("input",{id:`${u}-proc-name`,type:"text",placeholder:"Processor name",value:l.name,onChange:v=>b(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{name:v.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-purpose`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Purpose"}),jsxRuntime.jsx("input",{id:`${u}-proc-purpose`,type:"text",placeholder:"Purpose",value:l.purpose,onChange:v=>b(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{purpose:v.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-country`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Country"}),jsxRuntime.jsx("input",{id:`${u}-proc-country`,type:"text",placeholder:"Country",value:l.country,onChange:v=>b(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{country:v.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:a,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>g(false),className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--secondary ndpr-button--sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxRuntime.jsxs("button",{type:"button",onClick:()=>g(true),className:chunkAME4HJR4_js.a("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsxRuntime.jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsxRuntime.jsx("h3",{id:"disclosures-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.disclosureList,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${u}-cross-border-label`,className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsxRuntime.jsx("p",{id:`${u}-cross-border-desc`,className:chunkAME4HJR4_js.a("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."})]}),jsxRuntime.jsx(gr,{id:`${u}-cross-border-toggle`,checked:n.hasCrossBorderTransfer,onChange:v=>r({hasCrossBorderTransfer:v})})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${u}-automated-label`,className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsxRuntime.jsx("p",{id:`${u}-automated-desc`,className:chunkAME4HJR4_js.a("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."})]}),jsxRuntime.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]=Ur.useState(d!=null?d:n.template);return Ur.useEffect(()=>{d!==void 0&&c(d);},[d]),Ur.useEffect(()=>{e&&c(d!=null?d:n.template);},[e,d,n.template]),jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-section-card",className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,a),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-2",g==null?void 0:g.header,a),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,a),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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}),jsxRuntime.jsxs("h4",{className:chunkAME4HJR4_js.a("text-sm font-semibold ndpr-text-foreground truncate",g==null?void 0:g.sectionTitle,a),children:[n.title,r&&jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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"})]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,a),children:[l&&jsxRuntime.jsx("button",{type:"button",onClick:l,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${n.title}" up`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),b&&jsxRuntime.jsx("button",{type:"button",onClick:b,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${n.title}" down`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!e&&jsxRuntime.jsx("button",{type:"button",onClick:t,className:chunkAME4HJR4_js.a("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,a),"aria-label":`Edit "${n.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&C&&jsxRuntime.jsx("button",{type:"button",onClick:C,className:chunkAME4HJR4_js.a("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,a),"aria-label":`Delete "${n.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),e?jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-2",g==null?void 0:g.editArea,a),children:[jsxRuntime.jsx("textarea",{value:v,onChange:m=>c(m.target.value),rows:8,className:chunkAME4HJR4_js.a("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}`}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex gap-2",g==null?void 0:g.editActions,a),children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>i(v),className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",g==null?void 0:g.saveButton,a),children:"Save"}),jsxRuntime.jsx("button",{type:"button",onClick:u,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--secondary ndpr-button--sm",g==null?void 0:g.cancelButton,a),children:"Cancel"})]})]}):jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("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=Ur.useId(),[t,i]=Ur.useState(""),[u,l]=Ur.useState(""),[b,C]=Ur.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 jsxRuntime.jsxs("div",{"data-ndpr-component":"custom-section-form",className:chunkAME4HJR4_js.a("ndpr-card ndpr-card--compact",r==null?void 0:r.root,e),children:[jsxRuntime.jsx("h4",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Add Custom Section"}),b&&jsxRuntime.jsx("p",{role:"alert",className:chunkAME4HJR4_js.a("text-xs ndpr-text-destructive",r==null?void 0:r.error,e),children:b}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-3",r==null?void 0:r.fields,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${d}-custom-section-title`,className:chunkAME4HJR4_js.a("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Section Title ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.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:chunkAME4HJR4_js.a(kr,r==null?void 0:r.input,e),"aria-required":"true"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${d}-custom-section-content`,className:chunkAME4HJR4_js.a("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Content ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.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:chunkAME4HJR4_js.a(`${kr} resize-y`,r==null?void 0:r.textarea,e),"aria-required":"true"})]})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("flex items-center gap-2",r==null?void 0:r.footer,e),children:jsxRuntime.jsx("button",{type:"button",onClick:g,className:chunkAME4HJR4_js.a("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})=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,u),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-3",i==null?void 0:i.formatHeader,u),children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,u),"aria-hidden":"true",children:n}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-section-heading",i==null?void 0:i.formatLabel,u),children:p}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",i==null?void 0:i.formatDescription,u),children:r})]})]}),jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:d,className:chunkAME4HJR4_js.a("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,u),children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):e})]}),Sr=({complianceResult:n,onExportPDF:p,onExportDOCX:r,onExportHTML:e,onExportMarkdown:d,classNames:t,unstyled:i})=>{var c;let[u,l]=Ur.useState(false),[b,C]=Ur.useState(false),g=(c=mr[n.rating])!=null?c:mr.not_compliant,a=()=>chunkRFPLZDIO_js.d(null,null,function*(){l(true);try{yield p();}finally{l(false);}}),v=()=>chunkRFPLZDIO_js.d(null,null,function*(){C(true);try{yield r();}finally{C(false);}});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-export-panel",className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${n.percentage}%`,children:[n.percentage,"%"]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:rt[n.rating]}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("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"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsxRuntime.jsx(s,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:u,onClick:a,classNames:t,unstyled:i}),jsxRuntime.jsx(s,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:b,onClick:v,classNames:t,unstyled:i}),jsxRuntime.jsx(s,{icon:jsxRuntime.jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsxRuntime.jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsxRuntime.jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:e,classNames:t,unstyled:i}),jsxRuntime.jsx(s,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 ndpr-text-muted",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:d,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,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:v})=>{let[c,m]=Ur.useState(null),[B,J]=Ur.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 jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-review",className:chunkAME4HJR4_js.a("ndpr-form-section",a==null?void 0:a.root,v),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",a==null?void 0:a.heading,v),children:"Review & Export"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",a==null?void 0:a.subheading,v),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-3",a==null?void 0:a.sectionList,v),"aria-live":"polite",children:n.map((h,F)=>jsxRuntime.jsx(Cr,{section:r[h.id]?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},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&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>J(true),className:chunkAME4HJR4_js.a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",a==null?void 0:a.addSectionButton,v),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",a==null?void 0:a.addSectionIcon,v),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),B&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-2",a==null?void 0:a.customFormWrapper,v),children:[jsxRuntime.jsx(wr,{onAdd:h=>{t(h),J(false);},nextOrder:ir,classNames:a,unstyled:v}),jsxRuntime.jsx("button",{type:"button",onClick:()=>J(false),className:chunkAME4HJR4_js.a("text-sm ndpr-text-muted hover:underline",a==null?void 0:a.cancelCustomForm,v),children:"Cancel"})]}),jsxRuntime.jsx("hr",{className:chunkAME4HJR4_js.a("border-gray-200 dark:border-gray-700",a==null?void 0:a.divider,v)}),jsxRuntime.jsx(Sr,{complianceResult:e,onExportPDF:l,onExportDOCX:b,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 jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:chunkAME4HJR4_js.a("flex flex-col items-center gap-2",e==null?void 0:e.root,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("relative w-24 h-24",e==null?void 0:e.svgWrapper,d),children:[jsxRuntime.jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsxRuntime.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"}})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("absolute inset-0 flex flex-col items-center justify-center",e==null?void 0:e.centerText,d),children:jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a(`text-xl font-bold leading-none ${i.text}`,e==null?void 0:e.scoreValue,d),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs font-semibold text-center ${i.text}`,e==null?void 0:e.ratingLabel,d),children:(g=ot[r])!=null?g:r}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("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]=Ur.useState(false);return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:chunkAME4HJR4_js.a("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",e==null?void 0:e.root,d),children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!p&&i(u=>!u),className:chunkAME4HJR4_js.a("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:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(["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?jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs font-medium ${p?"ndpr-text-muted":"ndpr-text-foreground"}`,e==null?void 0:e.requirementLabel,d),children:n.requirement}),!p&&jsxRuntime.jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("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&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mt-2 ml-6 space-y-2",e==null?void 0:e.detail,d),children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs ${it[n.severity]}`,e==null?void 0:e.message,d),children:n.message}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{r(n.requirementId),i(false);},className:chunkAME4HJR4_js.a("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",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]=Ur.useState(false),i=dt(n.gaps,n.passed);return jsxRuntime.jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,e),"aria-label":"NDPA compliance checker",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,e),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.title,e),children:"NDPA Compliance"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(u=>!u),className:chunkAME4HJR4_js.a("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,e),"aria-expanded":!d,"aria-label":d?"Expand compliance checker":"Collapse compliance checker",children:jsxRuntime.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:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!d&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 space-y-4",r==null?void 0:r.body,e),children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("flex justify-center",r==null?void 0:r.ringWrapper,e),children:jsxRuntime.jsx(Fr,{score:n.score,maxScore:n.maxScore,rating:n.rating,classNames:r,unstyled:e})}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("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})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-base font-bold ${b}`,r==null?void 0:r.statValue,e),children:u}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.statLabel,e),children:l})]},l))}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,e),children:i.length===0?jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-empty-state",r==null?void 0:r.emptyState,e),children:"No requirements to display."}):i.map(({gap:u,isPassed:l})=>jsxRuntime.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 jsxRuntime.jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:chunkAME4HJR4_js.a(`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"&&jsxRuntime.jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("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})=>{let{currentStep:t,nextStep:i,prevStep:u,canProceed:l,context:b,updateOrg:C,updateContext:g,toggleDataCategory:a,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}=chunkHXWHL4BD_js.a({adapter:n,onComplete:p,initialContext:d}),nr=(D,K)=>{let O=URL.createObjectURL(D),H=document.createElement("a");H.href=O,H.download=K,H.click(),URL.revokeObjectURL(O);},Or=()=>chunkRFPLZDIO_js.d(null,null,function*(){let D=yield _r();nr(D,"privacy-policy.pdf");}),Hr=()=>chunkRFPLZDIO_js.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?jsxRuntime.jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkAME4HJR4_js.a("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:[jsxRuntime.jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsxRuntime.jsx("span",{className:"ndpr-text-sm",children:"Loading\u2026"})]}):jsxRuntime.jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkAME4HJR4_js.a("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,e),children:jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,e),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between mb-6",r==null?void 0:r.topBar,e),children:[jsxRuntime.jsx("h1",{className:chunkAME4HJR4_js.a("text-2xl font-bold ndpr-text-foreground",r==null?void 0:r.wizardTitle,e),children:"Privacy Policy Builder"}),jsxRuntime.jsx(Tr,{lastSavedAt:jr,isSaving:false,hasError:false,classNames:r,unstyled:e})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,e),children:jsxRuntime.jsx(lr,{currentStep:t,classNames:r,unstyled:e})}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,e),children:[jsxRuntime.jsxs("main",{"aria-live":"polite",className:chunkAME4HJR4_js.a("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,e),children:[t===1&&jsxRuntime.jsx(fr,{context:b,onUpdateOrg:C,classNames:r,unstyled:e}),t===2&&jsxRuntime.jsx(xr,{categories:b.dataCategories,onToggle:a,classNames:r,unstyled:e}),t===3&&jsxRuntime.jsx(hr,{context:b,onTogglePurpose:v,onUpdateContext:g,onAddProcessor:c,onRemoveProcessor:m,classNames:r,unstyled:e}),t===4&&jsxRuntime.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}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,e),children:[jsxRuntime.jsx("button",{type:"button",onClick:u,disabled:t===1,className:chunkAME4HJR4_js.a("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"}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.stepCounter,e),children:["Step ",t," of 4"]})}),t<4?jsxRuntime.jsx("button",{type:"button",onClick:i,disabled:!l,className:chunkAME4HJR4_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,e),children:"Next"}):jsxRuntime.jsx("span",{})]})]}),jsxRuntime.jsx("aside",{className:chunkAME4HJR4_js.a("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,e),children:jsxRuntime.jsx($r,{complianceResult:N,onFix:Ir,classNames:r,unstyled:e})})]})]})})};
|
|
2
|
+
exports.a=Ro;
|
package/dist/core.d.mts
CHANGED
|
@@ -1334,6 +1334,18 @@ export declare interface NotificationRequirement {
|
|
|
1334
1334
|
nitdaNotificationDeadline?: number;
|
|
1335
1335
|
}
|
|
1336
1336
|
|
|
1337
|
+
/**
|
|
1338
|
+
* Static metadata for every template — useful for picker UIs that need
|
|
1339
|
+
* to list available templates with a one-line description.
|
|
1340
|
+
*/
|
|
1341
|
+
export declare const ORG_POLICY_TEMPLATE_REGISTRY: Record<OrgPolicyTemplateId, {
|
|
1342
|
+
id: OrgPolicyTemplateId;
|
|
1343
|
+
label: string;
|
|
1344
|
+
description: string;
|
|
1345
|
+
/** Best-fit org examples to show in the picker. */
|
|
1346
|
+
examples: readonly string[];
|
|
1347
|
+
}>;
|
|
1348
|
+
|
|
1337
1349
|
/**
|
|
1338
1350
|
* Represents organization information for a privacy policy
|
|
1339
1351
|
*/
|
|
@@ -1358,6 +1370,48 @@ export declare interface OrganizationInfo {
|
|
|
1358
1370
|
ndpcRegistrationNumber?: string;
|
|
1359
1371
|
}
|
|
1360
1372
|
|
|
1373
|
+
/**
|
|
1374
|
+
* Org-specific privacy-policy templates — pre-filled `TemplateContext`
|
|
1375
|
+
* factories for the most common Nigerian app shapes.
|
|
1376
|
+
*
|
|
1377
|
+
* Each template returns a fully-populated `TemplateContext` with:
|
|
1378
|
+
* - industry set to the matching `Industry` value
|
|
1379
|
+
* - the data categories the sector typically collects (selected: true)
|
|
1380
|
+
* - the processing purposes that match the business model
|
|
1381
|
+
* - sensitive-data / children / cross-border / automated-decisions flags
|
|
1382
|
+
* set to the defaults that org type usually needs (a school will have
|
|
1383
|
+
* children data, a hospital will have sensitive data, etc.)
|
|
1384
|
+
*
|
|
1385
|
+
* Templates are guidance starters. The wizard still walks the user through
|
|
1386
|
+
* every step — they can flip any flag, add/remove categories, or rewrite
|
|
1387
|
+
* any section before the policy is finalised. The legal-notice footer the
|
|
1388
|
+
* toolkit ships everywhere applies to the generated output.
|
|
1389
|
+
*
|
|
1390
|
+
* @example
|
|
1391
|
+
* import { templateContextFor } from '@tantainnovative/ndpr-toolkit/server';
|
|
1392
|
+
* const ctx = templateContextFor('ecommerce', { orgName: 'Acme NG' });
|
|
1393
|
+
* const draft = assemblePolicy(ctx);
|
|
1394
|
+
*/
|
|
1395
|
+
|
|
1396
|
+
/** Identifiers for the bundled org templates. */
|
|
1397
|
+
export declare type OrgPolicyTemplateId = 'saas' | 'ecommerce' | 'school' | 'healthcare' | 'procurement';
|
|
1398
|
+
|
|
1399
|
+
/** Optional overrides applied on top of a template's defaults. */
|
|
1400
|
+
export declare interface OrgPolicyTemplateOverrides {
|
|
1401
|
+
/** Organisation name (e.g. "Acme Nigeria Ltd"). Default: empty. */
|
|
1402
|
+
orgName?: string;
|
|
1403
|
+
/** Public website URL. */
|
|
1404
|
+
website?: string;
|
|
1405
|
+
/** Privacy contact email. */
|
|
1406
|
+
privacyEmail?: string;
|
|
1407
|
+
/** Postal address. */
|
|
1408
|
+
address?: string;
|
|
1409
|
+
/** DPO name. Required for DCPMI under NDPA Section 32. */
|
|
1410
|
+
dpoName?: string;
|
|
1411
|
+
/** DPO email. Required for the NDPC breach-notification contact. */
|
|
1412
|
+
dpoEmail?: string;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1361
1415
|
/** Organisation size tiers — affects complexity of generated language. */
|
|
1362
1416
|
declare type OrgSize = 'startup' | 'midsize' | 'enterprise';
|
|
1363
1417
|
|
|
@@ -1917,6 +1971,22 @@ export declare interface TemplateContext {
|
|
|
1917
1971
|
thirdPartyProcessors: ThirdPartyProcessor[];
|
|
1918
1972
|
}
|
|
1919
1973
|
|
|
1974
|
+
/**
|
|
1975
|
+
* Returns a fresh `TemplateContext` pre-filled for the given org type.
|
|
1976
|
+
* Pass `overrides` to set organisation details (name, DPO, etc.) inline.
|
|
1977
|
+
*
|
|
1978
|
+
* Calling without arguments throws — pass a known template id.
|
|
1979
|
+
*
|
|
1980
|
+
* @example
|
|
1981
|
+
* const ctx = templateContextFor('healthcare', {
|
|
1982
|
+
* orgName: 'Lagos Heart Centre',
|
|
1983
|
+
* dpoEmail: 'dpo@lhc.ng',
|
|
1984
|
+
* });
|
|
1985
|
+
*/
|
|
1986
|
+
declare function templateContextFor(id: OrgPolicyTemplateId, overrides?: OrgPolicyTemplateOverrides): TemplateContext;
|
|
1987
|
+
export { templateContextFor as createOrgTemplate }
|
|
1988
|
+
export { templateContextFor }
|
|
1989
|
+
|
|
1920
1990
|
/** A third-party entity that processes data on behalf of the organisation. */
|
|
1921
1991
|
export declare interface ThirdPartyProcessor {
|
|
1922
1992
|
/** Name of the third party. */
|
package/dist/core.d.ts
CHANGED
|
@@ -1334,6 +1334,18 @@ export declare interface NotificationRequirement {
|
|
|
1334
1334
|
nitdaNotificationDeadline?: number;
|
|
1335
1335
|
}
|
|
1336
1336
|
|
|
1337
|
+
/**
|
|
1338
|
+
* Static metadata for every template — useful for picker UIs that need
|
|
1339
|
+
* to list available templates with a one-line description.
|
|
1340
|
+
*/
|
|
1341
|
+
export declare const ORG_POLICY_TEMPLATE_REGISTRY: Record<OrgPolicyTemplateId, {
|
|
1342
|
+
id: OrgPolicyTemplateId;
|
|
1343
|
+
label: string;
|
|
1344
|
+
description: string;
|
|
1345
|
+
/** Best-fit org examples to show in the picker. */
|
|
1346
|
+
examples: readonly string[];
|
|
1347
|
+
}>;
|
|
1348
|
+
|
|
1337
1349
|
/**
|
|
1338
1350
|
* Represents organization information for a privacy policy
|
|
1339
1351
|
*/
|
|
@@ -1358,6 +1370,48 @@ export declare interface OrganizationInfo {
|
|
|
1358
1370
|
ndpcRegistrationNumber?: string;
|
|
1359
1371
|
}
|
|
1360
1372
|
|
|
1373
|
+
/**
|
|
1374
|
+
* Org-specific privacy-policy templates — pre-filled `TemplateContext`
|
|
1375
|
+
* factories for the most common Nigerian app shapes.
|
|
1376
|
+
*
|
|
1377
|
+
* Each template returns a fully-populated `TemplateContext` with:
|
|
1378
|
+
* - industry set to the matching `Industry` value
|
|
1379
|
+
* - the data categories the sector typically collects (selected: true)
|
|
1380
|
+
* - the processing purposes that match the business model
|
|
1381
|
+
* - sensitive-data / children / cross-border / automated-decisions flags
|
|
1382
|
+
* set to the defaults that org type usually needs (a school will have
|
|
1383
|
+
* children data, a hospital will have sensitive data, etc.)
|
|
1384
|
+
*
|
|
1385
|
+
* Templates are guidance starters. The wizard still walks the user through
|
|
1386
|
+
* every step — they can flip any flag, add/remove categories, or rewrite
|
|
1387
|
+
* any section before the policy is finalised. The legal-notice footer the
|
|
1388
|
+
* toolkit ships everywhere applies to the generated output.
|
|
1389
|
+
*
|
|
1390
|
+
* @example
|
|
1391
|
+
* import { templateContextFor } from '@tantainnovative/ndpr-toolkit/server';
|
|
1392
|
+
* const ctx = templateContextFor('ecommerce', { orgName: 'Acme NG' });
|
|
1393
|
+
* const draft = assemblePolicy(ctx);
|
|
1394
|
+
*/
|
|
1395
|
+
|
|
1396
|
+
/** Identifiers for the bundled org templates. */
|
|
1397
|
+
export declare type OrgPolicyTemplateId = 'saas' | 'ecommerce' | 'school' | 'healthcare' | 'procurement';
|
|
1398
|
+
|
|
1399
|
+
/** Optional overrides applied on top of a template's defaults. */
|
|
1400
|
+
export declare interface OrgPolicyTemplateOverrides {
|
|
1401
|
+
/** Organisation name (e.g. "Acme Nigeria Ltd"). Default: empty. */
|
|
1402
|
+
orgName?: string;
|
|
1403
|
+
/** Public website URL. */
|
|
1404
|
+
website?: string;
|
|
1405
|
+
/** Privacy contact email. */
|
|
1406
|
+
privacyEmail?: string;
|
|
1407
|
+
/** Postal address. */
|
|
1408
|
+
address?: string;
|
|
1409
|
+
/** DPO name. Required for DCPMI under NDPA Section 32. */
|
|
1410
|
+
dpoName?: string;
|
|
1411
|
+
/** DPO email. Required for the NDPC breach-notification contact. */
|
|
1412
|
+
dpoEmail?: string;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1361
1415
|
/** Organisation size tiers — affects complexity of generated language. */
|
|
1362
1416
|
declare type OrgSize = 'startup' | 'midsize' | 'enterprise';
|
|
1363
1417
|
|
|
@@ -1917,6 +1971,22 @@ export declare interface TemplateContext {
|
|
|
1917
1971
|
thirdPartyProcessors: ThirdPartyProcessor[];
|
|
1918
1972
|
}
|
|
1919
1973
|
|
|
1974
|
+
/**
|
|
1975
|
+
* Returns a fresh `TemplateContext` pre-filled for the given org type.
|
|
1976
|
+
* Pass `overrides` to set organisation details (name, DPO, etc.) inline.
|
|
1977
|
+
*
|
|
1978
|
+
* Calling without arguments throws — pass a known template id.
|
|
1979
|
+
*
|
|
1980
|
+
* @example
|
|
1981
|
+
* const ctx = templateContextFor('healthcare', {
|
|
1982
|
+
* orgName: 'Lagos Heart Centre',
|
|
1983
|
+
* dpoEmail: 'dpo@lhc.ng',
|
|
1984
|
+
* });
|
|
1985
|
+
*/
|
|
1986
|
+
declare function templateContextFor(id: OrgPolicyTemplateId, overrides?: OrgPolicyTemplateOverrides): TemplateContext;
|
|
1987
|
+
export { templateContextFor as createOrgTemplate }
|
|
1988
|
+
export { templateContextFor }
|
|
1989
|
+
|
|
1920
1990
|
/** A third-party entity that processes data on behalf of the organisation. */
|
|
1921
1991
|
export declare interface ThirdPartyProcessor {
|
|
1922
1992
|
/** Name of the third party. */
|
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkUAV7V4EM_js=require('./chunk-UAV7V4EM.js'),chunk4QXTB3L6_js=require('./chunk-4QXTB3L6.js'),chunk7IFSWCQP_js=require('./chunk-7IFSWCQP.js'),chunkLVGT3DLT_js=require('./chunk-LVGT3DLT.js'),chunkQPRYXVH2_js=require('./chunk-QPRYXVH2.js'),chunkQ64735OC_js=require('./chunk-Q64735OC.js'),chunkWZYCBW2R_js=require('./chunk-WZYCBW2R.js'),chunkYFBDJ4FH_js=require('./chunk-YFBDJ4FH.js'),chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunk3IA3KDII_js=require('./chunk-3IA3KDII.js'),chunkB46SJB5V_js=require('./chunk-B46SJB5V.js'),chunkL2BRFMVS_js=require('./chunk-L2BRFMVS.js'),chunkTQZWJGJ2_js=require('./chunk-TQZWJGJ2.js'),chunk3YTAOT5O_js=require('./chunk-3YTAOT5O.js'),chunkUXUMYP4L_js=require('./chunk-UXUMYP4L.js'),chunkZVOIR4QH_js=require('./chunk-ZVOIR4QH.js');require('./chunk-RFPLZDIO.js');Object.defineProperty(exports,"NDPRProvider",{enumerable:true,get:function(){return chunkUAV7V4EM_js.a}});Object.defineProperty(exports,"useNDPRConfig",{enumerable:true,get:function(){return chunkUAV7V4EM_js.b}});Object.defineProperty(exports,"useNDPRLocale",{enumerable:true,get:function(){return chunkUAV7V4EM_js.c}});Object.defineProperty(exports,"hausaLocale",{enumerable:true,get:function(){return chunk4QXTB3L6_js.c}});Object.defineProperty(exports,"igboLocale",{enumerable:true,get:function(){return chunk4QXTB3L6_js.b}});Object.defineProperty(exports,"pidginLocale",{enumerable:true,get:function(){return chunk4QXTB3L6_js.d}});Object.defineProperty(exports,"yorubaLocale",{enumerable:true,get:function(){return chunk4QXTB3L6_js.a}});Object.defineProperty(exports,"defaultLocale",{enumerable:true,get:function(){return chunk7IFSWCQP_js.a}});Object.defineProperty(exports,"mergeLocale",{enumerable:true,get:function(){return chunk7IFSWCQP_js.b}});Object.defineProperty(exports,"DEFAULT_POLICY_SECTIONS",{enumerable:true,get:function(){return chunkLVGT3DLT_js.c}});Object.defineProperty(exports,"DEFAULT_POLICY_VARIABLES",{enumerable:true,get:function(){return chunkLVGT3DLT_js.d}});Object.defineProperty(exports,"createBusinessPolicyTemplate",{enumerable:true,get:function(){return chunkLVGT3DLT_js.e}});Object.defineProperty(exports,"findUnfilledTokens",{enumerable:true,get:function(){return chunkLVGT3DLT_js.a}});Object.defineProperty(exports,"generatePolicyText",{enumerable:true,get:function(){return chunkLVGT3DLT_js.b}});Object.defineProperty(exports,"getComplianceScore",{enumerable:true,get:function(){return chunkQPRYXVH2_js.a}});Object.defineProperty(exports,"assemblePolicy",{enumerable:true,get:function(){return chunkQ64735OC_js.c}});Object.defineProperty(exports,"createDefaultContext",{enumerable:true,get:function(){return chunkQ64735OC_js.e}});Object.defineProperty(exports,"evaluatePolicyCompliance",{enumerable:true,get:function(){return chunkQ64735OC_js.f}});Object.defineProperty(exports,"assessComplianceGaps",{enumerable:true,get:function(){return chunkWZYCBW2R_js.c}});Object.defineProperty(exports,"generateLawfulBasisSummary",{enumerable:true,get:function(){return chunkWZYCBW2R_js.d}});Object.defineProperty(exports,"getLawfulBasisDescription",{enumerable:true,get:function(){return chunkWZYCBW2R_js.b}});Object.defineProperty(exports,"validateProcessingActivity",{enumerable:true,get:function(){return chunkWZYCBW2R_js.a}});Object.defineProperty(exports,"assessTransferRisk",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.h}});Object.defineProperty(exports,"getTransferMechanismDescription",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.f}});Object.defineProperty(exports,"isNDPCApprovalRequired",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.e}});Object.defineProperty(exports,"validateTransfer",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.g}});Object.defineProperty(exports,"exportROPAToCSV",{enumerable:true,get:function(){return chunk4CVBQC66_js.c}});Object.defineProperty(exports,"generateROPASummary",{enumerable:true,get:function(){return chunk4CVBQC66_js.b}});Object.defineProperty(exports,"identifyComplianceGaps",{enumerable:true,get:function(){return chunk4CVBQC66_js.d}});Object.defineProperty(exports,"validateProcessingRecord",{enumerable:true,get:function(){return chunk4CVBQC66_js.a}});Object.defineProperty(exports,"appendAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.c}});Object.defineProperty(exports,"createAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.a}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunk3IA3KDII_js.b}});Object.defineProperty(exports,"validateConsent",{enumerable:true,get:function(){return chunkB46SJB5V_js.a}});Object.defineProperty(exports,"validateConsentOptions",{enumerable:true,get:function(){return chunkB46SJB5V_js.b}});Object.defineProperty(exports,"formatDSRRequest",{enumerable:true,get:function(){return chunkL2BRFMVS_js.b}});Object.defineProperty(exports,"validateDsrSubmission",{enumerable:true,get:function(){return chunkL2BRFMVS_js.a}});Object.defineProperty(exports,"assessDPIARisk",{enumerable:true,get:function(){return chunkTQZWJGJ2_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunk3YTAOT5O_js.a}});Object.defineProperty(exports,"sanitizeInput",{enumerable:true,get:function(){return chunkUXUMYP4L_js.a}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_LONG",{enumerable:true,get:function(){return chunkZVOIR4QH_js.b}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_SHORT",{enumerable:true,get:function(){return chunkZVOIR4QH_js.a}});Object.defineProperty(exports,"legalDisclaimerBlock",{enumerable:true,get:function(){return chunkZVOIR4QH_js.c}});
|
|
1
|
+
'use strict';var chunkUAV7V4EM_js=require('./chunk-UAV7V4EM.js'),chunk4QXTB3L6_js=require('./chunk-4QXTB3L6.js'),chunk3GRGYT3P_js=require('./chunk-3GRGYT3P.js'),chunk7IFSWCQP_js=require('./chunk-7IFSWCQP.js'),chunkLVGT3DLT_js=require('./chunk-LVGT3DLT.js'),chunkQPRYXVH2_js=require('./chunk-QPRYXVH2.js'),chunkQ64735OC_js=require('./chunk-Q64735OC.js'),chunkWZYCBW2R_js=require('./chunk-WZYCBW2R.js'),chunkYFBDJ4FH_js=require('./chunk-YFBDJ4FH.js'),chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunk3IA3KDII_js=require('./chunk-3IA3KDII.js'),chunkB46SJB5V_js=require('./chunk-B46SJB5V.js'),chunkL2BRFMVS_js=require('./chunk-L2BRFMVS.js'),chunkTQZWJGJ2_js=require('./chunk-TQZWJGJ2.js'),chunk3YTAOT5O_js=require('./chunk-3YTAOT5O.js'),chunkUXUMYP4L_js=require('./chunk-UXUMYP4L.js'),chunkZVOIR4QH_js=require('./chunk-ZVOIR4QH.js');require('./chunk-RFPLZDIO.js');Object.defineProperty(exports,"NDPRProvider",{enumerable:true,get:function(){return chunkUAV7V4EM_js.a}});Object.defineProperty(exports,"useNDPRConfig",{enumerable:true,get:function(){return chunkUAV7V4EM_js.b}});Object.defineProperty(exports,"useNDPRLocale",{enumerable:true,get:function(){return chunkUAV7V4EM_js.c}});Object.defineProperty(exports,"hausaLocale",{enumerable:true,get:function(){return chunk4QXTB3L6_js.c}});Object.defineProperty(exports,"igboLocale",{enumerable:true,get:function(){return chunk4QXTB3L6_js.b}});Object.defineProperty(exports,"pidginLocale",{enumerable:true,get:function(){return chunk4QXTB3L6_js.d}});Object.defineProperty(exports,"yorubaLocale",{enumerable:true,get:function(){return chunk4QXTB3L6_js.a}});Object.defineProperty(exports,"ORG_POLICY_TEMPLATE_REGISTRY",{enumerable:true,get:function(){return chunk3GRGYT3P_js.a}});Object.defineProperty(exports,"createOrgTemplate",{enumerable:true,get:function(){return chunk3GRGYT3P_js.b}});Object.defineProperty(exports,"templateContextFor",{enumerable:true,get:function(){return chunk3GRGYT3P_js.b}});Object.defineProperty(exports,"defaultLocale",{enumerable:true,get:function(){return chunk7IFSWCQP_js.a}});Object.defineProperty(exports,"mergeLocale",{enumerable:true,get:function(){return chunk7IFSWCQP_js.b}});Object.defineProperty(exports,"DEFAULT_POLICY_SECTIONS",{enumerable:true,get:function(){return chunkLVGT3DLT_js.c}});Object.defineProperty(exports,"DEFAULT_POLICY_VARIABLES",{enumerable:true,get:function(){return chunkLVGT3DLT_js.d}});Object.defineProperty(exports,"createBusinessPolicyTemplate",{enumerable:true,get:function(){return chunkLVGT3DLT_js.e}});Object.defineProperty(exports,"findUnfilledTokens",{enumerable:true,get:function(){return chunkLVGT3DLT_js.a}});Object.defineProperty(exports,"generatePolicyText",{enumerable:true,get:function(){return chunkLVGT3DLT_js.b}});Object.defineProperty(exports,"getComplianceScore",{enumerable:true,get:function(){return chunkQPRYXVH2_js.a}});Object.defineProperty(exports,"assemblePolicy",{enumerable:true,get:function(){return chunkQ64735OC_js.c}});Object.defineProperty(exports,"createDefaultContext",{enumerable:true,get:function(){return chunkQ64735OC_js.e}});Object.defineProperty(exports,"evaluatePolicyCompliance",{enumerable:true,get:function(){return chunkQ64735OC_js.f}});Object.defineProperty(exports,"assessComplianceGaps",{enumerable:true,get:function(){return chunkWZYCBW2R_js.c}});Object.defineProperty(exports,"generateLawfulBasisSummary",{enumerable:true,get:function(){return chunkWZYCBW2R_js.d}});Object.defineProperty(exports,"getLawfulBasisDescription",{enumerable:true,get:function(){return chunkWZYCBW2R_js.b}});Object.defineProperty(exports,"validateProcessingActivity",{enumerable:true,get:function(){return chunkWZYCBW2R_js.a}});Object.defineProperty(exports,"assessTransferRisk",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.h}});Object.defineProperty(exports,"getTransferMechanismDescription",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.f}});Object.defineProperty(exports,"isNDPCApprovalRequired",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.e}});Object.defineProperty(exports,"validateTransfer",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.g}});Object.defineProperty(exports,"exportROPAToCSV",{enumerable:true,get:function(){return chunk4CVBQC66_js.c}});Object.defineProperty(exports,"generateROPASummary",{enumerable:true,get:function(){return chunk4CVBQC66_js.b}});Object.defineProperty(exports,"identifyComplianceGaps",{enumerable:true,get:function(){return chunk4CVBQC66_js.d}});Object.defineProperty(exports,"validateProcessingRecord",{enumerable:true,get:function(){return chunk4CVBQC66_js.a}});Object.defineProperty(exports,"appendAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.c}});Object.defineProperty(exports,"createAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.a}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunk3IA3KDII_js.b}});Object.defineProperty(exports,"validateConsent",{enumerable:true,get:function(){return chunkB46SJB5V_js.a}});Object.defineProperty(exports,"validateConsentOptions",{enumerable:true,get:function(){return chunkB46SJB5V_js.b}});Object.defineProperty(exports,"formatDSRRequest",{enumerable:true,get:function(){return chunkL2BRFMVS_js.b}});Object.defineProperty(exports,"validateDsrSubmission",{enumerable:true,get:function(){return chunkL2BRFMVS_js.a}});Object.defineProperty(exports,"assessDPIARisk",{enumerable:true,get:function(){return chunkTQZWJGJ2_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunk3YTAOT5O_js.a}});Object.defineProperty(exports,"sanitizeInput",{enumerable:true,get:function(){return chunkUXUMYP4L_js.a}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_LONG",{enumerable:true,get:function(){return chunkZVOIR4QH_js.b}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_SHORT",{enumerable:true,get:function(){return chunkZVOIR4QH_js.a}});Object.defineProperty(exports,"legalDisclaimerBlock",{enumerable:true,get:function(){return chunkZVOIR4QH_js.c}});
|
package/dist/core.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as NDPRProvider,b as useNDPRConfig,c as useNDPRLocale}from'./chunk-EEQALYOY.mjs';export{c as hausaLocale,b as igboLocale,d as pidginLocale,a as yorubaLocale}from'./chunk-LQTARVPU.mjs';export{a as defaultLocale,b as mergeLocale}from'./chunk-HWHBINVN.mjs';export{c as DEFAULT_POLICY_SECTIONS,d as DEFAULT_POLICY_VARIABLES,e as createBusinessPolicyTemplate,a as findUnfilledTokens,b as generatePolicyText}from'./chunk-Y3MKMAFQ.mjs';export{a as getComplianceScore}from'./chunk-EFIBHKQE.mjs';export{c as assemblePolicy,e as createDefaultContext,f as evaluatePolicyCompliance}from'./chunk-RMQ7OLNY.mjs';export{c as assessComplianceGaps,d as generateLawfulBasisSummary,b as getLawfulBasisDescription,a as validateProcessingActivity}from'./chunk-LWIKDDSU.mjs';export{h as assessTransferRisk,f as getTransferMechanismDescription,e as isNDPCApprovalRequired,g as validateTransfer}from'./chunk-7BJXI2HI.mjs';export{c as exportROPAToCSV,b as generateROPASummary,d as identifyComplianceGaps,a as validateProcessingRecord}from'./chunk-XP5PL6K7.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-V7UFP6QU.mjs';export{a as validateConsent,b as validateConsentOptions}from'./chunk-PJNKQPQP.mjs';export{b as formatDSRRequest,a as validateDsrSubmission}from'./chunk-RZ6GC6WN.mjs';export{a as assessDPIARisk}from'./chunk-LRRENTT5.mjs';export{a as calculateBreachSeverity}from'./chunk-WTGKZX7J.mjs';export{a as sanitizeInput}from'./chunk-EWVK45Z3.mjs';export{b as LEGAL_DISCLAIMER_LONG,a as LEGAL_DISCLAIMER_SHORT,c as legalDisclaimerBlock}from'./chunk-ITCY2Z66.mjs';import'./chunk-ZJYULEER.mjs';
|
|
1
|
+
export{a as NDPRProvider,b as useNDPRConfig,c as useNDPRLocale}from'./chunk-EEQALYOY.mjs';export{c as hausaLocale,b as igboLocale,d as pidginLocale,a as yorubaLocale}from'./chunk-LQTARVPU.mjs';export{a as ORG_POLICY_TEMPLATE_REGISTRY,b as createOrgTemplate,b as templateContextFor}from'./chunk-UKLU6BQF.mjs';export{a as defaultLocale,b as mergeLocale}from'./chunk-HWHBINVN.mjs';export{c as DEFAULT_POLICY_SECTIONS,d as DEFAULT_POLICY_VARIABLES,e as createBusinessPolicyTemplate,a as findUnfilledTokens,b as generatePolicyText}from'./chunk-Y3MKMAFQ.mjs';export{a as getComplianceScore}from'./chunk-EFIBHKQE.mjs';export{c as assemblePolicy,e as createDefaultContext,f as evaluatePolicyCompliance}from'./chunk-RMQ7OLNY.mjs';export{c as assessComplianceGaps,d as generateLawfulBasisSummary,b as getLawfulBasisDescription,a as validateProcessingActivity}from'./chunk-LWIKDDSU.mjs';export{h as assessTransferRisk,f as getTransferMechanismDescription,e as isNDPCApprovalRequired,g as validateTransfer}from'./chunk-7BJXI2HI.mjs';export{c as exportROPAToCSV,b as generateROPASummary,d as identifyComplianceGaps,a as validateProcessingRecord}from'./chunk-XP5PL6K7.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-V7UFP6QU.mjs';export{a as validateConsent,b as validateConsentOptions}from'./chunk-PJNKQPQP.mjs';export{b as formatDSRRequest,a as validateDsrSubmission}from'./chunk-RZ6GC6WN.mjs';export{a as assessDPIARisk}from'./chunk-LRRENTT5.mjs';export{a as calculateBreachSeverity}from'./chunk-WTGKZX7J.mjs';export{a as sanitizeInput}from'./chunk-EWVK45Z3.mjs';export{b as LEGAL_DISCLAIMER_LONG,a as LEGAL_DISCLAIMER_SHORT,c as legalDisclaimerBlock}from'./chunk-ITCY2Z66.mjs';import'./chunk-ZJYULEER.mjs';
|
package/dist/hooks.d.mts
CHANGED
|
@@ -1406,6 +1406,16 @@ export declare interface UseAdaptivePolicyWizardOptions {
|
|
|
1406
1406
|
adapter?: StorageAdapter<PolicyDraft>;
|
|
1407
1407
|
onComplete?: (policy: PrivacyPolicy) => void;
|
|
1408
1408
|
onComplianceChange?: (score: number, gaps: ComplianceGap[]) => void;
|
|
1409
|
+
/**
|
|
1410
|
+
* Initial template context. Use an org-template factory like
|
|
1411
|
+
* `templateContextFor('healthcare')` to start the wizard with a sector-
|
|
1412
|
+
* specific pre-fill (lawful basis, data categories, sensitive-data flag,
|
|
1413
|
+
* cross-border default). Defaults to `createDefaultContext()` if omitted.
|
|
1414
|
+
*
|
|
1415
|
+
* If an adapter loads a saved draft, the draft's context wins — the
|
|
1416
|
+
* `initialContext` only seeds the very first session.
|
|
1417
|
+
*/
|
|
1418
|
+
initialContext?: TemplateContext;
|
|
1409
1419
|
}
|
|
1410
1420
|
|
|
1411
1421
|
export declare interface UseAdaptivePolicyWizardReturn {
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1406,6 +1406,16 @@ export declare interface UseAdaptivePolicyWizardOptions {
|
|
|
1406
1406
|
adapter?: StorageAdapter<PolicyDraft>;
|
|
1407
1407
|
onComplete?: (policy: PrivacyPolicy) => void;
|
|
1408
1408
|
onComplianceChange?: (score: number, gaps: ComplianceGap[]) => void;
|
|
1409
|
+
/**
|
|
1410
|
+
* Initial template context. Use an org-template factory like
|
|
1411
|
+
* `templateContextFor('healthcare')` to start the wizard with a sector-
|
|
1412
|
+
* specific pre-fill (lawful basis, data categories, sensitive-data flag,
|
|
1413
|
+
* cross-border default). Defaults to `createDefaultContext()` if omitted.
|
|
1414
|
+
*
|
|
1415
|
+
* If an adapter loads a saved draft, the draft's context wins — the
|
|
1416
|
+
* `initialContext` only seeds the very first session.
|
|
1417
|
+
*/
|
|
1418
|
+
initialContext?: TemplateContext;
|
|
1409
1419
|
}
|
|
1410
1420
|
|
|
1411
1421
|
export declare interface UseAdaptivePolicyWizardReturn {
|
package/dist/hooks.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var chunkRYREGZVQ_js=require('./chunk-RYREGZVQ.js'),chunkZ763UI5U_js=require('./chunk-Z763UI5U.js'),chunkUTFBKL73_js=require('./chunk-UTFBKL73.js'),chunkHHK5LHEG_js=require('./chunk-HHK5LHEG.js'),chunk3JPDTXGC_js=require('./chunk-3JPDTXGC.js'),
|
|
2
|
+
'use strict';var chunkRYREGZVQ_js=require('./chunk-RYREGZVQ.js'),chunkZ763UI5U_js=require('./chunk-Z763UI5U.js'),chunkUTFBKL73_js=require('./chunk-UTFBKL73.js'),chunkHHK5LHEG_js=require('./chunk-HHK5LHEG.js'),chunk3JPDTXGC_js=require('./chunk-3JPDTXGC.js'),chunkHXWHL4BD_js=require('./chunk-HXWHL4BD.js');require('./chunk-N3MQQUQP.js'),require('./chunk-LVGT3DLT.js'),require('./chunk-QPRYXVH2.js'),require('./chunk-Q64735OC.js'),require('./chunk-WZYCBW2R.js'),require('./chunk-YFBDJ4FH.js'),require('./chunk-4CVBQC66.js');var chunkP4LNLCSF_js=require('./chunk-P4LNLCSF.js'),chunkL2VO3MEJ_js=require('./chunk-L2VO3MEJ.js');require('./chunk-7ZZO7GVB.js'),require('./chunk-B46SJB5V.js');var chunkHBLGN4SD_js=require('./chunk-HBLGN4SD.js');require('./chunk-L2BRFMVS.js');var chunkC7IDR2IV_js=require('./chunk-C7IDR2IV.js');require('./chunk-TQZWJGJ2.js');var chunkVJTQXVAF_js=require('./chunk-VJTQXVAF.js');require('./chunk-3YTAOT5O.js'),require('./chunk-ZVOIR4QH.js'),require('./chunk-VWED6UTN.js'),require('./chunk-RFPLZDIO.js');Object.defineProperty(exports,"useComplianceScore",{enumerable:true,get:function(){return chunkRYREGZVQ_js.a}});Object.defineProperty(exports,"useDefaultPrivacyPolicy",{enumerable:true,get:function(){return chunkZ763UI5U_js.b}});Object.defineProperty(exports,"usePrivacyPolicy",{enumerable:true,get:function(){return chunkZ763UI5U_js.a}});Object.defineProperty(exports,"useLawfulBasis",{enumerable:true,get:function(){return chunkUTFBKL73_js.a}});Object.defineProperty(exports,"useCrossBorderTransfer",{enumerable:true,get:function(){return chunkHHK5LHEG_js.a}});Object.defineProperty(exports,"useROPA",{enumerable:true,get:function(){return chunk3JPDTXGC_js.a}});Object.defineProperty(exports,"useAdaptivePolicyWizard",{enumerable:true,get:function(){return chunkHXWHL4BD_js.a}});Object.defineProperty(exports,"useConsent",{enumerable:true,get:function(){return chunkP4LNLCSF_js.a}});Object.defineProperty(exports,"useFocusTrap",{enumerable:true,get:function(){return chunkL2VO3MEJ_js.a}});Object.defineProperty(exports,"useDSR",{enumerable:true,get:function(){return chunkHBLGN4SD_js.a}});Object.defineProperty(exports,"useDPIA",{enumerable:true,get:function(){return chunkC7IDR2IV_js.a}});Object.defineProperty(exports,"useBreach",{enumerable:true,get:function(){return chunkVJTQXVAF_js.a}});
|
package/dist/hooks.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{a as useComplianceScore}from'./chunk-W65ZWTLD.mjs';export{b as useDefaultPrivacyPolicy,a as usePrivacyPolicy}from'./chunk-VYAL2TGT.mjs';export{a as useLawfulBasis}from'./chunk-4G3SRVRI.mjs';export{a as useCrossBorderTransfer}from'./chunk-KDAZQO3N.mjs';export{a as useROPA}from'./chunk-RPXRPGHL.mjs';export{a as useAdaptivePolicyWizard}from'./chunk-
|
|
2
|
+
export{a as useComplianceScore}from'./chunk-W65ZWTLD.mjs';export{b as useDefaultPrivacyPolicy,a as usePrivacyPolicy}from'./chunk-VYAL2TGT.mjs';export{a as useLawfulBasis}from'./chunk-4G3SRVRI.mjs';export{a as useCrossBorderTransfer}from'./chunk-KDAZQO3N.mjs';export{a as useROPA}from'./chunk-RPXRPGHL.mjs';export{a as useAdaptivePolicyWizard}from'./chunk-2MIQXECH.mjs';import'./chunk-AOHKVFAS.mjs';import'./chunk-Y3MKMAFQ.mjs';import'./chunk-EFIBHKQE.mjs';import'./chunk-RMQ7OLNY.mjs';import'./chunk-LWIKDDSU.mjs';import'./chunk-7BJXI2HI.mjs';import'./chunk-XP5PL6K7.mjs';export{a as useConsent}from'./chunk-PCU6GKBE.mjs';export{a as useFocusTrap}from'./chunk-YTU4FNM2.mjs';import'./chunk-UASG46LP.mjs';import'./chunk-PJNKQPQP.mjs';export{a as useDSR}from'./chunk-MPBPAEZC.mjs';import'./chunk-RZ6GC6WN.mjs';export{a as useDPIA}from'./chunk-H3XJV2IR.mjs';import'./chunk-LRRENTT5.mjs';export{a as useBreach}from'./chunk-3HOXQNCH.mjs';import'./chunk-WTGKZX7J.mjs';import'./chunk-ITCY2Z66.mjs';import'./chunk-DBZSN4WP.mjs';import'./chunk-ZJYULEER.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -3904,6 +3904,16 @@ export declare interface UseAdaptivePolicyWizardOptions {
|
|
|
3904
3904
|
adapter?: StorageAdapter<PolicyDraft>;
|
|
3905
3905
|
onComplete?: (policy: PrivacyPolicy) => void;
|
|
3906
3906
|
onComplianceChange?: (score: number, gaps: ComplianceGap[]) => void;
|
|
3907
|
+
/**
|
|
3908
|
+
* Initial template context. Use an org-template factory like
|
|
3909
|
+
* `templateContextFor('healthcare')` to start the wizard with a sector-
|
|
3910
|
+
* specific pre-fill (lawful basis, data categories, sensitive-data flag,
|
|
3911
|
+
* cross-border default). Defaults to `createDefaultContext()` if omitted.
|
|
3912
|
+
*
|
|
3913
|
+
* If an adapter loads a saved draft, the draft's context wins — the
|
|
3914
|
+
* `initialContext` only seeds the very first session.
|
|
3915
|
+
*/
|
|
3916
|
+
initialContext?: TemplateContext;
|
|
3907
3917
|
}
|
|
3908
3918
|
|
|
3909
3919
|
export declare interface UseAdaptivePolicyWizardReturn {
|
package/dist/index.d.ts
CHANGED
|
@@ -3904,6 +3904,16 @@ export declare interface UseAdaptivePolicyWizardOptions {
|
|
|
3904
3904
|
adapter?: StorageAdapter<PolicyDraft>;
|
|
3905
3905
|
onComplete?: (policy: PrivacyPolicy) => void;
|
|
3906
3906
|
onComplianceChange?: (score: number, gaps: ComplianceGap[]) => void;
|
|
3907
|
+
/**
|
|
3908
|
+
* Initial template context. Use an org-template factory like
|
|
3909
|
+
* `templateContextFor('healthcare')` to start the wizard with a sector-
|
|
3910
|
+
* specific pre-fill (lawful basis, data categories, sensitive-data flag,
|
|
3911
|
+
* cross-border default). Defaults to `createDefaultContext()` if omitted.
|
|
3912
|
+
*
|
|
3913
|
+
* If an adapter loads a saved draft, the draft's context wins — the
|
|
3914
|
+
* `initialContext` only seeds the very first session.
|
|
3915
|
+
*/
|
|
3916
|
+
initialContext?: TemplateContext;
|
|
3907
3917
|
}
|
|
3908
3918
|
|
|
3909
3919
|
export declare interface UseAdaptivePolicyWizardReturn {
|