// @requirements REQ-PRODUCT-MOBILE REQ-PRODUCT-A11Y // Only explicit demonstration entry points receive this frame. Compiled legal documents and pinned artifacts stay byte-for-byte intact. import {readFile} from 'node:fs/promises'; const leaf=''; const profiles={ 'storage-exceptions/index.html':['exceptions','storage-exceptions'], 'orders/mixed/index.html':['orders','paid-orders'],'dark/orders/mixed/index.html':['orders','paid-orders'], 'orders/deferred/index.html':['orders','paid-orders'],'dark/orders/deferred/index.html':['orders','paid-orders'], 'orders/conditional/index.html':['orders','paid-orders'],'dark/orders/conditional/index.html':['orders','paid-orders'], 'catalog-releases/index.html':['catalog-releases','service-catalog'], 'services/index.html':['services','services'], 'dark/services/index.html':['services','services'], 'contract-actions/withdrawal/index.html':['contracts','contract-actions'], 'contract-actions/cancellation/index.html':['contracts','contract-actions'], 'dark/contract-actions/withdrawal/index.html':['contracts','contract-actions'], 'dark/contract-actions/cancellation/index.html':['contracts','contract-actions'], 'google-basic/index.html':['google','google-basic'], 'dark/google-basic/index.html':['google','google-basic'], 'index.html':['overview','package'], 'brand/index.html':['brand','package'], 'form-permissions/react/index.html':['permissions','react'], 'dark/form-permissions/react/index.html':['permissions','react'], 'form-permissions/index.html':['permissions','form-permissions'], 'dark/form-permissions/index.html':['permissions','form-permissions'], 'agreement/index.html':['agreement','terms'], 'dark/agreement/index.html':['agreement','terms'], 'react/index.html':['react','react'], 'dark/react/index.html':['react','react'], 'collection/index.html':['collection','collection'],'dark/collection/index.html':['collection','collection'], 'indirect-collection/index.html':['indirect-collection','indirect-collection'],'dark/indirect-collection/index.html':['indirect-collection','indirect-collection'], 'guarantees/index.html':['guarantees','guarantees'],'dark/guarantees/index.html':['guarantees','guarantees'], 'guarantees/product/index.html':['producer-guarantee','guarantee-labels'],'dark/guarantees/product/index.html':['producer-guarantee','guarantee-labels'], 'embeds/index.html':['embeds','embeds'],'embeds/frame/index.html':['frame','embeds'], 'privacy-signals/index.html':['signals','privacy-signals'], 'processing-choices/index.html':['processing','processing-choices'], 'storage-cleanup/index.html':['storage','storage-cleanup'],'releases/index.html':['releases','releases'], 'rights/index.html':['rights','rights'],'dark/rights/index.html':['rights','rights'], 'scope-guards/index.html':['guards','scope-guards'],'dark/scope-guards/index.html':['guards','scope-guards'], 'repeat-prompts/index.html':['regions','regional-prompts'],'dark/repeat-prompts/index.html':['regions','regional-prompts'], }; export async function styleExamplePages(files){ const result={...files,'assets/example-pages.css':await readFile(new URL('./example-pages.css',import.meta.url),'utf8'),'assets/example-theme.css':await readFile(new URL('./example-theme.css',import.meta.url),'utf8')}; const allProfiles={...profiles};for(const path of Object.keys(files))if(/^(?:dark\/)?rights\/workflow\/[a-z-]+\/index.html$/u.test(path))allProfiles[path]=['rights-workflow','rights']; for(const [path,[kind,guide]] of Object.entries(allProfiles)){ if(typeof result[path]!=='string')throw new Error('A styled example entry point is missing.'); let html=result[path];const dark=path.startsWith('dark/'); html=html.replace('',''); html=html.replace(/
/u,``); // Header stays outside framework hydration roots. The framework-owned main/controls are not rewritten. html=html.replace(/