@serifpersia/dango 3.5.0 → 3.5.2

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 (97) hide show
  1. package/README.md +1 -15
  2. package/client/dist/assets/{AnimeCard-CpMObnqU.js → AnimeCard-BVnAhrys.js} +1 -1
  3. package/client/dist/assets/{AnimeInfo-DkDW8o1k.js → AnimeInfo-DYBLIXmE.js} +1 -1
  4. package/client/dist/assets/AnimeInfoPage-DnXV4EMC.js +2 -0
  5. package/client/dist/assets/{Asmr-B08Aimrk.js → Asmr-Dwlv-Af8.js} +2 -2
  6. package/client/dist/assets/{AsmrResetProgressModal-CZMbyJZz.js → AsmrResetProgressModal-CnF9ZTJQ.js} +1 -1
  7. package/client/dist/assets/{AvSyncCalibrator-VoOEtoX9.js → AvSyncCalibrator-Cr9n1euF.js} +1 -1
  8. package/client/dist/assets/Home-B_q2l74h.css +1 -0
  9. package/client/dist/assets/{Home-C3Vck_99.js → Home-CUZPz_wy.js} +1 -1
  10. package/client/dist/assets/Insights-hvaO1jbY.js +1 -0
  11. package/client/dist/assets/{LibraryListPage-CUzEUs5k.js → LibraryListPage-BeYz_I1y.js} +1 -1
  12. package/client/dist/assets/{ListeningList-CoeQ17lz.js → ListeningList-D-D-W7JK.js} +1 -1
  13. package/client/dist/assets/Manga-DqIR2B6F.js +1 -0
  14. package/client/dist/assets/{MangaInfoPage-wqYZN_sT.js → MangaInfoPage-CWqxWbb3.js} +1 -1
  15. package/client/dist/assets/{MangaReadPage-BbyExwBN.js → MangaReadPage-BlyJ-OdY.js} +1 -1
  16. package/client/dist/assets/{MangaResetProgressModal-Dg0xhJQI.js → MangaResetProgressModal-gvz9_X7z.js} +1 -1
  17. package/client/dist/assets/{Mature-ZKR5vMIv.js → Mature-B1Cuj67a.js} +1 -1
  18. package/client/dist/assets/MediaCard-GwFTnacn.js +1 -0
  19. package/client/dist/assets/Music-BEmRDuSo.js +1 -0
  20. package/client/dist/assets/{OptionListMenu-DcHg1QsF.js → OptionListMenu-Dlk9eHM7.js} +1 -1
  21. package/client/dist/assets/{Player-V9IueAzT.js → Player-khTFa_o1.js} +6 -6
  22. package/client/dist/assets/{PlayerSettings-BZtjBWWq.js → PlayerSettings-B16FnAO_.js} +1 -1
  23. package/client/dist/assets/QueueOptionsButton-DjBOibpt.js +1 -0
  24. package/client/dist/assets/{QueueRail-CO2ocUNx.js → QueueRail-DcLtEU46.js} +1 -1
  25. package/client/dist/assets/{Radio-CJ-ra4vb.js → Radio-rpaFuI72.js} +1 -1
  26. package/client/dist/assets/{ReadingList-CSvUUtZ3.js → ReadingList-DTnI5411.js} +1 -1
  27. package/client/dist/assets/{ResetProgressModal-5FOWMuqi.js → ResetProgressModal-Bcv92v7c.js} +1 -1
  28. package/client/dist/assets/{Search-q0GUdNMS.js → Search-DNxPl_On.js} +1 -1
  29. package/client/dist/assets/Settings-CQ-ykTG3.js +21 -0
  30. package/client/dist/assets/{Settings-AuFxQcJF.css → Settings-CwIWLSfY.css} +1 -1
  31. package/client/dist/assets/{SkeletonGrid-DY_7CXpX.js → SkeletonGrid-ZN-kS9re.js} +1 -1
  32. package/client/dist/assets/ToggleSwitch-BPil0d_k.css +1 -0
  33. package/client/dist/assets/ToggleSwitch-CN_ppEc9.js +1 -0
  34. package/client/dist/assets/{Trackers-Dn7P6AfI.js → Trackers-EN1_ol5G.js} +1 -1
  35. package/client/dist/assets/{Tv-BfaWoR72.js → Tv-C-4wd-BS.js} +4 -4
  36. package/client/dist/assets/{TvInfo-CgEVN57T.js → TvInfo-Mpzun3PF.js} +1 -1
  37. package/client/dist/assets/{TvPopup-B-vYyDQF.js → TvPopup-YYgg9-7r.js} +1 -1
  38. package/client/dist/assets/{TvSearch-CnnVkms6.js → TvSearch-CdL9EA-S.js} +1 -1
  39. package/client/dist/assets/{TvWatchlist-BLVF_row.js → TvWatchlist-DD6nRESU.js} +1 -1
  40. package/client/dist/assets/{Watchlist-wd9cCDOK.js → Watchlist-CD8UqukO.js} +1 -1
  41. package/client/dist/assets/{hls-Bej65gvf.js → hls-E94cMCjR.js} +1 -1
  42. package/client/dist/assets/index-CZW1But9.js +178 -0
  43. package/client/dist/assets/index-w_r2lTCe.css +1 -0
  44. package/client/dist/assets/{useAnimeInfoData-ZmMruFBq.js → useAnimeInfoData-C9tOyy6E.js} +1 -1
  45. package/client/dist/assets/{useAsmr-z-txLq1s.js → useAsmr-B4HAapZD.js} +1 -1
  46. package/client/dist/assets/{useAsmrPopup-DU55UhPN.js → useAsmrPopup-trIV7nUr.js} +1 -1
  47. package/client/dist/assets/{useMangaLibrary-D92WQbf5.js → useMangaLibrary-CZ2Gke8p.js} +1 -1
  48. package/client/dist/assets/{useMangaPopup-TJOA229J.js → useMangaPopup-80Daa4y-.js} +1 -1
  49. package/client/dist/assets/{useProviders-fmZrOyDC.js → useProviders-CqMq_6ue.js} +1 -1
  50. package/client/dist/assets/{useTv-CmfxzpS-.js → useTv-CHDhiKWu.js} +1 -1
  51. package/client/dist/assets/{useTvLibrary-0y9NZnsk.js → useTvLibrary-DWUGDtld.js} +1 -1
  52. package/client/dist/index.html +2 -2
  53. package/package.json +2 -2
  54. package/server/dist/app-hono.js +2 -10
  55. package/server/dist/config.js +0 -1
  56. package/server/dist/db/schema-anime.js +0 -4
  57. package/server/dist/db/schema-asmr.js +0 -12
  58. package/server/dist/db/schema-tv.js +0 -15
  59. package/server/dist/discord-gateway.js +0 -6
  60. package/server/dist/discord-rpc.js +0 -14
  61. package/server/dist/github-sync.js +1 -5
  62. package/server/dist/hono/proxy.js +19 -2
  63. package/server/dist/hono/tv.js +1 -1
  64. package/server/dist/hono/watchlist.js +8 -13
  65. package/server/dist/lib/anilist.js +2 -26
  66. package/server/dist/lib/anischedule.js +0 -3
  67. package/server/dist/lib/mal.js +0 -9
  68. package/server/dist/lib/{discord-roles-sync.service.js → recommendations.service.js} +0 -149
  69. package/server/dist/lib/tracker/anilist-tracker.js +0 -3
  70. package/server/dist/lib/tracker/sync.service.js +0 -1
  71. package/server/dist/providers/manga/manga.types.js +1 -7
  72. package/server/dist/repositories/mal-cache.repository.js +0 -3
  73. package/server/dist/server.js +0 -2
  74. package/server/dist/shipped-defaults.js +0 -1
  75. package/server/dist/sync.js +0 -1
  76. package/server/dist/trpc/errors.js +0 -6
  77. package/server/dist/trpc/index.js +0 -1
  78. package/server/dist/trpc/routers/discord.js +0 -4
  79. package/server/dist/trpc/routers/discovery.js +1 -5
  80. package/server/dist/trpc/routers/insights.js +1 -31
  81. package/server/dist/trpc/routers/settings.js +0 -10
  82. package/server/dist/trpc/routers/watchlist.js +3 -3
  83. package/server/package.json +1 -1
  84. package/client/dist/assets/AnimeInfoPage-l0wIHS7j.js +0 -2
  85. package/client/dist/assets/Home-B6bte0tw.css +0 -1
  86. package/client/dist/assets/Insights-nW34Wbg1.js +0 -1
  87. package/client/dist/assets/Manga-CeSb5K2w.js +0 -1
  88. package/client/dist/assets/Map-BtXwpBOC.js +0 -1
  89. package/client/dist/assets/Map-CXFqXmsZ.css +0 -1
  90. package/client/dist/assets/MediaCard-9NGAjN3E.js +0 -1
  91. package/client/dist/assets/Music-CljVJFCj.js +0 -1
  92. package/client/dist/assets/QueueOptionsButton-CzzisJ3N.js +0 -1
  93. package/client/dist/assets/Settings-CyT9Lyhz.js +0 -21
  94. package/client/dist/assets/index-Cc1Up_NI.css +0 -1
  95. package/client/dist/assets/index-Dk0ASzEz.js +0 -178
  96. package/server/dist/sync-config.js +0 -23
  97. package/server/dist/utils/machine-id.js +0 -39
@@ -1,178 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-C3Vck_99.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-query-BBT5_sHx.js","assets/SkeletonGrid-DY_7CXpX.js","assets/vendor-icons-DrybRNxP.js","assets/SkeletonGrid-Bge3aRl2.css","assets/AnimeCard-CpMObnqU.js","assets/useAnimeInfoData-ZmMruFBq.js","assets/QueueOptionsButton-CzzisJ3N.js","assets/vendor-ui-3qrARCPr.js","assets/QueueOptionsButton-CM15uQn8.css","assets/MediaCard-9NGAjN3E.js","assets/useIsMobile-Dvx1uJ82.js","assets/MediaCard-DB6Yjgky.css","assets/ErrorMessage-DAxegITP.js","assets/ErrorMessage-CXoRbrLN.css","assets/ResetProgressModal-5FOWMuqi.js","assets/QueueRail-CO2ocUNx.js","assets/QueueRail-BUYEjdaq.css","assets/useMangaPopup-TJOA229J.js","assets/useMangaLibrary-D92WQbf5.js","assets/usePopup-DS9jMzp6.js","assets/MangaResetProgressModal-Dg0xhJQI.js","assets/useProviders-fmZrOyDC.js","assets/useTv-CmfxzpS-.js","assets/TvPopup-B-vYyDQF.js","assets/useTvLibrary-0y9NZnsk.js","assets/AsmrResetProgressModal-CZMbyJZz.js","assets/useAsmr-z-txLq1s.js","assets/Home-B6bte0tw.css","assets/Watchlist-wd9cCDOK.js","assets/Watchlist.module-XGtVQr1d.js","assets/Watchlist-BiDEU0iV.css","assets/Settings-CyT9Lyhz.js","assets/Settings-AuFxQcJF.css","assets/Player-V9IueAzT.js","assets/AvSyncCalibrator-VoOEtoX9.js","assets/AvSyncCalibrator-gEONBv5a.css","assets/hls-Bej65gvf.js","assets/AnimeMetaDetails-BogOi_bM.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-B3Sa5pRv.js","assets/SynopsisText-CYv2W3yR.css","assets/Player-B036Ic3m.css","assets/Search-q0GUdNMS.js","assets/Search.module-CMEai-B-.js","assets/Search-Cs45oAwI.css","assets/Mature-ZKR5vMIv.js","assets/Mature-DJmUUtlF.css","assets/Asmr-B08Aimrk.js","assets/Asmr.module-CdWlioTY.js","assets/Asmr-D1KuQwQy.css","assets/useAsmrPopup-DU55UhPN.js","assets/page.module-C1MlZzf3.js","assets/page-DRvjODkg.css","assets/Manga-CeSb5K2w.js","assets/Manga.module-depGEacJ.js","assets/Manga-CqAceKxR.css","assets/MangaInfoPage-wqYZN_sT.js","assets/MangaReadPage-BbyExwBN.js","assets/ReadingList-CSvUUtZ3.js","assets/LibraryListPage-CUzEUs5k.js","assets/Radio-CJ-ra4vb.js","assets/Radio.module-DGSZLpKM.js","assets/Radio-CCHNFN7R.css","assets/Music-CljVJFCj.js","assets/Music-BGH_0voi.css","assets/TvSearch-CnnVkms6.js","assets/TvInfo-CgEVN57T.js","assets/TvInfo-Bu36xJyO.css","assets/Tv-BfaWoR72.js","assets/OptionListMenu-DcHg1QsF.js","assets/Tv-Bx7tGS57.css","assets/TvWatchlist-BLVF_row.js","assets/ListeningList-CoeQ17lz.js","assets/Trackers-Dn7P6AfI.js","assets/Trackers-D5XBOCDp.css","assets/Insights-nW34Wbg1.js","assets/Insights-Dc8xLmsr.css","assets/Map-BtXwpBOC.js","assets/Map-CXFqXmsZ.css","assets/AnimeInfoPage-l0wIHS7j.js","assets/PlayerRedirect-fv2tzEUu.js","assets/VirtualKeyboard-BmqZPZXR.js","assets/VirtualKeyboard-KIPc5ZGH.css"])))=>i.map(i=>d[i]);
2
- import{N as Sn,k as M,A as B,q as F,h as b,S as G,d as _,X as oe,x as ie,T as he,g as Je,u as o,L as J,$ as Rt,a as qt,c as Ye,e as kn,f as Pn,D as En,i as Tn,P as at,j as In,l as w,m as ct,z as I,n as xn,B as On}from"./vendor-core-DfaOB3Rn.js";import{s as de,i as Nn,q as Cn,u as z,a as Y,b as Q,c as Ze,Q as An,d as Ln}from"./vendor-query-BBT5_sHx.js";import{I as v}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 Rn="modulepreload",qn=function(e){return"/"+e},lt={},x=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=qn(u),u in lt)return;lt[u]=!0;const d=u.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${m}`))return;const p=document.createElement("link");if(p.rel=d?"stylesheet":Rn,d||(p.as="script"),p.crossOrigin="",p.href=u,c&&p.setAttribute("nonce",c),document.head.appendChild(p),d)return new Promise((h,f)=>{p.addEventListener("load",h),p.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};let $n={data:""},Dn=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||$n},jn=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Mn=/\/\*[^]*?\*\/| +/g,ut=/\n+/g,ce=(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"?ce(a,s):s+"{"+ce(a,s[1]=="k"?"":t)+"}":typeof a=="object"?r+=ce(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+=ce.p?ce.p(s,a):s+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},ae={},$t=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+$t(e[n]);return t}return e},Bn=(e,t,n,r,i)=>{let s=$t(e),a=ae[s]||(ae[s]=(l=>{let u=0,d=11;for(;u<l.length;)d=101*d+l.charCodeAt(u++)>>>0;return"go"+d})(s));if(!ae[a]){let l=s!==e?e:(u=>{let d,m,p=[{}];for(;d=jn.exec(u.replace(Mn,""));)d[4]?p.shift():d[3]?(m=d[3].replace(ut," ").trim(),p.unshift(p[0][m]=p[0][m]||{})):p[0][d[1]]=d[2].replace(ut," ").trim();return p[0]})(e);ae[a]=ce(i?{["@keyframes "+a]:l}:l,n?"":"."+a)}let c=n&&ae.g;return n&&(ae.g=ae[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)})(ae[a],t,r,c),a},Fn=(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?"":ce(c,""):c===!1?"":c}return r+i+(a??"")},"");function Re(e){let t=this||{},n=e.call?e(t.p):e;return Bn(n.unshift?n.raw?Fn(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,Dn(t.target),t.g,t.o,t.k)}let Dt,We,Ue;Re.bind({g:1});let se=Re.bind({k:1});function Wn(e,t,n,r){ce.p=t,Dt=e,We=n,Ue=r}function ue(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:We&&We()},c),n.o=/go\d/.test(l),c.className=Re.apply(n,r)+(l?" "+l:"");let u=e;return e[0]&&(u=c.as||e,delete c.as),Ue&&u[0]&&Ue(c),Dt(u,c)}return i}}var Un=e=>typeof e=="function",Ce=(e,t)=>Un(e)?e(t):e,Kn=(()=>{let e=0;return()=>(++e).toString()})(),jt=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),zn=20,Xe="default",Mt=(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 Mt(e,{type:e.toasts.find(a=>a.id===r.id)?1:0,toast:r});case 3:let{toastId:i}=t;return{...e,toasts:e.toasts.map(a=>a.id===i||i===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+s}))}}},xe=[],Bt={toasts:[],pausedAt:void 0,settings:{toastLimit:zn}},te={},Ft=(e,t=Xe)=>{te[t]=Mt(te[t]||Bt,e),xe.forEach(([n,r])=>{n===t&&r(te[t])})},Wt=e=>Object.keys(te).forEach(t=>Ft(e,t)),Qn=e=>Object.keys(te).find(t=>te[t].toasts.some(n=>n.id===e)),qe=(e=Xe)=>t=>{Ft(t,e)},Hn={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Vn=(e={},t=Xe)=>{let[n,r]=_(te[t]||Bt),i=B(te[t]);b(()=>(i.current!==te[t]&&r(te[t]),xe.push([t,r]),()=>{let a=xe.findIndex(([c])=>c===t);a>-1&&xe.splice(a,1)}),[t]);let s=n.toasts.map(a=>{var c,l,u;return{...e,...e[a.type],...a,removeDelay:a.removeDelay||((c=e[a.type])==null?void 0:c.removeDelay)||e?.removeDelay,duration:a.duration||((l=e[a.type])==null?void 0:l.duration)||e?.duration||Hn[a.type],style:{...e.style,...(u=e[a.type])==null?void 0:u.style,...a.style}}});return{...n,toasts:s}},Gn=(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||Kn()}),ke=e=>(t,n)=>{let r=Gn(t,e,n);return qe(r.toasterId||Qn(r.id))({type:2,toast:r}),r.id},q=(e,t)=>ke("blank")(e,t);q.error=ke("error");q.success=ke("success");q.loading=ke("loading");q.custom=ke("custom");q.dismiss=(e,t)=>{let n={type:3,toastId:e};t?qe(t)(n):Wt(n)};q.dismissAll=e=>q.dismiss(void 0,e);q.remove=(e,t)=>{let n={type:4,toastId:e};t?qe(t)(n):Wt(n)};q.removeAll=e=>q.remove(void 0,e);q.promise=(e,t,n)=>{let r=q.loading(t.loading,{...n,...n?.loading});return typeof e=="function"&&(e=e()),e.then(i=>{let s=t.success?Ce(t.success,i):void 0;return s?q.success(s,{id:r,...n,...n?.success}):q.dismiss(r),i}).catch(i=>{let s=t.error?Ce(t.error,i):void 0;s?q.error(s,{id:r,...n,...n?.error}):q.dismiss(r)}),e};var Jn=1e3,Yn=(e,t="default")=>{let{toasts:n,pausedAt:r}=Vn(e,t),i=B(new Map).current,s=F((m,p=Jn)=>{if(i.has(m))return;let h=setTimeout(()=>{i.delete(m),a({type:4,toastId:m})},p);i.set(m,h)},[]);b(()=>{if(r)return;let m=Date.now(),p=n.map(h=>{if(h.duration===1/0)return;let f=(h.duration||0)+h.pauseDuration-(m-h.createdAt);if(f<0){h.visible&&q.dismiss(h.id);return}return setTimeout(()=>q.dismiss(h.id,t),f)});return()=>{p.forEach(h=>h&&clearTimeout(h))}},[n,r,t]);let a=F(qe(t),[t]),c=F(()=>{a({type:5,time:Date.now()})},[a]),l=F((m,p)=>{a({type:1,toast:{id:m,height:p}})},[a]),u=F(()=>{r&&a({type:6,time:Date.now()})},[r,a]),d=F((m,p)=>{let{reverseOrder:h=!1,gutter:f=8,defaultPosition:O}=p||{},D=n.filter(A=>(A.position||O)===(m.position||O)&&A.height),j=D.findIndex(A=>A.id===m.id),H=D.filter((A,R)=>R<j&&A.visible).length;return D.filter(A=>A.visible).slice(...h?[H+1]:[0,H]).reduce((A,R)=>A+(R.height||0)+f,0)},[n]);return b(()=>{n.forEach(m=>{if(m.dismissed)s(m.id,m.removeDelay);else{let p=i.get(m.id);p&&(clearTimeout(p),i.delete(m.id))}})},[n,s]),{toasts:n,handlers:{updateHeight:l,startPause:c,endPause:u,calculateOffset:d}}},Zn=se`
3
- from {
4
- transform: scale(0) rotate(45deg);
5
- opacity: 0;
6
- }
7
- to {
8
- transform: scale(1) rotate(45deg);
9
- opacity: 1;
10
- }`,Xn=se`
11
- from {
12
- transform: scale(0);
13
- opacity: 0;
14
- }
15
- to {
16
- transform: scale(1);
17
- opacity: 1;
18
- }`,er=se`
19
- from {
20
- transform: scale(0) rotate(90deg);
21
- opacity: 0;
22
- }
23
- to {
24
- transform: scale(1) rotate(90deg);
25
- opacity: 1;
26
- }`,tr=ue("div")`
27
- width: 20px;
28
- opacity: 0;
29
- height: 20px;
30
- border-radius: 10px;
31
- background: ${e=>e.primary||"#ff4b4b"};
32
- position: relative;
33
- transform: rotate(45deg);
34
-
35
- animation: ${Zn} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
36
- forwards;
37
- animation-delay: 100ms;
38
-
39
- &:after,
40
- &:before {
41
- content: '';
42
- animation: ${Xn} 0.15s ease-out forwards;
43
- animation-delay: 150ms;
44
- position: absolute;
45
- border-radius: 3px;
46
- opacity: 0;
47
- background: ${e=>e.secondary||"#fff"};
48
- bottom: 9px;
49
- left: 4px;
50
- height: 2px;
51
- width: 12px;
52
- }
53
-
54
- &:before {
55
- animation: ${er} 0.15s ease-out forwards;
56
- animation-delay: 180ms;
57
- transform: rotate(90deg);
58
- }
59
- `,nr=se`
60
- from {
61
- transform: rotate(0deg);
62
- }
63
- to {
64
- transform: rotate(360deg);
65
- }
66
- `,rr=ue("div")`
67
- width: 12px;
68
- height: 12px;
69
- box-sizing: border-box;
70
- border: 2px solid;
71
- border-radius: 100%;
72
- border-color: ${e=>e.secondary||"#e0e0e0"};
73
- border-right-color: ${e=>e.primary||"#616161"};
74
- animation: ${nr} 1s linear infinite;
75
- `,or=se`
76
- from {
77
- transform: scale(0) rotate(45deg);
78
- opacity: 0;
79
- }
80
- to {
81
- transform: scale(1) rotate(45deg);
82
- opacity: 1;
83
- }`,ir=se`
84
- 0% {
85
- height: 0;
86
- width: 0;
87
- opacity: 0;
88
- }
89
- 40% {
90
- height: 0;
91
- width: 6px;
92
- opacity: 1;
93
- }
94
- 100% {
95
- opacity: 1;
96
- height: 10px;
97
- }`,sr=ue("div")`
98
- width: 20px;
99
- opacity: 0;
100
- height: 20px;
101
- border-radius: 10px;
102
- background: ${e=>e.primary||"#61d345"};
103
- position: relative;
104
- transform: rotate(45deg);
105
-
106
- animation: ${or} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
107
- forwards;
108
- animation-delay: 100ms;
109
- &:after {
110
- content: '';
111
- box-sizing: border-box;
112
- animation: ${ir} 0.2s ease-out forwards;
113
- opacity: 0;
114
- animation-delay: 200ms;
115
- position: absolute;
116
- border-right: 2px solid;
117
- border-bottom: 2px solid;
118
- border-color: ${e=>e.secondary||"#fff"};
119
- bottom: 6px;
120
- left: 6px;
121
- height: 10px;
122
- width: 6px;
123
- }
124
- `,ar=ue("div")`
125
- position: absolute;
126
- `,cr=ue("div")`
127
- position: relative;
128
- display: flex;
129
- justify-content: center;
130
- align-items: center;
131
- min-width: 20px;
132
- min-height: 20px;
133
- `,lr=se`
134
- from {
135
- transform: scale(0.6);
136
- opacity: 0.4;
137
- }
138
- to {
139
- transform: scale(1);
140
- opacity: 1;
141
- }`,ur=ue("div")`
142
- position: relative;
143
- transform: scale(0.6);
144
- opacity: 0.4;
145
- min-width: 20px;
146
- animation: ${lr} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
147
- forwards;
148
- `,dr=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?M(ur,null,t):t:n==="blank"?null:M(cr,null,M(rr,{...r}),n!=="loading"&&M(ar,null,n==="error"?M(tr,{...r}):M(sr,{...r})))},mr=e=>`
149
- 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
150
- 100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
151
- `,pr=e=>`
152
- 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
153
- 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
154
- `,hr="0%{opacity:0;} 100%{opacity:1;}",fr="0%{opacity:1;} 100%{opacity:0;}",yr=ue("div")`
155
- display: flex;
156
- align-items: center;
157
- background: #fff;
158
- color: #363636;
159
- line-height: 1.3;
160
- will-change: transform;
161
- box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
162
- max-width: 350px;
163
- pointer-events: auto;
164
- padding: 8px 10px;
165
- border-radius: 8px;
166
- `,vr=ue("div")`
167
- display: flex;
168
- justify-content: center;
169
- margin: 4px 10px;
170
- color: inherit;
171
- flex: 1 1 auto;
172
- white-space: pre-line;
173
- `,gr=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=jt()?[hr,fr]:[mr(n),pr(n)];return{animation:t?`${se(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${se(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},br=Sn(({toast:e,position:t,style:n,children:r})=>{let i=e.height?gr(e.position||t||"top-center",e.visible):{opacity:0},s=M(dr,{toast:e}),a=M(vr,{...e.ariaProps},Ce(e.message,e));return M(yr,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:a}):M(G,null,s,a))});Wn(M);var _r=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=F(a=>{if(a){let c=()=>{let l=a.getBoundingClientRect().height;r(e,l)};c(),new MutationObserver(c).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return M("div",{ref:s,className:t,style:n},i)},wr=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:jt()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},Sr=Re`
174
- z-index: 9999;
175
- > * {
176
- pointer-events: auto;
177
- }
178
- `,Ee=16,kr=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,toasterId:s,containerStyle:a,containerClassName:c})=>{let{toasts:l,handlers:u}=Yn(n,s);return M("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Ee,left:Ee,right:Ee,bottom:Ee,pointerEvents:"none",...a},className:c,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(d=>{let m=d.position||t,p=u.calculateOffset(d,{reverseOrder:e,gutter:r,defaultPosition:t}),h=wr(m,p);return M(_r,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?Sr:"",style:h},d.type==="custom"?Ce(d.message,d):i?i(d):M(br,{toast:d,position:m}))}))},g=q;function $e(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(Pr,t)}};return t}function Pr(e,t){return t(e)}function Er(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 Tr(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 $e(c=>(n++,i.push(c),s(),{unsubscribe(){n--,a();const l=i.findIndex(u=>u===c);l>-1&&i.splice(l,1)}}))}}function Ir(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=$e(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 xr(e){return $e(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 _e(e){"@babel/helpers - typeof";return _e=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},_e(e)}function Or(e,t){if(_e(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_e(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nr(e){var t=Or(e,"string");return _e(t)=="symbol"?t:t+""}function U(e,t,n){return(t=Nr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dt(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 $(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dt(Object(n),!0).forEach(function(r){U(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function le(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Cr(e){return typeof e=="function"}function Ar(){return Object.create(null)}const Lr=typeof Symbol=="function"&&!!Symbol.asyncIterator;function Rr(e){return Lr&&le(e)&&Symbol.asyncIterator in e}const qr=e=>e(),Ut=()=>{},mt=e=>{Object.freeze&&Object.freeze(e)};function Kt(e,t,n){var r;const i=t.join(".");return(r=n[i])!==null&&r!==void 0||(n[i]=new Proxy(Ut,{get(s,a){if(!(typeof a!="string"||a==="then"))return Kt(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)}),mt(u.args),mt(u.path),e(u)}})),n[i]}const zt=e=>Kt(e,[],Ar()),$r=e=>new Proxy(Ut,{get(t,n){if(n!=="then")return e(n)}});function we(e){"@babel/helpers - typeof";return we=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},we(e)}function Dr(e,t){if(we(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(we(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jr(e){var t=Dr(e,"string");return we(t)=="symbol"?t:t+""}function Ke(e,t,n){return(t=jr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pt(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 Te(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pt(Object(n),!0).forEach(function(r){Ke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Mr=class extends Error{constructor(e){super(Br(e)),Object.assign(this,e)}};function Br(e){if("message"in e)return String(e.message)}function Fr(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(le(e))return new Mr(e)}}var ht=class extends Error{constructor(e){var t,n,r;const i=Fr(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}),Ke(this,"cause",void 0),Ke(this,"code",void 0),this.code=e.code,this.name="TRPCError",(r=this.cause)!==null&&r!==void 0||(this.cause=i)}};function Wr(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:Te(Te({},e),{},{error:n})}}return{ok:!0,result:Te(Te({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var Me=class extends Error{constructor(){super("Unable to transform response from server")}};function Ur(e,t){let n;try{n=Wr(e,t)}catch{throw new Me}if(!n.ok&&(!le(n.error.error)||typeof n.error.error.code!="number"))throw new Me;if(n.ok&&!le(n.result))throw new Me;return n}function Kr(e){return typeof e=="function"}async function zr(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 Qr(e){const{type:t,path:n}=e,r=await zr(e.router,n);if(!r||!Kr(r)||r._def.type!==t&&!e.allowMethodOverride)throw new ht({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new ht({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return r(e)}function Hr(e){return e instanceof Ae}function Vr(e){return le(e)&&le(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Gr(e,t){return typeof e=="string"?e:le(e)&&typeof e.message=="string"?e.message:t}var Ae=class Oe extends Error{constructor(t,n){var r,i;const s=n?.cause;super(t,{cause:s}),U(this,"cause",void 0),U(this,"shape",void 0),U(this,"data",void 0),U(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,Oe.prototype)}static from(t,n={}){const r=t;return Hr(r)?(n.meta&&(r.meta=$($({},r.meta),n.meta)),r):Vr(r)?new Oe(r.error.message,$($({},n),{},{result:r,cause:n.cause})):new Oe(Gr(r,"Unknown error"),$($({},n),{},{cause:r}))}};function Jr(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 ft=e=>typeof e=="function";function Yr(e){if(e)return e;if(typeof window<"u"&&ft(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&ft(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function Zr(...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 Xr(...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 eo(e){return{url:e.url.toString(),fetch:e.fetch,transformer:Jr(e.transformer),methodOverride:e.methodOverride}}function to(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const no={query:"GET",mutation:"POST",subscription:"PATCH"};function Qt(e){return"input"in e?e.transformer.input.serialize(e.input):to(e.inputs.map(t=>e.transformer.input.serialize(t)))}const Ht=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=Qt(e);i!==void 0&&e.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(i))}`)}return r.length&&(n+="?"+r.join("&")),n},ro=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=Qt(e);return t!==void 0?JSON.stringify(t):void 0},oo=e=>co($($({},e),{},{contentTypeHeader:"application/json",getUrl:Ht,getBody:ro}));var io=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const so=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 io};async function ao(e){var t,n;so(e.signal);const r=e.getUrl(e),i=e.getBody(e),s=(t=e.methodOverride)!==null&&t!==void 0?t:no[e.type],a=await(async()=>{const l=await e.headers();return Symbol.iterator in l?Object.fromEntries(l):l})(),c=$($($({},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 Yr(e.fetch)(r,{method:s,signal:e.signal,body:i,headers:c})}async function co(e){const t={},n=await ao(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const yt=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function vt(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function i(c){const l=[[]];let u=0;for(;;){const p=c[u];if(!p)break;const h=l[l.length-1];if(p.aborted){var d;(d=p.reject)===null||d===void 0||d.call(p,new Error("Aborted")),u++;continue}if(e.validate(h.concat(p).map(f=>f.key))){h.push(p),u++;continue}if(h.length===0){var m;(m=p.reject)===null||m===void 0||m.call(p,new Error("Input is too big for a single dispatch")),u++;continue}l.push([])}return l}function s(){const c=i(t);r();for(const l of c){if(!l.length)continue;const u={items:l};for(const d of l)d.batch=u;e.fetch(u.items.map(d=>d.key)).then(async d=>{await Promise.all(d.map(async(p,h)=>{const f=u.items[h];try{var O;const j=await Promise.resolve(p);(O=f.resolve)===null||O===void 0||O.call(f,j)}catch(j){var D;(D=f.reject)===null||D===void 0||D.call(f,j)}f.batch=null,f.reject=null,f.resolve=null}));for(const p of u.items){var m;(m=p.reject)===null||m===void 0||m.call(p,new Error("Missing result")),p.batch=null}}).catch(d=>{for(const p of u.items){var m;(m=p.reject)===null||m===void 0||m.call(p,d),p.batch=null}})}}function a(c){var l;const u={aborted:!1,key:c,batch:null,resolve:yt,reject:yt},d=new Promise((m,p)=>{var h;u.reject=p,u.resolve=m,(h=t)!==null&&h!==void 0||(t=[]),t.push(u)});return(l=n)!==null&&l!==void 0||(n=setTimeout(s)),d}return{load:a}}function lo(e){var t,n;const r=eo(e),i=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,s=(n=e.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const a=l=>({validate(u){if(i===1/0&&s===1/0)return!0;if(u.length>s)return!1;const d=u.map(p=>p.path).join(","),m=u.map(p=>p.input);return Ht($($({},r),{},{type:l,path:d,inputs:m,signal:null})).length<=i},async fetch(u){const d=u.map(f=>f.path).join(","),m=u.map(f=>f.input),p=Zr(...u.map(f=>f.signal)),h=await oo($($({},r),{},{path:d,inputs:m,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:u}):e.headers:{}},signal:p}));return(Array.isArray(h.json)?h.json:u.map(()=>h.json)).map(f=>({meta:h.meta,json:f}))}}),c={query:vt(a("query")),mutation:vt(a("mutation"))};return({op:l})=>$e(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($($({},l),{},{signal:Xr(l.signal,d.signal)}));let p=!1,h;return m.then(f=>{p=!0,h=f;const O=Ur(f.json,r.transformer.output);if(!O.ok){u.error(Ae.from(O.error,{meta:f.meta}));return}u.next({context:f.meta,result:O.result}),u.complete()}).catch(f=>{p=!0,u.error(Ae.from(f,{meta:h?.meta}))}),()=>{p||d.abort()}})}}const Vt=(e,...t)=>typeof e=="function"?e(...t):e;function uo(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function mo(e){const t=await Vt(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function po(e,t){const n={method:"connectionParams",data:await Vt(e)};return t.encode(n)}function ho(e){const{promise:t,resolve:n,reject:r}=uo();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function fo(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 yo=class ze{constructor(t){var n;if(U(this,"id",++ze.connectCount),U(this,"WebSocketPonyfill",void 0),U(this,"urlOptions",void 0),U(this,"keepAliveOpts",void 0),U(this,"encoder",void 0),U(this,"wsObservable",Ir(null)),U(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=++ze.connectCount;const t=mo(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&&fo(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await ho(n),this.urlOptions.connectionParams&&n.send(await po(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()}}};U(yo,"connectCount",0);var Gt=class{constructor(e){U(this,"links",void 0),U(this,"runtime",void 0),U(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return xr({links:this.links,op:$($({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Tr())}async requestAsPromise(e){try{const t=this.$request(e);return(await Er(t)).result.data}catch(t){throw Ae.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 Jt=Symbol.for("trpc_untypedClient"),vo={query:"query",mutate:"mutation",subscribe:"subscription"},go=e=>vo[e];function bo(e){const t=zt(({path:n,args:r})=>{const i=[...n],s=go(i.pop()),a=i.join(".");return e[s](a,...r)});return $r(n=>n===Jt?e:t[n])}function _o(e){return bo(new Gt(e))}function wo(e){return e[Jt]}function Se(e){"@babel/helpers - typeof";return Se=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},Se(e)}function So(e,t){if(Se(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Se(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ko(e){var t=So(e,"string");return Se(t)=="symbol"?t:t+""}function Po(e,t,n){return(t=ko(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gt(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 k(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gt(Object(n),!0).forEach(function(r){Po(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eo(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 Ne(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Ne(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 Ne=function(r){this.s=r,this.n=r.next},Ne.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 Ne(e)}function To(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 Io(e,t){if(e==null)return{};var n,r,i=To(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 xo=["cursor","direction"];function De(e){return{path:e.path.join(".")}}function Oo(e){return e.length>=3}function No(e){return Oo(e)?{type:"prefixed",prefix:e[0],path:e[1],args:e[2]}:{type:"unprefixed",prefix:void 0,path:e[0],args:e[1]}}function et(e,t,n){var r;const i=No(e);let s=(r=i.args)===null||r===void 0?void 0:r.input;if(n){var a,c;s=k(k(k({},(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 Co(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=Eo(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 re(e){const t=qr(()=>{const{input:n,type:r}=e,i=e.path.flatMap(s=>s.split("."));if(!n&&r==="any")return i.length?[i]:[];if(r==="infinite"&&le(n)&&("direction"in n||"cursor"in n)){const{cursor:s,direction:a}=n;return[i,{input:Io(n,xo),type:"infinite"}]}return[i,k(k({},typeof n<"u"&&n!==de&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function Yt(e){const t=[e.path.flatMap(n=>n.split("."))];return e.prefix&&t.unshift([e.prefix]),t}function tt(e){return Cr(e)?e():e}function Ao(e){var t;const{input:n,query:r,path:i,queryKey:s,opts:a}=e,c=n===de,l=async u=>{var d;const m=k(k({},a),{},{trpc:k(k({},a?.trpc),!(a==null||(d=a.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})});return await r(...et(s,m,{direction:u.direction,pageParam:u.pageParam}))};return Object.assign(Nn(k(k({},a??{}),{},{queryKey:s,queryFn:c?de:l,initialPageParam:(t=a?.initialCursor)!==null&&t!==void 0?t:n?.cursor})),{trpc:De({path:i})})}function Lo(e){var t,n;const{mutate:r,path:i,prefix:s,opts:a,overrides:c}=e,l=tt(e.queryClient),u=Yt({path:i,prefix:(t=a?.keyPrefix)!==null&&t!==void 0?t:s}),d=l.defaultMutationOptions(l.getMutationDefaults(u)),m=(n=c?.onSuccess)!==null&&n!==void 0?n:(h=>h.originalFn()),p=async h=>await r(...et([...u,{input:h}],a));return k(k({},a),{},{mutationKey:u,mutationFn:p,onSuccess(...h){var f,O;return m({originalFn:()=>{var j,H,A;return(j=a==null||(H=a.onSuccess)===null||H===void 0?void 0:H.call(a,...h))!==null&&j!==void 0?j:d==null||(A=d.onSuccess)===null||A===void 0?void 0:A.call(d,...h)},queryClient:l,meta:(f=(O=a?.meta)!==null&&O!==void 0?O:d?.meta)!==null&&f!==void 0?f:{}})},trpc:De({path:i})})}function Ro(e){const{input:t,query:n,path:r,queryKey:i,opts:s}=e,a=tt(e.queryClient),c=t===de,l=async u=>{var d;const m=k(k({},s),{},{trpc:k(k({},s?.trpc),!(s==null||(d=s.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})}),p=u.queryKey,h=await n(...et(p,m));return Rr(h)?Co(h,a,p):h};return Object.assign(Cn(k(k({},s),{},{queryKey:i,queryFn:c?de:l})),{trpc:De({path:r})})}const qo=e=>{const{subscribe:t,path:n,queryKey:r,input:i,opts:s={}}=e,a="enabled"in s?!!s.enabled:i!==de,c=l=>t(n.join("."),i===de?void 0:i,l);return k(k({},s),{},{enabled:a,subscribe:c,queryKey:r,trpc:De({path:n})})};function $o(e){const t=e.keyPrefix,n=r=>(i,s,a)=>"router"in e?Promise.resolve(tt(e.ctx)).then(c=>Qr({router:e.router,path:i,getRawInput:async()=>s,ctx:c,type:r,signal:void 0,batchIndex:0})):(e.client instanceof Gt?e.client:wo(e.client))[r](i,s,a);return zt(({args:r,path:i})=>{const s=[...i],a=s.pop(),[c,l]=r;return{"~types":void 0,pathKey:()=>re({path:s,type:"any",prefix:t}),pathFilter:()=>k(k({},c),{},{queryKey:re({path:s,type:"any",prefix:t})}),queryOptions:()=>Ro({input:c,opts:l,path:s,queryClient:e.queryClient,queryKey:re({path:s,input:c,type:"query",prefix:t}),query:n("query")}),queryKey:()=>re({path:s,input:c,type:"query",prefix:t}),queryFilter:()=>k(k({},l),{},{queryKey:re({path:s,input:c,type:"query",prefix:t})}),infiniteQueryOptions:()=>Ao({input:c,opts:l,path:s,queryKey:re({path:s,input:c,type:"infinite",prefix:t}),query:n("query")}),infiniteQueryKey:()=>re({path:s,input:c,type:"infinite",prefix:t}),infiniteQueryFilter:()=>k(k({},l),{},{queryKey:re({path:s,input:c,type:"infinite",prefix:t})}),mutationOptions:()=>{var u;return Lo({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:()=>Yt({path:s,prefix:t}),subscriptionOptions:()=>qo({opts:l,path:s,input:c,queryKey:re({path:s,input:c,type:"any",prefix:t}),subscribe:n("subscription")})}[a]()})}function Do(){const e=oe(null),t=oe(null),n=s=>{const a=he(()=>$o({client:s.trpcClient,queryClient:s.queryClient,keyPrefix:s.keyPrefix}),[s.trpcClient,s.queryClient,s.keyPrefix]);return M(e.Provider,{value:s.trpcClient},M(t.Provider,{value:a},s.children))};n.displayName="TRPCProvider";function r(){const s=ie(t);if(!s)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return s}function i(){const s=ie(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 Qe={lan:new Set,animepahe:new Set,jasmr:new Set};function me(e){for(const t of[...Qe[e]])try{t()}catch(n){console.error(`auth-bus listener failed (${e}):`,n)}}function Zt(e,t){return Qe[e].add(t),()=>{Qe[e].delete(t)}}const jo=e=>new Promise(t=>setTimeout(t,e)),Xt=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 jo(Math.min(500*2**a,4e3)),s=await fetch(e,{...t,headers:{...n,...t?.headers}});return s},Mc=async(e,t)=>{const n=await Xt(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"&&me("animepahe"),n.status===403&&s==="AUTH_REQUIRED"&&i.provider==="jasmr"&&me("jasmr"),n.status===401&&s==="LAN_AUTH_REQUIRED"&&me("lan"),new Error(s||`Failed to fetch from ${e}`)}return n.json()};async function Mo(e,t){const n=await Xt(e,t);if(n.status===401)try{(await n.clone().json())?.error==="LAN_AUTH_REQUIRED"&&me("lan")}catch{}return await Bo(n),n}async function Bo(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")&&me(s.provider),(i.message==="LAN_AUTH_REQUIRED"||s?.code==="LAN_AUTH_REQUIRED")&&me("lan")}}catch{}}const{TRPCProvider:Fo,useTRPC:P}=Do(),K=_o({links:[lo({url:"/api/trpc",fetch:Mo})]}),be=new Map,Wo=500,Uo=(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(be.has(i))return be.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 be.size>Wo&&be.clear(),be.set(i,s),s},Bc=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 Fc(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 Wc(e){return e==null?e:e>10?Number((e/10).toFixed(1)):e}const Ko=(...e)=>e.filter(Boolean).join(" "),en=oe(void 0),zo=()=>{const e=ie(en);if(e===void 0)throw new Error("useTitlePreference must be used within a TitlePreferenceProvider");return e},Uc=()=>{const e=P();return Q({...e.data.spotlight.queryOptions(),staleTime:1e3*60*5,retry:1})},Kc=(e="TRENDING_DESC",t=10)=>Ze({queryKey:["trendingList",e,t],queryFn:({pageParam:n=1})=>K.data.popularList.query({sort:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),zc=(e="TV",t=12)=>Ze({queryKey:["latestReleases",e,t],queryFn:({pageParam:n=1})=>K.data.latestReleases.query({format:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),Qc=(e,t="TV",n=!0)=>{const r=P();return Q({...r.data.seasonal.queryOptions({page:e,format:t}),enabled:n,staleTime:1e3*60*5})},Qo=["query","sortBy","type","status","season","year","country","genres","excludeGenres","excludeTags","minScore","minEpisodes","adult"],Hc=(e,t,n=14)=>{const r=P(),i=new URLSearchParams(e),s={page:t,limit:n};for(const a of Qo){const c=i.get(a);c!==null&&(s[a]=c)}return Q({...r.data.search.queryOptions(s),enabled:e!=null})},Vc=()=>{const e=P();return Q(e.queue.list.queryOptions())},Ho=()=>{const e=P(),t=z();return Y(e.queue.add.mutationOptions({onSuccess:n=>{n.queued?g.success("Added to queue"):g.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]})},onError:n=>{g.error(`Failed to update queue: ${n.message}`)}}))},Gc=()=>{const e=P(),t=z();return Y(e.queue.remove.mutationOptions({onSuccess:()=>{g.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{g.error(`Failed to remove: ${n.message}`)}}))},Jc=(e,t=!0)=>Q({queryKey:["queue-remaining",e],queryFn:()=>K.watchlist.queueRemaining.query({showId:e}),enabled:!!e&&t,staleTime:1e3*60}),Yc=()=>{const e=P(),t=z();return Y(e.queue.addBatch.mutationOptions({onSuccess:(n,r)=>{const i=n.added??r.episodeNumbers.length;g.success(`${i} ${i===1?"episode":"episodes"} added to queue`),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]})},onError:n=>{g.error(`Failed to update queue: ${n.message}`)}}))},Zc=()=>{const e=P(),t=z();return Y(e.queue.removeMany.mutationOptions({onSuccess:()=>{g.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{g.error(`Failed to remove: ${n.message}`)}}))},Xc=()=>{const e=P(),t=z();return Y(e.queue.clear.mutationOptions({onSuccess:()=>{g.success("Queue cleared"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:["queue-remaining"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{g.error(`Failed to clear queue: ${n.message}`)}}))},el=()=>{const e=P(),t=z(),n=e.queue.list.queryOptions().queryKey;return Y(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())}}))},Vo=["status","showMature","query","type","season","year","genres","excludeGenres","sortBy","titlePreference"];function nt(e,t,n){const r=new URLSearchParams(e),i={page:t,limit:n};for(const s of Vo){const a=r.get(s);a!==null&&(i[s]=a)}return i}const tl=(e,t="",n,r=14)=>Q({queryKey:["watchlist",e,t,n,r],queryFn:async()=>{const i=new URLSearchParams(t);return i.set("status",e),await K.watchlist.list.query(nt(i.toString(),n,r))}}),nl=(e="")=>Ze({queryKey:["allContinueWatching",e],queryFn:async({pageParam:t=1})=>await K.watchlist.continueWatchingAll.query(nt(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)})}),rl=(e="",t,n=14)=>Q({queryKey:["allContinueWatching",e,t,n],queryFn:async()=>await K.watchlist.continueWatchingAll.query(nt(e,t,n))}),ol=()=>{const e=P(),t=z();return Y(e.watchlist.remove.mutationOptions({onSuccess:()=>{g.success("Removed from watchlist"),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:["watchlist"]})},onError:n=>{g.error(`Failed to remove: ${n.message}`)}}))},il=()=>{const e=P(),t=z();return Y(e.watchlist.batchStatus.mutationOptions({onSuccess:n=>{g.success(`Status updated for ${n.updated??0} items`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:["watchlist"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{g.error(`Failed to update statuses: ${n.message}`)}}))},sl=()=>{const e=P(),t=z();return Y(e.watchlist.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;g.success(`Removed ${r} ${r===1?"item":"items"} from watchlist`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:["watchlist"]}),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{g.error(`Failed to remove: ${n.message}`)}}))},al=()=>{const e=P(),t=z();return Y(e.continueWatching.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;g.success(`Removed ${r} ${r===1?"item":"items"} from continue watching`),t.invalidateQueries(e.continueWatching.pathFilter()),t.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{g.error(`Failed to remove: ${n.message}`)}}))},tn=(e=!0)=>{const t=P();return Q({...t.notifications.list.queryOptions(),enabled:e,refetchInterval:3e4})},nn=(e=!0)=>{const t=P();return Q({...t.data.systemNotifications.queryOptions(),enabled:e,refetchInterval:3e4})},rn=(e=!0)=>{const t=P();return Q({...t.discovery.status.queryOptions(),enabled:e,refetchInterval:n=>n.state.data?.running?2e3:!1})},Go=()=>{const e=P(),t=z(),n=e.discovery.status.queryOptions().queryKey;return Y(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})}}))},Jo=()=>{const e=P(),t=z();return Y(e.notifications.dismiss.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},Yo=()=>{const e=P(),t=z();return Y(e.notifications.clearAll.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},cl=()=>{const e=P();return Q({...e.continueWatching.thisWeek.queryOptions(),staleTime:1e3*60*5})},ll=()=>{const e=P();return Q({...e.data.genresAndTags.queryOptions(),staleTime:1e3*60*60})},ul=()=>Q({queryKey:["genreCards"],queryFn:()=>K.insights.genreCards.query()}),Zo="_container_z68uz_1",Xo="_bellBtn_z68uz_7",ei="_badge_z68uz_56",ti="_dropdown_z68uz_96",ni="_dropdownHeader_z68uz_127",ri="_clearAllBtn_z68uz_141",oi="_discoveryStatusRow_z68uz_156",ii="_statusDot_z68uz_167",si="_statusDotRunning_z68uz_174",ai="_statusDotOk_z68uz_179",ci="_statusDotInfo_z68uz_183",li="_statusDotError_z68uz_187",ui="_statusDotIdle_z68uz_191",di="_list_z68uz_205",mi="_item_z68uz_219",pi="_thumbnail_z68uz_234",hi="_itemInfo_z68uz_243",fi="_itemTitle_z68uz_248",yi="_itemMeta_z68uz_259",vi="_systemItemMeta_z68uz_269",gi="_removeItem_z68uz_286",bi="_queueItem_z68uz_316",_i="_emptyState_z68uz_320",y={container:Zo,bellBtn:Xo,badge:ei,dropdown:ti,dropdownHeader:ni,clearAllBtn:ri,discoveryStatusRow:oi,statusDot:ii,statusDotRunning:si,statusDotOk:ai,statusDotInfo:ci,statusDotError:li,statusDotIdle:ui,list:di,item:mi,thumbnail:pi,itemInfo:hi,itemTitle:fi,itemMeta:yi,systemItemMeta:vi,removeItem:gi,queueItem:bi,emptyState:_i},wi=({notification:e})=>{const t=Jo(),n=Ho(),[r,i]=Je.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}=zo(),u=l==="nativeName"?e.nativeName||e.name:l==="englishName"&&e.englishName||e.name;return o(J,{to:`/watch/${e.showId}/${e.episodeNumber}`,className:y.item,onClick:a,children:[o("img",{src:Uo(e.thumbnail,48,64),alt:e.name,className:y.thumbnail,loading:"lazy",decoding:"async"}),o("div",{className:y.itemInfo,children:[o("span",{className:y.itemTitle,children:u}),o("span",{className:y.itemMeta,children:["New Episode ",e.episodeNumber]})]}),o("button",{className:`${y.removeItem} ${y.queueItem}`,onClick:c,"aria-label":"Add notification to queue",children:r?o(v,{name:"check"}):o(v,{name:"plus"})}),o("button",{className:y.removeItem,onClick:s,"aria-label":"Remove notification",children:o(v,{name:"times"})})]})};function Be({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 Si=({count:e=3})=>o(G,{children:Array.from({length:e}).map((t,n)=>o("div",{className:y.item,style:{borderBottom:"1px solid var(--border-primary)",pointerEvents:"none"},children:[o("div",{className:y.thumbnail,style:{overflow:"hidden"},children:o(Be,{width:"100%",height:"100%",variant:"rectangular"})}),o("div",{className:y.itemInfo,children:[o(Be,{width:"80%",height:"1rem",variant:"text",style:{marginBottom:"4px"}}),o(Be,{width:"40%",height:"0.7rem",variant:"rectangular",style:{borderRadius:"var(--radius-sm)"}})]})]},n))}),ki=()=>{const{data:e=[],isLoading:t}=tn(),{data:n=[]}=nn(),{data:r}=rn(),i=Yo(),s=z(),[a,c]=_(null);b(()=>{s.invalidateQueries({queryKey:["notifications"]})},[s]);const l=()=>{i.mutate(void 0)},u=n.find(d=>d.id===a)??null;return o("div",{className:y.dropdown,children:[o("div",{className:y.dropdownHeader,children:[o("h4",{children:"Notifications"}),e.length>0&&o("button",{className:y.clearAllBtn,onClick:l,children:"Clear All"})]}),o("div",{className:y.discoveryStatusRow,children:r?.running?o(G,{children:[o("span",{className:`${y.statusDot} ${y.statusDotRunning}`,"aria-hidden":"true"}),o("span",{children:r.total>0?`Checking ${Math.min(r.done,r.total)}/${r.total} shows...`:"Checking for new episodes..."})]}):r?.state==="complete"?o(G,{children:[o("span",{className:`${y.statusDot} ${y.statusDotOk}`,"aria-hidden":"true"}),o("span",{children:["Discovery complete — checked ",r.total," ",r.total===1?"show":"shows"]})]}):r?.state==="empty"?o(G,{children:[o("span",{className:`${y.statusDot} ${y.statusDotInfo}`,"aria-hidden":"true"}),o("span",{children:"No shows set to Watching — nothing to check"})]}):r?.state==="error"?o(G,{children:[o("span",{className:`${y.statusDot} ${y.statusDotError}`,"aria-hidden":"true"}),o("span",{children:"Last check failed — will retry automatically"})]}):o(G,{children:[o("span",{className:`${y.statusDot} ${y.statusDotIdle}`,"aria-hidden":"true"}),o("span",{children:r?.lastRunAt?`Last checked ${Math.max(1,Math.round((Date.now()-r.lastRunAt)/1e3))}s ago`:"Auto-checks every few minutes"})]})}),o("div",{className:y.list,children:t&&n.length===0?o(Si,{count:4}):o(G,{children:[n.map(d=>o("div",{className:y.item,children:[o("div",{className:y.thumbnail,style:{background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:0,boxShadow:"none"},children:o(v,{name:"info-circle",size:32,color:"#6c9fff"})}),o("div",{className:y.itemInfo,children:[o("span",{className:y.itemTitle,children:d.title}),o("button",{type:"button",className:y.systemItemMeta,onClick:()=>c(d.id),title:"View full status",children:d.message.length>40?d.message.slice(0,40)+"…":d.message})]}),o("button",{className:y.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:o(v,{name:"plus"})}),o("button",{className:y.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:o(v,{name:"times"})})]},d.id)),n.length>0&&e.length>0&&o("div",{className:y.notificationDivider}),e.length>0?e.map(d=>o(wi,{notification:d},d.id)):!t&&n.length===0&&o("div",{className:y.emptyState,children:"No new notifications"})]})}),u&&Rt(o("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,padding:"1rem",backdropFilter:"blur(3px)"},onClick:()=>c(null),children:o("div",{style:{backgroundColor:"var(--bg-secondary)",padding:"1.5rem",borderRadius:"var(--radius-lg)",maxWidth:"420px",width:"100%",boxShadow:"var(--shadow-xl)",border:"1px solid var(--border-primary)"},onClick:d=>d.stopPropagation(),children:[o("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1rem"},children:[o(v,{name:"info-circle",color:"#6c9fff"}),o("span",{style:{color:"#fff",fontWeight:600,fontSize:"1rem"},children:u.title})]}),o("p",{style:{color:"var(--text-secondary)",marginBottom:"1.5rem",lineHeight:1.5},children:u.message}),o("div",{style:{display:"flex",justifyContent:"flex-end"},children:o("button",{type:"button",onClick:()=>c(null),style:{background:"var(--primary-color)",color:"#fff",border:"none",padding:"0.5rem 1rem",borderRadius:"var(--radius-md)",cursor:"pointer",fontWeight:600},children:"OK"})})]})}),document.body)]})},Pi=()=>{const[e,t]=_(!1),n=B(null),r=z(),i=P(),s=Go(),{data:a=[]}=tn(),{data:c=[]}=nn(),{data:l}=rn(),u=a.length+c.length,d=u>5?"5+":u,m=B(!1);b(()=>{const h=f=>{n.current&&!n.current.contains(f.target)&&t(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),b(()=>{const h=!!l?.running;m.current&&!h&&(r.invalidateQueries(i.notifications.pathFilter()),r.invalidateQueries(i.discovery.pathFilter())),m.current=h},[l?.running,r,i]);const p=()=>{const h=!e;t(h),h&&s.mutate()};return o("div",{className:y.container,ref:n,children:[o("button",{className:y.bellBtn,onClick:p,"aria-label":"Notifications",children:[o(v,{name:"bell"}),u>0&&o("span",{className:y.badge,children:d})]}),e&&o(ki,{})]})},on=oe(void 0),sn=()=>{const e=ie(on);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},dl=[{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"}],bt={iris:"/logo.png",mochi:"/logo-mochi.png",sakura:"/logo-sakura.png"},an=({className:e})=>{const{theme:t}=sn(),n=bt[t]||bt.iris;return o("img",{src:n,alt:"dango",className:e,decoding:"async",style:{height:"var(--logo-height, 75px)",width:"auto",display:"block",objectFit:"contain"}})},cn=oe(void 0),rt=()=>{const e=ie(cn);if(e===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return e},ln=oe(void 0),un=()=>{const e=ie(ln);if(e===void 0)throw new Error("useContentType must be used within a ContentTypeProvider");return e},He="virtual-keyboard:hide",_t="virtual-keyboard:enabled-change",dn="virtual_keyboard_enabled",Ei=!1;function wt(){const e=localStorage.getItem(dn);return e===null?Ei:e==="true"}const St=e=>e instanceof HTMLInputElement&&e.type==="text"&&!e.disabled&&!e.readOnly;function Ti(){window.dispatchEvent(new CustomEvent(He))}function Ii(){const[e,t]=_(!1),[n,r]=_(wt),i=B(null);return b(()=>{const s=d=>{n&&St(d.target)&&(i.current=d.target,t(!0))},a=d=>{d.target===i.current&&window.setTimeout(()=>{if(St(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!==dn)return;const m=d.newValue==="true";r(m),m||c()},u=()=>{const d=wt();r(d),d||c()};return document.addEventListener("focusin",s),document.addEventListener("focusout",a),window.addEventListener(He,c),window.addEventListener("storage",l),window.addEventListener(_t,u),()=>{document.removeEventListener("focusin",s),document.removeEventListener("focusout",a),window.removeEventListener(He,c),window.removeEventListener("storage",l),window.removeEventListener(_t,u)}},[n]),{activeInputRef:i,isVisible:n&&e,hide:()=>t(!1)}}const xi="_header_1elij_1",Oi="_hidden_1elij_21",Ni="_scrolled_1elij_25",Ci="_logo_1elij_31",Ai="_headerInner_1elij_44",Li="_leftSection_1elij_54",Ri="_desktopNav_1elij_60",qi="_navLink_1elij_67",$i="_navLinkActive_1elij_83",Di="_rightSection_1elij_102",ji="_searchWrapper_1elij_108",Mi="_searchInput_1elij_114",Bi="_searchButton_1elij_144",Fi="_searchIcon_1elij_168",Wi="_profileBtn_1elij_178",Ui="_profileImg_1elij_211",Ki="_hamburgerBtn_1elij_217",zi="_mobileSearchBar_1elij_245",Qi="_mobileSearchBarHidden_1elij_272",Hi="_mobileSearchInner_1elij_289",Vi="_mobileSearchIcon_1elij_305",Gi="_mobileSearchInput_1elij_312",S={header:xi,hidden:Oi,scrolled:Ni,logo:Ci,headerInner:Ai,leftSection:Li,desktopNav:Ri,navLink:qi,navLinkActive:$i,rightSection:Di,searchWrapper:ji,searchInput:Mi,searchButton:Bi,searchIcon:Fi,profileBtn:Wi,profileImg:Ui,hamburgerBtn:Ki,mobileSearchBar:zi,mobileSearchBarHidden:Qi,mobileSearchInner:Hi,mobileSearchIcon:Vi,mobileSearchInput:Gi},Ji=async()=>{let e;try{e=await K.auth.syncSettings.query()}catch{return null}const t=e.actualActiveProvider;if(t==="github")try{const n=await K.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 K.auth.user.query();if(n)return{name:n.name,picture:n.picture,email:n.email,provider:"google"}}catch{}return null},Yi=()=>{const{toggleSidebar:e}=rt(),{contentType:t}=un(),[n,r]=_(""),[i,s]=_(!0),[a,c]=_(!1),[l,u]=_(!0),[d,m]=_(!1),p=qt(),h=Ye(),f=B(null),O=B(!1),D=B(null),j=B(null),H=B(null),A=B(null),{data:R}=Q({queryKey:["sync-profile"],queryFn:Ji,staleTime:3e4});b(()=>{const N=window.visualViewport;if(!N)return;const V=()=>{A.current?.style.setProperty("--vv-top",`${N.offsetTop}px`)};return V(),N.addEventListener("scroll",V),N.addEventListener("resize",V),()=>{N.removeEventListener("scroll",V),N.removeEventListener("resize",V)}},[]),b(()=>{const N=()=>{f.current&&(window.clearTimeout(f.current),f.current=null)},V=()=>{O.current||(O.current=!0,D.current=requestAnimationFrame(()=>{O.current=!1,D.current=null;const ne=window.scrollY<=10;u(ge=>ge===ne?ge:ne),s(ge=>ge||!0),N(),ne||(f.current=window.setTimeout(()=>{s(!1)},2500))}))},st=ne=>{(ne.metaKey||ne.ctrlKey)&&ne.key==="k"?(ne.preventDefault(),E.current?.focus({preventScroll:!0})):ne.key==="Escape"&&document.activeElement===E.current&&E.current?.blur()};return window.addEventListener("scroll",V,{passive:!0}),window.addEventListener("keydown",st),()=>{window.removeEventListener("scroll",V),window.removeEventListener("keydown",st),N(),D.current!==null&&(cancelAnimationFrame(D.current),D.current=null),O.current=!1}},[a]);const E=Je.useRef(null),Z=()=>window.innerWidth<=1024,ye=()=>{Z()?(m(!0),setTimeout(()=>H.current?.focus({preventScroll:!0}),50)):document.activeElement===E.current&&n.trim()?je():E.current?.focus({preventScroll:!0})},X=N=>{j.current?.contains(N.relatedTarget)||m(!1)},Pe=t==="manga"?"Search manga...":t==="tv"?"Search TV & movies...":t==="asmr"?"Search ASMR...":"Search anime...",ve=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"},je=N=>{Ti();const V=n.trim();V&&p(t==="manga"?`/manga?q=${encodeURIComponent(V)}`:t==="tv"?`/tv-search?q=${encodeURIComponent(V)}`:t==="asmr"?`/asmr?q=${encodeURIComponent(V)}`:`/search?query=${encodeURIComponent(V)}`)};return o(G,{children:o("header",{ref:A,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(v,{name:"bars"})}),o(J,{to:"/",className:S.logo,"aria-label":"Ani-Web Home",children:o(an,{})}),o("nav",{className:S.desktopNav,children:[o(J,{to:"/",className:`${S.navLink} ${h.pathname==="/"?S.navLinkActive:""}`,children:"Home"}),o(J,{to:ve.to,className:`${S.navLink} ${h.pathname.startsWith(ve.to)?S.navLinkActive:""}`,children:ve.label}),t==="anime"&&o(J,{to:"/insights",className:`${S.navLink} ${h.pathname==="/insights"?S.navLinkActive:""}`,children:"Insights"}),o(J,{to:"/settings",className:`${S.navLink} ${h.pathname.startsWith("/settings")?S.navLinkActive:""}`,children:"Settings"})]})]}),o("div",{className:S.rightSection,children:[o("div",{className:S.searchWrapper,children:[o("input",{ref:E,type:"text","data-virtual-keyboard":"true",className:S.searchInput,placeholder:Pe,value:n,onChange:N=>r(N.target.value),onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:N=>{N.key==="Enter"&&je()}}),o("button",{type:"button",className:S.searchButton,"aria-label":"Search",onMouseDown:N=>N.preventDefault(),onClick:ye,children:o(v,{name:"search",className:S.searchIcon})})]}),o(Pi,{}),o(J,{to:"/settings?tab=sync",className:S.profileBtn,"aria-label":"Sync settings",children:R?.picture?o("img",{src:R.picture,alt:R.name,className:S.profileImg,referrerPolicy:"no-referrer",decoding:"async"}):R?.provider==="github"?o(v,{name:"github"}):o(v,{name:"cloud"})})]})]}),d&&o("div",{className:`${S.mobileSearchBar} ${i?"":S.mobileSearchBarHidden}`,ref:j,onBlur:X,children:o("div",{className:S.mobileSearchInner,children:[o(v,{name:"search",className:S.mobileSearchIcon}),o("input",{ref:H,type:"text","data-virtual-keyboard":"true",className:S.mobileSearchInput,placeholder:Pe,value:n,onChange:N=>r(N.target.value),onKeyDown:N=>{N.key==="Enter"?(je(),m(!1)):N.key==="Escape"&&m(!1)}})]})})]})})},Ve="agreedToViewMature";function kt(){try{return localStorage.getItem(Ve)==="true"}catch{return!1}}function Zi(){const[e,t]=_(kt);b(()=>{const i=()=>t(kt());return window.addEventListener("storage",i),window.addEventListener("focus",i),()=>{window.removeEventListener("storage",i),window.removeEventListener("focus",i)}},[]);const n=F(()=>{try{localStorage.setItem(Ve,"true")}catch{}t(!0)},[]),r=F(()=>{try{localStorage.removeItem(Ve)}catch{}t(!1)},[]);return{hasConsent:e,grant:n,revoke:r}}const Xi="_sidebar_153jc_1",es="_open_153jc_20",ts="_sidebarHeader_153jc_25",ns="_closeBtn_153jc_33",rs="_logo_153jc_57",os="_navSection_153jc_69",is="_navLink_153jc_75",ss="_active_153jc_108",as="_overlay_153jc_118",cs="_versionInfo_153jc_138",ee={sidebar:Xi,open:es,sidebarHeader:ts,closeBtn:ns,logo:rs,navSection:os,navLink:is,active:ss,overlay:as,versionInfo:cs},ls="dango-client",us="3.5.0",ds="module",ms={node:">=22.12.0"},ps={start:"vite",dev:"vite",build:"tsc && vite build",lint:"eslint .",test:"vitest run",preview:"vite preview","start:prod":"vite preview",format:"prettier --write ."},hs={"@floating-ui/react":"^0.27.20","@tanstack/react-query":"^5.99.2","@trpc/client":"11.19.0","@trpc/tanstack-react-query":"11.19.0","anime4k-webgpu-async":"^2.0.0","embla-carousel-react":"^8.6.0","hls.js":"^1.5.13",preact:"^10.29.1","react-hot-toast":"^2.6.0","react-router":"^8.3.0","react-simple-maps":"^5.0.3"},fs={"@preact/preset-vite":"^2.10.5","@webgpu/types":"^0.1.72","eslint-plugin-react-hooks":"^7.1.1","eslint-plugin-react-refresh":"^0.5.2",vite:"^7.3.1",vitest:"^5.0.0"},ot={name:ls,private:!0,version:us,type:ds,engines:ms,scripts:ps,dependencies:hs,devDependencies:fs},ys=()=>{const{isOpen:e,setIsOpen:t}=rt(),{contentType:n}=un(),{hasConsent:r}=Zi(),i=()=>{t(!1)},s=n==="manga",a=n==="tv",c=n==="asmr",l=[{to:"/",icon:o(v,{name:"home"}),label:"Home"},s?{to:"/manga",icon:o(v,{name:"book"}),label:"Manga"}:a?{to:"/tv-search",icon:o(v,{name:"tv"}),label:"TV and Movies"}:c?{to:"/asmr",icon:o(v,{name:"headphones"}),label:"ASMR"}:{to:"/search",icon:o(v,{name:"search"}),label:"Search"},s?{to:"/reading-list",icon:o(v,{name:"bookmark"}),label:"Reading List"}:a?{to:"/tv-watchlist",icon:o(v,{name:"clock"}),label:"TV Watchlist"}:c?{to:"/listening-list",icon:o(v,{name:"history"}),label:"Listening List"}:{to:"/watchlist",icon:o(v,{name:"clock"}),label:"Watchlist"},...n==="anime"?[{to:"/insights",icon:o(v,{name:"chart-pie"}),label:"Insights"}]:[],{to:"/trackers",icon:o(v,{name:"sync-alt"}),label:"Trackers"},{to:"/radio",icon:o(v,{name:"broadcast-tower"}),label:"Radio"},{to:"/music",icon:o(v,{name:"headphones"}),label:"Music"},...r?[{to:"/mature",icon:o(v,{name:"pepper-hot"}),label:"Mature"}]:[],{to:"/settings",icon:o(v,{name:"cog"}),label:"Settings"}];return o(G,{children:[o("aside",{className:`${ee.sidebar} ${e?ee.open:""} sidebar`,children:[o("div",{className:ee.sidebarHeader,children:[o("button",{className:ee.closeBtn,onClick:()=>t(!1),"aria-label":"Close menu",children:"×"}),o(J,{to:"/",className:ee.logo,onClick:i,children:o(an,{})})]}),o("nav",{className:ee.navSection,children:l.map(u=>o(kn,{to:u.to,className:({isActive:d})=>`${ee.navLink} ${d?ee.active:""}`,onClick:i,end:u.to==="/",children:[u.icon,o("span",{children:u.label})]},u.to))}),o("div",{className:ee.versionInfo,children:["v",ot.version]})]}),e&&o("div",{className:ee.overlay,onClick:()=>t(!1),"aria-label":"Close sidebar"})]})},vs="_footer_1p5nb_1",gs="_footerInner_1p5nb_15",bs="_brandSection_1p5nb_27",_s="_logoRow_1p5nb_39",ws="_logoText_1p5nb_59",Ss="_brandMeta_1p5nb_65",ks="_brandTagline_1p5nb_74",Ps="_statusPill_1p5nb_81",Es="_statusDot_1p5nb_94",Ts="_linksGrid_1p5nb_102",Is="_linkColumn_1p5nb_110",xs="_columnTitle_1p5nb_116",Os="_bottomBar_1p5nb_140",Ns="_copyright_1p5nb_150",Cs="_brand_1p5nb_27",As="_heartIcon_1p5nb_166",Ls="_backToTop_1p5nb_171",C={footer:vs,footerInner:gs,brandSection:bs,logoRow:_s,logoText:ws,brandMeta:Ss,brandTagline:ks,statusPill:Ps,statusDot:Es,linksGrid:Ts,linkColumn:Is,columnTitle:xs,bottomBar:Os,copyright:Ns,brand:Cs,heartIcon:As,backToTop:Ls},Pt={iris:"/logo.png",mochi:"/logo-mochi.png",sakura:"/logo-sakura.png"},Rs=()=>{const{theme:e}=sn(),t=Pt[e]||Pt.iris,n=new Date().getFullYear(),r=()=>{window.scrollTo({top:0,behavior:"smooth"})};return o("footer",{className:C.footer,children:[o("div",{className:C.footerInner,children:[o("div",{className:C.brandSection,children:[o("div",{className:C.logoRow,children:o("img",{src:t,className:C.logoText,alt:"dango",loading:"lazy",decoding:"async"})}),o("div",{className:C.brandMeta,children:[o("div",{className:C.statusPill,children:[o("span",{className:C.statusDot}),o("span",{children:["v",ot.version]})]}),o("p",{className:C.brandTagline,children:"Fast, local anime streaming."})]})]}),o("div",{className:C.linksGrid,children:[o("div",{className:C.linkColumn,children:[o("h4",{className:C.columnTitle,children:"Navigation"}),o(J,{to:"/",children:"Home"}),o(J,{to:"/watchlist",children:"Watchlist"}),o(J,{to:"/settings",children:"Settings"})]}),o("div",{className:C.linkColumn,children:[o("h4",{className:C.columnTitle,children:"Features"}),o(J,{to:"/search",children:"Search Anime"}),o(J,{to:"/trackers",children:"Trackers"}),o(J,{to:"/insights",children:"Insights"})]}),o("div",{className:C.linkColumn,children:[o("h4",{className:C.columnTitle,children:"Community"}),o("a",{href:"https://discord.gg/2FTSPXCsvn",target:"_blank",rel:"noopener noreferrer",children:[o(v,{name:"discord",style:{marginRight:"6px"}})," Discord"]}),o("a",{href:"https://github.com/serifpersia/dango",target:"_blank",rel:"noopener noreferrer",children:[o(v,{name:"github",style:{marginRight:"6px"}})," GitHub"]})]}),o("div",{className:C.linkColumn,children:[o("h4",{className:C.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:C.bottomBar,children:[o("p",{className:C.copyright,children:["© ",n," ",o("span",{className:C.brand,children:"dango"})," • Crafted with"," ",o(v,{name:"heart",className:C.heartIcon})," by"," ",o("a",{href:"https://github.com/serifpersia",target:"_blank",rel:"noopener noreferrer",children:"serifpersia"})]}),o("button",{className:C.backToTop,onClick:r,"aria-label":"Back to top",children:[o(v,{name:"chevron-up",size:14}),o("span",{children:"Top"})]})]})]})},qs=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2)+Date.now().toString(36),Le="https://script.google.com/macros/s/AKfycbxpllCbhqNjqFN02er9WV-0Tv-Y9br13UqXZqGHzSMetAgqKaFX5oFKGHgxji1fxJ6udw/exec",$s=()=>{const e=navigator.userAgent;let t="Unknown Browser",n="Unknown OS";return e.includes("Firefox")?t="Firefox":e.includes("SamsungBrowser")?t="Samsung Browser":e.includes("Opera")||e.includes("OPR")?t="Opera":e.includes("Trident")?t="Internet Explorer":e.includes("Edge")?t="Edge":e.includes("Chrome")?t="Chrome":e.includes("Safari")&&(t="Safari"),e.includes("Windows")?n="Windows":e.includes("Mac")?n="MacOS":e.includes("Linux")?n="Linux":e.includes("Android")?n="Android":(e.includes("iPhone")||e.includes("iPad")||e.includes("iPod"))&&(n="iOS"),`${t} on ${n}`},Ds=async()=>{localStorage.removeItem("last_telemetry_ping");const e=localStorage.getItem("installation_id");if(e&&Le)try{await fetch(Le,{method:"POST",mode:"no-cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"delete"})})}catch(t){console.error("Telemetry delete request failed:",t)}};let Fe=!1;const js=async()=>{if(!Fe){Fe=!0,localStorage.setItem("last_telemetry_ping",Date.now().toString());try{let e=localStorage.getItem("installation_id");if(!e)try{const t=await K.settings.installationId.query();t.id&&(e=t.id,localStorage.setItem("installation_id",e))}catch(t){console.error("Failed to fetch hardware ID:",t)}e||(e=qs(),localStorage.setItem("installation_id",e)),await fetch(Le,{method:"POST",mode:"no-cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,version:ot.version,userAgent:$s(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})})}catch(e){console.error("Telemetry ping failed:",e)}finally{Fe=!1}}},Ms=()=>{const[e,t]=_(!1);return b(()=>{if(!localStorage.getItem("telemetry_notice_v2")){const r=setTimeout(()=>t(!0),3e3);return()=>clearTimeout(r)}},[]),b(()=>{if(!(localStorage.getItem("telemetry_enabled")!=="false")||!Le)return;const r=localStorage.getItem("last_telemetry_ping"),i=Date.now(),s=1440*60*1e3;r&&i-parseInt(r)<s||js()},[]),{showTelemetryModal:e,setShowTelemetryModal:t}},Bs="_overlay_1juub_1",Fs="_fadeIn_1juub_1",Ws="_content_1juub_11",Us="_modalIn_1juub_1",Ks="_sm_1juub_29",zs="_md_1juub_33",Qs="_lg_1juub_37",Hs="_title_1juub_41",Vs="_body_1juub_48",Gs="_footer_1juub_52",pe={overlay:Bs,fadeIn:Fs,content:Ws,modalIn:Us,sm:Ks,md:zs,lg:Qs,title:Hs,body:Vs,footer:Gs};function mn({children:e}){return o("h2",{className:pe.title,children:e})}function pn({children:e}){return o("div",{className:pe.body,children:e})}function hn({children:e}){return o("div",{className:pe.footer,children:e})}function fe({isOpen:e,onClose:t,title:n,children:r,footer:i,width:s="md"}){const a=B(null);return b(()=>{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?Rt(o("div",{role:"presentation",onMouseDown:c=>c.stopPropagation(),children:[o("div",{className:pe.overlay,onClick:()=>t?.(),"aria-hidden":"true"}),o("div",{ref:a,className:`${pe.content} ${pe[s]}`,role:"dialog","aria-modal":"true","aria-label":n,tabIndex:-1,children:[n&&o(mn,{children:n}),o(pn,{children:r}),i&&o(hn,{children:i})]})]}),document.body):null}fe.Header=mn;fe.Body=pn;fe.Actions=hn;const Js="_slider_1f1gi_15",Et={switch:"_switch_1f1gi_1",slider:Js},Ys=({isChecked:e,onChange:t,id:n,disabled:r=!1})=>o("label",{className:Et.switch,htmlFor:n,children:[o("input",{type:"checkbox",id:n,checked:e,onChange:t,disabled:r}),o("span",{className:Et.slider})]}),Zs="_container_1hh92_1",Xs="_description_1hh92_8",ea="_dataList_1hh92_14",ta="_dataTitle_1hh92_20",na="_toggleRow_1hh92_39",ra="_toggleLabel_1hh92_46",oa="_actions_1hh92_50",ia="_okButton_1hh92_55",sa="_previewToggle_1hh92_71",aa="_chevron_1hh92_89",ca="_chevronOpen_1hh92_94",la="_previewBox_1hh92_98",ua="_previewItem_1hh92_107",da="_previewKey_1hh92_114",ma="_previewVal_1hh92_118",T={container:Zs,description:Xs,dataList:ea,dataTitle:ta,toggleRow:na,toggleLabel:ra,actions:oa,okButton:ia,previewToggle:sa,chevron:aa,chevronOpen:ca,previewBox:la,previewItem:ua,previewKey:da,previewVal:ma},pa="3.5.0",ha={version:pa},fa=()=>{const e=navigator.userAgent;return e.includes("Firefox")?"Firefox":e.includes("SamsungBrowser")?"Samsung Browser":e.includes("Opera")||e.includes("OPR")?"Opera":e.includes("Edge")?"Edge":e.includes("Chrome")?"Chrome":e.includes("Safari")?"Safari":"Unknown"},ya=()=>{const e=navigator.userAgent;return e.includes("Windows")?"Windows":e.includes("Mac")?"macOS":e.includes("Linux")?"Linux":e.includes("Android")?"Android":e.includes("iPhone")||e.includes("iPad")?"iOS":"Unknown"},va=({isOpen:e,onClose:t})=>{const[n,r]=_(!0),[i,s]=_(!1),a=()=>{localStorage.setItem("telemetry_enabled",String(n)),localStorage.setItem("telemetry_notice_v2","true"),n||Ds(),t()};return o(fe,{isOpen:e,onClose:()=>{},title:"Telemetry",children:o("div",{className:T.container,children:[o("p",{className:T.description,children:"Dango collects anonymous usage data to help track how many people use the app. This information is used to measure the project's install base and popularity. Participation is completely optional."}),o("div",{className:T.dataList,children:[o("p",{className:T.dataTitle,children:"What is collected:"}),o("ul",{children:[o("li",{children:"Browser type and operating system"}),o("li",{children:"Your timezone (e.g. Europe/Berlin)"}),o("li",{children:"Anonymous timestamps (first seen / last seen)"})]})]}),o("button",{className:T.previewToggle,onClick:()=>s(!i),children:[o("span",{children:"See exactly what data is sent"}),o(v,{name:"chevron-down",className:`${T.chevron} ${i?T.chevronOpen:""}`})]}),i&&o("div",{className:T.previewBox,children:[o("div",{className:T.previewItem,children:[o("span",{className:T.previewKey,children:"Browser:"}),o("span",{className:T.previewVal,children:fa()})]}),o("div",{className:T.previewItem,children:[o("span",{className:T.previewKey,children:"OS:"}),o("span",{className:T.previewVal,children:ya()})]}),o("div",{className:T.previewItem,children:[o("span",{className:T.previewKey,children:"Timezone:"}),o("span",{className:T.previewVal,children:Intl.DateTimeFormat().resolvedOptions().timeZone})]}),o("div",{className:T.previewItem,children:[o("span",{className:T.previewKey,children:"App Version:"}),o("span",{className:T.previewVal,children:ha.version})]})]}),o("div",{className:T.toggleRow,children:[o("span",{className:T.toggleLabel,children:"Send anonymous telemetry"}),o(Ys,{isChecked:n,onChange:c=>r(c.target.checked),id:"telemetry-notice-toggle"})]}),o("div",{className:T.actions,children:o("button",{className:T.okButton,onClick:a,children:"Ok"})})]})})},ga="_promoWrapper_1vfnt_1",ba="_visible_1vfnt_11",_a="_panel_1vfnt_16",wa="_closeBtn_1vfnt_29",Sa="_header_1vfnt_55",ka="_discordIcon_1vfnt_62",Pa="_headerText_1vfnt_74",Ea="_body_1vfnt_89",Ta="_rolePreview_1vfnt_96",Ia="_badge_1vfnt_103",xa="_badgeRank_1vfnt_111",Oa="_badgeDere_1vfnt_117",Na="_actions_1vfnt_123",Ca="_btnJoin_1vfnt_129",Aa="_btnSettings_1vfnt_155",La="_skipLink_1vfnt_180",Ra="_hint_1vfnt_200",L={promoWrapper:ga,visible:ba,panel:_a,closeBtn:wa,header:Sa,discordIcon:ka,headerText:Pa,body:Ea,rolePreview:Ta,badge:Ia,badgeRank:xa,badgeDere:Oa,actions:Na,btnJoin:Ca,btnSettings:Aa,skipLink:La,hint:Ra},Tt="discord_community_promo_dismissed",qa=4500;function $a({workerUrl:e}){const t=qt(),[n,r]=_(!1),i=B(!1);b(()=>{if(localStorage.getItem(Tt)==="true"||localStorage.getItem("dango_discord_user"))return;const c=setTimeout(()=>r(!0),qa);return()=>clearTimeout(c)},[]);const s=()=>{i.current||(i.current=!0,r(!1),localStorage.setItem(Tt,"true"))},a=()=>{s(),t("/settings?tab=community")};return e?o("div",{className:`${L.promoWrapper} ${n?L.visible:""}`,"aria-live":"polite",children:o("div",{className:L.panel,children:[o("button",{className:L.closeBtn,onClick:s,"aria-label":"Dismiss",children:"✕"}),o("div",{className:L.header,children:[o("div",{className:L.discordIcon,children:o("svg",{width:"20",height:"16",viewBox:"0 0 71 55",fill:"white","aria-hidden":"true",children:o("path",{d:"M60.1 4.9A58.5 58.5 0 0 0 45.5.3a.22.22 0 0 0-.23.11 40.8 40.8 0 0 0-1.8 3.7 54 54 0 0 0-16.2 0 37.5 37.5 0 0 0-1.83-3.7.23.23 0 0 0-.23-.11A58.3 58.3 0 0 0 10.9 4.9a.2.2 0 0 0-.1.08C1.58 18.73-1 32.23.31 45.55a.24.24 0 0 0 .09.17 58.8 58.8 0 0 0 17.7 8.95.23.23 0 0 0 .25-.08 42 42 0 0 0 3.61-5.88.22.22 0 0 0-.12-.31 38.7 38.7 0 0 1-5.53-2.64.23.23 0 0 1-.02-.37 29 29 0 0 0 1.1-.86.22.22 0 0 1 .23-.03c11.6 5.3 24.14 5.3 35.6 0a.22.22 0 0 1 .23.03c.36.3.73.58 1.1.86a.23.23 0 0 1-.02.37 36.4 36.4 0 0 1-5.53 2.64.22.22 0 0 0-.12.31 47.1 47.1 0 0 0 3.61 5.88.22.22 0 0 0 .25.08 58.6 58.6 0 0 0 17.72-8.95.23.23 0 0 0 .09-.16c1.47-15.27-2.47-28.65-10.46-40.47a.18.18 0 0 0-.09-.09ZM23.73 37.55c-3.49 0-6.37-3.21-6.37-7.15s2.82-7.15 6.37-7.15c3.58 0 6.42 3.24 6.37 7.15 0 3.94-2.82 7.15-6.37 7.15Zm23.54 0c-3.49 0-6.37-3.21-6.37-7.15s2.82-7.15 6.37-7.15c3.58 0 6.42 3.24 6.37 7.15 0 3.94-2.79 7.15-6.37 7.15Z"})})}),o("div",{className:L.headerText,children:[o("h4",{children:"Join the Dango Community"}),o("p",{children:"Earn roles based on your watch stats"})]})]}),o("div",{className:L.body,children:[o("p",{style:{margin:"0 0 6px"},children:"Connect your Discord account and earn exclusive server roles based on how much you watch:"}),o("div",{className:L.rolePreview,children:[o("span",{className:`${L.badge} ${L.badgeRank}`,children:"S-Rank"}),o("span",{className:`${L.badge} ${L.badgeRank}`,children:"F–A Rank"}),o("span",{className:`${L.badge} ${L.badgeDere}`,children:"Tsundere"}),o("span",{className:`${L.badge} ${L.badgeDere}`,children:"Kamidere…"})]})]}),o("div",{className:L.actions,children:[o("a",{className:L.btnJoin,href:"https://discord.gg/6yPAZjDzg8",target:"_blank",rel:"noopener noreferrer",children:[o("svg",{width:"16",height:"12",viewBox:"0 0 71 55",fill:"currentColor","aria-hidden":"true",children:o("path",{d:"M60.1 4.9A58.5 58.5 0 0 0 45.5.3a.22.22 0 0 0-.23.11 40.8 40.8 0 0 0-1.8 3.7 54 54 0 0 0-16.2 0 37.5 37.5 0 0 0-1.83-3.7.23.23 0 0 0-.23-.11A58.3 58.3 0 0 0 10.9 4.9a.2.2 0 0 0-.1.08C1.58 18.73-1 32.23.31 45.55a.24.24 0 0 0 .09.17 58.8 58.8 0 0 0 17.7 8.95.23.23 0 0 0 .25-.08 42 42 0 0 0 3.61-5.88.22.22 0 0 0-.12-.31 38.7 38.7 0 0 1-5.53-2.64.23.23 0 0 1-.02-.37 29 29 0 0 0 1.1-.86.22.22 0 0 1 .23-.03c11.6 5.3 24.14 5.3 35.6 0a.22.22 0 0 1 .23.03c.36.3.73.58 1.1.86a.23.23 0 0 1-.02.37 36.4 36.4 0 0 1-5.53 2.64.22.22 0 0 0-.12.31 47.1 47.1 0 0 0 3.61 5.88.22.22 0 0 0 .25.08 58.6 58.6 0 0 0 17.72-8.95.23.23 0 0 0 .09-.16c1.47-15.27-2.47-28.65-10.46-40.47a.18.18 0 0 0-.09-.09ZM23.73 37.55c-3.49 0-6.37-3.21-6.37-7.15s2.82-7.15 6.37-7.15c3.58 0 6.42 3.24 6.37 7.15 0 3.94-2.82 7.15-6.37 7.15Zm23.54 0c-3.49 0-6.37-3.21-6.37-7.15s2.82-7.15 6.37-7.15c3.58 0 6.42 3.24 6.37 7.15 0 3.94-2.79 7.15-6.37 7.15Z"})}),"Join Discord Server"]}),o("button",{className:L.btnSettings,onClick:a,children:[o("span",{children:"⚙"})," Get Roles & Settings"]})]}),o("button",{className:L.skipLink,onClick:s,children:"Skip — don't show again"}),o("p",{className:L.hint,children:"You can always find this in Settings → Community"})]})}):null}const it=e=>{const t=P();return Q({...t.settings.getByKey.queryOptions({key:e}),select:n=>n.value})},fn=()=>{const e=P(),t=z();return Y(e.settings.set.mutationOptions({onSuccess:()=>{g.success("Setting updated!"),t.invalidateQueries(e.settings.pathFilter()),t.invalidateQueries({queryKey:["settings"]})},onError:n=>{g.error(`Failed to update setting: ${n.message}`)}}))};function yn(e){return JSON.stringify({0:e??{}})}function vn(e){return`/api/trpc/${e}?batch=1`}function Ge(e,t){const n=yn(t),r=vn(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 ml(e,t){await fetch(vn(e),{method:"POST",headers:{"Content-Type":"application/json"},body:yn(t),keepalive:!0})}function pl(e){e&&(Ge("discord.clear",{sessionId:e}),Ge("discord.heartbeat",{sessionId:e,bye:!0}))}function Da(){const e=Ye(),{data:t}=it("discordRPCEnabled"),n=B("");n.current||(n.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`tab-${Date.now()}-${Math.random().toString(36).slice(2)}`),b(()=>{if(t===!1||t==="false")return;const r=n.current,i=()=>K.discord.heartbeat.mutate({sessionId:r}).catch(()=>{});i();const s=setInterval(i,15e3),a=()=>{Ge("discord.heartbeat",{sessionId:r,bye:!0})};return window.addEventListener("pagehide",a),()=>{clearInterval(s),window.removeEventListener("pagehide",a)}},[t]),b(()=>{if(t===!1||t==="false")return;const r=e.pathname;if(r.startsWith("/watch/")||r.startsWith("/player/"))return;let i="home";r.startsWith("/search")||r.startsWith("/mature")?i="search":r.startsWith("/watchlist")?i="watchlist":r.startsWith("/anime/")?i="anime":r.startsWith("/insights")?i="insights":r.startsWith("/settings")?i="settings":r.startsWith("/map")?i="map":r.startsWith("/trackers")?i="trackers":r.startsWith("/asmr")?i="asmr":r.startsWith("/manga")?i="manga":r.startsWith("/radio")?i="radio":r.startsWith("/music")?i="music":r.startsWith("/tv")&&(i="tv"),K.discord.pageStatus.mutate({page:i}).catch(()=>{})},[e.pathname,t])}function gn(e,t){const[n,r]=_(()=>{try{const s=localStorage.getItem(e);if(s===null)return t;if(typeof t=="string")return s;try{return JSON.parse(s)}catch{return s}}catch{return t}});b(()=>{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=F(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 bn=oe(void 0),ja=()=>{const e=ie(bn);if(!e)throw new Error("useAnimePaheCookie must be used within an AnimePaheCookieProvider");return e},Ma="_container_e96gf_1",Ba="_field_e96gf_9",Fa="_textarea_e96gf_20",Wa="_input_e96gf_40",Ua="_button_e96gf_58",Ka="_secondaryButton_e96gf_78",za="_actions_e96gf_95",Qa="_hint_e96gf_104",Ha="_link_e96gf_117",W={container:Ma,field:Ba,textarea:Fa,input:Wa,button:Ua,secondaryButton:Ka,actions:za,hint:Qa,link:Ha},Va="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",Ga=e=>{try{return JSON.parse(e.detail)}catch{return null}},Ja=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,i]=_(1),[s,a]=_(navigator.userAgent),[c,l]=_(""),[u,d]=_(!1),m=B(null),p=navigator.userAgent,h=/android/i.test(p),f=/firefox|fxios/i.test(p)&&!h,O=!f&&!h&&/chrome|chromium|edg|brave/i.test(p),D=f||O;b(()=>{e&&(i(1),a(navigator.userAgent),l(""),d(!1))},[e]),b(()=>()=>{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)},H=()=>{if(u)return;d(!0);const R=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,E=window.setTimeout(()=>{d(!1),m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null),g.error("Helper not detected — install it via about:debugging first.")},3e3),Z=ye=>{const X=Ga(ye);if(!(!X||X.requestId!==R))if(window.clearTimeout(E),window.removeEventListener("dango:pahe-cookie",Z),m.current=null,d(!1),X?.ok&&X.cookie)l(X.cookie),g.success("Cookie extracted from helper!");else if(X?.error==="NO_COOKIE"){const Pe=X.debug?.stores?.length??0,ve=X.debug?.names??[];g.error(`Helper found no cf_clearance (checked ${Pe} stores, saw: ${ve.join(", ")||"none"}) — solve the challenge on the AnimePahe tab first.`)}else g.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:R}}))},A=()=>{const R=c.trim();if(!R){g.error("Please enter the cf_clearance cookie");return}try{localStorage.setItem("animepahe_cookie",R),g.success("Cookie updated successfully! Reloading…"),n?.(),t(),window.setTimeout(()=>window.location.reload(),1e3)}catch{g.error("Failed to save cookie")}};return o(fe,{isOpen:e,onClose:t,title:"AnimePahe Verification Required",children:o("div",{className:W.container,children:r===1?o(G,{children:[o("p",{children:"AnimePahe requires a manual verification to bypass Cloudflare/DDoS-Guard protection."}),o("div",{className:W.field,children:[o("label",{children:"Your User-Agent (will be used for requests):"}),o("textarea",{value:s,readOnly:!0,rows:3,className:W.textarea})]}),o("div",{className:W.actions,children:[o("button",{className:W.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:W.button,onClick:j,children:"Start Verification (Opens AnimePahe)"})]})]}):o(G,{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."]}),D&&o("div",{className:W.hint,children:[o("strong",{children:"Dango helper (one-time setup):"})," ",f?o(G,{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(G,{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:Va,target:"_blank",rel:"noreferrer",className:W.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",o("div",{className:W.actions,children:o("button",{className:W.button,onClick:H,disabled:u,type:"button",children:u?"Extracting…":"Extract cookie from helper"})})]}),o("div",{className:W.field,children:[o("label",{children:"cf_clearance cookie value:"}),o("input",{type:"text",value:c,onChange:R=>l(R.target.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:W.input})]}),o("div",{className:W.actions,children:[o("button",{className:W.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:W.secondaryButton,onClick:()=>i(1),children:"Back"}),o("button",{className:W.button,onClick:A,children:"Submit"})]})]})})})};function Ya(){const[e,t]=_(!1);return b(()=>{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 Za extends Pn{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.hasError?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100%",backgroundColor:"#1a1b1c",color:"#fff",textAlign:"center",padding:"2rem"},children:[o(v,{name:"exclamation-triangle",style:{fontSize:"4rem",color:"#ff4d4d",marginBottom:"1rem"}}),o("h1",{style:{marginBottom:"1rem"},children:"Something went wrong"}),o("p",{style:{color:"#aaa",marginBottom:"2rem"},children:"The application encountered an unexpected error."}),o("button",{onClick:()=>{this.setState({hasError:!1}),window.location.href="/"},style:{padding:"0.8rem 1.5rem",backgroundColor:"var(--accent, #3d5afe)",color:"#fff",border:"none",borderRadius:"0.5rem",cursor:"pointer",display:"flex",alignItems:"center",gap:"0.5rem",fontSize:"1rem",transition:"background-color 0.2s"},onMouseOver:t=>t.currentTarget.style.backgroundColor="#536dfe",onMouseOut:t=>t.currentTarget.style.backgroundColor="var(--accent, #3d5afe)",children:[o(v,{name:"home"}),"Go back Home"]})]}):this.props.children}}const _n=oe(void 0),Xa=({children:e})=>{const[t,n]=_(!1),r=F(()=>n(!0),[]),i=F(()=>n(!1),[]);return b(()=>Zt("lan",r),[r]),o(_n.Provider,{value:{isOpen:t,openModal:r,closeModal:i},children:e})},ec=()=>{const e=ie(_n);if(!e)throw new Error("useLanAuth must be used within a LanAuthProvider");return e},tc="_container_88bss_1",nc="_field_88bss_8",rc="_input_88bss_19",oc="_actions_88bss_37",Ie={container:tc,field:nc,input:rc,actions:oc},It=En(({variant:e="primary",size:t="md",loading:n,children:r,className:i="",disabled:s,...a},c)=>{const l=Ko("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})}),ic=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,i]=_(""),[s,a]=_(!1);Je.useEffect(()=>{e&&i("")},[e]);const c=async()=>{if(!r){g.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){g.error(u.error||"Login failed");return}g.success("Authenticated successfully"),n(),t(),window.location.reload()}catch{g.error("Network error")}finally{a(!1)}};return o(fe,{isOpen:e,onClose:t,title:"LAN Authentication Required",children:o("div",{className:Ie.container,children:[o("p",{children:"This instance is protected. Enter the password to access from this device."}),o("div",{className:Ie.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:Ie.input,onKeyDown:l=>l.key==="Enter"&&c()})]}),o("div",{className:Ie.actions,children:[o(It,{variant:"secondary",onClick:t,disabled:s,children:"Cancel"}),o(It,{variant:"primary",onClick:c,loading:s,children:"Unlock"})]})]})})},sc=I(()=>x(()=>import("./Home-C3Vck_99.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]))),ac=I(()=>x(()=>import("./Watchlist-wd9cCDOK.js"),__vite__mapDeps([30,1,2,4,6,7,8,9,10,11,12,13,3,5,14,15,31,32]))),cc=I(()=>x(()=>import("./Settings-CyT9Lyhz.js"),__vite__mapDeps([33,1,2,4,34]))),xt=I(()=>x(()=>import("./Player-V9IueAzT.js"),__vite__mapDeps([35,1,2,36,4,37,38,12,17,18,8,9,10,23,39,40,41,42,43]))),lc=I(()=>x(()=>import("./Search-q0GUdNMS.js"),__vite__mapDeps([44,1,4,3,5,6,7,2,8,9,10,11,12,13,14,15,45,46]))),uc=I(()=>x(()=>import("./Mature-ZKR5vMIv.js"),__vite__mapDeps([47,1,2,4,3,5,6,7,8,9,10,11,12,13,14,15,23,45,46,48]))),Ot=I(()=>x(()=>import("./Asmr-B08Aimrk.js"),__vite__mapDeps([49,1,4,2,11,9,12,13,28,50,51,52,21,38,53,54]))),dc=I(()=>x(()=>import("./Manga-CeSb5K2w.js"),__vite__mapDeps([55,1,4,14,15,11,9,12,13,19,20,2,21,23,56,57,53,54]))),mc=I(()=>x(()=>import("./MangaInfoPage-wqYZN_sT.js"),__vite__mapDeps([58,1,4,14,15,20,2,56,57,53,54]))),pc=I(()=>x(()=>import("./MangaReadPage-BbyExwBN.js"),__vite__mapDeps([59,1,14,4,15,2,20,56,57,53,54]))),hc=I(()=>x(()=>import("./ReadingList-CSvUUtZ3.js"),__vite__mapDeps([60,1,11,9,4,12,13,61,3,5,14,15,31,32,19,20,2,21,22,16]))),fc=I(()=>x(()=>import("./Radio-CJ-ra4vb.js"),__vite__mapDeps([62,1,4,2,50,51,63,64,53,54]))),yc=I(()=>x(()=>import("./Music-CljVJFCj.js"),__vite__mapDeps([65,1,4,50,51,63,64,2,53,54,66]))),Nt=I(()=>x(()=>import("./TvSearch-CnnVkms6.js"),__vite__mapDeps([67,1,4,3,5,24,11,9,12,13,25,26,2,14,15,45,46]))),vc=I(()=>x(()=>import("./TvInfo-CgEVN57T.js"),__vite__mapDeps([68,1,4,26,2,69]))),gc=I(()=>x(()=>import("./Tv-BfaWoR72.js"),__vite__mapDeps([70,1,2,4,36,37,71,23,26,38,12,41,42,72]))),bc=I(()=>x(()=>import("./TvWatchlist-BLVF_row.js"),__vite__mapDeps([73,1,11,9,4,12,13,61,3,5,14,15,31,32,16,25,26,2]))),_c=I(()=>x(()=>import("./ListeningList-CoeQ17lz.js"),__vite__mapDeps([74,1,11,9,4,12,13,61,3,5,14,15,31,32,52,28,2,50,51,21,27,16]))),wc=I(()=>x(()=>import("./Trackers-Dn7P6AfI.js"),__vite__mapDeps([75,1,2,4,76]))),Sc=I(()=>x(()=>import("./Insights-nW34Wbg1.js"),__vite__mapDeps([77,1,2,4,78]))),kc=I(()=>x(()=>import("./Map-BtXwpBOC.js"),__vite__mapDeps([79,1,4,80]))),Pc=I(()=>x(()=>import("./AnimeInfoPage-l0wIHS7j.js"),__vite__mapDeps([81,1,2,4]))),Ec=I(()=>x(()=>import("./PlayerRedirect-fv2tzEUu.js"),__vite__mapDeps([82,1]))),Tc=I(()=>x(()=>import("./VirtualKeyboard-BmqZPZXR.js"),__vite__mapDeps([83,1,84])));function Ic(){const{isOpen:e,closeModal:t,onSuccess:n}=ja(),{isOpen:r,setIsOpen:i}=rt(),{isOpen:s,openModal:a,closeModal:c}=ec(),l=Ye(),u=Tn(),d=B(new Map),m=Ii(),{showTelemetryModal:p,setShowTelemetryModal:h}=Ms();Da();const[f,O]=_("");b(()=>{K.discord.rolesConfig.query().then(E=>{E.workerUrl&&O(E.workerUrl)}).catch(()=>{})},[]);const[D,j]=_(!1);b(()=>{fetch("/api/auth/app-status").then(E=>E.json()).then(E=>{E.hasPassword&&!E.isAuthenticated&&(j(!0),a())}).catch(()=>{})},[a]);const[H,A]=gn("lan_auth_notice_shown","false"),R=B(!1);return b(()=>{if(H==="true"||R.current)return;R.current=!0,A("true");const E=setTimeout(()=>{g("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(E)},[H,A]),b(()=>{try{window.history.scrollRestoration="manual"}catch{}},[]),b(()=>{const E=l.key,Z=d.current;if(u==="POP"){const ye=Z.get(E)??0;window.scrollTo({top:ye,behavior:"instant"})}else window.scrollTo({top:0,behavior:"instant"});return()=>{Z.set(E,window.scrollY)}},[l.key,u]),b(()=>{const E=Z=>{r&&Z.key==="Escape"&&i(!1)};return r?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open"),window.addEventListener("keydown",E),()=>{window.removeEventListener("keydown",E),document.body.classList.remove("sidebar-open")}},[r,i]),o("div",{className:"app-container",children:[o(Ja,{isOpen:e,onClose:t,onSuccess:n}),o(va,{isOpen:p,onClose:()=>h(!1)}),o(ic,{isOpen:s,onClose:D?()=>{}:c,onSuccess:()=>{j(!1),c()}}),f&&o($a,{workerUrl:f}),o(kr,{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(Yi,{}),o(ys,{}),o("main",{className:"main-content",children:o(Za,{children:o(at,{fallback:o(Ya,{}),children:o(In,{children:[o(w,{path:"/",element:o(sc,{})}),o(w,{path:"/watchlist/:filter?",element:o(ac,{})}),o(w,{path:"/reading-list/:filter?",element:o(hc,{})}),o(w,{path:"/search",element:o(lc,{})}),o(w,{path:"/mature",element:o(uc,{})}),o(w,{path:"/asmr",element:o(Ot,{})}),o(w,{path:"/asmr/:rj",element:o(Ot,{})}),o(w,{path:"/manga",element:o(dc,{})}),o(w,{path:"/manga/:provider/:id",element:o(mc,{})}),o(w,{path:"/manga/:provider/:id/read",element:o(pc,{})}),o(w,{path:"/radio",element:o(fc,{})}),o(w,{path:"/music",element:o(yc,{})}),o(w,{path:"/tv",element:o(Nt,{})}),o(w,{path:"/tv/:id",element:o(vc,{})}),o(w,{path:"/tv/:id/watch",element:o(gc,{})}),o(w,{path:"/tv-search",element:o(Nt,{})}),o(w,{path:"/tv-watchlist/:filter?",element:o(bc,{})}),o(w,{path:"/listening-list/:filter?",element:o(_c,{})}),o(w,{path:"/settings",element:o(cc,{})}),o(w,{path:"/trackers",element:o(wc,{})}),o(w,{path:"/mal",element:o(ct,{to:"/trackers",replace:!0})}),o(w,{path:"/insights",element:o(Sc,{})}),o(w,{path:"/map",element:o(kc,{})}),o(w,{path:"/anime/:id",element:o(Pc,{})}),o(w,{path:"/watch/:id",element:o(xt,{})}),o(w,{path:"/watch/:id/:episodeNumber",element:o(xt,{})}),o(w,{path:"/player/:id/:episodeNumber?",element:o(Ec,{})}),o(w,{path:"*",element:o(ct,{to:"/",replace:!0})})]})})})}),o(Rs,{}),m.isVisible&&o(at,{fallback:null,children:o(Tc,{activeInputRef:m.activeInputRef,isVisible:m.isVisible,onClose:m.hide})})]})}function xc(){return o(Xa,{children:o(Ic,{})})}const Oc=({children:e})=>{const[t,n]=_(!1),r=F(()=>{n(s=>!s)},[]),i=he(()=>({isOpen:t,setIsOpen:n,toggleSidebar:r}),[t,r]);return o(cn.Provider,{value:i,children:e})},Nc=({children:e})=>{const[t,n]=gn("dango_content_type","anime"),r=he(()=>({contentType:t,setContentType:n}),[t,n]);return o(ln.Provider,{value:r,children:e})},Cc=({children:e})=>{const[t,n]=_("englishName"),[r,i]=_(!0);b(()=>{(async()=>{try{const c=await K.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=he(()=>({titlePreference:t,setTitlePreference:n,loading:r}),[t,r]);return o(en.Provider,{value:s,children:e})},wn=oe(void 0),hl=()=>{const e=ie(wn);if(e===void 0)throw new Error("useLowEndMode must be used within a LowEndModeProvider");return e},Ac=({children:e})=>{const{data:t,isLoading:n}=it("lowEndMode"),r=fn(),[i,s]=_(!1);b(()=>{t!==void 0&&s(t==="true"||t===!0)},[t]),b(()=>{i?document.body.classList.add("low-end"):document.body.classList.remove("low-end")},[i]);const a=F(l=>{s(l),r.mutate({key:"lowEndMode",value:String(l)})},[r]),c=he(()=>({lowEndMode:i,setLowEndMode:a,loading:n}),[i,a,n]);return o(wn.Provider,{value:c,children:e})},Lc=["iris","mochi","sakura"];function Ct(e){e==="iris"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const Rc=({children:e})=>{const{data:t,isLoading:n}=it("theme"),r=fn(),[i,s]=_("iris");b(()=>{typeof t=="string"&&Lc.includes(t)&&s(t)},[t]),b(()=>{Ct(i)},[i]);const a=F(l=>{l!==i&&(s(l),Ct(l),r.mutate({key:"theme",value:l}))},[r,i]),c=he(()=>({theme:i,setTheme:a,loading:n}),[i,a,n]);return o(on.Provider,{value:c,children:e})},qc=({children:e})=>{const[t,n]=_(!1),[r,i]=_(void 0),s=F(c=>{i(()=>c),n(!0)},[]),a=F(()=>{n(!1),i(void 0)},[]);return b(()=>Zt("animepahe",()=>s()),[s]),o(bn.Provider,{value:{isOpen:t,openModal:s,closeModal:a,onSuccess:r},children:e})};try{window.history.scrollRestoration="manual"}catch{}const At=new An({defaultOptions:{queries:{staleTime:1e3*60*5,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,retry:1}}}),Lt=document.getElementById("root");Lt&&xn(o(On,{children:o(Fo,{trpcClient:K,queryClient:At,children:o(Ln,{client:At,children:o(qc,{children:o(Oc,{children:o(Nc,{children:o(Cc,{children:o(Ac,{children:o(Rc,{children:o(xc,{})})})})})})})})})}),Lt);export{Mc as $,fn as A,It as B,sl as C,al as D,il as E,q as F,sn as G,dl as H,wt as I,ha as J,$s as K,_t as L,fe as M,js as N,Ds as O,Wc as P,Ja as Q,Hc as R,Be as S,Ys as T,Ti as U,dn as V,pl as W,W as X,Zt as Y,ml as Z,x as _,gn as a,rt as a0,ul as a1,Ya as a2,Yc as a3,Zc as a4,Jc as a5,Kc as b,zc as c,zo as d,Zi as e,Uo as f,Bc as g,P as h,Qc as i,un as j,ol as k,Vc as l,Gc as m,Xc as n,el as o,cl as p,nl as q,Uc as r,Fc as s,K as t,hl as u,ll as v,rl as w,tl as x,it as y,g as z};
@@ -1,23 +0,0 @@
1
- import logger from './logger.js';
2
- const log = logger.child({ module: 'SyncConfig' });
3
- let activeRemote;
4
- export function setActiveRemote(remote) {
5
- log.info({ remote }, 'Setting active sync remote');
6
- activeRemote = remote;
7
- }
8
- export function getActiveRemote() {
9
- return activeRemote;
10
- }
11
- export async function initialize() {
12
- if (activeRemote !== 'gdrive') {
13
- log.info('Active remote is not gdrive, skipping gdrive-specific initialization.');
14
- return;
15
- }
16
- log.info('gdrive is the active remote.');
17
- }
18
- export function getRemoteString(remoteDir) {
19
- if (!activeRemote) {
20
- throw new Error('Cannot get remote string: active remote is not set.');
21
- }
22
- return `${activeRemote}:${remoteDir}`;
23
- }
@@ -1,39 +0,0 @@
1
- import { execSync } from 'child_process';
2
- import os from 'os';
3
- import crypto from 'crypto';
4
- import fs from 'fs';
5
- export function getMachineId() {
6
- let hardwareId = '';
7
- try {
8
- if (process.platform === 'win32') {
9
- hardwareId = execSync('reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography" /v MachineGuid')
10
- .toString()
11
- .split('REG_SZ')[1]
12
- .trim();
13
- }
14
- else if (process.platform === 'linux') {
15
- if (fs.existsSync('/etc/machine-id')) {
16
- hardwareId = fs.readFileSync('/etc/machine-id', 'utf8').trim();
17
- }
18
- else if (fs.existsSync('/var/lib/dbus/machine-id')) {
19
- hardwareId = fs.readFileSync('/var/lib/dbus/machine-id', 'utf8').trim();
20
- }
21
- }
22
- else if (process.platform === 'darwin') {
23
- hardwareId = execSync("ioreg -rd1 -c IOPlatformExpertDevice | grep -E 'IOPlatformUUID' | awk -F'\"' '{print $4}'")
24
- .toString()
25
- .trim();
26
- }
27
- }
28
- catch (err) {
29
- const interfaces = os.networkInterfaces();
30
- const macs = Object.values(interfaces)
31
- .flat()
32
- .flatMap((iface) => iface && !iface.internal && iface.mac !== '00:00:00:00:00:00' ? [iface.mac] : [])
33
- .sort();
34
- hardwareId = macs.length > 0 ? macs.join('-') : os.hostname();
35
- }
36
- const username = os.userInfo().username;
37
- const seed = `${hardwareId}:${username}:${process.platform}`;
38
- return crypto.createHash('sha256').update(seed).digest('hex');
39
- }