// @requirements REQ-PRODUCT-CF-HOST REQ-PRODUCT-MOBILE REQ-PRODUCT-A11Y import {siteSections,guideSectionUrl,stageDirectory,stageForSection,areaContinuation} from './navigation.mjs'; const arrow='',e=value=>String(value).replace(/[&<>"']/gu,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); function topicCard(topic,level=2){const h='h'+level,relatedLabel=topic.variants.every(v=>v.href.startsWith('/guide/'))?'Resources':'Variants';return `
<${h} id="example-${topic.id}">${e(topic.title)}

${e(topic.description)}

Open example ${arrow}Integration guide
${topic.variants.length?``:''}
`;} const firstSteps=`

First examples

Start with the basics

Read a legal page, then try a cookie choice. Each works on its own.

01 / Publish a document

Legal pages ${arrow}

Privacy, cookie and terms pages rendered as ordinary HTML.

02 / Add a choice

Cookie choices ${arrow}

Accept, reject or choose purposes and inspect which services may run.

`; export function examplesBody({sectionId}={}){ if(sectionId){ const section=siteSections.find(s=>s.id===sectionId);if(!section)throw Error('Unknown example section.'); const groups=section.groups.filter(g=>g.topicIds.length); return `
← All examples

${e(stageForSection(section).title)} / Examples

${e(section.title)}

${e(section.description)}

Guides for this area →
${groups.map((group,i)=>{ const heading=`

${group.specialist?'For specific integrations':String(i+1).padStart(2,'0')}

${e(group.title)}

${e(group.description)}

`,cards=`
${group.topicIds.map(id=>topicCard(section.topics.find(t=>t.id===id),3)).join('')}
`; return group.specialist?`
${heading}${cards}
`:`
${heading}${cards}
`; }).join('')}

Continue from here

`; } return `

Notabenda examples

Find your
starting point

Explore one part of your integration at a time. Start with the basics, or choose the area you’re working on.

Start building ${arrow}
${firstSteps}

Browse by task

Choose an area

Follow the three stages, or jump to the area you need. Each topic keeps its example, guide and variants together.

${stageDirectory()}

Need a configuration?

Work through your site

The setup guide asks about your practices and keeps the reasons behind each recommendation.

Open guided setup ${arrow}Or use the local CLI wizard →
`; }