From dcfd66a2f8ef4d1777deaaabed94d90c9e247dc8 Mon Sep 17 00:00:00 2001 From: Jieiku <106644+Jieiku@users.noreply.github.com> Date: Wed, 7 Aug 2024 13:39:36 -0700 Subject: [PATCH] node script optimizations --- package_abridge.js | 19 +++++++++++-------- static/sw.js | 2 +- static/sw.min.js | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/package_abridge.js b/package_abridge.js index 7c673f13..1edc2437 100644 --- a/package_abridge.js +++ b/package_abridge.js @@ -139,7 +139,7 @@ async function abridge() { if (e.code != 'EEXIST') throw e; } const path = './public/'; - cache = 'this.BASE_CACHE_FILES = ['; + cache = ''; files = fs.readdirSync(path, { recursive: true, withFileTypes: false }) .forEach( (file) => { @@ -149,6 +149,7 @@ async function abridge() { item = "/"+file.replace(/index\.html$/i,'');// strip index.html from path item = item.replace(/\\/g,'/');// replace backslash with forward slash for Windows item = item.replace(/^\/sw(\.min)?\.js/i,'');// dont cache service worker + item = item.replace(/^\/_headers/i,'');// dont cache the cloudflare _headers file // if formatted output is not empty line then append it to cache var if (item != '') {// skip empty lines @@ -157,11 +158,13 @@ async function abridge() { } } ); - cache = cache.slice(0, -1)+'];'// remove the last comma and close the array + cache = cache.slice(0, -1)// remove the last comma } else if (pwa_BASE_CACHE_FILES) { - cache = 'this.BASE_CACHE_FILES = ['+pwa_BASE_CACHE_FILES+'];'; + cache = pwa_BASE_CACHE_FILES; } + cache = cache.split(",").sort().join(",")//sort the cache list, this should help keep the commit history cleaner. + cache = 'this.BASE_CACHE_FILES = ['+cache+'];'; // update the BASE_CACHE_FILES variable in the sw.js service worker file results = replaceInFileSync({ files: 'static/sw.js', @@ -212,11 +215,6 @@ async function abridge() { await execWrapper('zola build'+args); } -async function searchChange(searchOption) { - const { replaceInFileSync } = await import('replace-in-file'); - replaceInFileSync({files: 'config.toml', from: /search_library.*=.*/g, to: 'search_library = \"'+searchOption+'\"'}); -} - function bundle(bpath,js_prestyle,js_switcher,js_email_encode,js_copycode,search_library,index_format,uglyurls,pwa) { minify_files = []; @@ -288,6 +286,11 @@ function minify(fileA,outfile) { } +async function searchChange(searchOption) { + const { replaceInFileSync } = await import('replace-in-file'); + replaceInFileSync({files: 'config.toml', from: /search_library.*=.*/g, to: 'search_library = \"'+searchOption+'\"'}); +} + if (args === ' offline') { searchChange('offline'); } else if (args === ' elasticlunrjava') { diff --git a/static/sw.js b/static/sw.js index f2e44cc0..e2007f0f 100644 --- a/static/sw.js +++ b/static/sw.js @@ -5,7 +5,7 @@ class Pwa { const Version = new URL(location).searchParams.get("v"); this.CACHE_VERSION = Version; //this.BASE_CACHE_FILES=['/js/theme.min.js','/js/theme_light.min.js','/abridge.css','/js/abridge.min.js','/','/404.html','/offline/','/manifest.json']; - this.BASE_CACHE_FILES = ['/404.html','/_headers','/abridge.css','/android-chrome-192x192.png','/android-chrome-512x512.png','/apple-touch-icon.png','/atom.xml','/banner.png','/browserconfig.xml','/elasticlunr.min.js','/favicon-16x16.png','/favicon-32x32.png','/favicon.ico','/favicon.svg','/','/katex.min.css','/m1024.png','/m128.png','/m192.png','/m384.png','/m48.png','/m512.png','/m72.png','/m96.png','/manifest.json','/manifest.min.json','/mstile-150x150.png','/nojs.css','/robots.txt','/safari-pinned-tab.svg','/search_index.en.json','/search_index.es.json','/search_index.fr.json','/search_index.pt.json','/sitemap.xml','/tinysearch_engine_bg.wasm','/about/','/archive/','/blog/','/contact/','/data_tinysearch/','/es/atom.xml','/es/','/fonts/KaTeX_AMS-Regular.woff2','/fonts/KaTeX_Caligraphic-Bold.woff2','/fonts/KaTeX_Caligraphic-Regular.woff2','/fonts/KaTeX_Fraktur-Bold.woff2','/fonts/KaTeX_Fraktur-Regular.woff2','/fonts/KaTeX_Main-Bold.woff2','/fonts/KaTeX_Main-BoldItalic.woff2','/fonts/KaTeX_Main-Italic.woff2','/fonts/KaTeX_Main-Regular.woff2','/fonts/KaTeX_Math-BoldItalic.woff2','/fonts/KaTeX_Math-Italic.woff2','/fonts/KaTeX_SansSerif-Bold.woff2','/fonts/KaTeX_SansSerif-Italic.woff2','/fonts/KaTeX_SansSerif-Regular.woff2','/fonts/KaTeX_Script-Regular.woff2','/fonts/KaTeX_Size1-Regular.woff2','/fonts/KaTeX_Size2-Regular.woff2','/fonts/KaTeX_Size3-Regular.woff2','/fonts/KaTeX_Size4-Regular.woff2','/fonts/KaTeX_Typewriter-Regular.woff2','/fonts/Roboto-Bold.woff2','/fonts/Roboto-Italic.woff2','/fonts/Roboto-Mono-Italic.woff2','/fonts/Roboto-Mono.woff2','/fonts/Roboto.woff2','/fr/atom.xml','/fr/','/images/ferris-gesture.svg','/images/ferris.svg','/js/abridge.min.js','/js/abridge_nopwa.min.js','/js/abridge_nosearch.min.js','/js/abridge_nosearch_nopwa.min.js','/js/codecopy.js','/js/elasticlunr.min.js','/js/email.js','/js/katex-auto-render.min.js','/js/katex.min.js','/js/katexbundle.min.js','/js/katexbundle.min.old.js','/js/katexoptions.js','/js/lunr.da.js','/js/lunr.da.min.js','/js/lunr.de.js','/js/lunr.de.min.js','/js/lunr.du.js','/js/lunr.du.min.js','/js/lunr.es.js','/js/lunr.es.min.js','/js/lunr.fi.js','/js/lunr.fi.min.js','/js/lunr.fr.js','/js/lunr.fr.min.js','/js/lunr.hu.js','/js/lunr.hu.min.js','/js/lunr.it.js','/js/lunr.it.min.js','/js/lunr.jp.js','/js/lunr.jp.min.js','/js/lunr.no.js','/js/lunr.no.min.js','/js/lunr.pt.js','/js/lunr.pt.min.js','/js/lunr.ro.js','/js/lunr.ro.min.js','/js/lunr.ru.js','/js/lunr.ru.min.js','/js/lunr.stemmer.support.js','/js/lunr.stemmer.support.min.js','/js/lunr.sv.js','/js/lunr.sv.min.js','/js/lunr.tr.js','/js/lunr.tr.min.js','/js/lunr.zh.js','/js/lunr.zh.min.js','/js/mathtex-script-type.min.js','/js/pagefind-entry.json','/js/pagefind-highlight.js','/js/pagefind-modular-ui.css','/js/pagefind-modular-ui.js','/js/pagefind-ui.css','/js/pagefind-ui.js','/js/pagefind.index.cjs','/js/pagefind.js','/js/pagefind.search.js','/js/prestyle.js','/js/search.js','/js/search_elasticlunr.min.js','/js/search_elasticlunr_jindex.min.js','/js/search_tinysearch.min.js','/js/searchjava.js','/js/searchjavaugly.js','/js/sw_load.js','/js/sw_load.min.js','/js/theme.js','/js/theme.min.js','/js/theme_button.js','/js/theme_light.js','/js/theme_light.min.js','/js/tinysearch.js','/js/wasm.en.pagefind','/js/wasm.es.pagefind','/js/wasm.fr.pagefind','/js/wasm.unknown.pagefind','/offline/','/overview-abridge/','/overview-abridge/lighthouse.png','/overview-code-blocks/','/overview-images/corro.svg','/overview-images/ferris-gesture.png','/overview-images/ferris-gesture.svg','/overview-images/ferris-happy.svg','/overview-images/ferris.svg','/overview-images/','/overview-markdown-and-style/','/overview-math/','/overview-rich-content/','/overview-rich-content/over9000-400.avif','/overview-rich-content/over9000-640.avif','/overview-rich-content/over9000-640.webp','/overview-rich-content/over9000-960.avif','/overview-rich-content/over9000.mp3','/overview-rich-content/over9000.ogg','/overview-rich-content/over9000_av1.mp4','/overview-rich-content/over9000_vp9.webm','/overview-showdata/','/privacy/','/pt/','/tags/','/es/archive/','/es/blog/','/es/tags/','/fr/about/','/fr/archive/','/fr/blog/','/fr/contact/','/fr/offline/','/fr/overview-code-blocks/','/fr/overview-images/corro.svg','/fr/overview-images/ferris-gesture.png','/fr/overview-images/ferris-gesture.svg','/fr/overview-images/ferris-happy.svg','/fr/overview-images/ferris.svg','/fr/overview-images/','/fr/overview-markdown-and-style/','/fr/overview-math/','/fr/overview-rich-content/','/fr/overview-rich-content/over9000-400.avif','/fr/overview-rich-content/over9000-640.avif','/fr/overview-rich-content/over9000-640.webp','/fr/overview-rich-content/over9000-960.avif','/fr/overview-rich-content/over9000.mp3','/fr/overview-rich-content/over9000.ogg','/fr/overview-rich-content/over9000_av1.mp4','/fr/overview-rich-content/over9000_vp9.webm','/fr/overview-showdata/','/fr/privacy/','/fr/tags/','/overview-images/img/ferris-gesture.svg','/overview-images/img/ferris.svg','/page/1/','/page/2/','/page/3/','/page/4/','/tags/audio/atom.xml','/tags/audio/','/tags/config/atom.xml','/tags/config/','/tags/data/atom.xml','/tags/data/','/tags/features/atom.xml','/tags/features/','/tags/images/atom.xml','/tags/images/','/tags/markdown/atom.xml','/tags/markdown/','/tags/mathematics/atom.xml','/tags/mathematics/','/tags/shortcodes/atom.xml','/tags/shortcodes/','/tags/video/atom.xml','/tags/video/','/video-streaming-sites/overview-embed-streamable/','/video-streaming-sites/overview-embed-vimeo/','/video-streaming-sites/overview-embed-youtube/','/blog/page/1/','/es/page/1/','/es/tags/features/atom.xml','/es/tags/features/','/es/tags/shortcodes/atom.xml','/es/tags/shortcodes/','/es/tags/video/atom.xml','/es/tags/video/','/es/video-streaming-sites/overview-embed-streamable/','/fr/overview-images/img/ferris-gesture.svg','/fr/overview-images/img/ferris.svg','/fr/page/1/','/fr/page/2/','/fr/page/3/','/fr/tags/audio/atom.xml','/fr/tags/audio/','/fr/tags/data/atom.xml','/fr/tags/data/','/fr/tags/features/atom.xml','/fr/tags/features/','/fr/tags/images/atom.xml','/fr/tags/images/','/fr/tags/markdown/atom.xml','/fr/tags/markdown/','/fr/tags/mathematics/atom.xml','/fr/tags/mathematics/','/fr/tags/shortcodes/atom.xml','/fr/tags/shortcodes/','/fr/tags/video/atom.xml','/fr/tags/video/','/fr/video-streaming-sites/overview-embed-streamable/','/fr/video-streaming-sites/overview-embed-vimeo/','/fr/video-streaming-sites/overview-embed-youtube/','/pt/page/1/','/es/blog/page/1/','/fr/blog/page/1/']; + this.BASE_CACHE_FILES = ['/','/404.html','/about/','/abridge.css','/android-chrome-192x192.png','/android-chrome-512x512.png','/apple-touch-icon.png','/archive/','/atom.xml','/banner.png','/blog/','/blog/page/1/','/browserconfig.xml','/contact/','/elasticlunr.min.js','/es/','/es/archive/','/es/atom.xml','/es/blog/','/es/blog/page/1/','/es/page/1/','/es/tags/','/es/tags/features/','/es/tags/features/atom.xml','/es/tags/shortcodes/','/es/tags/shortcodes/atom.xml','/es/tags/video/','/es/tags/video/atom.xml','/es/video-streaming-sites/overview-embed-streamable/','/favicon-16x16.png','/favicon-32x32.png','/favicon.ico','/favicon.svg','/fonts/KaTeX_AMS-Regular.woff2','/fonts/KaTeX_Caligraphic-Bold.woff2','/fonts/KaTeX_Caligraphic-Regular.woff2','/fonts/KaTeX_Fraktur-Bold.woff2','/fonts/KaTeX_Fraktur-Regular.woff2','/fonts/KaTeX_Main-Bold.woff2','/fonts/KaTeX_Main-BoldItalic.woff2','/fonts/KaTeX_Main-Italic.woff2','/fonts/KaTeX_Main-Regular.woff2','/fonts/KaTeX_Math-BoldItalic.woff2','/fonts/KaTeX_Math-Italic.woff2','/fonts/KaTeX_SansSerif-Bold.woff2','/fonts/KaTeX_SansSerif-Italic.woff2','/fonts/KaTeX_SansSerif-Regular.woff2','/fonts/KaTeX_Script-Regular.woff2','/fonts/KaTeX_Size1-Regular.woff2','/fonts/KaTeX_Size2-Regular.woff2','/fonts/KaTeX_Size3-Regular.woff2','/fonts/KaTeX_Size4-Regular.woff2','/fonts/KaTeX_Typewriter-Regular.woff2','/fonts/Roboto-Bold.woff2','/fonts/Roboto-Italic.woff2','/fonts/Roboto-Mono-Italic.woff2','/fonts/Roboto-Mono.woff2','/fonts/Roboto.woff2','/fr/','/fr/about/','/fr/archive/','/fr/atom.xml','/fr/blog/','/fr/blog/page/1/','/fr/contact/','/fr/offline/','/fr/overview-code-blocks/','/fr/overview-images/','/fr/overview-images/corro.svg','/fr/overview-images/ferris-gesture.png','/fr/overview-images/ferris-gesture.svg','/fr/overview-images/ferris-happy.svg','/fr/overview-images/ferris.svg','/fr/overview-images/img/ferris-gesture.svg','/fr/overview-images/img/ferris.svg','/fr/overview-markdown-and-style/','/fr/overview-math/','/fr/overview-rich-content/','/fr/overview-rich-content/over9000-400.avif','/fr/overview-rich-content/over9000-640.avif','/fr/overview-rich-content/over9000-640.webp','/fr/overview-rich-content/over9000-960.avif','/fr/overview-rich-content/over9000.mp3','/fr/overview-rich-content/over9000.ogg','/fr/overview-rich-content/over9000_av1.mp4','/fr/overview-rich-content/over9000_vp9.webm','/fr/overview-showdata/','/fr/page/1/','/fr/page/2/','/fr/page/3/','/fr/privacy/','/fr/tags/','/fr/tags/audio/','/fr/tags/audio/atom.xml','/fr/tags/data/','/fr/tags/data/atom.xml','/fr/tags/features/','/fr/tags/features/atom.xml','/fr/tags/images/','/fr/tags/images/atom.xml','/fr/tags/markdown/','/fr/tags/markdown/atom.xml','/fr/tags/mathematics/','/fr/tags/mathematics/atom.xml','/fr/tags/shortcodes/','/fr/tags/shortcodes/atom.xml','/fr/tags/video/','/fr/tags/video/atom.xml','/fr/video-streaming-sites/overview-embed-streamable/','/fr/video-streaming-sites/overview-embed-vimeo/','/fr/video-streaming-sites/overview-embed-youtube/','/images/ferris-gesture.svg','/images/ferris.svg','/js/abridge.min.js','/js/abridge_nopwa.min.js','/js/abridge_nosearch.min.js','/js/abridge_nosearch_nopwa.min.js','/js/codecopy.js','/js/elasticlunr.min.js','/js/email.js','/js/katex-auto-render.min.js','/js/katex.min.js','/js/katexbundle.min.js','/js/katexbundle.min.old.js','/js/katexoptions.js','/js/lunr.da.js','/js/lunr.da.min.js','/js/lunr.de.js','/js/lunr.de.min.js','/js/lunr.du.js','/js/lunr.du.min.js','/js/lunr.es.js','/js/lunr.es.min.js','/js/lunr.fi.js','/js/lunr.fi.min.js','/js/lunr.fr.js','/js/lunr.fr.min.js','/js/lunr.hu.js','/js/lunr.hu.min.js','/js/lunr.it.js','/js/lunr.it.min.js','/js/lunr.jp.js','/js/lunr.jp.min.js','/js/lunr.no.js','/js/lunr.no.min.js','/js/lunr.pt.js','/js/lunr.pt.min.js','/js/lunr.ro.js','/js/lunr.ro.min.js','/js/lunr.ru.js','/js/lunr.ru.min.js','/js/lunr.stemmer.support.js','/js/lunr.stemmer.support.min.js','/js/lunr.sv.js','/js/lunr.sv.min.js','/js/lunr.tr.js','/js/lunr.tr.min.js','/js/lunr.zh.js','/js/lunr.zh.min.js','/js/mathtex-script-type.min.js','/js/pagefind-entry.json','/js/pagefind-highlight.js','/js/pagefind-modular-ui.css','/js/pagefind-modular-ui.js','/js/pagefind-ui.css','/js/pagefind-ui.js','/js/pagefind.index.cjs','/js/pagefind.js','/js/pagefind.search.js','/js/prestyle.js','/js/search.js','/js/search_elasticlunr.min.js','/js/search_elasticlunr_jindex.min.js','/js/search_tinysearch.min.js','/js/searchjava.js','/js/searchjavaugly.js','/js/sw_load.js','/js/sw_load.min.js','/js/theme.js','/js/theme.min.js','/js/theme_button.js','/js/theme_light.js','/js/theme_light.min.js','/js/tinysearch.js','/js/wasm.en.pagefind','/js/wasm.es.pagefind','/js/wasm.fr.pagefind','/js/wasm.unknown.pagefind','/katex.min.css','/m1024.png','/m128.png','/m192.png','/m384.png','/m48.png','/m512.png','/m72.png','/m96.png','/manifest.json','/manifest.min.json','/mstile-150x150.png','/nojs.css','/offline/','/overview-abridge/','/overview-abridge/lighthouse.png','/overview-code-blocks/','/overview-images/','/overview-images/corro.svg','/overview-images/ferris-gesture.png','/overview-images/ferris-gesture.svg','/overview-images/ferris-happy.svg','/overview-images/ferris.svg','/overview-images/img/ferris-gesture.svg','/overview-images/img/ferris.svg','/overview-markdown-and-style/','/overview-math/','/overview-rich-content/','/overview-rich-content/over9000-400.avif','/overview-rich-content/over9000-640.avif','/overview-rich-content/over9000-640.webp','/overview-rich-content/over9000-960.avif','/overview-rich-content/over9000.mp3','/overview-rich-content/over9000.ogg','/overview-rich-content/over9000_av1.mp4','/overview-rich-content/over9000_vp9.webm','/overview-showdata/','/page/1/','/page/2/','/page/3/','/page/4/','/privacy/','/pt/','/pt/page/1/','/robots.txt','/safari-pinned-tab.svg','/search_index.en.json','/search_index.es.json','/search_index.fr.json','/search_index.pt.json','/sitemap.xml','/tags/','/tags/audio/','/tags/audio/atom.xml','/tags/config/','/tags/config/atom.xml','/tags/data/','/tags/data/atom.xml','/tags/features/','/tags/features/atom.xml','/tags/images/','/tags/images/atom.xml','/tags/markdown/','/tags/markdown/atom.xml','/tags/mathematics/','/tags/mathematics/atom.xml','/tags/shortcodes/','/tags/shortcodes/atom.xml','/tags/video/','/tags/video/atom.xml','/tinysearch_engine_bg.wasm','/video-streaming-sites/overview-embed-streamable/','/video-streaming-sites/overview-embed-vimeo/','/video-streaming-sites/overview-embed-youtube/']; this.host = `${self.location.protocol}//${self.location.host}`; console.info(`Host: ${this.host}`); this.OFFLINE_PAGE = '/offline/'; diff --git a/static/sw.min.js b/static/sw.min.js index 672d5210..6028cc4b 100644 --- a/static/sw.min.js +++ b/static/sw.min.js @@ -1 +1 @@ -class Pwa{constructor(e){this.scope=e;var s=new URL(location).searchParams.get("v");this.CACHE_VERSION=s,this.BASE_CACHE_FILES=["/404.html","/_headers","/abridge.css","/android-chrome-192x192.png","/android-chrome-512x512.png","/apple-touch-icon.png","/atom.xml","/banner.png","/browserconfig.xml","/elasticlunr.min.js","/favicon-16x16.png","/favicon-32x32.png","/favicon.ico","/favicon.svg","/","/katex.min.css","/m1024.png","/m128.png","/m192.png","/m384.png","/m48.png","/m512.png","/m72.png","/m96.png","/manifest.json","/manifest.min.json","/mstile-150x150.png","/nojs.css","/robots.txt","/safari-pinned-tab.svg","/search_index.en.json","/search_index.es.json","/search_index.fr.json","/search_index.pt.json","/sitemap.xml","/tinysearch_engine_bg.wasm","/about/","/archive/","/blog/","/contact/","/data_tinysearch/","/es/atom.xml","/es/","/fonts/KaTeX_AMS-Regular.woff2","/fonts/KaTeX_Caligraphic-Bold.woff2","/fonts/KaTeX_Caligraphic-Regular.woff2","/fonts/KaTeX_Fraktur-Bold.woff2","/fonts/KaTeX_Fraktur-Regular.woff2","/fonts/KaTeX_Main-Bold.woff2","/fonts/KaTeX_Main-BoldItalic.woff2","/fonts/KaTeX_Main-Italic.woff2","/fonts/KaTeX_Main-Regular.woff2","/fonts/KaTeX_Math-BoldItalic.woff2","/fonts/KaTeX_Math-Italic.woff2","/fonts/KaTeX_SansSerif-Bold.woff2","/fonts/KaTeX_SansSerif-Italic.woff2","/fonts/KaTeX_SansSerif-Regular.woff2","/fonts/KaTeX_Script-Regular.woff2","/fonts/KaTeX_Size1-Regular.woff2","/fonts/KaTeX_Size2-Regular.woff2","/fonts/KaTeX_Size3-Regular.woff2","/fonts/KaTeX_Size4-Regular.woff2","/fonts/KaTeX_Typewriter-Regular.woff2","/fonts/Roboto-Bold.woff2","/fonts/Roboto-Italic.woff2","/fonts/Roboto-Mono-Italic.woff2","/fonts/Roboto-Mono.woff2","/fonts/Roboto.woff2","/fr/atom.xml","/fr/","/images/ferris-gesture.svg","/images/ferris.svg","/js/abridge.min.js","/js/abridge_nopwa.min.js","/js/abridge_nosearch.min.js","/js/abridge_nosearch_nopwa.min.js","/js/codecopy.js","/js/elasticlunr.min.js","/js/email.js","/js/katex-auto-render.min.js","/js/katex.min.js","/js/katexbundle.min.js","/js/katexbundle.min.old.js","/js/katexoptions.js","/js/lunr.da.js","/js/lunr.da.min.js","/js/lunr.de.js","/js/lunr.de.min.js","/js/lunr.du.js","/js/lunr.du.min.js","/js/lunr.es.js","/js/lunr.es.min.js","/js/lunr.fi.js","/js/lunr.fi.min.js","/js/lunr.fr.js","/js/lunr.fr.min.js","/js/lunr.hu.js","/js/lunr.hu.min.js","/js/lunr.it.js","/js/lunr.it.min.js","/js/lunr.jp.js","/js/lunr.jp.min.js","/js/lunr.no.js","/js/lunr.no.min.js","/js/lunr.pt.js","/js/lunr.pt.min.js","/js/lunr.ro.js","/js/lunr.ro.min.js","/js/lunr.ru.js","/js/lunr.ru.min.js","/js/lunr.stemmer.support.js","/js/lunr.stemmer.support.min.js","/js/lunr.sv.js","/js/lunr.sv.min.js","/js/lunr.tr.js","/js/lunr.tr.min.js","/js/lunr.zh.js","/js/lunr.zh.min.js","/js/mathtex-script-type.min.js","/js/pagefind-entry.json","/js/pagefind-highlight.js","/js/pagefind-modular-ui.css","/js/pagefind-modular-ui.js","/js/pagefind-ui.css","/js/pagefind-ui.js","/js/pagefind.index.cjs","/js/pagefind.js","/js/pagefind.search.js","/js/prestyle.js","/js/search.js","/js/search_elasticlunr.min.js","/js/search_elasticlunr_jindex.min.js","/js/search_tinysearch.min.js","/js/searchjava.js","/js/searchjavaugly.js","/js/sw_load.js","/js/sw_load.min.js","/js/theme.js","/js/theme.min.js","/js/theme_button.js","/js/theme_light.js","/js/theme_light.min.js","/js/tinysearch.js","/js/wasm.en.pagefind","/js/wasm.es.pagefind","/js/wasm.fr.pagefind","/js/wasm.unknown.pagefind","/offline/","/overview-abridge/","/overview-abridge/lighthouse.png","/overview-code-blocks/","/overview-images/corro.svg","/overview-images/ferris-gesture.png","/overview-images/ferris-gesture.svg","/overview-images/ferris-happy.svg","/overview-images/ferris.svg","/overview-images/","/overview-markdown-and-style/","/overview-math/","/overview-rich-content/","/overview-rich-content/over9000-400.avif","/overview-rich-content/over9000-640.avif","/overview-rich-content/over9000-640.webp","/overview-rich-content/over9000-960.avif","/overview-rich-content/over9000.mp3","/overview-rich-content/over9000.ogg","/overview-rich-content/over9000_av1.mp4","/overview-rich-content/over9000_vp9.webm","/overview-showdata/","/privacy/","/pt/","/tags/","/es/archive/","/es/blog/","/es/tags/","/fr/about/","/fr/archive/","/fr/blog/","/fr/contact/","/fr/offline/","/fr/overview-code-blocks/","/fr/overview-images/corro.svg","/fr/overview-images/ferris-gesture.png","/fr/overview-images/ferris-gesture.svg","/fr/overview-images/ferris-happy.svg","/fr/overview-images/ferris.svg","/fr/overview-images/","/fr/overview-markdown-and-style/","/fr/overview-math/","/fr/overview-rich-content/","/fr/overview-rich-content/over9000-400.avif","/fr/overview-rich-content/over9000-640.avif","/fr/overview-rich-content/over9000-640.webp","/fr/overview-rich-content/over9000-960.avif","/fr/overview-rich-content/over9000.mp3","/fr/overview-rich-content/over9000.ogg","/fr/overview-rich-content/over9000_av1.mp4","/fr/overview-rich-content/over9000_vp9.webm","/fr/overview-showdata/","/fr/privacy/","/fr/tags/","/overview-images/img/ferris-gesture.svg","/overview-images/img/ferris.svg","/page/1/","/page/2/","/page/3/","/page/4/","/tags/audio/atom.xml","/tags/audio/","/tags/config/atom.xml","/tags/config/","/tags/data/atom.xml","/tags/data/","/tags/features/atom.xml","/tags/features/","/tags/images/atom.xml","/tags/images/","/tags/markdown/atom.xml","/tags/markdown/","/tags/mathematics/atom.xml","/tags/mathematics/","/tags/shortcodes/atom.xml","/tags/shortcodes/","/tags/video/atom.xml","/tags/video/","/video-streaming-sites/overview-embed-streamable/","/video-streaming-sites/overview-embed-vimeo/","/video-streaming-sites/overview-embed-youtube/","/blog/page/1/","/es/page/1/","/es/tags/features/atom.xml","/es/tags/features/","/es/tags/shortcodes/atom.xml","/es/tags/shortcodes/","/es/tags/video/atom.xml","/es/tags/video/","/es/video-streaming-sites/overview-embed-streamable/","/fr/overview-images/img/ferris-gesture.svg","/fr/overview-images/img/ferris.svg","/fr/page/1/","/fr/page/2/","/fr/page/3/","/fr/tags/audio/atom.xml","/fr/tags/audio/","/fr/tags/data/atom.xml","/fr/tags/data/","/fr/tags/features/atom.xml","/fr/tags/features/","/fr/tags/images/atom.xml","/fr/tags/images/","/fr/tags/markdown/atom.xml","/fr/tags/markdown/","/fr/tags/mathematics/atom.xml","/fr/tags/mathematics/","/fr/tags/shortcodes/atom.xml","/fr/tags/shortcodes/","/fr/tags/video/atom.xml","/fr/tags/video/","/fr/video-streaming-sites/overview-embed-streamable/","/fr/video-streaming-sites/overview-embed-vimeo/","/fr/video-streaming-sites/overview-embed-youtube/","/pt/page/1/","/es/blog/page/1/","/fr/blog/page/1/"],this.host=e.location.protocol+"//"+e.location.host,this.OFFLINE_PAGE="/offline/",this.NOT_FOUND_PAGE="/404.html",this.CACHE_NAME="content-v"+this.CACHE_VERSION,this.NORM_TTL=0,this.LONG_TTL=0,this.TTL_NORM=["sw.min.js","sw_load.min.js"],this.TTL_LONG=["jpg","jpeg","png","gif","webp","avif","ico","svg","xsl","txt"],this.TTL_EXEMPT=["js","css","otf","eot","ttf","woff","woff2","mp4","webm","mp3","ogg"]}canCache(e){return!e.startsWith("http://localhost")&&e.toString().startsWith(this.host)}getFileExtension(e){e=e.split(".").reverse()[0].split("?")[0];return e.endsWith("/")?"/":e}getFileName(e){e=e.substring(1+e.lastIndexOf("/")).split("?")[0];return e.endsWith("/")?"/":e}getTTL(e){var s;return"string"==typeof e?(s=this.getFileExtension(e),e=this.getFileName(e),~this.TTL_NORM.indexOf(e)?this.NORM_TTL:~this.TTL_LONG.indexOf(s)?this.LONG_TTL:~this.TTL_EXEMPT.indexOf(s)?null:this.NORM_TTL):null}async installServiceWorker(){try{return await caches.open(this.CACHE_NAME).then(e=>e.addAll(this.BASE_CACHE_FILES),e=>{}),this.scope.skipWaiting()}catch(e){}}cleanupLegacyCache(){let i=[this.CACHE_NAME];return new Promise((s,t)=>{caches.keys().then(e=>e.filter(e=>!~i.indexOf(e))).then(e=>{e.length?Promise.all(e.map(e=>caches.delete(e))).then(()=>s()).catch(e=>{t(e)}):s()}).catch(e=>{t(e)})})}async preCacheUrl(s){let t=await caches.open(this.CACHE_NAME);return await t.match(s)?null:fetch(s).then(e=>t.put(s,e.clone()))}register(){this.scope.addEventListener("install",e=>{e.waitUntil(Promise.all([this.installServiceWorker(),this.scope.skipWaiting()]))}),this.scope.addEventListener("activate",s=>{s.waitUntil(Promise.all([this.cleanupLegacyCache(),this.scope.clients.claim(),this.scope.skipWaiting()]).catch(e=>{s.skipWaiting()}))}),this.scope.addEventListener("fetch",o=>{o.respondWith(caches.open(this.CACHE_NAME).then(async s=>{if(!this.canCache(o.request.url))return fetch(o.request);let t=await s.match(o.request);if(t){var i;let e=null;for(i of t.headers.entries())if("date"===i[0]){e=new Date(i[1]);break}if(!e)return t;var r=parseInt(""+((new Date).getTime()-e.getTime())/1e3),a=this.getTTL(o.request.url);if(null===a||a&&re.status<400?(this.canCache(o.request.url)&&s.put(o.request,e.clone()),e):s.match(this.NOT_FOUND_PAGE)).catch(e=>(o.request.url,t||s.match(this.OFFLINE_PAGE)))}))})}}let pwa=new Pwa(self);pwa.register(); \ No newline at end of file +class Pwa{constructor(e){this.scope=e;var s=new URL(location).searchParams.get("v");this.CACHE_VERSION=s,this.BASE_CACHE_FILES=["/","/404.html","/about/","/abridge.css","/android-chrome-192x192.png","/android-chrome-512x512.png","/apple-touch-icon.png","/archive/","/atom.xml","/banner.png","/blog/","/blog/page/1/","/browserconfig.xml","/contact/","/elasticlunr.min.js","/es/","/es/archive/","/es/atom.xml","/es/blog/","/es/blog/page/1/","/es/page/1/","/es/tags/","/es/tags/features/","/es/tags/features/atom.xml","/es/tags/shortcodes/","/es/tags/shortcodes/atom.xml","/es/tags/video/","/es/tags/video/atom.xml","/es/video-streaming-sites/overview-embed-streamable/","/favicon-16x16.png","/favicon-32x32.png","/favicon.ico","/favicon.svg","/fonts/KaTeX_AMS-Regular.woff2","/fonts/KaTeX_Caligraphic-Bold.woff2","/fonts/KaTeX_Caligraphic-Regular.woff2","/fonts/KaTeX_Fraktur-Bold.woff2","/fonts/KaTeX_Fraktur-Regular.woff2","/fonts/KaTeX_Main-Bold.woff2","/fonts/KaTeX_Main-BoldItalic.woff2","/fonts/KaTeX_Main-Italic.woff2","/fonts/KaTeX_Main-Regular.woff2","/fonts/KaTeX_Math-BoldItalic.woff2","/fonts/KaTeX_Math-Italic.woff2","/fonts/KaTeX_SansSerif-Bold.woff2","/fonts/KaTeX_SansSerif-Italic.woff2","/fonts/KaTeX_SansSerif-Regular.woff2","/fonts/KaTeX_Script-Regular.woff2","/fonts/KaTeX_Size1-Regular.woff2","/fonts/KaTeX_Size2-Regular.woff2","/fonts/KaTeX_Size3-Regular.woff2","/fonts/KaTeX_Size4-Regular.woff2","/fonts/KaTeX_Typewriter-Regular.woff2","/fonts/Roboto-Bold.woff2","/fonts/Roboto-Italic.woff2","/fonts/Roboto-Mono-Italic.woff2","/fonts/Roboto-Mono.woff2","/fonts/Roboto.woff2","/fr/","/fr/about/","/fr/archive/","/fr/atom.xml","/fr/blog/","/fr/blog/page/1/","/fr/contact/","/fr/offline/","/fr/overview-code-blocks/","/fr/overview-images/","/fr/overview-images/corro.svg","/fr/overview-images/ferris-gesture.png","/fr/overview-images/ferris-gesture.svg","/fr/overview-images/ferris-happy.svg","/fr/overview-images/ferris.svg","/fr/overview-images/img/ferris-gesture.svg","/fr/overview-images/img/ferris.svg","/fr/overview-markdown-and-style/","/fr/overview-math/","/fr/overview-rich-content/","/fr/overview-rich-content/over9000-400.avif","/fr/overview-rich-content/over9000-640.avif","/fr/overview-rich-content/over9000-640.webp","/fr/overview-rich-content/over9000-960.avif","/fr/overview-rich-content/over9000.mp3","/fr/overview-rich-content/over9000.ogg","/fr/overview-rich-content/over9000_av1.mp4","/fr/overview-rich-content/over9000_vp9.webm","/fr/overview-showdata/","/fr/page/1/","/fr/page/2/","/fr/page/3/","/fr/privacy/","/fr/tags/","/fr/tags/audio/","/fr/tags/audio/atom.xml","/fr/tags/data/","/fr/tags/data/atom.xml","/fr/tags/features/","/fr/tags/features/atom.xml","/fr/tags/images/","/fr/tags/images/atom.xml","/fr/tags/markdown/","/fr/tags/markdown/atom.xml","/fr/tags/mathematics/","/fr/tags/mathematics/atom.xml","/fr/tags/shortcodes/","/fr/tags/shortcodes/atom.xml","/fr/tags/video/","/fr/tags/video/atom.xml","/fr/video-streaming-sites/overview-embed-streamable/","/fr/video-streaming-sites/overview-embed-vimeo/","/fr/video-streaming-sites/overview-embed-youtube/","/images/ferris-gesture.svg","/images/ferris.svg","/js/abridge.min.js","/js/abridge_nopwa.min.js","/js/abridge_nosearch.min.js","/js/abridge_nosearch_nopwa.min.js","/js/codecopy.js","/js/elasticlunr.min.js","/js/email.js","/js/katex-auto-render.min.js","/js/katex.min.js","/js/katexbundle.min.js","/js/katexbundle.min.old.js","/js/katexoptions.js","/js/lunr.da.js","/js/lunr.da.min.js","/js/lunr.de.js","/js/lunr.de.min.js","/js/lunr.du.js","/js/lunr.du.min.js","/js/lunr.es.js","/js/lunr.es.min.js","/js/lunr.fi.js","/js/lunr.fi.min.js","/js/lunr.fr.js","/js/lunr.fr.min.js","/js/lunr.hu.js","/js/lunr.hu.min.js","/js/lunr.it.js","/js/lunr.it.min.js","/js/lunr.jp.js","/js/lunr.jp.min.js","/js/lunr.no.js","/js/lunr.no.min.js","/js/lunr.pt.js","/js/lunr.pt.min.js","/js/lunr.ro.js","/js/lunr.ro.min.js","/js/lunr.ru.js","/js/lunr.ru.min.js","/js/lunr.stemmer.support.js","/js/lunr.stemmer.support.min.js","/js/lunr.sv.js","/js/lunr.sv.min.js","/js/lunr.tr.js","/js/lunr.tr.min.js","/js/lunr.zh.js","/js/lunr.zh.min.js","/js/mathtex-script-type.min.js","/js/pagefind-entry.json","/js/pagefind-highlight.js","/js/pagefind-modular-ui.css","/js/pagefind-modular-ui.js","/js/pagefind-ui.css","/js/pagefind-ui.js","/js/pagefind.index.cjs","/js/pagefind.js","/js/pagefind.search.js","/js/prestyle.js","/js/search.js","/js/search_elasticlunr.min.js","/js/search_elasticlunr_jindex.min.js","/js/search_tinysearch.min.js","/js/searchjava.js","/js/searchjavaugly.js","/js/sw_load.js","/js/sw_load.min.js","/js/theme.js","/js/theme.min.js","/js/theme_button.js","/js/theme_light.js","/js/theme_light.min.js","/js/tinysearch.js","/js/wasm.en.pagefind","/js/wasm.es.pagefind","/js/wasm.fr.pagefind","/js/wasm.unknown.pagefind","/katex.min.css","/m1024.png","/m128.png","/m192.png","/m384.png","/m48.png","/m512.png","/m72.png","/m96.png","/manifest.json","/manifest.min.json","/mstile-150x150.png","/nojs.css","/offline/","/overview-abridge/","/overview-abridge/lighthouse.png","/overview-code-blocks/","/overview-images/","/overview-images/corro.svg","/overview-images/ferris-gesture.png","/overview-images/ferris-gesture.svg","/overview-images/ferris-happy.svg","/overview-images/ferris.svg","/overview-images/img/ferris-gesture.svg","/overview-images/img/ferris.svg","/overview-markdown-and-style/","/overview-math/","/overview-rich-content/","/overview-rich-content/over9000-400.avif","/overview-rich-content/over9000-640.avif","/overview-rich-content/over9000-640.webp","/overview-rich-content/over9000-960.avif","/overview-rich-content/over9000.mp3","/overview-rich-content/over9000.ogg","/overview-rich-content/over9000_av1.mp4","/overview-rich-content/over9000_vp9.webm","/overview-showdata/","/page/1/","/page/2/","/page/3/","/page/4/","/privacy/","/pt/","/pt/page/1/","/robots.txt","/safari-pinned-tab.svg","/search_index.en.json","/search_index.es.json","/search_index.fr.json","/search_index.pt.json","/sitemap.xml","/tags/","/tags/audio/","/tags/audio/atom.xml","/tags/config/","/tags/config/atom.xml","/tags/data/","/tags/data/atom.xml","/tags/features/","/tags/features/atom.xml","/tags/images/","/tags/images/atom.xml","/tags/markdown/","/tags/markdown/atom.xml","/tags/mathematics/","/tags/mathematics/atom.xml","/tags/shortcodes/","/tags/shortcodes/atom.xml","/tags/video/","/tags/video/atom.xml","/tinysearch_engine_bg.wasm","/video-streaming-sites/overview-embed-streamable/","/video-streaming-sites/overview-embed-vimeo/","/video-streaming-sites/overview-embed-youtube/"],this.host=e.location.protocol+"//"+e.location.host,this.OFFLINE_PAGE="/offline/",this.NOT_FOUND_PAGE="/404.html",this.CACHE_NAME="content-v"+this.CACHE_VERSION,this.NORM_TTL=0,this.LONG_TTL=0,this.TTL_NORM=["sw.min.js","sw_load.min.js"],this.TTL_LONG=["jpg","jpeg","png","gif","webp","avif","ico","svg","xsl","txt"],this.TTL_EXEMPT=["js","css","otf","eot","ttf","woff","woff2","mp4","webm","mp3","ogg"]}canCache(e){return!e.startsWith("http://localhost")&&e.toString().startsWith(this.host)}getFileExtension(e){e=e.split(".").reverse()[0].split("?")[0];return e.endsWith("/")?"/":e}getFileName(e){e=e.substring(1+e.lastIndexOf("/")).split("?")[0];return e.endsWith("/")?"/":e}getTTL(e){var s;return"string"==typeof e?(s=this.getFileExtension(e),e=this.getFileName(e),~this.TTL_NORM.indexOf(e)?this.NORM_TTL:~this.TTL_LONG.indexOf(s)?this.LONG_TTL:~this.TTL_EXEMPT.indexOf(s)?null:this.NORM_TTL):null}async installServiceWorker(){try{return await caches.open(this.CACHE_NAME).then(e=>e.addAll(this.BASE_CACHE_FILES),e=>{}),this.scope.skipWaiting()}catch(e){}}cleanupLegacyCache(){let i=[this.CACHE_NAME];return new Promise((s,t)=>{caches.keys().then(e=>e.filter(e=>!~i.indexOf(e))).then(e=>{e.length?Promise.all(e.map(e=>caches.delete(e))).then(()=>s()).catch(e=>{t(e)}):s()}).catch(e=>{t(e)})})}async preCacheUrl(s){let t=await caches.open(this.CACHE_NAME);return await t.match(s)?null:fetch(s).then(e=>t.put(s,e.clone()))}register(){this.scope.addEventListener("install",e=>{e.waitUntil(Promise.all([this.installServiceWorker(),this.scope.skipWaiting()]))}),this.scope.addEventListener("activate",s=>{s.waitUntil(Promise.all([this.cleanupLegacyCache(),this.scope.clients.claim(),this.scope.skipWaiting()]).catch(e=>{s.skipWaiting()}))}),this.scope.addEventListener("fetch",o=>{o.respondWith(caches.open(this.CACHE_NAME).then(async s=>{if(!this.canCache(o.request.url))return fetch(o.request);let t=await s.match(o.request);if(t){var i;let e=null;for(i of t.headers.entries())if("date"===i[0]){e=new Date(i[1]);break}if(!e)return t;var r=parseInt(""+((new Date).getTime()-e.getTime())/1e3),a=this.getTTL(o.request.url);if(null===a||a&&re.status<400?(this.canCache(o.request.url)&&s.put(o.request,e.clone()),e):s.match(this.NOT_FOUND_PAGE)).catch(e=>(o.request.url,t||s.match(this.OFFLINE_PAGE)))}))})}}let pwa=new Pwa(self);pwa.register(); \ No newline at end of file