<!doctype html><script>
window.__driftlessDemoEnquiry = function(url, event) {
if (!event.isTrusted) return false;
var target; try { target = new URL(url, location.href); } catch { return false; }
var managed = new URL("https://driftless-staging-staging.up.railway.app/showcase/demo-action?intent=enquiry");
if (target.origin !== managed.origin || target.pathname !== managed.pathname || target.username || target.password
|| target.hash || target.searchParams.getAll('intent').length !== 1 || target.searchParams.get('intent') !== 'enquiry') return false;
for (var entry of target.searchParams) {
if (!['case', 'intent', 'item', 'product'].includes(entry[0]) || target.searchParams.getAll(entry[0]).length !== 1 || entry[1].length > 256) return false;
}
event.stopImmediatePropagation();
if (event.type === 'click' || event.type === 'submit') {
event.preventDefault();
top.location.href = managed.href;
}
return true;
};
// Published bundles may still carry the older capture-phase guard.
for (var name of ['pointerdown', 'mousedown', 'touchstart', 'click', 'keydown', 'submit']) {
addEventListener(name, function(event) {
if (event.type === 'keydown' && !['Enter', ' '].includes(event.key)) return;
var control = event.type === 'submit' ? event.target
: event.target && event.target.closest && event.target.closest('a[href],button,input[type="submit"]');
if (!control) return;
var url = control.tagName === 'FORM' ? control.getAttribute('action')
: control.getAttribute('href') || control.getAttribute('formaction')
|| (control.type === 'submit' && control.form && control.form.getAttribute('action'));
if (url) window.__driftlessDemoEnquiry(url, event);
}, {capture: true, passive: false});
}
</script><script src="/driftless-showcase-actions.js" data-driftless-showcase-actions data-action-url="https://driftless-staging-staging.up.railway.app/showcase/demo-action" data-legal-copy="DriftLess demonstration. Démonstration uniquement. Il ne s’agit pas d’une entreprise immatriculée. Aucun numéro d’organisation ou de TVA n’est publié." data-navigation-paths="["/collection"]"></script><html lang="fr"><head><base target="_top"><script data-driftless-demo-navigation>
window.__driftlessDemoNavigate = function(url, replace) {
parent.postMessage({type: 'driftless-demo-navigation', url: url, replace: replace}, '*');
};
document.addEventListener('click', function(event) {
var link = event.target && event.target.closest && event.target.closest('a[href]');
if (!link || event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey
|| link.hasAttribute('download') || link.getAttribute('target') === '_blank') return;
var url; try { url = new URL(link.getAttribute('href'), location.href); } catch { return; }
if (url.origin !== location.origin) return;
var root = window.__driftlessPreviewRootPath;
if (root && url.pathname !== root && !url.pathname.startsWith(root + '/')) url.pathname = root + url.pathname;
if (url.pathname === location.pathname && url.search === location.search) return;
url.searchParams.delete('__driftless_demo_frame');
event.preventDefault(); event.stopImmediatePropagation(); top.location.href = url.href;
}, true);
</script><base href="/showcase/atelier-trois-plis/"><style>.dl-skip-link{position:fixed;left:1rem;top:1rem;z-index:2147483647;padding:.75rem 1rem;background:#fff;color:#111;transform:translateY(-200%)}.dl-skip-link:focus{transform:none}</style><link rel="stylesheet" href="./driftless-fonts.css" data-driftless-bundled-fonts><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Plis clairs — Atelier</title><meta name="description" content="La ligne et le rebord plié d’une coupe en grès."> <script type="module" crossorigin src="./assets/index-CbxnRA59.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-rFMQNuCE.css">
<script data-driftless-preview-route-normalizer>
(function(){
function derivePreviewRootPath(pathname){
if(typeof pathname !== 'string') return '';
var normalized = pathname.replace(/\/index\.html$/,'') || '/';
var segments = normalized.split('/').filter(Boolean);
for(var apiIndex=0;apiIndex<segments.length;apiIndex++){
if(
segments[apiIndex] === 'api' &&
segments[apiIndex + 1] === 'v1' &&
segments[apiIndex + 2] === 'runs' &&
segments[apiIndex + 3] &&
segments[apiIndex + 4] === 'preview-candidate'
){
return '/' + segments.slice(0, apiIndex + 5).join('/');
}
}
if(segments[0] === 'p' && segments[1] && segments[2]){
return '/' + segments.slice(0, 3).join('/');
}
if(segments[0] === 'previews' && segments[1]){
return '/' + segments.slice(0, 2).join('/');
}
if(segments[0] === 'showcase' && segments[1]){
return '/' + segments.slice(0, 2).join('/');
}
if(segments[0] === 'site' && segments[1]){
return '/' + segments.slice(0, 2).join('/');
}
return '';
}
function appPathFromPreviewPath(pathname, previewRootPath){
if(!previewRootPath) return pathname || '/';
if(pathname === previewRootPath) return '/';
var prefix = previewRootPath + '/';
if(pathname.indexOf(prefix) !== 0) return '/';
var appPath = pathname.slice(previewRootPath.length) || '/';
appPath = appPath.replace(/\/index\.html$/,'/') || '/';
return appPath.charAt(0) === '/' ? appPath : '/' + appPath;
}
function normalizePreviewAppPath(value){
if(typeof value !== 'string') return '';
var clean = value.split(/[?#]/)[0].replace(/^\/+/, '').replace(/\/+$/, '');
if(!clean || clean === 'home' || clean === 'index' || clean === 'index.html') return '/';
return '/' + clean.replace(/\/index\.html$/i, '').replace(/\/+/g, '/');
}
function closestAnchor(target){
var node = target && target.nodeType === 1 ? target : target && target.parentElement;
return node && node.closest ? node.closest('a[href]') : null;
}
function editorParentOrigin(){
if(window.parent === window) return window.location.origin;
try { return new URL(document.referrer).origin; } catch(e) {}
try {
var parentOrigin = window.parent.location.origin;
return parentOrigin !== 'null' && parentOrigin === window.location.origin ? parentOrigin : '';
} catch(e) { return ''; }
}
function postEditorMessage(message){
var targetOrigin = editorParentOrigin();
if(targetOrigin) window.parent.postMessage(message, targetOrigin);
}
function installPreviewScrollBridge(){
if(window.parent === window || window.__driftlessPreviewScrollBridgeInstalled) return;
window.__driftlessPreviewScrollBridgeInstalled = true;
var syncing = false;
var scheduled = false;
window.addEventListener('scroll', function(){
if(syncing || scheduled) return;
scheduled = true;
requestAnimationFrame(function(){
scheduled = false;
var height = Math.max(document.documentElement.scrollHeight, document.body ? document.body.scrollHeight : 0) - window.innerHeight;
postEditorMessage({ type: 'driftless-preview-scroll', ratio: height > 0 ? window.scrollY / height : 0 });
});
}, { passive: true });
window.addEventListener('message', function(event){
if(event.source !== window.parent || event.origin !== editorParentOrigin()) return;
if(!event.data || event.data.type !== 'driftless-preview-scroll-to' || typeof event.data.ratio !== 'number' || !isFinite(event.data.ratio)) return;
var height = Math.max(document.documentElement.scrollHeight, document.body ? document.body.scrollHeight : 0) - window.innerHeight;
syncing = true;
window.scrollTo(0, Math.max(0, Math.min(1, event.data.ratio)) * Math.max(0, height));
requestAnimationFrame(function(){ syncing = false; });
});
}
function installPreviewLinkGuard(previewRootPath){
if(!previewRootPath || window.__driftlessPreviewLinkGuardInstalled) return;
window.__driftlessPreviewLinkGuardInstalled = true;
function belongsToAnotherSurface(pathname){
if(pathname === previewRootPath || pathname.indexOf(previewRootPath + '/') === 0) return false;
if(['/p/','/previews/','/showcase/','/site/'].some(function(prefix){ return pathname.indexOf(prefix) === 0; })) return true;
if(['/api','/brain','/dashboard','/settings','/account','/login','/signup','/forgot-password','/reset-password','/reactivate','/verify-email','/verify-email-change','/claim-draft','/publish','/selling'].some(function(prefix){ return pathname === prefix || pathname.indexOf(prefix + '/') === 0; })) return true;
var parts = pathname.split('/').filter(Boolean);
return ['en','es','fr'].includes(parts[0]) && ['onboarding','signin','login','brain','dashboard','settings'].includes(parts[1]);
}
function scopePreviewAnchor(anchor){
if(!anchor || anchor.hasAttribute('download')) return null;
var rawHref = anchor.getAttribute('href') || '';
if(!rawHref || rawHref.charAt(0) === '#' || /^(?:mailto|tel|sms|javascript|data|blob):/i.test(rawHref) || rawHref.indexOf('//') === 0) return null;
var targetUrl;
try { targetUrl = new URL(rawHref, window.location.href); } catch(e) { return null; }
if(!/^https?:$/.test(targetUrl.protocol) || targetUrl.origin !== window.location.origin || belongsToAnotherSurface(targetUrl.pathname)) return null;
var contactPath = targetUrl.pathname.endsWith('/') ? targetUrl.pathname.slice(0, -1) : targetUrl.pathname;
if(rawHref.indexOf(targetUrl.origin + '/') === 0 && ['/en/contact','/fr/contact','/es/contact'].includes(contactPath)) return null;
var alreadyScoped = targetUrl.pathname === previewRootPath || targetUrl.pathname.indexOf(previewRootPath + '/') === 0;
if(!alreadyScoped){
targetUrl.pathname = previewRootPath + (targetUrl.pathname === '/' ? '/' : targetUrl.pathname);
anchor.setAttribute('href', targetUrl.toString());
}
return targetUrl;
}
function scopePreviewLinks(root){
if(root && root.matches && root.matches('a[href]')) scopePreviewAnchor(root);
if(root && root.querySelectorAll) Array.prototype.forEach.call(root.querySelectorAll('a[href]'), scopePreviewAnchor);
}
function startPreviewLinkGuard(){
scopePreviewLinks(document);
new MutationObserver(function(records){
records.forEach(function(record){
if(record.type === 'attributes') scopePreviewAnchor(record.target);
else Array.prototype.forEach.call(record.addedNodes, scopePreviewLinks);
});
}).observe(document.documentElement, { attributes: true, attributeFilter: ['href'], childList: true, subtree: true });
}
if(document.readyState === 'loading') document.addEventListener('DOMContentLoaded', startPreviewLinkGuard, { once: true });
else startPreviewLinkGuard();
document.addEventListener('click', function(event){
if(event.defaultPrevented || event.button !== 0) return;
if(document.documentElement.getAttribute('data-driftless-rehearsal') === 'active') return;
var anchor = closestAnchor(event.target);
if(!anchor || anchor.hasAttribute('download')) return;
var openInNewContext = Boolean(anchor.target && anchor.target !== '_self') || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;
var targetUrl = scopePreviewAnchor(anchor);
if(!targetUrl) return;
if(!openInNewContext && new URLSearchParams(window.location.search).get('driftlessEditor') === '1'){
if(anchor.closest('nav,header')) return;
var nestedEditorTarget = event.target && event.target.closest
? event.target.closest('img,h1,h2,h3,h4,h5,h6,p,button,label,li,blockquote,figcaption')
: null;
if(nestedEditorTarget && nestedEditorTarget !== anchor) return;
if(!anchor.querySelector('img,h1,h2,h3,h4,h5,h6,p,li,blockquote,figcaption')) return;
event.preventDefault();
event.stopImmediatePropagation();
postEditorMessage({
type: 'driftless-editor-navigate',
path: appPathFromPreviewPath(targetUrl.pathname, previewRootPath)
});
return;
}
if(openInNewContext) return;
}, true);
}
function installPreviewVisitorRehearsal(previewRootPath){
if(window.parent === window || window.__driftlessVisitorRehearsalInstalled) return;
window.__driftlessVisitorRehearsalInstalled = true;
var active = false;
var scheduled = false;
var rehearsalParentOrigin = '';
var dangerous = /(?:checkout|cart|basket|book(?:ing)?|reserve|payment|pay|purchase|buy|order|subscribe|publish|generate|update)/i;
function rehearsalPost(message){
window.parent.postMessage(message,rehearsalParentOrigin || '*');
}
function rehearsalText(node){
return String(node && (node.innerText || node.textContent) || '').replace(/\s+/g,' ').trim().slice(0,120);
}
function rehearsalPath(value){
var target;
try { target = new URL(value, window.location.href); } catch(e) { return ''; }
if(target.origin !== window.location.origin) return '';
var path = previewRootPath && (target.pathname === previewRootPath || target.pathname.indexOf(previewRootPath + '/') === 0)
? appPathFromPreviewPath(target.pathname, previewRootPath)
: normalizePreviewAppPath(target.pathname);
return path ? path.split('?')[0].split('#')[0] : '';
}
function transactional(node, path){
return dangerous.test(rehearsalText(node) + ' ' + path + ' ' + String(node && node.getAttribute && (node.getAttribute('name') || node.getAttribute('aria-label')) || ''));
}
function currentRoute(){
return window.__driftlessPreviewRequestedPath || appPathFromPreviewPath(window.location.pathname, previewRootPath) || '/';
}
function sendReport(){
if(!active) return;
var seen = {};
var routes = Array.prototype.slice.call(document.querySelectorAll('a[href]')).map(function(anchor){
var path = rehearsalPath(anchor.getAttribute('href') || '');
if(!path || transactional(anchor,path) || seen[path]) return null;
seen[path] = true;
return { path:path, label:rehearsalText(anchor) || path };
}).filter(Boolean).slice(0,25);
var images = Array.prototype.slice.call(document.querySelectorAll('img[src]'));
var failedMedia = images.filter(function(image){ return image.complete && image.naturalWidth === 0; }).map(function(image){
try { return new URL(image.currentSrc || image.getAttribute('src') || '', window.location.href).pathname; } catch(e) { return ''; }
}).filter(Boolean).slice(0,20);
var explicit = Array.prototype.slice.call(document.querySelectorAll('main [data-driftless-primary-action]'));
var actionNodes = explicit.length ? explicit : Array.prototype.slice.call(document.querySelectorAll('main a[href],main button:not([disabled]),main [role="button"]')).slice(0,1);
var primaryActions = actionNodes.map(function(node){
var anchor = node.matches && node.matches('a[href]') ? node : node.closest && node.closest('a[href]');
var raw = anchor ? anchor.getAttribute('href') || '' : '';
var path = raw ? rehearsalPath(raw) : '';
var kind = raw && /^(?:mailto:|tel:)/i.test(raw) ? 'contact' : path ? 'internal' : raw ? 'external' : 'control';
return { label:rehearsalText(node) || 'Unnamed action', destination:path || kind, kind:kind, blocked:transactional(node,path || raw) || node.tagName === 'BUTTON' };
});
rehearsalPost({
type:'driftless-rehearsal-report',
route:currentRoute(),
routes:routes,
media:{ total:images.length, loaded:Math.max(0,images.length-failedMedia.length), failed:failedMedia },
primaryActions:primaryActions,
blockedControls:document.querySelectorAll('form').length + Array.prototype.slice.call(document.querySelectorAll('a[href],button')).filter(function(node){
var anchor = node.matches && node.matches('a[href]') ? node : null;
var path = anchor ? rehearsalPath(anchor.getAttribute('href') || '') : '';
return transactional(node,path);
}).length
});
}
function scheduleReport(){
if(!active || scheduled) return;
scheduled = true;
window.setTimeout(function(){ scheduled=false; sendReport(); },80);
}
window.addEventListener('message',function(event){
if(event.source !== window.parent || !event.data) return;
if(event.data.type === 'driftless-rehearsal-start'){
if(event.origin.indexOf('http://') !== 0 && event.origin.indexOf('https://') !== 0) return;
rehearsalParentOrigin = event.origin;
active = true;
document.documentElement.setAttribute('data-driftless-rehearsal','active');
scheduleReport();
} else if(event.origin !== rehearsalParentOrigin){
return;
} else if(event.data.type === 'driftless-rehearsal-stop'){
active = false;
document.documentElement.removeAttribute('data-driftless-rehearsal');
} else if(event.data.type === 'driftless-rehearsal-visit' && active){
var path = normalizePreviewAppPath(String(event.data.path || ''));
if(!path || dangerous.test(path)) return;
var target = new URL(window.location.href);
target.pathname = (previewRootPath + (path === '/' ? '/' : path)).replace(/\/\/+/g,'/');
target.search = '';
target.hash = '';
window.location.assign(target.toString());
}
});
document.addEventListener('submit',function(event){
if(!active) return;
event.preventDefault();
event.stopImmediatePropagation();
rehearsalPost({ type:'driftless-rehearsal-blocked', label:rehearsalText(event.target), destination:'form', reason:'submission' });
},true);
document.addEventListener('click',function(event){
if(!active) return;
var control = event.target && event.target.closest ? event.target.closest('a[href],button,input[type="submit"],[role="button"]') : null;
if(!control) return;
var anchor = control.matches && control.matches('a[href]') ? control : control.closest && control.closest('a[href]');
var raw = anchor ? anchor.getAttribute('href') || '' : '';
event.preventDefault();
event.stopImmediatePropagation();
rehearsalPost({ type:'driftless-rehearsal-blocked', label:rehearsalText(control), destination:rehearsalPath(raw) || (raw ? 'external' : 'control'), reason:transactional(control,raw) ? 'transaction' : 'rehearsal' });
},true);
new MutationObserver(scheduleReport).observe(document.documentElement,{ childList:true,subtree:true,attributes:true,attributeFilter:['src','href','disabled'] });
rehearsalPost({ type:'driftless-rehearsal-ready' });
}
function installPreviewAccessibilityBridge(){
if(window.__driftlessPreviewAccessibilityBridgeInstalled) return;
window.__driftlessPreviewAccessibilityBridgeInstalled = true;
var observer = null;
var scheduled = false;
function syncPreviewAccessibility(){
var target = document.getElementById('main-content');
var main = target || document.querySelector('main');
if(!target && main) main.id = 'main-content';
var currentSkipHref = window.location.pathname + window.location.search + '#main-content';
var platformSkip = document.querySelector('a[data-driftless-skip-link]');
if(platformSkip && platformSkip.getAttribute('href') !== currentSkipHref) platformSkip.setAttribute('href',currentSkipHref);
var hasAuthoredCurrentSkip = Array.prototype.some.call(document.querySelectorAll('a[href]'),function(link){
if(link === platformSkip) return false;
try {
var href = new URL(link.href,window.location.href);
return href.origin === window.location.origin && href.pathname.replace(/index\.html$/,'') === window.location.pathname.replace(/index\.html$/,'')
&& href.search === window.location.search && href.hash === '#main-content';
} catch(e) { return false; }
});
if(platformSkip && hasAuthoredCurrentSkip){ platformSkip.remove(); platformSkip = null; }
var hasCurrentSkip = Array.prototype.some.call(document.querySelectorAll('a[href]'),function(link){
try {
var href = new URL(link.href,window.location.href);
return href.origin === window.location.origin && href.pathname.replace(/index.html$/,'') === window.location.pathname.replace(/index.html$/,'')
&& href.search === window.location.search && href.hash === '#main-content';
} catch(e) { return false; }
});
if(document.body && !hasCurrentSkip){
var link = document.createElement('a');
link.setAttribute('href',currentSkipHref);
link.className = 'dl-skip-link';
link.setAttribute('data-driftless-skip-link','');
link.textContent = 'Skip to content';
document.body.insertBefore(link, document.body.firstChild);
}
if(document.head && !document.querySelector('style[data-driftless-skip-link]')){
var style = document.createElement('style');
style.setAttribute('data-driftless-skip-link','');
style.textContent = '[data-driftless-skip-link]{position:fixed;left:1rem;top:1rem;z-index:2147483647;padding:.75rem 1rem;background:#fff;color:#111;transform:translateY(-200%)}[data-driftless-skip-link]:focus{transform:none}';
document.head.appendChild(style);
}
}
function schedulePreviewAccessibility(){
if(scheduled) return;
scheduled = true;
setTimeout(function(){ scheduled = false; syncPreviewAccessibility(); },0);
}
function startPreviewAccessibility(){
syncPreviewAccessibility();
observer = new MutationObserver(schedulePreviewAccessibility);
observer.observe(document.documentElement,{childList:true,subtree:true,attributes:true,attributeFilter:['href']});
}
if(document.readyState === 'loading') document.addEventListener('DOMContentLoaded',startPreviewAccessibility,{once:true});
else startPreviewAccessibility();
}
installPreviewAccessibilityBridge();
var originalPathname = window.location.pathname;
var previewRootPath = derivePreviewRootPath(originalPathname);
installPreviewScrollBridge();
installPreviewLinkGuard(previewRootPath);
installPreviewVisitorRehearsal(previewRootPath);
if(!previewRootPath) return;
try {
var appPath = appPathFromPreviewPath(originalPathname, previewRootPath);
var search = window.location.search || '';
var hintedAppPath = '';
try {
var params = new URLSearchParams(search);
var requestedRoute = params.get('driftlessEditorRoute');
if(requestedRoute !== null){
hintedAppPath = normalizePreviewAppPath(requestedRoute);
params.delete('driftlessEditorRoute');
var nextSearch = params.toString();
search = nextSearch ? '?' + nextSearch : '';
}
} catch(e) {
hintedAppPath = '';
}
if(hintedAppPath){
appPath = hintedAppPath;
}
var hash = window.location.hash || '';
if(hintedAppPath){
hash = appPath === '/' ? '#/' : '#' + appPath;
} else if(hash && hash.indexOf('#/') === 0){
appPath = hash.slice(1) || '/';
hash = '';
}
window.__driftlessPreviewRootPath = previewRootPath;
window.__driftlessPreviewRequestedPath = appPath;
// Keep a public showcase frame on a real route that the browser can restore.
var showcaseHomeFrame = originalPathname === previewRootPath + '/index.html'
&& previewRootPath.indexOf('/showcase/') === 0 && appPath === '/'
&& new URLSearchParams(search).get('__driftless_demo_frame') === '1';
var scopedPath = showcaseHomeFrame ? originalPathname : previewRootPath + (appPath === '/' ? '/' : appPath);
window.history.replaceState(null,'',scopedPath + search + hash);
if(hintedAppPath){
setTimeout(function(){
try {
var routeHash = appPath === '/' ? '#/' : '#' + appPath;
if(window.location.hash !== routeHash){
window.location.hash = routeHash;
}
} catch(e) {
// Leave the normalized path in place if hash routing is unavailable.
}
}, 0);
}
} catch(e) {
// Keep the served document usable if history replacement is unavailable.
}
var editorMode = new URLSearchParams(window.location.search).get('driftlessEditor') === '1';
if (editorMode) {
(function installEditorSizes(initialRules) {
if (window.__driftlessEditorSizeRuntimeVersion === 2 && window.__driftlessEditorSizeRuntimeMeasuresImages && window.__driftlessSetEditorSizes) { if (initialRules) window.__driftlessSetEditorSizes(initialRules); return; }
if (window.__driftlessEditorSizeRuntimeVersion === 'pending') { if (initialRules && window.__driftlessSetEditorSizes) window.__driftlessSetEditorSizes(initialRules); return; }
if (window.__driftlessSetEditorSizes && !initialRules) {
const legacy = window.__driftlessSetEditorSizes;
window.__driftlessEditorSizeRuntimeVersion = 'pending';
window.__driftlessSetEditorSizes = (next) => {
legacy([]);
window.__driftlessSetEditorSizes = null;
window.__driftlessEditorSizeRuntimeVersion = 0;
installEditorSizes(next);
};
return;
}
if (window.__driftlessSetEditorSizes) window.__driftlessSetEditorSizes([]);
window.__driftlessEditorSizeRuntimeVersion = 2;
window.__driftlessEditorSizeRuntimeMeasuresImages = true;
let rules = initialRules || [];
const original = new Map();
const text = (value) => value.replace(/\s+/g, ' ').trim().toLowerCase();
const comparableUrl = (value) => {
try { const url = new URL(value, location.href); return url.pathname + url.search; } catch { return value; }
};
const reset = (element, property, value, priority) => {
if (value) element.style.setProperty(property, value, priority);
else element.style.removeProperty(property);
};
const scaled = (value, factor) => {
if (!value || value === 'none') return String(factor);
const parts = value.split(/\s+/).map((part) => {
const percent = part.endsWith('%');
const number = Number.parseFloat(part);
return Number.isFinite(number) ? String(number * factor / (percent ? 100 : 1)) : '';
});
return parts.every(Boolean) ? parts.join(' ') : String(factor);
};
const restore = (element) => {
const prior = original.get(element);
if (!prior) return;
reset(element, 'zoom', prior.zoomValue, prior.zoomPriority);
reset(element, 'scale', prior.scaleValue, prior.scalePriority);
original.delete(element);
};
function apply() {
const active = new Set();
const structure = (function editorStructure() {
let left = 2166136261, right = 5381;
const elements = Array.from(document.body ? document.body.querySelectorAll('*') : []);
if (elements.length > 2500) return '';
for (const element of elements) {
if (element.closest('script,style,link,[data-driftless-attribution],[data-driftless-storefront],[data-driftless-insights-disclosure]')) continue;
const value = element.tagName + '/' + element.parentElement.tagName + '/' + element.id + '/' + element.className + '/' + (element.getAttribute('data-product-id') || '') + '/' + (element.getAttribute('data-driftless-media-id') || '') + ';';
for (let index = 0; index < value.length; index++) { left = Math.imul(left ^ value.charCodeAt(index), 16777619); right = Math.imul(right, 33) ^ value.charCodeAt(index); }
}
return (left >>> 0).toString(16).padStart(8, '0') + (right >>> 0).toString(16).padStart(8, '0');
})();
const path = (window.__driftlessPreviewRequestedPath || location.pathname).replace(/\/+$/, '') || '/';
for (const rule of rules) {
if (rule.path !== path || rule.size === 'original' || rule.structure !== structure) continue;
const element = document.querySelector(rule.selector);
if (!element || element.closest('[data-driftless-attribution],[data-driftless-storefront]')) continue;
const matches = rule.kind === 'image' ? element.tagName === 'IMG'
&& comparableUrl(element.currentSrc || element.getAttribute('src') || '') === comparableUrl(rule.value)
: element.tagName !== 'IMG' && text(element.innerText || element.textContent || '') === text(rule.value);
if (!matches) continue;
active.add(element);
if (!original.has(element)) {
original.set(element, {
zoomValue: element.style.getPropertyValue('zoom'), zoomPriority: element.style.getPropertyPriority('zoom'),
scaleValue: element.style.getPropertyValue('scale'), scalePriority: element.style.getPropertyPriority('scale'),
});
}
const prior = original.get(element);
const factor = rule.size === 'smaller' ? 0.8 : 1.2;
reset(element, 'zoom', prior.zoomValue, prior.zoomPriority);
reset(element, 'scale', prior.scaleValue, prior.scalePriority);
const authored = getComputedStyle(element);
const zoomBase = Number.parseFloat(authored.zoom) || 1;
const scaleBase = authored.scale;
const positionedImage = rule.kind === 'image' && ['absolute', 'fixed'].includes(authored.position);
const before = rule.kind === 'image' && !positionedImage ? element.getBoundingClientRect() : null;
if (positionedImage) {
const value = scaled(scaleBase, factor);
if (element.style.getPropertyValue('scale') !== value) element.style.setProperty('scale', value);
} else {
const value = String(zoomBase * factor);
if (element.style.getPropertyValue('zoom') !== value) element.style.setProperty('zoom', value);
if (before) {
const after = element.getBoundingClientRect();
const constrained = [[before.width, after.width], [before.height, after.height]].some(([from, to]) => from > 0 && Math.abs(to - from * factor) > 1);
if (constrained) {
reset(element, 'zoom', prior.zoomValue, prior.zoomPriority);
element.style.setProperty('scale', scaled(scaleBase, factor));
}
}
}
}
for (const element of original.keys()) if (!active.has(element)) restore(element);
}
let timer = 0;
const schedule = () => { window.clearTimeout(timer); timer = window.setTimeout(apply, 0); };
window.__driftlessSetEditorSizes = (next) => { rules = next; schedule(); };
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', schedule, { once: true });
else schedule();
new MutationObserver(schedule).observe(document.documentElement, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: ['src', 'class', 'id', 'data-product-id', 'data-driftless-media-id'] });
window.addEventListener('popstate', schedule);
window.addEventListener('resize', schedule);
})(null);
var editorStyle = document.createElement('style');
editorStyle.setAttribute('data-driftless-editor-selection-style','');
editorStyle.textContent = '[data-driftless-editor-hover]{outline:2px dashed #b86e52!important;outline-offset:2px;cursor:pointer!important}[data-driftless-editor-selected]{outline:3px solid #b86e52!important;outline-offset:2px;cursor:pointer!important}';
document.head.appendChild(editorStyle);
var editorHovered = null;
var editorSelected = null;
var editorTargets = 'img,h1,h2,h3,h4,h5,h6,p,a,button,label,li,blockquote,figcaption';
var editorInventoryTimer = 0;
function editorContent(target) {
var parts = [];
var raw = '';
var visited = 0;
var truncated = false;
var walker = document.createTreeWalker(target, NodeFilter.SHOW_TEXT);
var node;
while((node = walker.nextNode())) {
if(visited++ >= 320) { truncated = true; break; }
if(node.parentElement.closest('script,style,noscript,template,[hidden],[aria-hidden="true"]')) continue;
var value = String(node.textContent || '');
if(raw.length + value.length > 5000) { truncated = true; break; }
raw += value;
var text = value.replace(/\s+/g,' ').trim();
if(text && parts.indexOf(text) === -1) parts.push(text);
}
return { text: truncated ? '' : raw.replace(/\s+/g,' ').trim(), parts: parts };
}
function editorText(target) { return editorContent(target).text; }
function editorTextParts(target) { return editorContent(target).parts; }
function editorSrc(target) {
return target.currentSrc || target.getAttribute('src') || '';
}
function editorSizeTarget(target) {
if (target.closest('[data-driftless-attribution],[data-driftless-storefront]')) return null;
var parts = [];
var element = target;
while (element && element !== document.body && parts.length < 24) {
var siblings = element.parentElement ? Array.from(element.parentElement.children).filter(function(child) { return child.tagName === element.tagName; }) : [];
parts.unshift(element.tagName.toLowerCase() + ':nth-of-type(' + (siblings.indexOf(element) + 1) + ')');
element = element.parentElement;
}
return element === document.body ? { path: window.__driftlessPreviewRequestedPath || '/', selector: 'body > ' + parts.join(' > '), structure: (function editorStructure() {
let left = 2166136261, right = 5381;
const elements = Array.from(document.body ? document.body.querySelectorAll('*') : []);
if (elements.length > 2500) return '';
for (const element of elements) {
if (element.closest('script,style,link,[data-driftless-attribution],[data-driftless-storefront],[data-driftless-insights-disclosure]')) continue;
const value = element.tagName + '/' + element.parentElement.tagName + '/' + element.id + '/' + element.className + '/' + (element.getAttribute('data-product-id') || '') + '/' + (element.getAttribute('data-driftless-media-id') || '') + ';';
for (let index = 0; index < value.length; index++) { left = Math.imul(left ^ value.charCodeAt(index), 16777619); right = Math.imul(right, 33) ^ value.charCodeAt(index); }
}
return (left >>> 0).toString(16).padStart(8, '0') + (right >>> 0).toString(16).padStart(8, '0');
})() } : null;
}
function reportEditorSelection(target, focusNodeId) {
postEditorMessage({
type: focusNodeId ? 'driftless-editor-focused' : 'driftless-editor-select', nodeId: focusNodeId || '',
text: editorText(target), textParts: editorTextParts(target), src: editorSrc(target), alt: target.getAttribute('alt') || '',
path: target.closest('a[href]') ? editorAppPath(target.closest('a[href]').getAttribute('href') || '') : '',
sizeTarget: editorSizeTarget(target)
});
}
window.addEventListener('message', function(event) {
if (event.source !== window.parent || event.origin !== editorParentOrigin() || !event.data || event.data.type !== 'driftless-editor-sizes') return;
if (Array.isArray(event.data.rules) && event.data.rules.length <= 100) window.__driftlessSetEditorSizes(event.data.rules);
});
function editorAppPath(value) {
var targetUrl;
try { targetUrl = new URL(value, window.location.href); } catch(e) { return ''; }
if (targetUrl.origin !== window.location.origin) return '';
var previewRootPath = window.__driftlessPreviewRootPath || '';
return previewRootPath && (targetUrl.pathname === previewRootPath || targetUrl.pathname.indexOf(previewRootPath + '/') === 0)
? appPathFromPreviewPath(targetUrl.pathname, previewRootPath)
: normalizePreviewAppPath(targetUrl.pathname);
}
function sendEditorInventory() {
var seenSurfaces = Object.create(null);
var surfaces = Array.prototype.slice.call(document.querySelectorAll(editorTargets)).map(function(target) {
if (target.closest('[data-driftless-attribution],script,style,noscript,template,[hidden],[aria-hidden="true"]')) return null;
var text = editorText(target);
var src = editorSrc(target);
var textParts = editorTextParts(target);
var path = target.closest('a[href]') ? editorAppPath(target.closest('a[href]').getAttribute('href') || '') : '';
var key = text + '\n' + src + '\n' + JSON.stringify(textParts) + '\n' + path;
if ((!text && !src) || seenSurfaces[key]) return null;
seenSurfaces[key] = true;
return { text: text, textParts: textParts, src: src, alt: target.getAttribute('alt') || '', path: path };
}).filter(Boolean).slice(0, 320);
var seenPaths = Object.create(null);
var navigation = Array.prototype.slice.call(document.querySelectorAll('nav a[href],header a[href]')).map(function(anchor) {
var path = editorAppPath(anchor.getAttribute('href') || '');
if (!path || seenPaths[path]) return null;
seenPaths[path] = true;
return { path: path, label: editorText(anchor) };
}).filter(Boolean);
postEditorMessage({ type: 'driftless-editor-inventory', surfaces: surfaces, navigation: navigation });
}
function scheduleEditorInventory() {
window.clearTimeout(editorInventoryTimer);
editorInventoryTimer = window.setTimeout(sendEditorInventory, 60);
}
function editorTarget(event) {
var target = event.target && event.target.closest ? event.target.closest(editorTargets) : null;
if (!target || target.closest('[data-driftless-attribution],script,style,noscript,template,[hidden],[aria-hidden="true"]')) return null;
return editorText(target) || editorSrc(target) ? target : null;
}
document.addEventListener('pointerover', function(event) {
var target = editorTarget(event);
if (!target || target === editorSelected) return;
if (editorHovered) editorHovered.removeAttribute('data-driftless-editor-hover');
editorHovered = target;
editorHovered.setAttribute('data-driftless-editor-hover','');
}, true);
document.addEventListener('pointerout', function(event) {
var target = editorTarget(event);
if (!target || target !== editorHovered || target === editorSelected) return;
target.removeAttribute('data-driftless-editor-hover');
editorHovered = null;
}, true);
document.addEventListener('click', function(event) {
if (event.target && event.target.closest && event.target.closest('[data-driftless-attribution],script,style,noscript,template,[hidden],[aria-hidden="true"]')) {
event.preventDefault();
event.stopPropagation();
return;
}
var target = editorTarget(event);
if (!target) return;
event.preventDefault();
event.stopPropagation();
if (editorSelected) editorSelected.removeAttribute('data-driftless-editor-selected');
if (editorHovered) editorHovered.removeAttribute('data-driftless-editor-hover');
editorSelected = target;
editorHovered = null;
editorSelected.setAttribute('data-driftless-editor-selected','');
reportEditorSelection(target);
}, true);
window.addEventListener('message', function(event) {
if (event.source !== window.parent || event.origin !== editorParentOrigin() || !event.data || event.data.type !== 'driftless-editor-focus') return;
if (editorSelected) editorSelected.removeAttribute('data-driftless-editor-selected');
if (editorHovered) editorHovered.removeAttribute('data-driftless-editor-hover');
editorSelected = null;
editorHovered = null;
if (event.data.clear === true || typeof event.data.nodeId !== 'string' || !event.data.nodeId || event.data.nodeId.length > 220) return;
var wantedText = String(event.data.text || '').replace(/\s+/g,' ').trim().toLowerCase();
var wantedSrc = String(event.data.src || '');
var targets = Array.prototype.slice.call(document.querySelectorAll(editorTargets)).filter(function(candidate) {
if (candidate.closest('[data-driftless-attribution],script,style,noscript,template,[hidden],[aria-hidden="true"]')) return false;
if (wantedSrc && editorSrc(candidate) === wantedSrc) return true;
return wantedText && [editorText(candidate)].concat(editorTextParts(candidate)).some(function(text){ return text.toLowerCase() === wantedText; });
});
if (targets.length !== 1) return;
var target = targets[0];
editorSelected = target;
editorSelected.setAttribute('data-driftless-editor-selected','');
editorSelected.scrollIntoView({ block: 'center', behavior: window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'auto' : 'smooth' });
reportEditorSelection(target, event.data.nodeId);
});
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', scheduleEditorInventory, { once: true });
else scheduleEditorInventory();
new MutationObserver(scheduleEditorInventory).observe(document.documentElement, { childList: true, characterData: true, subtree: true });
}
})();
</script><script>(function(){
if(new URLSearchParams(window.location.search).get('driftlessEditor')!=='1')return;
var type="driftless-editor-font-preview";
var tokens={displayFont:'--dl-style-display-font',bodyFont:'--dl-style-body-font'};
var allowed={"displayFont":["ui-serif, Georgia, Cambria, serif","ui-sans-serif, system-ui, sans-serif","Georgia, Cambria, ui-serif, serif","\"Cormorant Garamond\", ui-serif, Georgia, serif"],"bodyFont":["ui-sans-serif, system-ui, sans-serif","ui-sans-serif, system-ui, sans-serif","Verdana, ui-sans-serif, sans-serif","Manrope, ui-sans-serif, system-ui, sans-serif"]};
var expectedParent=(function(){try{return document.referrer?new URL(document.referrer).origin:window.location.origin}catch(_){return window.location.origin}})();
var originals={};
window.addEventListener('message',function(event){
if(event.source!==window.parent||event.origin!==expectedParent)return;
var message=event.data;
if(!message||message.type!==type||!message.fonts||typeof message.fonts!=='object'||Array.isArray(message.fonts))return;
var fonts=message.fonts;
for(var key in fonts)if(!Object.prototype.hasOwnProperty.call(tokens,key)||!allowed[key].includes(fonts[key]))return;
Object.keys(tokens).forEach(function(key){
var value=fonts[key];
var token=tokens[key];
if(value===undefined){
var original=originals[key];
if(!original)return;
if(original.value)document.documentElement.style.setProperty(token,original.value,original.priority);
else document.documentElement.style.removeProperty(token);
delete originals[key];
return;
}
if(!originals[key])originals[key]={value:document.documentElement.style.getPropertyValue(token),priority:document.documentElement.style.getPropertyPriority(token)};
document.documentElement.style.setProperty(token,value);
});
});
})();</script>
</head><body><a class="dl-skip-link" href="#main-content">Skip to content</a><div id="root"></div><aside id="driftless-badge" data-driftless-attribution aria-label="DriftLess attribution" style="border-top:1px solid rgba(148,163,184,.24);padding:14px 16px 16px;text-align:center;font:12px/1.4 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#475569;background:transparent;">
<a href="https://driftless.chat?utm_source=generated_project&utm_medium=attribution_badge" target="_blank" rel="noopener" style="color:inherit;text-decoration:none;">
Built with <strong style="font-weight:600;color:inherit;">DriftLess</strong>
</a>
</aside>
</body></html>