Files
KatelyaTV/public/sw.js
T
katelya 4617b0199b feat: Enhance package manager detection script and improve type safety in components
- Updated `check-package-manager.js` to disable specific ESLint rules for better readability.
- Refactored `page.tsx` in the login module to remove unnecessary type assertions and improve state management.
- Modified `page.tsx` in the home module to enhance error handling, improve layout with grid system, and limit displayed items.
- Adjusted `PageLayout.tsx` to implement responsive layout changes for the play page.
- Improved `ThemeToggle.tsx` to ensure proper dependency tracking in useEffect.
- Enhanced `VideoCard.tsx` with better type definitions for favorites.
- Updated `db.client.ts` to rename legacy cache prefix for future migration.
- Added runtime configuration types in `types.ts` and extended global Window interface.
- Introduced a new Workbox service worker file for improved caching strategies.
2025-09-01 21:23:45 +08:00

2 lines
8.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
if(!self.define){let e,s={};const n=(n,t)=>(n=new URL(n+".js",t).href,s[n]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()}).then(()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didnt register its module`);return e}));self.define=(t,c)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(s[i])return;let a={};const r=e=>n(e,i),o={module:{uri:i},exports:a,require:r};s[i]=Promise.all(t.map(e=>o[e]||r(e))).then(e=>(c(...e),a))}}define(["./workbox-4754cb34"],function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/app-build-manifest.json",revision:"4cc81709a85016d2e1325aec145aa599"},{url:"/_next/static/chunks/100-efcc706557360c1e.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/117-712c1385f002eef0.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/262-b67318e67f316783.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/41ade5dc-797c284ea15e5986.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/519-9968375803c5bb08.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/827-35ccbd32f32feb33.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/872-010f54d5928bfbfd.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/886-b0b555a14550a8dc.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/97-d35e729ca3ec6714.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/a4634e51-a3fb94d869211083.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/_not-found/page-231758babf57b819.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/admin/page-094e47d9aa7845e0.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/douban/page-75ce0c7d2b4cff9c.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/layout-870a3b1d3b21202a.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/login/page-b79e53e406bf669d.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/page-61b1291c1aa52317.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/play/page-d478c791ff7bae46.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/search/page-2e6fb9284b7fe3b7.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/app/warning/page-6c04923bb35d02d2.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/fd9d1056-5fb180716357b830.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/framework-f66176bb897dc684.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/main-33b2d4bbe5672234.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/main-app-073eb01104a135dc.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/pages/_app-72b849fbd24ac258.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/pages/_error-7ba65e1336b92748.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/chunks/polyfills-42372ed130431b0a.js",revision:"846118c33b2c0e922d7b3a7676f81f6f"},{url:"/_next/static/chunks/webpack-05e23bcac07e9541.js",revision:"m91B5pHK189d_DOw2NJtJ"},{url:"/_next/static/css/01f6801b310b5690.css",revision:"01f6801b310b5690"},{url:"/_next/static/css/275ed64cc4367444.css",revision:"275ed64cc4367444"},{url:"/_next/static/css/2da794711423e5a1.css",revision:"2da794711423e5a1"},{url:"/_next/static/m91B5pHK189d_DOw2NJtJ/_buildManifest.js",revision:"c155cce658e53418dec34664328b51ac"},{url:"/_next/static/m91B5pHK189d_DOw2NJtJ/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/_next/static/media/26a46d62cd723877-s.woff2",revision:"befd9c0fdfa3d8a645d5f95717ed6420"},{url:"/_next/static/media/55c55f0601d81cf3-s.woff2",revision:"43828e14271c77b87e3ed582dbff9f74"},{url:"/_next/static/media/581909926a08bbc8-s.woff2",revision:"f0b86e7c24f455280b8df606b89af891"},{url:"/_next/static/media/8e9860b6e62d6359-s.woff2",revision:"01ba6c2a184b8cba08b0d57167664d75"},{url:"/_next/static/media/97e0cb1ae144a2a9-s.woff2",revision:"e360c61c5bd8d90639fd4503c829c2dc"},{url:"/_next/static/media/df0a9ae256c0569c-s.woff2",revision:"d54db44de5ccb18886ece2fda72bdfe0"},{url:"/_next/static/media/e4af272ccee01ff0-s.p.woff2",revision:"65850a373e258f1c897a2b3d75eb74de"},{url:"/favicon.ico",revision:"c5de6e56c5664adda146825f75ea6ecf"},{url:"/icons/icon-192x192.png",revision:"4a56c090828a1ad254c903c7aec0389d"},{url:"/icons/icon-256x256.png",revision:"f6409eb1a001f754121e3a8281c0319c"},{url:"/icons/icon-384x384.png",revision:"f6efc3e357b9ffdf4e0d8c14b2ed0ac1"},{url:"/icons/icon-512x512.png",revision:"9c008cbbeb6a576fe07bb1284a83f4d2"},{url:"/logo.png",revision:"40de611b143c47c6291c7bdad2c959ca"},{url:"/manifest.json",revision:"7bd3dabc1cfbfe40f09577efca223d31"},{url:"/robots.txt",revision:"e2b2cd8514443456bc6fb9d77b3b1f3e"},{url:"/screenshot1.png",revision:"10572bfcea54dc93ac4c5f7c9057fc98"},{url:"/screenshot2.png",revision:"f815a8990973a221899976867365c239"},{url:"/screenshot3.png",revision:"49709e96345dfeeab1d8083821d4b44e"},{url:"/screenshot4.png",revision:"a76c751e41e37556048a487e4f8b8b1c"}],{ignoreURLParametersMatching:[]}),e.cleanupOutdatedCaches(),e.registerRoute("/",new e.NetworkFirst({cacheName:"start-url",plugins:[{cacheWillUpdate:async({request:e,response:s,event:n,state:t})=>s&&"opaqueredirect"===s.type?new Response(s.body,{status:200,statusText:"OK",headers:s.headers}):s}]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:31536e3})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,new e.StaleWhileRevalidate({cacheName:"static-font-assets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,new e.StaleWhileRevalidate({cacheName:"static-image-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/image\?url=.+$/i,new e.StaleWhileRevalidate({cacheName:"next-image",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp3|wav|ogg)$/i,new e.CacheFirst({cacheName:"static-audio-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp4)$/i,new e.CacheFirst({cacheName:"static-video-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:js)$/i,new e.StaleWhileRevalidate({cacheName:"static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:css|less)$/i,new e.StaleWhileRevalidate({cacheName:"static-style-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/data\/.+\/.+\.json$/i,new e.StaleWhileRevalidate({cacheName:"next-data",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:json|xml|csv)$/i,new e.NetworkFirst({cacheName:"static-data-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(({url:e})=>{if(!(self.origin===e.origin))return!1;const s=e.pathname;return!s.startsWith("/api/auth/")&&!!s.startsWith("/api/")},new e.NetworkFirst({cacheName:"apis",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:16,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(({url:e})=>{if(!(self.origin===e.origin))return!1;return!e.pathname.startsWith("/api/")},new e.NetworkFirst({cacheName:"others",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(({url:e})=>!(self.origin===e.origin),new e.NetworkFirst({cacheName:"cross-origin",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:3600})]}),"GET")});