@serifpersia/dango 3.3.9 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/client/dist/assets/{AnimeCard-URCiiy5W.js → AnimeCard-CJy1SXH3.js} +1 -1
- package/client/dist/assets/{AnimeInfo-e3z3er9t.js → AnimeInfo-BoXlVvZ-.js} +1 -1
- package/client/dist/assets/{AnimeInfoPage-B7Djlmy_.js → AnimeInfoPage-BxbA_7AV.js} +2 -2
- package/client/dist/assets/Asmr--Zc8G9zv.js +2 -0
- package/client/dist/assets/AsmrResetProgressModal-CKYm-8cp.js +1 -0
- package/client/dist/assets/AvSyncCalibrator-3yjZS7s6.js +10 -0
- package/client/dist/assets/Home-rrhOGQcg.js +1 -0
- package/client/dist/assets/Insights-Bay90Yeg.js +1 -0
- package/client/dist/assets/{LibraryListPage-B0qWqhb_.js → LibraryListPage-HzuDavbb.js} +1 -1
- package/client/dist/assets/{ListeningList-CSqD8j1C.js → ListeningList-DYcQnnsG.js} +1 -1
- package/client/dist/assets/{Manga-Cg2YuObF.js → Manga-D8CT9aO0.js} +1 -1
- package/client/dist/assets/{MangaInfoPage-DcArhEsy.js → MangaInfoPage-DGK6CYp1.js} +1 -1
- package/client/dist/assets/MangaReadPage-B9XoDKF9.js +1 -0
- package/client/dist/assets/{MangaResetProgressModal-D_yT3d1v.js → MangaResetProgressModal-QjZyIAjl.js} +1 -1
- package/client/dist/assets/Mature-CHt_-Hz5.js +1 -0
- package/client/dist/assets/MediaCard-B5584Cq9.js +1 -0
- package/client/dist/assets/Music-HeLrEZ2d.js +1 -0
- package/client/dist/assets/OptionListMenu-CJ90CdwI.js +1 -0
- package/client/dist/assets/Player-BYtEax_z.js +56 -0
- package/client/dist/assets/PlayerSettings-4-cUAY4B.js +1 -0
- package/client/dist/assets/QueueOptionsButton-Ba0dg_82.js +1 -0
- package/client/dist/assets/{QueueRail-B7f1-e6i.js → QueueRail-O7f4RqjB.js} +1 -1
- package/client/dist/assets/Radio-DPZxQnyD.js +1 -0
- package/client/dist/assets/{ReadingList-BaIem8H1.js → ReadingList-n6rr8ygy.js} +1 -1
- package/client/dist/assets/{ResetProgressModal-DES5Y-Fl.js → ResetProgressModal-CcStlbhP.js} +1 -1
- package/client/dist/assets/Search-C2wrWOdy.js +1 -0
- package/client/dist/assets/Settings-CluUYs8U.js +21 -0
- package/client/dist/assets/{SkeletonGrid-BxfgjP4i.js → SkeletonGrid-CLEPY9nP.js} +1 -1
- package/client/dist/assets/Trackers-CTGPxs0V.js +2 -0
- package/client/dist/assets/Tv-BwHlDdi8.js +4 -0
- package/client/dist/assets/Tv-ZEA45gXK.css +1 -0
- package/client/dist/assets/TvInfo-CXnrLekr.js +1 -0
- package/client/dist/assets/TvPopup-BekfiNcX.js +1 -0
- package/client/dist/assets/{TvSearch-BWDwWnHe.js → TvSearch-DuqR-z3v.js} +1 -1
- package/client/dist/assets/{TvWatchlist-D3n5_4MI.js → TvWatchlist-CBvgFrA0.js} +1 -1
- package/client/dist/assets/Watchlist-mj8mTOam.js +1 -0
- package/client/dist/assets/{hls-BO_L1WoN.js → hls-Boje3IOE.js} +1 -1
- package/client/dist/assets/index-BXwhFWB_.js +178 -0
- package/client/dist/assets/useAnimeInfoData-DJ7A4B4T.js +1 -0
- package/client/dist/assets/useAsmr-DIwIsJXF.js +1 -0
- package/client/dist/assets/{useAsmrPopup-D_o9-QlR.js → useAsmrPopup-e4zNN9ig.js} +1 -1
- package/client/dist/assets/useMangaLibrary-C9Lci5N4.js +1 -0
- package/client/dist/assets/{useMangaPopup-TFzkC-tG.js → useMangaPopup-B8nnpvyi.js} +1 -1
- package/client/dist/assets/useProviders-B5Qr4I1y.js +1 -0
- package/client/dist/assets/useTv-Dm8MCYlL.js +1 -0
- package/client/dist/assets/useTvLibrary-B7jEk2Q7.js +1 -0
- package/client/dist/assets/{vendor-query-BXRECSI6.js → vendor-query-BUTye89G.js} +1 -1
- package/client/dist/index.html +2 -2
- package/orchestrator.js +1 -2
- package/package.json +2 -6
- package/server/dist/app-auth.js +9 -29
- package/server/dist/app-hono.js +621 -0
- package/server/dist/config.js +0 -1
- package/server/dist/db/drizzle.js +32 -0
- package/server/dist/db/schema-anime.js +64 -0
- package/server/dist/db/schema-asmr.js +25 -0
- package/server/dist/db/schema-manga.js +31 -0
- package/server/dist/db/schema-tv.js +33 -0
- package/server/dist/db.js +75 -4
- package/server/dist/discord-gateway.js +1 -1
- package/server/dist/google.js +0 -7
- package/server/dist/hono/asmr.js +1 -0
- package/server/dist/hono/auth.js +56 -0
- package/server/dist/hono/music.js +419 -0
- package/server/dist/{controllers/proxy.controller.js → hono/proxy.js} +390 -394
- package/server/dist/hono/tv.js +197 -0
- package/server/dist/hono/watchlist.js +733 -0
- package/server/dist/lib/anilist.js +3 -3
- package/server/dist/lib/insights.js +185 -0
- package/server/dist/lib/ipc.js +1 -2
- package/server/dist/lib/kitsu.js +1 -28
- package/server/dist/lib/mal-import.js +291 -0
- package/server/dist/lib/migration.js +20 -34
- package/server/dist/lib/offline-db.js +36 -36
- package/server/dist/lib/tracker/manga-sync.service.js +21 -21
- package/server/dist/lib/tracker/sync.service.js +20 -20
- package/server/dist/lib/translate.js +79 -0
- package/server/dist/lib/ytmusic.js +0 -2
- package/server/dist/providers/title-matching.js +0 -1
- package/server/dist/repositories/asmr.repository.js +90 -87
- package/server/dist/repositories/insights.repository.js +24 -13
- package/server/dist/repositories/library.repository.js +33 -93
- package/server/dist/repositories/manga.repository.js +108 -116
- package/server/dist/repositories/notifications.repository.js +50 -31
- package/server/dist/repositories/queue.repository.js +36 -25
- package/server/dist/repositories/settings.repository.js +18 -8
- package/server/dist/repositories/shows-meta.repository.js +54 -41
- package/server/dist/repositories/temp-show-ids.repository.js +43 -31
- package/server/dist/repositories/tv.repository.js +98 -115
- package/server/dist/repositories/watched-episodes.repository.js +52 -20
- package/server/dist/repositories/watchlist.repository.js +36 -48
- package/server/dist/server.js +59 -151
- package/server/dist/sync.js +41 -4
- package/server/dist/trpc/context.js +7 -0
- package/server/dist/trpc/errors.js +21 -0
- package/server/dist/trpc/index.js +19 -0
- package/server/dist/trpc/router.js +49 -0
- package/server/dist/trpc/routers/asmr-library.js +122 -0
- package/server/dist/trpc/routers/asmr-progress.js +133 -0
- package/server/dist/trpc/routers/asmr.js +87 -0
- package/server/dist/trpc/routers/auth.js +247 -0
- package/server/dist/trpc/routers/continue-watching.js +83 -0
- package/server/dist/trpc/routers/data.js +1039 -0
- package/server/dist/trpc/routers/discord.js +288 -0
- package/server/dist/trpc/routers/discovery.js +15 -0
- package/server/dist/trpc/routers/insights.js +45 -0
- package/server/dist/trpc/routers/manga-library.js +280 -0
- package/server/dist/trpc/routers/manga-progress.js +181 -0
- package/server/dist/trpc/routers/manga.js +201 -0
- package/server/dist/{controllers/music.controller.js → trpc/routers/music.js} +155 -288
- package/server/dist/trpc/routers/notifications.js +80 -0
- package/server/dist/trpc/routers/progress.js +15 -0
- package/server/dist/trpc/routers/queue.js +95 -0
- package/server/dist/{routes/radio.routes.js → trpc/routers/radio.js} +30 -23
- package/server/dist/trpc/routers/settings.js +105 -0
- package/server/dist/trpc/routers/tracker.js +219 -0
- package/server/dist/trpc/routers/tv-library.js +145 -0
- package/server/dist/trpc/routers/tv-progress.js +171 -0
- package/server/dist/trpc/routers/tv.js +565 -0
- package/server/dist/trpc/routers/watchlist.js +564 -0
- package/server/dist/trpc/validation.js +159 -0
- package/server/dist/utils/security.utils.js +0 -18
- package/server/package.json +5 -10
- package/client/dist/assets/Asmr-C28TfSvX.js +0 -2
- package/client/dist/assets/AsmrResetProgressModal-6Xh71AgR.js +0 -1
- package/client/dist/assets/AvSyncCalibrator-BwCtRW0P.js +0 -10
- package/client/dist/assets/Home-BJdbHYja.js +0 -1
- package/client/dist/assets/Insights-CjRy42YE.js +0 -1
- package/client/dist/assets/MangaReadPage-YCETZRte.js +0 -1
- package/client/dist/assets/Mature-BGxRWkV5.js +0 -1
- package/client/dist/assets/MediaCard-CAzoxsRS.js +0 -1
- package/client/dist/assets/Music-Cgo-yQ7E.js +0 -1
- package/client/dist/assets/OptionListMenu--Owe9Jle.js +0 -1
- package/client/dist/assets/Player-yRXG2BrP.js +0 -56
- package/client/dist/assets/PlayerSettings-DrZLa0CC.js +0 -1
- package/client/dist/assets/QueueOptionsButton-BVZyPyKf.js +0 -1
- package/client/dist/assets/Radio-BFjxlzuF.js +0 -1
- package/client/dist/assets/Search-BOBo0Ogh.js +0 -1
- package/client/dist/assets/Settings-DOvNQ0gX.js +0 -21
- package/client/dist/assets/Trackers-DZ9KqOWv.js +0 -2
- package/client/dist/assets/Tv-5mATEU4p.js +0 -4
- package/client/dist/assets/Tv-C2SWcVzN.css +0 -1
- package/client/dist/assets/TvInfo-CF-5C5Fs.js +0 -1
- package/client/dist/assets/TvPopup-Dfqifj3s.js +0 -1
- package/client/dist/assets/Watchlist-B8MHNsAU.js +0 -1
- package/client/dist/assets/index-D2RkUJIN.js +0 -178
- package/client/dist/assets/useAnimeInfoData-BWShDHqE.js +0 -1
- package/client/dist/assets/useAsmr-FyfD9G7b.js +0 -1
- package/client/dist/assets/useMangaLibrary-BJU5x8Vz.js +0 -1
- package/client/dist/assets/useProviders-DDRxa8vl.js +0 -1
- package/client/dist/assets/useTv-Bh6WmNnZ.js +0 -1
- package/client/dist/assets/useTvLibrary-_Pqm8re1.js +0 -1
- package/server/dist/controllers/asmr-library.controller.js +0 -288
- package/server/dist/controllers/auth.controller.js +0 -225
- package/server/dist/controllers/data.controller.js +0 -767
- package/server/dist/controllers/insights.controller.js +0 -203
- package/server/dist/controllers/manga-library.controller.js +0 -350
- package/server/dist/controllers/settings.controller.js +0 -609
- package/server/dist/controllers/tv-library.controller.js +0 -314
- package/server/dist/controllers/watchlist.controller.js +0 -1069
- package/server/dist/request-logger.js +0 -16
- package/server/dist/routes/asmr-library.routes.js +0 -23
- package/server/dist/routes/asmr.routes.js +0 -81
- package/server/dist/routes/auth.routes.js +0 -25
- package/server/dist/routes/data.routes.js +0 -47
- package/server/dist/routes/discord-gateway.routes.js +0 -51
- package/server/dist/routes/insights.routes.js +0 -35
- package/server/dist/routes/lan-auth.routes.js +0 -46
- package/server/dist/routes/manga-library.routes.js +0 -25
- package/server/dist/routes/manga.routes.js +0 -141
- package/server/dist/routes/music.routes.js +0 -20
- package/server/dist/routes/providers.routes.js +0 -17
- package/server/dist/routes/proxy.routes.js +0 -12
- package/server/dist/routes/settings.routes.js +0 -24
- package/server/dist/routes/tracker.routes.js +0 -287
- package/server/dist/routes/translate.routes.js +0 -88
- package/server/dist/routes/tv-library.routes.js +0 -23
- package/server/dist/routes/tv.routes.js +0 -629
- package/server/dist/routes/watchlist.routes.js +0 -341
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-rrhOGQcg.js","assets/vendor-core-8R2fFbyN.js","assets/vendor-query-BUTye89G.js","assets/SkeletonGrid-CLEPY9nP.js","assets/vendor-icons-CDMuNDeL.js","assets/SkeletonGrid-Bge3aRl2.css","assets/AnimeCard-CJy1SXH3.js","assets/useAnimeInfoData-DJ7A4B4T.js","assets/QueueOptionsButton-Ba0dg_82.js","assets/vendor-ui-CUDCvRS_.js","assets/QueueOptionsButton-CM15uQn8.css","assets/MediaCard-B5584Cq9.js","assets/useIsMobile-Dm_b6Ob3.js","assets/MediaCard-DB6Yjgky.css","assets/ErrorMessage-z4f4WGgP.js","assets/ErrorMessage-CXoRbrLN.css","assets/ResetProgressModal-CcStlbhP.js","assets/QueueRail-O7f4RqjB.js","assets/QueueRail-BUYEjdaq.css","assets/useMangaPopup-B8nnpvyi.js","assets/useMangaLibrary-C9Lci5N4.js","assets/MangaResetProgressModal-QjZyIAjl.js","assets/useProviders-B5Qr4I1y.js","assets/useMatureConsent-CT7-KfzG.js","assets/useTv-Dm8MCYlL.js","assets/TvPopup-BekfiNcX.js","assets/useTvLibrary-B7jEk2Q7.js","assets/AsmrResetProgressModal-CKYm-8cp.js","assets/useAsmr-DIwIsJXF.js","assets/Home-DtRtTuI9.css","assets/Watchlist-mj8mTOam.js","assets/Watchlist.module-XGtVQr1d.js","assets/Watchlist-BiDEU0iV.css","assets/Settings-CluUYs8U.js","assets/Settings-AuFxQcJF.css","assets/Player-BYtEax_z.js","assets/AvSyncCalibrator-3yjZS7s6.js","assets/AvSyncCalibrator-BPa6KaGC.css","assets/hls-Boje3IOE.js","assets/AnimeMetaDetails-BPvv5xIl.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-BcpwT5iw.js","assets/SynopsisText-CYv2W3yR.css","assets/Player-B036Ic3m.css","assets/Search-C2wrWOdy.js","assets/Search.module-CMEai-B-.js","assets/Search-Cs45oAwI.css","assets/Mature-CHt_-Hz5.js","assets/Mature-DJmUUtlF.css","assets/Asmr--Zc8G9zv.js","assets/Asmr.module-ChUXDZKx.js","assets/Asmr-Cq2ua6Zk.css","assets/useAsmrPopup-e4zNN9ig.js","assets/Manga-D8CT9aO0.js","assets/Manga.module-BcfOdsNP.js","assets/Manga-Dp_-l1Pw.css","assets/MangaInfoPage-DGK6CYp1.js","assets/MangaReadPage-B9XoDKF9.js","assets/ReadingList-n6rr8ygy.js","assets/LibraryListPage-HzuDavbb.js","assets/Radio-DPZxQnyD.js","assets/Radio.module-DGSZLpKM.js","assets/Radio-CCHNFN7R.css","assets/Music-HeLrEZ2d.js","assets/Music-BGH_0voi.css","assets/TvSearch-DuqR-z3v.js","assets/TvInfo-CXnrLekr.js","assets/TvInfo-Bu36xJyO.css","assets/Tv-BwHlDdi8.js","assets/OptionListMenu-CJ90CdwI.js","assets/Tv-ZEA45gXK.css","assets/TvWatchlist-CBvgFrA0.js","assets/ListeningList-DYcQnnsG.js","assets/Trackers-CTGPxs0V.js","assets/Trackers-D5XBOCDp.css","assets/Insights-Bay90Yeg.js","assets/Insights-Dc8xLmsr.css","assets/Map-Dj51g5zL.js","assets/Map-CXFqXmsZ.css","assets/AnimeInfoPage-BxbA_7AV.js","assets/PlayerRedirect-D70t8VUW.js","assets/VirtualKeyboard-6ZNTym4R.js","assets/VirtualKeyboard-KIPc5ZGH.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{N as fn,k as D,A as U,q as K,h as w,S as V,d as _,X as ee,x as te,T as de,g as Ve,u as o,L as H,$ as Nt,a as Ct,c as He,e as yn,f as vn,D as gn,P as ot,i as bn,j as S,l as it,z as T,m as _n,B as wn}from"./vendor-core-8R2fFbyN.js";import{s as le,i as Sn,q as kn,u as W,a as G,b as z,c as Ge,Q as Pn,d as xn}from"./vendor-query-BUTye89G.js";import{I as v}from"./vendor-icons-CDMuNDeL.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const En="modulepreload",In=function(e){return"/"+e},st={},O=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");i=l(n.map(u=>{if(u=In(u),u in st)return;st[u]=!0;const d=u.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${m}`))return;const p=document.createElement("link");if(p.rel=d?"stylesheet":En,d||(p.as="script"),p.crossOrigin="",p.href=u,c&&p.setAttribute("nonce",c),document.head.appendChild(p),d)return new Promise((h,f)=>{p.addEventListener("load",h),p.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};let Tn={data:""},On=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Tn},Nn=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Cn=/\/\*[^]*?\*\/| +/g,at=/\n+/g,se=(e,t)=>{let n="",r="",i="";for(let s in e){let a=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+a+";":r+=s[1]=="f"?se(a,s):s+"{"+se(a,s[1]=="k"?"":t)+"}":typeof a=="object"?r+=se(a,t?t.replace(/([^,])+/g,c=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,c):c?c+" "+l:l)):s):a!=null&&(s=s[1]=="-"?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=se.p?se.p(s,a):s+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},ie={},At=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+At(e[n]);return t}return e},An=(e,t,n,r,i)=>{let s=At(e),a=ie[s]||(ie[s]=(l=>{let u=0,d=11;for(;u<l.length;)d=101*d+l.charCodeAt(u++)>>>0;return"go"+d})(s));if(!ie[a]){let l=s!==e?e:(u=>{let d,m,p=[{}];for(;d=Nn.exec(u.replace(Cn,""));)d[4]?p.shift():d[3]?(m=d[3].replace(at," ").trim(),p.unshift(p[0][m]=p[0][m]||{})):p[0][d[1]]=d[2].replace(at," ").trim();return p[0]})(e);ie[a]=se(i?{["@keyframes "+a]:l}:l,n?"":"."+a)}let c=n&&ie.g;return n&&(ie.g=ie[a]),((l,u,d,m)=>{m?u.data=u.data.replace(m,l):u.data.indexOf(l)===-1&&(u.data=d?l+u.data:u.data+l)})(ie[a],t,r,c),a},Ln=(e,t,n)=>e.reduce((r,i,s)=>{let a=t[s];if(a&&a.call){let c=a(n),l=c&&c.props&&c.props.className||/^go/.test(c)&&c;a=l?"."+l:c&&typeof c=="object"?c.props?"":se(c,""):c===!1?"":c}return r+i+(a??"")},"");function Ce(e){let t=this||{},n=e.call?e(t.p):e;return An(n.unshift?n.raw?Ln(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,On(t.target),t.g,t.o,t.k)}let Lt,Be,Fe;Ce.bind({g:1});let ne=Ce.bind({k:1});function Rn(e,t,n,r){se.p=t,Lt=e,Be=n,Fe=r}function ce(e,t){let n=this||{};return function(){let r=arguments;function i(s,a){let c=Object.assign({},s),l=c.className||i.className;n.p=Object.assign({theme:Be&&Be()},c),n.o=/go\d/.test(l),c.className=Ce.apply(n,r)+(l?" "+l:"");let u=e;return e[0]&&(u=c.as||e,delete c.as),Fe&&u[0]&&Fe(c),Lt(u,c)}return i}}var qn=e=>typeof e=="function",Te=(e,t)=>qn(e)?e(t):e,$n=(()=>{let e=0;return()=>(++e).toString()})(),Rt=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),Dn=20,Je="default",qt=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:r}=t;return qt(e,{type:e.toasts.find(a=>a.id===r.id)?1:0,toast:r});case 3:let{toastId:i}=t;return{...e,toasts:e.toasts.map(a=>a.id===i||i===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+s}))}}},xe=[],$t={toasts:[],pausedAt:void 0,settings:{toastLimit:Dn}},Y={},Dt=(e,t=Je)=>{Y[t]=qt(Y[t]||$t,e),xe.forEach(([n,r])=>{n===t&&r(Y[t])})},jt=e=>Object.keys(Y).forEach(t=>Dt(e,t)),jn=e=>Object.keys(Y).find(t=>Y[t].toasts.some(n=>n.id===e)),Ae=(e=Je)=>t=>{Dt(t,e)},Mn={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Bn=(e={},t=Je)=>{let[n,r]=_(Y[t]||$t),i=U(Y[t]);w(()=>(i.current!==Y[t]&&r(Y[t]),xe.push([t,r]),()=>{let a=xe.findIndex(([c])=>c===t);a>-1&&xe.splice(a,1)}),[t]);let s=n.toasts.map(a=>{var c,l,u;return{...e,...e[a.type],...a,removeDelay:a.removeDelay||((c=e[a.type])==null?void 0:c.removeDelay)||e?.removeDelay,duration:a.duration||((l=e[a.type])==null?void 0:l.duration)||e?.duration||Mn[a.type],style:{...e.style,...(u=e[a.type])==null?void 0:u.style,...a.style}}});return{...n,toasts:s}},Fn=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:n?.id||$n()}),_e=e=>(t,n)=>{let r=Fn(t,e,n);return Ae(r.toasterId||jn(r.id))({type:2,toast:r}),r.id},R=(e,t)=>_e("blank")(e,t);R.error=_e("error");R.success=_e("success");R.loading=_e("loading");R.custom=_e("custom");R.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Ae(t)(n):jt(n)};R.dismissAll=e=>R.dismiss(void 0,e);R.remove=(e,t)=>{let n={type:4,toastId:e};t?Ae(t)(n):jt(n)};R.removeAll=e=>R.remove(void 0,e);R.promise=(e,t,n)=>{let r=R.loading(t.loading,{...n,...n?.loading});return typeof e=="function"&&(e=e()),e.then(i=>{let s=t.success?Te(t.success,i):void 0;return s?R.success(s,{id:r,...n,...n?.success}):R.dismiss(r),i}).catch(i=>{let s=t.error?Te(t.error,i):void 0;s?R.error(s,{id:r,...n,...n?.error}):R.dismiss(r)}),e};var Wn=1e3,Kn=(e,t="default")=>{let{toasts:n,pausedAt:r}=Bn(e,t),i=U(new Map).current,s=K((m,p=Wn)=>{if(i.has(m))return;let h=setTimeout(()=>{i.delete(m),a({type:4,toastId:m})},p);i.set(m,h)},[]);w(()=>{if(r)return;let m=Date.now(),p=n.map(h=>{if(h.duration===1/0)return;let f=(h.duration||0)+h.pauseDuration-(m-h.createdAt);if(f<0){h.visible&&R.dismiss(h.id);return}return setTimeout(()=>R.dismiss(h.id,t),f)});return()=>{p.forEach(h=>h&&clearTimeout(h))}},[n,r,t]);let a=K(Ae(t),[t]),c=K(()=>{a({type:5,time:Date.now()})},[a]),l=K((m,p)=>{a({type:1,toast:{id:m,height:p}})},[a]),u=K(()=>{r&&a({type:6,time:Date.now()})},[r,a]),d=K((m,p)=>{let{reverseOrder:h=!1,gutter:f=8,defaultPosition:E}=p||{},A=n.filter(g=>(g.position||E)===(m.position||E)&&g.height),$=A.findIndex(g=>g.id===m.id),Q=A.filter((g,L)=>L<$&&g.visible).length;return A.filter(g=>g.visible).slice(...h?[Q+1]:[0,Q]).reduce((g,L)=>g+(L.height||0)+f,0)},[n]);return w(()=>{n.forEach(m=>{if(m.dismissed)s(m.id,m.removeDelay);else{let p=i.get(m.id);p&&(clearTimeout(p),i.delete(m.id))}})},[n,s]),{toasts:n,handlers:{updateHeight:l,startPause:c,endPause:u,calculateOffset:d}}},Un=ne`
|
|
3
|
+
from {
|
|
4
|
+
transform: scale(0) rotate(45deg);
|
|
5
|
+
opacity: 0;
|
|
6
|
+
}
|
|
7
|
+
to {
|
|
8
|
+
transform: scale(1) rotate(45deg);
|
|
9
|
+
opacity: 1;
|
|
10
|
+
}`,zn=ne`
|
|
11
|
+
from {
|
|
12
|
+
transform: scale(0);
|
|
13
|
+
opacity: 0;
|
|
14
|
+
}
|
|
15
|
+
to {
|
|
16
|
+
transform: scale(1);
|
|
17
|
+
opacity: 1;
|
|
18
|
+
}`,Qn=ne`
|
|
19
|
+
from {
|
|
20
|
+
transform: scale(0) rotate(90deg);
|
|
21
|
+
opacity: 0;
|
|
22
|
+
}
|
|
23
|
+
to {
|
|
24
|
+
transform: scale(1) rotate(90deg);
|
|
25
|
+
opacity: 1;
|
|
26
|
+
}`,Vn=ce("div")`
|
|
27
|
+
width: 20px;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
height: 20px;
|
|
30
|
+
border-radius: 10px;
|
|
31
|
+
background: ${e=>e.primary||"#ff4b4b"};
|
|
32
|
+
position: relative;
|
|
33
|
+
transform: rotate(45deg);
|
|
34
|
+
|
|
35
|
+
animation: ${Un} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
36
|
+
forwards;
|
|
37
|
+
animation-delay: 100ms;
|
|
38
|
+
|
|
39
|
+
&:after,
|
|
40
|
+
&:before {
|
|
41
|
+
content: '';
|
|
42
|
+
animation: ${zn} 0.15s ease-out forwards;
|
|
43
|
+
animation-delay: 150ms;
|
|
44
|
+
position: absolute;
|
|
45
|
+
border-radius: 3px;
|
|
46
|
+
opacity: 0;
|
|
47
|
+
background: ${e=>e.secondary||"#fff"};
|
|
48
|
+
bottom: 9px;
|
|
49
|
+
left: 4px;
|
|
50
|
+
height: 2px;
|
|
51
|
+
width: 12px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:before {
|
|
55
|
+
animation: ${Qn} 0.15s ease-out forwards;
|
|
56
|
+
animation-delay: 180ms;
|
|
57
|
+
transform: rotate(90deg);
|
|
58
|
+
}
|
|
59
|
+
`,Hn=ne`
|
|
60
|
+
from {
|
|
61
|
+
transform: rotate(0deg);
|
|
62
|
+
}
|
|
63
|
+
to {
|
|
64
|
+
transform: rotate(360deg);
|
|
65
|
+
}
|
|
66
|
+
`,Gn=ce("div")`
|
|
67
|
+
width: 12px;
|
|
68
|
+
height: 12px;
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
border: 2px solid;
|
|
71
|
+
border-radius: 100%;
|
|
72
|
+
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
73
|
+
border-right-color: ${e=>e.primary||"#616161"};
|
|
74
|
+
animation: ${Hn} 1s linear infinite;
|
|
75
|
+
`,Jn=ne`
|
|
76
|
+
from {
|
|
77
|
+
transform: scale(0) rotate(45deg);
|
|
78
|
+
opacity: 0;
|
|
79
|
+
}
|
|
80
|
+
to {
|
|
81
|
+
transform: scale(1) rotate(45deg);
|
|
82
|
+
opacity: 1;
|
|
83
|
+
}`,Yn=ne`
|
|
84
|
+
0% {
|
|
85
|
+
height: 0;
|
|
86
|
+
width: 0;
|
|
87
|
+
opacity: 0;
|
|
88
|
+
}
|
|
89
|
+
40% {
|
|
90
|
+
height: 0;
|
|
91
|
+
width: 6px;
|
|
92
|
+
opacity: 1;
|
|
93
|
+
}
|
|
94
|
+
100% {
|
|
95
|
+
opacity: 1;
|
|
96
|
+
height: 10px;
|
|
97
|
+
}`,Zn=ce("div")`
|
|
98
|
+
width: 20px;
|
|
99
|
+
opacity: 0;
|
|
100
|
+
height: 20px;
|
|
101
|
+
border-radius: 10px;
|
|
102
|
+
background: ${e=>e.primary||"#61d345"};
|
|
103
|
+
position: relative;
|
|
104
|
+
transform: rotate(45deg);
|
|
105
|
+
|
|
106
|
+
animation: ${Jn} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
107
|
+
forwards;
|
|
108
|
+
animation-delay: 100ms;
|
|
109
|
+
&:after {
|
|
110
|
+
content: '';
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
animation: ${Yn} 0.2s ease-out forwards;
|
|
113
|
+
opacity: 0;
|
|
114
|
+
animation-delay: 200ms;
|
|
115
|
+
position: absolute;
|
|
116
|
+
border-right: 2px solid;
|
|
117
|
+
border-bottom: 2px solid;
|
|
118
|
+
border-color: ${e=>e.secondary||"#fff"};
|
|
119
|
+
bottom: 6px;
|
|
120
|
+
left: 6px;
|
|
121
|
+
height: 10px;
|
|
122
|
+
width: 6px;
|
|
123
|
+
}
|
|
124
|
+
`,Xn=ce("div")`
|
|
125
|
+
position: absolute;
|
|
126
|
+
`,er=ce("div")`
|
|
127
|
+
position: relative;
|
|
128
|
+
display: flex;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
align-items: center;
|
|
131
|
+
min-width: 20px;
|
|
132
|
+
min-height: 20px;
|
|
133
|
+
`,tr=ne`
|
|
134
|
+
from {
|
|
135
|
+
transform: scale(0.6);
|
|
136
|
+
opacity: 0.4;
|
|
137
|
+
}
|
|
138
|
+
to {
|
|
139
|
+
transform: scale(1);
|
|
140
|
+
opacity: 1;
|
|
141
|
+
}`,nr=ce("div")`
|
|
142
|
+
position: relative;
|
|
143
|
+
transform: scale(0.6);
|
|
144
|
+
opacity: 0.4;
|
|
145
|
+
min-width: 20px;
|
|
146
|
+
animation: ${tr} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
147
|
+
forwards;
|
|
148
|
+
`,rr=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?D(nr,null,t):t:n==="blank"?null:D(er,null,D(Gn,{...r}),n!=="loading"&&D(Xn,null,n==="error"?D(Vn,{...r}):D(Zn,{...r})))},or=e=>`
|
|
149
|
+
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
150
|
+
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
151
|
+
`,ir=e=>`
|
|
152
|
+
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
153
|
+
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
154
|
+
`,sr="0%{opacity:0;} 100%{opacity:1;}",ar="0%{opacity:1;} 100%{opacity:0;}",cr=ce("div")`
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
background: #fff;
|
|
158
|
+
color: #363636;
|
|
159
|
+
line-height: 1.3;
|
|
160
|
+
will-change: transform;
|
|
161
|
+
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
162
|
+
max-width: 350px;
|
|
163
|
+
pointer-events: auto;
|
|
164
|
+
padding: 8px 10px;
|
|
165
|
+
border-radius: 8px;
|
|
166
|
+
`,lr=ce("div")`
|
|
167
|
+
display: flex;
|
|
168
|
+
justify-content: center;
|
|
169
|
+
margin: 4px 10px;
|
|
170
|
+
color: inherit;
|
|
171
|
+
flex: 1 1 auto;
|
|
172
|
+
white-space: pre-line;
|
|
173
|
+
`,ur=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=Rt()?[sr,ar]:[or(n),ir(n)];return{animation:t?`${ne(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${ne(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},dr=fn(({toast:e,position:t,style:n,children:r})=>{let i=e.height?ur(e.position||t||"top-center",e.visible):{opacity:0},s=D(rr,{toast:e}),a=D(lr,{...e.ariaProps},Te(e.message,e));return D(cr,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:a}):D(V,null,s,a))});Rn(D);var mr=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=K(a=>{if(a){let c=()=>{let l=a.getBoundingClientRect().height;r(e,l)};c(),new MutationObserver(c).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return D("div",{ref:s,className:t,style:n},i)},pr=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Rt()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},hr=Ce`
|
|
174
|
+
z-index: 9999;
|
|
175
|
+
> * {
|
|
176
|
+
pointer-events: auto;
|
|
177
|
+
}
|
|
178
|
+
`,Se=16,fr=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,toasterId:s,containerStyle:a,containerClassName:c})=>{let{toasts:l,handlers:u}=Kn(n,s);return D("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Se,left:Se,right:Se,bottom:Se,pointerEvents:"none",...a},className:c,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(d=>{let m=d.position||t,p=u.calculateOffset(d,{reverseOrder:e,gutter:r,defaultPosition:t}),h=pr(m,p);return D(mr,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?hr:"",style:h},d.type==="custom"?Te(d.message,d):i?i(d):D(dr,{toast:d,position:m}))}))},b=R;function Le(e){const t={subscribe(n){let r=null,i=!1,s=!1,a=!1;function c(){if(r===null){a=!0;return}s||(s=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(l){var u;i||(u=n.next)===null||u===void 0||u.call(n,l)},error(l){var u;i||(i=!0,(u=n.error)===null||u===void 0||u.call(n,l),c())},complete(){var l;i||(i=!0,(l=n.complete)===null||l===void 0||l.call(n),c())}}),a&&c(),{unsubscribe:c}},pipe(...n){return n.reduce(yr,t)}};return t}function yr(e,t){return t(e)}function vr(e){const t=new AbortController;return new Promise((n,r)=>{let i=!1;function s(){i||(i=!0,a.unsubscribe())}t.signal.addEventListener("abort",()=>{r(t.signal.reason)});const a=e.subscribe({next(c){i=!0,n(c),s()},error(c){r(c)},complete(){t.abort(),s()}})})}function gr(e){return t=>{let n=0,r=null;const i=[];function s(){r||(r=t.subscribe({next(c){for(const u of i){var l;(l=u.next)===null||l===void 0||l.call(u,c)}},error(c){for(const u of i){var l;(l=u.error)===null||l===void 0||l.call(u,c)}},complete(){for(const l of i){var c;(c=l.complete)===null||c===void 0||c.call(l)}}}))}function a(){if(n===0&&r){const c=r;r=null,c.unsubscribe()}}return Le(c=>(n++,i.push(c),s(),{unsubscribe(){n--,a();const l=i.findIndex(u=>u===c);l>-1&&i.splice(l,1)}}))}}function br(e){let t=e;const n=[],r=a=>{t!==void 0&&a.next(t),n.push(a)},i=a=>{n.splice(n.indexOf(a),1)},s=Le(a=>(r(a),()=>{i(a)}));return s.next=a=>{if(t!==a){t=a;for(const c of n)c.next(a)}},s.get=()=>t,s}function _r(e){return Le(t=>{function n(r=0,i=e.op){const s=e.links[r];if(!s)throw new Error("No more links to execute - did you forget to add an ending link?");return s({op:i,next(a){return n(r+1,a)}})}return n().subscribe(t)})}function ve(e){"@babel/helpers - typeof";return ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ve(e)}function wr(e,t){if(ve(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ve(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sr(e){var t=wr(e,"string");return ve(t)=="symbol"?t:t+""}function B(e,t,n){return(t=Sr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ct(Object(n),!0).forEach(function(r){B(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ae(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function kr(e){return typeof e=="function"}function Pr(){return Object.create(null)}const xr=typeof Symbol=="function"&&!!Symbol.asyncIterator;function Er(e){return xr&&ae(e)&&Symbol.asyncIterator in e}const Ir=e=>e(),Mt=()=>{},lt=e=>{Object.freeze&&Object.freeze(e)};function Bt(e,t,n){var r;const i=t.join(".");return(r=n[i])!==null&&r!==void 0||(n[i]=new Proxy(Mt,{get(s,a){if(!(typeof a!="string"||a==="then"))return Bt(e,[...t,a],n)},apply(s,a,c){const l=t[t.length-1];if(l==="valueOf"||l==="toString"||l==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let u={args:c,path:t};return l==="call"?u={args:c.length>=2?[c[1]]:[],path:t.slice(0,-1)}:l==="apply"&&(u={args:c.length>=2?c[1]:[],path:t.slice(0,-1)}),lt(u.args),lt(u.path),e(u)}})),n[i]}const Ft=e=>Bt(e,[],Pr()),Tr=e=>new Proxy(Mt,{get(t,n){if(n!=="then")return e(n)}});function ge(e){"@babel/helpers - typeof";return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(e)}function Or(e,t){if(ge(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ge(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nr(e){var t=Or(e,"string");return ge(t)=="symbol"?t:t+""}function We(e,t,n){return(t=Nr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ut(Object(n),!0).forEach(function(r){We(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ut(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Cr=class extends Error{constructor(e){super(Ar(e)),Object.assign(this,e)}};function Ar(e){if("message"in e)return String(e.message)}function Lr(e){if(e instanceof Error)return e;const t=typeof e;if(!(t==="undefined"||t==="function"||e===null)){if(t!=="object")return new Error(String(e));if(ae(e))return new Cr(e)}}var dt=class extends Error{constructor(e){var t,n,r;const i=Lr(e.cause),s=(t=(n=e.message)!==null&&n!==void 0?n:i?.message)!==null&&t!==void 0?t:e.code;super(s,{cause:i}),We(this,"cause",void 0),We(this,"code",void 0),this.code=e.code,this.name="TRPCError",(r=this.cause)!==null&&r!==void 0||(this.cause=i)}};function Rr(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:ke(ke({},e),{},{error:n})}}return{ok:!0,result:ke(ke({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var De=class extends Error{constructor(){super("Unable to transform response from server")}};function qr(e,t){let n;try{n=Rr(e,t)}catch{throw new De}if(!n.ok&&(!ae(n.error.error)||typeof n.error.error.code!="number"))throw new De;if(n.ok&&!ae(n.result))throw new De;return n}function $r(e){return typeof e=="function"}async function Dr(e,t){const{_def:n}=e;let r=n.procedures[t];for(;!r;){const i=Object.keys(n.lazy).find(s=>t===s||t.startsWith(s+"."));if(!i)return null;await n.lazy[i].load(),r=n.procedures[t]}return r}async function jr(e){const{type:t,path:n}=e,r=await Dr(e.router,n);if(!r||!$r(r)||r._def.type!==t&&!e.allowMethodOverride)throw new dt({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new dt({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return r(e)}function Mr(e){return e instanceof Oe}function Br(e){return ae(e)&&ae(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Fr(e,t){return typeof e=="string"?e:ae(e)&&typeof e.message=="string"?e.message:t}var Oe=class Ee extends Error{constructor(t,n){var r,i;const s=n?.cause;super(t,{cause:s}),B(this,"cause",void 0),B(this,"shape",void 0),B(this,"data",void 0),B(this,"meta",void 0),this.meta=n?.meta,this.cause=s,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(i=n.result)===null||i===void 0?void 0:i.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ee.prototype)}static from(t,n={}){const r=t;return Mr(r)?(n.meta&&(r.meta=q(q({},r.meta),n.meta)),r):Br(r)?new Ee(r.error.message,q(q({},n),{},{result:r,cause:n.cause})):new Ee(Fr(r,"Unknown error"),q(q({},n),{},{cause:r}))}};function Wr(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const mt=e=>typeof e=="function";function Kr(e){if(e)return e;if(typeof window<"u"&&mt(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&mt(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function Ur(...e){const t=new AbortController,n=e.length;let r=0;const i=()=>{++r===n&&t.abort()};for(const s of e)s?.aborted?i():s?.addEventListener("abort",i,{once:!0});return t.signal}function zr(...e){const t=new AbortController;for(const n of e)n?.aborted?t.abort():n?.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}function Qr(e){return{url:e.url.toString(),fetch:e.fetch,transformer:Wr(e.transformer),methodOverride:e.methodOverride}}function Vr(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const Hr={query:"GET",mutation:"POST",subscription:"PATCH"};function Wt(e){return"input"in e?e.transformer.input.serialize(e.input):Vr(e.inputs.map(t=>e.transformer.input.serialize(t)))}const Kt=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const r=[];if(t[1]&&r.push(t[1]),"inputs"in e&&r.push("batch=1"),e.type==="query"||e.type==="subscription"){const i=Wt(e);i!==void 0&&e.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(i))}`)}return r.length&&(n+="?"+r.join("&")),n},Gr=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=Wt(e);return t!==void 0?JSON.stringify(t):void 0},Jr=e=>eo(q(q({},e),{},{contentTypeHeader:"application/json",getUrl:Kt,getBody:Gr}));var Yr=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Zr=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Yr};async function Xr(e){var t,n;Zr(e.signal);const r=e.getUrl(e),i=e.getBody(e),s=(t=e.methodOverride)!==null&&t!==void 0?t:Hr[e.type],a=await(async()=>{const l=await e.headers();return Symbol.iterator in l?Object.fromEntries(l):l})(),c=q(q(q({},e.contentTypeHeader&&s!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),a);return Kr(e.fetch)(r,{method:s,signal:e.signal,body:i,headers:c})}async function eo(e){const t={},n=await Xr(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const pt=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function ht(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function i(c){const l=[[]];let u=0;for(;;){const p=c[u];if(!p)break;const h=l[l.length-1];if(p.aborted){var d;(d=p.reject)===null||d===void 0||d.call(p,new Error("Aborted")),u++;continue}if(e.validate(h.concat(p).map(f=>f.key))){h.push(p),u++;continue}if(h.length===0){var m;(m=p.reject)===null||m===void 0||m.call(p,new Error("Input is too big for a single dispatch")),u++;continue}l.push([])}return l}function s(){const c=i(t);r();for(const l of c){if(!l.length)continue;const u={items:l};for(const d of l)d.batch=u;e.fetch(u.items.map(d=>d.key)).then(async d=>{await Promise.all(d.map(async(p,h)=>{const f=u.items[h];try{var E;const $=await Promise.resolve(p);(E=f.resolve)===null||E===void 0||E.call(f,$)}catch($){var A;(A=f.reject)===null||A===void 0||A.call(f,$)}f.batch=null,f.reject=null,f.resolve=null}));for(const p of u.items){var m;(m=p.reject)===null||m===void 0||m.call(p,new Error("Missing result")),p.batch=null}}).catch(d=>{for(const p of u.items){var m;(m=p.reject)===null||m===void 0||m.call(p,d),p.batch=null}})}}function a(c){var l;const u={aborted:!1,key:c,batch:null,resolve:pt,reject:pt},d=new Promise((m,p)=>{var h;u.reject=p,u.resolve=m,(h=t)!==null&&h!==void 0||(t=[]),t.push(u)});return(l=n)!==null&&l!==void 0||(n=setTimeout(s)),d}return{load:a}}function to(e){var t,n;const r=Qr(e),i=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,s=(n=e.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const a=l=>({validate(u){if(i===1/0&&s===1/0)return!0;if(u.length>s)return!1;const d=u.map(p=>p.path).join(","),m=u.map(p=>p.input);return Kt(q(q({},r),{},{type:l,path:d,inputs:m,signal:null})).length<=i},async fetch(u){const d=u.map(f=>f.path).join(","),m=u.map(f=>f.input),p=Ur(...u.map(f=>f.signal)),h=await Jr(q(q({},r),{},{path:d,inputs:m,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:u}):e.headers:{}},signal:p}));return(Array.isArray(h.json)?h.json:u.map(()=>h.json)).map(f=>({meta:h.meta,json:f}))}}),c={query:ht(a("query")),mutation:ht(a("mutation"))};return({op:l})=>Le(u=>{if(l.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const d=new AbortController,m=c[l.type].load(q(q({},l),{},{signal:zr(l.signal,d.signal)}));let p=!1,h;return m.then(f=>{p=!0,h=f;const E=qr(f.json,r.transformer.output);if(!E.ok){u.error(Oe.from(E.error,{meta:f.meta}));return}u.next({context:f.meta,result:E.result}),u.complete()}).catch(f=>{p=!0,u.error(Oe.from(f,{meta:h?.meta}))}),()=>{p||d.abort()}})}}const Ut=(e,...t)=>typeof e=="function"?e(...t):e;function no(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function ro(e){const t=await Ut(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function oo(e,t){const n={method:"connectionParams",data:await Ut(e)};return t.encode(n)}function io(e){const{promise:t,resolve:n,reject:r}=no();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function so(e,{intervalMs:t,pongTimeoutMs:n}){let r,i;function s(){r=setTimeout(()=>{e.send("PING"),i=setTimeout(()=>{e.close()},n)},t)}function a(){clearTimeout(r),s()}function c(){clearTimeout(i),a()}e.addEventListener("open",s),e.addEventListener("message",({data:l})=>{clearTimeout(r),s(),l==="PONG"&&c()}),e.addEventListener("close",()=>{clearTimeout(r),clearTimeout(i)})}var ao=class Ke{constructor(t){var n;if(B(this,"id",++Ke.connectCount),B(this,"WebSocketPonyfill",void 0),B(this,"urlOptions",void 0),B(this,"keepAliveOpts",void 0),B(this,"encoder",void 0),B(this,"wsObservable",br(null)),B(this,"openPromise",null),this.WebSocketPonyfill=(n=t.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++Ke.connectCount;const t=ro(this.urlOptions).then(n=>new this.WebSocketPonyfill(n));this.openPromise=t.then(async n=>{this.ws=n,n.binaryType="arraybuffer",n.addEventListener("message",function({data:r}){r==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&so(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await io(n),this.urlOptions.connectionParams&&n.send(await oo(this.urlOptions.connectionParams,this.encoder))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{var t;(t=this.ws)===null||t===void 0||t.close()}}};B(ao,"connectCount",0);var zt=class{constructor(e){B(this,"links",void 0),B(this,"runtime",void 0),B(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return _r({links:this.links,op:q(q({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(gr())}async requestAsPromise(e){try{const t=this.$request(e);return(await vr(t)).result.data}catch(t){throw Oe.from(t)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(r){switch(r.result.type){case"state":var i;(i=n.onConnectionStateChange)===null||i===void 0||i.call(n,r.result);break;case"started":var s;(s=n.onStarted)===null||s===void 0||s.call(n,{context:r.context});break;case"stopped":var a;(a=n.onStopped)===null||a===void 0||a.call(n);break;case"data":case void 0:var c;(c=n.onData)===null||c===void 0||c.call(n,r.result.data)}},error(r){var i;(i=n.onError)===null||i===void 0||i.call(n,r)},complete(){var r;(r=n.onComplete)===null||r===void 0||r.call(n)}})}};const Qt=Symbol.for("trpc_untypedClient"),co={query:"query",mutate:"mutation",subscribe:"subscription"},lo=e=>co[e];function uo(e){const t=Ft(({path:n,args:r})=>{const i=[...n],s=lo(i.pop()),a=i.join(".");return e[s](a,...r)});return Tr(n=>n===Qt?e:t[n])}function mo(e){return uo(new zt(e))}function po(e){return e[Qt]}function be(e){"@babel/helpers - typeof";return be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},be(e)}function ho(e,t){if(be(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(be(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fo(e){var t=ho(e,"string");return be(t)=="symbol"?t:t+""}function yo(e,t,n){return(t=fo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ft(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ft(Object(n),!0).forEach(function(r){yo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vo(e){var t,n,r,i=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new Ie(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Ie(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(i){return{value:i,done:r}})}return Ie=function(r){this.s=r,this.n=r.next},Ie.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var i=this.s.return;return i===void 0?Promise.resolve({value:r,done:!0}):t(i.apply(this.s,arguments))},throw:function(r){var i=this.s.return;return i===void 0?Promise.reject(r):t(i.apply(this.s,arguments))}},new Ie(e)}function go(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function bo(e,t){if(e==null)return{};var n,r,i=go(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}const _o=["cursor","direction"];function Re(e){return{path:e.path.join(".")}}function wo(e){return e.length>=3}function So(e){return wo(e)?{type:"prefixed",prefix:e[0],path:e[1],args:e[2]}:{type:"unprefixed",prefix:void 0,path:e[0],args:e[1]}}function Ye(e,t,n){var r;const i=So(e);let s=(r=i.args)===null||r===void 0?void 0:r.input;if(n){var a,c;s=P(P(P({},(a=(c=i.args)===null||c===void 0?void 0:c.input)!==null&&a!==void 0?a:{}),n.pageParam!==void 0?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[i.path.join("."),s,t?.trpc]}async function ko(e,t,n){const r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:"success"});const i=[];var s=!1,a=!1,c;try{for(var l=vo(e),u;s=!(u=await l.next()).done;s=!1){const d=u.value;i.push(d),r.setState({data:[...i]})}}catch(d){a=!0,c=d}finally{try{s&&l.return!=null&&await l.return()}finally{if(a)throw c}}return i}function X(e){const t=Ir(()=>{const{input:n,type:r}=e,i=e.path.flatMap(s=>s.split("."));if(!n&&r==="any")return i.length?[i]:[];if(r==="infinite"&&ae(n)&&("direction"in n||"cursor"in n)){const{cursor:s,direction:a}=n;return[i,{input:bo(n,_o),type:"infinite"}]}return[i,P(P({},typeof n<"u"&&n!==le&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function Vt(e){const t=[e.path.flatMap(n=>n.split("."))];return e.prefix&&t.unshift([e.prefix]),t}function Ze(e){return kr(e)?e():e}function Po(e){var t;const{input:n,query:r,path:i,queryKey:s,opts:a}=e,c=n===le,l=async u=>{var d;const m=P(P({},a),{},{trpc:P(P({},a?.trpc),!(a==null||(d=a.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})});return await r(...Ye(s,m,{direction:u.direction,pageParam:u.pageParam}))};return Object.assign(Sn(P(P({},a??{}),{},{queryKey:s,queryFn:c?le:l,initialPageParam:(t=a?.initialCursor)!==null&&t!==void 0?t:n?.cursor})),{trpc:Re({path:i})})}function xo(e){var t,n;const{mutate:r,path:i,prefix:s,opts:a,overrides:c}=e,l=Ze(e.queryClient),u=Vt({path:i,prefix:(t=a?.keyPrefix)!==null&&t!==void 0?t:s}),d=l.defaultMutationOptions(l.getMutationDefaults(u)),m=(n=c?.onSuccess)!==null&&n!==void 0?n:(h=>h.originalFn()),p=async h=>await r(...Ye([...u,{input:h}],a));return P(P({},a),{},{mutationKey:u,mutationFn:p,onSuccess(...h){var f,E;return m({originalFn:()=>{var $,Q,g;return($=a==null||(Q=a.onSuccess)===null||Q===void 0?void 0:Q.call(a,...h))!==null&&$!==void 0?$:d==null||(g=d.onSuccess)===null||g===void 0?void 0:g.call(d,...h)},queryClient:l,meta:(f=(E=a?.meta)!==null&&E!==void 0?E:d?.meta)!==null&&f!==void 0?f:{}})},trpc:Re({path:i})})}function Eo(e){const{input:t,query:n,path:r,queryKey:i,opts:s}=e,a=Ze(e.queryClient),c=t===le,l=async u=>{var d;const m=P(P({},s),{},{trpc:P(P({},s?.trpc),!(s==null||(d=s.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})}),p=u.queryKey,h=await n(...Ye(p,m));return Er(h)?ko(h,a,p):h};return Object.assign(kn(P(P({},s),{},{queryKey:i,queryFn:c?le:l})),{trpc:Re({path:r})})}const Io=e=>{const{subscribe:t,path:n,queryKey:r,input:i,opts:s={}}=e,a="enabled"in s?!!s.enabled:i!==le,c=l=>t(n.join("."),i===le?void 0:i,l);return P(P({},s),{},{enabled:a,subscribe:c,queryKey:r,trpc:Re({path:n})})};function To(e){const t=e.keyPrefix,n=r=>(i,s,a)=>"router"in e?Promise.resolve(Ze(e.ctx)).then(c=>jr({router:e.router,path:i,getRawInput:async()=>s,ctx:c,type:r,signal:void 0,batchIndex:0})):(e.client instanceof zt?e.client:po(e.client))[r](i,s,a);return Ft(({args:r,path:i})=>{const s=[...i],a=s.pop(),[c,l]=r;return{"~types":void 0,pathKey:()=>X({path:s,type:"any",prefix:t}),pathFilter:()=>P(P({},c),{},{queryKey:X({path:s,type:"any",prefix:t})}),queryOptions:()=>Eo({input:c,opts:l,path:s,queryClient:e.queryClient,queryKey:X({path:s,input:c,type:"query",prefix:t}),query:n("query")}),queryKey:()=>X({path:s,input:c,type:"query",prefix:t}),queryFilter:()=>P(P({},l),{},{queryKey:X({path:s,input:c,type:"query",prefix:t})}),infiniteQueryOptions:()=>Po({input:c,opts:l,path:s,queryKey:X({path:s,input:c,type:"infinite",prefix:t}),query:n("query")}),infiniteQueryKey:()=>X({path:s,input:c,type:"infinite",prefix:t}),infiniteQueryFilter:()=>P(P({},l),{},{queryKey:X({path:s,input:c,type:"infinite",prefix:t})}),mutationOptions:()=>{var u;return xo({opts:c,path:s,prefix:t,queryClient:e.queryClient,mutate:n("mutation"),overrides:(u=e.overrides)===null||u===void 0?void 0:u.mutations})},mutationKey:()=>Vt({path:s,prefix:t}),subscriptionOptions:()=>Io({opts:l,path:s,input:c,queryKey:X({path:s,input:c,type:"any",prefix:t}),subscribe:n("subscription")})}[a]()})}function Oo(){const e=ee(null),t=ee(null),n=s=>{const a=de(()=>To({client:s.trpcClient,queryClient:s.queryClient,keyPrefix:s.keyPrefix}),[s.trpcClient,s.queryClient,s.keyPrefix]);return D(e.Provider,{value:s.trpcClient},D(t.Provider,{value:a},s.children))};n.displayName="TRPCProvider";function r(){const s=te(t);if(!s)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return s}function i(){const s=te(e);if(!s)throw new Error("useTRPCClient() can only be used inside of a <TRPCProvider>");return s}return{TRPCProvider:n,useTRPC:r,useTRPCClient:i}}const Ue={lan:new Set,animepahe:new Set,jasmr:new Set};function ze(e){for(const t of[...Ue[e]])try{t()}catch(n){console.error(`auth-bus listener failed (${e}):`,n)}}function Ht(e,t){return Ue[e].add(t),()=>{Ue[e].delete(t)}}const No=e=>new Promise(t=>setTimeout(t,e));async function Co(e,t){const n={"Content-Type":"application/json"},r=typeof e=="string"?e:e.toString();if(r.startsWith("/")||typeof window<"u"&&r.startsWith(window.location.origin)){const a=localStorage.getItem("animepahe_ua"),c=localStorage.getItem("animepahe_cookie"),l=localStorage.getItem("jasmr_ua"),u=localStorage.getItem("jasmr_cookie");a&&(n["x-animepahe-ua"]=a),c&&(n["x-animepahe-cookie"]=c),l&&(n["x-jasmr-ua"]=l),u&&(n["x-jasmr-cookie"]=u)}let s=await fetch(e,{...t,headers:{...n,...t?.headers}});for(let a=0;s.status===503&&a<8;a++)await No(Math.min(500*2**a,4e3)),s=await fetch(e,{...t,headers:{...n,...t?.headers}});if(s.status===401)try{(await s.clone().json())?.error==="LAN_AUTH_REQUIRED"&&ze("lan")}catch{}return await Ao(s),s}async function Ao(e){try{if(!e.headers.get("content-type")?.includes("json"))return;const t=await e.clone().json(),n=Array.isArray(t)?t:[t];for(const r of n){const i=r?.error;if(!i||typeof i!="object")continue;const s=i.data?.cause;(i.message==="AUTH_REQUIRED"||s?.code==="AUTH_REQUIRED")&&(s?.provider==="animepahe"||s?.provider==="jasmr")&&ze(s.provider),(i.message==="LAN_AUTH_REQUIRED"||s?.code==="LAN_AUTH_REQUIRED")&&ze("lan")}}catch{}}const{TRPCProvider:Lo,useTRPC:x}=Oo(),F=mo({links:[to({url:"/api/trpc",fetch:Co})]}),ye=new Map,Ro=500,qo=(e,t,n)=>{if(!e||e.trim()==="")return"/placeholder.svg";if(e.includes("/api/image-proxy")){let a=e;if(t&&!a.includes("w=")){const c=a.includes("?")?"&":"?";a+=`${c}w=${t}`}if(n&&!a.includes("h=")){const c=a.includes("?")?"&":"?";a+=`${c}h=${n}`}return a}let r=e;r.includes("aln.youtube-anime.com")&&(r=r.replace(/https?:\/\/allanime\.day\/aln\.youtube-anime\.com/,"https://aln.youtube-anime.com"),r.includes("/images/mcovers")&&(r=r.replace("/images/mcovers","/mcovers")),r.includes("/images/images2")&&(r=r.replace("/images/images2","/images2"))),r.includes("allanime.day/s4.anilist.co")&&(r=r.replace(/https?:\/\/allanime\.day\/s4\.anilist\.co/,"https://s4.anilist.co")),r.includes("wp.youtube-anime.com/s4.anilist.co")&&(r=r.replace(/https?:\/\/wp\.youtube-anime\.com\/s4\.anilist\.co/,"https://s4.anilist.co"));const i=`${r}-${t}-${n}`;if(ye.has(i))return ye.get(i);let s;if(r.startsWith("https://s4.anilist.co"))s=r,t&&(s+=`${s.includes("?")?"&":"?"}w=${t}`),n&&(s+=`${s.includes("?")?"&":"?"}h=${n}`);else if(r.includes("animepahe")){s=`/api/image-proxy?url=${encodeURIComponent(r)}`;const a=localStorage.getItem("animepahe_cookie"),c=localStorage.getItem("animepahe_ua");a&&(s+=`&cookie=${encodeURIComponent(a)}`),c&&(s+=`&ua=${encodeURIComponent(c)}`)}else if(r.startsWith("http"))s=`/api/image-proxy?url=${encodeURIComponent(r)}`,t&&(s+=`&w=${t}`),n?s+=`&h=${n}`:t||(s+="&w=300");else{const c=`${r.startsWith("mcovers")||r.startsWith("images2")?"https://aln.youtube-anime.com":"https://aln.youtube-anime.com/images"}/${r}`;s=`/api/image-proxy?url=${encodeURIComponent(c)}`,t&&(s+=`&w=${t}`),n?s+=`&h=${n}`:t||(s+="&w=300")}return ye.size>Ro&&ye.clear(),ye.set(i,s),s},Tc=e=>{if(isNaN(e)||e<=0)return"00:00";const t=new Date(e*1e3).toISOString().slice(11,19);return parseInt(t.slice(0,2),10)>0?t:t.slice(3)};function Oc(e){return e?e.replace(/<[^>]*>?/gm,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").trim():""}function Nc(e){return e==null?e:e>10?Number((e/10).toFixed(1)):e}const Gt=ee(void 0),$o=()=>{const e=te(Gt);if(e===void 0)throw new Error("useTitlePreference must be used within a TitlePreferenceProvider");return e},Cc=()=>{const e=x();return z({...e.data.spotlight.queryOptions(),staleTime:1e3*60*5,retry:1})},Ac=(e="TRENDING_DESC",t=10)=>Ge({queryKey:["trendingList",e,t],queryFn:({pageParam:n=1})=>F.data.popularList.query({sort:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),Lc=(e="TV",t=12)=>Ge({queryKey:["latestReleases",e,t],queryFn:({pageParam:n=1})=>F.data.latestReleases.query({format:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),Rc=(e,t="TV",n=!0)=>{const r=x();return z({...r.data.seasonal.queryOptions({page:e,format:t}),enabled:n,staleTime:1e3*60*5})},Do=["query","sortBy","type","status","season","year","country","genres","excludeGenres","excludeTags","minScore","minEpisodes","adult"],qc=(e,t,n=14)=>{const r=x(),i=new URLSearchParams(e),s={page:t,limit:n};for(const a of Do){const c=i.get(a);c!==null&&(s[a]=c)}return z({...r.data.search.queryOptions(s),enabled:e!=null})},$c=()=>{const e=x();return z(e.queue.list.queryOptions())},jo=()=>{const e=x(),t=W();return G(e.queue.add.mutationOptions({onSuccess:n=>{n.queued?b.success("Added to queue"):b.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]})},onError:n=>{b.error(`Failed to update queue: ${n.message}`)}}))},Dc=()=>{const e=x(),t=W();return G(e.queue.remove.mutationOptions({onSuccess:()=>{b.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{b.error(`Failed to remove: ${n.message}`)}}))},jc=(e,t=!0)=>z({queryKey:["queue-remaining",e],queryFn:()=>F.watchlist.queueRemaining.query({showId:e}),enabled:!!e&&t,staleTime:1e3*60}),Mc=()=>{const e=x(),t=W();return G(e.queue.addBatch.mutationOptions({onSuccess:(n,r)=>{const i=n.added??r.episodeNumbers.length;b.success(`${i} ${i===1?"episode":"episodes"} added to queue`),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]})},onError:n=>{b.error(`Failed to update queue: ${n.message}`)}}))},Bc=()=>{const e=x(),t=W();return G(e.queue.removeMany.mutationOptions({onSuccess:()=>{b.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{b.error(`Failed to remove: ${n.message}`)}}))},Fc=()=>{const e=x(),t=W();return G(e.queue.clear.mutationOptions({onSuccess:()=>{b.success("Queue cleared"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{b.error(`Failed to clear queue: ${n.message}`)}}))},Wc=()=>{const e=x(),t=W(),n=e.queue.list.queryOptions().queryKey;return G(e.queue.reorder.mutationOptions({onMutate:async r=>{await t.cancelQueries({queryKey:n});const i=t.getQueryData(n);return t.setQueryData(n,s=>{if(!s)return s;const a=new Map(s.map(c=>[c.id,c]));return r.map((c,l)=>{const u=a.get(c.id??-1);return u?{...u,queue_order:l}:void 0}).filter(c=>!!c)}),{previousQueue:i}},onError:(r,i,s)=>{s?.previousQueue&&t.setQueryData(n,s.previousQueue)},onSettled:()=>{t.invalidateQueries(e.queue.pathFilter())}}))},Mo=["status","showMature","query","type","season","year","genres","excludeGenres","sortBy","titlePreference"];function Xe(e,t,n){const r=new URLSearchParams(e),i={page:t,limit:n};for(const s of Mo){const a=r.get(s);a!==null&&(i[s]=a)}return i}const Kc=(e,t="",n,r=14)=>z({queryKey:["watchlist",e,t,n,r],queryFn:async()=>{const i=new URLSearchParams(t);return i.set("status",e),await F.watchlist.list.query(Xe(i.toString(),n,r))}}),Uc=(e="")=>Ge({queryKey:["allContinueWatching",e],queryFn:async({pageParam:t=1})=>await F.watchlist.continueWatchingAll.query(Xe(e,t,14)),initialPageParam:1,getNextPageParam:t=>{if(!(t.data.length===0||t.page*t.limit>=t.total))return t.page+1},select:t=>({...t,pages:t.pages.flatMap(n=>n.data)})}),zc=(e="",t,n=14)=>z({queryKey:["allContinueWatching",e,t,n],queryFn:async()=>await F.watchlist.continueWatchingAll.query(Xe(e,t,n))}),Qc=()=>{const e=x(),t=W();return G(e.watchlist.remove.mutationOptions({onSuccess:()=>{b.success("Removed from watchlist"),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:["watchlist"]})},onError:n=>{b.error(`Failed to remove: ${n.message}`)}}))},Vc=()=>{const e=x(),t=W();return G(e.watchlist.batchStatus.mutationOptions({onSuccess:n=>{b.success(`Status updated for ${n.updated??0} items`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:["watchlist"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{b.error(`Failed to update statuses: ${n.message}`)}}))},Hc=()=>{const e=x(),t=W();return G(e.watchlist.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;b.success(`Removed ${r} ${r===1?"item":"items"} from watchlist`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:["watchlist"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{b.error(`Failed to remove: ${n.message}`)}}))},Gc=()=>{const e=x(),t=W();return G(e.continueWatching.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;b.success(`Removed ${r} ${r===1?"item":"items"} from continue watching`),t.invalidateQueries(e.continueWatching.pathFilter()),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{b.error(`Failed to remove: ${n.message}`)}}))},Jt=(e=!0)=>{const t=x();return z({...t.notifications.list.queryOptions(),enabled:e,refetchInterval:3e4})},Yt=(e=!0)=>{const t=x();return z({...t.data.systemNotifications.queryOptions(),enabled:e,refetchInterval:3e4})},Zt=(e=!0)=>{const t=x();return z({...t.discovery.status.queryOptions(),enabled:e,refetchInterval:n=>n.state.data?.running?2e3:!1})},Bo=()=>{const e=x(),t=W(),n=e.discovery.status.queryOptions().queryKey;return G(e.discovery.refresh.mutationOptions({onSuccess:r=>{t.setQueryData(n,{running:r.running,state:r.state,total:r.total,done:r.done,lastRunAt:r.lastRunAt}),t.invalidateQueries(e.notifications.pathFilter()),t.invalidateQueries({queryKey:["notifications"]})},onError:()=>{t.invalidateQueries({queryKey:n})}}))},Fo=()=>{const e=x(),t=W();return G(e.notifications.dismiss.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},Wo=()=>{const e=x(),t=W();return G(e.notifications.clearAll.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},Jc=()=>{const e=x();return z({...e.continueWatching.thisWeek.queryOptions(),staleTime:1e3*60*5})},Yc=()=>{const e=x();return z({...e.data.genresAndTags.queryOptions(),staleTime:1e3*60*60})},Zc=()=>z({queryKey:["genreCards"],queryFn:()=>F.insights.genreCards.query()}),Ko="_container_z68uz_1",Uo="_bellBtn_z68uz_7",zo="_badge_z68uz_56",Qo="_dropdown_z68uz_96",Vo="_dropdownHeader_z68uz_127",Ho="_clearAllBtn_z68uz_141",Go="_discoveryStatusRow_z68uz_156",Jo="_statusDot_z68uz_167",Yo="_statusDotRunning_z68uz_174",Zo="_statusDotOk_z68uz_179",Xo="_statusDotInfo_z68uz_183",ei="_statusDotError_z68uz_187",ti="_statusDotIdle_z68uz_191",ni="_list_z68uz_205",ri="_item_z68uz_219",oi="_thumbnail_z68uz_234",ii="_itemInfo_z68uz_243",si="_itemTitle_z68uz_248",ai="_itemMeta_z68uz_259",ci="_systemItemMeta_z68uz_269",li="_removeItem_z68uz_286",ui="_queueItem_z68uz_316",di="_emptyState_z68uz_320",y={container:Ko,bellBtn:Uo,badge:zo,dropdown:Qo,dropdownHeader:Vo,clearAllBtn:Ho,discoveryStatusRow:Go,statusDot:Jo,statusDotRunning:Yo,statusDotOk:Zo,statusDotInfo:Xo,statusDotError:ei,statusDotIdle:ti,list:ni,item:ri,thumbnail:oi,itemInfo:ii,itemTitle:si,itemMeta:ai,systemItemMeta:ci,removeItem:li,queueItem:ui,emptyState:di},mi=({notification:e})=>{const t=Fo(),n=jo(),[r,i]=Ve.useState(!1),s=d=>{d.preventDefault(),d.stopPropagation(),t.mutate({showId:e.showId,episodeNumber:e.episodeNumber})},a=()=>{t.mutate({showId:e.showId,episodeNumber:e.episodeNumber})},c=d=>{d.preventDefault(),d.stopPropagation(),i(!0),n.mutate({showId:e.showId,episodeNumber:e.episodeNumber,showName:e.name,showThumbnail:e.thumbnail,nativeName:e.nativeName,englishName:e.englishName}),t.mutate({showId:e.showId,episodeNumber:e.episodeNumber}),window.setTimeout(()=>i(!1),1e3)},{titlePreference:l}=$o(),u=l==="nativeName"?e.nativeName||e.name:l==="englishName"&&e.englishName||e.name;return o(H,{to:`/watch/${e.showId}/${e.episodeNumber}`,className:y.item,onClick:a,children:[o("img",{src:qo(e.thumbnail,48,64),alt:e.name,className:y.thumbnail,loading:"lazy",decoding:"async"}),o("div",{className:y.itemInfo,children:[o("span",{className:y.itemTitle,children:u}),o("span",{className:y.itemMeta,children:["New Episode ",e.episodeNumber]})]}),o("button",{className:`${y.removeItem} ${y.queueItem}`,onClick:c,"aria-label":"Add notification to queue",children:r?o(v,{name:"check"}):o(v,{name:"plus"})}),o("button",{className:y.removeItem,onClick:s,"aria-label":"Remove notification",children:o(v,{name:"times"})})]})};function je({width:e="100%",height:t="1em",variant:n="rectangular",className:r="",style:i}){return o("div",{className:`skeleton skeleton-${n} ${r}`,style:{width:e,height:t,...i}})}const pi=({count:e=3})=>o(V,{children:Array.from({length:e}).map((t,n)=>o("div",{className:y.item,style:{borderBottom:"1px solid var(--border-primary)",pointerEvents:"none"},children:[o("div",{className:y.thumbnail,style:{overflow:"hidden"},children:o(je,{width:"100%",height:"100%",variant:"rectangular"})}),o("div",{className:y.itemInfo,children:[o(je,{width:"80%",height:"1rem",variant:"text",style:{marginBottom:"4px"}}),o(je,{width:"40%",height:"0.7rem",variant:"rectangular",style:{borderRadius:"var(--radius-sm)"}})]})]},n))}),hi=()=>{const{data:e=[],isLoading:t}=Jt(),{data:n=[]}=Yt(),{data:r}=Zt(),i=Wo(),s=W(),[a,c]=_(null);w(()=>{s.invalidateQueries({queryKey:["notifications"]})},[s]);const l=()=>{i.mutate(void 0)},u=n.find(d=>d.id===a)??null;return o("div",{className:y.dropdown,children:[o("div",{className:y.dropdownHeader,children:[o("h4",{children:"Notifications"}),e.length>0&&o("button",{className:y.clearAllBtn,onClick:l,children:"Clear All"})]}),o("div",{className:y.discoveryStatusRow,children:r?.running?o(V,{children:[o("span",{className:`${y.statusDot} ${y.statusDotRunning}`,"aria-hidden":"true"}),o("span",{children:r.total>0?`Checking ${Math.min(r.done,r.total)}/${r.total} shows...`:"Checking for new episodes..."})]}):r?.state==="complete"?o(V,{children:[o("span",{className:`${y.statusDot} ${y.statusDotOk}`,"aria-hidden":"true"}),o("span",{children:["Discovery complete — checked ",r.total," ",r.total===1?"show":"shows"]})]}):r?.state==="empty"?o(V,{children:[o("span",{className:`${y.statusDot} ${y.statusDotInfo}`,"aria-hidden":"true"}),o("span",{children:"No shows set to Watching — nothing to check"})]}):r?.state==="error"?o(V,{children:[o("span",{className:`${y.statusDot} ${y.statusDotError}`,"aria-hidden":"true"}),o("span",{children:"Last check failed — will retry automatically"})]}):o(V,{children:[o("span",{className:`${y.statusDot} ${y.statusDotIdle}`,"aria-hidden":"true"}),o("span",{children:r?.lastRunAt?`Last checked ${Math.max(1,Math.round((Date.now()-r.lastRunAt)/1e3))}s ago`:"Auto-checks every few minutes"})]})}),o("div",{className:y.list,children:t&&n.length===0?o(pi,{count:4}):o(V,{children:[n.map(d=>o("div",{className:y.item,children:[o("div",{className:y.thumbnail,style:{background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:0,boxShadow:"none"},children:o(v,{name:"info-circle",size:32,color:"#6c9fff"})}),o("div",{className:y.itemInfo,children:[o("span",{className:y.itemTitle,children:d.title}),o("button",{type:"button",className:y.systemItemMeta,onClick:()=>c(d.id),title:"View full status",children:d.message.length>40?d.message.slice(0,40)+"…":d.message})]}),o("button",{className:y.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:o(v,{name:"plus"})}),o("button",{className:y.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:o(v,{name:"times"})})]},d.id)),n.length>0&&e.length>0&&o("div",{className:y.notificationDivider}),e.length>0?e.map(d=>o(mi,{notification:d},d.id)):!t&&n.length===0&&o("div",{className:y.emptyState,children:"No new notifications"})]})}),u&&Nt(o("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,padding:"1rem",backdropFilter:"blur(3px)"},onClick:()=>c(null),children:o("div",{style:{backgroundColor:"var(--bg-secondary)",padding:"1.5rem",borderRadius:"var(--radius-lg)",maxWidth:"420px",width:"100%",boxShadow:"var(--shadow-xl)",border:"1px solid var(--border-primary)"},onClick:d=>d.stopPropagation(),children:[o("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1rem"},children:[o(v,{name:"info-circle",color:"#6c9fff"}),o("span",{style:{color:"#fff",fontWeight:600,fontSize:"1rem"},children:u.title})]}),o("p",{style:{color:"var(--text-secondary)",marginBottom:"1.5rem",lineHeight:1.5},children:u.message}),o("div",{style:{display:"flex",justifyContent:"flex-end"},children:o("button",{type:"button",onClick:()=>c(null),style:{background:"var(--primary-color)",color:"#fff",border:"none",padding:"0.5rem 1rem",borderRadius:"var(--radius-md)",cursor:"pointer",fontWeight:600},children:"OK"})})]})}),document.body)]})},fi=()=>{const[e,t]=_(!1),n=U(null),r=W(),i=x(),s=Bo(),{data:a=[]}=Jt(),{data:c=[]}=Yt(),{data:l}=Zt(),u=a.length+c.length,d=u>5?"5+":u,m=U(!1);w(()=>{const h=f=>{n.current&&!n.current.contains(f.target)&&t(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),w(()=>{const h=!!l?.running;m.current&&!h&&(r.invalidateQueries(i.notifications.pathFilter()),r.invalidateQueries(i.discovery.pathFilter())),m.current=h},[l?.running,r,i]);const p=()=>{const h=!e;t(h),h&&s.mutate()};return o("div",{className:y.container,ref:n,children:[o("button",{className:y.bellBtn,onClick:p,"aria-label":"Notifications",children:[o(v,{name:"bell"}),u>0&&o("span",{className:y.badge,children:d})]}),e&&o(hi,{})]})},Xt=ee(void 0),en=()=>{const e=te(Xt);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Xc=[{id:"iris",label:"Taro (default)",blurb:"Deep purple",swatch:"#7d6df0"},{id:"mochi",label:"Mochi",blurb:"Monochrome pearl",swatch:"#f0f0f0"},{id:"sakura",label:"Sakura",blurb:"Soft pink",swatch:"#e0b0e0"}],yt={iris:"/logo.png",mochi:"/logo-mochi.png",sakura:"/logo-sakura.png"},tn=({className:e})=>{const{theme:t}=en(),n=yt[t]||yt.iris;return o("img",{src:n,alt:"dango",className:e,decoding:"async",style:{height:"var(--logo-height, 75px)",width:"auto",display:"block",objectFit:"contain"}})},nn=ee(void 0),et=()=>{const e=te(nn);if(e===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return e},rn=ee(void 0),on=()=>{const e=te(rn);if(e===void 0)throw new Error("useContentType must be used within a ContentTypeProvider");return e},Qe="virtual-keyboard:hide",vt="virtual-keyboard:enabled-change",sn="virtual_keyboard_enabled",yi=!1;function gt(){const e=localStorage.getItem(sn);return e===null?yi:e==="true"}const bt=e=>e instanceof HTMLInputElement&&e.type==="text"&&!e.disabled&&!e.readOnly;function vi(){window.dispatchEvent(new CustomEvent(Qe))}function gi(){const[e,t]=_(!1),[n,r]=_(gt),i=U(null);return w(()=>{const s=d=>{n&&bt(d.target)&&(i.current=d.target,t(!0))},a=d=>{d.target===i.current&&window.setTimeout(()=>{if(bt(document.activeElement)){i.current=document.activeElement,t(!0);return}i.current=null,t(!1)},0)},c=()=>{i.current=null,t(!1)},l=d=>{if(d.key!==sn)return;const m=d.newValue==="true";r(m),m||c()},u=()=>{const d=gt();r(d),d||c()};return document.addEventListener("focusin",s),document.addEventListener("focusout",a),window.addEventListener(Qe,c),window.addEventListener("storage",l),window.addEventListener(vt,u),()=>{document.removeEventListener("focusin",s),document.removeEventListener("focusout",a),window.removeEventListener(Qe,c),window.removeEventListener("storage",l),window.removeEventListener(vt,u)}},[n]),{activeInputRef:i,isVisible:n&&e,hide:()=>t(!1)}}const bi="_header_rlbx9_1",_i="_hidden_rlbx9_21",wi="_scrolled_rlbx9_25",Si="_logo_rlbx9_31",ki="_headerInner_rlbx9_44",Pi="_leftSection_rlbx9_54",xi="_desktopNav_rlbx9_60",Ei="_navLink_rlbx9_67",Ii="_navLinkActive_rlbx9_83",Ti="_rightSection_rlbx9_102",Oi="_searchWrapper_rlbx9_108",Ni="_searchInput_rlbx9_114",Ci="_searchButton_rlbx9_146",Ai="_searchIcon_rlbx9_170",Li="_profileBtn_rlbx9_180",Ri="_profileImg_rlbx9_213",qi="_hamburgerBtn_rlbx9_219",$i="_mobileSearchBar_rlbx9_247",Di="_mobileSearchInner_rlbx9_283",ji="_mobileSearchIcon_rlbx9_293",Mi="_mobileSearchInput_rlbx9_300",k={header:bi,hidden:_i,scrolled:wi,logo:Si,headerInner:ki,leftSection:Pi,desktopNav:xi,navLink:Ei,navLinkActive:Ii,rightSection:Ti,searchWrapper:Oi,searchInput:Ni,searchButton:Ci,searchIcon:Ai,profileBtn:Li,profileImg:Ri,hamburgerBtn:qi,mobileSearchBar:$i,mobileSearchInner:Di,mobileSearchIcon:ji,mobileSearchInput:Mi},Bi=async()=>{let e;try{e=await F.auth.syncSettings.query()}catch{return null}const t=e.actualActiveProvider;if(t==="github")try{const n=await F.auth.githubStatus.query();if(n.authenticated&&n.user)return{name:n.user.name||n.user.login,picture:n.user.avatarUrl,provider:"github"}}catch{}if(t==="google")try{const n=await F.auth.user.query();if(n)return{name:n.name,picture:n.picture,email:n.email,provider:"google"}}catch{}return null},Fi=()=>{const{toggleSidebar:e}=et(),{contentType:t}=on(),[n,r]=_(""),[i,s]=_(!0),[a,c]=_(!1),[l,u]=_(!0),[d,m]=_(!1),p=Ct(),h=He(),f=U(null),E=U(!1),A=U(null),$=U(null),Q=U(null),{data:g}=z({queryKey:["sync-profile"],queryFn:Bi,staleTime:3e4});w(()=>{const j=()=>{f.current&&(window.clearTimeout(f.current),f.current=null)},oe=()=>{E.current||(E.current=!0,A.current=requestAnimationFrame(()=>{E.current=!1,A.current=null;const Z=window.scrollY<=10;u(fe=>fe===Z?fe:Z),s(fe=>fe||!0),j(),Z||(f.current=window.setTimeout(()=>{s(!1)},2500))}))},rt=Z=>{(Z.metaKey||Z.ctrlKey)&&Z.key==="k"?(Z.preventDefault(),L.current?.focus()):Z.key==="Escape"&&document.activeElement===L.current&&L.current?.blur()};return window.addEventListener("scroll",oe,{passive:!0}),window.addEventListener("keydown",rt),()=>{window.removeEventListener("scroll",oe),window.removeEventListener("keydown",rt),j(),A.current!==null&&(cancelAnimationFrame(A.current),A.current=null),E.current=!1}},[a]);const L=Ve.useRef(null),pe=()=>window.innerWidth<=1024,qe=()=>{pe()?(m(!0),setTimeout(()=>Q.current?.focus(),50)):document.activeElement===L.current&&n.trim()?$e():L.current?.focus()},re=j=>{$.current?.contains(j.relatedTarget)||m(!1)},we=t==="manga"?"Search manga...":t==="tv"?"Search TV & movies...":t==="asmr"?"Search ASMR...":"Search anime...",he=t==="manga"?{to:"/reading-list",label:"Reading List"}:t==="tv"?{to:"/tv-watchlist",label:"TV Watchlist"}:t==="asmr"?{to:"/listening-list",label:"Listening List"}:{to:"/watchlist",label:"Watchlist"},$e=j=>{vi();const oe=n.trim();oe&&p(t==="manga"?`/manga?q=${encodeURIComponent(oe)}`:t==="tv"?`/tv-search?q=${encodeURIComponent(oe)}`:t==="asmr"?`/asmr?q=${encodeURIComponent(oe)}`:`/search?query=${encodeURIComponent(oe)}`)};return o(V,{children:[o("header",{className:`${k.header} ${i?"":k.hidden} ${l?"":k.scrolled}`,children:o("div",{className:k.headerInner,children:[o("div",{className:k.leftSection,children:[o("button",{className:k.hamburgerBtn,onClick:e,"aria-label":"Menu",children:o(v,{name:"bars"})}),o(H,{to:"/",className:k.logo,"aria-label":"Ani-Web Home",children:o(tn,{})}),o("nav",{className:k.desktopNav,children:[o(H,{to:"/",className:`${k.navLink} ${h.pathname==="/"?k.navLinkActive:""}`,children:"Home"}),o(H,{to:he.to,className:`${k.navLink} ${h.pathname.startsWith(he.to)?k.navLinkActive:""}`,children:he.label}),t==="anime"&&o(H,{to:"/insights",className:`${k.navLink} ${h.pathname==="/insights"?k.navLinkActive:""}`,children:"Insights"}),o(H,{to:"/settings",className:`${k.navLink} ${h.pathname.startsWith("/settings")?k.navLinkActive:""}`,children:"Settings"})]})]}),o("div",{className:k.rightSection,children:[o("div",{className:k.searchWrapper,children:[o("input",{ref:L,type:"text","data-virtual-keyboard":"true",className:k.searchInput,placeholder:we,value:n,onChange:j=>r(j.target.value),onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:j=>{j.key==="Enter"&&$e()}}),o("button",{type:"button",className:k.searchButton,"aria-label":"Search",onMouseDown:j=>j.preventDefault(),onClick:qe,children:o(v,{name:"search",className:k.searchIcon})})]}),o(fi,{}),o(H,{to:"/settings?tab=sync",className:k.profileBtn,"aria-label":"Sync settings",children:g?.picture?o("img",{src:g.picture,alt:g.name,className:k.profileImg,referrerPolicy:"no-referrer",decoding:"async"}):g?.provider==="github"?o(v,{name:"github"}):o(v,{name:"cloud"})})]})]})}),d&&o("div",{className:k.mobileSearchBar,ref:$,onBlur:re,children:o("div",{className:k.mobileSearchInner,children:[o(v,{name:"search",className:k.mobileSearchIcon}),o("input",{ref:Q,type:"text","data-virtual-keyboard":"true",className:k.mobileSearchInput,placeholder:we,value:n,onChange:j=>r(j.target.value),onKeyDown:j=>{j.key==="Enter"?($e(),m(!1)):j.key==="Escape"&&m(!1)}})]})})]})},Wi="_sidebar_153jc_1",Ki="_open_153jc_20",Ui="_sidebarHeader_153jc_25",zi="_closeBtn_153jc_33",Qi="_logo_153jc_57",Vi="_navSection_153jc_69",Hi="_navLink_153jc_75",Gi="_active_153jc_108",Ji="_overlay_153jc_118",Yi="_versionInfo_153jc_138",J={sidebar:Wi,open:Ki,sidebarHeader:Ui,closeBtn:zi,logo:Qi,navSection:Vi,navLink:Hi,active:Gi,overlay:Ji,versionInfo:Yi},Zi="dango-client",Xi="3.4.0",es="module",ts={node:">=22.12.0"},ns={start:"vite",dev:"vite",build:"tsc && vite build",lint:"eslint .",test:"vitest run",preview:"vite preview","start:prod":"vite preview",format:"prettier --write ."},rs={"@floating-ui/react":"^0.27.20","@tanstack/react-query":"^5.99.2","@trpc/client":"11.19.0","@trpc/tanstack-react-query":"11.19.0","anime4k-webgpu-async":"^2.0.0","embla-carousel-react":"^8.6.0","hls.js":"^1.5.13",preact:"^10.29.1","react-hot-toast":"^2.6.0","react-router":"^8.3.0","react-simple-maps":"^5.0.3"},os={"@preact/preset-vite":"^2.10.5","@webgpu/types":"^0.1.72","eslint-plugin-react-hooks":"^7.1.1","eslint-plugin-react-refresh":"^0.5.2",vite:"^7.3.1",vitest:"^5.0.0"},tt={name:Zi,private:!0,version:Xi,type:es,engines:ts,scripts:ns,dependencies:rs,devDependencies:os},is=()=>{const{isOpen:e,setIsOpen:t}=et(),{contentType:n}=on(),[r,i]=_(()=>localStorage.getItem("agreedToViewMature")==="true");w(()=>{const d=()=>i(localStorage.getItem("agreedToViewMature")==="true");return window.addEventListener("storage",d),window.addEventListener("focus",d),()=>{window.removeEventListener("storage",d),window.removeEventListener("focus",d)}},[]);const s=()=>{t(!1)},a=n==="manga",c=n==="tv",l=n==="asmr",u=[{to:"/",icon:o(v,{name:"home"}),label:"Home"},a?{to:"/manga",icon:o(v,{name:"book"}),label:"Manga"}:c?{to:"/tv-search",icon:o(v,{name:"tv"}),label:"TV and Movies"}:l?{to:"/asmr",icon:o(v,{name:"headphones"}),label:"ASMR"}:{to:"/search",icon:o(v,{name:"search"}),label:"Search"},a?{to:"/reading-list",icon:o(v,{name:"bookmark"}),label:"Reading List"}:c?{to:"/tv-watchlist",icon:o(v,{name:"clock"}),label:"TV Watchlist"}:l?{to:"/listening-list",icon:o(v,{name:"history"}),label:"Listening List"}:{to:"/watchlist",icon:o(v,{name:"clock"}),label:"Watchlist"},...n==="anime"?[{to:"/insights",icon:o(v,{name:"chart-pie"}),label:"Insights"}]:[],{to:"/trackers",icon:o(v,{name:"sync-alt"}),label:"Trackers"},{to:"/radio",icon:o(v,{name:"broadcast-tower"}),label:"Radio"},{to:"/music",icon:o(v,{name:"headphones"}),label:"Music"},...r?[{to:"/mature",icon:o(v,{name:"pepper-hot"}),label:"Mature"}]:[],{to:"/settings",icon:o(v,{name:"cog"}),label:"Settings"}];return o(V,{children:[o("aside",{className:`${J.sidebar} ${e?J.open:""} sidebar`,children:[o("div",{className:J.sidebarHeader,children:[o("button",{className:J.closeBtn,onClick:()=>t(!1),"aria-label":"Close menu",children:"×"}),o(H,{to:"/",className:J.logo,onClick:s,children:o(tn,{})})]}),o("nav",{className:J.navSection,children:u.map(d=>o(yn,{to:d.to,className:({isActive:m})=>`${J.navLink} ${m?J.active:""}`,onClick:s,end:d.to==="/",children:[d.icon,o("span",{children:d.label})]},d.to))}),o("div",{className:J.versionInfo,children:["v",tt.version]})]}),e&&o("div",{className:J.overlay,onClick:()=>t(!1),"aria-label":"Close sidebar"})]})},ss="_footer_1p5nb_1",as="_footerInner_1p5nb_15",cs="_brandSection_1p5nb_27",ls="_logoRow_1p5nb_39",us="_logoText_1p5nb_59",ds="_brandMeta_1p5nb_65",ms="_brandTagline_1p5nb_74",ps="_statusPill_1p5nb_81",hs="_statusDot_1p5nb_94",fs="_linksGrid_1p5nb_102",ys="_linkColumn_1p5nb_110",vs="_columnTitle_1p5nb_116",gs="_bottomBar_1p5nb_140",bs="_copyright_1p5nb_150",_s="_brand_1p5nb_27",ws="_heartIcon_1p5nb_166",Ss="_backToTop_1p5nb_171",N={footer:ss,footerInner:as,brandSection:cs,logoRow:ls,logoText:us,brandMeta:ds,brandTagline:ms,statusPill:ps,statusDot:hs,linksGrid:fs,linkColumn:ys,columnTitle:vs,bottomBar:gs,copyright:bs,brand:_s,heartIcon:ws,backToTop:Ss},_t={iris:"/logo.png",mochi:"/logo-mochi.png",sakura:"/logo-sakura.png"},ks=()=>{const{theme:e}=en(),t=_t[e]||_t.iris,n=new Date().getFullYear(),r=()=>{window.scrollTo({top:0,behavior:"smooth"})};return o("footer",{className:N.footer,children:[o("div",{className:N.footerInner,children:[o("div",{className:N.brandSection,children:[o("div",{className:N.logoRow,children:o("img",{src:t,className:N.logoText,alt:"dango",loading:"lazy",decoding:"async"})}),o("div",{className:N.brandMeta,children:[o("div",{className:N.statusPill,children:[o("span",{className:N.statusDot}),o("span",{children:["v",tt.version]})]}),o("p",{className:N.brandTagline,children:"Fast, local anime streaming."})]})]}),o("div",{className:N.linksGrid,children:[o("div",{className:N.linkColumn,children:[o("h4",{className:N.columnTitle,children:"Navigation"}),o(H,{to:"/",children:"Home"}),o(H,{to:"/watchlist",children:"Watchlist"}),o(H,{to:"/settings",children:"Settings"})]}),o("div",{className:N.linkColumn,children:[o("h4",{className:N.columnTitle,children:"Features"}),o(H,{to:"/search",children:"Search Anime"}),o(H,{to:"/trackers",children:"Trackers"}),o(H,{to:"/insights",children:"Insights"})]}),o("div",{className:N.linkColumn,children:[o("h4",{className:N.columnTitle,children:"Community"}),o("a",{href:"https://discord.gg/2FTSPXCsvn",target:"_blank",rel:"noopener noreferrer",children:[o(v,{name:"discord",style:{marginRight:"6px"}})," Discord"]}),o("a",{href:"https://github.com/serifpersia/dango",target:"_blank",rel:"noopener noreferrer",children:[o(v,{name:"github",style:{marginRight:"6px"}})," GitHub"]})]}),o("div",{className:N.linkColumn,children:[o("h4",{className:N.columnTitle,children:"Project"}),o("a",{href:"https://github.com/serifpersia/dango/releases",target:"_blank",rel:"noopener noreferrer",children:"Releases"}),o("a",{href:"https://github.com/serifpersia/dango/issues",target:"_blank",rel:"noopener noreferrer",children:"Feedback"})]})]})]}),o("div",{className:N.bottomBar,children:[o("p",{className:N.copyright,children:["© ",n," ",o("span",{className:N.brand,children:"dango"})," • Crafted with"," ",o(v,{name:"heart",className:N.heartIcon})," by"," ",o("a",{href:"https://github.com/serifpersia",target:"_blank",rel:"noopener noreferrer",children:"serifpersia"})]}),o("button",{className:N.backToTop,onClick:r,"aria-label":"Back to top",children:[o(v,{name:"chevron-up",size:14}),o("span",{children:"Top"})]})]})]})},Ps=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2)+Date.now().toString(36),Ne="https://script.google.com/macros/s/AKfycbxpllCbhqNjqFN02er9WV-0Tv-Y9br13UqXZqGHzSMetAgqKaFX5oFKGHgxji1fxJ6udw/exec",xs=()=>{const e=navigator.userAgent;let t="Unknown Browser",n="Unknown OS";return e.includes("Firefox")?t="Firefox":e.includes("SamsungBrowser")?t="Samsung Browser":e.includes("Opera")||e.includes("OPR")?t="Opera":e.includes("Trident")?t="Internet Explorer":e.includes("Edge")?t="Edge":e.includes("Chrome")?t="Chrome":e.includes("Safari")&&(t="Safari"),e.includes("Windows")?n="Windows":e.includes("Mac")?n="MacOS":e.includes("Linux")?n="Linux":e.includes("Android")?n="Android":(e.includes("iPhone")||e.includes("iPad")||e.includes("iPod"))&&(n="iOS"),`${t} on ${n}`},Es=async()=>{localStorage.removeItem("last_telemetry_ping");const e=localStorage.getItem("installation_id");if(e&&Ne)try{await fetch(Ne,{method:"POST",mode:"no-cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"delete"})})}catch(t){console.error("Telemetry delete request failed:",t)}};let Me=!1;const Is=async()=>{if(!Me){Me=!0,localStorage.setItem("last_telemetry_ping",Date.now().toString());try{let e=localStorage.getItem("installation_id");if(!e)try{const t=await F.settings.installationId.query();t.id&&(e=t.id,localStorage.setItem("installation_id",e))}catch(t){console.error("Failed to fetch hardware ID:",t)}e||(e=Ps(),localStorage.setItem("installation_id",e)),await fetch(Ne,{method:"POST",mode:"no-cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,version:tt.version,userAgent:xs(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})})}catch(e){console.error("Telemetry ping failed:",e)}finally{Me=!1}}},Ts=()=>{const[e,t]=_(!1);return w(()=>{if(!localStorage.getItem("telemetry_notice_v2")){const r=setTimeout(()=>t(!0),3e3);return()=>clearTimeout(r)}},[]),w(()=>{if(!(localStorage.getItem("telemetry_enabled")!=="false")||!Ne)return;const r=localStorage.getItem("last_telemetry_ping"),i=Date.now(),s=1440*60*1e3;r&&i-parseInt(r)<s||Is()},[]),{showTelemetryModal:e,setShowTelemetryModal:t}},Os="_overlay_1juub_1",Ns="_fadeIn_1juub_1",Cs="_content_1juub_11",As="_modalIn_1juub_1",Ls="_sm_1juub_29",Rs="_md_1juub_33",qs="_lg_1juub_37",$s="_title_1juub_41",Ds="_body_1juub_48",js="_footer_1juub_52",ue={overlay:Os,fadeIn:Ns,content:Cs,modalIn:As,sm:Ls,md:Rs,lg:qs,title:$s,body:Ds,footer:js};function an({children:e}){return o("h2",{className:ue.title,children:e})}function cn({children:e}){return o("div",{className:ue.body,children:e})}function ln({children:e}){return o("div",{className:ue.footer,children:e})}function me({isOpen:e,onClose:t,title:n,children:r,footer:i,width:s="md"}){const a=U(null);return w(()=>{if(!e)return;const c=u=>{u.key==="Escape"&&t?.()};document.addEventListener("keydown",c);const l=document.body.style.overflow;return document.body.style.overflow="hidden",a.current?.focus(),()=>{document.removeEventListener("keydown",c),document.body.style.overflow=l}},[e,t]),e?Nt(o("div",{role:"presentation",onMouseDown:c=>c.stopPropagation(),children:[o("div",{className:ue.overlay,onClick:()=>t?.(),"aria-hidden":"true"}),o("div",{ref:a,className:`${ue.content} ${ue[s]}`,role:"dialog","aria-modal":"true","aria-label":n,tabIndex:-1,children:[n&&o(an,{children:n}),o(cn,{children:r}),i&&o(ln,{children:i})]})]}),document.body):null}me.Header=an;me.Body=cn;me.Actions=ln;const Ms="_slider_1f1gi_15",wt={switch:"_switch_1f1gi_1",slider:Ms},Bs=({isChecked:e,onChange:t,id:n,disabled:r=!1})=>o("label",{className:wt.switch,htmlFor:n,children:[o("input",{type:"checkbox",id:n,checked:e,onChange:t,disabled:r}),o("span",{className:wt.slider})]}),Fs="_container_1hh92_1",Ws="_description_1hh92_8",Ks="_dataList_1hh92_14",Us="_dataTitle_1hh92_20",zs="_toggleRow_1hh92_39",Qs="_toggleLabel_1hh92_46",Vs="_actions_1hh92_50",Hs="_okButton_1hh92_55",Gs="_previewToggle_1hh92_71",Js="_chevron_1hh92_89",Ys="_chevronOpen_1hh92_94",Zs="_previewBox_1hh92_98",Xs="_previewItem_1hh92_107",ea="_previewKey_1hh92_114",ta="_previewVal_1hh92_118",I={container:Fs,description:Ws,dataList:Ks,dataTitle:Us,toggleRow:zs,toggleLabel:Qs,actions:Vs,okButton:Hs,previewToggle:Gs,chevron:Js,chevronOpen:Ys,previewBox:Zs,previewItem:Xs,previewKey:ea,previewVal:ta},na="3.4.0",ra={version:na},oa=()=>{const e=navigator.userAgent;return e.includes("Firefox")?"Firefox":e.includes("SamsungBrowser")?"Samsung Browser":e.includes("Opera")||e.includes("OPR")?"Opera":e.includes("Edge")?"Edge":e.includes("Chrome")?"Chrome":e.includes("Safari")?"Safari":"Unknown"},ia=()=>{const e=navigator.userAgent;return e.includes("Windows")?"Windows":e.includes("Mac")?"macOS":e.includes("Linux")?"Linux":e.includes("Android")?"Android":e.includes("iPhone")||e.includes("iPad")?"iOS":"Unknown"},sa=({isOpen:e,onClose:t})=>{const[n,r]=_(!0),[i,s]=_(!1),a=()=>{localStorage.setItem("telemetry_enabled",String(n)),localStorage.setItem("telemetry_notice_v2","true"),n||Es(),t()};return o(me,{isOpen:e,onClose:()=>{},title:"Telemetry",children:o("div",{className:I.container,children:[o("p",{className:I.description,children:"Dango collects anonymous usage data to help track how many people use the app. This information is used to measure the project's install base and popularity. Participation is completely optional."}),o("div",{className:I.dataList,children:[o("p",{className:I.dataTitle,children:"What is collected:"}),o("ul",{children:[o("li",{children:"Browser type and operating system"}),o("li",{children:"Your timezone (e.g. Europe/Berlin)"}),o("li",{children:"Anonymous timestamps (first seen / last seen)"})]})]}),o("button",{className:I.previewToggle,onClick:()=>s(!i),children:[o("span",{children:"See exactly what data is sent"}),o(v,{name:"chevron-down",className:`${I.chevron} ${i?I.chevronOpen:""}`})]}),i&&o("div",{className:I.previewBox,children:[o("div",{className:I.previewItem,children:[o("span",{className:I.previewKey,children:"Browser:"}),o("span",{className:I.previewVal,children:oa()})]}),o("div",{className:I.previewItem,children:[o("span",{className:I.previewKey,children:"OS:"}),o("span",{className:I.previewVal,children:ia()})]}),o("div",{className:I.previewItem,children:[o("span",{className:I.previewKey,children:"Timezone:"}),o("span",{className:I.previewVal,children:Intl.DateTimeFormat().resolvedOptions().timeZone})]}),o("div",{className:I.previewItem,children:[o("span",{className:I.previewKey,children:"App Version:"}),o("span",{className:I.previewVal,children:ra.version})]})]}),o("div",{className:I.toggleRow,children:[o("span",{className:I.toggleLabel,children:"Send anonymous telemetry"}),o(Bs,{isChecked:n,onChange:c=>r(c.target.checked),id:"telemetry-notice-toggle"})]}),o("div",{className:I.actions,children:o("button",{className:I.okButton,onClick:a,children:"Ok"})})]})})},aa="_promoWrapper_1vfnt_1",ca="_visible_1vfnt_11",la="_panel_1vfnt_16",ua="_closeBtn_1vfnt_29",da="_header_1vfnt_55",ma="_discordIcon_1vfnt_62",pa="_headerText_1vfnt_74",ha="_body_1vfnt_89",fa="_rolePreview_1vfnt_96",ya="_badge_1vfnt_103",va="_badgeRank_1vfnt_111",ga="_badgeDere_1vfnt_117",ba="_actions_1vfnt_123",_a="_btnJoin_1vfnt_129",wa="_btnSettings_1vfnt_155",Sa="_skipLink_1vfnt_180",ka="_hint_1vfnt_200",C={promoWrapper:aa,visible:ca,panel:la,closeBtn:ua,header:da,discordIcon:ma,headerText:pa,body:ha,rolePreview:fa,badge:ya,badgeRank:va,badgeDere:ga,actions:ba,btnJoin:_a,btnSettings:wa,skipLink:Sa,hint:ka},St="discord_community_promo_dismissed",Pa=4500;function xa({workerUrl:e}){const t=Ct(),[n,r]=_(!1),i=U(!1);w(()=>{if(localStorage.getItem(St)==="true"||localStorage.getItem("dango_discord_user"))return;const c=setTimeout(()=>r(!0),Pa);return()=>clearTimeout(c)},[]);const s=()=>{i.current||(i.current=!0,r(!1),localStorage.setItem(St,"true"))},a=()=>{s(),t("/settings?tab=community")};return e?o("div",{className:`${C.promoWrapper} ${n?C.visible:""}`,"aria-live":"polite",children:o("div",{className:C.panel,children:[o("button",{className:C.closeBtn,onClick:s,"aria-label":"Dismiss",children:"✕"}),o("div",{className:C.header,children:[o("div",{className:C.discordIcon,children:o("svg",{width:"20",height:"16",viewBox:"0 0 71 55",fill:"white","aria-hidden":"true",children:o("path",{d:"M60.1 4.9A58.5 58.5 0 0 0 45.5.3a.22.22 0 0 0-.23.11 40.8 40.8 0 0 0-1.8 3.7 54 54 0 0 0-16.2 0 37.5 37.5 0 0 0-1.83-3.7.23.23 0 0 0-.23-.11A58.3 58.3 0 0 0 10.9 4.9a.2.2 0 0 0-.1.08C1.58 18.73-1 32.23.31 45.55a.24.24 0 0 0 .09.17 58.8 58.8 0 0 0 17.7 8.95.23.23 0 0 0 .25-.08 42 42 0 0 0 3.61-5.88.22.22 0 0 0-.12-.31 38.7 38.7 0 0 1-5.53-2.64.23.23 0 0 1-.02-.37 29 29 0 0 0 1.1-.86.22.22 0 0 1 .23-.03c11.6 5.3 24.14 5.3 35.6 0a.22.22 0 0 1 .23.03c.36.3.73.58 1.1.86a.23.23 0 0 1-.02.37 36.4 36.4 0 0 1-5.53 2.64.22.22 0 0 0-.12.31 47.1 47.1 0 0 0 3.61 5.88.22.22 0 0 0 .25.08 58.6 58.6 0 0 0 17.72-8.95.23.23 0 0 0 .09-.16c1.47-15.27-2.47-28.65-10.46-40.47a.18.18 0 0 0-.09-.09ZM23.73 37.55c-3.49 0-6.37-3.21-6.37-7.15s2.82-7.15 6.37-7.15c3.58 0 6.42 3.24 6.37 7.15 0 3.94-2.82 7.15-6.37 7.15Zm23.54 0c-3.49 0-6.37-3.21-6.37-7.15s2.82-7.15 6.37-7.15c3.58 0 6.42 3.24 6.37 7.15 0 3.94-2.79 7.15-6.37 7.15Z"})})}),o("div",{className:C.headerText,children:[o("h4",{children:"Join the Dango Community"}),o("p",{children:"Earn roles based on your watch stats"})]})]}),o("div",{className:C.body,children:[o("p",{style:{margin:"0 0 6px"},children:"Connect your Discord account and earn exclusive server roles based on how much you watch:"}),o("div",{className:C.rolePreview,children:[o("span",{className:`${C.badge} ${C.badgeRank}`,children:"S-Rank"}),o("span",{className:`${C.badge} ${C.badgeRank}`,children:"F–A Rank"}),o("span",{className:`${C.badge} ${C.badgeDere}`,children:"Tsundere"}),o("span",{className:`${C.badge} ${C.badgeDere}`,children:"Kamidere…"})]})]}),o("div",{className:C.actions,children:[o("a",{className:C.btnJoin,href:"https://discord.gg/6yPAZjDzg8",target:"_blank",rel:"noopener noreferrer",children:[o("svg",{width:"16",height:"12",viewBox:"0 0 71 55",fill:"currentColor","aria-hidden":"true",children:o("path",{d:"M60.1 4.9A58.5 58.5 0 0 0 45.5.3a.22.22 0 0 0-.23.11 40.8 40.8 0 0 0-1.8 3.7 54 54 0 0 0-16.2 0 37.5 37.5 0 0 0-1.83-3.7.23.23 0 0 0-.23-.11A58.3 58.3 0 0 0 10.9 4.9a.2.2 0 0 0-.1.08C1.58 18.73-1 32.23.31 45.55a.24.24 0 0 0 .09.17 58.8 58.8 0 0 0 17.7 8.95.23.23 0 0 0 .25-.08 42 42 0 0 0 3.61-5.88.22.22 0 0 0-.12-.31 38.7 38.7 0 0 1-5.53-2.64.23.23 0 0 1-.02-.37 29 29 0 0 0 1.1-.86.22.22 0 0 1 .23-.03c11.6 5.3 24.14 5.3 35.6 0a.22.22 0 0 1 .23.03c.36.3.73.58 1.1.86a.23.23 0 0 1-.02.37 36.4 36.4 0 0 1-5.53 2.64.22.22 0 0 0-.12.31 47.1 47.1 0 0 0 3.61 5.88.22.22 0 0 0 .25.08 58.6 58.6 0 0 0 17.72-8.95.23.23 0 0 0 .09-.16c1.47-15.27-2.47-28.65-10.46-40.47a.18.18 0 0 0-.09-.09ZM23.73 37.55c-3.49 0-6.37-3.21-6.37-7.15s2.82-7.15 6.37-7.15c3.58 0 6.42 3.24 6.37 7.15 0 3.94-2.82 7.15-6.37 7.15Zm23.54 0c-3.49 0-6.37-3.21-6.37-7.15s2.82-7.15 6.37-7.15c3.58 0 6.42 3.24 6.37 7.15 0 3.94-2.79 7.15-6.37 7.15Z"})}),"Join Discord Server"]}),o("button",{className:C.btnSettings,onClick:a,children:[o("span",{children:"⚙"})," Get Roles & Settings"]})]}),o("button",{className:C.skipLink,onClick:s,children:"Skip — don't show again"}),o("p",{className:C.hint,children:"You can always find this in Settings → Community"})]})}):null}const nt=e=>{const t=x();return z({...t.settings.getByKey.queryOptions({key:e}),select:n=>n.value})},un=()=>{const e=x(),t=W();return G(e.settings.set.mutationOptions({onSuccess:()=>{b.success("Setting updated!"),t.invalidateQueries(e.settings.pathFilter()),t.invalidateQueries({queryKey:["settings"]})},onError:n=>{b.error(`Failed to update setting: ${n.message}`)}}))};function Ea(){const e=He(),{data:t}=nt("discordRPCEnabled"),n=U("");n.current||(n.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`tab-${Date.now()}-${Math.random().toString(36).slice(2)}`),w(()=>{if(t===!1||t==="false")return;const r=n.current,i=()=>F.discord.heartbeat.mutate({sessionId:r}).catch(()=>{});i();const s=setInterval(i,15e3),a=()=>{navigator.sendBeacon("/api/discord/heartbeat",new Blob([JSON.stringify({sessionId:r,bye:!0})],{type:"application/json"}))};return window.addEventListener("pagehide",a),()=>{clearInterval(s),window.removeEventListener("pagehide",a)}},[t]),w(()=>{if(t===!1||t==="false")return;const r=e.pathname;if(r.startsWith("/watch/")||r.startsWith("/player/"))return;let i="home";r.startsWith("/search")||r.startsWith("/mature")?i="search":r.startsWith("/watchlist")?i="watchlist":r.startsWith("/anime/")?i="anime":r.startsWith("/insights")?i="insights":r.startsWith("/settings")?i="settings":r.startsWith("/map")?i="map":r.startsWith("/trackers")?i="trackers":r.startsWith("/asmr")?i="asmr":r.startsWith("/manga")?i="manga":r.startsWith("/radio")?i="radio":r.startsWith("/music")?i="music":r.startsWith("/tv")&&(i="tv"),F.discord.pageStatus.mutate({page:i}).catch(()=>{})},[e.pathname,t])}function dn(e,t){const[n,r]=_(()=>{try{const s=localStorage.getItem(e);if(s===null)return t;if(typeof t=="string")return s;try{return JSON.parse(s)}catch{return s}}catch{return t}});w(()=>{const s=a=>{if(a.key===e)try{if(a.newValue===null){r(t);return}if(typeof t=="string"){r(a.newValue);return}try{r(JSON.parse(a.newValue))}catch{r(a.newValue)}}catch{}};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},[e,t]);const i=K(s=>{r(a=>{const c=typeof s=="function"?s(a):s;try{typeof c=="string"?localStorage.setItem(e,c):localStorage.setItem(e,JSON.stringify(c))}catch{}return c})},[e]);return[n,i]}const mn=ee(void 0),Ia=()=>{const e=te(mn);if(!e)throw new Error("useAnimePaheCookie must be used within an AnimePaheCookieProvider");return e},Ta="_container_e96gf_1",Oa="_field_e96gf_9",Na="_textarea_e96gf_20",Ca="_input_e96gf_40",Aa="_button_e96gf_58",La="_secondaryButton_e96gf_78",Ra="_actions_e96gf_95",qa="_hint_e96gf_104",$a="_link_e96gf_117",M={container:Ta,field:Oa,textarea:Na,input:Ca,button:Aa,secondaryButton:La,actions:Ra,hint:qa,link:$a},Da="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",ja=e=>{try{return JSON.parse(e.detail)}catch{return null}},Ma=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,i]=_(1),[s,a]=_(navigator.userAgent),[c,l]=_(""),[u,d]=_(!1),m=U(null),p=navigator.userAgent,h=/android/i.test(p),f=/firefox|fxios/i.test(p)&&!h,E=!f&&!h&&/chrome|chromium|edg|brave/i.test(p),A=f||E;w(()=>{e&&(i(1),a(navigator.userAgent),l(""),d(!1))},[e]),w(()=>()=>{m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null)},[]);const $=()=>{localStorage.setItem("animepahe_ua",s),window.open("https://animepahe.pw","_blank","noopener,noreferrer"),i(2)},Q=()=>{if(u)return;d(!0);const L=window.setTimeout(()=>{d(!1),m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null),b.error("Helper not detected — install it via about:debugging first.")},3e3),pe=qe=>{window.clearTimeout(L),window.removeEventListener("dango:pahe-cookie",pe),m.current=null,d(!1);const re=ja(qe);if(re?.ok&&re.cookie)l(re.cookie),b.success("Cookie extracted from helper!");else if(re?.error==="NO_COOKIE"){const we=re.debug?.stores?.length??0,he=re.debug?.names??[];b.error(`Helper found no cf_clearance (checked ${we} stores, saw: ${he.join(", ")||"none"}) — solve the challenge on the AnimePahe tab first.`)}else b.error("Helper request failed — try again.")};m.current=pe,window.addEventListener("dango:pahe-cookie",pe),window.dispatchEvent(new CustomEvent("dango:get-pahe-cookie"))},g=()=>{const L=c.trim();if(!L){b.error("Please enter the cf_clearance cookie");return}try{localStorage.setItem("animepahe_cookie",L),b.success("Cookie updated successfully! Reloading…"),n?.(),t(),window.setTimeout(()=>window.location.reload(),1e3)}catch{b.error("Failed to save cookie")}};return o(me,{isOpen:e,onClose:t,title:"AnimePahe Verification Required",children:o("div",{className:M.container,children:r===1?o(V,{children:[o("p",{children:"AnimePahe requires a manual verification to bypass Cloudflare/DDoS-Guard protection."}),o("div",{className:M.field,children:[o("label",{children:"Your User-Agent (will be used for requests):"}),o("textarea",{value:s,readOnly:!0,rows:3,className:M.textarea})]}),o("div",{className:M.actions,children:[o("button",{className:M.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:M.button,onClick:$,children:"Start Verification (Opens AnimePahe)"})]})]}):o(V,{children:[o("p",{children:["1. Solve the challenge on the ",o("strong",{children:"AnimePahe tab"})," (keep that tab open).",o("br",{}),"2. Copy the ",o("strong",{children:"cf_clearance"})," cookie value using one of these:",o("br",{}),o("br",{}),o("strong",{children:"Chrome / Edge — DevTools:"})," press ",o("code",{children:"F12"})," →"," ",o("strong",{children:"Application"})," → ",o("strong",{children:"Cookies"})," →"," ",o("code",{children:"https://animepahe.pw"}),". Find ",o("strong",{children:"cf_clearance"}),", double-click its ",o("strong",{children:"Value"})," to select it, then copy.",o("br",{}),o("br",{}),o("strong",{children:"Firefox — Storage Inspector:"})," press ",o("code",{children:"F12"})," →"," ",o("strong",{children:"Storage"})," → ",o("strong",{children:"Cookies"})," →"," ",o("code",{children:"https://animepahe.pw"}),". Find ",o("strong",{children:"cf_clearance"}),", right-click the value → ",o("strong",{children:"Copy Value"}),".",o("br",{}),o("br",{}),o("strong",{children:"Either browser — extension:"})," open"," ",o("strong",{children:"Cookie Manager"})," while on the AnimePahe tab, find"," ",o("strong",{children:"cf_clearance"}),", and copy its value (or use the extension's export).",o("br",{}),o("br",{}),"3. Paste it below. Copy ",o("strong",{children:"only the value"})," — remove any"," ",o("code",{children:"cf_clearance="})," prefix or quotes if they were included."]}),A&&o("div",{className:M.hint,children:[o("strong",{children:"Dango helper (one-time setup):"})," ",f?o(V,{children:["type ",o("code",{children:"about:debugging"})," in the address bar →"," ",o("strong",{children:"This Firefox"})," → ",o("strong",{children:"Load Temporary Add-on"})," ","→ open the ",o("code",{children:"dango-extension/firefox"})," folder and pick"," ",o("code",{children:"manifest.json"}),". (Temporary helpers unload when Firefox closes — repeat after a restart.)"]}):o(V,{children:["type ",o("code",{children:"chrome://extensions"})," in the address bar → enable"," ",o("strong",{children:"Developer mode"})," → ",o("strong",{children:"Load unpacked"})," → open the ",o("code",{children:"dango-extension/chrome"})," folder. (Unpacked helpers show a developer-mode notice — expected.)"]})," ","Use this link to download the extension and extract it:"," ",o("a",{href:Da,target:"_blank",rel:"noreferrer",className:M.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",o("div",{className:M.actions,children:o("button",{className:M.button,onClick:Q,disabled:u,type:"button",children:u?"Extracting…":"Extract cookie from helper"})})]}),o("div",{className:M.field,children:[o("label",{children:"cf_clearance cookie value:"}),o("input",{type:"text",value:c,onChange:L=>l(L.target.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:M.input})]}),o("div",{className:M.actions,children:[o("button",{className:M.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:M.secondaryButton,onClick:()=>i(1),children:"Back"}),o("button",{className:M.button,onClick:g,children:"Submit"})]})]})})})};function Ba(){const[e,t]=_(!1);return w(()=>{const n=window.setTimeout(()=>t(!0),120);return()=>window.clearTimeout(n)},[]),e?o("div",{className:"top-progress-bar",role:"progressbar","aria-label":"Loading"}):null}class Fa extends vn{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.hasError?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100%",backgroundColor:"#1a1b1c",color:"#fff",textAlign:"center",padding:"2rem"},children:[o(v,{name:"exclamation-triangle",style:{fontSize:"4rem",color:"#ff4d4d",marginBottom:"1rem"}}),o("h1",{style:{marginBottom:"1rem"},children:"Something went wrong"}),o("p",{style:{color:"#aaa",marginBottom:"2rem"},children:"The application encountered an unexpected error."}),o("button",{onClick:()=>{this.setState({hasError:!1}),window.location.href="/"},style:{padding:"0.8rem 1.5rem",backgroundColor:"var(--accent, #3d5afe)",color:"#fff",border:"none",borderRadius:"0.5rem",cursor:"pointer",display:"flex",alignItems:"center",gap:"0.5rem",fontSize:"1rem",transition:"background-color 0.2s"},onMouseOver:t=>t.currentTarget.style.backgroundColor="#536dfe",onMouseOut:t=>t.currentTarget.style.backgroundColor="var(--accent, #3d5afe)",children:[o(v,{name:"home"}),"Go back Home"]})]}):this.props.children}}const pn=ee(void 0),Wa=({children:e})=>{const[t,n]=_(!1),r=K(()=>n(!0),[]),i=K(()=>n(!1),[]);return w(()=>Ht("lan",r),[r]),o(pn.Provider,{value:{isOpen:t,openModal:r,closeModal:i},children:e})},Ka=()=>{const e=te(pn);if(!e)throw new Error("useLanAuth must be used within a LanAuthProvider");return e},Ua="_container_88bss_1",za="_field_88bss_8",Qa="_input_88bss_19",Va="_actions_88bss_37",Pe={container:Ua,field:za,input:Qa,actions:Va},kt=gn(({variant:e="primary",size:t="md",loading:n,children:r,className:i="",disabled:s,...a},c)=>{const l=["btn",`btn-${e}`,t!=="md"&&`btn-${t}`,n&&"btn-loading",i].filter(Boolean).join(" ");return o("button",{className:l,disabled:s||n,ref:c,...a,children:n?o("span",{className:"btn-spinner"}):r})}),Ha=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,i]=_(""),[s,a]=_(!1);Ve.useEffect(()=>{e&&i("")},[e]);const c=async()=>{if(!r){b.error("Please enter your password");return}a(!0);try{const l=await fetch("/api/auth/app-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:r})}),u=await l.json().catch(()=>({}));if(!l.ok){b.error(u.error||"Login failed");return}b.success("Authenticated successfully"),n(),t(),window.location.reload()}catch{b.error("Network error")}finally{a(!1)}};return o(me,{isOpen:e,onClose:t,title:"LAN Authentication Required",children:o("div",{className:Pe.container,children:[o("p",{children:"This instance is protected. Enter the password to access from this device."}),o("div",{className:Pe.field,children:[o("label",{htmlFor:"lan-password",children:"Password"}),o("input",{id:"lan-password",type:"password",value:r,onChange:l=>i(l.target.value),placeholder:"Enter password...",className:Pe.input,onKeyDown:l=>l.key==="Enter"&&c()})]}),o("div",{className:Pe.actions,children:[o(kt,{variant:"secondary",onClick:t,disabled:s,children:"Cancel"}),o(kt,{variant:"primary",onClick:c,loading:s,children:"Unlock"})]})]})})},Ga=T(()=>O(()=>import("./Home-rrhOGQcg.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]))),Ja=T(()=>O(()=>import("./Watchlist-mj8mTOam.js"),__vite__mapDeps([30,1,2,4,6,7,8,9,10,11,12,13,3,5,14,15,31,32]))),Ya=T(()=>O(()=>import("./Settings-CluUYs8U.js"),__vite__mapDeps([33,1,2,4,34]))),Pt=T(()=>O(()=>import("./Player-BYtEax_z.js"),__vite__mapDeps([35,1,2,36,4,22,37,38,23,12,17,18,8,9,10,39,40,41,42,43]))),Za=T(()=>O(()=>import("./Search-C2wrWOdy.js"),__vite__mapDeps([44,1,4,3,5,6,7,2,8,9,10,11,12,13,14,15,45,46]))),Xa=T(()=>O(()=>import("./Mature-CHt_-Hz5.js"),__vite__mapDeps([47,1,2,4,3,5,6,7,8,9,10,11,12,13,14,15,23,22,45,46,48]))),xt=T(()=>O(()=>import("./Asmr--Zc8G9zv.js"),__vite__mapDeps([49,1,4,2,11,9,12,13,28,50,51,52,38]))),ec=T(()=>O(()=>import("./Manga-D8CT9aO0.js"),__vite__mapDeps([53,1,4,14,15,11,9,12,13,19,20,2,22,54,55]))),tc=T(()=>O(()=>import("./MangaInfoPage-DGK6CYp1.js"),__vite__mapDeps([56,1,4,14,15,20,2,54,55]))),nc=T(()=>O(()=>import("./MangaReadPage-B9XoDKF9.js"),__vite__mapDeps([57,1,14,4,15,2,20,54,55]))),rc=T(()=>O(()=>import("./ReadingList-n6rr8ygy.js"),__vite__mapDeps([58,1,11,9,4,12,13,59,3,5,14,15,31,32,19,20,2,21,16]))),oc=T(()=>O(()=>import("./Radio-DPZxQnyD.js"),__vite__mapDeps([60,1,4,2,50,51,61,62]))),ic=T(()=>O(()=>import("./Music-HeLrEZ2d.js"),__vite__mapDeps([63,1,4,50,51,61,62,2,64]))),Et=T(()=>O(()=>import("./TvSearch-DuqR-z3v.js"),__vite__mapDeps([65,1,4,3,5,24,11,9,12,13,25,26,2,14,15,45,46]))),sc=T(()=>O(()=>import("./TvInfo-CXnrLekr.js"),__vite__mapDeps([66,1,4,23,26,2,67]))),ac=T(()=>O(()=>import("./Tv-BwHlDdi8.js"),__vite__mapDeps([68,1,2,4,36,22,37,69,23,26,38,12,41,42,70]))),cc=T(()=>O(()=>import("./TvWatchlist-CBvgFrA0.js"),__vite__mapDeps([71,1,11,9,4,12,13,59,3,5,14,15,31,32,16,25,26,2]))),lc=T(()=>O(()=>import("./ListeningList-DYcQnnsG.js"),__vite__mapDeps([72,1,11,9,4,12,13,59,3,5,14,15,31,32,52,28,2,50,51,27,16]))),uc=T(()=>O(()=>import("./Trackers-CTGPxs0V.js"),__vite__mapDeps([73,1,2,4,74]))),dc=T(()=>O(()=>import("./Insights-Bay90Yeg.js"),__vite__mapDeps([75,1,2,4,76]))),mc=T(()=>O(()=>import("./Map-Dj51g5zL.js"),__vite__mapDeps([77,1,4,78]))),pc=T(()=>O(()=>import("./AnimeInfoPage-BxbA_7AV.js"),__vite__mapDeps([79,1,2,4]))),hc=T(()=>O(()=>import("./PlayerRedirect-D70t8VUW.js"),__vite__mapDeps([80,1]))),fc=T(()=>O(()=>import("./VirtualKeyboard-6ZNTym4R.js"),__vite__mapDeps([81,1,82])));function yc(){const{isOpen:e,closeModal:t,onSuccess:n}=Ia(),{isOpen:r,setIsOpen:i}=et(),{isOpen:s,openModal:a,closeModal:c}=Ka(),l=He(),u=gi(),{showTelemetryModal:d,setShowTelemetryModal:m}=Ts();Ea();const[p,h]=_("");w(()=>{F.discord.rolesConfig.query().then(g=>{g.workerUrl&&h(g.workerUrl)}).catch(()=>{})},[]);const[f,E]=_(!1);w(()=>{fetch("/api/auth/app-status").then(g=>g.json()).then(g=>{g.hasPassword&&!g.isAuthenticated&&(E(!0),a())}).catch(()=>{})},[a]);const[A,$]=dn("lan_auth_notice_shown","false"),Q=U(!1);return w(()=>{if(A==="true"||Q.current)return;Q.current=!0,$("true");const g=setTimeout(()=>{b("Optional LAN lock is available. Set a password in Settings to protect access from other devices on your network.",{duration:1e4,icon:"🔒"})},3e3);return()=>clearTimeout(g)},[A,$]),w(()=>{window.scrollTo(0,0)},[l.pathname]),w(()=>{const g=L=>{r&&L.key==="Escape"&&i(!1)};return r?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open"),window.addEventListener("keydown",g),()=>{window.removeEventListener("keydown",g),document.body.classList.remove("sidebar-open")}},[r,i]),o("div",{className:"app-container",children:[o(Ma,{isOpen:e,onClose:t,onSuccess:n}),o(sa,{isOpen:d,onClose:()=>m(!1)}),o(Ha,{isOpen:s,onClose:f?()=>{}:c,onSuccess:()=>{E(!1),c()}}),p&&o(xa,{workerUrl:p}),o(fr,{position:"top-center",toastOptions:{style:{background:"var(--bg-elevated)",color:"var(--text-primary)",border:"1px solid var(--border-primary)"},success:{style:{background:"var(--accent)",color:"var(--accent-text)"},iconTheme:{primary:"var(--accent-text)",secondary:"var(--accent)"}},error:{style:{background:"rgba(153, 42, 42, 0.95)",color:"#fff"}}}}),o(Fi,{}),o(is,{}),o("main",{className:"main-content",children:o(Fa,{children:o(ot,{fallback:o(Ba,{}),children:o(bn,{children:[o(S,{path:"/",element:o(Ga,{})}),o(S,{path:"/watchlist/:filter?",element:o(Ja,{})}),o(S,{path:"/reading-list/:filter?",element:o(rc,{})}),o(S,{path:"/search",element:o(Za,{})}),o(S,{path:"/mature",element:o(Xa,{})}),o(S,{path:"/asmr",element:o(xt,{})}),o(S,{path:"/asmr/:rj",element:o(xt,{})}),o(S,{path:"/manga",element:o(ec,{})}),o(S,{path:"/manga/:provider/:id",element:o(tc,{})}),o(S,{path:"/manga/:provider/:id/read",element:o(nc,{})}),o(S,{path:"/radio",element:o(oc,{})}),o(S,{path:"/music",element:o(ic,{})}),o(S,{path:"/tv",element:o(Et,{})}),o(S,{path:"/tv/:id",element:o(sc,{})}),o(S,{path:"/tv/:id/watch",element:o(ac,{})}),o(S,{path:"/tv-search",element:o(Et,{})}),o(S,{path:"/tv-watchlist/:filter?",element:o(cc,{})}),o(S,{path:"/listening-list/:filter?",element:o(lc,{})}),o(S,{path:"/settings",element:o(Ya,{})}),o(S,{path:"/trackers",element:o(uc,{})}),o(S,{path:"/mal",element:o(it,{to:"/trackers",replace:!0})}),o(S,{path:"/insights",element:o(dc,{})}),o(S,{path:"/map",element:o(mc,{})}),o(S,{path:"/anime/:id",element:o(pc,{})}),o(S,{path:"/watch/:id",element:o(Pt,{})}),o(S,{path:"/watch/:id/:episodeNumber",element:o(Pt,{})}),o(S,{path:"/player/:id/:episodeNumber?",element:o(hc,{})}),o(S,{path:"*",element:o(it,{to:"/",replace:!0})})]})})})}),o(ks,{}),u.isVisible&&o(ot,{fallback:null,children:o(fc,{activeInputRef:u.activeInputRef,isVisible:u.isVisible,onClose:u.hide})})]})}function vc(){return o(Wa,{children:o(yc,{})})}const gc=({children:e})=>{const[t,n]=_(!1),r=K(()=>{n(s=>!s)},[]),i=de(()=>({isOpen:t,setIsOpen:n,toggleSidebar:r}),[t,r]);return o(nn.Provider,{value:i,children:e})},bc=({children:e})=>{const[t,n]=dn("dango_content_type","anime"),r=de(()=>({contentType:t,setContentType:n}),[t,n]);return o(rn.Provider,{value:r,children:e})},_c=({children:e})=>{const[t,n]=_("englishName"),[r,i]=_(!0);w(()=>{(async()=>{try{const c=await F.settings.getByKey.query({key:"titlePreference"});c.value&&n(c.value)}catch(c){console.error("Error fetching title preference in context:",c)}finally{i(!1)}})()},[]);const s=de(()=>({titlePreference:t,setTitlePreference:n,loading:r}),[t,r]);return o(Gt.Provider,{value:s,children:e})},hn=ee(void 0),el=()=>{const e=te(hn);if(e===void 0)throw new Error("useLowEndMode must be used within a LowEndModeProvider");return e},wc=({children:e})=>{const{data:t,isLoading:n}=nt("lowEndMode"),r=un(),[i,s]=_(!1);w(()=>{t!==void 0&&s(t==="true"||t===!0)},[t]),w(()=>{i?document.body.classList.add("low-end"):document.body.classList.remove("low-end")},[i]);const a=K(l=>{s(l),r.mutate({key:"lowEndMode",value:String(l)})},[r]),c=de(()=>({lowEndMode:i,setLowEndMode:a,loading:n}),[i,a,n]);return o(hn.Provider,{value:c,children:e})},Sc=["iris","mochi","sakura"];function It(e){e==="iris"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const kc=({children:e})=>{const{data:t,isLoading:n}=nt("theme"),r=un(),[i,s]=_("iris");w(()=>{typeof t=="string"&&Sc.includes(t)&&s(t)},[t]),w(()=>{It(i)},[i]);const a=K(l=>{l!==i&&(s(l),It(l),r.mutate({key:"theme",value:l}))},[r,i]),c=de(()=>({theme:i,setTheme:a,loading:n}),[i,a,n]);return o(Xt.Provider,{value:c,children:e})},Pc=({children:e})=>{const[t,n]=_(!1),[r,i]=_(void 0),s=K(c=>{i(()=>c),n(!0)},[]),a=K(()=>{n(!1),i(void 0)},[]);return w(()=>Ht("animepahe",()=>s()),[s]),o(mn.Provider,{value:{isOpen:t,openModal:s,closeModal:a,onSuccess:r},children:e})},Tt=new Pn({defaultOptions:{queries:{staleTime:1e3*60*5,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,retry:1}}}),Ot=document.getElementById("root");Ot&&_n(o(wn,{children:o(Lo,{trpcClient:F,queryClient:Tt,children:o(xn,{client:Tt,children:o(Pc,{children:o(gc,{children:o(bc,{children:o(_c,{children:o(wc,{children:o(kc,{children:o(vc,{})})})})})})})})})}),Ot);export{Ba as $,Hc as A,kt as B,Gc as C,Vc as D,R as E,en as F,Xc as G,gt as H,ra as I,xs as J,vt as K,Is as L,me as M,Es as N,Nc as O,Ma as P,qc as Q,vi as R,je as S,Bs as T,M as U,sn as V,Ht as W,ze as X,et as Y,Zc as Z,O as _,dn as a,Mc as a0,Bc as a1,jc as a2,Ac as b,Lc as c,$o as d,Tc as e,qo as f,x as g,Rc as h,on as i,Qc as j,$c as k,Dc as l,Fc as m,Wc as n,Jc as o,Uc as p,Cc as q,Yc as r,Oc as s,F as t,el as u,zc as v,Kc as w,nt as x,un as y,b as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as g}from"./vendor-core-8R2fFbyN.js";import{u as p,b as q,a as M}from"./vendor-query-BUTye89G.js";import{g as v,z as h,t as y}from"./index-BXwhFWB_.js";import{u as Q}from"./QueueOptionsButton-Ba0dg_82.js";function b(t){const s=p(),c=v(),{data:i,isLoading:w,error:u}=Q(t),n=c.watchlist.check.queryOptions({showId:t??""}).queryKey,{data:d}=q({...c.watchlist.check.queryOptions({showId:t??""}),enabled:!!t}),r=d?.inWatchlist??!1,{mutateAsync:l}=M({mutationFn:async({wasIn:e,meta:a})=>{if(!t)throw new Error("Missing showId");if(e)await y.watchlist.remove.mutate({id:t});else{const o=a?.names,m=a?.name||o?.romaji;if(!m)throw new Error("Missing show name");await y.watchlist.add.mutate({id:t,name:m,thumbnail:a?.thumbnail,nativeName:o?.native,englishName:o?.english,type:a?.type,isAdult:a?.isAdult})}return!e},onMutate:async({wasIn:e})=>{await s.cancelQueries({queryKey:n}),s.setQueryData(n,a=>({...a,inWatchlist:!e}))},onError:e=>{s.invalidateQueries({queryKey:n}),h.error(e instanceof Error?e.message:"Failed to update watchlist")},onSuccess:e=>{h.success(e?"Added to watchlist":"Removed from watchlist"),s.invalidateQueries({queryKey:["watchlist"]})}}),f=g(async()=>{!t||!i||await l({wasIn:r,meta:i})},[t,i,r,l]);return{showMeta:i,inWatchlist:r,loadingMeta:w,error:u?u.message:null,toggleWatchlist:f}}export{b as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{T as E}from"./vendor-core-8R2fFbyN.js";import{b as y,u as l,a as d,e as F}from"./vendor-query-BUTye89G.js";import{g as n,z as a,t as v}from"./index-BXwhFWB_.js";function K(r){return String(r||"").trim().toUpperCase()}function M(r){return K(r.id||r._id||"")}function N(r){return!!r.isAdult}const D=["Listening","Completed","On-Hold","Dropped","Planned"],P=r=>K(r),G=(r="All",e=1,s=24)=>{const t=n();return y(t.asmrLibrary.list.queryOptions({status:r,page:e,limit:s}))},_=()=>{const r=n();return y({...r.asmrLibrary.ids.queryOptions(),staleTime:1e3*60})},H=r=>{const e=n();return y({...e.asmrLibrary.check.queryOptions({id:r||""}),enabled:!!r,staleTime:1e3*60})},U=(r=24)=>{const e=n();return y(e.asmrProgress.continueListening.queryOptions({limit:r}))},W=r=>{const e=n();return y({...e.asmrProgress.getByWork.queryOptions({workId:r||""}),enabled:!!r})},C=()=>{const r=n(),e=l();return d({mutationFn:async s=>{const{silent:t,...m}=s;return v.asmrLibrary.add.mutate(m)},onSuccess:(s,t)=>{t.silent||a.success("Added to listening list"),e.invalidateQueries({queryKey:["asmr-library"]}),e.invalidateQueries({queryKey:["asmr-library-ids"]}),e.invalidateQueries({queryKey:["asmr-library-check",P(t.rjCode)]}),e.invalidateQueries(r.asmrLibrary.pathFilter())},onError:s=>{a.error(`Failed to add: ${s.message}`)}})},O=()=>{const r=n(),e=l();return d(r.asmrLibrary.remove.mutationOptions({onSuccess:(s,t)=>{a.success("Removed from listening list"),e.invalidateQueries({queryKey:["asmr-library"]}),e.invalidateQueries({queryKey:["asmr-library-ids"]}),e.invalidateQueries({queryKey:["asmr-continue-listening"]}),e.invalidateQueries({queryKey:["asmr-library-check",t.id]}),e.invalidateQueries(r.asmrLibrary.pathFilter()),e.invalidateQueries(r.asmrProgress.pathFilter())},onError:s=>{a.error(`Failed to remove: ${s.message}`)}}))},x=()=>{const r=n(),e=l();return d(r.asmrLibrary.setStatus.mutationOptions({onSuccess:()=>{a.success("Status updated"),e.invalidateQueries({queryKey:["asmr-library"]}),e.invalidateQueries({queryKey:["asmr-continue-listening"]}),e.invalidateQueries(r.asmrLibrary.pathFilter()),e.invalidateQueries(r.asmrProgress.pathFilter())},onError:s=>{a.error(`Failed to update status: ${s.message}`)}}))},j=()=>{const r=n(),e=l();return d(r.asmrProgress.save.mutationOptions({onSuccess:(s,t)=>{e.invalidateQueries({queryKey:["asmr-progress",t.workId]}),e.invalidateQueries({queryKey:["asmr-continue-listening"]}),e.invalidateQueries({queryKey:["asmr-library"]}),e.invalidateQueries({queryKey:["asmr-library-ids"]}),e.invalidateQueries(r.asmrLibrary.pathFilter()),e.invalidateQueries(r.asmrProgress.pathFilter())}}))},z=()=>{const r=n(),e=l();return d(r.asmrProgress.remove.mutationOptions({onSuccess:()=>{a.success("Progress reset"),e.invalidateQueries({queryKey:["asmr-progress"]}),e.invalidateQueries({queryKey:["asmr-continue-listening"]}),e.invalidateQueries({queryKey:["asmr-library"]}),e.invalidateQueries(r.asmrLibrary.pathFilter()),e.invalidateQueries(r.asmrProgress.pathFilter())},onError:s=>{a.error(`Failed to reset progress: ${s.message}`)}}))},Y=()=>{const r=n(),e=l();return d(r.asmrLibrary.batchStatus.mutationOptions({onSuccess:s=>{a.success(`Status updated for ${s.updated??0} items`),e.invalidateQueries({queryKey:["asmr-library"]}),e.invalidateQueries({queryKey:["asmr-continue-listening"]}),e.invalidateQueries(r.asmrLibrary.pathFilter()),e.invalidateQueries(r.asmrProgress.pathFilter())},onError:s=>{a.error(`Failed to update statuses: ${s.message}`)}}))},J=()=>{const r=n(),e=l();return d(r.asmrLibrary.removeMany.mutationOptions({onSuccess:s=>{const t=s.removed??0;a.success(`Removed ${t} ${t===1?"item":"items"} from listening list`),e.invalidateQueries({queryKey:["asmr-library"]}),e.invalidateQueries({queryKey:["asmr-library-ids"]}),e.invalidateQueries({queryKey:["asmr-continue-listening"]}),e.invalidateQueries(r.asmrLibrary.pathFilter()),e.invalidateQueries(r.asmrProgress.pathFilter())},onError:s=>{a.error(`Failed to remove: ${s.message}`)}}))},V=()=>{const r=n(),e=l();return d(r.asmrProgress.removeMany.mutationOptions({onSuccess:s=>{const t=s.removed??0;a.success(`Reset progress for ${t} ${t===1?"item":"items"}`),e.invalidateQueries({queryKey:["asmr-progress"]}),e.invalidateQueries({queryKey:["asmr-continue-listening"]}),e.invalidateQueries({queryKey:["asmr-library"]}),e.invalidateQueries(r.asmrLibrary.pathFilter()),e.invalidateQueries(r.asmrProgress.pathFilter())},onError:s=>{a.error(`Failed to reset progress: ${s.message}`)}}))},X=()=>{const r=C(),e=O(),{data:s}=_(),t=E(()=>new Set(s?.ids||[]),[s]);return{toggle:i=>{const o=P(i.rjCode);t.has(o)?e.mutate({id:o}):r.mutate({...i,thumbnail:i.thumbnail||""})},bookmarkedIds:t,pending:r.isPending||e.isPending}},h=300*1e3,A=15,Z=(r,e,s,t)=>{const m=e+1,i=F({queries:Array.from({length:m},(u,w)=>{const L=w+1;return{queryKey:["asmrBrowse",r,L,s,t],queryFn:()=>{const k=r.trim();return v.asmr.browse.query({q:k||void 0,page:L,sort:s&&s!=="latest"?s:void 0,rating:t||void 0})},staleTime:h}})}),o=i.flatMap(u=>u.data?.shows??[]),q=o.slice((e-1)*A,e*A),g=i[i.length-1]?.data,b=!!(g&&(g.hasNext||o.length>e*A)),Q=i.some(u=>u.isLoading),c=i.some(u=>u.isFetching),f=i.some(u=>u.isError);return{data:{shows:q,hasNext:b},isLoading:Q,isError:f,isFetching:c}},ee=r=>y({queryKey:["asmrWork",r],queryFn:()=>v.asmr.work.query({rj:r}),enabled:!!r,staleTime:h,refetchOnMount:"always"}),T=15,p=6;function B(r){if(r.isAdult||!r.thumbnail)return!1;const e=(r.rating||"").toLowerCase();return e===""||e==="sfw"}function S(r,e){const s=new Set,t=[];for(const m of r)for(const i of m){if(t.length>=e)return t;const o=i.id||i._id;!o||s.has(o)||(s.add(o),B(i)&&t.push(i))}return t}const re=(r=!0)=>{const e=F({queries:Array.from({length:T},(c,f)=>{const u=f+1;return{queryKey:["asmrBrowse","",u,"popular_month",""],queryFn:()=>v.asmr.browse.query({page:u,sort:"popular_month"}),staleTime:h,enabled:r,retry:1}})}),s=e.map(c=>c.data?.shows??[]),t=S(s,p),m=e.every(c=>c.isFetched),i=r&&m&&t.length<p,o=y({queryKey:["asmrBrowse","",1,"popular","sfw"],queryFn:()=>v.asmr.browse.query({page:1,sort:"popular",rating:"sfw"}),staleTime:h,enabled:i,retry:1}),q=o.data?.shows??[],g=t.length>=p?t.slice(0,p):S([t,q],p),b=r&&(e.some(c=>c.isLoading)||i&&o.isLoading),Q=r&&m&&g.length===0&&e.some(c=>c.isError);return{data:g,isLoading:b,isError:Q}};export{D as A,M as a,re as b,ee as c,H as d,X as e,W as f,K as g,j as h,C as i,Z as j,P as k,N as l,G as m,O as n,x as o,Y as p,J as q,V as r,z as s,U as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e,S as y,L as g,d as k,A as L,q as r}from"./vendor-core-8R2fFbyN.js";import{I as a}from"./vendor-icons-CDMuNDeL.js";import{c as P}from"./useAsmr-
|
|
1
|
+
import{u as e,S as y,L as g,d as k,A as L,q as r}from"./vendor-core-8R2fFbyN.js";import{I as a}from"./vendor-icons-CDMuNDeL.js";import{c as P}from"./useAsmr-DIwIsJXF.js";import{p as s,a as f}from"./MediaCard-B5584Cq9.js";import{a as A}from"./Asmr.module-ChUXDZKx.js";const B=({data:n,anchorRect:l,bookmarked:i,onToggleBookmark:c,onMouseEnter:o,onMouseLeave:m,onRequestClose:p})=>{const{data:t,isLoading:d}=P(n.rjCode||null),u=t?.tracks.length??0,N=u>0,h=!d;return e(f,{anchorRect:l,onMouseEnter:o,onMouseLeave:m,onRequestClose:p,children:[e("div",{className:s.header,children:[n.thumbnail&&e("img",{src:n.thumbnail,alt:n.title,loading:"lazy",decoding:"async",className:A.popupCover}),e("div",{className:s.title,children:n.title}),e("div",{className:s.synopsis,children:n.rjCode})]}),e("div",{className:s.body,children:[e("div",{className:s.metaRow,children:[e("div",{className:s.metaItem,children:[e(a,{name:"headphones",size:14}),e("span",{children:h?N?e(y,{children:[u," track",u===1?"":"s"]}):"No tracks":"Loading tracks…"})]}),n.rating&&e("div",{className:s.metaItem,children:e("span",{children:n.rating.toUpperCase()})}),n.isAdult&&e("div",{className:s.metaItem,children:e("span",{children:"18+"})}),n.progressLabel&&e("div",{className:s.metaItem,children:[e(a,{name:"bookmark",size:12}),e("span",{children:n.progressLabel})]})]}),e("div",{className:s.synopsis,children:!h&&!t?.description?"Loading description…":t?.description??"No description available."})]}),e("div",{className:s.footer,children:[e("div",{className:s.primaryAction,children:N?e(g,{to:n.listenTarget,className:s.watchBtn,children:[e(a,{name:"play",size:14}),"Listen now"]}):e("span",{className:s.watchBtn,"aria-disabled":"true",style:{opacity:.5,pointerEvents:"none"},children:[e(a,{name:"play",size:14}),h?"No tracks":"Loading…"]})}),e("div",{className:s.secondaryActions,children:[e("button",{className:`${s.watchlistBtn} ${i?s.active:""}`,onClick:v=>{v.preventDefault(),v.stopPropagation(),c()},children:[i?e(a,{name:"check",size:12}):e(a,{name:"plus",size:12}),e("span",{children:i?"Remove":"Bookmark"})]}),e(g,{to:n.listenTarget,className:s.detailsBtn,children:"Details"})]})]})]})},C=300;function D(){const[n,l]=k(null),i=L(null),c=r(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]),o=r((t,d)=>{c(),l({data:d,rect:t})},[c]),m=r(()=>{c(),i.current=setTimeout(()=>{i.current=null,l(null)},C)},[c]),p=r(()=>{c(),l(null)},[c]);return{popup:n,openPopup:o,scheduleClose:m,cancelClose:c,closePopup:p}}export{B as A,D as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as u,c as Q,u as g,a as c}from"./vendor-query-BUTye89G.js";import{t as v,g as s,z as i}from"./index-BXwhFWB_.js";import{T as K}from"./vendor-core-8R2fFbyN.js";const p=300*1e3,h={mangadex:"https://mangadex.org/",mangapill:"https://www.mangapill.com/"},M=(a,e)=>`/api/proxy?url=${encodeURIComponent(e)}&referer=${encodeURIComponent(h[a])}`,C=(a,e)=>e&&(a==="mangapill"?M(a,e):e),T=(a,e=!0)=>{const{provider:r,query:n,page:o,sort:t,status:d,type:m,rating:y,mature:l}=a;return u({queryKey:["mangaBrowse",r,n,o,t,d,m,y,l],queryFn:()=>v.manga.search.query({provider:r,q:n.trim()||void 0,page:o,sort:t||void 0,status:d||void 0,type:m||void 0,rating:y||void 0,mature:l?"1":void 0}),staleTime:p,enabled:e&&!!r})},E=(a,e=14)=>{const{provider:r,query:n,sort:o,status:t,type:d,rating:m,mature:y}=a;return Q({queryKey:["mangaBrowseInfinite",r,n,o,t,d,m,y,e],queryFn:({pageParam:l=1})=>v.manga.search.query({provider:r,q:n.trim()||void 0,page:l,limit:e,sort:o||void 0,status:t||void 0,type:d||void 0,rating:m||void 0,mature:y?"1":void 0}),initialPageParam:1,getNextPageParam:(l,b)=>l.hasNext?b.length+1:void 0,staleTime:p,enabled:!!r})},O=(a,e,r="safe",n=!1)=>u({queryKey:["mangaDetail",a,e,r,n],queryFn:()=>v.manga.info.query({provider:a||"",id:e||"",rating:r,mature:n?"1":void 0}),enabled:!!a&&!!e,staleTime:p}),$=(a,e,r)=>u({queryKey:["mangaPages",a,e],queryFn:()=>v.manga.pages.query({provider:a||"",id:e||""}),enabled:!!a&&!!e,staleTime:1800*1e3}),B=()=>{const a=s();return u({...a.manga.trending.queryOptions(),staleTime:600*1e3,retry:1})},I=a=>a.contentRating==="erotica"||a.contentRating==="pornographic"||a.type==="doujinshi";function N(a,e){const r=a.titles??{};return e==="englishName"?r.en||a.title:e==="nativeName"&&(r.native||r.romaji||a.altTitle)||a.title}function A(a){return{englishName:a.titles?.en??a.title,nativeName:a.titles?.native??a.titles?.romaji??a.altTitle??void 0}}const f=/^anilist:ch:(\d+)$/;function w(a){if(!a)return null;const e=f.exec(a.trim());if(!e)return null;const r=Number.parseInt(e[1],10);return Number.isFinite(r)?r:null}function _(a,e){const r=String(e),n=a.find(o=>(o.number??"").trim()===r);return n||(a.find(o=>{const t=Number.parseFloat((o.number??"").trim());return Number.isFinite(t)&&t===e})??null)}const x=["Reading","Completed","On-Hold","Dropped","Planned"],q=(a,e)=>`${a.toLowerCase()}:${e}`,D=(a="All",e=1,r=24)=>{const n=s();return u(n.mangaLibrary.list.queryOptions({status:a,page:e,limit:r}))},L=()=>{const a=s();return u({...a.mangaLibrary.ids.queryOptions(),staleTime:1e3*60})},U=a=>{const e=s();return u({...e.mangaLibrary.check.queryOptions({id:a??""}),enabled:!!a,staleTime:1e3*60})},j=a=>{const e=s();return u({...e.mangaLibrary.entry.queryOptions({id:a??""}),enabled:!!a,staleTime:1e3*60})},H=()=>{const a=s(),e=g();return c(a.mangaLibrary.link.mutationOptions({onSuccess:r=>{i.success(r?.progressMigrated?"Linked — chapter progress carried over":"Linked to AniList entry"),e.invalidateQueries(a.mangaLibrary.pathFilter()),e.invalidateQueries({queryKey:["manga-library"]}),e.invalidateQueries({queryKey:["manga-library-ids"]}),e.invalidateQueries({queryKey:["manga-continue-reading"]}),e.invalidateQueries({queryKey:["manga-library-check"]}),e.invalidateQueries({queryKey:["manga-library-entry"]})},onError:r=>{i.error(`Failed to link: ${r.message}`)}}))},z=(a=24)=>{const e=s();return u(e.mangaProgress.continueReading.queryOptions({limit:a}))},V=a=>{const e=s();return u({...e.mangaProgress.byManga.queryOptions({mangaId:a??""}),enabled:!!a})},P=()=>{const a=s(),e=g();return c(a.mangaLibrary.add.mutationOptions({onSuccess:(r,n)=>{n.silent||i.success("Bookmarked"),e.invalidateQueries(a.mangaLibrary.pathFilter()),e.invalidateQueries({queryKey:["manga-library"]}),e.invalidateQueries({queryKey:["manga-library-ids"]}),e.invalidateQueries({queryKey:["manga-library-check",q(n.provider??"",n.mangaId??"")]})},onError:r=>{i.error(`Failed to bookmark: ${r.message}`)}}))},S=()=>{const a=s(),e=g();return c(a.mangaLibrary.remove.mutationOptions({onSuccess:(r,n)=>{i.success("Bookmark removed"),e.invalidateQueries(a.mangaLibrary.pathFilter()),e.invalidateQueries({queryKey:["manga-library"]}),e.invalidateQueries({queryKey:["manga-library-ids"]}),e.invalidateQueries({queryKey:["manga-continue-reading"]}),e.invalidateQueries({queryKey:["manga-library-check",n]})},onError:r=>{i.error(`Failed to remove: ${r.message}`)}}))},Y=()=>{const a=s(),e=g();return c(a.mangaLibrary.setStatus.mutationOptions({onSuccess:()=>{i.success("Status updated"),e.invalidateQueries(a.mangaLibrary.pathFilter()),e.invalidateQueries({queryKey:["manga-library"]}),e.invalidateQueries({queryKey:["manga-continue-reading"]})},onError:r=>{i.error(`Failed to update status: ${r.message}`)}}))},G=()=>{const a=s(),e=g();return c(a.mangaProgress.save.mutationOptions({onSuccess:(r,n)=>{e.invalidateQueries({queryKey:["manga-progress",n.mangaId]}),e.invalidateQueries({queryKey:["manga-continue-reading"]}),e.invalidateQueries({queryKey:["manga-library"]}),e.invalidateQueries({queryKey:["manga-library-ids"]}),e.invalidateQueries(a.mangaProgress.pathFilter())}}))},J=()=>{const a=s(),e=g();return c(a.mangaProgress.remove.mutationOptions({onSuccess:()=>{i.success("Progress reset"),e.invalidateQueries({queryKey:["manga-progress"]}),e.invalidateQueries({queryKey:["manga-continue-reading"]}),e.invalidateQueries({queryKey:["manga-library"]}),e.invalidateQueries(a.mangaProgress.pathFilter())},onError:r=>{i.error(`Failed to reset progress: ${r.message}`)}}))},W=()=>{const a=s(),e=g();return c(a.mangaLibrary.batchStatus.mutationOptions({onSuccess:r=>{i.success(`Status updated for ${r.updated??0} items`),e.invalidateQueries(a.mangaLibrary.pathFilter()),e.invalidateQueries({queryKey:["manga-library"]}),e.invalidateQueries({queryKey:["manga-continue-reading"]})},onError:r=>{i.error(`Failed to update statuses: ${r.message}`)}}))},X=()=>{const a=s(),e=g();return c(a.mangaLibrary.removeMany.mutationOptions({onSuccess:r=>{const n=r.removed??0;i.success(`Removed ${n} ${n===1?"item":"items"} from reading list`),e.invalidateQueries(a.mangaLibrary.pathFilter()),e.invalidateQueries({queryKey:["manga-library"]}),e.invalidateQueries({queryKey:["manga-library-ids"]}),e.invalidateQueries({queryKey:["manga-continue-reading"]})},onError:r=>{i.error(`Failed to remove: ${r.message}`)}}))},Z=()=>{const a=s(),e=g();return c(a.mangaProgress.removeMany.mutationOptions({onSuccess:r=>{const n=r.removed??0;i.success(`Reset progress for ${n} ${n===1?"item":"items"}`),e.invalidateQueries({queryKey:["manga-progress"]}),e.invalidateQueries({queryKey:["manga-continue-reading"]}),e.invalidateQueries({queryKey:["manga-library"]}),e.invalidateQueries(a.mangaProgress.pathFilter())},onError:r=>{i.error(`Failed to reset progress: ${r.message}`)}}))},ee=()=>{const a=P(),e=S(),{data:r}=L(),n=K(()=>new Set(r?.ids||[]),[r]);return{toggle:t=>{const d=q(t.provider,t.id);n.has(d)?e.mutate(d):a.mutate({provider:t.provider,mangaId:t.id,title:t.title,cover:t.cover,altTitle:t.altTitle,contentRating:t.contentRating})},bookmarkedIds:n,pending:a.isPending||e.isPending}};export{Z as A,J as B,x as M,E as a,C as b,A as c,z as d,B as e,T as f,j as g,P as h,I as i,H as j,O as k,U as l,q as m,V as n,S as o,Y as p,w as q,N as r,_ as s,$ as t,ee as u,M as v,G as w,D as x,W as y,X as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e,S as T,L as N,d as P,A as y,q as o}from"./vendor-core-8R2fFbyN.js";import{I as c}from"./vendor-icons-CDMuNDeL.js";import{k as I,r as k}from"./useMangaLibrary-
|
|
1
|
+
import{u as e,S as T,L as N,d as P,A as y,q as o}from"./vendor-core-8R2fFbyN.js";import{I as c}from"./vendor-icons-CDMuNDeL.js";import{k as I,r as k}from"./useMangaLibrary-C9Lci5N4.js";import{d as A}from"./index-BXwhFWB_.js";import{p as s,a as L}from"./MediaCard-B5584Cq9.js";const S=({data:l,anchorRect:t,bookmarked:a,onToggleBookmark:i,onMouseEnter:d,onMouseLeave:m,onRequestClose:p})=>{const{data:n,isLoading:h}=I(l.provider,l.mangaId,l.rating||"safe",l.mature||!1),{titlePreference:f}=A(),u=n?.chapters.length??0,v=[n?.status,n?.type].filter(Boolean).join(" · "),g=k({title:l.title,altTitle:n?.altTitle??l.altTitle},f);return e(L,{anchorRect:t,onMouseEnter:d,onMouseLeave:m,onRequestClose:p,children:h?e("div",{className:s.loading,children:[e("div",{className:s.spinner}),e("span",{children:"Fetching details..."})]}):e(T,{children:[e("div",{className:s.header,children:[e("div",{className:s.title,children:g}),n?.altTitle&&n.altTitle!==g&&e("div",{className:s.synopsis,children:["Also known as: ",n.altTitle]})]}),e("div",{className:s.body,children:[e("div",{className:s.metaRow,children:[v&&e("div",{className:s.metaItem,children:[e(c,{name:"book",size:14}),e("span",{children:v})]}),u>0&&e("div",{className:s.metaItem,children:e("span",{children:[u," chapter",u===1?"":"s"]})}),l.progressLabel&&e("div",{className:s.metaItem,children:[e(c,{name:"bookmark",size:12}),e("span",{children:l.progressLabel})]})]}),e("div",{className:s.synopsis,children:n?.description?n.description:"No synopsis available."}),Array.isArray(n?.genres)&&(n?.genres?.length??0)>0&&e("div",{className:s.details,children:e("div",{className:s.genres,children:n.genres.filter(Boolean).slice(0,4).map(r=>e("span",{className:s.genre,children:r},r))})})]}),e("div",{className:s.footer,children:[e("div",{className:s.primaryAction,children:e(N,{to:l.readTarget,className:s.watchBtn,children:[e(c,{name:"book",size:14}),"Read now"]})}),e("div",{className:s.secondaryActions,children:[e("button",{className:`${s.watchlistBtn} ${a?s.active:""}`,onClick:r=>{r.preventDefault(),r.stopPropagation(),i()},children:[a?e(c,{name:"check",size:12}):e(c,{name:"plus",size:12}),e("span",{children:a?"Remove":"Bookmark"})]}),e(N,{to:`/manga/${l.provider}/${encodeURIComponent(l.mangaId)}`,className:s.detailsBtn,children:"Read more"})]})]})]})})},M=300;function $(){const[l,t]=P(null),a=y(null),i=o(()=>{a.current&&(clearTimeout(a.current),a.current=null)},[]),d=o((n,h)=>{i(),t({data:h,rect:n})},[i]),m=o(()=>{i(),a.current=setTimeout(()=>{a.current=null,t(null)},M)},[i]),p=o(()=>{i(),t(null)},[i]);return{popup:l,openPopup:d,scheduleClose:m,cancelClose:i,closePopup:p}}export{S as M,$ as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{T as l}from"./vendor-core-8R2fFbyN.js";import{b as m}from"./vendor-query-BUTye89G.js";import{X as n}from"./index-BXwhFWB_.js";const d=e=>new Promise(t=>setTimeout(t,e)),f=async(e,t)=>{const a={"Content-Type":"application/json"};if(e.startsWith("/")||typeof window<"u"&&e.startsWith(window.location.origin)){const o=localStorage.getItem("animepahe_ua"),s=localStorage.getItem("animepahe_cookie"),i=localStorage.getItem("jasmr_ua"),p=localStorage.getItem("jasmr_cookie");o&&(a["x-animepahe-ua"]=o),s&&(a["x-animepahe-cookie"]=s),i&&(a["x-jasmr-ua"]=i),p&&(a["x-jasmr-cookie"]=p)}let r=await fetch(e,{...t,headers:{...a,...t?.headers}});for(let o=0;r.status===503&&o<8;o++)await d(Math.min(500*2**o,4e3)),r=await fetch(e,{...t,headers:{...a,...t?.headers}});if(!r.ok){const o=await r.text().catch(()=>"");let s={};try{s=JSON.parse(o)}catch{}const i=typeof s.error=="string"?s.error:"";throw r.status===403&&i==="AUTH_REQUIRED"&&s.provider==="animepahe"&&n("animepahe"),r.status===403&&i==="AUTH_REQUIRED"&&s.provider==="jasmr"&&n("jasmr"),r.status===401&&i==="LAN_AUTH_REQUIRED"&&n("lan"),new Error(i||`Failed to fetch from ${e}`)}return r.json()},h=300*1e3;function u(e){return{value:e.id,label:e.label,mature:e.mature,kind:e.kind,sub:e.sub,tier:e.tier,browse:e.browse,facets:e.facets,servers:e.servers}}const j=()=>{const e=m({queryKey:["providers"],queryFn:()=>f("/api/providers"),staleTime:h,retry:1}),t=Array.isArray(e.data)?e.data:null,a=l(()=>t&&t.length>0?t.filter(c=>c.loaded).map(u):[],[t]);return{...e,options:a,isFallback:!t||t.length===0}};export{f,j as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as c,u as r,S as d}from"./vendor-core-8R2fFbyN.js";import{I as v}from"./vendor-icons-CDMuNDeL.js";import{M as g}from"./MediaCard-B5584Cq9.js";import{T}from"./TvPopup-BekfiNcX.js";import{c as m,i as f}from"./useTvLibrary-B7jEk2Q7.js";import{b as i}from"./vendor-query-BUTye89G.js";import{g as p}from"./index-BXwhFWB_.js";const _=c(({item:e})=>{const o=e.type==="tv"||e.type==="tvSeries"||e.type==="tvMiniSeries",s=m(e.type,e.id);return r(g,{item:{id:String(e.id),title:e.title,thumbnail:e.image,typeBadge:o?"TV":"Movie",isAdult:f(e)},linkTo:s,hoverIcon:"info",showInfoButton:!0,metaRow:r(d,{children:[e.year&&r("span",{style:{opacity:.75},children:e.year}),e.vote_average!=null&&r("span",{style:{display:"inline-flex",alignItems:"center",gap:3},children:[r(v,{name:"star",size:10}),Number(e.vote_average).toFixed(1)]})]}),renderPopup:(a,t)=>r(T,{item:e,anchorRect:a,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onRequestClose:t.close})})}),u=1e3*60*5,b=e=>{const o=p(),{query:s,type:a,genre:t,year:n,sort_by:l,page:y}=e;return i({...o.tv.search.queryOptions({q:s?.trim()||"",type:a||"multi",genre:t||"",year:n&&n!=="ALL"?n:"",sortBy:l||"popularity.desc",page:y||1}),staleTime:u,retry:1})},A=(e="all",o="week",s=1,a=!0)=>{const t=p();return i({...t.tv.trending.queryOptions({mediaType:e,timeWindow:o,page:s}),enabled:a,staleTime:u,retry:1})};export{_ as T,b as a,A as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{T as p}from"./vendor-core-8R2fFbyN.js";import{b as v,u as n,a as o}from"./vendor-query-BUTye89G.js";import{g as a,z as i,t as m}from"./index-BXwhFWB_.js";const d=t=>String(t).toLowerCase()==="movie"?"movie":"tv",g=(t,e)=>`${d(t)}:${e}`,K=(t,e)=>{const r=d(t);return`/tv/${e}?type=${r}`},L=(t,e,r,s)=>{const u=new URLSearchParams;return u.set("type",d(t)),r!==void 0&&u.set("s",String(r)),s!==void 0&&u.set("e",String(s)),`/tv/${e}/watch?${u.toString()}`},S=t=>t.adult===!0||t.adult===1,F=["Watching","Completed","On-Hold","Dropped","Planned"],y=(t,e)=>g(t,e),$=(t="All",e=1,r=24)=>{const s=a();return v(s.tvLibrary.list.queryOptions({status:t,page:e,limit:r}))},b=()=>{const t=a();return v({...t.tvLibrary.ids.queryOptions(),staleTime:1e3*60})},C=t=>{const e=a();return v({...e.tvLibrary.check.queryOptions({id:t||""}),enabled:!!t,staleTime:1e3*60})},w=(t=24)=>{const e=a();return v(e.tvProgress.continueWatching.queryOptions({limit:t}))},O=t=>{const e=a();return v({...e.tvProgress.getByMedia.queryOptions({mediaId:t||""}),enabled:!!t})},k=(t,e,r)=>{const s=a();return v({...s.tvProgress.latest.queryOptions({mediaId:t||"",season:e,episode:r}),enabled:!!t,staleTime:0})},h=()=>{const t=a(),e=n();return o({mutationFn:async r=>{const{silent:s,...u}=r;return m.tvLibrary.add.mutate(u)},onSuccess:(r,s)=>{s.silent||i.success("Added to TV watchlist"),e.invalidateQueries({queryKey:["tv-library"]}),e.invalidateQueries({queryKey:["tv-library-ids"]}),e.invalidateQueries({queryKey:["tv-library-check",y(s.mediaType,s.tmdbId)]}),e.invalidateQueries(t.tvLibrary.pathFilter())},onError:r=>{i.error(`Failed to add: ${r.message}`)}})},Q=()=>{const t=a(),e=n();return o(t.tvLibrary.remove.mutationOptions({onSuccess:(r,s)=>{i.success("Removed from TV watchlist"),e.invalidateQueries({queryKey:["tv-library"]}),e.invalidateQueries({queryKey:["tv-library-ids"]}),e.invalidateQueries({queryKey:["tv-continue-watching"]}),e.invalidateQueries({queryKey:["tv-library-check",s]}),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())},onError:r=>{i.error(`Failed to remove: ${r.message}`)}}))},f=()=>{const t=a(),e=n();return o(t.tvLibrary.setStatus.mutationOptions({onSuccess:()=>{i.success("Status updated"),e.invalidateQueries({queryKey:["tv-library"]}),e.invalidateQueries({queryKey:["tv-continue-watching"]}),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())},onError:r=>{i.error(`Failed to update status: ${r.message}`)}}))},R=()=>{const t=a(),e=n();return o(t.tvProgress.save.mutationOptions({onSuccess:(r,s)=>{e.invalidateQueries({queryKey:["tv-progress",s.mediaId]}),e.invalidateQueries({queryKey:["tv-progress-latest",s.mediaId]}),e.invalidateQueries({queryKey:["tv-continue-watching"]}),e.invalidateQueries({queryKey:["tv-library"]}),e.invalidateQueries({queryKey:["tv-library-ids"]}),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())}}))},I=()=>{const t=a(),e=n();return o(t.tvProgress.remove.mutationOptions({onSuccess:()=>{i.success("Progress reset"),e.invalidateQueries({queryKey:["tv-progress"]}),e.invalidateQueries({queryKey:["tv-continue-watching"]}),e.invalidateQueries({queryKey:["tv-library"]}),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())},onError:r=>{i.error(`Failed to reset progress: ${r.message}`)}}))},B=()=>{const t=a(),e=n();return o(t.tvLibrary.batchStatus.mutationOptions({onSuccess:r=>{i.success(`Status updated for ${r.updated??0} items`),e.invalidateQueries({queryKey:["tv-library"]}),e.invalidateQueries({queryKey:["tv-continue-watching"]}),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())},onError:r=>{i.error(`Failed to update statuses: ${r.message}`)}}))},E=()=>{const t=a(),e=n();return o(t.tvLibrary.removeMany.mutationOptions({onSuccess:r=>{const s=r.removed??0;i.success(`Removed ${s} ${s===1?"item":"items"} from TV watchlist`),e.invalidateQueries({queryKey:["tv-library"]}),e.invalidateQueries({queryKey:["tv-library-ids"]}),e.invalidateQueries({queryKey:["tv-continue-watching"]}),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())},onError:r=>{i.error(`Failed to remove: ${r.message}`)}}))},A=()=>{const t=a(),e=n();return o(t.tvProgress.removeMany.mutationOptions({onSuccess:r=>{const s=r.removed??0;i.success(`Reset progress for ${s} ${s===1?"item":"items"}`),e.invalidateQueries({queryKey:["tv-progress"]}),e.invalidateQueries({queryKey:["tv-continue-watching"]}),e.invalidateQueries({queryKey:["tv-library"]}),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())},onError:r=>{i.error(`Failed to reset progress: ${r.message}`)}}))},_=()=>{const t=h(),e=Q(),{data:r}=b(),s=p(()=>new Set(r?.ids||[]),[r]);return{toggle:c=>{const l=y(c.mediaType,c.tmdbId);s.has(l)?e.mutate(l):t.mutate({...c,poster:c.poster||""})},bookmarkedIds:s,pending:t.isPending||e.isPending}};export{F as T,Q as a,I as b,K as c,g as d,C as e,_ as f,R as g,f as h,S as i,k as j,O as k,$ as l,B as m,d as n,E as o,A as p,L as t,w as u};
|