@serifpersia/dango 3.5.8 → 3.5.9

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.
Files changed (54) hide show
  1. package/README.md +2 -2
  2. package/client/dist/assets/{AnimeCard-Vxac3CKU.js → AnimeCard-CDeVbWJO.js} +1 -1
  3. package/client/dist/assets/{AnimeInfo-z1nSbaco.js → AnimeInfo-DVpM_cPF.js} +1 -1
  4. package/client/dist/assets/{AnimeInfoPage-Brb3TFXh.js → AnimeInfoPage-Cc3OcfHY.js} +2 -2
  5. package/client/dist/assets/{Asmr-BvM8UKQ3.js → Asmr-DZmR_EHb.js} +1 -1
  6. package/client/dist/assets/{AsmrResetProgressModal-CndzdTHo.js → AsmrResetProgressModal-DBCDlfYq.js} +1 -1
  7. package/client/dist/assets/{AvSyncCalibrator-XH4E6Sfp.js → AvSyncCalibrator-Cf5L0Dxf.js} +1 -1
  8. package/client/dist/assets/{Home-CW24x23t.js → Home-BqhPqzWF.js} +1 -1
  9. package/client/dist/assets/{Insights-DLqUhamB.js → Insights-CmbbDZr3.js} +1 -1
  10. package/client/dist/assets/{LibraryListPage-BcHi-OIb.js → LibraryListPage-jLA7gnux.js} +1 -1
  11. package/client/dist/assets/{ListeningList-gNfL7dv7.js → ListeningList-Cm9zGlLB.js} +1 -1
  12. package/client/dist/assets/{Manga-B26xL6Dq.js → Manga-x4pVT4ZH.js} +1 -1
  13. package/client/dist/assets/{MangaInfoPage-CFI4_GgJ.js → MangaInfoPage-BPSW9UER.js} +1 -1
  14. package/client/dist/assets/{MangaReadPage-CL2TKQc8.js → MangaReadPage-V1iDbCfL.js} +1 -1
  15. package/client/dist/assets/{MangaResetProgressModal-yIv7jY4h.js → MangaResetProgressModal-Dto3km2X.js} +1 -1
  16. package/client/dist/assets/{Mature-q8lBiSsb.js → Mature-B0DoN3tQ.js} +1 -1
  17. package/client/dist/assets/{MediaCard-DM2d5vjg.js → MediaCard-D6_9HL2Z.js} +1 -1
  18. package/client/dist/assets/{Music-Dbswx5jU.js → Music-1MlUIfdw.js} +1 -1
  19. package/client/dist/assets/{OptionListMenu-BQnYYHpM.js → OptionListMenu-BWwktIiH.js} +1 -1
  20. package/client/dist/assets/{Player-lSQC6rcr.js → Player-Dgtn--lM.js} +2 -2
  21. package/client/dist/assets/{PlayerSettings-Bns1A0RY.js → PlayerSettings-CI5hGpEU.js} +1 -1
  22. package/client/dist/assets/{QueueOptionsButton-CGQAqTtM.js → QueueOptionsButton-DjcdOJgg.js} +1 -1
  23. package/client/dist/assets/{QueueRail-ByOPjeHY.js → QueueRail-B5z_xhzj.js} +1 -1
  24. package/client/dist/assets/{Radio-C7BD7L1o.js → Radio-BAE-Q-iN.js} +1 -1
  25. package/client/dist/assets/{ReadingList-L0kcgqzm.js → ReadingList-B97i_hGv.js} +1 -1
  26. package/client/dist/assets/{ResetProgressModal-aeUUSFYc.js → ResetProgressModal-C7-CvTi-.js} +1 -1
  27. package/client/dist/assets/{Search-DP0QouO-.js → Search-CbPFjKeU.js} +1 -1
  28. package/client/dist/assets/{Settings-C7iOaCMq.js → Settings-BbihEcZ2.js} +1 -1
  29. package/client/dist/assets/{SkeletonGrid-DyG9u20F.js → SkeletonGrid-BA_x2PRl.js} +1 -1
  30. package/client/dist/assets/{Trackers-COKJmOew.js → Trackers-Bperfrcz.js} +1 -1
  31. package/client/dist/assets/{Tv-QYoBwOlH.js → Tv-BSGuUz2F.js} +1 -1
  32. package/client/dist/assets/{TvInfo-DS9pbimS.js → TvInfo-CxSmzVSL.js} +1 -1
  33. package/client/dist/assets/{TvPopup-C9Xhv1dW.js → TvPopup-S5blnD3l.js} +1 -1
  34. package/client/dist/assets/{TvSearch-BjyAFYCg.js → TvSearch-B-2sRNbN.js} +1 -1
  35. package/client/dist/assets/{TvWatchlist-CAuCk-AT.js → TvWatchlist-MaA-qhQw.js} +1 -1
  36. package/client/dist/assets/{Watchlist-hgU-RPay.js → Watchlist-yVEi1oVn.js} +1 -1
  37. package/client/dist/assets/{hls-E2REEW_P.js → hls-CnFtaJwf.js} +1 -1
  38. package/client/dist/assets/{index-_iy8RyKU.js → index-DNxWyfmM.js} +2 -2
  39. package/client/dist/assets/{useAnimeInfoData-CgmVQOsk.js → useAnimeInfoData-BqAd5seW.js} +1 -1
  40. package/client/dist/assets/{useAsmr-BxU_JBAI.js → useAsmr-B1vlDm2S.js} +1 -1
  41. package/client/dist/assets/{useAsmrPopup-BYMMk2rG.js → useAsmrPopup-BNJC4JQo.js} +1 -1
  42. package/client/dist/assets/{useMangaLibrary-BrKhv-sI.js → useMangaLibrary-CU3bFfuD.js} +1 -1
  43. package/client/dist/assets/{useMangaPopup-BQe7Ug-A.js → useMangaPopup-LbRnTFzq.js} +1 -1
  44. package/client/dist/assets/{useProviders-swR4Flu5.js → useProviders-CvKGEjDV.js} +1 -1
  45. package/client/dist/assets/{useTv-mq8TkTZl.js → useTv-LsgXHZD4.js} +1 -1
  46. package/client/dist/assets/{useTvLibrary-BuMreQuF.js → useTvLibrary-c90knUfT.js} +1 -1
  47. package/client/dist/favicon.svg +11 -0
  48. package/client/dist/index.html +2 -2
  49. package/client/dist/repo_logo.svg +33 -78
  50. package/package.json +2 -2
  51. package/server/package.json +1 -1
  52. package/client/dist/favicon.ico +0 -0
  53. package/client/dist/logo-mochi.png +0 -0
  54. package/client/dist/logo-sakura.png +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-CW24x23t.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-query-BBT5_sHx.js","assets/SkeletonGrid-DyG9u20F.js","assets/vendor-icons-DrybRNxP.js","assets/SkeletonGrid-Bge3aRl2.css","assets/AnimeCard-Vxac3CKU.js","assets/useAnimeInfoData-CgmVQOsk.js","assets/QueueOptionsButton-CGQAqTtM.js","assets/vendor-ui-3qrARCPr.js","assets/QueueOptionsButton-CM15uQn8.css","assets/MediaCard-DM2d5vjg.js","assets/useIsMobile-Dvx1uJ82.js","assets/MediaCard-DB6Yjgky.css","assets/ErrorMessage-DAxegITP.js","assets/ErrorMessage-CXoRbrLN.css","assets/ResetProgressModal-aeUUSFYc.js","assets/QueueRail-ByOPjeHY.js","assets/QueueRail-BUYEjdaq.css","assets/useMangaPopup-BQe7Ug-A.js","assets/useMangaLibrary-BrKhv-sI.js","assets/usePopup-DS9jMzp6.js","assets/MangaResetProgressModal-yIv7jY4h.js","assets/useProviders-swR4Flu5.js","assets/useTv-mq8TkTZl.js","assets/TvPopup-C9Xhv1dW.js","assets/useTvLibrary-BuMreQuF.js","assets/AsmrResetProgressModal-CndzdTHo.js","assets/useAsmr-BxU_JBAI.js","assets/Home-B_q2l74h.css","assets/Watchlist-hgU-RPay.js","assets/Watchlist.module-XGtVQr1d.js","assets/Watchlist-BiDEU0iV.css","assets/Settings-C7iOaCMq.js","assets/ToggleSwitch-CN_ppEc9.js","assets/ToggleSwitch-BPil0d_k.css","assets/Settings-CwIWLSfY.css","assets/Player-lSQC6rcr.js","assets/AvSyncCalibrator-XH4E6Sfp.js","assets/AvSyncCalibrator-ieaRTs3u.css","assets/hls-E2REEW_P.js","assets/AnimeMetaDetails-BogOi_bM.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-B3Sa5pRv.js","assets/SynopsisText-CYv2W3yR.css","assets/Player-DBLl-bj_.css","assets/Search-DP0QouO-.js","assets/Search.module-CMEai-B-.js","assets/Search-Cs45oAwI.css","assets/Mature-q8lBiSsb.js","assets/Mature-DJmUUtlF.css","assets/Asmr-BvM8UKQ3.js","assets/Asmr.module-CdWlioTY.js","assets/Asmr-D1KuQwQy.css","assets/useAsmrPopup-BYMMk2rG.js","assets/page.module-C1MlZzf3.js","assets/page-DRvjODkg.css","assets/Manga-B26xL6Dq.js","assets/Manga.module-depGEacJ.js","assets/Manga-CqAceKxR.css","assets/MangaInfoPage-CFI4_GgJ.js","assets/MangaReadPage-CL2TKQc8.js","assets/ReadingList-L0kcgqzm.js","assets/LibraryListPage-BcHi-OIb.js","assets/Radio-C7BD7L1o.js","assets/Radio.module-DGSZLpKM.js","assets/Radio-CCHNFN7R.css","assets/Music-Dbswx5jU.js","assets/Music-BGH_0voi.css","assets/TvSearch-BjyAFYCg.js","assets/TvInfo-DS9pbimS.js","assets/TvInfo-Bu36xJyO.css","assets/Tv-QYoBwOlH.js","assets/OptionListMenu-BQnYYHpM.js","assets/Tv-BlVIanQL.css","assets/TvWatchlist-CAuCk-AT.js","assets/ListeningList-gNfL7dv7.js","assets/Trackers-COKJmOew.js","assets/Trackers-D5XBOCDp.css","assets/Insights-DLqUhamB.js","assets/Insights-Dc8xLmsr.css","assets/AnimeInfoPage-Brb3TFXh.js","assets/PlayerRedirect-fv2tzEUu.js","assets/VirtualKeyboard-BmqZPZXR.js","assets/VirtualKeyboard-KIPc5ZGH.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-BqhPqzWF.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-query-BBT5_sHx.js","assets/SkeletonGrid-BA_x2PRl.js","assets/vendor-icons-DrybRNxP.js","assets/SkeletonGrid-Bge3aRl2.css","assets/AnimeCard-CDeVbWJO.js","assets/useAnimeInfoData-BqAd5seW.js","assets/QueueOptionsButton-DjcdOJgg.js","assets/vendor-ui-3qrARCPr.js","assets/QueueOptionsButton-CM15uQn8.css","assets/MediaCard-D6_9HL2Z.js","assets/useIsMobile-Dvx1uJ82.js","assets/MediaCard-DB6Yjgky.css","assets/ErrorMessage-DAxegITP.js","assets/ErrorMessage-CXoRbrLN.css","assets/ResetProgressModal-C7-CvTi-.js","assets/QueueRail-B5z_xhzj.js","assets/QueueRail-BUYEjdaq.css","assets/useMangaPopup-LbRnTFzq.js","assets/useMangaLibrary-CU3bFfuD.js","assets/usePopup-DS9jMzp6.js","assets/MangaResetProgressModal-Dto3km2X.js","assets/useProviders-CvKGEjDV.js","assets/useTv-LsgXHZD4.js","assets/TvPopup-S5blnD3l.js","assets/useTvLibrary-c90knUfT.js","assets/AsmrResetProgressModal-DBCDlfYq.js","assets/useAsmr-B1vlDm2S.js","assets/Home-B_q2l74h.css","assets/Watchlist-yVEi1oVn.js","assets/Watchlist.module-XGtVQr1d.js","assets/Watchlist-BiDEU0iV.css","assets/Settings-BbihEcZ2.js","assets/ToggleSwitch-CN_ppEc9.js","assets/ToggleSwitch-BPil0d_k.css","assets/Settings-CwIWLSfY.css","assets/Player-Dgtn--lM.js","assets/AvSyncCalibrator-Cf5L0Dxf.js","assets/AvSyncCalibrator-ieaRTs3u.css","assets/hls-CnFtaJwf.js","assets/AnimeMetaDetails-BogOi_bM.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-B3Sa5pRv.js","assets/SynopsisText-CYv2W3yR.css","assets/Player-DBLl-bj_.css","assets/Search-CbPFjKeU.js","assets/Search.module-CMEai-B-.js","assets/Search-Cs45oAwI.css","assets/Mature-B0DoN3tQ.js","assets/Mature-DJmUUtlF.css","assets/Asmr-DZmR_EHb.js","assets/Asmr.module-CdWlioTY.js","assets/Asmr-D1KuQwQy.css","assets/useAsmrPopup-BNJC4JQo.js","assets/page.module-C1MlZzf3.js","assets/page-DRvjODkg.css","assets/Manga-x4pVT4ZH.js","assets/Manga.module-depGEacJ.js","assets/Manga-CqAceKxR.css","assets/MangaInfoPage-BPSW9UER.js","assets/MangaReadPage-V1iDbCfL.js","assets/ReadingList-B97i_hGv.js","assets/LibraryListPage-jLA7gnux.js","assets/Radio-BAE-Q-iN.js","assets/Radio.module-DGSZLpKM.js","assets/Radio-CCHNFN7R.css","assets/Music-1MlUIfdw.js","assets/Music-BGH_0voi.css","assets/TvSearch-B-2sRNbN.js","assets/TvInfo-CxSmzVSL.js","assets/TvInfo-Bu36xJyO.css","assets/Tv-BSGuUz2F.js","assets/OptionListMenu-BWwktIiH.js","assets/Tv-BlVIanQL.css","assets/TvWatchlist-MaA-qhQw.js","assets/ListeningList-Cm9zGlLB.js","assets/Trackers-Bperfrcz.js","assets/Trackers-D5XBOCDp.css","assets/Insights-CmbbDZr3.js","assets/Insights-Dc8xLmsr.css","assets/AnimeInfoPage-Cc3OcfHY.js","assets/PlayerRedirect-fv2tzEUu.js","assets/VirtualKeyboard-BmqZPZXR.js","assets/VirtualKeyboard-KIPc5ZGH.css"])))=>i.map(i=>d[i]);
2
2
  import{N as An,k as W,A as F,q as Q,h as E,S as U,d as k,X as se,x as ae,T as be,g as rt,u as o,L as Y,$ as Ut,a as Ln,c as ot,e as qn,f as Rn,D as jn,i as Dn,P as ft,j as $n,l as x,m as yt,z as L,n as Mn,B as zn}from"./vendor-core-DfaOB3Rn.js";import{s as ye,i as Fn,q as Bn,u as K,a as X,b as G,c as it,Q as Wn,d as Qn}from"./vendor-query-BBT5_sHx.js";import{I as b}from"./vendor-icons-DrybRNxP.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 Un="modulepreload",Kn=function(e){return"/"+e},vt={},q=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=Kn(u),u in vt)return;vt[u]=!0;const d=u.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${m}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":Un,d||(h.as="script"),h.crossOrigin="",h.href=u,c&&h.setAttribute("nonce",c),document.head.appendChild(h),d)return new Promise((p,f)=>{h.addEventListener("load",p),h.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 Hn={data:""},Vn=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||Hn},Gn=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Yn=/\/\*[^]*?\*\/| +/g,gt=/\n+/g,me=(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"?me(a,s):s+"{"+me(a,s[1]=="k"?"":t)+"}":typeof a=="object"?r+=me(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+=me.p?me.p(s,a):s+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},de={},Kt=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Kt(e[n]);return t}return e},Jn=(e,t,n,r,i)=>{let s=Kt(e),a=de[s]||(de[s]=(l=>{let u=0,d=11;for(;u<l.length;)d=101*d+l.charCodeAt(u++)>>>0;return"go"+d})(s));if(!de[a]){let l=s!==e?e:(u=>{let d,m,h=[{}];for(;d=Gn.exec(u.replace(Yn,""));)d[4]?h.shift():d[3]?(m=d[3].replace(gt," ").trim(),h.unshift(h[0][m]=h[0][m]||{})):h[0][d[1]]=d[2].replace(gt," ").trim();return h[0]})(e);de[a]=me(i?{["@keyframes "+a]:l}:l,n?"":"."+a)}let c=n&&de.g;return n&&(de.g=de[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)})(de[a],t,r,c),a},Xn=(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?"":me(c,""):c===!1?"":c}return r+i+(a??"")},"");function Fe(e){let t=this||{},n=e.call?e(t.p):e;return Jn(n.unshift?n.raw?Xn(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,Vn(t.target),t.g,t.o,t.k)}let Ht,Ve,Ge;Fe.bind({g:1});let ce=Fe.bind({k:1});function Zn(e,t,n,r){me.p=t,Ht=e,Ve=n,Ge=r}function pe(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:Ve&&Ve()},c),n.o=/go\d/.test(l),c.className=Fe.apply(n,r)+(l?" "+l:"");let u=e;return e[0]&&(u=c.as||e,delete c.as),Ge&&u[0]&&Ge(c),Ht(u,c)}return i}}var er=e=>typeof e=="function",Me=(e,t)=>er(e)?e(t):e,tr=(()=>{let e=0;return()=>(++e).toString()})(),Vt=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),nr=20,st="default",Gt=(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 Gt(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}))}}},je=[],Yt={toasts:[],pausedAt:void 0,settings:{toastLimit:nr}},re={},Jt=(e,t=st)=>{re[t]=Gt(re[t]||Yt,e),je.forEach(([n,r])=>{n===t&&r(re[t])})},Xt=e=>Object.keys(re).forEach(t=>Jt(e,t)),rr=e=>Object.keys(re).find(t=>re[t].toasts.some(n=>n.id===e)),Be=(e=st)=>t=>{Jt(t,e)},or={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},ir=(e={},t=st)=>{let[n,r]=k(re[t]||Yt),i=F(re[t]);E(()=>(i.current!==re[t]&&r(re[t]),je.push([t,r]),()=>{let a=je.findIndex(([c])=>c===t);a>-1&&je.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||or[a.type],style:{...e.style,...(u=e[a.type])==null?void 0:u.style,...a.style}}});return{...n,toasts:s}},sr=(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||tr()}),Oe=e=>(t,n)=>{let r=sr(t,e,n);return Be(r.toasterId||rr(r.id))({type:2,toast:r}),r.id},M=(e,t)=>Oe("blank")(e,t);M.error=Oe("error");M.success=Oe("success");M.loading=Oe("loading");M.custom=Oe("custom");M.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Be(t)(n):Xt(n)};M.dismissAll=e=>M.dismiss(void 0,e);M.remove=(e,t)=>{let n={type:4,toastId:e};t?Be(t)(n):Xt(n)};M.removeAll=e=>M.remove(void 0,e);M.promise=(e,t,n)=>{let r=M.loading(t.loading,{...n,...n?.loading});return typeof e=="function"&&(e=e()),e.then(i=>{let s=t.success?Me(t.success,i):void 0;return s?M.success(s,{id:r,...n,...n?.success}):M.dismiss(r),i}).catch(i=>{let s=t.error?Me(t.error,i):void 0;s?M.error(s,{id:r,...n,...n?.error}):M.dismiss(r)}),e};var ar=1e3,cr=(e,t="default")=>{let{toasts:n,pausedAt:r}=ir(e,t),i=F(new Map).current,s=Q((m,h=ar)=>{if(i.has(m))return;let p=setTimeout(()=>{i.delete(m),a({type:4,toastId:m})},h);i.set(m,p)},[]);E(()=>{if(r)return;let m=Date.now(),h=n.map(p=>{if(p.duration===1/0)return;let f=(p.duration||0)+p.pauseDuration-(m-p.createdAt);if(f<0){p.visible&&M.dismiss(p.id);return}return setTimeout(()=>M.dismiss(p.id,t),f)});return()=>{h.forEach(p=>p&&clearTimeout(p))}},[n,r,t]);let a=Q(Be(t),[t]),c=Q(()=>{a({type:5,time:Date.now()})},[a]),l=Q((m,h)=>{a({type:1,toast:{id:m,height:h}})},[a]),u=Q(()=>{r&&a({type:6,time:Date.now()})},[r,a]),d=Q((m,h)=>{let{reverseOrder:p=!1,gutter:f=8,defaultPosition:w}=h||{},N=n.filter(P=>(P.position||w)===(m.position||w)&&P.height),j=N.findIndex(P=>P.id===m.id),I=N.filter((P,D)=>D<j&&P.visible).length;return N.filter(P=>P.visible).slice(...p?[I+1]:[0,I]).reduce((P,D)=>P+(D.height||0)+f,0)},[n]);return E(()=>{n.forEach(m=>{if(m.dismissed)s(m.id,m.removeDelay);else{let h=i.get(m.id);h&&(clearTimeout(h),i.delete(m.id))}})},[n,s]),{toasts:n,handlers:{updateHeight:l,startPause:c,endPause:u,calculateOffset:d}}},lr=ce`
3
3
  from {
4
4
  transform: scale(0) rotate(45deg);
@@ -175,4 +175,4 @@ to {
175
175
  > * {
176
176
  pointer-events: auto;
177
177
  }
178
- `,Le=16,qr=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,toasterId:s,containerStyle:a,containerClassName:c})=>{let{toasts:l,handlers:u}=cr(n,s);return W("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Le,left:Le,right:Le,bottom:Le,pointerEvents:"none",...a},className:c,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(d=>{let m=d.position||t,h=u.calculateOffset(d,{reverseOrder:e,gutter:r,defaultPosition:t}),p=Ar(m,h);return W(Nr,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?Lr:"",style:p},d.type==="custom"?Me(d.message,d):i?i(d):W(Cr,{toast:d,position:m}))}))},_=M;function We(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(Rr,t)}};return t}function Rr(e,t){return t(e)}function jr(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 Dr(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 We(c=>(n++,i.push(c),s(),{unsubscribe(){n--,a();const l=i.findIndex(u=>u===c);l>-1&&i.splice(l,1)}}))}}function $r(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=We(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 Mr(e){return We(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 xe(e){"@babel/helpers - typeof";return xe=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},xe(e)}function zr(e,t){if(xe(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xe(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fr(e){var t=zr(e,"string");return xe(t)=="symbol"?t:t+""}function V(e,t,n){return(t=Fr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bt(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 z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bt(Object(n),!0).forEach(function(r){V(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function he(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Br(e){return typeof e=="function"}function Wr(){return Object.create(null)}const Qr=typeof Symbol=="function"&&!!Symbol.asyncIterator;function Ur(e){return Qr&&he(e)&&Symbol.asyncIterator in e}const Kr=e=>e(),Zt=()=>{},_t=e=>{Object.freeze&&Object.freeze(e)};function en(e,t,n){var r;const i=t.join(".");return(r=n[i])!==null&&r!==void 0||(n[i]=new Proxy(Zt,{get(s,a){if(!(typeof a!="string"||a==="then"))return en(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)}),_t(u.args),_t(u.path),e(u)}})),n[i]}const tn=e=>en(e,[],Wr()),Hr=e=>new Proxy(Zt,{get(t,n){if(n!=="then")return e(n)}});function Te(e){"@babel/helpers - typeof";return Te=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},Te(e)}function Vr(e,t){if(Te(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Te(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gr(e){var t=Vr(e,"string");return Te(t)=="symbol"?t:t+""}function Ye(e,t,n){return(t=Gr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wt(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 qe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wt(Object(n),!0).forEach(function(r){Ye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Yr=class extends Error{constructor(e){super(Jr(e)),Object.assign(this,e)}};function Jr(e){if("message"in e)return String(e.message)}function Xr(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(he(e))return new Yr(e)}}var Et=class extends Error{constructor(e){var t,n,r;const i=Xr(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}),Ye(this,"cause",void 0),Ye(this,"code",void 0),this.code=e.code,this.name="TRPCError",(r=this.cause)!==null&&r!==void 0||(this.cause=i)}};function Zr(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:qe(qe({},e),{},{error:n})}}return{ok:!0,result:qe(qe({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var Ue=class extends Error{constructor(){super("Unable to transform response from server")}};function eo(e,t){let n;try{n=Zr(e,t)}catch{throw new Ue}if(!n.ok&&(!he(n.error.error)||typeof n.error.error.code!="number"))throw new Ue;if(n.ok&&!he(n.result))throw new Ue;return n}function to(e){return typeof e=="function"}async function no(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 ro(e){const{type:t,path:n}=e,r=await no(e.router,n);if(!r||!to(r)||r._def.type!==t&&!e.allowMethodOverride)throw new Et({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new Et({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return r(e)}function oo(e){return e instanceof ze}function io(e){return he(e)&&he(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function so(e,t){return typeof e=="string"?e:he(e)&&typeof e.message=="string"?e.message:t}var ze=class De extends Error{constructor(t,n){var r,i;const s=n?.cause;super(t,{cause:s}),V(this,"cause",void 0),V(this,"shape",void 0),V(this,"data",void 0),V(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,De.prototype)}static from(t,n={}){const r=t;return oo(r)?(n.meta&&(r.meta=z(z({},r.meta),n.meta)),r):io(r)?new De(r.error.message,z(z({},n),{},{result:r,cause:n.cause})):new De(so(r,"Unknown error"),z(z({},n),{},{cause:r}))}};function ao(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 St=e=>typeof e=="function";function co(e){if(e)return e;if(typeof window<"u"&&St(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&St(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function lo(...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 uo(...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 mo(e){return{url:e.url.toString(),fetch:e.fetch,transformer:ao(e.transformer),methodOverride:e.methodOverride}}function ho(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const po={query:"GET",mutation:"POST",subscription:"PATCH"};function nn(e){return"input"in e?e.transformer.input.serialize(e.input):ho(e.inputs.map(t=>e.transformer.input.serialize(t)))}const rn=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=nn(e);i!==void 0&&e.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(i))}`)}return r.length&&(n+="?"+r.join("&")),n},fo=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=nn(e);return t!==void 0?JSON.stringify(t):void 0},yo=e=>_o(z(z({},e),{},{contentTypeHeader:"application/json",getUrl:rn,getBody:fo}));var vo=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const go=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 vo};async function bo(e){var t,n;go(e.signal);const r=e.getUrl(e),i=e.getBody(e),s=(t=e.methodOverride)!==null&&t!==void 0?t:po[e.type],a=await(async()=>{const l=await e.headers();return Symbol.iterator in l?Object.fromEntries(l):l})(),c=z(z(z({},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 co(e.fetch)(r,{method:s,signal:e.signal,body:i,headers:c})}async function _o(e){const t={},n=await bo(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const kt=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Pt(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function i(c){const l=[[]];let u=0;for(;;){const h=c[u];if(!h)break;const p=l[l.length-1];if(h.aborted){var d;(d=h.reject)===null||d===void 0||d.call(h,new Error("Aborted")),u++;continue}if(e.validate(p.concat(h).map(f=>f.key))){p.push(h),u++;continue}if(p.length===0){var m;(m=h.reject)===null||m===void 0||m.call(h,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(h,p)=>{const f=u.items[p];try{var w;const j=await Promise.resolve(h);(w=f.resolve)===null||w===void 0||w.call(f,j)}catch(j){var N;(N=f.reject)===null||N===void 0||N.call(f,j)}f.batch=null,f.reject=null,f.resolve=null}));for(const h of u.items){var m;(m=h.reject)===null||m===void 0||m.call(h,new Error("Missing result")),h.batch=null}}).catch(d=>{for(const h of u.items){var m;(m=h.reject)===null||m===void 0||m.call(h,d),h.batch=null}})}}function a(c){var l;const u={aborted:!1,key:c,batch:null,resolve:kt,reject:kt},d=new Promise((m,h)=>{var p;u.reject=h,u.resolve=m,(p=t)!==null&&p!==void 0||(t=[]),t.push(u)});return(l=n)!==null&&l!==void 0||(n=setTimeout(s)),d}return{load:a}}function wo(e){var t,n;const r=mo(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(h=>h.path).join(","),m=u.map(h=>h.input);return rn(z(z({},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),h=lo(...u.map(f=>f.signal)),p=await yo(z(z({},r),{},{path:d,inputs:m,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:u}):e.headers:{}},signal:h}));return(Array.isArray(p.json)?p.json:u.map(()=>p.json)).map(f=>({meta:p.meta,json:f}))}}),c={query:Pt(a("query")),mutation:Pt(a("mutation"))};return({op:l})=>We(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(z(z({},l),{},{signal:uo(l.signal,d.signal)}));let h=!1,p;return m.then(f=>{h=!0,p=f;const w=eo(f.json,r.transformer.output);if(!w.ok){u.error(ze.from(w.error,{meta:f.meta}));return}u.next({context:f.meta,result:w.result}),u.complete()}).catch(f=>{h=!0,u.error(ze.from(f,{meta:p?.meta}))}),()=>{h||d.abort()}})}}const on=(e,...t)=>typeof e=="function"?e(...t):e;function Eo(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function So(e){const t=await on(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function ko(e,t){const n={method:"connectionParams",data:await on(e)};return t.encode(n)}function Po(e){const{promise:t,resolve:n,reject:r}=Eo();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function xo(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 To=class Je{constructor(t){var n;if(V(this,"id",++Je.connectCount),V(this,"WebSocketPonyfill",void 0),V(this,"urlOptions",void 0),V(this,"keepAliveOpts",void 0),V(this,"encoder",void 0),V(this,"wsObservable",$r(null)),V(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=++Je.connectCount;const t=So(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&&xo(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await Po(n),this.urlOptions.connectionParams&&n.send(await ko(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()}}};V(To,"connectCount",0);var sn=class{constructor(e){V(this,"links",void 0),V(this,"runtime",void 0),V(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return Mr({links:this.links,op:z(z({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Dr())}async requestAsPromise(e){try{const t=this.$request(e);return(await jr(t)).result.data}catch(t){throw ze.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 an=Symbol.for("trpc_untypedClient"),Io={query:"query",mutate:"mutation",subscribe:"subscription"},Oo=e=>Io[e];function Co(e){const t=tn(({path:n,args:r})=>{const i=[...n],s=Oo(i.pop()),a=i.join(".");return e[s](a,...r)});return Hr(n=>n===an?e:t[n])}function No(e){return Co(new sn(e))}function Ao(e){return e[an]}function Ie(e){"@babel/helpers - typeof";return Ie=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},Ie(e)}function Lo(e,t){if(Ie(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ie(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qo(e){var t=Lo(e,"string");return Ie(t)=="symbol"?t:t+""}function Ro(e,t,n){return(t=qo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xt(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 T(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xt(Object(n),!0).forEach(function(r){Ro(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jo(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 $e(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function $e(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 $e=function(r){this.s=r,this.n=r.next},$e.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 $e(e)}function Do(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 $o(e,t){if(e==null)return{};var n,r,i=Do(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 Mo=["cursor","direction"];function Qe(e){return{path:e.path.join(".")}}function zo(e){return e.length>=3}function Fo(e){return zo(e)?{type:"prefixed",prefix:e[0],path:e[1],args:e[2]}:{type:"unprefixed",prefix:void 0,path:e[0],args:e[1]}}function at(e,t,n){var r;const i=Fo(e);let s=(r=i.args)===null||r===void 0?void 0:r.input;if(n){var a,c;s=T(T(T({},(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 Bo(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=jo(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 ie(e){const t=Kr(()=>{const{input:n,type:r}=e,i=e.path.flatMap(s=>s.split("."));if(!n&&r==="any")return i.length?[i]:[];if(r==="infinite"&&he(n)&&("direction"in n||"cursor"in n)){const{cursor:s,direction:a}=n;return[i,{input:$o(n,Mo),type:"infinite"}]}return[i,T(T({},typeof n<"u"&&n!==ye&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function cn(e){const t=[e.path.flatMap(n=>n.split("."))];return e.prefix&&t.unshift([e.prefix]),t}function ct(e){return Br(e)?e():e}function Wo(e){var t;const{input:n,query:r,path:i,queryKey:s,opts:a}=e,c=n===ye,l=async u=>{var d;const m=T(T({},a),{},{trpc:T(T({},a?.trpc),!(a==null||(d=a.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})});return await r(...at(s,m,{direction:u.direction,pageParam:u.pageParam}))};return Object.assign(Fn(T(T({},a??{}),{},{queryKey:s,queryFn:c?ye:l,initialPageParam:(t=a?.initialCursor)!==null&&t!==void 0?t:n?.cursor})),{trpc:Qe({path:i})})}function Qo(e){var t,n;const{mutate:r,path:i,prefix:s,opts:a,overrides:c}=e,l=ct(e.queryClient),u=cn({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:(p=>p.originalFn()),h=async p=>await r(...at([...u,{input:p}],a));return T(T({},a),{},{mutationKey:u,mutationFn:h,onSuccess(...p){var f,w;return m({originalFn:()=>{var j,I,P;return(j=a==null||(I=a.onSuccess)===null||I===void 0?void 0:I.call(a,...p))!==null&&j!==void 0?j:d==null||(P=d.onSuccess)===null||P===void 0?void 0:P.call(d,...p)},queryClient:l,meta:(f=(w=a?.meta)!==null&&w!==void 0?w:d?.meta)!==null&&f!==void 0?f:{}})},trpc:Qe({path:i})})}function Uo(e){const{input:t,query:n,path:r,queryKey:i,opts:s}=e,a=ct(e.queryClient),c=t===ye,l=async u=>{var d;const m=T(T({},s),{},{trpc:T(T({},s?.trpc),!(s==null||(d=s.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})}),h=u.queryKey,p=await n(...at(h,m));return Ur(p)?Bo(p,a,h):p};return Object.assign(Bn(T(T({},s),{},{queryKey:i,queryFn:c?ye:l})),{trpc:Qe({path:r})})}const Ko=e=>{const{subscribe:t,path:n,queryKey:r,input:i,opts:s={}}=e,a="enabled"in s?!!s.enabled:i!==ye,c=l=>t(n.join("."),i===ye?void 0:i,l);return T(T({},s),{},{enabled:a,subscribe:c,queryKey:r,trpc:Qe({path:n})})};function Ho(e){const t=e.keyPrefix,n=r=>(i,s,a)=>"router"in e?Promise.resolve(ct(e.ctx)).then(c=>ro({router:e.router,path:i,getRawInput:async()=>s,ctx:c,type:r,signal:void 0,batchIndex:0})):(e.client instanceof sn?e.client:Ao(e.client))[r](i,s,a);return tn(({args:r,path:i})=>{const s=[...i],a=s.pop(),[c,l]=r;return{"~types":void 0,pathKey:()=>ie({path:s,type:"any",prefix:t}),pathFilter:()=>T(T({},c),{},{queryKey:ie({path:s,type:"any",prefix:t})}),queryOptions:()=>Uo({input:c,opts:l,path:s,queryClient:e.queryClient,queryKey:ie({path:s,input:c,type:"query",prefix:t}),query:n("query")}),queryKey:()=>ie({path:s,input:c,type:"query",prefix:t}),queryFilter:()=>T(T({},l),{},{queryKey:ie({path:s,input:c,type:"query",prefix:t})}),infiniteQueryOptions:()=>Wo({input:c,opts:l,path:s,queryKey:ie({path:s,input:c,type:"infinite",prefix:t}),query:n("query")}),infiniteQueryKey:()=>ie({path:s,input:c,type:"infinite",prefix:t}),infiniteQueryFilter:()=>T(T({},l),{},{queryKey:ie({path:s,input:c,type:"infinite",prefix:t})}),mutationOptions:()=>{var u;return Qo({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:()=>cn({path:s,prefix:t}),subscriptionOptions:()=>Ko({opts:l,path:s,input:c,queryKey:ie({path:s,input:c,type:"any",prefix:t}),subscribe:n("subscription")})}[a]()})}function Vo(){const e=se(null),t=se(null),n=s=>{const a=be(()=>Ho({client:s.trpcClient,queryClient:s.queryClient,keyPrefix:s.keyPrefix}),[s.trpcClient,s.queryClient,s.keyPrefix]);return W(e.Provider,{value:s.trpcClient},W(t.Provider,{value:a},s.children))};n.displayName="TRPCProvider";function r(){const s=ae(t);if(!s)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return s}function i(){const s=ae(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 Xe={lan:new Set,animepahe:new Set,jasmr:new Set};function ve(e){for(const t of[...Xe[e]])try{t()}catch(n){console.error(`auth-bus listener failed (${e}):`,n)}}function ln(e,t){return Xe[e].add(t),()=>{Xe[e].delete(t)}}const Go=e=>new Promise(t=>setTimeout(t,e)),un=async(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 Go(Math.min(500*2**a,4e3)),s=await fetch(e,{...t,headers:{...n,...t?.headers}});return s},jc=async(e,t)=>{const n=await un(e,t);if(!n.ok){const r=await n.text().catch(()=>"");let i={};try{i=JSON.parse(r)}catch{}const s=typeof i.error=="string"?i.error:"";throw n.status===403&&s==="AUTH_REQUIRED"&&i.provider==="animepahe"&&ve("animepahe"),n.status===403&&s==="AUTH_REQUIRED"&&i.provider==="jasmr"&&ve("jasmr"),n.status===401&&s==="LAN_AUTH_REQUIRED"&&ve("lan"),new Error(s||`Failed to fetch from ${e}`)}return n.json()};async function Yo(e,t){const n=await un(e,t);if(n.status===401)try{(await n.clone().json())?.error==="LAN_AUTH_REQUIRED"&&ve("lan")}catch{}return await Jo(n),n}async function Jo(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")&&ve(s.provider),(i.message==="LAN_AUTH_REQUIRED"||s?.code==="LAN_AUTH_REQUIRED")&&ve("lan")}}catch{}}const{TRPCProvider:Xo,useTRPC:C}=Vo(),J=No({links:[wo({url:"/api/trpc",fetch:Yo})]}),Ee=new Map,Zo=500,ei=(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(Ee.has(i))return Ee.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 Ee.size>Zo&&Ee.clear(),Ee.set(i,s),s},Dc=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 $c(e){return e?e.replace(/<[^>]*>?/gm,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").trim():""}function Mc(e){return e==null?e:e>10?Number((e/10).toFixed(1)):e}const ti=(...e)=>e.filter(Boolean).join(" "),dn=se(void 0),ni=()=>{const e=ae(dn);if(e===void 0)throw new Error("useTitlePreference must be used within a TitlePreferenceProvider");return e},zc=()=>{const e=C();return G({...e.data.spotlight.queryOptions(),staleTime:1e3*60*5,retry:1})},Fc=(e="TRENDING_DESC",t=10)=>it({queryKey:["trendingList",e,t],queryFn:({pageParam:n=1})=>J.data.popularList.query({sort:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),Bc=(e="TV",t=12)=>it({queryKey:["latestReleases",e,t],queryFn:({pageParam:n=1})=>J.data.latestReleases.query({format:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),Wc=(e,t="TV",n=!0)=>{const r=C();return G({...r.data.seasonal.queryOptions({page:e,format:t}),enabled:n,staleTime:1e3*60*5})},ri=["query","sortBy","type","status","season","year","country","genres","excludeGenres","excludeTags","minScore","minEpisodes","adult"],Qc=(e,t,n=14)=>{const r=C(),i=new URLSearchParams(e),s={page:t,limit:n};for(const a of ri){const c=i.get(a);c!==null&&(s[a]=c)}return G({...r.data.search.queryOptions(s),enabled:e!=null})},Uc=()=>{const e=C();return G(e.queue.list.queryOptions())},oi=()=>{const e=C(),t=K();return X(e.queue.add.mutationOptions({onSuccess:n=>{n.queued?_.success("Added to queue"):_.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]})},onError:n=>{_.error(`Failed to update queue: ${n.message}`)}}))},Kc=()=>{const e=C(),t=K();return X(e.queue.remove.mutationOptions({onSuccess:()=>{_.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{_.error(`Failed to remove: ${n.message}`)}}))},Hc=(e,t=!0)=>G({queryKey:["queue-remaining",e],queryFn:()=>J.watchlist.queueRemaining.query({showId:e}),enabled:!!e&&t,staleTime:1e3*60}),Vc=()=>{const e=C(),t=K();return X(e.queue.addBatch.mutationOptions({onSuccess:(n,r)=>{const i=n.added??r.episodeNumbers.length;_.success(`${i} ${i===1?"episode":"episodes"} added to queue`),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]})},onError:n=>{_.error(`Failed to update queue: ${n.message}`)}}))},Gc=()=>{const e=C(),t=K();return X(e.queue.removeMany.mutationOptions({onSuccess:()=>{_.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{_.error(`Failed to remove: ${n.message}`)}}))},Yc=()=>{const e=C(),t=K();return X(e.queue.clear.mutationOptions({onSuccess:()=>{_.success("Queue cleared"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{_.error(`Failed to clear queue: ${n.message}`)}}))},Jc=()=>{const e=C(),t=K(),n=e.queue.list.queryOptions().queryKey;return X(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())}}))},ii=["status","showMature","query","type","season","year","genres","excludeGenres","sortBy","titlePreference"];function lt(e,t,n){const r=new URLSearchParams(e),i={page:t,limit:n};for(const s of ii){const a=r.get(s);a!==null&&(i[s]=a)}return i}const Xc=(e,t="",n,r=14)=>G({queryKey:["watchlist",e,t,n,r],queryFn:async()=>{const i=new URLSearchParams(t);return i.set("status",e),await J.watchlist.list.query(lt(i.toString(),n,r))}}),Zc=(e="")=>it({queryKey:["allContinueWatching",e],queryFn:async({pageParam:t=1})=>await J.watchlist.continueWatchingAll.query(lt(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)})}),el=(e="",t,n=14)=>G({queryKey:["allContinueWatching",e,t,n],queryFn:async()=>await J.watchlist.continueWatchingAll.query(lt(e,t,n))}),tl=()=>{const e=C(),t=K();return X(e.watchlist.remove.mutationOptions({onSuccess:()=>{_.success("Removed from watchlist"),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:["watchlist"]})},onError:n=>{_.error(`Failed to remove: ${n.message}`)}}))},nl=()=>{const e=C(),t=K();return X(e.watchlist.batchStatus.mutationOptions({onSuccess:n=>{_.success(`Status updated for ${n.updated??0} items`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:["watchlist"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{_.error(`Failed to update statuses: ${n.message}`)}}))},rl=()=>{const e=C(),t=K();return X(e.watchlist.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;_.success(`Removed ${r} ${r===1?"item":"items"} from watchlist`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:["watchlist"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{_.error(`Failed to remove: ${n.message}`)}}))},ol=()=>{const e=C(),t=K();return X(e.continueWatching.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;_.success(`Removed ${r} ${r===1?"item":"items"} from continue watching`),t.invalidateQueries(e.continueWatching.pathFilter()),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{_.error(`Failed to remove: ${n.message}`)}}))},mn=(e=!0)=>{const t=C();return G({...t.notifications.list.queryOptions(),enabled:e,refetchInterval:3e4})},hn=(e=!0)=>{const t=C();return G({...t.data.systemNotifications.queryOptions(),enabled:e,refetchInterval:3e4})},pn=(e=!0)=>{const t=C();return G({...t.discovery.status.queryOptions(),enabled:e,refetchInterval:n=>n.state.data?.running?2e3:!1})},si=()=>{const e=C(),t=K(),n=e.discovery.status.queryOptions().queryKey;return X(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})}}))},ai=()=>{const e=C(),t=K();return X(e.notifications.dismiss.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},ci=()=>{const e=C(),t=K();return X(e.notifications.clearAll.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},il=()=>{const e=C();return G({...e.continueWatching.thisWeek.queryOptions(),staleTime:1e3*60*5})},sl=()=>{const e=C();return G({...e.data.genresAndTags.queryOptions(),staleTime:1e3*60*60})},al=()=>G({queryKey:["genreCards"],queryFn:()=>J.insights.genreCards.query()}),li="_container_z68uz_1",ui="_bellBtn_z68uz_7",di="_badge_z68uz_56",mi="_dropdown_z68uz_96",hi="_dropdownHeader_z68uz_127",pi="_clearAllBtn_z68uz_141",fi="_discoveryStatusRow_z68uz_156",yi="_statusDot_z68uz_167",vi="_statusDotRunning_z68uz_174",gi="_statusDotOk_z68uz_179",bi="_statusDotInfo_z68uz_183",_i="_statusDotError_z68uz_187",wi="_statusDotIdle_z68uz_191",Ei="_list_z68uz_205",Si="_item_z68uz_219",ki="_thumbnail_z68uz_234",Pi="_itemInfo_z68uz_243",xi="_itemTitle_z68uz_248",Ti="_itemMeta_z68uz_259",Ii="_systemItemMeta_z68uz_269",Oi="_removeItem_z68uz_286",Ci="_queueItem_z68uz_316",Ni="_emptyState_z68uz_320",v={container:li,bellBtn:ui,badge:di,dropdown:mi,dropdownHeader:hi,clearAllBtn:pi,discoveryStatusRow:fi,statusDot:yi,statusDotRunning:vi,statusDotOk:gi,statusDotInfo:bi,statusDotError:_i,statusDotIdle:wi,list:Ei,item:Si,thumbnail:ki,itemInfo:Pi,itemTitle:xi,itemMeta:Ti,systemItemMeta:Ii,removeItem:Oi,queueItem:Ci,emptyState:Ni},Ai=({notification:e})=>{const t=ai(),n=oi(),[r,i]=rt.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}=ni(),u=l==="nativeName"?e.nativeName||e.name:l==="englishName"&&e.englishName||e.name;return o(Y,{to:`/watch/${e.showId}/${e.episodeNumber}`,className:v.item,onClick:a,children:[o("img",{src:ei(e.thumbnail,48,64),alt:e.name,className:v.thumbnail,loading:"lazy",decoding:"async"}),o("div",{className:v.itemInfo,children:[o("span",{className:v.itemTitle,children:u}),o("span",{className:v.itemMeta,children:["New Episode ",e.episodeNumber]})]}),o("button",{className:`${v.removeItem} ${v.queueItem}`,onClick:c,"aria-label":"Add notification to queue",children:r?o(b,{name:"check"}):o(b,{name:"plus"})}),o("button",{className:v.removeItem,onClick:s,"aria-label":"Remove notification",children:o(b,{name:"times"})})]})};function Ke({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 Li=({count:e=3})=>o(U,{children:Array.from({length:e}).map((t,n)=>o("div",{className:v.item,style:{borderBottom:"1px solid var(--border-primary)",pointerEvents:"none"},children:[o("div",{className:v.thumbnail,style:{overflow:"hidden"},children:o(Ke,{width:"100%",height:"100%",variant:"rectangular"})}),o("div",{className:v.itemInfo,children:[o(Ke,{width:"80%",height:"1rem",variant:"text",style:{marginBottom:"4px"}}),o(Ke,{width:"40%",height:"0.7rem",variant:"rectangular",style:{borderRadius:"var(--radius-sm)"}})]})]},n))}),qi=()=>{const{data:e=[],isLoading:t}=mn(),{data:n=[]}=hn(),{data:r}=pn(),i=ci(),s=K(),[a,c]=k(null);E(()=>{s.invalidateQueries({queryKey:["notifications"]})},[s]);const l=()=>{i.mutate(void 0)},u=n.find(d=>d.id===a)??null;return o("div",{className:v.dropdown,children:[o("div",{className:v.dropdownHeader,children:[o("h4",{children:"Notifications"}),e.length>0&&o("button",{className:v.clearAllBtn,onClick:l,children:"Clear All"})]}),o("div",{className:v.discoveryStatusRow,children:r?.running?o(U,{children:[o("span",{className:`${v.statusDot} ${v.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(U,{children:[o("span",{className:`${v.statusDot} ${v.statusDotOk}`,"aria-hidden":"true"}),o("span",{children:["Discovery complete — checked ",r.total," ",r.total===1?"show":"shows"]})]}):r?.state==="empty"?o(U,{children:[o("span",{className:`${v.statusDot} ${v.statusDotInfo}`,"aria-hidden":"true"}),o("span",{children:"No shows set to Watching — nothing to check"})]}):r?.state==="error"?o(U,{children:[o("span",{className:`${v.statusDot} ${v.statusDotError}`,"aria-hidden":"true"}),o("span",{children:"Last check failed — will retry automatically"})]}):o(U,{children:[o("span",{className:`${v.statusDot} ${v.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:v.list,children:t&&n.length===0?o(Li,{count:4}):o(U,{children:[n.map(d=>o("div",{className:v.item,children:[o("div",{className:v.thumbnail,style:{background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:0,boxShadow:"none"},children:o(b,{name:"info-circle",size:32,color:"#6c9fff"})}),o("div",{className:v.itemInfo,children:[o("span",{className:v.itemTitle,children:d.title}),o("button",{type:"button",className:v.systemItemMeta,onClick:()=>c(d.id),title:"View full status",children:d.message.length>40?d.message.slice(0,40)+"…":d.message})]}),o("button",{className:v.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:o(b,{name:"plus"})}),o("button",{className:v.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:o(b,{name:"times"})})]},d.id)),n.length>0&&e.length>0&&o("div",{className:v.notificationDivider}),e.length>0?e.map(d=>o(Ai,{notification:d},d.id)):!t&&n.length===0&&o("div",{className:v.emptyState,children:"No new notifications"})]})}),u&&Ut(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(b,{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)]})},Ri=()=>{const[e,t]=k(!1),n=F(null),r=K(),i=C(),s=si(),{data:a=[]}=mn(),{data:c=[]}=hn(),{data:l}=pn(),u=a.length+c.length,d=u>5?"5+":u,m=F(!1);E(()=>{const p=f=>{n.current&&!n.current.contains(f.target)&&t(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),E(()=>{const p=!!l?.running;m.current&&!p&&(r.invalidateQueries(i.notifications.pathFilter()),r.invalidateQueries(i.discovery.pathFilter())),m.current=p},[l?.running,r,i]);const h=()=>{const p=!e;t(p),p&&s.mutate()};return o("div",{className:v.container,ref:n,children:[o("button",{className:v.bellBtn,onClick:h,"aria-label":"Notifications",children:[o(b,{name:"bell"}),u>0&&o("span",{className:v.badge,children:d})]}),e&&o(qi,{})]})},fn=se(void 0),yn=()=>{const e=ae(fn);if(e===void 0)throw new Error("useLowEndMode must be used within a LowEndModeProvider");return e},Ce=e=>{const t=C();return G({...t.settings.getByKey.queryOptions({key:e}),select:n=>n.value})},vn=()=>{const e=C(),t=K();return X(e.settings.set.mutationOptions({onSuccess:()=>{_.success("Setting updated!"),t.invalidateQueries(e.settings.pathFilter()),t.invalidateQueries({queryKey:["settings"]})},onError:n=>{_.error(`Failed to update setting: ${n.message}`)}}))},gn=se(void 0),cl=()=>{const e=ae(gn);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},ll=[{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"}],Tt={iris:{fill:"#897cff",stroke:"#5646db"},mochi:{fill:"#e3e1ee",stroke:"#b3b1c6"},sakura:{fill:"#e1afef",stroke:"#a978a9"}},fe={x:-.6,y:-2,w:44.8,h:14},It=15,Ot={w:13.6,h:10.2},Pe=[{x:0,y:.5},{x:It,y:-.9},{x:It*2,y:.3}],Ct=(e,t,n,r=0)=>{if(n.width<=0)return-1;const i=n.width/fe.w,s=(e-n.left)/i+fe.x,a=(t-n.top)/i+fe.y;for(let c=0;c<Pe.length;c++){const l=s-Pe[c].x,u=a-Pe[c].y;if(l>=-r&&l<=Ot.w+r&&u>=-r&&u<=Ot.h+r)return c}return-1},ji="_logo_1z0j0_1",Di="_gaze_1z0j0_8",$i="_face_1z0j0_16",Mi="_faceNormal_1z0j0_22",zi="_facePet_1z0j0_23",Fi="_faceSquint_1z0j0_24",Bi="_faceSleep_1z0j0_25",Wi="_line_1z0j0_33",Qi="_weight_1z0j0_41",Ui="_shift_1z0j0_56",Ki="_rock_1z0j0_70",Hi="_glance_1z0j0_88",Vi="_blink_1z0j0_107",Gi="_blinkDouble_1z0j0_112 _blink_1z0j0_107",Yi="_blinkSlow_1z0j0_136 _blink_1z0j0_107",Ji="_cheer_1z0j0_172",Xi="_heart_1z0j0_176",ee={logo:ji,gaze:Di,face:$i,faceNormal:Mi,facePet:zi,faceSquint:Fi,faceSleep:Bi,line:Wi,weight:Qi,"dango-weight":"_dango-weight_1z0j0_1",shift:Ui,"dango-shift":"_dango-shift_1z0j0_1",rock:Ki,"dango-rock":"_dango-rock_1z0j0_1",glance:Hi,"dango-glance":"_dango-glance_1z0j0_1",blink:Vi,blinkDouble:Gi,"dango-blink-double":"_dango-blink-double_1z0j0_1",blinkSlow:Yi,"dango-blink-slow":"_dango-blink-slow_1z0j0_1","dango-nudge":"_dango-nudge_1z0j0_1",cheer:Ji,heart:Xi,"dango-heart":"_dango-heart_1z0j0_1"},Zi="m 7,0 c -3.9372984,0 -7.10030437,2.4883888 -7,6 0.13572675,4.751733 5.0802847,4.156395 7,4.156395 1.2538994,0 6.530451,0.392468 6.584946,-4.168088 C 13.622023,2.8853946 10.937298,0 7,0 Z",es="m 4.9623825,3.416 c -0.5858889,0 -0.6520292,2.3368563 -0.024765,2.3368563 0.6604959,0 0.6704653,-2.3368563 0.024765,-2.3368563 z",ts="M 8.588001,3.416 C 8.0021121,3.416 7.9359718,5.7528563 8.563236,5.7528563 9.2237319,5.7528563 9.2337013,3.416 8.588001,3.416 Z",ns="M 4.85,5.15 Q 5.285,4.0 5.72,5.15",rs="M 8.25,5.15 Q 8.618,4.0 8.99,5.15",os="M 4.82,3.9 L 5.6,4.62 L 4.82,5.34",is="M 9.08,3.9 L 8.3,4.62 L 9.08,5.34",ss="M 4.9,4.72 Q 5.285,5.28 5.67,4.72",as="M 8.25,4.72 Q 8.618,5.28 9.0,4.72",Ze=[{lag:.8,hue:"iris",blink:"double",motion:"weight",glances:!1},{lag:1.4,hue:"sakura",blink:"slow",motion:"shift",glances:!1},{lag:1,hue:"mochi",blink:"slow",motion:"rock",glances:!0}],Se=(e,t)=>e+Math.random()*(t-e),Nt=Ze.map(()=>({blinkDelay:-Se(0,9),blinkDuration:Se(3.4,8.6),motionDelay:-Se(0,9),motionDuration:Se(5.5,11),glanceDelay:-Se(0,11)})),cs={double:ee.blinkDouble,slow:ee.blinkSlow},ls=[{x:7,y:4.2,delay:0,drift:"0px"},{x:9.6,y:6.4,delay:-.3,drift:"-0.9px"},{x:4.6,y:6.1,delay:-.6,drift:"0.8px"},{x:8.2,y:3.4,delay:-.9,drift:"-0.4px"}],ut=({className:e})=>{const{data:t}=Ce("dangoGaze"),{lowEndMode:n}=yn(),r=t!=="false"&&!n,i=(c,l,u)=>{const d=Nt[l];return o("g",{transform:`translate(${Pe[l].x} ${Pe[l].y})`,children:o("g",{"data-dango-face-slot":l,"data-face":"normal",className:r?ee[c.motion]:void 0,style:r?{animationDelay:`${d.motionDelay}s`,animationDuration:`${d.motionDuration}s`}:void 0,children:o("g",{"data-nudge":!0,children:u})})},c.hue)},s=c=>o("path",{fill:Tt[c.hue].fill,stroke:Tt[c.hue].stroke,strokeWidth:"0.9",strokeLinejoin:"round",paintOrder:"stroke fill",d:Zi}),a=(c,l)=>{const u=Nt[l],d=r?{animationDelay:`${u.blinkDelay}s`,animationDuration:`${u.blinkDuration}s`}:void 0,m=(f,w)=>o(U,{children:[o("path",{className:ee.line,d:f}),o("path",{className:ee.line,d:w})]}),h=(f,w,N=!0)=>o("g",{className:`${ee.face} ${ee[`face${f}`]}`,children:o("g",{className:r&&N?cs[c.blink]:void 0,style:N?d:void 0,children:w})},f),p=o("g",{className:ee.gaze,style:{"--lag":c.lag,transitionDuration:`${.1+c.lag*.18}s`},children:[h("Normal",o(U,{children:[o("path",{fill:"#140f15",d:es}),o("path",{fill:"#140f15",d:ts})]})),h("Pet",m(ns,rs),!1),h("Squint",m(os,is),!1),h("Sleep",m(ss,as),!1)]});return o(U,{children:[c.glances?o("g",{className:r?ee.glance:void 0,style:r?{animationDelay:`${u.glanceDelay}s`}:void 0,children:p}):p,r&&o("g",{className:ee.cheer,children:ls.map(f=>o("text",{className:ee.heart,x:f.x,y:f.y,fill:"var(--color-danger)",style:{"--drift":f.drift,animationDelay:`${f.delay}s`},children:"♥"},f.x))})]})};return o("svg",{viewBox:`${fe.x} ${fe.y} ${fe.w} ${fe.h}`,className:e?`${ee.logo} ${e}`:ee.logo,role:"img","aria-label":"dango","data-dango-gaze-origin":"",children:[Ze.map((c,l)=>i(c,l,s(c))),Ze.map((c,l)=>i(c,l,a(c,l)))]})},bn=se(void 0),dt=()=>{const e=ae(bn);if(e===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return e},_n=se(void 0),wn=()=>{const e=ae(_n);if(e===void 0)throw new Error("useContentType must be used within a ContentTypeProvider");return e},et="virtual-keyboard:hide",At="virtual-keyboard:enabled-change",En="virtual_keyboard_enabled",us=!1;function Lt(){const e=localStorage.getItem(En);return e===null?us:e==="true"}const qt=e=>e instanceof HTMLInputElement&&e.type==="text"&&!e.disabled&&!e.readOnly;function ds(){window.dispatchEvent(new CustomEvent(et))}function ms(){const[e,t]=k(!1),[n,r]=k(Lt),i=F(null);return E(()=>{const s=d=>{n&&qt(d.target)&&(i.current=d.target,t(!0))},a=d=>{d.target===i.current&&window.setTimeout(()=>{if(qt(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!==En)return;const m=d.newValue==="true";r(m),m||c()},u=()=>{const d=Lt();r(d),d||c()};return document.addEventListener("focusin",s),document.addEventListener("focusout",a),window.addEventListener(et,c),window.addEventListener("storage",l),window.addEventListener(At,u),()=>{document.removeEventListener("focusin",s),document.removeEventListener("focusout",a),window.removeEventListener(et,c),window.removeEventListener("storage",l),window.removeEventListener(At,u)}},[n]),{activeInputRef:i,isVisible:n&&e,hide:()=>t(!1)}}const hs="_header_q6huj_1",ps="_hidden_q6huj_21",fs="_scrolled_q6huj_25",ys="_logo_q6huj_31",vs="_headerInner_q6huj_44",gs="_leftSection_q6huj_54",bs="_desktopNav_q6huj_60",_s="_navLink_q6huj_67",ws="_navLinkActive_q6huj_83",Es="_rightSection_q6huj_102",Ss="_searchWrapper_q6huj_108",ks="_searchInput_q6huj_114",Ps="_searchButton_q6huj_144",xs="_searchIcon_q6huj_168",Ts="_profileBtn_q6huj_178",Is="_profileImg_q6huj_211",Os="_hamburgerBtn_q6huj_217",Cs="_mobileSearchBar_q6huj_244",Ns="_mobileSearchBarHidden_q6huj_271",As="_mobileSearchInner_q6huj_288",Ls="_mobileSearchIcon_q6huj_304",qs="_mobileSearchInput_q6huj_311",S={header:hs,hidden:ps,scrolled:fs,logo:ys,headerInner:vs,leftSection:gs,desktopNav:bs,navLink:_s,navLinkActive:ws,rightSection:Es,searchWrapper:Ss,searchInput:ks,searchButton:Ps,searchIcon:xs,profileBtn:Ts,profileImg:Is,hamburgerBtn:Os,mobileSearchBar:Cs,mobileSearchBarHidden:Ns,mobileSearchInner:As,mobileSearchIcon:Ls,mobileSearchInput:qs},Rs=async()=>{let e;try{e=await J.auth.syncSettings.query()}catch{return null}const t=e.actualActiveProvider;if(t==="github")try{const n=await J.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 J.auth.user.query();if(n)return{name:n.name,picture:n.picture,email:n.email,provider:"google"}}catch{}return null},js=()=>{const{toggleSidebar:e}=dt(),{contentType:t}=wn(),[n,r]=k(""),[i,s]=k(!0),[a,c]=k(!1),[l,u]=k(!0),[d,m]=k(!1),h=Ln(),p=ot(),f=F(null),w=F(!1),N=F(null),j=F(null),I=F(null),P=F(null),D=F(!1),{data:oe}=G({queryKey:["sync-profile"],queryFn:Rs,staleTime:3e4});E(()=>{const O=window.visualViewport;if(!O)return;const $=()=>{P.current?.style.setProperty("--vv-top",`${O.offsetTop}px`)};return $(),O.addEventListener("scroll",$),O.addEventListener("resize",$),()=>{O.removeEventListener("scroll",$),O.removeEventListener("resize",$)}},[]),E(()=>{const O=()=>{f.current&&(window.clearTimeout(f.current),f.current=null)},$=()=>{O(),!(window.scrollY<=10)&&(f.current=window.setTimeout(()=>{D.current||s(!1)},2500))},le=()=>{w.current||(w.current=!0,N.current=requestAnimationFrame(()=>{w.current=!1,N.current=null;const ue=window.scrollY<=10;u(we=>we===ue?we:ue),s(we=>we||!0),$()}))},mt=ue=>{(ue.metaKey||ue.ctrlKey)&&ue.key==="k"?(ue.preventDefault(),Z.current?.focus({preventScroll:!0})):ue.key==="Escape"&&document.activeElement===Z.current&&Z.current?.blur()},Ae=P.current,ht=()=>{D.current=!0},pt=()=>{D.current=!1,$()};return window.addEventListener("scroll",le,{passive:!0}),window.addEventListener("keydown",mt),Ae?.addEventListener("pointerenter",ht),Ae?.addEventListener("pointerleave",pt),()=>{window.removeEventListener("scroll",le),window.removeEventListener("keydown",mt),Ae?.removeEventListener("pointerenter",ht),Ae?.removeEventListener("pointerleave",pt),O(),N.current!==null&&(cancelAnimationFrame(N.current),N.current=null),w.current=!1}},[a]);const Z=rt.useRef(null),y=()=>window.innerWidth<=1024,g=()=>{y()?(m(!0),setTimeout(()=>I.current?.focus({preventScroll:!0}),50)):document.activeElement===Z.current&&n.trim()?_e():Z.current?.focus({preventScroll:!0})},B=O=>{j.current?.contains(O.relatedTarget)||m(!1)},R=p.pathname==="/music"?"Search music...":t==="manga"?"Search manga...":t==="tv"?"Search TV & movies...":t==="asmr"?"Search ASMR...":"Search anime...",te=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=O=>{ds();const $=n.trim();if($){if(p.pathname==="/music"){const le=new URLSearchParams(p.search);le.set("q",$),h(`/music?${le.toString()}`);return}h(t==="manga"?`/manga?q=${encodeURIComponent($)}`:t==="tv"?`/tv-search?q=${encodeURIComponent($)}`:t==="asmr"?`/asmr?q=${encodeURIComponent($)}`:`/search?query=${encodeURIComponent($)}`)}};return o(U,{children:o("header",{ref:P,className:`${S.header} ${i?"":S.hidden} ${l?"":S.scrolled}`,children:[o("div",{className:S.headerInner,children:[o("div",{className:S.leftSection,children:[o("button",{className:S.hamburgerBtn,onClick:e,"aria-label":"Menu",children:o(b,{name:"bars"})}),o(Y,{to:"/",className:S.logo,"aria-label":"Ani-Web Home",children:o(ut,{})}),o("nav",{className:S.desktopNav,children:[o(Y,{to:"/",className:`${S.navLink} ${p.pathname==="/"?S.navLinkActive:""}`,children:"Home"}),o(Y,{to:te.to,className:`${S.navLink} ${p.pathname.startsWith(te.to)?S.navLinkActive:""}`,children:te.label}),t==="anime"&&o(Y,{to:"/insights",className:`${S.navLink} ${p.pathname==="/insights"?S.navLinkActive:""}`,children:"Insights"}),o(Y,{to:"/settings",className:`${S.navLink} ${p.pathname.startsWith("/settings")?S.navLinkActive:""}`,children:"Settings"})]})]}),o("div",{className:S.rightSection,children:[o("div",{className:S.searchWrapper,children:[o("input",{ref:Z,type:"text","data-virtual-keyboard":"true",className:S.searchInput,placeholder:R,value:n,onChange:O=>r(O.target.value),onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:O=>{O.key==="Enter"&&_e()}}),o("button",{type:"button",className:S.searchButton,"aria-label":"Search",onMouseDown:O=>O.preventDefault(),onClick:g,children:o(b,{name:"search",className:S.searchIcon})})]}),o(Ri,{}),o(Y,{to:"/settings?tab=sync",className:S.profileBtn,"aria-label":"Sync settings",children:oe?.picture?o("img",{src:oe.picture,alt:oe.name,className:S.profileImg,referrerPolicy:"no-referrer",decoding:"async"}):oe?.provider==="github"?o(b,{name:"github"}):o(b,{name:"cloud"})})]})]}),d&&o("div",{className:`${S.mobileSearchBar} ${i?"":S.mobileSearchBarHidden}`,ref:j,onBlur:B,children:o("div",{className:S.mobileSearchInner,children:[o(b,{name:"search",className:S.mobileSearchIcon}),o("input",{ref:I,type:"text","data-virtual-keyboard":"true",className:S.mobileSearchInput,placeholder:R,value:n,onChange:O=>r(O.target.value),onKeyDown:O=>{O.key==="Enter"?(_e(),m(!1)):O.key==="Escape"&&m(!1)}})]})})]})})},tt="agreedToViewMature";function Rt(){try{return localStorage.getItem(tt)==="true"}catch{return!1}}function Ds(){const[e,t]=k(Rt);E(()=>{const i=()=>t(Rt());return window.addEventListener("storage",i),window.addEventListener("focus",i),()=>{window.removeEventListener("storage",i),window.removeEventListener("focus",i)}},[]);const n=Q(()=>{try{localStorage.setItem(tt,"true")}catch{}t(!0)},[]),r=Q(()=>{try{localStorage.removeItem(tt)}catch{}t(!1)},[]);return{hasConsent:e,grant:n,revoke:r}}const $s="_sidebar_153jc_1",Ms="_open_153jc_20",zs="_sidebarHeader_153jc_25",Fs="_closeBtn_153jc_33",Bs="_logo_153jc_57",Ws="_navSection_153jc_69",Qs="_navLink_153jc_75",Us="_active_153jc_108",Ks="_overlay_153jc_118",Hs="_versionInfo_153jc_138",ne={sidebar:$s,open:Ms,sidebarHeader:zs,closeBtn:Fs,logo:Bs,navSection:Ws,navLink:Qs,active:Us,overlay:Ks,versionInfo:Hs},Vs="3.5.8",Sn={version:Vs},Gs=()=>{const{isOpen:e,setIsOpen:t}=dt(),{contentType:n}=wn(),{hasConsent:r}=Ds(),i=()=>{t(!1)},s=n==="manga",a=n==="tv",c=n==="asmr",l=[{to:"/",icon:o(b,{name:"home"}),label:"Home"},s?{to:"/manga",icon:o(b,{name:"book"}),label:"Manga"}:a?{to:"/tv-search",icon:o(b,{name:"tv"}),label:"TV and Movies"}:c?{to:"/asmr",icon:o(b,{name:"headphones"}),label:"ASMR"}:{to:"/search",icon:o(b,{name:"search"}),label:"Search"},s?{to:"/reading-list",icon:o(b,{name:"bookmark"}),label:"Reading List"}:a?{to:"/tv-watchlist",icon:o(b,{name:"clock"}),label:"TV Watchlist"}:c?{to:"/listening-list",icon:o(b,{name:"history"}),label:"Listening List"}:{to:"/watchlist",icon:o(b,{name:"clock"}),label:"Watchlist"},...n==="anime"?[{to:"/insights",icon:o(b,{name:"chart-pie"}),label:"Insights"}]:[],{to:"/trackers",icon:o(b,{name:"sync-alt"}),label:"Trackers"},{to:"/radio",icon:o(b,{name:"broadcast-tower"}),label:"Radio"},{to:"/music",icon:o(b,{name:"headphones"}),label:"Music"},...r?[{to:"/mature",icon:o(b,{name:"pepper-hot"}),label:"Mature"}]:[],{to:"/settings",icon:o(b,{name:"cog"}),label:"Settings"}];return o(U,{children:[o("aside",{className:`${ne.sidebar} ${e?ne.open:""} sidebar`,children:[o("div",{className:ne.sidebarHeader,children:[o("button",{className:ne.closeBtn,onClick:()=>t(!1),"aria-label":"Close menu",children:"×"}),o(Y,{to:"/",className:ne.logo,onClick:i,children:o(ut,{})})]}),o("nav",{className:ne.navSection,children:l.map(u=>o(qn,{to:u.to,className:({isActive:d})=>`${ne.navLink} ${d?ne.active:""}`,onClick:i,end:u.to==="/",children:[u.icon,o("span",{children:u.label})]},u.to))}),o("div",{className:ne.versionInfo,children:["v",Sn.version]})]}),e&&o("div",{className:ne.overlay,onClick:()=>t(!1),"aria-label":"Close sidebar"})]})},Ys="_footer_1c905_1",Js="_footerInner_1c905_15",Xs="_brandSection_1c905_27",Zs="_logoRow_1c905_39",ea="_logoText_1c905_45",ta="_brandMeta_1c905_51",na="_brandTagline_1c905_60",ra="_statusPill_1c905_67",oa="_statusDot_1c905_80",ia="_linksGrid_1c905_88",sa="_linkColumn_1c905_96",aa="_columnTitle_1c905_102",ca="_bottomBar_1c905_126",la="_copyright_1c905_136",ua="_brand_1c905_27",da="_heartIcon_1c905_152",ma="_backToTop_1c905_157",A={footer:Ys,footerInner:Js,brandSection:Xs,logoRow:Zs,logoText:ea,brandMeta:ta,brandTagline:na,statusPill:ra,statusDot:oa,linksGrid:ia,linkColumn:sa,columnTitle:aa,bottomBar:ca,copyright:la,brand:ua,heartIcon:da,backToTop:ma},ha=()=>{const e=new Date().getFullYear(),t=()=>{window.scrollTo({top:0,behavior:"smooth"})};return o("footer",{className:A.footer,children:[o("div",{className:A.footerInner,children:[o("div",{className:A.brandSection,children:[o("div",{className:A.logoRow,children:o(ut,{className:A.logoText})}),o("div",{className:A.brandMeta,children:[o("div",{className:A.statusPill,children:[o("span",{className:A.statusDot}),o("span",{children:["v",Sn.version]})]}),o("p",{className:A.brandTagline,children:"Fast, local anime streaming."})]})]}),o("div",{className:A.linksGrid,children:[o("div",{className:A.linkColumn,children:[o("h4",{className:A.columnTitle,children:"Navigation"}),o(Y,{to:"/",children:"Home"}),o(Y,{to:"/watchlist",children:"Watchlist"}),o(Y,{to:"/settings",children:"Settings"})]}),o("div",{className:A.linkColumn,children:[o("h4",{className:A.columnTitle,children:"Features"}),o(Y,{to:"/search",children:"Search Anime"}),o(Y,{to:"/trackers",children:"Trackers"}),o(Y,{to:"/insights",children:"Insights"})]}),o("div",{className:A.linkColumn,children:[o("h4",{className:A.columnTitle,children:"Community"}),o("a",{href:"https://discord.gg/2FTSPXCsvn",target:"_blank",rel:"noopener noreferrer",children:[o(b,{name:"discord",style:{marginRight:"6px"}})," Discord"]}),o("a",{href:"https://github.com/serifpersia/dango",target:"_blank",rel:"noopener noreferrer",children:[o(b,{name:"github",style:{marginRight:"6px"}})," GitHub"]})]}),o("div",{className:A.linkColumn,children:[o("h4",{className:A.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:A.bottomBar,children:[o("p",{className:A.copyright,children:["© ",e," ",o("span",{className:A.brand,children:"dango"})," • Crafted with"," ",o(b,{name:"heart",className:A.heartIcon})," by"," ",o("a",{href:"https://github.com/serifpersia",target:"_blank",rel:"noopener noreferrer",children:"serifpersia"})]}),o("button",{className:A.backToTop,onClick:t,"aria-label":"Back to top",children:[o(b,{name:"chevron-up",size:14}),o("span",{children:"Top"})]})]})]})};function kn(e){return JSON.stringify({0:e??{}})}function Pn(e){return`/api/trpc/${e}?batch=1`}function nt(e,t){const n=kn(t),r=Pn(e);try{if(navigator.sendBeacon){navigator.sendBeacon(r,new Blob([n],{type:"application/json"}));return}}catch{}fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}).catch(()=>{})}async function ul(e,t){await fetch(Pn(e),{method:"POST",headers:{"Content-Type":"application/json"},body:kn(t),keepalive:!0})}function dl(e){e&&(nt("discord.clear",{sessionId:e}),nt("discord.heartbeat",{sessionId:e,bye:!0}))}function pa(){const e=ot(),{data:t}=Ce("discordRPCEnabled"),n=F("");n.current||(n.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`tab-${Date.now()}-${Math.random().toString(36).slice(2)}`),E(()=>{if(t===!1||t==="false")return;const r=n.current,i=()=>J.discord.heartbeat.mutate({sessionId:r}).catch(()=>{});i();const s=setInterval(i,15e3),a=()=>{nt("discord.heartbeat",{sessionId:r,bye:!0})};return window.addEventListener("pagehide",a),()=>{clearInterval(s),window.removeEventListener("pagehide",a)}},[t]),E(()=>{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("/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"),J.discord.pageStatus.mutate({page:i}).catch(()=>{})},[e.pathname,t])}function xn(e,t){const[n,r]=k(()=>{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}});E(()=>{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=Q(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 Tn=se(void 0),fa=()=>{const e=ae(Tn);if(!e)throw new Error("useAnimePaheCookie must be used within an AnimePaheCookieProvider");return e},ya="_overlay_1juub_1",va="_fadeIn_1juub_1",ga="_content_1juub_11",ba="_modalIn_1juub_1",_a="_sm_1juub_29",wa="_md_1juub_33",Ea="_lg_1juub_37",Sa="_title_1juub_41",ka="_body_1juub_48",Pa="_footer_1juub_52",ge={overlay:ya,fadeIn:va,content:ga,modalIn:ba,sm:_a,md:wa,lg:Ea,title:Sa,body:ka,footer:Pa};function In({children:e}){return o("h2",{className:ge.title,children:e})}function On({children:e}){return o("div",{className:ge.body,children:e})}function Cn({children:e}){return o("div",{className:ge.footer,children:e})}function Ne({isOpen:e,onClose:t,title:n,children:r,footer:i,width:s="md"}){const a=F(null);return E(()=>{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?Ut(o("div",{role:"presentation",onMouseDown:c=>c.stopPropagation(),children:[o("div",{className:ge.overlay,onClick:()=>t?.(),"aria-hidden":"true"}),o("div",{ref:a,className:`${ge.content} ${ge[s]}`,role:"dialog","aria-modal":"true","aria-label":n,tabIndex:-1,children:[n&&o(In,{children:n}),o(On,{children:r}),i&&o(Cn,{children:i})]})]}),document.body):null}Ne.Header=In;Ne.Body=On;Ne.Actions=Cn;const xa="_container_e96gf_1",Ta="_field_e96gf_9",Ia="_textarea_e96gf_20",Oa="_input_e96gf_40",Ca="_button_e96gf_58",Na="_secondaryButton_e96gf_78",Aa="_actions_e96gf_95",La="_hint_e96gf_104",qa="_link_e96gf_117",H={container:xa,field:Ta,textarea:Ia,input:Oa,button:Ca,secondaryButton:Na,actions:Aa,hint:La,link:qa},Ra="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",ja=e=>{try{return JSON.parse(e.detail)}catch{return null}},Da=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,i]=k(1),[s,a]=k(navigator.userAgent),[c,l]=k(""),[u,d]=k(!1),m=F(null),h=navigator.userAgent,p=/android/i.test(h),f=/firefox|fxios/i.test(h)&&!p,w=!f&&!p&&/chrome|chromium|edg|brave/i.test(h),N=f||w;E(()=>{e&&(i(1),a(navigator.userAgent),l(""),d(!1))},[e]),E(()=>()=>{m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null)},[]);const j=()=>{localStorage.setItem("animepahe_ua",s),window.open("https://animepahe.pw","_blank","noopener,noreferrer"),i(2)},I=()=>{if(u)return;d(!0);const D=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,oe=window.setTimeout(()=>{d(!1),m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null),_.error("Helper not detected — install it via about:debugging first.")},3e3),Z=y=>{const g=ja(y);if(!(!g||g.requestId!==D))if(window.clearTimeout(oe),window.removeEventListener("dango:pahe-cookie",Z),m.current=null,d(!1),g?.ok&&g.cookie)l(g.cookie),_.success("Cookie extracted from helper!");else if(g?.error==="NO_COOKIE"){const B=g.debug?.stores?.length??0,R=g.debug?.names??[];_.error(`Helper found no cf_clearance (checked ${B} stores, saw: ${R.join(", ")||"none"}) — solve the challenge on the AnimePahe tab first.`)}else _.error("Helper request failed — try again.")};m.current=Z,window.addEventListener("dango:pahe-cookie",Z),window.dispatchEvent(new CustomEvent("dango:get-pahe-cookie",{detail:{requestId:D}}))},P=()=>{const D=c.trim();if(!D){_.error("Please enter the cf_clearance cookie");return}try{localStorage.setItem("animepahe_cookie",D),_.success("Cookie updated successfully! Reloading…"),n?.(),t(),window.setTimeout(()=>window.location.reload(),1e3)}catch{_.error("Failed to save cookie")}};return o(Ne,{isOpen:e,onClose:t,title:"AnimePahe Verification Required",children:o("div",{className:H.container,children:r===1?o(U,{children:[o("p",{children:"AnimePahe requires a manual verification to bypass Cloudflare/DDoS-Guard protection."}),o("div",{className:H.field,children:[o("label",{children:"Your User-Agent (will be used for requests):"}),o("textarea",{value:s,readOnly:!0,rows:3,className:H.textarea})]}),o("div",{className:H.actions,children:[o("button",{className:H.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:H.button,onClick:j,children:"Start Verification (Opens AnimePahe)"})]})]}):o(U,{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."]}),N&&o("div",{className:H.hint,children:[o("strong",{children:"Dango helper (one-time setup):"})," ",f?o(U,{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(U,{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:Ra,target:"_blank",rel:"noreferrer",className:H.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",o("div",{className:H.actions,children:o("button",{className:H.button,onClick:I,disabled:u,type:"button",children:u?"Extracting…":"Extract cookie from helper"})})]}),o("div",{className:H.field,children:[o("label",{children:"cf_clearance cookie value:"}),o("input",{type:"text",value:c,onChange:D=>l(D.target.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:H.input})]}),o("div",{className:H.actions,children:[o("button",{className:H.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:H.secondaryButton,onClick:()=>i(1),children:"Back"}),o("button",{className:H.button,onClick:P,children:"Submit"})]})]})})})},jt=300,$a=(e,t,n)=>{const r=i=>Math.max(-1,Math.min(1,i));return{x:r((e-(n.left+n.width/2))/jt),y:r((t-(n.top+n.height/2))/jt)}},Ma=["normal","squint"],za={normal:.64,squint:.36},Fa=(e=Math.random())=>{let t=0;for(const n of Ma)if(t+=za[n],e<t)return n;return"normal"},Ba="pet",Wa="sleep",Qa=6e3,Ua=420,Ka=.5,Ha=[0,260,520],He={from:1,to:2,after:200},ke=()=>document.querySelectorAll("[data-dango-face-slot]"),Dt=e=>e?.closest?.("[data-dango-face-slot]")??null,Va=()=>{const{data:e}=Ce("dangoGaze"),{lowEndMode:t}=yn(),n=e!=="false"&&!t;E(()=>{if(!n||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const r=["normal","normal","normal"];let i=-1,s=-1,a=!1,c=0,l=0;const u=[],d=(y,g)=>{const B=Array.from(document.querySelectorAll("svg[data-dango-gaze-origin]")).map(R=>R.getBoundingClientRect());return B.find(R=>y>=R.left&&y<=R.right&&g>=R.top&&g<=R.bottom)??B[0]},m=(y,g)=>{const B=window.setTimeout(()=>{u.splice(u.indexOf(B),1),y()},g);u.push(B)},h=(y,g,B)=>{const R=()=>ke().forEach(te=>te.removeAttribute(g));R(),requestAnimationFrame(()=>{ke().forEach(te=>{Number(te.getAttribute("data-dango-face-slot"))===y&&te.setAttribute(g,"")}),m(R,B)})},p=(y,g,B)=>{ke().forEach(R=>{Number(R.getAttribute("data-dango-face-slot"))===y&&(B?R.setAttribute(g,""):R.removeAttribute(g))})},f=()=>{ke().forEach(y=>{const g=Number(y.getAttribute("data-dango-face-slot"));y.setAttribute("data-face",s===g?Ba:r[g]),i===g?y.setAttribute("data-hover",""):y.removeAttribute("data-hover")})},w=y=>{y!==s&&(s>=0&&p(s,"data-cheer",!1),s=y,y>=0&&p(y,"data-cheer",!0))},N=()=>{window.clearTimeout(l),l=window.setTimeout(()=>{w(-1),f()},Ua)},j=()=>{window.clearTimeout(l),w(-1)},I=()=>{a=!1,Ha.forEach((y,g)=>{m(()=>{r[g]=Fa(),g===He.from&&m(()=>h(He.to,"data-nudge",520),He.after),f()},y)})},P=()=>{a=!0,r.fill(Wa),j(),f()},D=()=>{window.clearTimeout(c),c=window.setTimeout(P,Qa)},oe=y=>{const g=d(y.clientX,y.clientY);if(!g)return;const{x:B,y:R}=$a(y.clientX,y.clientY,g),te=document.documentElement.style;te.setProperty("--dango-gaze-x",B.toFixed(3)),te.setProperty("--dango-gaze-y",R.toFixed(3));const _e=i,O=s,$=Ct(y.clientX,y.clientY,g),le=$>=0?$:Ct(y.clientX,y.clientY,g,Ka);i=$,le>=0?(w(le),N()):j(),(_e!==i||O!==s)&&f(),a&&I(),D()},Z=y=>{const g=Dt(y.target),B=g?.getAttribute("data-dango-face-slot"),R=Dt(y.relatedTarget);!g||R?.getAttribute("data-dango-face-slot")===B||(i=-1,j(),f(),D())};return f(),D(),window.addEventListener("pointermove",oe,{passive:!0}),document.addEventListener("pointerout",Z),()=>{window.clearTimeout(c),window.clearTimeout(l),u.forEach(window.clearTimeout),window.removeEventListener("pointermove",oe),document.removeEventListener("pointerout",Z),document.documentElement.style.removeProperty("--dango-gaze-x"),document.documentElement.style.removeProperty("--dango-gaze-y"),ke().forEach(y=>{y.setAttribute("data-face","normal"),y.removeAttribute("data-hover"),y.removeAttribute("data-cheer")})}},[n])};function Ga(){const[e,t]=k(!1);return E(()=>{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 Ya extends Rn{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(b,{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(b,{name:"home"}),"Go back Home"]})]}):this.props.children}}const Nn=se(void 0),Ja=({children:e})=>{const[t,n]=k(!1),r=Q(()=>n(!0),[]),i=Q(()=>n(!1),[]);return E(()=>ln("lan",r),[r]),o(Nn.Provider,{value:{isOpen:t,openModal:r,closeModal:i},children:e})},Xa=()=>{const e=ae(Nn);if(!e)throw new Error("useLanAuth must be used within a LanAuthProvider");return e},Za="_container_88bss_1",ec="_field_88bss_8",tc="_input_88bss_19",nc="_actions_88bss_37",Re={container:Za,field:ec,input:tc,actions:nc},$t=jn(({variant:e="primary",size:t="md",loading:n,children:r,className:i="",disabled:s,...a},c)=>{const l=ti("btn",`btn-${e}`,t!=="md"&&`btn-${t}`,n&&"btn-loading",i);return o("button",{className:l,disabled:s||n,ref:c,...a,children:n?o("span",{className:"btn-spinner"}):r})}),rc=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,i]=k(""),[s,a]=k(!1);rt.useEffect(()=>{e&&i("")},[e]);const c=async()=>{if(!r){_.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){_.error(u.error||"Login failed");return}_.success("Authenticated successfully"),n(),t(),window.location.reload()}catch{_.error("Network error")}finally{a(!1)}};return o(Ne,{isOpen:e,onClose:t,title:"LAN Authentication Required",children:o("div",{className:Re.container,children:[o("p",{children:"This instance is protected. Enter the password to access from this device."}),o("div",{className:Re.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:Re.input,onKeyDown:l=>l.key==="Enter"&&c()})]}),o("div",{className:Re.actions,children:[o($t,{variant:"secondary",onClick:t,disabled:s,children:"Cancel"}),o($t,{variant:"primary",onClick:c,loading:s,children:"Unlock"})]})]})})},oc=L(()=>q(()=>import("./Home-CW24x23t.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]))),ic=L(()=>q(()=>import("./Watchlist-hgU-RPay.js"),__vite__mapDeps([30,1,2,4,6,7,8,9,10,11,12,13,3,5,14,15,31,32]))),sc=L(()=>q(()=>import("./Settings-C7iOaCMq.js"),__vite__mapDeps([33,1,2,34,35,4,36]))),Mt=L(()=>q(()=>import("./Player-lSQC6rcr.js"),__vite__mapDeps([37,1,2,38,4,39,40,12,17,18,8,9,10,23,41,42,43,44,45]))),ac=L(()=>q(()=>import("./Search-DP0QouO-.js"),__vite__mapDeps([46,1,4,3,5,6,7,2,8,9,10,11,12,13,14,15,47,48]))),cc=L(()=>q(()=>import("./Mature-q8lBiSsb.js"),__vite__mapDeps([49,1,2,4,3,5,6,7,8,9,10,11,12,13,14,15,23,47,48,50]))),zt=L(()=>q(()=>import("./Asmr-BvM8UKQ3.js"),__vite__mapDeps([51,1,4,2,34,35,11,9,12,13,28,52,53,54,21,40,55,56]))),lc=L(()=>q(()=>import("./Manga-B26xL6Dq.js"),__vite__mapDeps([57,1,4,34,35,14,15,11,9,12,13,19,20,2,21,23,58,59,55,56]))),uc=L(()=>q(()=>import("./MangaInfoPage-CFI4_GgJ.js"),__vite__mapDeps([60,1,4,14,15,20,2,58,59,55,56]))),dc=L(()=>q(()=>import("./MangaReadPage-CL2TKQc8.js"),__vite__mapDeps([61,1,14,4,15,2,20,58,59,55,56]))),mc=L(()=>q(()=>import("./ReadingList-L0kcgqzm.js"),__vite__mapDeps([62,1,11,9,12,4,13,63,3,5,14,15,31,32,19,20,2,21,22,16]))),hc=L(()=>q(()=>import("./Radio-C7BD7L1o.js"),__vite__mapDeps([64,1,4,2,52,53,65,66,55,56]))),pc=L(()=>q(()=>import("./Music-Dbswx5jU.js"),__vite__mapDeps([67,1,4,65,66,52,53,2,55,56,68]))),Ft=L(()=>q(()=>import("./TvSearch-BjyAFYCg.js"),__vite__mapDeps([69,1,4,3,5,24,11,9,12,13,25,26,2,14,15,47,48]))),fc=L(()=>q(()=>import("./TvInfo-DS9pbimS.js"),__vite__mapDeps([70,1,4,26,2,71]))),yc=L(()=>q(()=>import("./Tv-QYoBwOlH.js"),__vite__mapDeps([72,1,2,4,38,39,73,23,26,40,12,43,44,74]))),vc=L(()=>q(()=>import("./TvWatchlist-CAuCk-AT.js"),__vite__mapDeps([75,1,11,9,12,4,13,63,3,5,14,15,31,32,16,25,26,2]))),gc=L(()=>q(()=>import("./ListeningList-gNfL7dv7.js"),__vite__mapDeps([76,1,11,9,12,4,13,63,3,5,14,15,31,32,54,28,2,52,53,21,27,16]))),bc=L(()=>q(()=>import("./Trackers-COKJmOew.js"),__vite__mapDeps([77,1,2,4,78]))),_c=L(()=>q(()=>import("./Insights-DLqUhamB.js"),__vite__mapDeps([79,1,2,4,80]))),wc=L(()=>q(()=>import("./AnimeInfoPage-Brb3TFXh.js"),__vite__mapDeps([81,1,2,4]))),Ec=L(()=>q(()=>import("./PlayerRedirect-fv2tzEUu.js"),__vite__mapDeps([82,1]))),Sc=L(()=>q(()=>import("./VirtualKeyboard-BmqZPZXR.js"),__vite__mapDeps([83,1,84])));function kc(){Va();const{isOpen:e,closeModal:t,onSuccess:n}=fa(),{isOpen:r,setIsOpen:i}=dt(),{isOpen:s,openModal:a,closeModal:c}=Xa(),l=ot(),u=Dn(),d=F(new Map),m=F(l.pathname),h=ms();pa();const[p,f]=k(!1);E(()=>{fetch("/api/auth/app-status").then(I=>I.json()).then(I=>{I.hasPassword&&!I.isAuthenticated&&(f(!0),a())}).catch(()=>{})},[a]);const[w,N]=xn("lan_auth_notice_shown","false"),j=F(!1);return E(()=>{if(w==="true"||j.current)return;j.current=!0,N("true");const I=setTimeout(()=>{_("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(I)},[w,N]),E(()=>{try{window.history.scrollRestoration="manual"}catch{}},[]),E(()=>{const I=l.key,P=d.current;if(u==="POP"){const D=P.get(I)??0;window.scrollTo({top:D,behavior:"instant"})}else l.pathname!==m.current&&window.scrollTo({top:0,behavior:"instant"});return m.current=l.pathname,()=>{P.set(I,window.scrollY)}},[l.key,l.pathname,u]),E(()=>{const I=P=>{r&&P.key==="Escape"&&i(!1)};return r?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open"),window.addEventListener("keydown",I),()=>{window.removeEventListener("keydown",I),document.body.classList.remove("sidebar-open")}},[r,i]),o("div",{className:"app-container",children:[o(Da,{isOpen:e,onClose:t,onSuccess:n}),o(rc,{isOpen:s,onClose:p?()=>{}:c,onSuccess:()=>{f(!1),c()}}),o(qr,{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(js,{}),o(Gs,{}),o("main",{className:"main-content",children:o(Ya,{children:o(ft,{fallback:o(Ga,{}),children:o($n,{children:[o(x,{path:"/",element:o(oc,{})}),o(x,{path:"/watchlist/:filter?",element:o(ic,{})}),o(x,{path:"/reading-list/:filter?",element:o(mc,{})}),o(x,{path:"/search",element:o(ac,{})}),o(x,{path:"/mature",element:o(cc,{})}),o(x,{path:"/asmr",element:o(zt,{})}),o(x,{path:"/asmr/:rj",element:o(zt,{})}),o(x,{path:"/manga",element:o(lc,{})}),o(x,{path:"/manga/:provider/:id",element:o(uc,{})}),o(x,{path:"/manga/:provider/:id/read",element:o(dc,{})}),o(x,{path:"/radio",element:o(hc,{})}),o(x,{path:"/music",element:o(pc,{})}),o(x,{path:"/tv",element:o(Ft,{})}),o(x,{path:"/tv/:id",element:o(fc,{})}),o(x,{path:"/tv/:id/watch",element:o(yc,{})}),o(x,{path:"/tv-search",element:o(Ft,{})}),o(x,{path:"/tv-watchlist/:filter?",element:o(vc,{})}),o(x,{path:"/listening-list/:filter?",element:o(gc,{})}),o(x,{path:"/settings",element:o(sc,{})}),o(x,{path:"/trackers",element:o(bc,{})}),o(x,{path:"/mal",element:o(yt,{to:"/trackers",replace:!0})}),o(x,{path:"/insights",element:o(_c,{})}),o(x,{path:"/anime/:id",element:o(wc,{})}),o(x,{path:"/watch/:id",element:o(Mt,{})}),o(x,{path:"/watch/:id/:episodeNumber",element:o(Mt,{})}),o(x,{path:"/player/:id/:episodeNumber?",element:o(Ec,{})}),o(x,{path:"*",element:o(yt,{to:"/",replace:!0})})]})})})}),o(ha,{}),h.isVisible&&o(ft,{fallback:null,children:o(Sc,{activeInputRef:h.activeInputRef,isVisible:h.isVisible,onClose:h.hide})})]})}function Pc(){return o(Ja,{children:o(kc,{})})}const xc=({children:e})=>{const[t,n]=k(!1),r=Q(()=>{n(s=>!s)},[]),i=be(()=>({isOpen:t,setIsOpen:n,toggleSidebar:r}),[t,r]);return o(bn.Provider,{value:i,children:e})},Tc=({children:e})=>{const[t,n]=xn("dango_content_type","anime"),r=be(()=>({contentType:t,setContentType:n}),[t,n]);return o(_n.Provider,{value:r,children:e})},Ic=({children:e})=>{const[t,n]=k("englishName"),[r,i]=k(!0);E(()=>{(async()=>{try{const c=await J.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=be(()=>({titlePreference:t,setTitlePreference:n,loading:r}),[t,r]);return o(dn.Provider,{value:s,children:e})},Oc=({children:e})=>{const{data:t,isLoading:n}=Ce("lowEndMode"),r=vn(),i=K(),[s,a]=k(!1);E(()=>{const u=i.getDefaultOptions();i.setDefaultOptions({...u,queries:{...u.queries,gcTime:s?900*1e3:1800*1e3}})},[s,i]),E(()=>{t!==void 0&&a(t==="true"||t===!0)},[t]),E(()=>{s?document.body.classList.add("low-end"):document.body.classList.remove("low-end")},[s]);const c=Q(u=>{a(u),r.mutate({key:"lowEndMode",value:String(u)})},[r]),l=be(()=>({lowEndMode:s,setLowEndMode:c,loading:n}),[s,c,n]);return o(fn.Provider,{value:l,children:e})},Cc=["iris","mochi","sakura"];function Bt(e){e==="iris"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const Nc=({children:e})=>{const{data:t,isLoading:n}=Ce("theme"),r=vn(),[i,s]=k("iris");E(()=>{typeof t=="string"&&Cc.includes(t)&&s(t)},[t]),E(()=>{Bt(i)},[i]);const a=Q(l=>{l!==i&&(s(l),Bt(l),r.mutate({key:"theme",value:l}))},[r,i]),c=be(()=>({theme:i,setTheme:a,loading:n}),[i,a,n]);return o(gn.Provider,{value:c,children:e})},Ac=({children:e})=>{const[t,n]=k(!1),[r,i]=k(void 0),s=Q(c=>{i(()=>c),n(!0)},[]),a=Q(()=>{n(!1),i(void 0)},[]);return E(()=>ln("animepahe",()=>s()),[s]),o(Tn.Provider,{value:{isOpen:t,openModal:s,closeModal:a,onSuccess:r},children:e})};try{window.history.scrollRestoration="manual"}catch{}const Wt=new Wn({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1800*1e3,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,retry:1}}}),Qt=document.getElementById("root");Qt&&Mn(o(zn,{children:o(Xo,{trpcClient:J,queryClient:Wt,children:o(Qn,{client:Wt,children:o(Ac,{children:o(xc,{children:o(Tc,{children:o(Ic,{children:o(Oc,{children:o(Nc,{children:o(Pc,{})})})})})})})})})}),Qt);export{Gc as $,vn as A,$t as B,rl as C,ol as D,nl as E,M as F,cl as G,Lt as H,At as I,Mc as J,Da as K,Qc as L,Ne as M,ds as N,dl as O,H as P,ln as Q,ul as R,Ke as S,ll as T,jc as U,En as V,dt as W,al as X,Ga as Y,Vc as Z,q as _,xn as a,Hc as a0,Fc as b,Bc as c,ni as d,Ds as e,ei as f,Dc as g,C as h,Wc as i,wn as j,tl as k,Uc as l,Kc as m,Yc as n,Jc as o,il as p,Zc as q,zc as r,$c as s,J as t,yn as u,sl as v,el as w,Xc as x,Ce as y,_ as z};
178
+ `,Le=16,qr=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,toasterId:s,containerStyle:a,containerClassName:c})=>{let{toasts:l,handlers:u}=cr(n,s);return W("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Le,left:Le,right:Le,bottom:Le,pointerEvents:"none",...a},className:c,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(d=>{let m=d.position||t,h=u.calculateOffset(d,{reverseOrder:e,gutter:r,defaultPosition:t}),p=Ar(m,h);return W(Nr,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?Lr:"",style:p},d.type==="custom"?Me(d.message,d):i?i(d):W(Cr,{toast:d,position:m}))}))},_=M;function We(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(Rr,t)}};return t}function Rr(e,t){return t(e)}function jr(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 Dr(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 We(c=>(n++,i.push(c),s(),{unsubscribe(){n--,a();const l=i.findIndex(u=>u===c);l>-1&&i.splice(l,1)}}))}}function $r(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=We(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 Mr(e){return We(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 xe(e){"@babel/helpers - typeof";return xe=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},xe(e)}function zr(e,t){if(xe(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xe(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fr(e){var t=zr(e,"string");return xe(t)=="symbol"?t:t+""}function V(e,t,n){return(t=Fr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bt(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 z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bt(Object(n),!0).forEach(function(r){V(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function he(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Br(e){return typeof e=="function"}function Wr(){return Object.create(null)}const Qr=typeof Symbol=="function"&&!!Symbol.asyncIterator;function Ur(e){return Qr&&he(e)&&Symbol.asyncIterator in e}const Kr=e=>e(),Zt=()=>{},_t=e=>{Object.freeze&&Object.freeze(e)};function en(e,t,n){var r;const i=t.join(".");return(r=n[i])!==null&&r!==void 0||(n[i]=new Proxy(Zt,{get(s,a){if(!(typeof a!="string"||a==="then"))return en(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)}),_t(u.args),_t(u.path),e(u)}})),n[i]}const tn=e=>en(e,[],Wr()),Hr=e=>new Proxy(Zt,{get(t,n){if(n!=="then")return e(n)}});function Te(e){"@babel/helpers - typeof";return Te=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},Te(e)}function Vr(e,t){if(Te(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Te(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gr(e){var t=Vr(e,"string");return Te(t)=="symbol"?t:t+""}function Ye(e,t,n){return(t=Gr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wt(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 qe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wt(Object(n),!0).forEach(function(r){Ye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Yr=class extends Error{constructor(e){super(Jr(e)),Object.assign(this,e)}};function Jr(e){if("message"in e)return String(e.message)}function Xr(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(he(e))return new Yr(e)}}var Et=class extends Error{constructor(e){var t,n,r;const i=Xr(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}),Ye(this,"cause",void 0),Ye(this,"code",void 0),this.code=e.code,this.name="TRPCError",(r=this.cause)!==null&&r!==void 0||(this.cause=i)}};function Zr(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:qe(qe({},e),{},{error:n})}}return{ok:!0,result:qe(qe({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var Ue=class extends Error{constructor(){super("Unable to transform response from server")}};function eo(e,t){let n;try{n=Zr(e,t)}catch{throw new Ue}if(!n.ok&&(!he(n.error.error)||typeof n.error.error.code!="number"))throw new Ue;if(n.ok&&!he(n.result))throw new Ue;return n}function to(e){return typeof e=="function"}async function no(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 ro(e){const{type:t,path:n}=e,r=await no(e.router,n);if(!r||!to(r)||r._def.type!==t&&!e.allowMethodOverride)throw new Et({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new Et({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return r(e)}function oo(e){return e instanceof ze}function io(e){return he(e)&&he(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function so(e,t){return typeof e=="string"?e:he(e)&&typeof e.message=="string"?e.message:t}var ze=class De extends Error{constructor(t,n){var r,i;const s=n?.cause;super(t,{cause:s}),V(this,"cause",void 0),V(this,"shape",void 0),V(this,"data",void 0),V(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,De.prototype)}static from(t,n={}){const r=t;return oo(r)?(n.meta&&(r.meta=z(z({},r.meta),n.meta)),r):io(r)?new De(r.error.message,z(z({},n),{},{result:r,cause:n.cause})):new De(so(r,"Unknown error"),z(z({},n),{},{cause:r}))}};function ao(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 St=e=>typeof e=="function";function co(e){if(e)return e;if(typeof window<"u"&&St(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&St(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function lo(...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 uo(...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 mo(e){return{url:e.url.toString(),fetch:e.fetch,transformer:ao(e.transformer),methodOverride:e.methodOverride}}function ho(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const po={query:"GET",mutation:"POST",subscription:"PATCH"};function nn(e){return"input"in e?e.transformer.input.serialize(e.input):ho(e.inputs.map(t=>e.transformer.input.serialize(t)))}const rn=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=nn(e);i!==void 0&&e.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(i))}`)}return r.length&&(n+="?"+r.join("&")),n},fo=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=nn(e);return t!==void 0?JSON.stringify(t):void 0},yo=e=>_o(z(z({},e),{},{contentTypeHeader:"application/json",getUrl:rn,getBody:fo}));var vo=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const go=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 vo};async function bo(e){var t,n;go(e.signal);const r=e.getUrl(e),i=e.getBody(e),s=(t=e.methodOverride)!==null&&t!==void 0?t:po[e.type],a=await(async()=>{const l=await e.headers();return Symbol.iterator in l?Object.fromEntries(l):l})(),c=z(z(z({},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 co(e.fetch)(r,{method:s,signal:e.signal,body:i,headers:c})}async function _o(e){const t={},n=await bo(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const kt=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Pt(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function i(c){const l=[[]];let u=0;for(;;){const h=c[u];if(!h)break;const p=l[l.length-1];if(h.aborted){var d;(d=h.reject)===null||d===void 0||d.call(h,new Error("Aborted")),u++;continue}if(e.validate(p.concat(h).map(f=>f.key))){p.push(h),u++;continue}if(p.length===0){var m;(m=h.reject)===null||m===void 0||m.call(h,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(h,p)=>{const f=u.items[p];try{var w;const j=await Promise.resolve(h);(w=f.resolve)===null||w===void 0||w.call(f,j)}catch(j){var N;(N=f.reject)===null||N===void 0||N.call(f,j)}f.batch=null,f.reject=null,f.resolve=null}));for(const h of u.items){var m;(m=h.reject)===null||m===void 0||m.call(h,new Error("Missing result")),h.batch=null}}).catch(d=>{for(const h of u.items){var m;(m=h.reject)===null||m===void 0||m.call(h,d),h.batch=null}})}}function a(c){var l;const u={aborted:!1,key:c,batch:null,resolve:kt,reject:kt},d=new Promise((m,h)=>{var p;u.reject=h,u.resolve=m,(p=t)!==null&&p!==void 0||(t=[]),t.push(u)});return(l=n)!==null&&l!==void 0||(n=setTimeout(s)),d}return{load:a}}function wo(e){var t,n;const r=mo(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(h=>h.path).join(","),m=u.map(h=>h.input);return rn(z(z({},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),h=lo(...u.map(f=>f.signal)),p=await yo(z(z({},r),{},{path:d,inputs:m,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:u}):e.headers:{}},signal:h}));return(Array.isArray(p.json)?p.json:u.map(()=>p.json)).map(f=>({meta:p.meta,json:f}))}}),c={query:Pt(a("query")),mutation:Pt(a("mutation"))};return({op:l})=>We(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(z(z({},l),{},{signal:uo(l.signal,d.signal)}));let h=!1,p;return m.then(f=>{h=!0,p=f;const w=eo(f.json,r.transformer.output);if(!w.ok){u.error(ze.from(w.error,{meta:f.meta}));return}u.next({context:f.meta,result:w.result}),u.complete()}).catch(f=>{h=!0,u.error(ze.from(f,{meta:p?.meta}))}),()=>{h||d.abort()}})}}const on=(e,...t)=>typeof e=="function"?e(...t):e;function Eo(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function So(e){const t=await on(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function ko(e,t){const n={method:"connectionParams",data:await on(e)};return t.encode(n)}function Po(e){const{promise:t,resolve:n,reject:r}=Eo();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function xo(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 To=class Je{constructor(t){var n;if(V(this,"id",++Je.connectCount),V(this,"WebSocketPonyfill",void 0),V(this,"urlOptions",void 0),V(this,"keepAliveOpts",void 0),V(this,"encoder",void 0),V(this,"wsObservable",$r(null)),V(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=++Je.connectCount;const t=So(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&&xo(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await Po(n),this.urlOptions.connectionParams&&n.send(await ko(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()}}};V(To,"connectCount",0);var sn=class{constructor(e){V(this,"links",void 0),V(this,"runtime",void 0),V(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return Mr({links:this.links,op:z(z({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Dr())}async requestAsPromise(e){try{const t=this.$request(e);return(await jr(t)).result.data}catch(t){throw ze.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 an=Symbol.for("trpc_untypedClient"),Io={query:"query",mutate:"mutation",subscribe:"subscription"},Oo=e=>Io[e];function Co(e){const t=tn(({path:n,args:r})=>{const i=[...n],s=Oo(i.pop()),a=i.join(".");return e[s](a,...r)});return Hr(n=>n===an?e:t[n])}function No(e){return Co(new sn(e))}function Ao(e){return e[an]}function Ie(e){"@babel/helpers - typeof";return Ie=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},Ie(e)}function Lo(e,t){if(Ie(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ie(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qo(e){var t=Lo(e,"string");return Ie(t)=="symbol"?t:t+""}function Ro(e,t,n){return(t=qo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xt(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 T(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xt(Object(n),!0).forEach(function(r){Ro(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jo(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 $e(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function $e(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 $e=function(r){this.s=r,this.n=r.next},$e.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 $e(e)}function Do(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 $o(e,t){if(e==null)return{};var n,r,i=Do(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 Mo=["cursor","direction"];function Qe(e){return{path:e.path.join(".")}}function zo(e){return e.length>=3}function Fo(e){return zo(e)?{type:"prefixed",prefix:e[0],path:e[1],args:e[2]}:{type:"unprefixed",prefix:void 0,path:e[0],args:e[1]}}function at(e,t,n){var r;const i=Fo(e);let s=(r=i.args)===null||r===void 0?void 0:r.input;if(n){var a,c;s=T(T(T({},(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 Bo(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=jo(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 ie(e){const t=Kr(()=>{const{input:n,type:r}=e,i=e.path.flatMap(s=>s.split("."));if(!n&&r==="any")return i.length?[i]:[];if(r==="infinite"&&he(n)&&("direction"in n||"cursor"in n)){const{cursor:s,direction:a}=n;return[i,{input:$o(n,Mo),type:"infinite"}]}return[i,T(T({},typeof n<"u"&&n!==ye&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function cn(e){const t=[e.path.flatMap(n=>n.split("."))];return e.prefix&&t.unshift([e.prefix]),t}function ct(e){return Br(e)?e():e}function Wo(e){var t;const{input:n,query:r,path:i,queryKey:s,opts:a}=e,c=n===ye,l=async u=>{var d;const m=T(T({},a),{},{trpc:T(T({},a?.trpc),!(a==null||(d=a.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})});return await r(...at(s,m,{direction:u.direction,pageParam:u.pageParam}))};return Object.assign(Fn(T(T({},a??{}),{},{queryKey:s,queryFn:c?ye:l,initialPageParam:(t=a?.initialCursor)!==null&&t!==void 0?t:n?.cursor})),{trpc:Qe({path:i})})}function Qo(e){var t,n;const{mutate:r,path:i,prefix:s,opts:a,overrides:c}=e,l=ct(e.queryClient),u=cn({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:(p=>p.originalFn()),h=async p=>await r(...at([...u,{input:p}],a));return T(T({},a),{},{mutationKey:u,mutationFn:h,onSuccess(...p){var f,w;return m({originalFn:()=>{var j,I,P;return(j=a==null||(I=a.onSuccess)===null||I===void 0?void 0:I.call(a,...p))!==null&&j!==void 0?j:d==null||(P=d.onSuccess)===null||P===void 0?void 0:P.call(d,...p)},queryClient:l,meta:(f=(w=a?.meta)!==null&&w!==void 0?w:d?.meta)!==null&&f!==void 0?f:{}})},trpc:Qe({path:i})})}function Uo(e){const{input:t,query:n,path:r,queryKey:i,opts:s}=e,a=ct(e.queryClient),c=t===ye,l=async u=>{var d;const m=T(T({},s),{},{trpc:T(T({},s?.trpc),!(s==null||(d=s.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})}),h=u.queryKey,p=await n(...at(h,m));return Ur(p)?Bo(p,a,h):p};return Object.assign(Bn(T(T({},s),{},{queryKey:i,queryFn:c?ye:l})),{trpc:Qe({path:r})})}const Ko=e=>{const{subscribe:t,path:n,queryKey:r,input:i,opts:s={}}=e,a="enabled"in s?!!s.enabled:i!==ye,c=l=>t(n.join("."),i===ye?void 0:i,l);return T(T({},s),{},{enabled:a,subscribe:c,queryKey:r,trpc:Qe({path:n})})};function Ho(e){const t=e.keyPrefix,n=r=>(i,s,a)=>"router"in e?Promise.resolve(ct(e.ctx)).then(c=>ro({router:e.router,path:i,getRawInput:async()=>s,ctx:c,type:r,signal:void 0,batchIndex:0})):(e.client instanceof sn?e.client:Ao(e.client))[r](i,s,a);return tn(({args:r,path:i})=>{const s=[...i],a=s.pop(),[c,l]=r;return{"~types":void 0,pathKey:()=>ie({path:s,type:"any",prefix:t}),pathFilter:()=>T(T({},c),{},{queryKey:ie({path:s,type:"any",prefix:t})}),queryOptions:()=>Uo({input:c,opts:l,path:s,queryClient:e.queryClient,queryKey:ie({path:s,input:c,type:"query",prefix:t}),query:n("query")}),queryKey:()=>ie({path:s,input:c,type:"query",prefix:t}),queryFilter:()=>T(T({},l),{},{queryKey:ie({path:s,input:c,type:"query",prefix:t})}),infiniteQueryOptions:()=>Wo({input:c,opts:l,path:s,queryKey:ie({path:s,input:c,type:"infinite",prefix:t}),query:n("query")}),infiniteQueryKey:()=>ie({path:s,input:c,type:"infinite",prefix:t}),infiniteQueryFilter:()=>T(T({},l),{},{queryKey:ie({path:s,input:c,type:"infinite",prefix:t})}),mutationOptions:()=>{var u;return Qo({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:()=>cn({path:s,prefix:t}),subscriptionOptions:()=>Ko({opts:l,path:s,input:c,queryKey:ie({path:s,input:c,type:"any",prefix:t}),subscribe:n("subscription")})}[a]()})}function Vo(){const e=se(null),t=se(null),n=s=>{const a=be(()=>Ho({client:s.trpcClient,queryClient:s.queryClient,keyPrefix:s.keyPrefix}),[s.trpcClient,s.queryClient,s.keyPrefix]);return W(e.Provider,{value:s.trpcClient},W(t.Provider,{value:a},s.children))};n.displayName="TRPCProvider";function r(){const s=ae(t);if(!s)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return s}function i(){const s=ae(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 Xe={lan:new Set,animepahe:new Set,jasmr:new Set};function ve(e){for(const t of[...Xe[e]])try{t()}catch(n){console.error(`auth-bus listener failed (${e}):`,n)}}function ln(e,t){return Xe[e].add(t),()=>{Xe[e].delete(t)}}const Go=e=>new Promise(t=>setTimeout(t,e)),un=async(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 Go(Math.min(500*2**a,4e3)),s=await fetch(e,{...t,headers:{...n,...t?.headers}});return s},jc=async(e,t)=>{const n=await un(e,t);if(!n.ok){const r=await n.text().catch(()=>"");let i={};try{i=JSON.parse(r)}catch{}const s=typeof i.error=="string"?i.error:"";throw n.status===403&&s==="AUTH_REQUIRED"&&i.provider==="animepahe"&&ve("animepahe"),n.status===403&&s==="AUTH_REQUIRED"&&i.provider==="jasmr"&&ve("jasmr"),n.status===401&&s==="LAN_AUTH_REQUIRED"&&ve("lan"),new Error(s||`Failed to fetch from ${e}`)}return n.json()};async function Yo(e,t){const n=await un(e,t);if(n.status===401)try{(await n.clone().json())?.error==="LAN_AUTH_REQUIRED"&&ve("lan")}catch{}return await Jo(n),n}async function Jo(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")&&ve(s.provider),(i.message==="LAN_AUTH_REQUIRED"||s?.code==="LAN_AUTH_REQUIRED")&&ve("lan")}}catch{}}const{TRPCProvider:Xo,useTRPC:C}=Vo(),J=No({links:[wo({url:"/api/trpc",fetch:Yo})]}),Ee=new Map,Zo=500,ei=(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(Ee.has(i))return Ee.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 Ee.size>Zo&&Ee.clear(),Ee.set(i,s),s},Dc=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 $c(e){return e?e.replace(/<[^>]*>?/gm,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").trim():""}function Mc(e){return e==null?e:e>10?Number((e/10).toFixed(1)):e}const ti=(...e)=>e.filter(Boolean).join(" "),dn=se(void 0),ni=()=>{const e=ae(dn);if(e===void 0)throw new Error("useTitlePreference must be used within a TitlePreferenceProvider");return e},zc=()=>{const e=C();return G({...e.data.spotlight.queryOptions(),staleTime:1e3*60*5,retry:1})},Fc=(e="TRENDING_DESC",t=10)=>it({queryKey:["trendingList",e,t],queryFn:({pageParam:n=1})=>J.data.popularList.query({sort:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),Bc=(e="TV",t=12)=>it({queryKey:["latestReleases",e,t],queryFn:({pageParam:n=1})=>J.data.latestReleases.query({format:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),Wc=(e,t="TV",n=!0)=>{const r=C();return G({...r.data.seasonal.queryOptions({page:e,format:t}),enabled:n,staleTime:1e3*60*5})},ri=["query","sortBy","type","status","season","year","country","genres","excludeGenres","excludeTags","minScore","minEpisodes","adult"],Qc=(e,t,n=14)=>{const r=C(),i=new URLSearchParams(e),s={page:t,limit:n};for(const a of ri){const c=i.get(a);c!==null&&(s[a]=c)}return G({...r.data.search.queryOptions(s),enabled:e!=null})},Uc=()=>{const e=C();return G(e.queue.list.queryOptions())},oi=()=>{const e=C(),t=K();return X(e.queue.add.mutationOptions({onSuccess:n=>{n.queued?_.success("Added to queue"):_.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]})},onError:n=>{_.error(`Failed to update queue: ${n.message}`)}}))},Kc=()=>{const e=C(),t=K();return X(e.queue.remove.mutationOptions({onSuccess:()=>{_.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{_.error(`Failed to remove: ${n.message}`)}}))},Hc=(e,t=!0)=>G({queryKey:["queue-remaining",e],queryFn:()=>J.watchlist.queueRemaining.query({showId:e}),enabled:!!e&&t,staleTime:1e3*60}),Vc=()=>{const e=C(),t=K();return X(e.queue.addBatch.mutationOptions({onSuccess:(n,r)=>{const i=n.added??r.episodeNumbers.length;_.success(`${i} ${i===1?"episode":"episodes"} added to queue`),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]})},onError:n=>{_.error(`Failed to update queue: ${n.message}`)}}))},Gc=()=>{const e=C(),t=K();return X(e.queue.removeMany.mutationOptions({onSuccess:()=>{_.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{_.error(`Failed to remove: ${n.message}`)}}))},Yc=()=>{const e=C(),t=K();return X(e.queue.clear.mutationOptions({onSuccess:()=>{_.success("Queue cleared"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{_.error(`Failed to clear queue: ${n.message}`)}}))},Jc=()=>{const e=C(),t=K(),n=e.queue.list.queryOptions().queryKey;return X(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())}}))},ii=["status","showMature","query","type","season","year","genres","excludeGenres","sortBy","titlePreference"];function lt(e,t,n){const r=new URLSearchParams(e),i={page:t,limit:n};for(const s of ii){const a=r.get(s);a!==null&&(i[s]=a)}return i}const Xc=(e,t="",n,r=14)=>G({queryKey:["watchlist",e,t,n,r],queryFn:async()=>{const i=new URLSearchParams(t);return i.set("status",e),await J.watchlist.list.query(lt(i.toString(),n,r))}}),Zc=(e="")=>it({queryKey:["allContinueWatching",e],queryFn:async({pageParam:t=1})=>await J.watchlist.continueWatchingAll.query(lt(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)})}),el=(e="",t,n=14)=>G({queryKey:["allContinueWatching",e,t,n],queryFn:async()=>await J.watchlist.continueWatchingAll.query(lt(e,t,n))}),tl=()=>{const e=C(),t=K();return X(e.watchlist.remove.mutationOptions({onSuccess:()=>{_.success("Removed from watchlist"),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:["watchlist"]})},onError:n=>{_.error(`Failed to remove: ${n.message}`)}}))},nl=()=>{const e=C(),t=K();return X(e.watchlist.batchStatus.mutationOptions({onSuccess:n=>{_.success(`Status updated for ${n.updated??0} items`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:["watchlist"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{_.error(`Failed to update statuses: ${n.message}`)}}))},rl=()=>{const e=C(),t=K();return X(e.watchlist.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;_.success(`Removed ${r} ${r===1?"item":"items"} from watchlist`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:["watchlist"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{_.error(`Failed to remove: ${n.message}`)}}))},ol=()=>{const e=C(),t=K();return X(e.continueWatching.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;_.success(`Removed ${r} ${r===1?"item":"items"} from continue watching`),t.invalidateQueries(e.continueWatching.pathFilter()),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{_.error(`Failed to remove: ${n.message}`)}}))},mn=(e=!0)=>{const t=C();return G({...t.notifications.list.queryOptions(),enabled:e,refetchInterval:3e4})},hn=(e=!0)=>{const t=C();return G({...t.data.systemNotifications.queryOptions(),enabled:e,refetchInterval:3e4})},pn=(e=!0)=>{const t=C();return G({...t.discovery.status.queryOptions(),enabled:e,refetchInterval:n=>n.state.data?.running?2e3:!1})},si=()=>{const e=C(),t=K(),n=e.discovery.status.queryOptions().queryKey;return X(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})}}))},ai=()=>{const e=C(),t=K();return X(e.notifications.dismiss.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},ci=()=>{const e=C(),t=K();return X(e.notifications.clearAll.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},il=()=>{const e=C();return G({...e.continueWatching.thisWeek.queryOptions(),staleTime:1e3*60*5})},sl=()=>{const e=C();return G({...e.data.genresAndTags.queryOptions(),staleTime:1e3*60*60})},al=()=>G({queryKey:["genreCards"],queryFn:()=>J.insights.genreCards.query()}),li="_container_z68uz_1",ui="_bellBtn_z68uz_7",di="_badge_z68uz_56",mi="_dropdown_z68uz_96",hi="_dropdownHeader_z68uz_127",pi="_clearAllBtn_z68uz_141",fi="_discoveryStatusRow_z68uz_156",yi="_statusDot_z68uz_167",vi="_statusDotRunning_z68uz_174",gi="_statusDotOk_z68uz_179",bi="_statusDotInfo_z68uz_183",_i="_statusDotError_z68uz_187",wi="_statusDotIdle_z68uz_191",Ei="_list_z68uz_205",Si="_item_z68uz_219",ki="_thumbnail_z68uz_234",Pi="_itemInfo_z68uz_243",xi="_itemTitle_z68uz_248",Ti="_itemMeta_z68uz_259",Ii="_systemItemMeta_z68uz_269",Oi="_removeItem_z68uz_286",Ci="_queueItem_z68uz_316",Ni="_emptyState_z68uz_320",v={container:li,bellBtn:ui,badge:di,dropdown:mi,dropdownHeader:hi,clearAllBtn:pi,discoveryStatusRow:fi,statusDot:yi,statusDotRunning:vi,statusDotOk:gi,statusDotInfo:bi,statusDotError:_i,statusDotIdle:wi,list:Ei,item:Si,thumbnail:ki,itemInfo:Pi,itemTitle:xi,itemMeta:Ti,systemItemMeta:Ii,removeItem:Oi,queueItem:Ci,emptyState:Ni},Ai=({notification:e})=>{const t=ai(),n=oi(),[r,i]=rt.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}=ni(),u=l==="nativeName"?e.nativeName||e.name:l==="englishName"&&e.englishName||e.name;return o(Y,{to:`/watch/${e.showId}/${e.episodeNumber}`,className:v.item,onClick:a,children:[o("img",{src:ei(e.thumbnail,48,64),alt:e.name,className:v.thumbnail,loading:"lazy",decoding:"async"}),o("div",{className:v.itemInfo,children:[o("span",{className:v.itemTitle,children:u}),o("span",{className:v.itemMeta,children:["New Episode ",e.episodeNumber]})]}),o("button",{className:`${v.removeItem} ${v.queueItem}`,onClick:c,"aria-label":"Add notification to queue",children:r?o(b,{name:"check"}):o(b,{name:"plus"})}),o("button",{className:v.removeItem,onClick:s,"aria-label":"Remove notification",children:o(b,{name:"times"})})]})};function Ke({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 Li=({count:e=3})=>o(U,{children:Array.from({length:e}).map((t,n)=>o("div",{className:v.item,style:{borderBottom:"1px solid var(--border-primary)",pointerEvents:"none"},children:[o("div",{className:v.thumbnail,style:{overflow:"hidden"},children:o(Ke,{width:"100%",height:"100%",variant:"rectangular"})}),o("div",{className:v.itemInfo,children:[o(Ke,{width:"80%",height:"1rem",variant:"text",style:{marginBottom:"4px"}}),o(Ke,{width:"40%",height:"0.7rem",variant:"rectangular",style:{borderRadius:"var(--radius-sm)"}})]})]},n))}),qi=()=>{const{data:e=[],isLoading:t}=mn(),{data:n=[]}=hn(),{data:r}=pn(),i=ci(),s=K(),[a,c]=k(null);E(()=>{s.invalidateQueries({queryKey:["notifications"]})},[s]);const l=()=>{i.mutate(void 0)},u=n.find(d=>d.id===a)??null;return o("div",{className:v.dropdown,children:[o("div",{className:v.dropdownHeader,children:[o("h4",{children:"Notifications"}),e.length>0&&o("button",{className:v.clearAllBtn,onClick:l,children:"Clear All"})]}),o("div",{className:v.discoveryStatusRow,children:r?.running?o(U,{children:[o("span",{className:`${v.statusDot} ${v.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(U,{children:[o("span",{className:`${v.statusDot} ${v.statusDotOk}`,"aria-hidden":"true"}),o("span",{children:["Discovery complete — checked ",r.total," ",r.total===1?"show":"shows"]})]}):r?.state==="empty"?o(U,{children:[o("span",{className:`${v.statusDot} ${v.statusDotInfo}`,"aria-hidden":"true"}),o("span",{children:"No shows set to Watching — nothing to check"})]}):r?.state==="error"?o(U,{children:[o("span",{className:`${v.statusDot} ${v.statusDotError}`,"aria-hidden":"true"}),o("span",{children:"Last check failed — will retry automatically"})]}):o(U,{children:[o("span",{className:`${v.statusDot} ${v.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:v.list,children:t&&n.length===0?o(Li,{count:4}):o(U,{children:[n.map(d=>o("div",{className:v.item,children:[o("div",{className:v.thumbnail,style:{background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:0,boxShadow:"none"},children:o(b,{name:"info-circle",size:32,color:"#6c9fff"})}),o("div",{className:v.itemInfo,children:[o("span",{className:v.itemTitle,children:d.title}),o("button",{type:"button",className:v.systemItemMeta,onClick:()=>c(d.id),title:"View full status",children:d.message.length>40?d.message.slice(0,40)+"…":d.message})]}),o("button",{className:v.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:o(b,{name:"plus"})}),o("button",{className:v.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:o(b,{name:"times"})})]},d.id)),n.length>0&&e.length>0&&o("div",{className:v.notificationDivider}),e.length>0?e.map(d=>o(Ai,{notification:d},d.id)):!t&&n.length===0&&o("div",{className:v.emptyState,children:"No new notifications"})]})}),u&&Ut(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(b,{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)]})},Ri=()=>{const[e,t]=k(!1),n=F(null),r=K(),i=C(),s=si(),{data:a=[]}=mn(),{data:c=[]}=hn(),{data:l}=pn(),u=a.length+c.length,d=u>5?"5+":u,m=F(!1);E(()=>{const p=f=>{n.current&&!n.current.contains(f.target)&&t(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),E(()=>{const p=!!l?.running;m.current&&!p&&(r.invalidateQueries(i.notifications.pathFilter()),r.invalidateQueries(i.discovery.pathFilter())),m.current=p},[l?.running,r,i]);const h=()=>{const p=!e;t(p),p&&s.mutate()};return o("div",{className:v.container,ref:n,children:[o("button",{className:v.bellBtn,onClick:h,"aria-label":"Notifications",children:[o(b,{name:"bell"}),u>0&&o("span",{className:v.badge,children:d})]}),e&&o(qi,{})]})},fn=se(void 0),yn=()=>{const e=ae(fn);if(e===void 0)throw new Error("useLowEndMode must be used within a LowEndModeProvider");return e},Ce=e=>{const t=C();return G({...t.settings.getByKey.queryOptions({key:e}),select:n=>n.value})},vn=()=>{const e=C(),t=K();return X(e.settings.set.mutationOptions({onSuccess:()=>{_.success("Setting updated!"),t.invalidateQueries(e.settings.pathFilter()),t.invalidateQueries({queryKey:["settings"]})},onError:n=>{_.error(`Failed to update setting: ${n.message}`)}}))},gn=se(void 0),cl=()=>{const e=ae(gn);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},ll=[{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"}],Tt={iris:{fill:"#897cff",stroke:"#5646db"},mochi:{fill:"#e3e1ee",stroke:"#b3b1c6"},sakura:{fill:"#e1afef",stroke:"#a978a9"}},fe={x:-.6,y:-2,w:44.8,h:14},It=15,Ot={w:13.6,h:10.2},Pe=[{x:0,y:.5},{x:It,y:-.9},{x:It*2,y:.3}],Ct=(e,t,n,r=0)=>{if(n.width<=0)return-1;const i=n.width/fe.w,s=(e-n.left)/i+fe.x,a=(t-n.top)/i+fe.y;for(let c=0;c<Pe.length;c++){const l=s-Pe[c].x,u=a-Pe[c].y;if(l>=-r&&l<=Ot.w+r&&u>=-r&&u<=Ot.h+r)return c}return-1},ji="_logo_1z0j0_1",Di="_gaze_1z0j0_8",$i="_face_1z0j0_16",Mi="_faceNormal_1z0j0_22",zi="_facePet_1z0j0_23",Fi="_faceSquint_1z0j0_24",Bi="_faceSleep_1z0j0_25",Wi="_line_1z0j0_33",Qi="_weight_1z0j0_41",Ui="_shift_1z0j0_56",Ki="_rock_1z0j0_70",Hi="_glance_1z0j0_88",Vi="_blink_1z0j0_107",Gi="_blinkDouble_1z0j0_112 _blink_1z0j0_107",Yi="_blinkSlow_1z0j0_136 _blink_1z0j0_107",Ji="_cheer_1z0j0_172",Xi="_heart_1z0j0_176",ee={logo:ji,gaze:Di,face:$i,faceNormal:Mi,facePet:zi,faceSquint:Fi,faceSleep:Bi,line:Wi,weight:Qi,"dango-weight":"_dango-weight_1z0j0_1",shift:Ui,"dango-shift":"_dango-shift_1z0j0_1",rock:Ki,"dango-rock":"_dango-rock_1z0j0_1",glance:Hi,"dango-glance":"_dango-glance_1z0j0_1",blink:Vi,blinkDouble:Gi,"dango-blink-double":"_dango-blink-double_1z0j0_1",blinkSlow:Yi,"dango-blink-slow":"_dango-blink-slow_1z0j0_1","dango-nudge":"_dango-nudge_1z0j0_1",cheer:Ji,heart:Xi,"dango-heart":"_dango-heart_1z0j0_1"},Zi="m 7,0 c -3.9372984,0 -7.10030437,2.4883888 -7,6 0.13572675,4.751733 5.0802847,4.156395 7,4.156395 1.2538994,0 6.530451,0.392468 6.584946,-4.168088 C 13.622023,2.8853946 10.937298,0 7,0 Z",es="m 4.9623825,3.416 c -0.5858889,0 -0.6520292,2.3368563 -0.024765,2.3368563 0.6604959,0 0.6704653,-2.3368563 0.024765,-2.3368563 z",ts="M 8.588001,3.416 C 8.0021121,3.416 7.9359718,5.7528563 8.563236,5.7528563 9.2237319,5.7528563 9.2337013,3.416 8.588001,3.416 Z",ns="M 4.85,5.15 Q 5.285,4.0 5.72,5.15",rs="M 8.25,5.15 Q 8.618,4.0 8.99,5.15",os="M 4.82,3.9 L 5.6,4.62 L 4.82,5.34",is="M 9.08,3.9 L 8.3,4.62 L 9.08,5.34",ss="M 4.9,4.72 Q 5.285,5.28 5.67,4.72",as="M 8.25,4.72 Q 8.618,5.28 9.0,4.72",Ze=[{lag:.8,hue:"iris",blink:"double",motion:"weight",glances:!1},{lag:1.4,hue:"sakura",blink:"slow",motion:"shift",glances:!1},{lag:1,hue:"mochi",blink:"slow",motion:"rock",glances:!0}],Se=(e,t)=>e+Math.random()*(t-e),Nt=Ze.map(()=>({blinkDelay:-Se(0,9),blinkDuration:Se(3.4,8.6),motionDelay:-Se(0,9),motionDuration:Se(5.5,11),glanceDelay:-Se(0,11)})),cs={double:ee.blinkDouble,slow:ee.blinkSlow},ls=[{x:7,y:4.2,delay:0,drift:"0px"},{x:9.6,y:6.4,delay:-.3,drift:"-0.9px"},{x:4.6,y:6.1,delay:-.6,drift:"0.8px"},{x:8.2,y:3.4,delay:-.9,drift:"-0.4px"}],ut=({className:e})=>{const{data:t}=Ce("dangoGaze"),{lowEndMode:n}=yn(),r=t!=="false"&&!n,i=(c,l,u)=>{const d=Nt[l];return o("g",{transform:`translate(${Pe[l].x} ${Pe[l].y})`,children:o("g",{"data-dango-face-slot":l,"data-face":"normal",className:r?ee[c.motion]:void 0,style:r?{animationDelay:`${d.motionDelay}s`,animationDuration:`${d.motionDuration}s`}:void 0,children:o("g",{"data-nudge":!0,children:u})})},c.hue)},s=c=>o("path",{fill:Tt[c.hue].fill,stroke:Tt[c.hue].stroke,strokeWidth:"0.9",strokeLinejoin:"round",paintOrder:"stroke fill",d:Zi}),a=(c,l)=>{const u=Nt[l],d=r?{animationDelay:`${u.blinkDelay}s`,animationDuration:`${u.blinkDuration}s`}:void 0,m=(f,w)=>o(U,{children:[o("path",{className:ee.line,d:f}),o("path",{className:ee.line,d:w})]}),h=(f,w,N=!0)=>o("g",{className:`${ee.face} ${ee[`face${f}`]}`,children:o("g",{className:r&&N?cs[c.blink]:void 0,style:N?d:void 0,children:w})},f),p=o("g",{className:ee.gaze,style:{"--lag":c.lag,transitionDuration:`${.1+c.lag*.18}s`},children:[h("Normal",o(U,{children:[o("path",{fill:"#140f15",d:es}),o("path",{fill:"#140f15",d:ts})]})),h("Pet",m(ns,rs),!1),h("Squint",m(os,is),!1),h("Sleep",m(ss,as),!1)]});return o(U,{children:[c.glances?o("g",{className:r?ee.glance:void 0,style:r?{animationDelay:`${u.glanceDelay}s`}:void 0,children:p}):p,r&&o("g",{className:ee.cheer,children:ls.map(f=>o("text",{className:ee.heart,x:f.x,y:f.y,fill:"var(--color-danger)",style:{"--drift":f.drift,animationDelay:`${f.delay}s`},children:"♥"},f.x))})]})};return o("svg",{viewBox:`${fe.x} ${fe.y} ${fe.w} ${fe.h}`,className:e?`${ee.logo} ${e}`:ee.logo,role:"img","aria-label":"dango","data-dango-gaze-origin":"",children:[Ze.map((c,l)=>i(c,l,s(c))),Ze.map((c,l)=>i(c,l,a(c,l)))]})},bn=se(void 0),dt=()=>{const e=ae(bn);if(e===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return e},_n=se(void 0),wn=()=>{const e=ae(_n);if(e===void 0)throw new Error("useContentType must be used within a ContentTypeProvider");return e},et="virtual-keyboard:hide",At="virtual-keyboard:enabled-change",En="virtual_keyboard_enabled",us=!1;function Lt(){const e=localStorage.getItem(En);return e===null?us:e==="true"}const qt=e=>e instanceof HTMLInputElement&&e.type==="text"&&!e.disabled&&!e.readOnly;function ds(){window.dispatchEvent(new CustomEvent(et))}function ms(){const[e,t]=k(!1),[n,r]=k(Lt),i=F(null);return E(()=>{const s=d=>{n&&qt(d.target)&&(i.current=d.target,t(!0))},a=d=>{d.target===i.current&&window.setTimeout(()=>{if(qt(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!==En)return;const m=d.newValue==="true";r(m),m||c()},u=()=>{const d=Lt();r(d),d||c()};return document.addEventListener("focusin",s),document.addEventListener("focusout",a),window.addEventListener(et,c),window.addEventListener("storage",l),window.addEventListener(At,u),()=>{document.removeEventListener("focusin",s),document.removeEventListener("focusout",a),window.removeEventListener(et,c),window.removeEventListener("storage",l),window.removeEventListener(At,u)}},[n]),{activeInputRef:i,isVisible:n&&e,hide:()=>t(!1)}}const hs="_header_q6huj_1",ps="_hidden_q6huj_21",fs="_scrolled_q6huj_25",ys="_logo_q6huj_31",vs="_headerInner_q6huj_44",gs="_leftSection_q6huj_54",bs="_desktopNav_q6huj_60",_s="_navLink_q6huj_67",ws="_navLinkActive_q6huj_83",Es="_rightSection_q6huj_102",Ss="_searchWrapper_q6huj_108",ks="_searchInput_q6huj_114",Ps="_searchButton_q6huj_144",xs="_searchIcon_q6huj_168",Ts="_profileBtn_q6huj_178",Is="_profileImg_q6huj_211",Os="_hamburgerBtn_q6huj_217",Cs="_mobileSearchBar_q6huj_244",Ns="_mobileSearchBarHidden_q6huj_271",As="_mobileSearchInner_q6huj_288",Ls="_mobileSearchIcon_q6huj_304",qs="_mobileSearchInput_q6huj_311",S={header:hs,hidden:ps,scrolled:fs,logo:ys,headerInner:vs,leftSection:gs,desktopNav:bs,navLink:_s,navLinkActive:ws,rightSection:Es,searchWrapper:Ss,searchInput:ks,searchButton:Ps,searchIcon:xs,profileBtn:Ts,profileImg:Is,hamburgerBtn:Os,mobileSearchBar:Cs,mobileSearchBarHidden:Ns,mobileSearchInner:As,mobileSearchIcon:Ls,mobileSearchInput:qs},Rs=async()=>{let e;try{e=await J.auth.syncSettings.query()}catch{return null}const t=e.actualActiveProvider;if(t==="github")try{const n=await J.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 J.auth.user.query();if(n)return{name:n.name,picture:n.picture,email:n.email,provider:"google"}}catch{}return null},js=()=>{const{toggleSidebar:e}=dt(),{contentType:t}=wn(),[n,r]=k(""),[i,s]=k(!0),[a,c]=k(!1),[l,u]=k(!0),[d,m]=k(!1),h=Ln(),p=ot(),f=F(null),w=F(!1),N=F(null),j=F(null),I=F(null),P=F(null),D=F(!1),{data:oe}=G({queryKey:["sync-profile"],queryFn:Rs,staleTime:3e4});E(()=>{const O=window.visualViewport;if(!O)return;const $=()=>{P.current?.style.setProperty("--vv-top",`${O.offsetTop}px`)};return $(),O.addEventListener("scroll",$),O.addEventListener("resize",$),()=>{O.removeEventListener("scroll",$),O.removeEventListener("resize",$)}},[]),E(()=>{const O=()=>{f.current&&(window.clearTimeout(f.current),f.current=null)},$=()=>{O(),!(window.scrollY<=10)&&(f.current=window.setTimeout(()=>{D.current||s(!1)},2500))},le=()=>{w.current||(w.current=!0,N.current=requestAnimationFrame(()=>{w.current=!1,N.current=null;const ue=window.scrollY<=10;u(we=>we===ue?we:ue),s(we=>we||!0),$()}))},mt=ue=>{(ue.metaKey||ue.ctrlKey)&&ue.key==="k"?(ue.preventDefault(),Z.current?.focus({preventScroll:!0})):ue.key==="Escape"&&document.activeElement===Z.current&&Z.current?.blur()},Ae=P.current,ht=()=>{D.current=!0},pt=()=>{D.current=!1,$()};return window.addEventListener("scroll",le,{passive:!0}),window.addEventListener("keydown",mt),Ae?.addEventListener("pointerenter",ht),Ae?.addEventListener("pointerleave",pt),()=>{window.removeEventListener("scroll",le),window.removeEventListener("keydown",mt),Ae?.removeEventListener("pointerenter",ht),Ae?.removeEventListener("pointerleave",pt),O(),N.current!==null&&(cancelAnimationFrame(N.current),N.current=null),w.current=!1}},[a]);const Z=rt.useRef(null),y=()=>window.innerWidth<=1024,g=()=>{y()?(m(!0),setTimeout(()=>I.current?.focus({preventScroll:!0}),50)):document.activeElement===Z.current&&n.trim()?_e():Z.current?.focus({preventScroll:!0})},B=O=>{j.current?.contains(O.relatedTarget)||m(!1)},R=p.pathname==="/music"?"Search music...":t==="manga"?"Search manga...":t==="tv"?"Search TV & movies...":t==="asmr"?"Search ASMR...":"Search anime...",te=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=O=>{ds();const $=n.trim();if($){if(p.pathname==="/music"){const le=new URLSearchParams(p.search);le.set("q",$),h(`/music?${le.toString()}`);return}h(t==="manga"?`/manga?q=${encodeURIComponent($)}`:t==="tv"?`/tv-search?q=${encodeURIComponent($)}`:t==="asmr"?`/asmr?q=${encodeURIComponent($)}`:`/search?query=${encodeURIComponent($)}`)}};return o(U,{children:o("header",{ref:P,className:`${S.header} ${i?"":S.hidden} ${l?"":S.scrolled}`,children:[o("div",{className:S.headerInner,children:[o("div",{className:S.leftSection,children:[o("button",{className:S.hamburgerBtn,onClick:e,"aria-label":"Menu",children:o(b,{name:"bars"})}),o(Y,{to:"/",className:S.logo,"aria-label":"Ani-Web Home",children:o(ut,{})}),o("nav",{className:S.desktopNav,children:[o(Y,{to:"/",className:`${S.navLink} ${p.pathname==="/"?S.navLinkActive:""}`,children:"Home"}),o(Y,{to:te.to,className:`${S.navLink} ${p.pathname.startsWith(te.to)?S.navLinkActive:""}`,children:te.label}),t==="anime"&&o(Y,{to:"/insights",className:`${S.navLink} ${p.pathname==="/insights"?S.navLinkActive:""}`,children:"Insights"}),o(Y,{to:"/settings",className:`${S.navLink} ${p.pathname.startsWith("/settings")?S.navLinkActive:""}`,children:"Settings"})]})]}),o("div",{className:S.rightSection,children:[o("div",{className:S.searchWrapper,children:[o("input",{ref:Z,type:"text","data-virtual-keyboard":"true",className:S.searchInput,placeholder:R,value:n,onChange:O=>r(O.target.value),onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:O=>{O.key==="Enter"&&_e()}}),o("button",{type:"button",className:S.searchButton,"aria-label":"Search",onMouseDown:O=>O.preventDefault(),onClick:g,children:o(b,{name:"search",className:S.searchIcon})})]}),o(Ri,{}),o(Y,{to:"/settings?tab=sync",className:S.profileBtn,"aria-label":"Sync settings",children:oe?.picture?o("img",{src:oe.picture,alt:oe.name,className:S.profileImg,referrerPolicy:"no-referrer",decoding:"async"}):oe?.provider==="github"?o(b,{name:"github"}):o(b,{name:"cloud"})})]})]}),d&&o("div",{className:`${S.mobileSearchBar} ${i?"":S.mobileSearchBarHidden}`,ref:j,onBlur:B,children:o("div",{className:S.mobileSearchInner,children:[o(b,{name:"search",className:S.mobileSearchIcon}),o("input",{ref:I,type:"text","data-virtual-keyboard":"true",className:S.mobileSearchInput,placeholder:R,value:n,onChange:O=>r(O.target.value),onKeyDown:O=>{O.key==="Enter"?(_e(),m(!1)):O.key==="Escape"&&m(!1)}})]})})]})})},tt="agreedToViewMature";function Rt(){try{return localStorage.getItem(tt)==="true"}catch{return!1}}function Ds(){const[e,t]=k(Rt);E(()=>{const i=()=>t(Rt());return window.addEventListener("storage",i),window.addEventListener("focus",i),()=>{window.removeEventListener("storage",i),window.removeEventListener("focus",i)}},[]);const n=Q(()=>{try{localStorage.setItem(tt,"true")}catch{}t(!0)},[]),r=Q(()=>{try{localStorage.removeItem(tt)}catch{}t(!1)},[]);return{hasConsent:e,grant:n,revoke:r}}const $s="_sidebar_153jc_1",Ms="_open_153jc_20",zs="_sidebarHeader_153jc_25",Fs="_closeBtn_153jc_33",Bs="_logo_153jc_57",Ws="_navSection_153jc_69",Qs="_navLink_153jc_75",Us="_active_153jc_108",Ks="_overlay_153jc_118",Hs="_versionInfo_153jc_138",ne={sidebar:$s,open:Ms,sidebarHeader:zs,closeBtn:Fs,logo:Bs,navSection:Ws,navLink:Qs,active:Us,overlay:Ks,versionInfo:Hs},Vs="3.5.9",Sn={version:Vs},Gs=()=>{const{isOpen:e,setIsOpen:t}=dt(),{contentType:n}=wn(),{hasConsent:r}=Ds(),i=()=>{t(!1)},s=n==="manga",a=n==="tv",c=n==="asmr",l=[{to:"/",icon:o(b,{name:"home"}),label:"Home"},s?{to:"/manga",icon:o(b,{name:"book"}),label:"Manga"}:a?{to:"/tv-search",icon:o(b,{name:"tv"}),label:"TV and Movies"}:c?{to:"/asmr",icon:o(b,{name:"headphones"}),label:"ASMR"}:{to:"/search",icon:o(b,{name:"search"}),label:"Search"},s?{to:"/reading-list",icon:o(b,{name:"bookmark"}),label:"Reading List"}:a?{to:"/tv-watchlist",icon:o(b,{name:"clock"}),label:"TV Watchlist"}:c?{to:"/listening-list",icon:o(b,{name:"history"}),label:"Listening List"}:{to:"/watchlist",icon:o(b,{name:"clock"}),label:"Watchlist"},...n==="anime"?[{to:"/insights",icon:o(b,{name:"chart-pie"}),label:"Insights"}]:[],{to:"/trackers",icon:o(b,{name:"sync-alt"}),label:"Trackers"},{to:"/radio",icon:o(b,{name:"broadcast-tower"}),label:"Radio"},{to:"/music",icon:o(b,{name:"headphones"}),label:"Music"},...r?[{to:"/mature",icon:o(b,{name:"pepper-hot"}),label:"Mature"}]:[],{to:"/settings",icon:o(b,{name:"cog"}),label:"Settings"}];return o(U,{children:[o("aside",{className:`${ne.sidebar} ${e?ne.open:""} sidebar`,children:[o("div",{className:ne.sidebarHeader,children:[o("button",{className:ne.closeBtn,onClick:()=>t(!1),"aria-label":"Close menu",children:"×"}),o(Y,{to:"/",className:ne.logo,onClick:i,children:o(ut,{})})]}),o("nav",{className:ne.navSection,children:l.map(u=>o(qn,{to:u.to,className:({isActive:d})=>`${ne.navLink} ${d?ne.active:""}`,onClick:i,end:u.to==="/",children:[u.icon,o("span",{children:u.label})]},u.to))}),o("div",{className:ne.versionInfo,children:["v",Sn.version]})]}),e&&o("div",{className:ne.overlay,onClick:()=>t(!1),"aria-label":"Close sidebar"})]})},Ys="_footer_1c905_1",Js="_footerInner_1c905_15",Xs="_brandSection_1c905_27",Zs="_logoRow_1c905_39",ea="_logoText_1c905_45",ta="_brandMeta_1c905_51",na="_brandTagline_1c905_60",ra="_statusPill_1c905_67",oa="_statusDot_1c905_80",ia="_linksGrid_1c905_88",sa="_linkColumn_1c905_96",aa="_columnTitle_1c905_102",ca="_bottomBar_1c905_126",la="_copyright_1c905_136",ua="_brand_1c905_27",da="_heartIcon_1c905_152",ma="_backToTop_1c905_157",A={footer:Ys,footerInner:Js,brandSection:Xs,logoRow:Zs,logoText:ea,brandMeta:ta,brandTagline:na,statusPill:ra,statusDot:oa,linksGrid:ia,linkColumn:sa,columnTitle:aa,bottomBar:ca,copyright:la,brand:ua,heartIcon:da,backToTop:ma},ha=()=>{const e=new Date().getFullYear(),t=()=>{window.scrollTo({top:0,behavior:"smooth"})};return o("footer",{className:A.footer,children:[o("div",{className:A.footerInner,children:[o("div",{className:A.brandSection,children:[o("div",{className:A.logoRow,children:o(ut,{className:A.logoText})}),o("div",{className:A.brandMeta,children:[o("div",{className:A.statusPill,children:[o("span",{className:A.statusDot}),o("span",{children:["v",Sn.version]})]}),o("p",{className:A.brandTagline,children:"Fast, local anime streaming."})]})]}),o("div",{className:A.linksGrid,children:[o("div",{className:A.linkColumn,children:[o("h4",{className:A.columnTitle,children:"Navigation"}),o(Y,{to:"/",children:"Home"}),o(Y,{to:"/watchlist",children:"Watchlist"}),o(Y,{to:"/settings",children:"Settings"})]}),o("div",{className:A.linkColumn,children:[o("h4",{className:A.columnTitle,children:"Features"}),o(Y,{to:"/search",children:"Search Anime"}),o(Y,{to:"/trackers",children:"Trackers"}),o(Y,{to:"/insights",children:"Insights"})]}),o("div",{className:A.linkColumn,children:[o("h4",{className:A.columnTitle,children:"Community"}),o("a",{href:"https://discord.gg/2FTSPXCsvn",target:"_blank",rel:"noopener noreferrer",children:[o(b,{name:"discord",style:{marginRight:"6px"}})," Discord"]}),o("a",{href:"https://github.com/serifpersia/dango",target:"_blank",rel:"noopener noreferrer",children:[o(b,{name:"github",style:{marginRight:"6px"}})," GitHub"]})]}),o("div",{className:A.linkColumn,children:[o("h4",{className:A.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:A.bottomBar,children:[o("p",{className:A.copyright,children:["© ",e," ",o("span",{className:A.brand,children:"dango"})," • Crafted with"," ",o(b,{name:"heart",className:A.heartIcon})," by"," ",o("a",{href:"https://github.com/serifpersia",target:"_blank",rel:"noopener noreferrer",children:"serifpersia"})]}),o("button",{className:A.backToTop,onClick:t,"aria-label":"Back to top",children:[o(b,{name:"chevron-up",size:14}),o("span",{children:"Top"})]})]})]})};function kn(e){return JSON.stringify({0:e??{}})}function Pn(e){return`/api/trpc/${e}?batch=1`}function nt(e,t){const n=kn(t),r=Pn(e);try{if(navigator.sendBeacon){navigator.sendBeacon(r,new Blob([n],{type:"application/json"}));return}}catch{}fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}).catch(()=>{})}async function ul(e,t){await fetch(Pn(e),{method:"POST",headers:{"Content-Type":"application/json"},body:kn(t),keepalive:!0})}function dl(e){e&&(nt("discord.clear",{sessionId:e}),nt("discord.heartbeat",{sessionId:e,bye:!0}))}function pa(){const e=ot(),{data:t}=Ce("discordRPCEnabled"),n=F("");n.current||(n.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`tab-${Date.now()}-${Math.random().toString(36).slice(2)}`),E(()=>{if(t===!1||t==="false")return;const r=n.current,i=()=>J.discord.heartbeat.mutate({sessionId:r}).catch(()=>{});i();const s=setInterval(i,15e3),a=()=>{nt("discord.heartbeat",{sessionId:r,bye:!0})};return window.addEventListener("pagehide",a),()=>{clearInterval(s),window.removeEventListener("pagehide",a)}},[t]),E(()=>{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("/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"),J.discord.pageStatus.mutate({page:i}).catch(()=>{})},[e.pathname,t])}function xn(e,t){const[n,r]=k(()=>{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}});E(()=>{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=Q(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 Tn=se(void 0),fa=()=>{const e=ae(Tn);if(!e)throw new Error("useAnimePaheCookie must be used within an AnimePaheCookieProvider");return e},ya="_overlay_1juub_1",va="_fadeIn_1juub_1",ga="_content_1juub_11",ba="_modalIn_1juub_1",_a="_sm_1juub_29",wa="_md_1juub_33",Ea="_lg_1juub_37",Sa="_title_1juub_41",ka="_body_1juub_48",Pa="_footer_1juub_52",ge={overlay:ya,fadeIn:va,content:ga,modalIn:ba,sm:_a,md:wa,lg:Ea,title:Sa,body:ka,footer:Pa};function In({children:e}){return o("h2",{className:ge.title,children:e})}function On({children:e}){return o("div",{className:ge.body,children:e})}function Cn({children:e}){return o("div",{className:ge.footer,children:e})}function Ne({isOpen:e,onClose:t,title:n,children:r,footer:i,width:s="md"}){const a=F(null);return E(()=>{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?Ut(o("div",{role:"presentation",onMouseDown:c=>c.stopPropagation(),children:[o("div",{className:ge.overlay,onClick:()=>t?.(),"aria-hidden":"true"}),o("div",{ref:a,className:`${ge.content} ${ge[s]}`,role:"dialog","aria-modal":"true","aria-label":n,tabIndex:-1,children:[n&&o(In,{children:n}),o(On,{children:r}),i&&o(Cn,{children:i})]})]}),document.body):null}Ne.Header=In;Ne.Body=On;Ne.Actions=Cn;const xa="_container_e96gf_1",Ta="_field_e96gf_9",Ia="_textarea_e96gf_20",Oa="_input_e96gf_40",Ca="_button_e96gf_58",Na="_secondaryButton_e96gf_78",Aa="_actions_e96gf_95",La="_hint_e96gf_104",qa="_link_e96gf_117",H={container:xa,field:Ta,textarea:Ia,input:Oa,button:Ca,secondaryButton:Na,actions:Aa,hint:La,link:qa},Ra="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",ja=e=>{try{return JSON.parse(e.detail)}catch{return null}},Da=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,i]=k(1),[s,a]=k(navigator.userAgent),[c,l]=k(""),[u,d]=k(!1),m=F(null),h=navigator.userAgent,p=/android/i.test(h),f=/firefox|fxios/i.test(h)&&!p,w=!f&&!p&&/chrome|chromium|edg|brave/i.test(h),N=f||w;E(()=>{e&&(i(1),a(navigator.userAgent),l(""),d(!1))},[e]),E(()=>()=>{m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null)},[]);const j=()=>{localStorage.setItem("animepahe_ua",s),window.open("https://animepahe.pw","_blank","noopener,noreferrer"),i(2)},I=()=>{if(u)return;d(!0);const D=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,oe=window.setTimeout(()=>{d(!1),m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null),_.error("Helper not detected — install it via about:debugging first.")},3e3),Z=y=>{const g=ja(y);if(!(!g||g.requestId!==D))if(window.clearTimeout(oe),window.removeEventListener("dango:pahe-cookie",Z),m.current=null,d(!1),g?.ok&&g.cookie)l(g.cookie),_.success("Cookie extracted from helper!");else if(g?.error==="NO_COOKIE"){const B=g.debug?.stores?.length??0,R=g.debug?.names??[];_.error(`Helper found no cf_clearance (checked ${B} stores, saw: ${R.join(", ")||"none"}) — solve the challenge on the AnimePahe tab first.`)}else _.error("Helper request failed — try again.")};m.current=Z,window.addEventListener("dango:pahe-cookie",Z),window.dispatchEvent(new CustomEvent("dango:get-pahe-cookie",{detail:{requestId:D}}))},P=()=>{const D=c.trim();if(!D){_.error("Please enter the cf_clearance cookie");return}try{localStorage.setItem("animepahe_cookie",D),_.success("Cookie updated successfully! Reloading…"),n?.(),t(),window.setTimeout(()=>window.location.reload(),1e3)}catch{_.error("Failed to save cookie")}};return o(Ne,{isOpen:e,onClose:t,title:"AnimePahe Verification Required",children:o("div",{className:H.container,children:r===1?o(U,{children:[o("p",{children:"AnimePahe requires a manual verification to bypass Cloudflare/DDoS-Guard protection."}),o("div",{className:H.field,children:[o("label",{children:"Your User-Agent (will be used for requests):"}),o("textarea",{value:s,readOnly:!0,rows:3,className:H.textarea})]}),o("div",{className:H.actions,children:[o("button",{className:H.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:H.button,onClick:j,children:"Start Verification (Opens AnimePahe)"})]})]}):o(U,{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."]}),N&&o("div",{className:H.hint,children:[o("strong",{children:"Dango helper (one-time setup):"})," ",f?o(U,{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(U,{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:Ra,target:"_blank",rel:"noreferrer",className:H.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",o("div",{className:H.actions,children:o("button",{className:H.button,onClick:I,disabled:u,type:"button",children:u?"Extracting…":"Extract cookie from helper"})})]}),o("div",{className:H.field,children:[o("label",{children:"cf_clearance cookie value:"}),o("input",{type:"text",value:c,onChange:D=>l(D.target.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:H.input})]}),o("div",{className:H.actions,children:[o("button",{className:H.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:H.secondaryButton,onClick:()=>i(1),children:"Back"}),o("button",{className:H.button,onClick:P,children:"Submit"})]})]})})})},jt=300,$a=(e,t,n)=>{const r=i=>Math.max(-1,Math.min(1,i));return{x:r((e-(n.left+n.width/2))/jt),y:r((t-(n.top+n.height/2))/jt)}},Ma=["normal","squint"],za={normal:.64,squint:.36},Fa=(e=Math.random())=>{let t=0;for(const n of Ma)if(t+=za[n],e<t)return n;return"normal"},Ba="pet",Wa="sleep",Qa=6e3,Ua=420,Ka=.5,Ha=[0,260,520],He={from:1,to:2,after:200},ke=()=>document.querySelectorAll("[data-dango-face-slot]"),Dt=e=>e?.closest?.("[data-dango-face-slot]")??null,Va=()=>{const{data:e}=Ce("dangoGaze"),{lowEndMode:t}=yn(),n=e!=="false"&&!t;E(()=>{if(!n||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const r=["normal","normal","normal"];let i=-1,s=-1,a=!1,c=0,l=0;const u=[],d=(y,g)=>{const B=Array.from(document.querySelectorAll("svg[data-dango-gaze-origin]")).map(R=>R.getBoundingClientRect());return B.find(R=>y>=R.left&&y<=R.right&&g>=R.top&&g<=R.bottom)??B[0]},m=(y,g)=>{const B=window.setTimeout(()=>{u.splice(u.indexOf(B),1),y()},g);u.push(B)},h=(y,g,B)=>{const R=()=>ke().forEach(te=>te.removeAttribute(g));R(),requestAnimationFrame(()=>{ke().forEach(te=>{Number(te.getAttribute("data-dango-face-slot"))===y&&te.setAttribute(g,"")}),m(R,B)})},p=(y,g,B)=>{ke().forEach(R=>{Number(R.getAttribute("data-dango-face-slot"))===y&&(B?R.setAttribute(g,""):R.removeAttribute(g))})},f=()=>{ke().forEach(y=>{const g=Number(y.getAttribute("data-dango-face-slot"));y.setAttribute("data-face",s===g?Ba:r[g]),i===g?y.setAttribute("data-hover",""):y.removeAttribute("data-hover")})},w=y=>{y!==s&&(s>=0&&p(s,"data-cheer",!1),s=y,y>=0&&p(y,"data-cheer",!0))},N=()=>{window.clearTimeout(l),l=window.setTimeout(()=>{w(-1),f()},Ua)},j=()=>{window.clearTimeout(l),w(-1)},I=()=>{a=!1,Ha.forEach((y,g)=>{m(()=>{r[g]=Fa(),g===He.from&&m(()=>h(He.to,"data-nudge",520),He.after),f()},y)})},P=()=>{a=!0,r.fill(Wa),j(),f()},D=()=>{window.clearTimeout(c),c=window.setTimeout(P,Qa)},oe=y=>{const g=d(y.clientX,y.clientY);if(!g)return;const{x:B,y:R}=$a(y.clientX,y.clientY,g),te=document.documentElement.style;te.setProperty("--dango-gaze-x",B.toFixed(3)),te.setProperty("--dango-gaze-y",R.toFixed(3));const _e=i,O=s,$=Ct(y.clientX,y.clientY,g),le=$>=0?$:Ct(y.clientX,y.clientY,g,Ka);i=$,le>=0?(w(le),N()):j(),(_e!==i||O!==s)&&f(),a&&I(),D()},Z=y=>{const g=Dt(y.target),B=g?.getAttribute("data-dango-face-slot"),R=Dt(y.relatedTarget);!g||R?.getAttribute("data-dango-face-slot")===B||(i=-1,j(),f(),D())};return f(),D(),window.addEventListener("pointermove",oe,{passive:!0}),document.addEventListener("pointerout",Z),()=>{window.clearTimeout(c),window.clearTimeout(l),u.forEach(window.clearTimeout),window.removeEventListener("pointermove",oe),document.removeEventListener("pointerout",Z),document.documentElement.style.removeProperty("--dango-gaze-x"),document.documentElement.style.removeProperty("--dango-gaze-y"),ke().forEach(y=>{y.setAttribute("data-face","normal"),y.removeAttribute("data-hover"),y.removeAttribute("data-cheer")})}},[n])};function Ga(){const[e,t]=k(!1);return E(()=>{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 Ya extends Rn{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(b,{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(b,{name:"home"}),"Go back Home"]})]}):this.props.children}}const Nn=se(void 0),Ja=({children:e})=>{const[t,n]=k(!1),r=Q(()=>n(!0),[]),i=Q(()=>n(!1),[]);return E(()=>ln("lan",r),[r]),o(Nn.Provider,{value:{isOpen:t,openModal:r,closeModal:i},children:e})},Xa=()=>{const e=ae(Nn);if(!e)throw new Error("useLanAuth must be used within a LanAuthProvider");return e},Za="_container_88bss_1",ec="_field_88bss_8",tc="_input_88bss_19",nc="_actions_88bss_37",Re={container:Za,field:ec,input:tc,actions:nc},$t=jn(({variant:e="primary",size:t="md",loading:n,children:r,className:i="",disabled:s,...a},c)=>{const l=ti("btn",`btn-${e}`,t!=="md"&&`btn-${t}`,n&&"btn-loading",i);return o("button",{className:l,disabled:s||n,ref:c,...a,children:n?o("span",{className:"btn-spinner"}):r})}),rc=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,i]=k(""),[s,a]=k(!1);rt.useEffect(()=>{e&&i("")},[e]);const c=async()=>{if(!r){_.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){_.error(u.error||"Login failed");return}_.success("Authenticated successfully"),n(),t(),window.location.reload()}catch{_.error("Network error")}finally{a(!1)}};return o(Ne,{isOpen:e,onClose:t,title:"LAN Authentication Required",children:o("div",{className:Re.container,children:[o("p",{children:"This instance is protected. Enter the password to access from this device."}),o("div",{className:Re.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:Re.input,onKeyDown:l=>l.key==="Enter"&&c()})]}),o("div",{className:Re.actions,children:[o($t,{variant:"secondary",onClick:t,disabled:s,children:"Cancel"}),o($t,{variant:"primary",onClick:c,loading:s,children:"Unlock"})]})]})})},oc=L(()=>q(()=>import("./Home-BqhPqzWF.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]))),ic=L(()=>q(()=>import("./Watchlist-yVEi1oVn.js"),__vite__mapDeps([30,1,2,4,6,7,8,9,10,11,12,13,3,5,14,15,31,32]))),sc=L(()=>q(()=>import("./Settings-BbihEcZ2.js"),__vite__mapDeps([33,1,2,34,35,4,36]))),Mt=L(()=>q(()=>import("./Player-Dgtn--lM.js"),__vite__mapDeps([37,1,2,38,4,39,40,12,17,18,8,9,10,23,41,42,43,44,45]))),ac=L(()=>q(()=>import("./Search-CbPFjKeU.js"),__vite__mapDeps([46,1,4,3,5,6,7,2,8,9,10,11,12,13,14,15,47,48]))),cc=L(()=>q(()=>import("./Mature-B0DoN3tQ.js"),__vite__mapDeps([49,1,2,4,3,5,6,7,8,9,10,11,12,13,14,15,23,47,48,50]))),zt=L(()=>q(()=>import("./Asmr-DZmR_EHb.js"),__vite__mapDeps([51,1,4,2,34,35,11,9,12,13,28,52,53,54,21,40,55,56]))),lc=L(()=>q(()=>import("./Manga-x4pVT4ZH.js"),__vite__mapDeps([57,1,4,34,35,14,15,11,9,12,13,19,20,2,21,23,58,59,55,56]))),uc=L(()=>q(()=>import("./MangaInfoPage-BPSW9UER.js"),__vite__mapDeps([60,1,4,14,15,20,2,58,59,55,56]))),dc=L(()=>q(()=>import("./MangaReadPage-V1iDbCfL.js"),__vite__mapDeps([61,1,14,4,15,2,20,58,59,55,56]))),mc=L(()=>q(()=>import("./ReadingList-B97i_hGv.js"),__vite__mapDeps([62,1,11,9,12,4,13,63,3,5,14,15,31,32,19,20,2,21,22,16]))),hc=L(()=>q(()=>import("./Radio-BAE-Q-iN.js"),__vite__mapDeps([64,1,4,2,52,53,65,66,55,56]))),pc=L(()=>q(()=>import("./Music-1MlUIfdw.js"),__vite__mapDeps([67,1,4,65,66,52,53,2,55,56,68]))),Ft=L(()=>q(()=>import("./TvSearch-B-2sRNbN.js"),__vite__mapDeps([69,1,4,3,5,24,11,9,12,13,25,26,2,14,15,47,48]))),fc=L(()=>q(()=>import("./TvInfo-CxSmzVSL.js"),__vite__mapDeps([70,1,4,26,2,71]))),yc=L(()=>q(()=>import("./Tv-BSGuUz2F.js"),__vite__mapDeps([72,1,2,4,38,39,73,23,26,40,12,43,44,74]))),vc=L(()=>q(()=>import("./TvWatchlist-MaA-qhQw.js"),__vite__mapDeps([75,1,11,9,12,4,13,63,3,5,14,15,31,32,16,25,26,2]))),gc=L(()=>q(()=>import("./ListeningList-Cm9zGlLB.js"),__vite__mapDeps([76,1,11,9,12,4,13,63,3,5,14,15,31,32,54,28,2,52,53,21,27,16]))),bc=L(()=>q(()=>import("./Trackers-Bperfrcz.js"),__vite__mapDeps([77,1,2,4,78]))),_c=L(()=>q(()=>import("./Insights-CmbbDZr3.js"),__vite__mapDeps([79,1,2,4,80]))),wc=L(()=>q(()=>import("./AnimeInfoPage-Cc3OcfHY.js"),__vite__mapDeps([81,1,2,4]))),Ec=L(()=>q(()=>import("./PlayerRedirect-fv2tzEUu.js"),__vite__mapDeps([82,1]))),Sc=L(()=>q(()=>import("./VirtualKeyboard-BmqZPZXR.js"),__vite__mapDeps([83,1,84])));function kc(){Va();const{isOpen:e,closeModal:t,onSuccess:n}=fa(),{isOpen:r,setIsOpen:i}=dt(),{isOpen:s,openModal:a,closeModal:c}=Xa(),l=ot(),u=Dn(),d=F(new Map),m=F(l.pathname),h=ms();pa();const[p,f]=k(!1);E(()=>{fetch("/api/auth/app-status").then(I=>I.json()).then(I=>{I.hasPassword&&!I.isAuthenticated&&(f(!0),a())}).catch(()=>{})},[a]);const[w,N]=xn("lan_auth_notice_shown","false"),j=F(!1);return E(()=>{if(w==="true"||j.current)return;j.current=!0,N("true");const I=setTimeout(()=>{_("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(I)},[w,N]),E(()=>{try{window.history.scrollRestoration="manual"}catch{}},[]),E(()=>{const I=l.key,P=d.current;if(u==="POP"){const D=P.get(I)??0;window.scrollTo({top:D,behavior:"instant"})}else l.pathname!==m.current&&window.scrollTo({top:0,behavior:"instant"});return m.current=l.pathname,()=>{P.set(I,window.scrollY)}},[l.key,l.pathname,u]),E(()=>{const I=P=>{r&&P.key==="Escape"&&i(!1)};return r?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open"),window.addEventListener("keydown",I),()=>{window.removeEventListener("keydown",I),document.body.classList.remove("sidebar-open")}},[r,i]),o("div",{className:"app-container",children:[o(Da,{isOpen:e,onClose:t,onSuccess:n}),o(rc,{isOpen:s,onClose:p?()=>{}:c,onSuccess:()=>{f(!1),c()}}),o(qr,{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(js,{}),o(Gs,{}),o("main",{className:"main-content",children:o(Ya,{children:o(ft,{fallback:o(Ga,{}),children:o($n,{children:[o(x,{path:"/",element:o(oc,{})}),o(x,{path:"/watchlist/:filter?",element:o(ic,{})}),o(x,{path:"/reading-list/:filter?",element:o(mc,{})}),o(x,{path:"/search",element:o(ac,{})}),o(x,{path:"/mature",element:o(cc,{})}),o(x,{path:"/asmr",element:o(zt,{})}),o(x,{path:"/asmr/:rj",element:o(zt,{})}),o(x,{path:"/manga",element:o(lc,{})}),o(x,{path:"/manga/:provider/:id",element:o(uc,{})}),o(x,{path:"/manga/:provider/:id/read",element:o(dc,{})}),o(x,{path:"/radio",element:o(hc,{})}),o(x,{path:"/music",element:o(pc,{})}),o(x,{path:"/tv",element:o(Ft,{})}),o(x,{path:"/tv/:id",element:o(fc,{})}),o(x,{path:"/tv/:id/watch",element:o(yc,{})}),o(x,{path:"/tv-search",element:o(Ft,{})}),o(x,{path:"/tv-watchlist/:filter?",element:o(vc,{})}),o(x,{path:"/listening-list/:filter?",element:o(gc,{})}),o(x,{path:"/settings",element:o(sc,{})}),o(x,{path:"/trackers",element:o(bc,{})}),o(x,{path:"/mal",element:o(yt,{to:"/trackers",replace:!0})}),o(x,{path:"/insights",element:o(_c,{})}),o(x,{path:"/anime/:id",element:o(wc,{})}),o(x,{path:"/watch/:id",element:o(Mt,{})}),o(x,{path:"/watch/:id/:episodeNumber",element:o(Mt,{})}),o(x,{path:"/player/:id/:episodeNumber?",element:o(Ec,{})}),o(x,{path:"*",element:o(yt,{to:"/",replace:!0})})]})})})}),o(ha,{}),h.isVisible&&o(ft,{fallback:null,children:o(Sc,{activeInputRef:h.activeInputRef,isVisible:h.isVisible,onClose:h.hide})})]})}function Pc(){return o(Ja,{children:o(kc,{})})}const xc=({children:e})=>{const[t,n]=k(!1),r=Q(()=>{n(s=>!s)},[]),i=be(()=>({isOpen:t,setIsOpen:n,toggleSidebar:r}),[t,r]);return o(bn.Provider,{value:i,children:e})},Tc=({children:e})=>{const[t,n]=xn("dango_content_type","anime"),r=be(()=>({contentType:t,setContentType:n}),[t,n]);return o(_n.Provider,{value:r,children:e})},Ic=({children:e})=>{const[t,n]=k("englishName"),[r,i]=k(!0);E(()=>{(async()=>{try{const c=await J.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=be(()=>({titlePreference:t,setTitlePreference:n,loading:r}),[t,r]);return o(dn.Provider,{value:s,children:e})},Oc=({children:e})=>{const{data:t,isLoading:n}=Ce("lowEndMode"),r=vn(),i=K(),[s,a]=k(!1);E(()=>{const u=i.getDefaultOptions();i.setDefaultOptions({...u,queries:{...u.queries,gcTime:s?900*1e3:1800*1e3}})},[s,i]),E(()=>{t!==void 0&&a(t==="true"||t===!0)},[t]),E(()=>{s?document.body.classList.add("low-end"):document.body.classList.remove("low-end")},[s]);const c=Q(u=>{a(u),r.mutate({key:"lowEndMode",value:String(u)})},[r]),l=be(()=>({lowEndMode:s,setLowEndMode:c,loading:n}),[s,c,n]);return o(fn.Provider,{value:l,children:e})},Cc=["iris","mochi","sakura"];function Bt(e){e==="iris"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const Nc=({children:e})=>{const{data:t,isLoading:n}=Ce("theme"),r=vn(),[i,s]=k("iris");E(()=>{typeof t=="string"&&Cc.includes(t)&&s(t)},[t]),E(()=>{Bt(i)},[i]);const a=Q(l=>{l!==i&&(s(l),Bt(l),r.mutate({key:"theme",value:l}))},[r,i]),c=be(()=>({theme:i,setTheme:a,loading:n}),[i,a,n]);return o(gn.Provider,{value:c,children:e})},Ac=({children:e})=>{const[t,n]=k(!1),[r,i]=k(void 0),s=Q(c=>{i(()=>c),n(!0)},[]),a=Q(()=>{n(!1),i(void 0)},[]);return E(()=>ln("animepahe",()=>s()),[s]),o(Tn.Provider,{value:{isOpen:t,openModal:s,closeModal:a,onSuccess:r},children:e})};try{window.history.scrollRestoration="manual"}catch{}const Wt=new Wn({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1800*1e3,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,retry:1}}}),Qt=document.getElementById("root");Qt&&Mn(o(zn,{children:o(Xo,{trpcClient:J,queryClient:Wt,children:o(Qn,{client:Wt,children:o(Ac,{children:o(xc,{children:o(Tc,{children:o(Ic,{children:o(Oc,{children:o(Nc,{children:o(Pc,{})})})})})})})})})}),Qt);export{Gc as $,vn as A,$t as B,rl as C,ol as D,nl as E,M as F,cl as G,Lt as H,At as I,Mc as J,Da as K,Qc as L,Ne as M,ds as N,dl as O,H as P,ln as Q,ul as R,Ke as S,ll as T,jc as U,En as V,dt as W,al as X,Ga as Y,Vc as Z,q as _,xn as a,Hc as a0,Fc as b,Bc as c,ni as d,Ds as e,ei as f,Dc as g,C as h,Wc as i,wn as j,tl as k,Uc as l,Kc as m,Yc as n,Jc as o,il as p,Zc as q,zc as r,$c as s,J as t,yn as u,sl as v,el as w,Xc as x,Ce as y,_ as z};
@@ -1 +1 @@
1
- import{q as g}from"./vendor-core-DfaOB3Rn.js";import{u as p,b as q,a as M}from"./vendor-query-BBT5_sHx.js";import{h as v,z as h,t as y}from"./index-_iy8RyKU.js";import{u as Q}from"./QueueOptionsButton-CGQAqTtM.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};
1
+ import{q as g}from"./vendor-core-DfaOB3Rn.js";import{u as p,b as q,a as M}from"./vendor-query-BBT5_sHx.js";import{h as v,z as h,t as y}from"./index-DNxWyfmM.js";import{u as Q}from"./QueueOptionsButton-DjcdOJgg.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};
@@ -1 +1 @@
1
- import{T as k}from"./vendor-core-DfaOB3Rn.js";import{b as y,u as l,a as d,e as F}from"./vendor-query-BBT5_sHx.js";import{h as n,z as a,t as v}from"./index-_iy8RyKU.js";function P(e){return String(e||"").trim().toUpperCase()}function M(e){return P(e.id||e._id||"")}function N(e){return!!e.isAdult}const D=["Listening","Completed","On-Hold","Dropped","Planned"],E=e=>P(e),G=(e="All",s=1,r=24)=>{const t=n();return y(t.asmrLibrary.list.queryOptions({status:e,page:s,limit:r}))},O=()=>{const e=n();return y({...e.asmrLibrary.ids.queryOptions(),staleTime:1e3*60})},H=e=>{const s=n();return y({...s.asmrLibrary.check.queryOptions({id:e||""}),enabled:!!e,staleTime:1e3*60})},U=(e=24)=>{const s=n();return y(s.asmrProgress.continueListening.queryOptions({limit:e}))},W=e=>{const s=n();return y({...s.asmrProgress.getByWork.queryOptions({workId:e||""}),enabled:!!e})},T=()=>{const e=n(),s=l();return d({mutationFn:async r=>{const{silent:t,...m}=r;return v.asmrLibrary.add.mutate(m)},onSuccess:(r,t)=>{t.silent||a.success("Added to listening list"),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries(e.asmrLibrary.pathFilter())},onError:r=>{a.error(`Failed to add: ${r.message}`)}})},_=()=>{const e=n(),s=l();return d(e.asmrLibrary.remove.mutationOptions({onSuccess:()=>{a.success("Removed from listening list"),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())},onError:r=>{a.error(`Failed to remove: ${r.message}`)}}))},x=()=>{const e=n(),s=l();return d(e.asmrLibrary.setStatus.mutationOptions({onSuccess:()=>{a.success("Status updated"),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())},onError:r=>{a.error(`Failed to update status: ${r.message}`)}}))},z=()=>{const e=n(),s=l();return d(e.asmrProgress.save.mutationOptions({onSuccess:(r,t)=>{s.invalidateQueries({queryKey:["asmr-progress",t.workId]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())}}))},j=()=>{const e=n(),s=l();return d(e.asmrProgress.remove.mutationOptions({onSuccess:()=>{a.success("Progress reset"),s.invalidateQueries({queryKey:["asmr-progress"]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())},onError:r=>{a.error(`Failed to reset progress: ${r.message}`)}}))},Y=()=>{const e=n(),s=l();return d(e.asmrLibrary.batchStatus.mutationOptions({onSuccess:r=>{a.success(`Status updated for ${r.updated??0} items`),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())},onError:r=>{a.error(`Failed to update statuses: ${r.message}`)}}))},J=()=>{const e=n(),s=l();return d(e.asmrLibrary.removeMany.mutationOptions({onSuccess:r=>{const t=r.removed??0;a.success(`Removed ${t} ${t===1?"item":"items"} from listening list`),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())},onError:r=>{a.error(`Failed to remove: ${r.message}`)}}))},V=()=>{const e=n(),s=l();return d(e.asmrProgress.removeMany.mutationOptions({onSuccess:r=>{const t=r.removed??0;a.success(`Reset progress for ${t} ${t===1?"item":"items"}`),s.invalidateQueries({queryKey:["asmr-progress"]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())},onError:r=>{a.error(`Failed to reset progress: ${r.message}`)}}))},X=()=>{const e=T(),s=_(),{data:r}=O(),t=k(()=>new Set(r?.ids||[]),[r]);return{toggle:i=>{const o=E(i.rjCode);t.has(o)?s.mutate({id:o}):e.mutate({...i,thumbnail:i.thumbnail||""})},bookmarkedIds:t,pending:e.isPending||s.isPending}},h=300*1e3,A=15,Z=(e,s,r,t)=>{const m=s+1,i=F({queries:Array.from({length:m},(u,w)=>{const L=w+1;return{queryKey:["asmrBrowse",e,L,r,t],queryFn:()=>{const K=e.trim();return v.asmr.browse.query({q:K||void 0,page:L,sort:r&&r!=="latest"?r:void 0,rating:t||void 0})},staleTime:h}})}),o=i.flatMap(u=>u.data?.shows??[]),q=o.slice((s-1)*A,s*A),p=i[i.length-1]?.data,b=!!(p&&(p.hasNext||o.length>s*A)),f=i.some(u=>u.isLoading),c=i.some(u=>u.isFetching),Q=i.some(u=>u.isError);return{data:{shows:q,hasNext:b},isLoading:f,isError:Q,isFetching:c}},ee=e=>y({queryKey:["asmrWork",e],queryFn:()=>v.asmr.work.query({rj:e}),enabled:!!e,staleTime:h,refetchOnMount:"always"}),C=15,g=6;function B(e){if(e.isAdult||!e.thumbnail)return!1;const s=(e.rating||"").toLowerCase();return s===""||s==="sfw"}function S(e,s){const r=new Set,t=[];for(const m of e)for(const i of m){if(t.length>=s)return t;const o=i.id||i._id;!o||r.has(o)||(r.add(o),B(i)&&t.push(i))}return t}const se=(e=!0)=>{const s=F({queries:Array.from({length:C},(c,Q)=>{const u=Q+1;return{queryKey:["asmrBrowse","",u,"popular_month",""],queryFn:()=>v.asmr.browse.query({page:u,sort:"popular_month"}),staleTime:h,enabled:e,retry:1}})}),r=s.map(c=>c.data?.shows??[]),t=S(r,g),m=s.every(c=>c.isFetched),i=e&&m&&t.length<g,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??[],p=t.length>=g?t.slice(0,g):S([t,q],g),b=e&&(s.some(c=>c.isLoading)||i&&o.isLoading),f=e&&m&&p.length===0&&s.some(c=>c.isError);return{data:p,isLoading:b,isError:f}};export{D as A,M as a,se as b,ee as c,H as d,X as e,W as f,P as g,z as h,T as i,Z as j,E as k,N as l,G as m,_ as n,x as o,Y as p,J as q,V as r,j as s,U as u};
1
+ import{T as k}from"./vendor-core-DfaOB3Rn.js";import{b as y,u as l,a as d,e as F}from"./vendor-query-BBT5_sHx.js";import{h as n,z as a,t as v}from"./index-DNxWyfmM.js";function P(e){return String(e||"").trim().toUpperCase()}function M(e){return P(e.id||e._id||"")}function N(e){return!!e.isAdult}const D=["Listening","Completed","On-Hold","Dropped","Planned"],E=e=>P(e),G=(e="All",s=1,r=24)=>{const t=n();return y(t.asmrLibrary.list.queryOptions({status:e,page:s,limit:r}))},O=()=>{const e=n();return y({...e.asmrLibrary.ids.queryOptions(),staleTime:1e3*60})},H=e=>{const s=n();return y({...s.asmrLibrary.check.queryOptions({id:e||""}),enabled:!!e,staleTime:1e3*60})},U=(e=24)=>{const s=n();return y(s.asmrProgress.continueListening.queryOptions({limit:e}))},W=e=>{const s=n();return y({...s.asmrProgress.getByWork.queryOptions({workId:e||""}),enabled:!!e})},T=()=>{const e=n(),s=l();return d({mutationFn:async r=>{const{silent:t,...m}=r;return v.asmrLibrary.add.mutate(m)},onSuccess:(r,t)=>{t.silent||a.success("Added to listening list"),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries(e.asmrLibrary.pathFilter())},onError:r=>{a.error(`Failed to add: ${r.message}`)}})},_=()=>{const e=n(),s=l();return d(e.asmrLibrary.remove.mutationOptions({onSuccess:()=>{a.success("Removed from listening list"),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())},onError:r=>{a.error(`Failed to remove: ${r.message}`)}}))},x=()=>{const e=n(),s=l();return d(e.asmrLibrary.setStatus.mutationOptions({onSuccess:()=>{a.success("Status updated"),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())},onError:r=>{a.error(`Failed to update status: ${r.message}`)}}))},z=()=>{const e=n(),s=l();return d(e.asmrProgress.save.mutationOptions({onSuccess:(r,t)=>{s.invalidateQueries({queryKey:["asmr-progress",t.workId]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())}}))},j=()=>{const e=n(),s=l();return d(e.asmrProgress.remove.mutationOptions({onSuccess:()=>{a.success("Progress reset"),s.invalidateQueries({queryKey:["asmr-progress"]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())},onError:r=>{a.error(`Failed to reset progress: ${r.message}`)}}))},Y=()=>{const e=n(),s=l();return d(e.asmrLibrary.batchStatus.mutationOptions({onSuccess:r=>{a.success(`Status updated for ${r.updated??0} items`),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())},onError:r=>{a.error(`Failed to update statuses: ${r.message}`)}}))},J=()=>{const e=n(),s=l();return d(e.asmrLibrary.removeMany.mutationOptions({onSuccess:r=>{const t=r.removed??0;a.success(`Removed ${t} ${t===1?"item":"items"} from listening list`),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())},onError:r=>{a.error(`Failed to remove: ${r.message}`)}}))},V=()=>{const e=n(),s=l();return d(e.asmrProgress.removeMany.mutationOptions({onSuccess:r=>{const t=r.removed??0;a.success(`Reset progress for ${t} ${t===1?"item":"items"}`),s.invalidateQueries({queryKey:["asmr-progress"]}),s.invalidateQueries({queryKey:["asmr-continue-listening"]}),s.invalidateQueries({queryKey:["asmr-library"]}),s.invalidateQueries(e.asmrLibrary.pathFilter()),s.invalidateQueries(e.asmrProgress.pathFilter())},onError:r=>{a.error(`Failed to reset progress: ${r.message}`)}}))},X=()=>{const e=T(),s=_(),{data:r}=O(),t=k(()=>new Set(r?.ids||[]),[r]);return{toggle:i=>{const o=E(i.rjCode);t.has(o)?s.mutate({id:o}):e.mutate({...i,thumbnail:i.thumbnail||""})},bookmarkedIds:t,pending:e.isPending||s.isPending}},h=300*1e3,A=15,Z=(e,s,r,t)=>{const m=s+1,i=F({queries:Array.from({length:m},(u,w)=>{const L=w+1;return{queryKey:["asmrBrowse",e,L,r,t],queryFn:()=>{const K=e.trim();return v.asmr.browse.query({q:K||void 0,page:L,sort:r&&r!=="latest"?r:void 0,rating:t||void 0})},staleTime:h}})}),o=i.flatMap(u=>u.data?.shows??[]),q=o.slice((s-1)*A,s*A),p=i[i.length-1]?.data,b=!!(p&&(p.hasNext||o.length>s*A)),f=i.some(u=>u.isLoading),c=i.some(u=>u.isFetching),Q=i.some(u=>u.isError);return{data:{shows:q,hasNext:b},isLoading:f,isError:Q,isFetching:c}},ee=e=>y({queryKey:["asmrWork",e],queryFn:()=>v.asmr.work.query({rj:e}),enabled:!!e,staleTime:h,refetchOnMount:"always"}),C=15,g=6;function B(e){if(e.isAdult||!e.thumbnail)return!1;const s=(e.rating||"").toLowerCase();return s===""||s==="sfw"}function S(e,s){const r=new Set,t=[];for(const m of e)for(const i of m){if(t.length>=s)return t;const o=i.id||i._id;!o||r.has(o)||(r.add(o),B(i)&&t.push(i))}return t}const se=(e=!0)=>{const s=F({queries:Array.from({length:C},(c,Q)=>{const u=Q+1;return{queryKey:["asmrBrowse","",u,"popular_month",""],queryFn:()=>v.asmr.browse.query({page:u,sort:"popular_month"}),staleTime:h,enabled:e,retry:1}})}),r=s.map(c=>c.data?.shows??[]),t=S(r,g),m=s.every(c=>c.isFetched),i=e&&m&&t.length<g,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??[],p=t.length>=g?t.slice(0,g):S([t,q],g),b=e&&(s.some(c=>c.isLoading)||i&&o.isLoading),f=e&&m&&p.length===0&&s.some(c=>c.isError);return{data:p,isLoading:b,isError:f}};export{D as A,M as a,se as b,ee as c,H as d,X as e,W as f,P as g,z as h,T as i,Z as j,E as k,N as l,G as m,_ as n,x as o,Y as p,J as q,V as r,j as s,U as u};