1// ============================================================================ 2// lib/index-main.js 3// 4// Extracted from inline <script type="module"> in index.html 5// to allow CSP `script-src 'self'` (no `unsafe-inline`) and achieve 6// SecurityHeaders.com A+ / Mozilla Observatory A+. 7// 8// DO NOT add inline JS back to index.html. Add to this file instead. 9// ============================================================================ 10 11import { initI18n, mountLangPicker, getLang, onLangChange } from "/lib/i18n.js?v=a97271a3"; 12import { initPwaInstall, registerServiceWorker } from "/lib/pwa-install.js?v=310ff450"; 13import { initLpPricing } from "/lib/lp-pricing.js?v=47fccc70"; 14 15/** 16 * ã¬ã¤ããªã³ã¯ãç¾å¨ã®è¨èªã«å¿ã㦠/guide/{lang}/ ã¸æ¸ãæããã 17 * - æ¥æ¬èª (ja) ã®ã¿ /guide/ (忬) 18 * - ãã®ä» 15 è¨èª (en/zh-CN/zh-TW/ko/es/pt-BR/de/fr/it/ru/id/vi/hi/ar/tr) 㯠/guide/{lang}/ 19 * 20 * 対象è¦ç´ : 21 * - data-guide-link="hub" â /guide/[{lang}/] 22 * - data-guide-link="article" data-guide-article="{file}" â /guide/[{lang}/]{file} 23 */ 24function updateGuideLinks(lang) { 25 const prefix = lang === "ja" ? "/guide/" : `/guide/${lang}/`; 26 const els = document.querySelectorAll("[data-guide-link]"); 27 for (const el of els) { 28 const kind = el.dataset.guideLink; 29 if (kind === "hub") { 30 el.setAttribute("href", prefix); 31 } else if (kind === "article") { 32 const article = el.dataset.guideArticle || ""; 33 el.setAttribute("href", prefix + article); 34 } 35 } 36} 37 38// éããããã³ã°åæå â Safari ã§ fetch ãã¹ãã¼ã§ããã¼ã¸å ¨ä½ãæ¢ããªã 39initI18n() 40 .then(() => { 41 mountLangPicker("#nav-lang", { compact: false }); 42 updateGuideLinks(getLang()); 43 // Phase 7.5ZM: LP åçä¾¡æ ¼ (AR-linked) ã /api/ar-price ãã live åå¾ãã¦åæ 44 initLpPricing(); 45 }) 46 .catch(err => console.warn("[i18n] init failed:", err)); 47 48// è¨èªåæ¿ã«è¿½å¾ãã¦ã¬ã¤ããªã³ã¯ãæ¸ãæã 49onLangChange(lang => updateGuideLinks(lang)); 50 51// PWAããã¼ã ç»é¢ã«è¿½å ãã³ã³ãã¼ãã³ã (端æ«å¤å®ã¤ã) + æå° service workerã 52registerServiceWorker(); 53initPwaInstall();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.