sinzmise-cetastories-en 2.0.0-1731680885028 → 2.0.0-1732422790525
Sign up to get free protection for your applications and to get access to all the features.
- package/404.html +0 -0
- package/archives/2023/12/index.html +0 -1
- package/archives/2023/index.html +0 -1
- package/archives/index.html +0 -1
- package/atom.xml +2 -2
- package/baidu_verify_codeva-NA6uDlCuZg.html +0 -1
- package/baidusitemap.xml +7 -0
- package/categories/Test/index.html +0 -1
- package/categories/index.html +0 -1
- package/comments/index.html +0 -0
- package/config.yaml +35 -2
- package/content.json +1 -1
- package/css/coin.css +1 -0
- package/css/custom2.css +1 -2
- package/css/hbe.style.css +1 -0
- package/css/index.css +1 -0
- package/css/kslink.css +1 -0
- package/css/pace/big-counter.css +1 -2
- package/css/pace/corner-indicator.css +1 -2
- package/css/pace/flash.css +1 -2
- package/css/pace/mac-osx.css +1 -2
- package/css/pace/pace.css +1 -2
- package/css/plane.css +1 -2
- package/css/tags.css +1 -2
- package/css/var.css +0 -0
- package/cw.js +1 -0
- package/google8073542809160a67.html +0 -1
- package/images/siteicon/android/android-launchericon-144-144.png +0 -0
- package/images/siteicon/android/android-launchericon-192-192.png +0 -0
- package/images/siteicon/android/android-launchericon-48-48.png +0 -0
- package/images/siteicon/android/android-launchericon-512-512.png +0 -0
- package/images/siteicon/android/android-launchericon-72-72.png +0 -0
- package/images/siteicon/android/android-launchericon-96-96.png +0 -0
- package/images/siteicon/apple-touch-icon.png +0 -0
- package/images/siteicon/favicon-96x96.png +0 -0
- package/images/siteicon/favicon.ico +0 -0
- package/images/siteicon/favicon.svg +1 -1
- package/images/siteicon/ios/100.png +0 -0
- package/images/siteicon/ios/1024.png +0 -0
- package/images/siteicon/ios/114.png +0 -0
- package/images/siteicon/ios/120.png +0 -0
- package/images/siteicon/ios/128.png +0 -0
- package/images/siteicon/ios/144.png +0 -0
- package/images/siteicon/ios/152.png +0 -0
- package/images/siteicon/ios/16.png +0 -0
- package/images/siteicon/ios/167.png +0 -0
- package/images/siteicon/ios/180.png +0 -0
- package/images/siteicon/ios/192.png +0 -0
- package/images/siteicon/ios/20.png +0 -0
- package/images/siteicon/ios/256.png +0 -0
- package/images/siteicon/ios/29.png +0 -0
- package/images/siteicon/ios/32.png +0 -0
- package/images/siteicon/ios/40.png +0 -0
- package/images/siteicon/ios/50.png +0 -0
- package/images/siteicon/ios/512.png +0 -0
- package/images/siteicon/ios/57.png +0 -0
- package/images/siteicon/ios/58.png +0 -0
- package/images/siteicon/ios/60.png +0 -0
- package/images/siteicon/ios/64.png +0 -0
- package/images/siteicon/ios/72.png +0 -0
- package/images/siteicon/ios/76.png +0 -0
- package/images/siteicon/ios/80.png +0 -0
- package/images/siteicon/ios/87.png +0 -0
- package/images/siteicon/web-app-manifest-192x192.png +0 -0
- package/images/siteicon/web-app-manifest-512x512.png +0 -0
- package/images/siteicon/windows11/LargeTile.scale-100.png +0 -0
- package/images/siteicon/windows11/LargeTile.scale-125.png +0 -0
- package/images/siteicon/windows11/LargeTile.scale-150.png +0 -0
- package/images/siteicon/windows11/LargeTile.scale-200.png +0 -0
- package/images/siteicon/windows11/LargeTile.scale-400.png +0 -0
- package/images/siteicon/windows11/SmallTile.scale-100.png +0 -0
- package/images/siteicon/windows11/SmallTile.scale-125.png +0 -0
- package/images/siteicon/windows11/SmallTile.scale-150.png +0 -0
- package/images/siteicon/windows11/SmallTile.scale-200.png +0 -0
- package/images/siteicon/windows11/SmallTile.scale-400.png +0 -0
- package/images/siteicon/windows11/SplashScreen.scale-100.png +0 -0
- package/images/siteicon/windows11/SplashScreen.scale-125.png +0 -0
- package/images/siteicon/windows11/SplashScreen.scale-150.png +0 -0
- package/images/siteicon/windows11/SplashScreen.scale-200.png +0 -0
- package/images/siteicon/windows11/SplashScreen.scale-400.png +0 -0
- package/images/siteicon/windows11/Square150x150Logo.scale-100.png +0 -0
- package/images/siteicon/windows11/Square150x150Logo.scale-125.png +0 -0
- package/images/siteicon/windows11/Square150x150Logo.scale-150.png +0 -0
- package/images/siteicon/windows11/Square150x150Logo.scale-200.png +0 -0
- package/images/siteicon/windows11/Square150x150Logo.scale-400.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-16.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-20.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-24.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-256.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-30.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-32.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-36.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-40.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-44.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-48.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-60.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-64.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-72.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-80.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-96.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-16.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-20.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-24.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-256.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-30.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-32.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-36.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-40.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-44.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-48.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-60.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-64.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-72.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-80.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-96.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.scale-100.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.scale-125.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.scale-150.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.scale-200.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.scale-400.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-16.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-20.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-24.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-256.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-30.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-32.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-36.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-40.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-44.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-48.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-60.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-64.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-72.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-80.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-96.png +0 -0
- package/images/siteicon/windows11/StoreLogo.scale-100.png +0 -0
- package/images/siteicon/windows11/StoreLogo.scale-125.png +0 -0
- package/images/siteicon/windows11/StoreLogo.scale-150.png +0 -0
- package/images/siteicon/windows11/StoreLogo.scale-200.png +0 -0
- package/images/siteicon/windows11/StoreLogo.scale-400.png +0 -0
- package/images/siteicon/windows11/Wide310x150Logo.scale-100.png +0 -0
- package/images/siteicon/windows11/Wide310x150Logo.scale-125.png +0 -0
- package/images/siteicon/windows11/Wide310x150Logo.scale-150.png +0 -0
- package/images/siteicon/windows11/Wide310x150Logo.scale-200.png +0 -0
- package/images/siteicon/windows11/Wide310x150Logo.scale-400.png +0 -0
- package/img/404.jpg +0 -0
- package/img/favicon.png +0 -0
- package/index.html +0 -1
- package/js/Gold-ingot.js +1 -0
- package/js/autoload.js +1 -2
- package/js/bibi.js +1 -0
- package/js/census.js +1 -0
- package/js/clock.js +1 -2
- package/js/coin.js +1 -0
- package/js/fomal.js +1 -0
- package/js/kslink.js +1 -2
- package/js/main.js +1 -0
- package/js/newyear.js +1 -2
- package/js/plane.js +1 -2
- package/js/search/algolia.js +1 -2
- package/js/search/local-search.js +1 -0
- package/js/tw_cn.js +1 -0
- package/js/txmap.js +1 -2
- package/js/utils.js +1 -0
- package/lib/hbe.js +1 -0
- package/load.html +1 -1
- package/package.json +1 -1
- package/posts/46521/index.html +0 -1
- package/search.xml +28 -11
- package/sitemap.xml +101 -0
- package/sw-dom.js +54 -0
- package/sw.js +1 -2
- package/tags/Test/index.html +0 -1
- package/tags/index.html +0 -1
- package/assets/algolia/algoliasearch.js +0 -11
- package/assets/algolia/algoliasearch.min.js +0 -4
- package/assets/algolia/algoliasearchLite.js +0 -11
- package/assets/algolia/algoliasearchLite.min.js +0 -3
- package/css/first.css +0 -2
- package/css/style.css +0 -2
- package/games +0 -4104
- package/images/siteicon/favicon-16x16.png +0 -0
- package/images/siteicon/favicon-32x32.png +0 -0
- package/images/siteicon/favicon-48x48.png +0 -0
- package/js/app.js +0 -2
- package/js/ceta/fancybox.css +0 -2
- package/js/ceta/fancybox.umd.js +0 -2
- package/js/ceta/iconfontInkss.js +0 -2
- package/js/ceta/lazyload.min.js +0 -1
- package/js/ceta/message.css +0 -2
- package/js/ceta/message.js +0 -2
- package/js/ceta/pjax.min.js +0 -1
- package/js/plugins/aplayer.js +0 -2
- package/js/plugins/parallax.js +0 -2
- package/js/plugins/rightMenus.js +0 -2
- package/js/plugins/tags/contributors.js +0 -2
- package/js/plugins/tags/friends.js +0 -2
- package/js/plugins/tags/sites.js +0 -2
- package/js/search/hexo.js +0 -2
- package/js/search/meilisearch.js +0 -2
- package/maps/assets/algolia/algoliasearch.js.map +0 -1
- package/maps/assets/algolia/algoliasearchLite.js.map +0 -1
- package/maps/css/custom2.css.map +0 -1
- package/maps/css/first.css.map +0 -1
- package/maps/css/pace/big-counter.css.map +0 -1
- package/maps/css/pace/corner-indicator.css.map +0 -1
- package/maps/css/pace/flash.css.map +0 -1
- package/maps/css/pace/mac-osx.css.map +0 -1
- package/maps/css/pace/pace.css.map +0 -1
- package/maps/css/plane.css.map +0 -1
- package/maps/css/style.css.map +0 -1
- package/maps/css/tags.css.map +0 -1
- package/maps/js/app.js.map +0 -1
- package/maps/js/autoload.js.map +0 -1
- package/maps/js/ceta/fancybox.css.map +0 -1
- package/maps/js/ceta/fancybox.umd.js.map +0 -1
- package/maps/js/ceta/iconfontInkss.js.map +0 -1
- package/maps/js/ceta/message.css.map +0 -1
- package/maps/js/ceta/message.js.map +0 -1
- package/maps/js/clock.js.map +0 -1
- package/maps/js/kslink.js.map +0 -1
- package/maps/js/newyear.js.map +0 -1
- package/maps/js/plane.js.map +0 -1
- package/maps/js/plugins/aplayer.js.map +0 -1
- package/maps/js/plugins/parallax.js.map +0 -1
- package/maps/js/plugins/rightMenus.js.map +0 -1
- package/maps/js/plugins/tags/contributors.js.map +0 -1
- package/maps/js/plugins/tags/friends.js.map +0 -1
- package/maps/js/plugins/tags/sites.js.map +0 -1
- package/maps/js/search/algolia.js.map +0 -1
- package/maps/js/search/hexo.js.map +0 -1
- package/maps/js/search/meilisearch.js.map +0 -1
- package/maps/js/txmap.js.map +0 -1
- package/maps/sw.js.map +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"../../../../js/plugins/tags/sites.js","names":["SitesJS","requestAPI","url","callback","timeout","retryTimes","request","Promise","resolve","reject","status","timer","setTimeout","fetch","then","response","clearTimeout","ok","json","Error","data","catch","error","layout","cfg","el","api","querySelector","remove","arr","content","cellALL","forEach","item","i","cell","title","screenshot","avatar","description","innerHTML","innerText","e","start","els","document","getElementsByClassName","length","getAttribute","Object","class","volantis","GLOBAL_CONFIG","default","link","cover","addEventListener"],"sources":["js/plugins/tags/sites.js"],"mappings":"AAAA,MAAMA,QAAU,CACdC,WAAY,CAACC,EAAKC,EAAUC,KAC1B,IAAIC,EAAa,GAEjB,SAASC,IACP,OAAO,IAAIC,SAAQ,CAACC,EAASC,KAC3B,IAAIC,EAAS,EACTC,EAAQC,YAAW,KACN,IAAXF,IACFA,EAAS,EACTC,EAAQ,KACRF,EAAO,QACW,GAAdJ,GACFD,IAEJ,GACC,KACHS,MAAMX,GAAKY,MAAK,SAAUC,GAOxB,GANe,IAAXL,IACFM,aAAaL,GACbH,EAAQO,GACRJ,EAAQ,KACRD,EAAS,GAEPK,EAASE,GACX,OAAOF,EAASG,OAElB,MAAM,IAAIC,MAAM,+BAClB,IAAGL,MAAK,SAAUM,GAChBf,EAAa,EACbF,EAASiB,EACX,IAAGC,OAAM,SAAUC,GACbjB,EAAa,GACfA,GAAc,EACdO,YAAW,KACTN,GAAS,GACR,MAEHF,GAEJ,GAAE,GAEN,CACAE,EAAS,EAEXiB,OAASC,IACP,MAAMC,EAAKD,EAAIC,GACfzB,QAAQC,WAAWuB,EAAIE,KAAK,SAAUN,GACpCK,EAAGE,cAAc,iBAAiBC,SAClC,MAAMC,EAAMT,EAAKU,QACjB,IAAIC,EAAU,GACdF,EAAIG,SAAQ,CAACC,EAAMC,KACjB,IAAIC,EAAO,0BACXA,GAAQ,iFAAmFF,EAAK/B,IAAM,KACtGiC,GAAQ,aAAeF,EAAKG,MAAQ,WAAaH,EAAKI,YAAe,iDAAmDJ,EAAK/B,KAAQ,oCACrIiC,GAAQ,qBACRA,GAAQ,aAAeF,EAAKG,MAAQ,WAAaH,EAAKK,QAAUd,EAAIc,QAAU,qCAC9EH,GAAQ,uBAAyBF,EAAKG,MAAQ,UAC9CD,GAAQ,uBAAyBF,EAAKM,aAAeN,EAAK/B,KAAO,UACjEiC,GAAQ,SACRA,GAAQ,OAERJ,GADAI,GAAQ,QACO,IAEjBV,EAAGE,cAAc,eAAea,UAAYT,CAC9C,IAAG,WACD,IACEN,EAAGE,cAAc,qBAAqBC,SACtCH,EAAGE,cAAc,mBAAmBc,UAAU,cAChD,CAAE,MAAOC,GAAK,CAChB,GAAE,EAEJC,MAAQnB,IACN,MAAMoB,EAAMC,SAASC,uBAAuB,gBAC5C,IAAK,IAAIZ,EAAI,EAAGA,EAAIU,EAAIG,OAAQb,IAAK,CACnC,MAAMT,EAAKmB,EAAIV,GACTR,EAAMD,EAAGuB,aAAa,OAC5B,GAAW,MAAPtB,GAGAF,EAAM,IAAIyB,QACVC,MAAQzB,EAAGuB,aAAa,SAC5BxB,EAAIC,GAAKA,EACTD,EAAIE,IAAMA,EACVF,EAAIc,OAASa,SAASC,cAAcC,QAAQC,KAC5C9B,EAAIa,WAAac,SAASC,cAAcC,QAAQE,MAChDvD,QAAQuB,OAAOC,EACjB,IAKJxB,QAAQ2C,QACRE,SAASW,iBAAiB,iBAAiB,WACzCxD,QAAQ2C,OACV","ignoreList":[],"sourcesContent":["const SitesJS = {\n requestAPI: (url, callback, timeout) => {\n let retryTimes = 5;\n\n function request() {\n return new Promise((resolve, reject) => {\n let status = 0; // 0 等待 1 完成 2 超时\n let timer = setTimeout(() => {\n if (status === 0) {\n status = 2;\n timer = null;\n reject('请求超时');\n if (retryTimes == 0) {\n timeout();\n }\n }\n }, 5000);\n fetch(url).then(function (response) {\n if (status !== 2) {\n clearTimeout(timer);\n resolve(response);\n timer = null;\n status = 1;\n }\n if (response.ok) {\n return response.json();\n }\n throw new Error('Network response was not ok.');\n }).then(function (data) {\n retryTimes = 0;\n callback(data);\n }).catch(function (error) {\n if (retryTimes > 0) {\n retryTimes -= 1;\n setTimeout(() => {\n request();\n }, 5000);\n } else {\n timeout();\n }\n });\n });\n }\n request();\n },\n layout: (cfg) => {\n const el = cfg.el;\n SitesJS.requestAPI(cfg.api, function (data) {\n el.querySelector('.loading-wrap').remove();\n const arr = data.content;\n var cellALL = \"\";\n arr.forEach((item, i) => {\n var cell = '<div class=\"site-card\">';\n cell += '<a class=\"card-link\" target=\"_blank\" rel=\"external noopener noreferrer\" href=\"' + item.url + '\">';\n cell += '<img alt=\"' + item.title + '\" src=\"' + (item.screenshot || ('https://image.thum.io/get/width/1024/crop/768/' + item.url)) + '\" onerror=\"errorImgCover(this)\"/>';\n cell += '<div class=\"info\">';\n cell += '<img alt=\"' + item.title + '\" src=\"' + (item.avatar || cfg.avatar) + '\" onerror=\"errorImgAvatar(this)\"/>';\n cell += '<span class=\"title\">' + item.title + '</span>';\n cell += '<span class=\"desc\">' + (item.description || item.url) + '</span>';\n cell += '</div>';\n cell += '</a>';\n cell += '</div>';\n cellALL += cell;\n });\n el.querySelector('.group-body').innerHTML = cellALL;\n }, function () {\n try {\n el.querySelector('.loading-wrap svg').remove();\n el.querySelector('.loading-wrap p').innerText('加载失败,请稍后重试。');\n } catch (e) { }\n });\n },\n start: (cfg) => {\n const els = document.getElementsByClassName('sitesjs-wrap');\n for (var i = 0; i < els.length; i++) {\n const el = els[i];\n const api = el.getAttribute('api');\n if (api == null) {\n continue;\n }\n var cfg = new Object();\n cfg.class = el.getAttribute('class');\n cfg.el = el;\n cfg.api = api;\n cfg.avatar = volantis.GLOBAL_CONFIG.default.link;\n cfg.screenshot = volantis.GLOBAL_CONFIG.default.cover;\n SitesJS.layout(cfg);\n }\n }\n}\n\n\nSitesJS.start();\ndocument.addEventListener('pjax:complete', function () {\n SitesJS.start();\n});"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"../../../js/search/algolia.js","names":["SearchService","fn","search","algolia","timerId","queryText","template","init","div","document","createElement","innerHTML","body","append","volantis","GLOBAL_CONFIG","appId","apiKey","indexName","event","setAlgolia","querySelector","style","textAlign","maxHeight","addEventListener","close","querySelectorAll","forEach","e","onSubmit","input","target","value","instantsearch","searchClient","algoliasearch","searchFunction","helper","state","query","configure","widgets","hitsPerPage","searchBox","container","autofocus","showReset","showSubmit","showLoadingIndicator","searchAsYouType","placeholder","templates","queryHook","refine","clearTimeout","setTimeout","hits","item","data","keyword","link","permalink","root","path","result","_highlightResult","content","contentStripTruncate","cutContent","contentStrip","title","empty","languages","hits_empty","replace","stats","text","hits_stats","nbHits","processingTimeMS","powerBy","poweredBy","theme","dark","mode","pagination","totalPages","first","last","previous","next","addWidgets","start","window","pjax","on","refresh","getElementById","setQueryText","setUiState","display","code","once","preventDefault","firstOccur","indexOf","end","pre","post","length","substring","matchContent","Object","freeze"],"sources":["js/search/algolia.js"],"mappings":"AAAA,IAAIA,cAAgB,MAClB,MAAMC,EAAK,CAAC,EACZ,IAAIC,EAAQC,EAASC,EA+NrB,OA9NAH,EAAGI,UAAY,KACfJ,EAAGK,SAAW,u7BA6BdL,EAAGM,KAAO,KACR,IAAIC,EAAMC,SAASC,cAAc,OACjCF,EAAIG,WAAaV,EAAGK,SACpBG,SAASG,KAAKC,OAAOL,GAErBL,EAAUW,SAASC,cAAcb,OAC7BC,EAAQa,OAASb,EAAQc,QAAUd,EAAQe,WAC7CjB,EAAGkB,QACHlB,EAAGmB,eAEHX,SAASY,cAAc,6BAA6BV,UAAY,8BAChEF,SAASY,cAAc,6BAA6BC,MAAMC,UAAY,SACtEd,SAASY,c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AE6E,MAAM,GAAM,EAGnBtG,EAAG6B,SAAYX,IACbA,EAAMqF,iBACN,IAAIzE,EAAQZ,EAAMa,OAAOX,cAAc,mBACvCpB,EAAGkG,aAAapE,GAAOE,MAAQF,EAAME,MAAQd,EAAMa,OAAOC,OAC1DhC,EAAGC,QAAQ,EAGbD,EAAGoE,WAAaF,IACd,GAAgB,KAAZA,EAAgB,MAAO,GAE3B,MAAMsC,EAAatC,EAAQuC,QAAQ,UAEnC,IAAIb,EAAQY,EAAa,GACrBE,EAAMF,EAAa,IACnBG,EAAM,GACNC,EAAO,GAgBX,OAdIhB,GAAS,GACXA,EAAQ,EACRc,EAAM,KAENC,EAAM,MAGJD,EAAMxC,EAAQ2C,OAChBH,EAAMxC,EAAQ2C,OAEdD,EAAO,MAGUD,EAAMzC,EAAQ4C,UAAUlB,EAAOc,GAAOE,CAClDG,EAGT/G,EAAGyB,MAAQ,KACTjB,SAASY,cAAc,aAAaC,MAAM+E,QAAU,MAAM,EAGrD,CACL9F,KAAMN,EAAGM,KACT4F,aAAc9F,IACZJ,EAAGkG,aAAa9F,EAAU,EAE5BH,OAAQD,EAAGC,OACXwB,MAAOzB,EAAGyB,MAEb,EAzOmB,GA2OpBuF,OAAOC,OAAOlH,eAEdA,cAAcO,OACdE,SAASgB,iBAAiB,YAAazB,cAAc0B","ignoreList":[],"sourcesContent":["let SearchService = (() => {\n const fn = {};\n let search, algolia, timerId; \n fn.queryText = null;\n fn.template = `<div id=\"u-search\">\n <div class=\"modal\">\n <header class=\"modal-header\" class=\"clearfix\">\n <button type=\"submit\" id=\"u-search-modal-btn-submit\" class=\"u-search-btn-submit\">\n <span class=\"fa-solid fa-search\"></span>\n </button>\n <div id=\"algolia-search-input\"></div>\n <a id=\"u-search-btn-close\" class=\"btn-close\"> <span class=\"fa-solid fa-times\"></span> </a>\n </header>\n <main class=\"modal-body\">\n <div id=\"algolia-search-results\">\n <div id=\"algolia-hits\">\n <div class=\"search-icon\"><i class=\"fa-sharp fa-solid fa-telescope\"></i></i></div>\n </div>\n </div>\n </main>\n <footer>\n <div id=\"algolia-pagination\"></div>\n <hr>\n <div id=\"algolia-info\">\n <div class=\"algolia-stats\"></div>\n <div class=\"algolia-poweredBy\"></div>\n </div>\n </footer>\n </div>\n <div id=\"modal-overlay\" class=\"modal-overlay\"></div>\n </div>\n `;\n\n fn.init = () => {\n let div = document.createElement(\"div\");\n div.innerHTML += fn.template;\n document.body.append(div);\n\n algolia = volantis.GLOBAL_CONFIG.search;\n if (algolia.appId && algolia.apiKey && algolia.indexName) {\n fn.event();\n fn.setAlgolia();\n } else {\n document.querySelector('#u-search main.modal-body').innerHTML = 'Algolia setting is invalid!';\n document.querySelector('#u-search main.modal-body').style.textAlign = 'center';\n document.querySelector('#u-search .modal').style.maxHeight = '128px';\n }\n }\n\n fn.event = () => {\n document\n .querySelector(\"#u-search-btn-close\")\n .addEventListener(\"click\", fn.close, false);\n document\n .querySelector(\"#modal-overlay\")\n .addEventListener(\"click\", fn.close, false);\n document.querySelectorAll(\".u-search-form\").forEach((e) => {\n e.addEventListener(\"submit\", fn.onSubmit, false);\n });\n document.querySelector(\"#algolia-search-input\").addEventListener(\"input\", event => {\n let input = event.target.querySelector(\".ais-SearchBox-input\");\n if (input) {\n fn.queryText = input.value;\n } else {\n fn.queryText = event.target.value;\n }\n })\n }\n\n fn.setAlgolia = () => {\n search = instantsearch({\n indexName: algolia.indexName,\n searchClient: algoliasearch(algolia.appId, algolia.apiKey),\n searchFunction(helper) {\n helper.state.query && helper.search()\n },\n })\n\n const configure = instantsearch.widgets.configure({\n hitsPerPage: algolia.hitsPerPage\n })\n\n const searchBox = instantsearch.widgets.searchBox({\n container: '#algolia-search-input',\n autofocus: true,\n showReset: false,\n showSubmit: false,\n showLoadingIndicator: false,\n searchAsYouType: algolia.searchAsYouType,\n placeholder: algolia.placeholder,\n templates: {\n input: 'algolia-input'\n },\n queryHook(query, refine) {\n clearTimeout(timerId)\n timerId = setTimeout(() => refine(query), 500)\n }\n })\n\n const hits = instantsearch.widgets.hits({\n container: '#algolia-hits',\n templates: {\n item(data) {\n const keyword = !!fn.queryText ? `?keyword=${fn.queryText}` : ''\n const link = data.permalink ? data.permalink : `${volantis.GLOBAL_CONFIG.root}${data.path}`\n const result = data._highlightResult\n const content = result.contentStripTruncate\n ? fn.cutContent(result.contentStripTruncate.value)\n : result.contentStrip\n ? fn.cutContent(result.contentStrip.value)\n : result.content\n ? fn.cutContent(result.content.value)\n : ''\n return `\n <a href=\"${link}${keyword}\" class=\"result\">\n <span class=\"title\">${result.title.value || 'no-title'}</span>\n <span class=\"digest\">${content}</span>\n </a>`\n },\n empty: function (data) {\n return (\n `<div id=\"resule-hits-empty\"><i class=\"fa-solid fa-box-open\"></i><p>${volantis.GLOBAL_CONFIG.languages.search.hits_empty.replace(/\\$\\{query}/, data.query)}</p></div>`\n )\n }\n }\n })\n\n const stats = instantsearch.widgets.stats({\n container: '#algolia-info > .algolia-stats',\n templates: {\n text: function (data) {\n const stats = volantis.GLOBAL_CONFIG.languages.search.hits_stats\n .replace(/\\$\\{hits}/, data.nbHits)\n .replace(/\\$\\{time}/, data.processingTimeMS)\n return (\n `${stats}`\n )\n }\n }\n })\n\n const powerBy = instantsearch.widgets.poweredBy({\n container: '#algolia-info > .algolia-poweredBy',\n theme: volantis.dark?.mode === 'dark' ? 'dark' : 'light'\n })\n\n const pagination = instantsearch.widgets.pagination({\n container: '#algolia-pagination',\n totalPages: 5,\n templates: {\n first: '<i class=\"fas fa-angle-double-left\"></i>',\n last: '<i class=\"fas fa-angle-double-right\"></i>',\n previous: '<i class=\"fas fa-angle-left\"></i>',\n next: '<i class=\"fas fa-angle-right\"></i>'\n }\n })\n\n search.addWidgets([configure, searchBox, hits, stats, powerBy, pagination])\n\n search.start()\n\n window.pjax && search.on('render', () => {\n window.pjax.refresh(document.getElementById('algolia-hits'))\n })\n }\n\n fn.setQueryText = queryText => {\n fn.queryText = queryText;\n if (!search) {\n fn.init()\n }\n search?.setUiState({\n [algolia.indexName]: {\n query: queryText\n }\n })\n }\n\n fn.search = () => {\n document.querySelector(\"#u-search\").style.display = \"block\";\n document.addEventListener(\"keydown\", event => {\n if (event.code === \"Escape\") {\n fn.close();\n }\n }, { once: true })\n }\n\n fn.onSubmit = (event) => {\n event.preventDefault();\n let input = event.target.querySelector(\".u-search-input\");\n fn.setQueryText(input?.value ? input.value : event.target.value)\n fn.search();\n };\n\n fn.cutContent = content => {\n if (content === '') return ''\n\n const firstOccur = content.indexOf('<mark>')\n\n let start = firstOccur - 30\n let end = firstOccur + 120\n let pre = ''\n let post = ''\n\n if (start <= 0) {\n start = 0\n end = 140\n } else {\n pre = '...'\n }\n\n if (end > content.length) {\n end = content.length\n } else {\n post = '...'\n }\n\n let matchContent = pre + content.substring(start, end) + post\n return matchContent\n }\n\n fn.close = () => {\n document.querySelector(\"#u-search\").style.display = \"none\";\n };\n\n return {\n init: fn.init,\n setQueryText: queryText => {\n fn.setQueryText(queryText);\n },\n search: fn.search,\n close: fn.close\n }\n})()\n\nObject.freeze(SearchService);\n\nSearchService.init();\ndocument.addEventListener(\"pjax:send\", SearchService.close);\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"../../../js/search/hexo.js","names":["SearchService","fn","div","document","createElement","innerHTML","template","body","append","querySelectorAll","forEach","e","addEventListener","onSubmit","querySelector","close","event","preventDefault","input","target","queryText","value","search","async","style","display","data","fetchData","results","buildResultList","pages","posts","volantis","GLOBAL_CONFIG","languages","hits_empty","replace","window","pjax","refresh","f","code","removeEventListener","fetch","dataPath","then","response","text","res","JSON","parse","html","post","title","trim","slice","contentSearch","buildResult","permalink","digest","post_title","toLowerCase","post_content","keywords","split","foundMatch","index_title","index_content","first_occur","word","index","indexOf","start","end","Math","max","min","length","match_content","substring","keyword","regS","RegExp","url","getUrlRelativePath","arrUrl","relUrl","init","setQueryText","Object","freeze"],"sources":["js/search/hexo.js"],"mappings":"AAAA,IAAIA,cAAgB,MAClB,MAAMC,EAAK,C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,EAAgBA,EAAc1C,QAC5B6C,EACA,WAAaD,EAAU,OAE3B,IACA5B,EAAKO,OAASmB,EAAgB,QAChC,MACEL,EAAMC,KAAKE,IAAI,IAAKd,EAAae,QACjCzB,EAAKO,OAASG,EAAaR,OAAOyB,UAAU,EAAGN,EAEnD,KAGGR,CAAU,EAEnBhE,YAAiB,CAACkF,EAAK9B,EAAOM,KAC5B,IACIR,EAAO,GAQX,OAPAA,GAAQ,OACRA,GACE,2BAJWlD,EAAGmF,mBAAmBD,GAIK,YAAclF,EAAGmB,UAAY,KACrE+B,GAAQ,uBAAyBE,EAAQ,UAC1B,KAAXM,IAAeR,GAAQ,wBAA0BQ,EAAS,WAC9DR,GAAQ,OACRA,GAAQ,QACDA,CAAI,EAEblD,mBAAwB,SAAUkF,GAChC,IAAIE,EAASF,EAAInB,MAAM,MACnBQ,EAAQa,EAAO,GAAGd,QAAQ,KAC1Be,EAASD,EAAO,GAAGN,UAAUP,GAIjC,OAH4B,GAAxBc,EAAOf,QAAQ,OACjBe,EAASA,EAAOtB,MAAM,KAAK,IAEtBsB,CACT,GACA,MAAO,CACLC,KAAM,KACJtF,EAAGsF,MAAM,EAEXC,aAAepE,IACbnB,EAAGmB,UAAYA,CAAS,EAE1BE,OAAQ,KACNrB,EAAGqB,QAAQ,EAGhB,EA3LmB,GA4LpBmE,OAAOC,OAAO1F,eAEdA,cAAcuF,OACdpF,SAASS,iBAAiB,eAAgBZ,cAAcuF,MACxDpF,SAASS,iBAAiB,aAAa,WACrCT,SAASW,cAAc,aAAaU,MAAMC,QAAU,MACtD","ignoreList":[],"sourcesContent":["let SearchService = (() => {\n const fn = {};\n fn.queryText = null;\n fn.data = null;\n fn.template = `<div id=\"u-search\">\n <div class=\"modal\">\n <header class=\"modal-header\" class=\"clearfix\">\n <form id=\"u-search-modal-form\" class=\"u-search-form\" name=\"uSearchModalForm\">\n <input type=\"text\" id=\"u-search-modal-input\" class=\"u-search-input\" />\n <button type=\"submit\" id=\"u-search-modal-btn-submit\" class=\"u-search-btn-submit\">\n <span class=\"fa-solid fa-search\"></span>\n </button>\n </form>\n <a id=\"u-search-btn-close\" class=\"btn-close\"> <span class=\"fa-solid fa-times\"></span> </a>\n </header>\n <main class=\"modal-body\">\n <ul class=\"modal-results\"></ul>\n </main>\n </div>\n <div id=\"modal-overlay\" class=\"modal-overlay\"></div>\n</div>\n`;\n fn.init = () => {\n let div = document.createElement(\"div\");\n div.innerHTML += fn.template;\n document.body.append(div);\n document.querySelectorAll(\".u-search-form\").forEach((e) => {\n e.addEventListener(\"submit\", fn.onSubmit, false);\n });\n let uSearchModalInput = document.querySelector(\"#u-search-modal-input\");\n uSearchModalInput.addEventListener(\"input\", fn.onSubmit);\n document\n .querySelector(\"#u-search-btn-close\")\n .addEventListener(\"click\", fn.close, false);\n document\n .querySelector(\"#modal-overlay\")\n .addEventListener(\"click\", fn.close, false);\n };\n fn.onSubmit = (event) => {\n event.preventDefault();\n let input = event.target.querySelector(\".u-search-input\");\n if (input) {\n fn.queryText = input.value;\n } else {\n fn.queryText = event.target.value;\n }\n\n if (fn.queryText) {\n fn.search();\n }\n };\n fn.search = async () => {\n document.querySelectorAll(\".u-search-input\").forEach((e) => {\n e.value = fn.queryText;\n });\n document.querySelector(\"#u-search\").style.display = \"block\";\n if (!fn.data) {\n fn.data = await fn.fetchData();\n }\n let results = \"\";\n results += fn.buildResultList(fn.data.pages);\n results += fn.buildResultList(fn.data.posts);\n if (results === \"\") {\n results = `<div id=\"resule-hits-empty\"><i class=\"fa-solid fa-box-open\"></i><p>${volantis.GLOBAL_CONFIG.languages.search.hits_empty.replace(/\\$\\{query}/, fn.queryText)}</p></div>`\n }\n document.querySelector(\"#u-search .modal-results\").innerHTML = results;\n window.pjax && pjax.refresh(document.querySelector(\"#u-search\"));\n document.addEventListener(\"keydown\", function f(event) {\n if (event.code === \"Escape\") {\n fn.close();\n document.removeEventListener(\"keydown\", f);\n }\n });\n };\n fn.close = () => {\n document.querySelector(\"#u-search\").style.display = \"none\";\n };\n fn.fetchData = () => {\n return fetch(volantis.GLOBAL_CONFIG.search.dataPath)\n .then((response) => response.text())\n .then((res) => {\n const data = JSON.parse(res);\n // console.log(data);\n return data;\n });\n };\n fn.buildResultList = (data) => {\n let html = \"\";\n data.forEach((post) => {\n if (post.text) {\n post.text = post.text.replace(/12345\\d*/g, \"\") // 简易移除代码行号\n }\n if (!post.title && post.text) {\n post.title = post.text.trim().slice(0, 15)\n }\n if (fn.contentSearch(post)) {\n html += fn.buildResult(post.permalink, post.title, post.digest);\n }\n });\n return html;\n };\n fn.contentSearch = (post) => {\n let post_title = post.title.trim().toLowerCase();\n let post_content = post.text.trim().toLowerCase();\n let keywords = fn.queryText\n .trim()\n .toLowerCase()\n .split(/[-\\s]+/);\n let foundMatch = false;\n let index_title = -1;\n let index_content = -1;\n let first_occur = -1;\n if (post_title && post_content) {\n keywords.forEach((word, index) => {\n index_title = post_title.indexOf(word);\n index_content = post_content.indexOf(word);\n if (index_title < 0 && index_content < 0) {\n foundMatch = false;\n } else {\n foundMatch = true;\n if (index_content < 0) {\n index_content = 0;\n }\n if (index === 0) {\n first_occur = index_content;\n }\n }\n if (foundMatch) {\n post_content = post.text.trim();\n let start = 0;\n let end = 0;\n if (first_occur >= 0) {\n start = Math.max(first_occur - 40, 0);\n end =\n start === 0\n ? Math.min(200, post_content.length)\n : Math.min(first_occur + 120, post_content.length);\n let match_content = post_content.substring(start, end);\n keywords.forEach(function (keyword) {\n let regS = new RegExp(keyword, \"gi\");\n match_content = match_content.replace(\n regS,\n \"<b mark>\" + keyword + \"</b>\"\n );\n });\n post.digest = match_content + \"......\";\n } else {\n end = Math.min(200, post_content.length);\n post.digest = post_content.trim().substring(0, end);\n }\n }\n });\n }\n return foundMatch;\n };\n fn.buildResult = (url, title, digest) => {\n let result = fn.getUrlRelativePath(url);\n let html = \"\";\n html += \"<li>\";\n html +=\n \"<a class='result' href='\" + result + \"?keyword=\" + fn.queryText + \"'>\";\n html += \"<span class='title'>\" + title + \"</span>\";\n if (digest !== \"\") html += \"<span class='digest'>\" + digest + \"</span>\";\n html += \"</a>\";\n html += \"</li>\";\n return html;\n };\n fn.getUrlRelativePath = function (url) {\n let arrUrl = url.split(\"//\");\n let start = arrUrl[1].indexOf(\"/\");\n let relUrl = arrUrl[1].substring(start);\n if (relUrl.indexOf(\"?\") != -1) {\n relUrl = relUrl.split(\"?\")[0];\n }\n return relUrl;\n };\n return {\n init: () => {\n fn.init();\n },\n setQueryText: (queryText) => {\n fn.queryText = queryText;\n },\n search: () => {\n fn.search();\n },\n };\n})();\nObject.freeze(SearchService);\n\nSearchService.init();\ndocument.addEventListener(\"pjax:success\", SearchService.init);\ndocument.addEventListener(\"pjax:send\", function () {\n document.querySelector(\"#u-search\").style.display = \"none\";\n});\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"../../../js/search/meilisearch.js","names":["SearchService","fn","search","meilisearch","timerId","queryText","template","init","div","document","createElement","innerHTML","body","append","volantis","GLOBAL_CONFIG","appId","apiKey","indexName","event","setAlgolia","querySelector","style","textAlign","maxHeight","addEventListener","close","querySelectorAll","forEach","e","onSubmit","input","target","value","instantsearch","searchClient","instantMeiliSearch","searchFunction","helper","state","query","widgets","configure","hitsPerPage","searchBox","container","autofocus","showReset","showSubmit","showLoadingIndicator","searchAsYouType","placeholder","templates","queryHook","refine","clearTimeout","setTimeout","hits","item","data","keyword","link","permalink","root","path","result","_highlightResult","content","cutContent","text","title","empty","languages","hits_empty","replace","stats","hits_stats","nbHits","processingTimeMS","addWidgets","start","window","pjax","on","refresh","getElementById","setQueryText","setUiState","display","code","once","preventDefault","firstOccur","indexOf","end","pre","post","length","substring","matchContent","Object","freeze"],"sources":["js/search/meilisearch.js"],"mappings":"AAAA,IAAIA,cAAgB,MAClB,MAAMC,EAAK,CAAC,EACZ,IAAIC,EAAQC,EAAaC,EA4MzB,OA3MAH,EAAGI,UAAY,KACfJ,EAAGK,SAAW,0oLAgCdL,EAAGM,KAAO,KACR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,GAAOE,MAAQF,EAAME,MAAQd,EAAMa,OAAOC,OAC1DhC,EAAGC,QAAQ,EAGbD,EAAGmE,WAAaD,IACd,GAAgB,KAAZA,EAAgB,MAAO,GAE3B,MAAMyB,EAAazB,EAAQ0B,QAAQ,UAEnC,IAAIb,EAAQY,EAAa,GACrBE,EAAMF,EAAa,IACnBG,EAAM,GACNC,EAAO,GAgBX,OAdIhB,GAAS,GACXA,EAAQ,EACRc,EAAM,KAENC,EAAM,MAGJD,EAAM3B,EAAQ8B,OAChBH,EAAM3B,EAAQ8B,OAEdD,EAAO,MAGUD,EAAM5B,EAAQ+B,UAAUlB,EAAOc,GAAOE,CAClDG,EAGTlG,EAAGyB,MAAQ,KACTjB,SAASY,cAAc,aAAaC,MAAMkE,QAAU,MAAM,EAGrD,CACLjF,KAAMN,EAAGM,KACT+E,aAAcjF,IACZJ,EAAGqF,aAAajF,EAAU,EAE5BH,OAAQD,EAAGC,OACXwB,MAAOzB,EAAGyB,MAEb,EAtNmB,GAwNpB0E,OAAOC,OAAOrG,eAEdA,cAAcO,OACdE,SAASgB,iBAAiB,YAAazB,cAAc0B","ignoreList":[],"sourcesContent":["let SearchService = (() => {\n const fn = {};\n let search, meilisearch, timerId; \n fn.queryText = null;\n fn.template = `<div id=\"u-search\">\n <div class=\"modal\">\n <header class=\"modal-header\" class=\"clearfix\">\n <button type=\"submit\" id=\"u-search-modal-btn-submit\" class=\"u-search-btn-submit\">\n <span class=\"fa-solid fa-search\"></span>\n </button>\n <div id=\"meilisearch-search-input\"></div>\n <a id=\"u-search-btn-close\" class=\"btn-close\"> <span class=\"fa-solid fa-times\"></span> </a>\n </header>\n <main class=\"modal-body\">\n <div id=\"meilisearch-search-results\">\n <div id=\"meilisearch-hits\">\n <div class=\"search-icon\"><i class=\"fa-sharp fa-solid fa-telescope\"></i></i></div>\n </div>\n </div>\n </main>\n <footer>\n <hr>\n <div id=\"meilisearch-info\">\n <div class=\"meilisearch-stats\"></div>\n <div class=\"meilisearch-poweredBy\">\n <a href=\"https://www.meilisearch.com\" titile=\"meilisearch\" target=\"_blank\">\n <svg width=\"97\" height=\"20\" viewBox=\"0 0 537 83\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M49.8729 49.6398C49.8729 41.9727 53.5489 37.4565 60.5858 37.4565C67.2026 37.4565 69.4082 42.1827 69.4082 48.2744V80.9383H84.3222V46.5939C84.3222 33.7805 77.6004 24.643 64.3668 24.643C56.4897 24.643 50.9232 27.0586 46.0919 32.4151C42.941 27.5838 37.5846 24.643 30.1275 24.643C22.2504 24.643 16.7889 27.8989 14.2682 32.6251V25.9033H0.509521V80.9383H15.4236V49.3247C15.4236 41.9727 19.2046 37.4565 26.1365 37.4565C32.7532 37.4565 34.9588 42.1827 34.9588 48.2744V80.9383H49.8729V49.6398Z\" fill=\"black\"/><path d=\"M145.538 57.727C145.538 57.727 145.748 55.7314 145.748 53.3158C145.748 37.0363 134.72 24.643 118.441 24.643C102.161 24.643 90.8184 37.0363 90.8184 53.3158C90.8184 70.2253 102.266 82.1986 118.546 82.1986C131.254 82.1986 141.337 74.5315 144.593 63.3985H129.574C127.788 67.3896 123.482 69.3851 118.966 69.3851C111.509 69.3851 106.678 65.289 105.627 57.727H145.538ZM118.336 36.6162C125.268 36.6162 129.784 40.8174 130.834 47.014H105.837C107.098 40.7123 111.509 36.6162 118.336 36.6162Z\" fill=\"black\"/><path d=\"M147.947 38.7168H154.564V80.9383H169.478V25.9033H147.947V38.7168ZM162.021 18.7614C167.272 18.7614 171.054 15.0854 171.054 9.83396C171.054 4.58254 167.272 0.801514 162.021 0.801514C156.77 0.801514 152.989 4.58254 152.989 9.83396C152.989 15.0854 156.77 18.7614 162.021 18.7614Z\" fill=\"black\"/><path d=\"M200.361 68.1248C199.94 68.1248 199.31 68.2298 198.365 68.2298C195.004 68.2298 194.584 66.6544 194.584 64.3438V2.16688H179.67V65.394C179.67 76.317 183.871 81.1483 195.739 81.1483C197.735 81.1483 199.625 80.9382 200.361 80.8332V68.1248Z\" fill=\"black\"/><path d=\"M202.057 38.7168H208.674V80.9383H223.588V25.9033H202.057V38.7168ZM216.131 18.7614C221.383 18.7614 225.164 15.0854 225.164 9.83396C225.164 4.58254 221.383 0.801514 216.131 0.801514C210.88 0.801514 207.099 4.58254 207.099 9.83396C207.099 15.0854 210.88 18.7614 216.131 18.7614Z\" fill=\"black\"/><path d=\"M253.531 81.5175C268.025 81.5175 274.852 73.8504 274.852 65.7632C274.852 43.2871 241.768 55.7855 241.768 40.9765C241.768 36.1452 245.864 32.0491 254.161 32.0491C262.669 32.0491 266.66 36.6703 267.29 42.4469H274.747C274.117 35.1999 269.18 25.5373 254.371 25.5373C241.663 25.5373 234.521 33.0994 234.521 41.2916C234.521 63.2425 267.605 50.6391 267.605 65.9733C267.605 71.3297 262.564 75.0057 253.531 75.0057C244.289 75.0057 239.667 70.3845 239.142 63.5576H231.58C232.21 72.9051 238.092 81.5175 253.531 81.5175Z\" fill=\"black\"/><path d=\"M334.078 55.6805C334.078 55.6805 334.183 54 334.183 52.8447C334.183 37.7206 324.415 25.5373 308.451 25.5373C292.382 25.5373 282.194 38.6659 282.194 53.4749C282.194 68.4939 291.647 81.5175 308.556 81.5175C321.265 81.5175 330.087 73.7454 333.238 63.5576H325.466C323.155 70.0694 316.853 74.7956 308.661 74.7956C297.423 74.7956 290.386 66.4984 289.651 55.6805H334.078ZM308.451 32.2592C318.954 32.2592 325.781 39.2961 326.726 49.5888H289.861C291.121 39.7162 298.053 32.2592 308.451 32.2592Z\" fill=\"black\"/><path d=\"M380.477 54.8402V59.8816C380.477 69.0191 373.86 75.3208 361.152 75.3208C353.274 75.3208 348.968 72.0649 348.968 65.028C348.968 61.457 350.649 58.7263 353.274 57.2559C356.005 55.7855 359.681 54.8402 380.477 54.8402ZM360.311 81.5175C369.554 81.5175 377.011 78.5767 380.792 72.485V80.2571H387.934V45.2827C387.934 33.4145 381.107 25.5373 365.668 25.5373C350.859 25.5373 344.347 32.9944 342.982 42.5519H350.229C351.699 34.9899 357.476 31.9441 365.353 31.9441C375.435 31.9441 380.477 36.1452 380.477 45.1776V48.6436C363.567 48.6436 356.53 48.9587 351.279 51.0592C345.187 53.4749 341.616 58.8313 341.616 65.2381C341.616 74.5856 347.603 81.5175 360.311 81.5175Z\" fill=\"black\"/><path d=\"M428.703 26.3776C428.703 26.3776 427.443 26.2725 426.917 26.2725C417.045 26.2725 411.793 31.4189 409.798 35.0949V26.7977H402.656V80.2571H410.113V49.9039C410.113 38.7709 416.94 33.3094 426.077 33.3094C427.443 33.3094 428.703 33.4145 428.703 33.4145V26.3776Z\" fill=\"black\"/><path d=\"M429.976 53.5799C429.976 68.1789 440.059 81.5175 456.338 81.5175C470.832 81.5175 479.235 71.8548 481.335 61.247H473.773C471.568 69.5442 465.476 74.7956 456.338 74.7956C445.1 74.7956 437.538 65.8682 437.538 53.5799C437.538 41.1866 445.1 32.2592 456.338 32.2592C465.476 32.2592 471.568 37.5106 473.773 45.8078H481.335C479.235 35.1999 470.832 25.5373 456.338 25.5373C440.059 25.5373 429.976 38.8759 429.976 53.5799Z\" fill=\"black\"/><path d=\"M498.891 1.48584H491.434V80.2571H498.891V48.6436C498.891 37.7206 505.927 32.0491 514.96 32.0491C524.517 32.0491 529.034 37.9307 529.034 47.5933V80.2571H536.491V46.1229C536.491 34.2547 529.454 25.5373 516.22 25.5373C506.243 25.5373 500.781 30.9988 498.891 34.2547V1.48584Z\" fill=\"black\"/></svg>\n </a>\n </div>\n </div>\n </footer>\n </div>\n <div id=\"modal-overlay\" class=\"modal-overlay\"></div>\n </div>\n `;\n\n fn.init = () => {\n let div = document.createElement(\"div\");\n div.innerHTML += fn.template;\n document.body.append(div);\n\n meilisearch = volantis.GLOBAL_CONFIG.search;\n if (meilisearch.appId && meilisearch.apiKey && meilisearch.indexName) {\n fn.event();\n fn.setAlgolia();\n } else {\n document.querySelector('#u-search main.modal-body').innerHTML = 'Algolia setting is invalid!';\n document.querySelector('#u-search main.modal-body').style.textAlign = 'center';\n document.querySelector('#u-search .modal').style.maxHeight = '128px';\n }\n }\n\n fn.event = () => {\n document\n .querySelector(\"#u-search-btn-close\")\n .addEventListener(\"click\", fn.close, false);\n document\n .querySelector(\"#modal-overlay\")\n .addEventListener(\"click\", fn.close, false);\n document.querySelectorAll(\".u-search-form\").forEach((e) => {\n e.addEventListener(\"submit\", fn.onSubmit, false);\n });\n document.querySelector(\"#meilisearch-search-input\").addEventListener(\"input\", event => {\n let input = event.target.querySelector(\".ais-SearchBox-input\");\n if (input) {\n fn.queryText = input.value;\n } else {\n fn.queryText = event.target.value;\n }\n })\n }\n\n fn.setAlgolia = () => {\n search = instantsearch({\n indexName: meilisearch.indexName,\n searchClient: instantMeiliSearch(meilisearch.appId, meilisearch.apiKey),\n searchFunction(helper) {\n helper.state.query && helper.search()\n },\n })\n\n const configure = instantsearch.widgets.configure({\n hitsPerPage: meilisearch.hitsPerPage\n })\n\n const searchBox = instantsearch.widgets.searchBox({\n container: '#meilisearch-search-input',\n autofocus: true,\n showReset: false,\n showSubmit: false,\n showLoadingIndicator: false,\n searchAsYouType: meilisearch.searchAsYouType,\n placeholder: meilisearch.placeholder,\n templates: {\n input: 'meilisearch-input'\n },\n queryHook(query, refine) {\n clearTimeout(timerId)\n timerId = setTimeout(() => refine(query), 500)\n }\n })\n\n const hits = instantsearch.widgets.hits({\n container: '#meilisearch-hits',\n templates: {\n item(data) {\n const keyword = !!fn.queryText ? `?keyword=${fn.queryText}` : ''\n const link = data.permalink ? data.permalink : `${volantis.GLOBAL_CONFIG.root}${data.path}`\n const result = data._highlightResult\n const content = fn.cutContent(result.text.value)\n return `\n <a href=\"${link}${keyword}\" class=\"result\">\n <span class=\"title\">${result.title.value || 'no-title'}</span>\n <span class=\"digest\">${content}</span>\n </a>`\n },\n empty: function (data) {\n return (\n `<div id=\"resule-hits-empty\"><i class=\"fa-solid fa-box-open\"></i><p>${volantis.GLOBAL_CONFIG.languages.search.hits_empty.replace(/\\$\\{query}/, data.query)}</p></div>`\n )\n }\n }\n })\n\n const stats = instantsearch.widgets.stats({\n container: '#meilisearch-info > .meilisearch-stats',\n templates: {\n text: function (data) {\n const stats = volantis.GLOBAL_CONFIG.languages.search.hits_stats\n .replace(/\\$\\{hits}/, data.nbHits)\n .replace(/\\$\\{time}/, data.processingTimeMS)\n return (\n `${stats}`\n )\n }\n }\n })\n\n search.addWidgets([searchBox, hits, stats])\n\n search.start()\n\n window.pjax && search.on('render', () => {\n window.pjax.refresh(document.getElementById('meilisearch-hits'))\n })\n }\n\n fn.setQueryText = queryText => {\n fn.queryText = queryText;\n if (!search) {\n fn.init()\n }\n search?.setUiState({\n [meilisearch.indexName]: {\n query: queryText\n }\n })\n }\n\n fn.search = () => {\n document.querySelector(\"#u-search\").style.display = \"block\";\n document.addEventListener(\"keydown\", event => {\n if (event.code === \"Escape\") {\n fn.close();\n }\n }, { once: true })\n }\n\n fn.onSubmit = (event) => {\n event.preventDefault();\n let input = event.target.querySelector(\".u-search-input\");\n fn.setQueryText(input?.value ? input.value : event.target.value)\n fn.search();\n };\n\n fn.cutContent = content => {\n if (content === '') return ''\n\n const firstOccur = content.indexOf('<mark>')\n\n let start = firstOccur - 30\n let end = firstOccur + 120\n let pre = ''\n let post = ''\n\n if (start <= 0) {\n start = 0\n end = 140\n } else {\n pre = '...'\n }\n\n if (end > content.length) {\n end = content.length\n } else {\n post = '...'\n }\n\n let matchContent = pre + content.substring(start, end) + post\n return matchContent\n }\n\n fn.close = () => {\n document.querySelector(\"#u-search\").style.display = \"none\";\n };\n\n return {\n init: fn.init,\n setQueryText: queryText => {\n fn.setQueryText(queryText);\n },\n search: fn.search,\n close: fn.close\n }\n})()\n\nObject.freeze(SearchService);\n\nSearchService.init();\ndocument.addEventListener(\"pjax:send\", SearchService.close);\n"]}
|
package/maps/js/txmap.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"../../js/txmap.js","names":["getDistance","e1","n1","e2","n2","sin","cos","asin","PI","hypot","Math","getPoint","e","n","x","y","z","a","b","r","round","showWelcome","ip","posdesc","timeChange","dist","ipLocation","result","location","lng","lat","pos","ad_info","nation","province","city","district","date","Date","getHours","includes","document","getElementById","innerHTML","err","console","log","$","ajax","type","url","data","key","output","dataType","success","res","window","onload","addEventListener"],"sources":["js/txmap.js"],"mappings":"AAaA,SAASA,YAAYC,EAAIC,EAAIC,EAAIC,GAC7B,MACMC,IAAEA,EAAGC,IAAEA,EAAGC,KAAEA,EAAIC,GAAEA,EAAEC,MAAEA,GAAUC,KACtC,IAAIC,EAAW,CAACC,EAAGC,KACfD,GAAKJ,EAAK,IAEH,CAAEM,EAAGR,EADZO,GAAKL,EAAK,KACWF,EAAIM,GAAIG,EAAGT,EAAIO,GAAKR,EAAIO,GAAII,EAAGX,EAAIQ,KAGxDI,EAAIN,EAASV,EAAIC,GACjBgB,EAAIP,EAASR,EAAIC,GAEjBe,EAAkB,EAAdZ,EADAE,EAAMQ,EAAEH,EAAII,EAAEJ,EAAGG,EAAEF,EAAIG,EAAEH,EAAGE,EAAED,EAAIE,EAAEF,GAC3B,GAXP,KAYV,OAAON,KAAKU,MAAMD,EACtB,CAEA,SAASE,cAEL,IAEIC,EACAC,EA8LAC,EAjMAC,EAAOzB,YAAY,UAAW,UAAW0B,WAAWC,OAAOC,SAASC,IAAKH,WAAWC,OAAOC,SAASE,KACpGC,EAAML,WAAWC,OAAOK,QAAQC,OAIpC,OAAQP,WAAWC,OAAOK,QAAQC,QAC9B,IAAK,KACDV,EAAU,eACV,MACJ,IAAK,KACDA,EAAU,wBACV,MACJ,IAAK,KACDA,EAAU,aACV,MACJ,IAAK,MACDA,EAAU,WACV,MACJ,IAAK,KACDA,EAAU,eACV,MACJ,IAAK,KACDA,EAAU,6BACV,MACJ,IAAK,OACDA,EAAU,WACV,MACJ,IAAK,MACDA,EAAU,YACV,MACJ,IAAK,KAGD,OAFAQ,EAAML,WAAWC,OAAOK,QAAQE,SAAW,IAAMR,WAAWC,OAAOK,QAAQG,KAAO,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,EAAU,cACV,MACJ,IAAK,MACDA,EAAU,kBACV,MACJ,IAAK,QACDA,EAAU,eACV,MACJ,IAAK,MACDA,EAAU,UACV,MACJ,IAAK,MACDA,EAAU,kBACV,MACJ,IAAK,MACDA,EAAU,cACV,MACJ,IAAK,UACDA,EAAU,cACV,MACJ,IAAK,WACDA,EAAU,kBACV,MACJ,IAAK,MACDA,EAAU,aACV,MACJ,IAAK,UACDA,EAAU,mBACV,MACJ,IAAK,UACDA,EAAU,YACV,MACJ,QACIA,EAAU,cAGlB,MACJ,QACIA,EAAU,aAMlB,IAAIc,EAAO,IAAIC,KACmCd,EAA9Ca,EAAKE,YAAc,GAAKF,EAAKE,WAAa,GAAiB,+BACtDF,EAAKE,YAAc,IAAMF,EAAKE,WAAa,GAAiB,6BAC5DF,EAAKE,YAAc,IAAMF,EAAKE,WAAa,GAAiB,4BAC5DF,EAAKE,YAAc,IAAMF,EAAKE,WAAa,GAAiB,kCAC5DF,EAAKE,YAAc,IAAMF,EAAKE,WAAa,GAAiB,8BACnD,eAGdjB,EAAGkB,SAAS,OACZlB,EAAK,uBAET,IAEImB,SAASC,eAAe,gBAAgBC,UACpC,0FAA0FZ,yBAA2BR,mEAAyEE,wCAA2CH,mBAAoBE,QACrQ,CAAE,MAAOoB,GACJC,QAAQC,IAAI,aACjB,CACJ,CAnPAC,EAAEC,KAAK,CACHC,KAAM,MACNC,IAAK,4CACLC,KAAM,CACFC,IAAK,sCACLC,OAAQ,SAEZC,SAAU,QACVC,QAAS,SAAUC,GACf9B,WAAa8B,CACjB,IA0OJC,OAAOC,OAASrC,YAEhBoB,SAASkB,iBAAiB,gBAAiBtC","ignoreList":[],"sourcesContent":["//get请求\n$.ajax({\n type: 'get',\n url: 'https://apis.map.qq.com/ws/location/v1/ip',\n data: {\n key: 'RIPBZ-MLQ64-A6WUR-KL2YV-O4KY5-DZFTC',\n output: 'jsonp',\n },\n dataType: 'jsonp',\n success: function (res) {\n ipLocation = res;\n }\n})\nfunction getDistance(e1, n1, e2, n2) {\n const R = 6371\n const { sin, cos, asin, PI, hypot } = Math\n let getPoint = (e, n) => {\n e *= PI / 180\n n *= PI / 180\n return { x: cos(n) * cos(e), y: cos(n) * sin(e), z: sin(n) }\n }\n\n let a = getPoint(e1, n1)\n let b = getPoint(e2, n2)\n let c = hypot(a.x - b.x, a.y - b.y, a.z - b.z)\n let r = asin(c / 2) * 2 * R\n return Math.round(r);\n}\n\nfunction showWelcome() {\n\n let dist = getDistance(114.21416, 22.576264, ipLocation.result.location.lng, ipLocation.result.location.lat); //这里记得换成自己的经纬度\n let pos = ipLocation.result.ad_info.nation;\n let ip;\n let posdesc;\n //根据国家、省份、城市信息自定义欢迎语\n switch (ipLocation.result.ad_info.nation) {\n case \"日本\":\n posdesc = \"よろしく,一起去看樱花吗\";\n break;\n case \"美国\":\n posdesc = \"Let us live in peace!\";\n break;\n case \"英国\":\n posdesc = \"想同你一起夜乘伦敦眼\";\n break;\n case \"俄罗斯\":\n posdesc = \"干了这瓶伏特加!\";\n break;\n case \"法国\":\n posdesc = \"C'est La Vie\";\n break;\n case \"德国\":\n posdesc = \"Die Zeit verging im Fluge.\";\n break;\n case \"澳大利亚\":\n posdesc = \"一起去大堡礁吧!\";\n break;\n case \"加拿大\":\n posdesc = \"拾起一片枫叶赠予你\";\n break;\n case \"中国\":\n pos = ipLocation.result.ad_info.province + \" \" + ipLocation.result.ad_info.city + \" \" + ipLocation.result.ad_info.district;\n ip = ipLocation.result.ip;\n switch (ipLocation.result.ad_info.province) {\n case \"北京市\":\n posdesc = \"北——京——欢迎你~~~\";\n break;\n case \"天津市\":\n posdesc = \"讲段相声吧\";\n break;\n case \"河北省\":\n posdesc = \"山势巍巍成壁垒,天下雄关铁马金戈由此向,无限江山\";\n break;\n case \"山西省\":\n posdesc = \"展开坐具长三尺,已占山河五百余\";\n break;\n case \"内蒙古自治区\":\n posdesc = \"天苍苍,野茫茫,风吹草低见牛羊\";\n break;\n case \"辽宁省\":\n posdesc = \"我想吃烤鸡架!\";\n break;\n case \"吉林省\":\n posdesc = \"状元阁就是东北烧烤之王\";\n break;\n case \"黑龙江省\":\n posdesc = \"很喜欢哈尔滨大剧院\";\n break;\n case \"上海市\":\n posdesc = \"众所周知,中国只有两个城市\";\n break;\n case \"江苏省\":\n switch (ipLocation.result.ad_info.city) {\n case \"南京市\":\n posdesc = \"这是我挺想去的城市啦\";\n break;\n case \"苏州市\":\n posdesc = \"上有天堂,下有苏杭\";\n break;\n default:\n posdesc = \"散装是必须要散装的\";\n break;\n }\n break;\n case \"浙江省\":\n posdesc = \"东风渐绿西湖柳,雁已还人未南归\";\n break;\n case \"河南省\":\n switch (ipLocation.result.ad_info.city) {\n case \"郑州市\":\n posdesc = \"豫州之域,天地之中\";\n break;\n case \"南阳市\":\n posdesc = \"臣本布衣,躬耕于南阳此南阳非彼南阳!\";\n break;\n case \"驻马店市\":\n posdesc = \"峰峰有奇石,石石挟仙气嵖岈山的花很美哦!\";\n break;\n case \"开封市\":\n posdesc = \"刚正不阿包青天\";\n break;\n case \"洛阳市\":\n posdesc = \"洛阳牡丹甲天下\";\n break;\n default:\n posdesc = \"可否带我品尝河南烩面啦?\";\n break;\n }\n break;\n case \"安徽省\":\n posdesc = \"蚌埠住了,芜湖起飞\";\n break;\n case \"福建省\":\n posdesc = \"井邑白云间,岩城远带山\";\n break;\n case \"江西省\":\n posdesc = \"落霞与孤鹜齐飞,秋水共长天一色\";\n break;\n case \"山东省\":\n posdesc = \"遥望齐州九点烟,一泓海水杯中泻\";\n break;\n case \"湖北省\":\n switch (ipLocation.result.ad_info.city) {\n case \"黄冈市\":\n posdesc = \"红安将军县!辈出将才!\";\n break;\n default:\n posdesc = \"来碗热干面~\";\n break;\n }\n break;\n case \"湖南省\":\n posdesc = \"74751,长沙斯塔克\";\n break;\n case \"广东省\":\n switch (ipLocation.result.ad_info.city) {\n case \"广州市\":\n posdesc = \"看小蛮腰,喝早茶了嘛~\";\n break;\n case \"深圳市\":\n posdesc = \"今天你逛商场了嘛~\";\n break;\n case \"阳江市\":\n posdesc = \"阳春合水!博主家乡~ 欢迎来玩~\";\n break;\n default:\n posdesc = \"来两斤福建人~\";\n break;\n }\n break;\n case \"广西壮族自治区\":\n posdesc = \"桂林山水甲天下\";\n break;\n case \"海南省\":\n posdesc = \"朝观日出逐白浪,夕看云起收霞光\";\n break;\n case \"四川省\":\n posdesc = \"康康川妹子\";\n break;\n case \"贵州省\":\n posdesc = \"茅台,学生,再塞200\";\n break;\n case \"云南省\":\n posdesc = \"玉龙飞舞云缠绕,万仞冰川直耸天\";\n break;\n case \"西藏自治区\":\n posdesc = \"躺在茫茫草原上,仰望蓝天\";\n break;\n case \"陕西省\":\n posdesc = \"来份臊子面加馍\";\n break;\n case \"甘肃省\":\n posdesc = \"羌笛何须怨杨柳,春风不度玉门关\";\n break;\n case \"青海省\":\n posdesc = \"牛肉干和老酸奶都好好吃\";\n break;\n case \"宁夏回族自治区\":\n posdesc = \"大漠孤烟直,长河落日圆\";\n break;\n case \"新疆维吾尔自治区\":\n posdesc = \"驼铃古道丝绸路,胡马犹闻唐汉风\";\n break;\n case \"台湾省\":\n posdesc = \"我在这头,大陆在那头\";\n break;\n case \"香港特别行政区\":\n posdesc = \"永定贼有残留地鬼嚎,迎击光非岁玉\";\n break;\n case \"澳门特别行政区\":\n posdesc = \"性感荷官,在线发牌\";\n break;\n default:\n posdesc = \"带我去你的城市逛逛吧!\";\n break;\n }\n break;\n default:\n posdesc = \"带我去你的国家逛逛吧\";\n break;\n }\n\n //根据本地时间切换欢迎语\n let timeChange;\n let date = new Date();\n if (date.getHours() >= 5 && date.getHours() < 11) timeChange = \"<span>🌤️ 早上好,一日之计在于晨</span>\";\n else if (date.getHours() >= 11 && date.getHours() < 13) timeChange = \"<span>☀️ 中午好,记得午休喔~</span>\";\n else if (date.getHours() >= 13 && date.getHours() < 17) timeChange = \"<span>🕞 下午好,饮茶先啦!</span>\";\n else if (date.getHours() >= 17 && date.getHours() < 19) timeChange = \"<span>🚶♂️ 即将下班,记得按时吃饭~</span>\";\n else if (date.getHours() >= 19 && date.getHours() < 24) timeChange = \"<span>🌙 晚上好,夜生活嗨起来!</span>\";\n else timeChange = \"夜深了,早点休息,少熬夜\";\n\n// 新增ipv6显示为指定内容\n if (ip.includes(\":\")) {\n ip = \"<br>好复杂,咱看不懂~(ipv6)\";\n }\n try {\n //自定义文本和需要放的位置\n document.getElementById(\"welcome-info\").innerHTML =\n `欢迎来自 <b><span style=\"color: var(--kouseki-ip-color);font-size: var(--kouseki-gl-size)\">${pos}</span></b> 的小友💖<br>${posdesc}🍂<br>当前位置距博主约 <b><span style=\"color: var(--kouseki-ip-color)\">${dist}</span></b> 公里!<br>您的IP地址为:<b><span>${ip}</span></b><br>${timeChange} <br>`;\n } catch (err) {\n console.log(\"Pjax无法获取元素\")\n }\n}\nwindow.onload = showWelcome;\n// 如果使用了pjax在加上下面这行代码\ndocument.addEventListener('pjax:complete', showWelcome);"]}
|
package/maps/sw.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"../sw.js","names":["prefix","cacheSuffixVersion","CACHE_NAME","PreCachlist","NPMMirror","NPMPackage","NPMPackageVersion","debug","handleFetch","async","event","url","request","test","NetworkOnly","CacheFirst","CacheAlways","cdn","gh","jsdelivr","fastly","gcore","testingcf","test1","storisinz","webcache","combine","npm","unpkg","eleme","cdnjs","baomitu","bytedance","sustech","cdn_match_list","type","key","push","_console","console","color","black","red","green","yellow","blue","magenta","cyan","white","add","arr","fi","length","first","other","concat","createlog","util","args","log","apply","creategroup","groupCollapsed","colorUtils","bold","str","colorHash","wait","error","warn","ready","info","createChalk","name","firstToUpperCase","strArr","createChalkBg","createChalkGroup","chalk","group","end","groupEnd","bg","Object","keys","forEach","toLowerCase","replace","L","toUpperCase","i","self","logger","generate_uuid","c","r","Math","random","toString","db","read","config","Promise","resolve","reject","caches","open","then","cache","match","Request","encodeURIComponent","res","text","catch","write","value","put","Response","compareVersion","a","b","v1","split","v2","len","max","num1","parseInt","num2","mirrors","getLocalVersion","mirror_time","setNewestVersion","f","fetch","FetchEngine","json","version","stack","setInterval","setTimeout","installFunction","index","response","addEventListener","skipWaiting","waitUntil","all","map","includes","delete","clients","claim","respondWith","URL","pathname","resp","CacheRuntime","matchCache","matchCDN","method","protocol","clone","req","nav","navigator","saveData","effectiveType","connection","mozConnection","webkitConnection","urls","pathType","pathTestRes","RegExp","location","origin","fullPath","item","exec","ext","pop","contentType","getContentType","arrayBuffer","buffer","headers","endsWith","list","indexOf","progress","status","createPromiseAny","any","promises","Array","isArray","errs","AggregateError","p","err","fetchAny","reqs","controller","AbortController","signal","abort","fetchParallel","abortEvent","Event","eventTarget","EventTarget","tagged","dispatchEvent","e"],"sources":["sw.js"],"mappings":"AACA,MAAMA,OAAS,0BACTC,mBAAqB,8BACrBC,WAAaF,OAAS,KAAOC,mBAC7BE,YAAc,CAClB,iBACA,aACA,sBAEF,IAAIC,WAAY,EAChB,MAAMC,WAAa,0BACnB,IAAIC,kBAAoB,SACpBC,OAAQ,EAEZ,MAAMC,YAAcC,MAAOC,IACzB,MAAMC,EAAMD,EAAME,QAAQD,IAC1B,MAAI,iBAAiBE,KAAKF,IAEf,uBAAuBE,KAAKF,IAE5B,cAAcE,KAAKF,IAEnB,6BAA6BE,KAAKF,GALpCG,YAAYJ,GAOV,UAAUG,KAAKF,GACjBI,WAAWL,GACT,yBAAyBG,KAAKF,IAE9B,kBAAkBE,KAAKF,IAEvB,6BAA6BE,KAAKF,IAElC,mBAAmBE,KAAKF,IAExB,4BAA4BE,KAAKF,IAEjC,gBAAgBE,KAAKF,IAErB,qBAAqBE,KAAKF,IAE1B,aAAaE,KAAKF,IAElB,gEAAgEE,KAAKF,IAErE,gBAAgBE,KAAKF,GAjBvBK,YAAYN,GAoBZK,WAAWL,EACpB,EAEIO,IAAM,CACVC,GAAI,CACFC,SAAU,8BACVC,OAAQ,iCACRC,MAAO,gCACPC,UAAW,oCACXC,MAAO,gCACPC,UAAW,oCACXC,S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,MACH,MAAO,iBACT,IAAK,MACH,MAAO,cACT,IAAK,MACH,MAAO,gCACT,IAAK,MAEL,IAAK,OAEL,IAAK,MAEL,IAAK,MAEL,IAAK,MACH,MAAO,aACT,IAAK,MACH,MAAO,YACT,IAAK,MACH,MAAO,YACT,IAAK,MACH,MAAO,kBACT,IAAK,OACH,MAAO,gCACT,IAAK,MACH,MAAO,gBACT,IAAK,MACH,MAAO,oBACT,IAAK,MACH,MAAO,iBACT,IAAK,OACH,MAAO,aACT,IAAK,MAEL,IAAK,OAEL,IAAK,OACH,MAAO,eACT,IAAK,KAEL,IAAK,MACH,MAAO,cACT,IAAK,MAEL,IAAK,OAEL,IAAK,MACH,MAAO,aAGX","ignoreList":[],"sourcesContent":["// 全站打包上传 npm,sw 并发请求 cdn\nconst prefix = 'sinzmise-cetastories-en';\nconst cacheSuffixVersion = '00000018-0.2868400152695496';\nconst CACHE_NAME = prefix + '-v' + cacheSuffixVersion;\nconst PreCachlist = [\n \"/css/style.css\",\n \"/js/app.js\",\n \"/js/search/hexo.js\",\n];\nlet NPMMirror = false;\nconst NPMPackage = \"sinzmise-cetastories-en\";\nlet NPMPackageVersion = \"latest\";\nlet debug = true;\n// location.hostname == 'localhost' && (debug = true) && (NPMMirror = false);\nconst handleFetch = async (event) => {\n const url = event.request.url;\n if (/hm\\.baidu\\.com/.test(url)) {\n return NetworkOnly(event)\n } else if (/collect-perf\\.51\\.la/.test(url)) {\n return NetworkOnly(event)\n } else if (/sdk\\.51\\.la/.test(url)) {\n return NetworkOnly(event)\n } else if (/www\\.google-analytics\\.com/.test(url)) {\n return NetworkOnly(event)\n } else if (/@latest/.test(url)) {\n return CacheFirst(event)\n } else if (/cdnjs\\.cloudflare\\.com/.test(url)) {\n return CacheAlways(event)\n } else if (/music\\.126\\.net/.test(url)) {\n return CacheAlways(event)\n } else if (/files\\.blog\\.sinzmise\\.top/.test(url)) {\n return CacheAlways(event)\n } else if (/qqmusic\\.qq\\.com/.test(url)) {\n return CacheAlways(event)\n } else if (/jsd\\.cdn\\.storisinz\\.site/.test(url)) {\n return CacheAlways(event)\n } else if (/jsdelivr\\.net/.test(url)) {\n return CacheAlways(event)\n } else if (/npm\\.elemecdn\\.com/.test(url)) {\n return CacheAlways(event)\n } else if (/unpkg\\.com/.test(url)) {\n return CacheAlways(event)\n } else if (/.*\\.(?:png|jpg|jpeg|svg|gif|webp|ico|eot|ttf|woff|woff2|mp3)$/.test(url)) {\n return CacheAlways(event)\n } else if (/.*\\.(css|js)$/.test(url)) {\n return CacheAlways(event)\n } else {\n return CacheFirst(event)\n }\n}\nconst cdn = {\n gh: {\n jsdelivr: 'https://cdn.jsdelivr.net/gh',\n fastly: 'https://fastly.jsdelivr.net/gh',\n gcore: 'https://gcore.jsdelivr.net/gh',\n testingcf: 'https://testingcf.jsdelivr.net/gh',\n test1: 'https://test1.jsdelivr.net/gh',\n storisinz: 'https://jsd.cdn.storisinz.site/gh',\n webcache: 'https://code.webcache.cn/gh',\n },\n combine: {\n jsdelivr: 'https://cdn.jsdelivr.net/combine',\n fastly: 'https://fastly.jsdelivr.net/combine',\n gcore: 'https://gcore.jsdelivr.net/combine',\n testingcf: 'https://testingcf.jsdelivr.net/combine',\n test1: 'https://test1.jsdelivr.net/combine',\n storisinz: 'https://jsd.cdn.storisinz.site/combine',\n },\n npm: {\n jsdelivr: 'https://cdn.jsdelivr.net/npm',\n fastly: 'https://fastly.jsdelivr.net/npm',\n gcore: 'https://gcore.jsdelivr.net/npm',\n testingcf: 'https://testingcf.jsdelivr.net/npm',\n test1: 'https://test1.jsdelivr.net/npm',\n unpkg: 'https://unpkg.com',\n eleme: 'https://npm.elemecdn.com',\n storisinz: 'https://jsd.cdn.storisinz.site/npm',\n webcache: 'https://npm.webcache.cn',\n },\n cdnjs: {\n cdnjs: 'https://cdnjs.cloudflare.com/ajax/libs',\n baomitu: 'https://lib.baomitu.com',\n bytedance: 'https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M',\n sustech: 'https://mirrors.sustech.edu.cn/cdnjs/ajax/libs',\n webcache: 'https://cdnjs.webstatic.cn/ajax/libs',\n }\n}\nconst cdn_match_list = []\nfor (const type in cdn) {\n for (const key in cdn[type]) {\n cdn_match_list.push({ type: type, key: cdn[type][key] })\n }\n}\nconst _console = console;\nconst color = {\n black: '#000000',\n red: '#FF0000',\n green: '#008000',\n yellow: '#FFFF00',\n blue: '#0000FF',\n magenta: '#FF00FF',\n cyan: '#00FFFF',\n white: '#FFFFFF',\n};\nconst add = (...arr) => {\n let fi = [\n []\n ];\n for (let key = 0; key < arr.length; key++) {\n const [first, ...other] = arr[key];\n fi[0] += first;\n fi = fi.concat(other);\n }\n return fi;\n};\nconst createlog = (util) => (...args) => {\n // const fun = _console[util] ? _console[util] : _console.log;\n const fun = util == \"error\" ? _console[util] : _console.log;\n fun.apply(void 0, args);\n};\nconst creategroup = (util) => (...args) => {\n const fun = _console.groupCollapsed;\n fun.apply(void 0, args);\n};\nconst colorUtils = {\n bold: (str) => {\n if (typeof str === 'string' || typeof str === 'number') {\n return `${str};font-weight: bold;`;\n }\n for (let key = 1; key < str.length; key++) {\n str[key] += `;font-weight: bold;`;\n }\n return str;\n }\n};\nconst colorHash = {\n log: 'black',\n wait: 'cyan',\n error: 'red',\n warn: 'yellow',\n ready: 'green',\n info: 'blue',\n event: 'magenta',\n};\nconst createChalk = (name) => (...str) => {\n if (typeof str[0] === 'object') {\n createlog(name)(...add(colorUtils.bold(colorUtils[colorHash[name]](`[${firstToUpperCase(name)}] `)), ...str));\n return;\n }\n let strArr = str;\n if (typeof str === 'string' || typeof str === 'number') {\n strArr = colorUtils[colorHash[name]](str);\n }\n createlog(name)(...add(colorUtils.bold(colorUtils[colorHash[name]](`[${firstToUpperCase(name)}] `)), strArr));\n};\nconst createChalkBg = (name) => (...str) => {\n if (typeof str[0] === 'object') {\n createlog(name)(...add(colorUtils.bold(colorUtils[`bg${firstToUpperCase(colorHash[name])}`](`[${firstToUpperCase(name)}] `)), ...str));\n return;\n }\n let strArr = str;\n if (typeof str === 'string' || typeof str === 'number') {\n strArr = colorUtils[colorHash[name]](str);\n }\n createlog(name)(...add(colorUtils.bold(colorUtils[`bg${firstToUpperCase(colorHash[name])}`](`[${firstToUpperCase(name)}] `)), strArr));\n};\nconst createChalkGroup = (name) => (...str) => {\n if (typeof str[0] === 'object') {\n creategroup(name)(...add(colorUtils.bold(colorUtils[colorHash[name]](`[${firstToUpperCase(name)}] `)), ...str));\n return;\n }\n let strArr = str;\n if (typeof str === 'string' || typeof str === 'number') {\n strArr = colorUtils[colorHash[name]](str);\n }\n creategroup(name)(...add(colorUtils.bold(colorUtils[colorHash[name]](`[${firstToUpperCase(name)}] `)), strArr));\n};\nconst chalk = {\n group: {\n end: _console.groupEnd\n },\n bg: {}\n};\nObject.keys(colorHash).forEach(key => {\n chalk[key] = createChalk(key);\n chalk.group[key] = createChalkGroup(key);\n chalk.bg[key] = createChalkBg(key);\n});\nconst firstToUpperCase = (str) => str.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase());\nObject.keys(color).forEach(key => {\n colorUtils[key] = (str) => {\n if (typeof str === 'string' || typeof str === 'number') {\n return [`%c${str}`, `color:${color[key]}`];\n }\n for (let i = 1; i < str.length; i++) {\n str[i] += `;color:${color[key]}`;\n }\n return str;\n };\n colorUtils[`bg${firstToUpperCase(key)}`] = (str) => {\n if (typeof str === 'string' || typeof str === 'number') {\n return [`%c${str}`, `padding: 2px 4px; border-radius: 3px; color: ${key === 'white' ? '#000' : '#fff'}; font-weight: bold; background:${color[key]};`];\n }\n for (let i = 1; i < str.length; i++) {\n str[i] += `;padding: 2px 4px; border-radius: 3px; font-weight: bold; background:${color[key]};`;\n }\n return str;\n };\n});\nself.logger = {\n add,\n ...chalk,\n ...colorUtils,\n};\n\nif (!debug) {\n logger = {\n log: () => { },\n wait: () => { },\n error: () => { },\n warn: () => { },\n ready: () => { },\n info: () => { },\n event: () => { },\n group: {\n log: () => { },\n wait: () => { },\n error: () => { },\n warn: () => { },\n ready: () => { },\n info: () => { },\n event: () => { },\n end: () => { },\n },\n bg: {\n log: () => { },\n wait: () => { },\n error: () => { },\n warn: () => { },\n ready: () => { },\n info: () => { },\n event: () => { },\n }\n };\n console.log = () => { };\n}\n\nconst generate_uuid = () => {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}\nself.db = {\n read: (key, config) => {\n if (!config) { config = { type: \"text\" } }\n return new Promise((resolve, reject) => {\n caches.open(CACHE_NAME).then(cache => {\n cache.match(new Request(`https://LOCALCACHE/${encodeURIComponent(key)}`)).then(function (res) {\n if (!res) resolve(null)\n res.text().then(text => resolve(text))\n }).catch(() => {\n resolve(null)\n })\n })\n })\n },\n write: (key, value) => {\n return new Promise((resolve, reject) => {\n caches.open(CACHE_NAME).then(function (cache) {\n cache.put(new Request(`https://LOCALCACHE/${encodeURIComponent(key)}`), new Response(value));\n resolve()\n }).catch(() => {\n reject()\n })\n })\n }\n}\nconst compareVersion = (a, b) => {\n let v1 = a.split('.');\n let v2 = b.split('.');\n const len = Math.max(v1.length, v2.length);\n while (v1.length < len) {\n v1.push('0');\n }\n while (v2.length < len) {\n v2.push('0');\n }\n for (let i = 0; i < len; i++) {\n const num1 = parseInt(v1[i]);\n const num2 = parseInt(v2[i]);\n if (num1 > num2) {\n return a;\n } else if (num1 < num2) {\n return b;\n }\n }\n return a;\n}\n\nconst mirrors = [\n `https://registry.npmjs.org/${NPMPackage}/latest`,\n `https://mirrors.cloud.tencent.com/npm/${NPMPackage}/latest`\n]\nconst getLocalVersion = async () => {\n NPMPackageVersion = await db.read('blog_version') || NPMPackageVersion\n logger.bg.info(`Local Version: ${NPMPackage}@${NPMPackageVersion}`)\n}\nlet mirror_time = 0;\nconst setNewestVersion = async () => {\n if (!NPMMirror) {\n return\n }\n let f = null;\n if (!(mirror_time % (mirrors.length + 1))) {\n f = FetchEngine(mirrors);\n } else {\n f = fetch(mirrors[(mirror_time % (mirrors.length + 1)) - 1]);\n }\n mirror_time++;\n return f\n .then(res => res.json())\n .then(async res => {\n if (!res.version) throw ('No Version Found!')\n NPMPackageVersion = compareVersion(res.version, await db.read('blog_version') || NPMPackageVersion)\n logger.bg.ready(`${NPMPackage}@${NPMPackageVersion}`)\n await db.write('blog_version', NPMPackageVersion)\n })\n .catch(error => {\n logger.error('[Set Newest Version] ' + (error.stack || error))\n })\n}\nsetInterval(async () => {\n await setNewestVersion()\n}, 60 * 1000);\nsetTimeout(async () => {\n await setNewestVersion()\n}, 5000)\nconst installFunction = async () => {\n await getLocalVersion();\n return caches.open(CACHE_NAME + \"-precache\")\n .then(async function (cache) {\n if (!await db.read('uuid')) {\n await db.write('uuid', generate_uuid())\n }\n if (PreCachlist.length) {\n logger.group.event(`Precaching ${PreCachlist.length} files.`);\n let index = 0;\n PreCachlist.forEach(function (url) {\n cache.match(new Request(url)).then(function (response) {\n if (response) {\n logger.ready(`Precaching ${url}`);\n } else {\n logger.wait(`Precaching ${url}`);\n cache.add(new Request(url));\n }\n index++;\n if (index === PreCachlist.length) {\n logger.ready(`Precached ${PreCachlist.length} files.`);\n logger.group.end();\n }\n })\n })\n }\n }).catch((error) => {\n logger.error('[install] ' + (error.stack || error));\n })\n}\nself.addEventListener('install', async function (event) {\n logger.bg.event(\"service worker install event listening\");\n try {\n self.skipWaiting();\n event.waitUntil(installFunction());\n logger.bg.ready('service worker install sucess!');\n } catch (error) {\n logger.error('[install] ' + (error.stack || error));\n }\n});\nself.addEventListener('activate', async event => {\n logger.bg.event(\"service worker activate event listening\");\n try {\n event.waitUntil(\n caches.keys().then((keys) => {\n return Promise.all(keys.map((key) => {\n if (!key.includes(cacheSuffixVersion)) {\n caches.delete(key);\n logger.bg.ready('Deleted Outdated Cache: ' + key);\n }\n }));\n }).catch((error) => {\n logger.error('[activate] ' + (error.stack || error));\n })\n );\n await self.clients.claim()\n logger.bg.ready('service worker activate sucess!');\n } catch (error) {\n logger.error('[activate] ' + (error.stack || error));\n }\n})\nself.addEventListener('fetch', async event => {\n event.respondWith(\n handleFetch(event).catch((error) => {\n logger.error('[fetch] ' + event.request.url + '\\n[error] ' + (error.stack || error));\n })\n )\n});\n\n\nconst NetworkOnly = async (event) => {\n logger.group.info('NetworkOnly: ' + new URL(event.request.url).pathname);\n logger.wait('service worker fetch: ' + event.request.url)\n logger.group.end();\n return fetch(event.request)\n}\nconst CacheFirst = async (event) => {\n return caches.match(event.request).then(function (resp) {\n logger.group.info('CacheFirst: ' + new URL(event.request.url).pathname);\n logger.wait('service worker fetch: ' + event.request.url)\n if (resp) {\n logger.group.ready(`Cache Hit`);\n console.log(resp)\n logger.group.end();\n logger.group.end();\n event.waitUntil(CacheRuntime(event.request))\n return resp;\n } else {\n logger.warn(`Cache Miss`);\n logger.group.end();\n return CacheRuntime(event.request)\n }\n })\n}\nconst CacheAlways = async (event) => {\n return caches.match(event.request).then(function (resp) {\n logger.group.info('CacheAlways: ' + new URL(event.request.url).pathname);\n logger.wait('service worker fetch: ' + event.request.url)\n if (resp) {\n logger.group.ready(`Cache Hit`);\n console.log(resp)\n logger.group.end();\n logger.group.end();\n return resp;\n } else {\n logger.warn(`Cache Miss`);\n logger.group.end();\n return CacheRuntime(event.request)\n }\n })\n}\n\nconst matchCache = async (event) => {\n return caches.match(event.request).then(function (resp) {\n logger.group.info('service worker fetch: ' + event.request.url)\n if (resp) {\n logger.group.ready(`Cache Hit`);\n console.log(resp)\n logger.group.end();\n logger.group.end();\n return resp;\n } else {\n logger.warn(`Cache Miss`);\n logger.group.end();\n return CacheRuntime(event.request)\n }\n })\n}\nasync function CacheRuntime(request) {\n const url = new URL(request.url);\n let response = await matchCDN(request);\n if (!response) {\n response = await fetch(request).catch(() => null)\n }\n logger.group.event(`Cache Runtime ${url.pathname}`);\n logger.wait(`Caching url: ${request.url}`);\n console.log(response);\n\n if (request.method === \"GET\" && (url.protocol == \"https:\")) {\n const cache = await caches.open(CACHE_NAME + \"-runtime\");\n cache.put(request, response.clone()).catch(error => {\n logger.error('[Cache Runtime] ' + (error.stack || error));\n if (error.name === 'QuotaExceededError') {\n caches.delete(CACHE_NAME + \"-runtime\");\n logger.ready(\"deleted cache\")\n }\n })\n logger.ready(`Cached url: ${request.url}`);\n } else {\n logger.warn(`Not Cached url: ${request.url}`);\n }\n logger.group.end();\n return response;\n}\n\nconst matchCDN = async (req) => {\n const nav = navigator\n const { saveData, effectiveType } = nav.connection || nav.mozConnection || nav.webkitConnection || {}\n if (saveData || /2g/.test(effectiveType)) {\n logger.warn(\"Slow Network: Transparent Proxy\");\n return fetch(req);\n }\n const urls = []\n let urlObj = new URL(req.url)\n let pathType = urlObj.pathname.split('/')[1]\n let pathTestRes = \"\";\n\n if (NPMMirror && new RegExp(location.origin).test(req.url)) {\n logger.group.ready(`Match NPM Mirror: ` + req.url);\n for (const key in cdn.npm) {\n let url = cdn.npm[key] + \"/\" + NPMPackage + \"@\" + NPMPackageVersion + req.url.replace(location.origin, '')\n url = fullPath(fullPath(url))\n console.log(url);\n urls.push(url)\n }\n logger.group.end()\n }\n if (!urls.length) {\n for (const item of cdn_match_list) {\n if (new RegExp(item.key).test(req.url)) {\n pathType = item.type\n pathTestRes = new RegExp(item.key).exec(req.url)[0]\n break;\n }\n }\n for (const type in cdn) {\n if (type === pathType) {\n logger.group.ready(`Match CDN ${pathType}: ` + req.url);\n for (const key in cdn[type]) {\n const url = cdn[type][key] + req.url.replace(pathTestRes, '')\n console.log(url);\n urls.push(url)\n }\n logger.group.end()\n }\n }\n }\n\n let res;\n if (urls.length)\n res = FetchEngine(urls)\n else\n res = fetch(req)\n if (res && NPMMirror && new RegExp(location.origin).test(req.url)) {\n const ext = fullPath(fullPath(req.url)).split('.').pop()\n const contentType = getContentType(ext)\n res = res\n .then(res => res.arrayBuffer())\n .then(buffer => new Response(buffer, {\n headers: {\n \"Content-Type\": contentType\n }\n }))\n .catch(() => null)\n }\n return res\n}\n\nconst fullPath = (url) => {\n url = url.split('?')[0].split('#')[0]\n if (url.endsWith('/')) {\n url += 'index.html'\n } else {\n const list = url.split('/')\n const last = list[list.length - 1]\n if (last.indexOf('.') === -1) {\n url += '.html'\n }\n }\n return url\n}\nasync function progress(res) {\n return new Response(await res.arrayBuffer(), {\n status: res.status,\n headers: res.headers\n })\n}\n\nfunction createPromiseAny() {\n Promise.any = function (promises) {\n return new Promise((resolve, reject) => {\n promises = Array.isArray(promises) ? promises : []\n let len = promises.length\n let errs = []\n if (len === 0) return reject(new AggregateError('All promises were rejected'))\n promises.forEach((p) => {\n if (p instanceof Promise) {\n p.then(\n (res) => resolve(res),\n (err) => {\n len--\n errs.push(err)\n if (len === 0) reject(new AggregateError(errs))\n }\n )\n } else {\n reject(p)\n }\n })\n })\n }\n}\n\nfunction fetchAny(reqs) {\n const controller = new AbortController()\n\n return reqs.map(req => {\n return new Promise((resolve, reject) => {\n fetch(req, {\n signal: controller.signal\n })\n .then(progress)\n .then(res => {\n controller.abort()\n if (res.status !== 200)\n reject(null)\n else\n resolve(res)\n })\n .catch(() => reject(null))\n })\n })\n}\n\nfunction fetchParallel(reqs) {\n const abortEvent = new Event(\"abortOtherInstance\")\n const eventTarget = new EventTarget();\n\n return reqs.map(async req => {\n const controller = new AbortController();\n let tagged = false;\n eventTarget.addEventListener(abortEvent.type, () => {\n if (!tagged) controller.abort();\n })\n return new Promise((resolve, reject) => {\n fetch(req, {\n signal: controller.signal,\n }).then(res => {\n tagged = true;\n eventTarget.dispatchEvent(abortEvent)\n if (res.status !== 200)\n reject(null)\n else\n resolve(res)\n }).catch(() => reject(null))\n })\n });\n}\n\nconst FetchEngine = (reqs) => {\n if (!Promise.any) createPromiseAny();\n return Promise.any(fetchParallel(reqs)).then(res => res)\n .catch((e) => {\n if (e == \"AggregateError: All promises were rejected\") {\n return Promise.any(fetchAny(reqs))\n .then((res) => res)\n .catch(() => null);\n }\n return null;\n });\n};\n\nconst getContentType = (ext) => {\n switch (ext) {\n case 'js':\n return 'text/javascript'\n case 'html':\n return 'text/html'\n case 'css':\n return 'text/css'\n case 'json':\n return 'application/json'\n case 'webp':\n return 'image/webp'\n case 'jpg':\n return 'image/jpg'\n case 'jpeg':\n return 'image/jpeg'\n case 'png':\n return 'image/png'\n case 'gif':\n return 'image/gif'\n case 'xml':\n return 'text/xml'\n case 'xsl':\n return 'text/xml'\n case 'webmanifest':\n return 'text/webmanifest'\n case 'map':\n return 'application/json'\n case 'bcmap':\n return 'image/vnd.wap.wbmp'\n case 'wbmp':\n return 'image/vnd.wap.wbmp'\n case 'bmp':\n return 'image/bmp'\n case 'ico':\n return 'image/vnd.microsoft.icon'\n case 'tiff':\n return 'image/tiff'\n case 'tif':\n return 'image/tiff'\n case 'svg':\n return 'image/svg+xml'\n case 'svgz':\n return 'image/svg+xml'\n case 'woff':\n return 'application/font-woff'\n case 'woff2':\n return 'application/font-woff2'\n case 'ttf':\n return 'application/font-ttf'\n case 'otf':\n return 'application/font-otf'\n case 'eot':\n return 'application/vnd.ms-fontobject'\n case 'zip':\n return 'application/zip'\n case 'tar':\n return 'application/x-tar'\n case 'gz':\n return 'application/gzip'\n case 'bz2':\n return 'application/x-bzip2'\n case 'rar':\n return 'application/x-rar-compressed'\n case '7z':\n return 'application/x-7z-compressed'\n case 'doc':\n return 'application/msword'\n case 'docx':\n return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n case 'xls':\n return 'application/vnd.ms-excel'\n case 'xlsx':\n return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n case 'ppt':\n return 'application/vnd.ms-powerpoint'\n case 'pptx':\n return 'application/vnd.openxmlformats-officedocument.presentationml.presentation'\n case 'pdf':\n return 'application/pdf'\n case 'txt':\n return 'text/plain'\n case 'rtf':\n return 'application/rtf'\n case 'mp3':\n return 'audio/mpeg'\n case 'wav':\n return 'audio/x-wav'\n case 'ogg':\n return 'audio/ogg'\n case 'mp4':\n return 'video/mp4'\n case 'm4v':\n return 'video/x-m4v'\n case 'mov':\n return 'video/quicktime'\n case 'avi':\n return 'video/x-msvideo'\n case 'wmv':\n return 'video/x-ms-wmv'\n case 'flv':\n return 'video/x-flv'\n case 'swf':\n return 'application/x-shockwave-flash'\n case 'mpg':\n return 'video/mpeg'\n case 'mpeg':\n return 'video/mpeg'\n case 'mpe':\n return 'video/mpeg'\n case 'mpv':\n return 'video/mpeg'\n case 'm2v':\n return 'video/mpeg'\n case 'm4a':\n return 'audio/mp4'\n case 'aac':\n return 'audio/aac'\n case 'm3u':\n return 'audio/x-mpegurl'\n case 'm3u8':\n return 'application/vnd.apple.mpegurl'\n case 'pls':\n return 'audio/x-scpls'\n case 'cue':\n return 'application/x-cue'\n case 'wma':\n return 'audio/x-ms-wma'\n case 'flac':\n return 'audio/flac'\n case 'aif':\n return 'audio/x-aiff'\n case 'aiff':\n return 'audio/x-aiff'\n case 'aifc':\n return 'audio/x-aiff'\n case 'au':\n return 'audio/basic'\n case 'snd':\n return 'audio/basic'\n case 'mid':\n return 'audio/midi'\n case 'midi':\n return 'audio/midi'\n case 'kar':\n return 'audio/midi'\n default:\n return 'text/plain'\n }\n}"]}
|