(function () { 'use strict'; if (window.__DBC_SITE_V270__) return; window.__DBC_SITE_V270__ = true; const file = decodeURIComponent(window.location.pathname.split('/').pop() || 'index.html').toLowerCase(); const family = document.body.dataset.v270Family || 'dbc'; const clusters = { dbc: { identity: ['DBC / APPLICATION PLATFORM', 'DBC / APPLICATION PLATFORM'], links: [ ['世界杯竞猜官网首页', 'DBC Home', 'index.html', ['index.html']], ['关于世界杯竞猜官网', 'About DBC', 'about.html', ['about.html']], ['品牌与业务生态', 'Brands & Businesses', 'about-brands.html', ['about-brands.html', 'casu.html', 'dpu.html', 'antux.html', 'ecoten.html']], ['联系与合作', 'Contact & Projects', 'contact.html', ['contact.html', 'contact-routing.html']] ], action: ['提交项目需求', 'Submit a project brief', 'contact.html'] }, bioten: { identity: ['BIOTEN / MATERIAL TO APPLICATION', 'BIOTEN / MATERIAL TO APPLICATION'], links: [ ['平台总览', 'Platform', 'bioten-platform.html', ['bioten-platform.html']], ['PHA 水性材料', 'PHA waterborne materials', 'bioten-platform.html#method', []], ['应用方向', 'Application programs', 'bioten-platform.html#routes', ['bioten-agriculture.html', 'bioten-personal-care.html', 'bioten-waterborne-coatings.html', 'bioten-health-research.html']], ['研发与合作边界', 'R&D and collaboration scope', 'bioten-platform.html#evidence', []] ], action: ['提交应用与合作需求', 'Submit an application brief', 'contact.html?intent=bioten-platform'] }, packaging: { identity: ['BIOTEN PACKAGING / BARRIER SYSTEMS', 'BIOTEN PACKAGING / BARRIER SYSTEMS'], links: [ ['包装总览', 'Packaging overview', 'bioten.html', ['bioten.html', 'bioten-packaging.html']], ['应用领域', 'Applications', 'bioten-packaging-applications.html', ['bioten-packaging-applications.html', 'solutions.html', 'solutions-food-packaging.html', 'solutions-industrial.html']], ['产品路线', 'Product routes', 'bioten-product-lines.html', ['bioten-product-lines.html', 'bioten-products.html', 'bioten-products-plus.html', 'bioten-products-pro.html', 'bioten-products-ultra.html', 'bioten-products-matrix.html']], ['工程与验证', 'Engineering and validation', 'bioten-lab.html', []] ], action: ['提交纸样与项目条件', 'Submit paper and project conditions', 'contact-intent-paper-sample.html'] }, developer: { identity: ['BIOTEN DEVELOPER / EVIDENCE WORKBENCH', 'BIOTEN DEVELOPER / EVIDENCE WORKBENCH'], links: [ ['开发者工作台', 'Developer Workbench', 'bioten-lab.html', ['bioten-lab.html']], ['资料中心', 'Resources', 'resources.html', ['resources.html', 'resources-bioten-plus-brochure.html', 'resources-tds-sds.html', 'resources-reports.html', 'portal-login.html']], ['知识与标准', 'Knowledge & Standards', 'knowledge.html', ['knowledge.html', 'knowledge-barrier-standards.html', 'knowledge-compliance-map.html', 'knowledge-circularity.html', 'knowledge-faq.html']], ['项目预审', 'Project Intake', 'sample.html', ['sample.html', 'contact-from-bioten.html']], ['纸样测试', 'Paper Sample Test', 'contact-intent-paper-sample.html', ['contact-intent-paper-sample.html']] ], action: ['发起项目评估', 'Start project assessment', 'sample.html'] }, news: { identity: ['NEWSROOM / TRACEABLE PROGRESS', 'NEWSROOM / TRACEABLE PROGRESS'], links: [ ['新闻总览', 'Newsroom', 'news.html', ['news.html']], ['重点进展', 'Featured Progress', 'news.html#observer-company', []], ['BIOTEN 进展', 'BIOTEN Updates', 'news.html#observer-company', []], ['公司动态', 'Company News', 'news-company.html', ['news-company.html']], ['行业洞察', 'Industry Insights', 'news-insights.html', ['news-insights.html']] ], action: ['回到项目与证据', 'Return to projects & evidence', 'bioten-lab.html'] } }; function makeLocalizedElement(tag, cn, en) { const element = document.createElement(tag); element.dataset.v270Cn = cn; element.dataset.v270En = en; element.textContent = cn; return element; } function applyLanguage() { const language = document.documentElement.dataset.lang === 'en' ? 'en' : 'cn'; document.querySelectorAll('[data-v270-cn]').forEach(function (element) { const value = language === 'en' ? element.dataset.v270En : element.dataset.v270Cn; if (typeof value === 'string') element.textContent = value; }); const context = document.querySelector('.v270-context'); if (context) context.setAttribute('aria-label', language === 'en' ? 'Section navigation' : '当前板块导航'); } function buildContextNavigation() { if (family === 'home') return; const main = document.querySelector('main'); const cluster = clusters[family] || clusters.dbc; if (!main || !cluster || document.querySelector('.v270-context')) return; const nav = document.createElement('nav'); nav.className = 'v270-context'; nav.setAttribute('aria-label', '当前板块导航'); const inner = document.createElement('div'); inner.className = 'v270-context__inner'; const identity = makeLocalizedElement('span', cluster.identity[0], cluster.identity[1]); identity.className = 'v270-context__identity'; inner.appendChild(identity); const links = document.createElement('div'); links.className = 'v270-context__links'; cluster.links.forEach(function (item) { const link = makeLocalizedElement('a', item[0], item[1]); link.href = item[2]; const owners = item[3] || []; if (owners.includes(file)) link.setAttribute('aria-current', 'page'); if (family === 'news' && file.startsWith('news-') && item[2] === 'news.html') link.setAttribute('aria-current', 'page'); links.appendChild(link); }); inner.appendChild(links); const action = makeLocalizedElement('a', cluster.action[0], cluster.action[1]); action.className = 'v270-context__action'; action.href = cluster.action[2]; inner.appendChild(action); nav.appendChild(inner); main.parentNode.insertBefore(nav, main); } function enhanceDocumentLinks() { document.querySelectorAll('a[href]').forEach(function (link) { const href = String(link.getAttribute('href') || '').trim(); if (!href) return; if (/\.pdf(?:[?#]|$)/i.test(href)) { link.target = '_blank'; link.rel = 'noopener'; link.classList.add('v270-pdf-link'); } if (/^https?:\/\//i.test(href)) { try { const target = new URL(href, window.location.href); if (target.origin !== window.location.origin && link.target === '_blank') { const rel = new Set(String(link.rel || '').split(/\s+/).filter(Boolean)); rel.add('noopener'); rel.add('noreferrer'); link.rel = Array.from(rel).join(' '); } } catch (error) { // Leave malformed legacy URLs untouched; the static verifier reports them. } } }); } function markCurrentFooterRoute() { document.querySelectorAll('footer.site-footer a[href]').forEach(function (link) { const href = String(link.getAttribute('href') || '').split('#')[0].split('?')[0].toLowerCase(); if (href && href === file) link.setAttribute('aria-current', 'page'); }); } function enhanceIllustrativeVisuals() { if (document.body.classList.contains('v400-site')) return; const illustrativeAssets = [ 'assets/images/bioten-engineering/hero-packaging', 'assets/images/bioten-lab/platform-material-states', 'assets/images/bioten-lab/application-formulation' ]; document.querySelectorAll('main img[src]').forEach(function (image) { const src = String(image.getAttribute('src') || ''); if (!illustrativeAssets.some(function (asset) { return src.includes(asset); })) return; const container = image.closest('figure, .v245-hero__media, .v245-flagship__media, .v245-tech-visual'); if (!container || container.querySelector('.v270-visual-disclaimer')) return; const caption = document.createElement(container.tagName === 'FIGURE' ? 'figcaption' : 'div'); caption.className = 'v270-visual-disclaimer'; caption.dataset.v270Cn = '技术示意图|用于解释材料、结构或应用逻辑,不作为产线、实验结果或客户项目证明。'; caption.dataset.v270En = 'Technical illustration | Explains material, structure or application logic; not production-line, test-result or customer-project evidence.'; caption.textContent = caption.dataset.v270Cn; container.appendChild(caption); }); } function enhanceMobileFooter() { const footer = document.querySelector('footer.formal-site-footer'); if (!footer) return; const columns = Array.from(footer.querySelectorAll('.footer-directory > .footer-column')); if (!columns.length) return; const mobileQuery = window.matchMedia('(max-width: 680px)'); const currentColumnIndex = columns.findIndex(function (column) { return Boolean(column.querySelector('a[aria-current="page"]')); }); columns.forEach(function (column, index) { column.classList.add('v270-footer-column'); const heading = column.querySelector(':scope > h3'); if (!heading || heading.querySelector('button')) return; const button = document.createElement('button'); button.type = 'button'; button.className = 'v270-footer-toggle'; button.textContent = heading.textContent; ['data-nav-cn', 'data-nav-en'].forEach(function (name) { if (!heading.hasAttribute(name)) return; button.setAttribute(name, heading.getAttribute(name)); heading.removeAttribute(name); }); heading.textContent = ''; heading.appendChild(button); if (index === (currentColumnIndex >= 0 ? currentColumnIndex : 0)) { column.classList.add('is-v270-open'); } button.addEventListener('click', function () { if (!mobileQuery.matches) return; const willOpen = !column.classList.contains('is-v270-open'); columns.forEach(function (item) { item.classList.remove('is-v270-open'); }); if (willOpen) column.classList.add('is-v270-open'); sync(); }); }); function sync() { columns.forEach(function (column) { const button = column.querySelector('.v270-footer-toggle'); if (!button) return; const expanded = !mobileQuery.matches || column.classList.contains('is-v270-open'); button.setAttribute('aria-expanded', String(expanded)); }); } if (typeof mobileQuery.addEventListener === 'function') mobileQuery.addEventListener('change', sync); else if (typeof mobileQuery.addListener === 'function') mobileQuery.addListener(sync); sync(); } function addMeasuredMotion() { if (family === 'home') return; if (!('IntersectionObserver' in window)) return; if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return; const candidates = Array.from(document.querySelectorAll('main > section:not([hidden])')) .filter(function (section) { return !section.classList.contains('v245-hero') && !section.classList.contains('news-business-panel'); }) .slice(0, 8); if (!candidates.length) return; document.documentElement.classList.add('v270-motion-ready'); const observer = new IntersectionObserver(function (entries) { entries.forEach(function (entry) { if (!entry.isIntersecting) return; entry.target.classList.add('is-v270-visible'); observer.unobserve(entry.target); }); }, { threshold: .08, rootMargin: '0px 0px -6% 0px' }); candidates.forEach(function (section) { section.dataset.v270Reveal = ''; observer.observe(section); if (section.getBoundingClientRect().top < window.innerHeight * .92) { section.classList.add('is-v270-visible'); observer.unobserve(section); } }); } function markRelease() { const release = document.body.dataset.dbcRelease || document.documentElement.dataset.dbcRelease || 'v3.0.0'; document.documentElement.dataset.dbcRelease = release; document.body.dataset.dbcRelease = release; document.body.classList.add('v270-enhanced'); const footer = document.querySelector('footer.site-footer'); if (footer) footer.dataset.dbcRelease = release; } buildContextNavigation(); enhanceDocumentLinks(); markCurrentFooterRoute(); enhanceIllustrativeVisuals(); enhanceMobileFooter(); markRelease(); applyLanguage(); addMeasuredMotion(); document.addEventListener('dbc:languagechange', applyLanguage); document.addEventListener('dbc:translations-loaded', applyLanguage); })();