@serifpersia/dango 3.3.4 → 3.3.6

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 (62) hide show
  1. package/README.md +1 -1
  2. package/client/dist/assets/AnimeCard-OKU7LaSN.js +1 -0
  3. package/client/dist/assets/{AnimeInfo-0huPAq0O.js → AnimeInfo-BCyLw0yz.js} +1 -1
  4. package/client/dist/assets/{AnimeInfoPage-Dqr5QH6R.js → AnimeInfoPage-BZWl-TJY.js} +2 -2
  5. package/client/dist/assets/{Asmr-B6ZiqkmU.js → Asmr-4S6uoevp.js} +1 -1
  6. package/client/dist/assets/{AsmrResetProgressModal-Cqsoo3XC.js → AsmrResetProgressModal-C8i6weqW.js} +1 -1
  7. package/client/dist/assets/{AvSyncCalibrator-C1_iBSyL.css → AvSyncCalibrator-BPa6KaGC.css} +1 -1
  8. package/client/dist/assets/AvSyncCalibrator-oK6LlG61.js +10 -0
  9. package/client/dist/assets/Home-CQ4Ikeja.js +1 -0
  10. package/client/dist/assets/{Insights-ZlgPrzGD.js → Insights-DiAo0UAc.js} +1 -1
  11. package/client/dist/assets/{LibraryListPage-CCiee-Ot.js → LibraryListPage-B0MDTnEc.js} +1 -1
  12. package/client/dist/assets/{ListeningList-ctAz_6Zi.js → ListeningList-Dxkhy6E2.js} +1 -1
  13. package/client/dist/assets/{Manga-BI9WMTx5.js → Manga-pJEpcUpo.js} +1 -1
  14. package/client/dist/assets/{MangaInfoPage-DcrEr7Sk.js → MangaInfoPage-BEQsjTHH.js} +1 -1
  15. package/client/dist/assets/{MangaReadPage-SYg63m48.js → MangaReadPage-C0WAtK-1.js} +1 -1
  16. package/client/dist/assets/{MangaResetProgressModal-DX-1PS4h.js → MangaResetProgressModal-WjKH_G_f.js} +1 -1
  17. package/client/dist/assets/{Mature-Dqh_9SA3.js → Mature-Ckx99wFj.js} +1 -1
  18. package/client/dist/assets/{MediaCard-Be1ST9oj.js → MediaCard-DszKDA4s.js} +1 -1
  19. package/client/dist/assets/{Music-zsPwT8_5.js → Music-CU6TBHF5.js} +1 -1
  20. package/client/dist/assets/{OptionListMenu-Drc_vybW.js → OptionListMenu-CkK2BvEz.js} +1 -1
  21. package/client/dist/assets/Player-C3yWQkXb.js +56 -0
  22. package/client/dist/assets/{PlayerSettings-Cwoji-P7.js → PlayerSettings-CBdTzo0E.js} +1 -1
  23. package/client/dist/assets/{QueueOptionsButton-B6BMq66e.js → QueueOptionsButton-DKWi-9kd.js} +1 -1
  24. package/client/dist/assets/{QueueRail-VxpUDBSm.js → QueueRail-DAcIex5B.js} +1 -1
  25. package/client/dist/assets/{Radio-B2Q_Egj7.js → Radio-BhTsgGGd.js} +1 -1
  26. package/client/dist/assets/{ReadingList-O0QPwXu7.js → ReadingList-BLnkwB--.js} +1 -1
  27. package/client/dist/assets/{ResetProgressModal-CR_ovLAu.js → ResetProgressModal-8mcLXaAb.js} +1 -1
  28. package/client/dist/assets/{Search-C8e2nlDD.js → Search-DxX021dj.js} +1 -1
  29. package/client/dist/assets/{Settings-BgPWBl2V.js → Settings-bSA7BG7h.js} +1 -1
  30. package/client/dist/assets/{SkeletonGrid-CtHKKMLj.js → SkeletonGrid-Du10CNfq.js} +1 -1
  31. package/client/dist/assets/{Trackers-Bfoiyuzy.js → Trackers-BXSONaRD.js} +1 -1
  32. package/client/dist/assets/Tv-C2SWcVzN.css +1 -0
  33. package/client/dist/assets/Tv-DJTbg4VW.js +4 -0
  34. package/client/dist/assets/{TvInfo-D_scgw_h.js → TvInfo-Z0c1Wh3i.js} +1 -1
  35. package/client/dist/assets/{TvPopup-YTI7dEbJ.js → TvPopup-CP41CncZ.js} +1 -1
  36. package/client/dist/assets/{TvSearch-CxU33UOf.js → TvSearch-BlqTQYJa.js} +1 -1
  37. package/client/dist/assets/TvWatchlist-COCWPkgh.js +1 -0
  38. package/client/dist/assets/{Watchlist-P6YMZUdF.js → Watchlist-BHLshSPX.js} +1 -1
  39. package/client/dist/assets/{hls-C4cG9wQw.js → hls-B_yo8-yR.js} +1 -1
  40. package/client/dist/assets/index-lo-bz7f2.js +178 -0
  41. package/client/dist/assets/{useAnimeInfoData-DeuwDSnI.js → useAnimeInfoData-CbNnHRj8.js} +1 -1
  42. package/client/dist/assets/{useAsmr-CbMVRjmV.js → useAsmr-BEcgHwxg.js} +1 -1
  43. package/client/dist/assets/{useAsmrPopup-D91Q3CBg.js → useAsmrPopup-BXD3y2m1.js} +1 -1
  44. package/client/dist/assets/{useMangaLibrary-BPvFb1lU.js → useMangaLibrary-BXhgN-dl.js} +1 -1
  45. package/client/dist/assets/{useMangaPopup-BOL2mQJs.js → useMangaPopup-BvgtZ53s.js} +1 -1
  46. package/client/dist/assets/{useProviders-BsRGONMA.js → useProviders-xlftutIo.js} +1 -1
  47. package/client/dist/assets/{useTv-D37MfTHA.js → useTv-DTqrJEWp.js} +1 -1
  48. package/client/dist/assets/{useTvLibrary-Cwxgy_Bg.js → useTvLibrary-BHeWSd1F.js} +1 -1
  49. package/client/dist/index.html +1 -1
  50. package/package.json +2 -2
  51. package/server/dist/controllers/tv-library.controller.js +9 -5
  52. package/server/dist/repositories/tv.repository.js +10 -8
  53. package/server/dist/sync.js +19 -1
  54. package/server/package.json +1 -1
  55. package/client/dist/assets/AnimeCard-B5A20jAI.js +0 -1
  56. package/client/dist/assets/AvSyncCalibrator-C8ZoIwMY.js +0 -10
  57. package/client/dist/assets/Home-thJhPfs1.js +0 -1
  58. package/client/dist/assets/Player-BEtAYps2.js +0 -56
  59. package/client/dist/assets/Tv-Ca0fCdko.js +0 -3
  60. package/client/dist/assets/Tv-CuEl3Iol.css +0 -1
  61. package/client/dist/assets/TvWatchlist-B4X1fWEH.js +0 -1
  62. package/client/dist/assets/index-IZgh1beL.js +0 -178
@@ -1 +1 @@
1
- import{A as T,d as v,h as P,T as z,u as e,S as W,L as p}from"./vendor-core-8R2fFbyN.js";import{I as i}from"./vendor-icons-CDMuNDeL.js";import{f as B,d as D,c as L,t as M}from"./useTvLibrary-Cwxgy_Bg.js";import{p as s,a as S}from"./MediaCard-Be1ST9oj.js";const E=({item:a,anchorRect:m,onMouseEnter:u,onMouseLeave:g,onRequestClose:l})=>{const d=T(!1),[n,f]=v(null),[N,c]=v(!0),{toggle:y,bookmarkedIds:_}=B(),w=D(a.type,a.id),o=_.has(w);P(()=>{let t=!1;return c(!0),fetch(`/api/tv/details/${a.type}/${a.id}`).then(r=>{if(!r.ok)throw new Error("Failed");return r.json()}).then(r=>{t||(f({overview:r.overview,genres:r.genres,vote_average:r.vote_average,vote_count:r.vote_count,status:r.status,number_of_seasons:r.number_of_seasons,number_of_episodes:r.number_of_episodes}),c(!1))}).catch(()=>{t||c(!1)}),()=>{t=!0}},[a.id,a.type]);const h=z(()=>n?.genres?n.genres.slice(0,4).map(t=>t.name):[],[n?.genres]),I=L(a.type,a.id),b=M(a.type,a.id),k=t=>{t.preventDefault(),t.stopPropagation(),y({tmdbId:a.id,mediaType:a.type,title:a.title,poster:a.image,year:a.year})};return e(S,{anchorRect:m,onMouseEnter:()=>{d.current=!0,u()},onMouseLeave:()=>{d.current=!1,g()},onRequestClose:l,children:[e("div",{className:s.header,children:e("div",{className:s.title,children:a.title})}),e("div",{className:s.body,children:N?e("div",{className:s.loading,children:[e("div",{className:s.spinner}),e("span",{children:"Fetching details..."})]}):e(W,{children:[e("div",{className:s.metaRow,children:[n?.vote_average!=null&&n.vote_average>0&&e("div",{className:s.metaItem,children:[e(i,{name:"star",className:s.scoreIcon,size:14}),e("span",{children:Number(n.vote_average).toFixed(1)})]}),e("div",{className:s.metaItem,children:[e(i,{name:"tv",size:14}),e("span",{children:a.type==="tv"?"TV Show":"Movie"})]}),a.year&&e("div",{className:s.metaItem,children:e("span",{children:a.year})}),n?.status&&e("div",{className:s.metaItem,children:e("span",{children:n.status})})]}),h.length>0&&e("div",{className:s.genres,children:h.map(t=>e("span",{className:s.genre,children:t},t))}),n?.overview&&e("div",{className:s.synopsis,children:n.overview.length>200?n.overview.slice(0,200)+"...":n.overview})]})}),e("div",{className:s.footer,children:[e("div",{className:s.primaryAction,children:e(p,{to:b,className:s.watchBtn,onClick:l,children:[e(i,{name:"play",size:14}),"Watch now"]})}),e("div",{className:s.secondaryActions,children:[e("button",{className:`${s.watchlistBtn} ${o?s.active:""}`,onClick:k,children:[o?e(i,{name:"check",size:12}):e(i,{name:"plus",size:12}),e("span",{children:o?"Remove":"Watchlist"})]}),e(p,{to:I,className:s.detailsBtn,onClick:l,children:[e(i,{name:"info-circle",size:12}),e("span",{children:"Details"})]})]})]})]})};export{E as T};
1
+ import{A as T,d as v,h as P,T as z,u as e,S as W,L as p}from"./vendor-core-8R2fFbyN.js";import{I as i}from"./vendor-icons-CDMuNDeL.js";import{f as B,d as D,c as L,t as M}from"./useTvLibrary-BHeWSd1F.js";import{p as s,a as S}from"./MediaCard-DszKDA4s.js";const E=({item:a,anchorRect:m,onMouseEnter:u,onMouseLeave:g,onRequestClose:l})=>{const d=T(!1),[n,f]=v(null),[N,c]=v(!0),{toggle:y,bookmarkedIds:_}=B(),w=D(a.type,a.id),o=_.has(w);P(()=>{let t=!1;return c(!0),fetch(`/api/tv/details/${a.type}/${a.id}`).then(r=>{if(!r.ok)throw new Error("Failed");return r.json()}).then(r=>{t||(f({overview:r.overview,genres:r.genres,vote_average:r.vote_average,vote_count:r.vote_count,status:r.status,number_of_seasons:r.number_of_seasons,number_of_episodes:r.number_of_episodes}),c(!1))}).catch(()=>{t||c(!1)}),()=>{t=!0}},[a.id,a.type]);const h=z(()=>n?.genres?n.genres.slice(0,4).map(t=>t.name):[],[n?.genres]),I=L(a.type,a.id),b=M(a.type,a.id),k=t=>{t.preventDefault(),t.stopPropagation(),y({tmdbId:a.id,mediaType:a.type,title:a.title,poster:a.image,year:a.year})};return e(S,{anchorRect:m,onMouseEnter:()=>{d.current=!0,u()},onMouseLeave:()=>{d.current=!1,g()},onRequestClose:l,children:[e("div",{className:s.header,children:e("div",{className:s.title,children:a.title})}),e("div",{className:s.body,children:N?e("div",{className:s.loading,children:[e("div",{className:s.spinner}),e("span",{children:"Fetching details..."})]}):e(W,{children:[e("div",{className:s.metaRow,children:[n?.vote_average!=null&&n.vote_average>0&&e("div",{className:s.metaItem,children:[e(i,{name:"star",className:s.scoreIcon,size:14}),e("span",{children:Number(n.vote_average).toFixed(1)})]}),e("div",{className:s.metaItem,children:[e(i,{name:"tv",size:14}),e("span",{children:a.type==="tv"?"TV Show":"Movie"})]}),a.year&&e("div",{className:s.metaItem,children:e("span",{children:a.year})}),n?.status&&e("div",{className:s.metaItem,children:e("span",{children:n.status})})]}),h.length>0&&e("div",{className:s.genres,children:h.map(t=>e("span",{className:s.genre,children:t},t))}),n?.overview&&e("div",{className:s.synopsis,children:n.overview.length>200?n.overview.slice(0,200)+"...":n.overview})]})}),e("div",{className:s.footer,children:[e("div",{className:s.primaryAction,children:e(p,{to:b,className:s.watchBtn,onClick:l,children:[e(i,{name:"play",size:14}),"Watch now"]})}),e("div",{className:s.secondaryActions,children:[e("button",{className:`${s.watchlistBtn} ${o?s.active:""}`,onClick:k,children:[o?e(i,{name:"check",size:12}):e(i,{name:"plus",size:12}),e("span",{children:o?"Remove":"Watchlist"})]}),e(p,{to:I,className:s.detailsBtn,onClick:l,children:[e(i,{name:"info-circle",size:12}),e("span",{children:"Details"})]})]})]})]})};export{E as T};
@@ -1 +1 @@
1
- import{h as D,o as ae,A as te,d as c,T as I,q as A,u as a}from"./vendor-core-8R2fFbyN.js";import{I as d}from"./vendor-icons-CDMuNDeL.js";import{a as ne,T as re}from"./useTv-D37MfTHA.js";import{S as se}from"./SkeletonGrid-CtHKKMLj.js";import{u as le,Q as ie,B as _}from"./index-IZgh1beL.js";import{E as oe}from"./ErrorMessage-z4f4WGgP.js";import{s as t}from"./Search.module-CMEai-B-.js";import"./MediaCard-Be1ST9oj.js";import"./vendor-ui-CUDCvRS_.js";import"./useIsMobile-Dm_b6Ob3.js";import"./TvPopup-YTI7dEbJ.js";import"./useTvLibrary-Cwxgy_Bg.js";import"./vendor-query-BXRECSI6.js";const ce=[{value:"multi",label:"All"},{value:"tv",label:"TV Shows"},{value:"movie",label:"Movies"}],de=[{value:"popularity.desc",label:"Popularity"},{value:"vote_average.desc",label:"Top Rated"},{value:"primary_release_date.desc",label:"Newest"},{value:"primary_release_date.asc",label:"Oldest"},{value:"vote_count.desc",label:"Most Voted"}],V={10759:"Action & Adventure",16:"Animation",35:"Comedy",80:"Crime",99:"Documentary",18:"Drama",10751:"Family",10762:"Kids",9648:"Mystery",10765:"Sci-Fi & Fantasy",37:"Western"},W={28:"Action",12:"Adventure",16:"Animation",35:"Comedy",80:"Crime",99:"Documentary",18:"Drama",10751:"Family",14:"Fantasy",36:"History",27:"Horror",9648:"Mystery",10749:"Romance",878:"Sci-Fi",53:"Thriller",10752:"War",37:"Western"},M=new Date().getFullYear(),me=[{value:"ALL",label:"All Years"},...Array.from({length:M-1980+1},(i,h)=>({value:String(M-h),label:String(M-h)}))];function Ae(){D(()=>{document.title="Search TV & Movies - dango"},[]);const[i,h]=ae(),{lowEndMode:Y}=le(),k=te(null),[v,Q]=c(i.get("q")||""),[g,H]=c(i.get("q")||""),[s,y]=c(parseInt(i.get("page")||"1",10)||1),[o,K]=c(i.get("type")||"multi"),[x,O]=c(i.get("genre")||""),[f,$]=c(i.get("year")||"ALL"),[b,F]=c(i.get("sort_by")||"popularity.desc"),[N,U]=c(!1),[m,S]=c(()=>{const e={},n=i.get("genre")||"";return n&&(e[n]="include"),e}),P=I(()=>{if(o==="tv")return Object.entries(V).map(([n,r])=>({id:n,name:r}));if(o==="movie")return Object.entries(W).map(([n,r])=>({id:n,name:r}));const e=new Map;for(const[n,r]of Object.entries(V))e.set(n,r);for(const[n,r]of Object.entries(W))e.set(n,r);return Array.from(e.entries()).map(([n,r])=>({id:n,name:r}))},[o]),w=I(()=>Object.entries(m).filter(([,n])=>n==="include").map(([n])=>n).join(","),[m]),{data:B,isLoading:p,isError:J,error:X}=ne({query:g,type:o,genre:w,year:f,sort_by:b,page:s}),T=B?.results||[],Z=B?.total_pages||0,E=B?.total_results||0,R=s<Math.min(Z,500),u=A((e={})=>{const n=new URLSearchParams,r=e.q!==void 0?e.q:g,l=e.type!==void 0?e.type:o,j=e.year!==void 0?e.year:f,q=e.sort!==void 0?e.sort:b,z=e.page!==void 0?e.page:String(s),G=e.genre!==void 0?e.genre:w;r.trim()&&n.set("q",r.trim()),l!=="multi"&&n.set("type",l),G&&n.set("genre",G),j!=="ALL"&&n.set("year",j),q!=="popularity.desc"&&n.set("sort_by",q),z!=="1"&&n.set("page",z),h(n,{replace:!0})},[g,o,f,b,s,w,h]),L=A(()=>{ie(),y(1),H(v),u({q:v,page:"1"}),window.scrollTo({top:0,behavior:"smooth"})},[v,u]),C=A(e=>{if(y(e),u({page:String(e)}),k.current){const n=k.current.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:n,behavior:"smooth"})}},[u]),ee=A(e=>{S(n=>{const r=n[e],l={...n};return r==="include"?l[e]="exclude":r==="exclude"?delete l[e]:l[e]="include",l}),y(1)},[]);return D(()=>{const n=Object.entries(m).filter(([,r])=>r==="include").map(([r])=>r).join(",");n!==x&&(O(n),u({genre:n,page:"1"}))},[m,x,O,u]),a("div",{className:"page-container",children:[a("div",{className:t.header,children:[a("h1",{className:t.pageTitle,children:"Search TV & Movies"}),a("p",{className:t.pageSubtitle,children:"Discover trending shows, movies, and more powered by TMDB"})]}),a("div",{className:t.filterContainer,children:[a("div",{className:t.searchBarWrapper,children:[a("div",{className:t.inputIconWrapper,children:[a(d,{name:"search",className:t.searchIcon}),a("input",{type:"text","data-virtual-keyboard":"true",className:t.searchInput,placeholder:"Search titles...",value:v,onInput:e=>Q(e.currentTarget.value),onKeyDown:e=>e.key==="Enter"&&L()})]}),a("div",{className:t.searchActions,children:[a("select",{value:o,onChange:e=>{K(e.target.value),S({})},className:t.providerSelect,"aria-label":"Media type",children:ce.map(e=>a("option",{value:e.value,children:e.label},e.value))}),a(_,{onClick:L,className:t.searchBtn,children:"Search"}),a("button",{className:`${t.filterToggleBtn} ${N?t.active:""}`,onClick:()=>U(!N),children:[a(d,{name:"filter",size:14}),a("span",{children:"Filters"}),N?a(d,{name:"chevron-up",size:12}):a(d,{name:"chevron-down",size:12})]})]})]}),a("div",{className:`${t.advancedFilters} ${N?t.show:""}`,children:[a("div",{className:t.filterDivider}),a("div",{className:t.filterGrid,children:[a("div",{className:t.filterItem,children:[a("label",{children:"Sort By"}),a("select",{value:b,onChange:e=>F(e.currentTarget.value),children:de.map(e=>a("option",{value:e.value,children:e.label},e.value))})]}),a("div",{className:t.filterItem,children:[a("label",{children:"Year"}),a("select",{value:f,onChange:e=>$(e.currentTarget.value),children:me.map(e=>a("option",{value:e.value,children:e.label},e.value))})]})]}),P.length>0&&a("div",{className:t.genreSection,children:[a("label",{className:t.genreLabel,children:"Genres"}),a("div",{className:t.genreContainer,children:P.map(e=>a("button",{className:`${t.genreButton} ${t[m[e.id]||""]}`,onClick:()=>ee(e.id),children:e.name},e.id))})]}),a("div",{className:t.filterActions,children:[a(_,{variant:"secondary",onClick:()=>{S({}),$("ALL"),F("popularity.desc"),y(1),u({genre:"",year:"ALL",sort:"popularity.desc",page:"1"})},children:"Reset All"}),a(_,{onClick:L,className:t.searchBtn,children:"Apply Filters"})]})]})]}),J&&a(oe,{message:X?.message||"Search failed"}),Object.keys(m).length>0&&a("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginBottom:"1.5rem"},children:[a("span",{style:{fontSize:"0.8rem",color:"var(--text-muted)",fontWeight:600},children:"Active Filters:"}),Object.entries(m).map(([e,n])=>{const r=P.find(l=>l.id===e)?.name||e;return a("span",{className:`badge ${n==="include"?"badge-primary":"badge-danger"}`,style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[n==="include"?`+ ${r}`:`- ${r}`,a("button",{onClick:()=>{const l={...m};delete l[e],S(l)},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]},e)})]}),a("div",{className:t.resultsHeader,ref:k,children:[a("h2",{className:t.resultsTitle,children:[g?`Results for "${g}"`:w?"Browsing genres":o==="tv"?"Popular TV Shows":o==="movie"?"Popular Movies":"Trending",E>0&&a("span",{style:{fontWeight:400,color:"var(--text-tertiary)",fontSize:"0.85em",marginLeft:"0.5em"},children:["(",E.toLocaleString(),")"]})]}),T.length>0&&a("div",{className:t.pagination,children:[a("button",{className:t.pageBtn,onClick:()=>C(s-1),disabled:s===1||p,"aria-label":"Previous page",children:a(d,{name:"chevron-left",size:14})}),a("span",{className:t.pageInfo,children:["Page ",a("strong",{children:s})]}),a("button",{className:t.pageBtn,onClick:()=>C(s+1),disabled:!R||p,"aria-label":"Next page",children:a(d,{name:"chevron-right",size:14})})]})]}),a("div",{className:`${t.resultsGrid} ${Y?t.lowEnd:""}`,children:p?a(se,{}):T.map(e=>a(re,{item:{id:e.id,title:e.title,year:e.year,type:e.type,image:e.image,vote_average:e.vote_average,adult:e.adult}},`${e.type}-${e.id}`))}),!p&&T.length===0&&a("div",{className:t.noResults,children:[a(d,{name:"search",size:48,className:t.noResultsIcon}),a("h3",{children:"No results found"}),a("p",{children:"Try adjusting your search or filters to find what you're looking for."})]}),T.length>0&&a("div",{className:t.bottomPagination,children:a("div",{className:t.pagination,children:[a("button",{className:t.pageBtn,onClick:()=>C(s-1),disabled:s===1||p,children:[a(d,{name:"chevron-left",size:14}),a("span",{children:"Previous"})]}),a("span",{className:t.pageInfo,children:["Page ",a("strong",{children:s})]}),a("button",{className:t.pageBtn,onClick:()=>C(s+1),disabled:!R||p,children:[a("span",{children:"Next"}),a(d,{name:"chevron-right",size:14})]})]})})]})}export{Ae as default};
1
+ import{h as D,o as ae,A as te,d as c,T as I,q as A,u as a}from"./vendor-core-8R2fFbyN.js";import{I as d}from"./vendor-icons-CDMuNDeL.js";import{a as ne,T as re}from"./useTv-DTqrJEWp.js";import{S as se}from"./SkeletonGrid-Du10CNfq.js";import{u as le,Q as ie,B as _}from"./index-lo-bz7f2.js";import{E as oe}from"./ErrorMessage-z4f4WGgP.js";import{s as t}from"./Search.module-CMEai-B-.js";import"./MediaCard-DszKDA4s.js";import"./vendor-ui-CUDCvRS_.js";import"./useIsMobile-Dm_b6Ob3.js";import"./TvPopup-CP41CncZ.js";import"./useTvLibrary-BHeWSd1F.js";import"./vendor-query-BXRECSI6.js";const ce=[{value:"multi",label:"All"},{value:"tv",label:"TV Shows"},{value:"movie",label:"Movies"}],de=[{value:"popularity.desc",label:"Popularity"},{value:"vote_average.desc",label:"Top Rated"},{value:"primary_release_date.desc",label:"Newest"},{value:"primary_release_date.asc",label:"Oldest"},{value:"vote_count.desc",label:"Most Voted"}],V={10759:"Action & Adventure",16:"Animation",35:"Comedy",80:"Crime",99:"Documentary",18:"Drama",10751:"Family",10762:"Kids",9648:"Mystery",10765:"Sci-Fi & Fantasy",37:"Western"},W={28:"Action",12:"Adventure",16:"Animation",35:"Comedy",80:"Crime",99:"Documentary",18:"Drama",10751:"Family",14:"Fantasy",36:"History",27:"Horror",9648:"Mystery",10749:"Romance",878:"Sci-Fi",53:"Thriller",10752:"War",37:"Western"},M=new Date().getFullYear(),me=[{value:"ALL",label:"All Years"},...Array.from({length:M-1980+1},(i,h)=>({value:String(M-h),label:String(M-h)}))];function Ae(){D(()=>{document.title="Search TV & Movies - dango"},[]);const[i,h]=ae(),{lowEndMode:Y}=le(),k=te(null),[v,Q]=c(i.get("q")||""),[g,H]=c(i.get("q")||""),[s,y]=c(parseInt(i.get("page")||"1",10)||1),[o,K]=c(i.get("type")||"multi"),[x,O]=c(i.get("genre")||""),[f,$]=c(i.get("year")||"ALL"),[b,F]=c(i.get("sort_by")||"popularity.desc"),[N,U]=c(!1),[m,S]=c(()=>{const e={},n=i.get("genre")||"";return n&&(e[n]="include"),e}),P=I(()=>{if(o==="tv")return Object.entries(V).map(([n,r])=>({id:n,name:r}));if(o==="movie")return Object.entries(W).map(([n,r])=>({id:n,name:r}));const e=new Map;for(const[n,r]of Object.entries(V))e.set(n,r);for(const[n,r]of Object.entries(W))e.set(n,r);return Array.from(e.entries()).map(([n,r])=>({id:n,name:r}))},[o]),w=I(()=>Object.entries(m).filter(([,n])=>n==="include").map(([n])=>n).join(","),[m]),{data:B,isLoading:p,isError:J,error:X}=ne({query:g,type:o,genre:w,year:f,sort_by:b,page:s}),T=B?.results||[],Z=B?.total_pages||0,E=B?.total_results||0,R=s<Math.min(Z,500),u=A((e={})=>{const n=new URLSearchParams,r=e.q!==void 0?e.q:g,l=e.type!==void 0?e.type:o,j=e.year!==void 0?e.year:f,q=e.sort!==void 0?e.sort:b,z=e.page!==void 0?e.page:String(s),G=e.genre!==void 0?e.genre:w;r.trim()&&n.set("q",r.trim()),l!=="multi"&&n.set("type",l),G&&n.set("genre",G),j!=="ALL"&&n.set("year",j),q!=="popularity.desc"&&n.set("sort_by",q),z!=="1"&&n.set("page",z),h(n,{replace:!0})},[g,o,f,b,s,w,h]),L=A(()=>{ie(),y(1),H(v),u({q:v,page:"1"}),window.scrollTo({top:0,behavior:"smooth"})},[v,u]),C=A(e=>{if(y(e),u({page:String(e)}),k.current){const n=k.current.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:n,behavior:"smooth"})}},[u]),ee=A(e=>{S(n=>{const r=n[e],l={...n};return r==="include"?l[e]="exclude":r==="exclude"?delete l[e]:l[e]="include",l}),y(1)},[]);return D(()=>{const n=Object.entries(m).filter(([,r])=>r==="include").map(([r])=>r).join(",");n!==x&&(O(n),u({genre:n,page:"1"}))},[m,x,O,u]),a("div",{className:"page-container",children:[a("div",{className:t.header,children:[a("h1",{className:t.pageTitle,children:"Search TV & Movies"}),a("p",{className:t.pageSubtitle,children:"Discover trending shows, movies, and more powered by TMDB"})]}),a("div",{className:t.filterContainer,children:[a("div",{className:t.searchBarWrapper,children:[a("div",{className:t.inputIconWrapper,children:[a(d,{name:"search",className:t.searchIcon}),a("input",{type:"text","data-virtual-keyboard":"true",className:t.searchInput,placeholder:"Search titles...",value:v,onInput:e=>Q(e.currentTarget.value),onKeyDown:e=>e.key==="Enter"&&L()})]}),a("div",{className:t.searchActions,children:[a("select",{value:o,onChange:e=>{K(e.target.value),S({})},className:t.providerSelect,"aria-label":"Media type",children:ce.map(e=>a("option",{value:e.value,children:e.label},e.value))}),a(_,{onClick:L,className:t.searchBtn,children:"Search"}),a("button",{className:`${t.filterToggleBtn} ${N?t.active:""}`,onClick:()=>U(!N),children:[a(d,{name:"filter",size:14}),a("span",{children:"Filters"}),N?a(d,{name:"chevron-up",size:12}):a(d,{name:"chevron-down",size:12})]})]})]}),a("div",{className:`${t.advancedFilters} ${N?t.show:""}`,children:[a("div",{className:t.filterDivider}),a("div",{className:t.filterGrid,children:[a("div",{className:t.filterItem,children:[a("label",{children:"Sort By"}),a("select",{value:b,onChange:e=>F(e.currentTarget.value),children:de.map(e=>a("option",{value:e.value,children:e.label},e.value))})]}),a("div",{className:t.filterItem,children:[a("label",{children:"Year"}),a("select",{value:f,onChange:e=>$(e.currentTarget.value),children:me.map(e=>a("option",{value:e.value,children:e.label},e.value))})]})]}),P.length>0&&a("div",{className:t.genreSection,children:[a("label",{className:t.genreLabel,children:"Genres"}),a("div",{className:t.genreContainer,children:P.map(e=>a("button",{className:`${t.genreButton} ${t[m[e.id]||""]}`,onClick:()=>ee(e.id),children:e.name},e.id))})]}),a("div",{className:t.filterActions,children:[a(_,{variant:"secondary",onClick:()=>{S({}),$("ALL"),F("popularity.desc"),y(1),u({genre:"",year:"ALL",sort:"popularity.desc",page:"1"})},children:"Reset All"}),a(_,{onClick:L,className:t.searchBtn,children:"Apply Filters"})]})]})]}),J&&a(oe,{message:X?.message||"Search failed"}),Object.keys(m).length>0&&a("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginBottom:"1.5rem"},children:[a("span",{style:{fontSize:"0.8rem",color:"var(--text-muted)",fontWeight:600},children:"Active Filters:"}),Object.entries(m).map(([e,n])=>{const r=P.find(l=>l.id===e)?.name||e;return a("span",{className:`badge ${n==="include"?"badge-primary":"badge-danger"}`,style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[n==="include"?`+ ${r}`:`- ${r}`,a("button",{onClick:()=>{const l={...m};delete l[e],S(l)},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]},e)})]}),a("div",{className:t.resultsHeader,ref:k,children:[a("h2",{className:t.resultsTitle,children:[g?`Results for "${g}"`:w?"Browsing genres":o==="tv"?"Popular TV Shows":o==="movie"?"Popular Movies":"Trending",E>0&&a("span",{style:{fontWeight:400,color:"var(--text-tertiary)",fontSize:"0.85em",marginLeft:"0.5em"},children:["(",E.toLocaleString(),")"]})]}),T.length>0&&a("div",{className:t.pagination,children:[a("button",{className:t.pageBtn,onClick:()=>C(s-1),disabled:s===1||p,"aria-label":"Previous page",children:a(d,{name:"chevron-left",size:14})}),a("span",{className:t.pageInfo,children:["Page ",a("strong",{children:s})]}),a("button",{className:t.pageBtn,onClick:()=>C(s+1),disabled:!R||p,"aria-label":"Next page",children:a(d,{name:"chevron-right",size:14})})]})]}),a("div",{className:`${t.resultsGrid} ${Y?t.lowEnd:""}`,children:p?a(se,{}):T.map(e=>a(re,{item:{id:e.id,title:e.title,year:e.year,type:e.type,image:e.image,vote_average:e.vote_average,adult:e.adult}},`${e.type}-${e.id}`))}),!p&&T.length===0&&a("div",{className:t.noResults,children:[a(d,{name:"search",size:48,className:t.noResultsIcon}),a("h3",{children:"No results found"}),a("p",{children:"Try adjusting your search or filters to find what you're looking for."})]}),T.length>0&&a("div",{className:t.bottomPagination,children:a("div",{className:t.pagination,children:[a("button",{className:t.pageBtn,onClick:()=>C(s-1),disabled:s===1||p,children:[a(d,{name:"chevron-left",size:14}),a("span",{children:"Previous"})]}),a("span",{className:t.pageInfo,children:["Page ",a("strong",{children:s})]}),a("button",{className:t.pageBtn,onClick:()=>C(s+1),disabled:!R||p,children:[a("span",{children:"Next"}),a(d,{name:"chevron-right",size:14})]})]})})]})}export{Ae as default};
@@ -0,0 +1 @@
1
+ import{n as U,d as v,h as y,T as x,u as l}from"./vendor-core-8R2fFbyN.js";import{M as N}from"./MediaCard-DszKDA4s.js";import{L as _}from"./LibraryListPage-B0MDTnEc.js";import{R as K}from"./ResetProgressModal-8mcLXaAb.js";import{T as O}from"./TvPopup-CP41CncZ.js";import{e as u}from"./index-lo-bz7f2.js";import{l as Q,u as Y,a as q,b as z,h as G,m as Z,o as j,p as D,t as S,i as I,T as k}from"./useTvLibrary-BHeWSd1F.js";import"./vendor-ui-CUDCvRS_.js";import"./vendor-icons-CDMuNDeL.js";import"./useIsMobile-Dm_b6Ob3.js";import"./SkeletonGrid-Du10CNfq.js";import"./ErrorMessage-z4f4WGgP.js";import"./Watchlist.module-XGtVQr1d.js";import"./vendor-query-BXRECSI6.js";const H=["All","Continue Watching",...k],P=24;function ce(){const{filter:d="All"}=U(),[T,g]=v(1),[s,p]=v(null),[h,c]=v(!1);y(()=>{document.title="TV Watchlist - dango"},[]),y(()=>{g(1)},[d]);const o=d==="Continue Watching",r=Q(o?"All":d,T,P),i=Y(100),b=q(),w=z(),C=G(),W=Z(),B=j(),E=D(),M=x(()=>o?(i.data?.data??[]).map(e=>{const a=e.currentTime??0,t=e.duration??0,f=e.season??e.lastSeason??1,R=e.episode??e.lastEpisode??1,n=e.mediaType==="movie",m=n?"Movie":`S${f} E${R}`,L=e.completed===!0||e.completed===1||t>0&&a>=t*.8;return{key:e.id,libId:e.id,tmdbId:e.tmdbId,mediaType:e.mediaType,title:e.title,poster:e.poster||"",year:e.year,adult:I({adult:e.adult===1}),status:e.status,badge:m,progressPercent:L?100:t>0?a/t*100:0,progressLabel:t>0?L?"Watched":n?`${u(a)} / ${u(t)}`:`${m} · ${u(a)} / ${u(t)}`:m,watchTarget:S(e.mediaType,e.tmdbId,n?void 0:f,n?void 0:R)}}):(r.data?.data??[]).map(e=>({key:e.id,libId:e.id,tmdbId:e.tmdbId,mediaType:e.mediaType,title:e.title,poster:e.poster||"",year:e.year,adult:I({adult:e.adult===1}),status:e.status,badge:e.lastSeason&&e.lastEpisode?`S${e.lastSeason} E${e.lastEpisode}`:void 0,progressPercent:void 0,progressLabel:void 0,watchTarget:S(e.mediaType,e.tmdbId,e.lastSeason??void 0,e.lastEpisode??void 0)})),[o,i.data,r.data]),A=o?i.data?.total??0:r.data?.total??0,V=o?i.isLoading:r.isLoading,$=o?i.error:r.error,F=()=>{s&&(w.mutate({mediaId:s.libId}),h&&b.mutate(s.libId),p(null),c(!1))};return l(_,{headerTitle:"My TV Watchlist",headerSubtitle:"Track and manage your movies and shows",filters:H,filterBy:d,filterBasePath:"/tv-watchlist",continueFilter:"Continue Watching",statusOptions:[...k],entries:M,total:A,isLoading:V,error:$,page:T,pageSize:P,onPageChange:g,emptyTitle:"Your TV watchlist is looking a bit empty",emptyFilteredText:"No titles match this filter.",emptyAllText:"Let's find something to watch!",browseLabel:"Browse TV & Movies",browseTarget:"/tv",removeListLabel:"Remove from TV Watchlist",listNoun:"TV watchlist",skipConfirmKey:"tvSkipRemoveConfirmation",onBulkStatus:(e,a)=>W.mutate({ids:e,status:a}),onBulkRemove:e=>{o?E.mutate(e):B.mutate(e)},onStatusChange:(e,a)=>C.mutate({id:e,status:a}),onRemoveItem:e=>b.mutate(e),renderCard:e=>l(N,{item:{id:e.libId,title:e.title,thumbnail:e.poster,typeBadge:e.mediaType==="movie"?"Movie":"TV",chapterBadge:e.badge??null,isAdult:e.adult},linkTo:e.watchTarget,hoverIcon:"play",progress:e.progressPercent!==void 0&&e.progressLabel?{percent:e.progressPercent,label:e.progressLabel}:void 0,showProgress:o,metaRow:e.year?l("span",{style:{opacity:.75},children:e.year}):void 0,onRemove:o?()=>p(e):void 0,renderPopup:(a,t)=>l(O,{item:{id:e.tmdbId??0,title:e.title||"",year:e.year||"",type:e.mediaType||"tv",image:e.poster||""},anchorRect:a,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onRequestClose:t.close})}),modals:l(K,{isOpen:!!s,itemName:s?.title,progressKind:"watch",listLabel:"my TV watchlist",alsoRemove:h,onAlsoRemoveChange:c,onClose:()=>{p(null),c(!1)},onConfirm:F})})}export{ce as default};
@@ -1 +1 @@
1
- import{h as he,n as je,a as qe,o as Ke,d as u,A as pe,T as j,u as t,S as Ve}from"./vendor-core-8R2fFbyN.js";import{u as Qe,a as ge}from"./vendor-query-BXRECSI6.js";import{u as He,d as Je,r as Ze,t as ve,v as fe,z as Xe,q as ye,i as et,w as tt,x as at,y as nt,A as st,C as lt,B,M as ae}from"./index-IZgh1beL.js";import{I as h}from"./vendor-icons-CDMuNDeL.js";import{A as rt}from"./AnimeCard-B5A20jAI.js";import{S as it}from"./SkeletonGrid-CtHKKMLj.js";import{E as ct}from"./ErrorMessage-z4f4WGgP.js";import{s as a}from"./Watchlist.module-XGtVQr1d.js";import"./useAnimeInfoData-DeuwDSnI.js";import"./QueueOptionsButton-B6BMq66e.js";import"./vendor-ui-CUDCvRS_.js";import"./MediaCard-Be1ST9oj.js";import"./useIsMobile-Dm_b6Ob3.js";const ot=(d,v)=>{const l=new URLSearchParams(v);return l.delete("page"),l.sort(),`${d}|${l.toString()}`},dt=(d,v)=>{const l=new Set(d);return v.forEach(A=>l.add(A)),l},mt=(d,v)=>{const l=new Set(d);return v.forEach(A=>l.delete(A)),l},Se=["All","Continue Watching","Watching","Completed","On-Hold","Dropped","Planned"],be=Se.slice(2),ut=[{value:"ALL",label:"All Types"},{value:"TV",label:"TV Series"},{value:"Movie",label:"Movie"},{value:"OVA",label:"OVA"},{value:"ONA",label:"ONA"},{value:"TV_SHORT",label:"TV Short"},{value:"SPECIAL",label:"Special"},{value:"ADULT",label:"Adult (18+)"}],ht=[{value:"ALL",label:"All Seasons"},{value:"WINTER",label:"Winter"},{value:"SPRING",label:"Spring"},{value:"SUMMER",label:"Summer"},{value:"FALL",label:"Fall"}],xt=()=>{he(()=>{document.title="Watchlist - dango"},[]);const{filter:d="All"}=je(),v=qe(),[l,A]=Ke(),ne=Qe(),[m,R]=u(parseInt(l.get("page")||"1")),[f,T]=u(l.get("query")||""),[C,q]=u(l.get("sortBy")||"last_added"),[y,P]=u(l.get("type")||"ALL"),[b,W]=u(l.get("season")||"ALL"),[S,I]=u(l.get("year")||"ALL"),[k,$]=u(()=>{const e={},n=l.get("genres")?.split(",").map(r=>r.trim()).filter(Boolean)||[],s=l.get("excludeGenres")?.split(",").map(r=>r.trim()).filter(Boolean)||[];return n.forEach(r=>r&&(e[r]="include")),s.forEach(r=>r&&(e[r]="exclude")),e}),[O,Ne]=u(()=>["type","season","year","genres","excludeGenres"].some(e=>l.has(e))),{lowEndMode:Le}=He(),{titlePreference:F}=Je(),{data:Ae}=Ze(),se=Ae?.genres||[],K=pe(null),[c,w]=u(null),[V,z]=u(!1),[le,D]=u(!1),[M,Ce]=u(!1),[g,N]=u(new Set),Q=pe(null),i=d==="Continue Watching",E=j(()=>{const e=new URLSearchParams(l);return e.delete("page"),e.set("titlePreference",F),e.toString()},[l,F]),{data:G,isLoading:ke,error:we}=ve(E,m,14),{data:_,isLoading:xe,error:Be}=fe(d,E,m,14),{data:Re}=ve(E,m+1,14),{data:Te}=fe(d,E,m+1,14),H=j(()=>(i?G?.data:_?.data)||[],[i,G,_]),J=j(()=>(i?G?.total:_?.total)||0,[i,G,_]),x=i?ke:xe,re=i?we:Be,ie=i?Re:Te;he(()=>{T(l.get("query")||""),q(l.get("sortBy")||"last_added"),P(l.get("type")||"ALL"),W(l.get("season")||"ALL"),I(l.get("year")||"ALL");const e={},n=l.get("genres")?.split(",").map(o=>o.trim()).filter(Boolean)||[],s=l.get("excludeGenres")?.split(",").map(o=>o.trim()).filter(Boolean)||[];n.forEach(o=>o&&(e[o]="include")),s.forEach(o=>o&&(e[o]="exclude")),$(e),R(parseInt(l.get("page")||"1"));const r=ot(d,l);Q.current!==null&&Q.current!==r&&N(new Set),Q.current=r},[l,d]);const Pe=ge({mutationFn:async({id:e,status:n})=>{await ye("/api/watchlist/status",{method:"POST",body:JSON.stringify({id:e,status:n})})},onSuccess:()=>{ne.invalidateQueries({queryKey:["watchlist"]}),Xe.success("Status updated")}}),We=ge({mutationFn:async e=>{await ye("/api/continue-watching/remove",{method:"POST",body:JSON.stringify({showId:e})})},onSuccess:()=>ne.invalidateQueries({queryKey:["allContinueWatching"]})}),Z=et(),{data:ce}=tt("skipRemoveConfirmation"),Ie=at(),X=j(()=>{const e=n=>n[F]||n.name||"";return[...H].sort((n,s)=>C==="name_asc"?e(n).localeCompare(e(s)):C==="name_desc"?e(s).localeCompare(e(n)):0)},[H,C,F]),ee=new Date().getFullYear(),$e=[{value:"ALL",label:"All Years"},...Array.from({length:ee-1980+1},(e,n)=>({value:String(ee-n),label:String(ee-n)}))],p=(e=C,n=1)=>{const s=new URLSearchParams;f.trim()&&s.set("query",f.trim()),e!=="last_added"&&s.set("sortBy",e),y!=="ALL"&&s.set("type",y),b!=="ALL"&&s.set("season",b),S!=="ALL"&&s.set("year",S);const r=Object.entries(k).filter(([,L])=>L==="include").map(([L])=>L),o=Object.entries(k).filter(([,L])=>L==="exclude").map(([L])=>L);r.length>0&&s.set("genres",r.join(",")),o.length>0&&s.set("excludeGenres",o.join(",")),n>1&&s.set("page",n.toString()),A(s),n!==m&&R(n)},U=e=>{if(p(C,e),K.current){const n=K.current.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:n,behavior:"smooth"})}},Oe=()=>{T(""),q("last_added"),P("ALL"),W("ALL"),I("ALL"),$({}),A(new URLSearchParams),R(1)},Fe=e=>{$(n=>{const s=n[e],r={...n};return s==="include"?r[e]="exclude":s==="exclude"?delete r[e]:r[e]="include",r})},oe=(e,n)=>{if(i){w({id:e,name:n});return}String(ce)==="true"||String(ce)==="1"?Z.mutate(e):w({id:e,name:n})},ze=()=>{if(c){if(c.ids){i?(De.mutate(c.ids),V&&me.mutate(c.ids)):me.mutate(c.ids),N(new Set),w(null),z(!1),D(!1);return}i?(We.mutate(c.id),V&&Z.mutate(c.id)):Z.mutate(c.id),le&&Ie.mutate({key:"skipRemoveConfirmation",value:!0}),w(null),z(!1),D(!1)}},de=()=>{w(null),z(!1),D(!1)},me=nt(),De=st(),Me=lt(),Ee=()=>{Ce(e=>{const n=!e;return n||N(new Set),n})},Ge=e=>{N(n=>{const s=new Set(n);return s.has(e)?s.delete(e):s.add(e),s})},Y=X.map(e=>e.id),te=Y.length>0&&Y.every(e=>g.has(e)),_e=()=>{N(te?e=>mt(e,Y):e=>dt(e,Y))},Ue=e=>{g.size!==0&&(Me.mutate({ids:[...g],status:e}),N(new Set))},Ye=()=>{g.size!==0&&w({ids:[...g]})},ue=H.length>=14&&ie&&ie.data.length>0;return t("div",{className:"page-container",children:[t("header",{className:a.header,children:[t("h2",{className:a.title,children:"My Watchlist"}),t("p",{className:a.subtitle,children:"Track and manage your anime collection"})]}),t("div",{className:a.controls,children:[t("div",{className:a.filters,children:Se.map(e=>t("button",{className:`${a.filterBtn} ${d===e?a.active:""}`,onClick:()=>{const n=new URLSearchParams(l);n.delete("page"),v({pathname:`/watchlist/${e}`,search:n.toString()}),R(1)},children:e},e))}),t("div",{children:t("select",{className:a.sortSelect,value:C,onChange:e=>{const n=e.currentTarget.value;q(n),p(n,m)},children:[t("option",{value:"last_added",children:"Recently Added"}),t("option",{value:"name_asc",children:"Name (A-Z)"}),t("option",{value:"name_desc",children:"Name (Z-A)"})]})})]}),t("div",{className:a.filterContainer,children:[t("div",{className:a.searchBarWrapper,children:[t("div",{className:a.inputIconWrapper,children:[t(h,{name:"search",className:a.searchIcon}),t("input",{className:a.searchInput,placeholder:"Search your watchlist by title...",value:f,onInput:e=>T(e.currentTarget.value),onKeyDown:e=>e.key==="Enter"&&p()})]}),t("div",{className:a.searchActions,children:[t(B,{onClick:()=>p(),className:a.searchBtn,children:"Search"}),t("button",{className:`${a.filterToggleBtn} ${O?a.active:""}`,onClick:()=>Ne(!O),children:[t(h,{name:"filter",size:14}),t("span",{children:"Filters"}),O?t(h,{name:"chevron-up",size:12}):t(h,{name:"chevron-down",size:12})]})]})]}),t("div",{className:`${a.advancedFilters} ${O?a.show:""}`,children:[t("div",{className:a.filterDivider}),t("div",{className:a.filterGrid,children:[t("div",{className:a.filterItem,children:[t("label",{children:"Type"}),t("select",{value:y,onChange:e=>P(e.currentTarget.value),children:ut.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:a.filterItem,children:[t("label",{children:"Season"}),t("select",{value:b,onChange:e=>W(e.currentTarget.value),children:ht.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:a.filterItem,children:[t("label",{children:"Year"}),t("select",{value:S,onChange:e=>I(e.currentTarget.value),children:$e.map(e=>t("option",{value:e.value,children:e.label},e.value))})]})]}),se.length>0&&t("div",{className:a.genreSection,children:[t("label",{className:a.genreLabel,children:"Genres"}),t("div",{className:a.genreContainer,children:se.map(e=>t("button",{className:`${a.genreButton} ${a[k[e]||""]}`,onClick:()=>Fe(e),children:e},e))})]}),t("div",{className:a.filterActions,children:[t(B,{variant:"secondary",onClick:Oe,children:"Reset All"}),t(B,{onClick:()=>p(),className:a.applyBtn,children:"Apply Filters"})]})]})]}),t("div",{className:a.resultsHeader,ref:K,children:[t("h3",{className:a.resultsTitle,children:[i?"Continue Watching":d,t("span",{className:a.itemCount,children:["(",J," items)"]})]}),t("div",{className:a.headerActions,children:[t("button",{className:`${a.manageBtn} ${M?a.active:""}`,onClick:Ee,children:[t(h,{name:"pencil-alt",size:13}),t("span",{children:"Bulk Manage"})]}),J>0&&t("div",{className:a.pagination,children:[t("button",{className:a.pageBtn,onClick:()=>U(m-1),disabled:m===1||x,"aria-label":"Previous page",children:t(h,{name:"chevron-left",size:14})}),t("span",{className:a.pageInfo,children:["Page ",t("strong",{children:m})]}),t("button",{className:a.pageBtn,onClick:()=>U(m+1),disabled:!ue||x,"aria-label":"Next page",children:t(h,{name:"chevron-right",size:14})})]})]})]}),M&&t("div",{className:a.manageBar,children:[t("button",{className:a.selectAllBtn,onClick:_e,children:[t("span",{className:`${a.selectAllBox} ${te?a.selectAllBoxChecked:""}`,"aria-hidden":"true"}),t("span",{children:te?"Clear Page":"Select All"})]}),t("span",{className:a.manageCount,children:[g.size," selected"]}),t("div",{className:a.manageSpacer}),!i&&t("select",{className:a.manageStatusSelect,value:"",onChange:e=>{e.currentTarget.value&&Ue(e.currentTarget.value)},disabled:g.size===0,title:"Set status for selected items",children:[t("option",{value:"",children:"Set status…"}),be.map(e=>t("option",{value:e,children:e},e))]}),t("button",{className:a.manageRemoveBtn,onClick:Ye,disabled:g.size===0,children:[t(h,{name:"trash",size:13}),t("span",{children:"Remove Selected"})]})]}),x?t(it,{}):re?t(ct,{message:re.message}):t(Ve,{children:[(y!=="ALL"||b!=="ALL"||S!=="ALL"||Object.keys(k).length>0||f.trim())&&t("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center",marginBottom:"1.5rem"},children:[t("span",{style:{fontSize:"0.8rem",color:"var(--text-muted)",fontWeight:600},children:"Active Filters:"}),f.trim()&&t("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Search: ",f,t("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),T(""),p()},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),y!=="ALL"&&t("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Type: ",y,t("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),P("ALL"),p()},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),b!=="ALL"&&t("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Season: ",b,t("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),W("ALL"),p()},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),S!=="ALL"&&t("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Year: ",S,t("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),I("ALL"),p()},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),Object.entries(k).map(([e,n])=>t("span",{className:`badge ${n==="include"?"badge-primary":"badge-danger"}`,style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[n==="include"?`+ ${e}`:`- ${e}`,t("button",{onClick:s=>{s.stopPropagation(),s.preventDefault(),$(r=>{const o={...r};return delete o[e],o}),p()},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]},e))]}),t("div",{className:`${a.grid} ${Le?a.lowEnd:""}`,children:X.map(e=>{const n=g.has(e.id);return t("div",{className:`${a.itemWrapper} ${n?a.selected:""}`,children:[M&&t("div",{className:a.selectOverlay,onClick:()=>Ge(e.id),title:n?"Deselect":"Select",children:t("span",{className:a.selectBadge,children:n?t(h,{name:"check",size:12}):null})}),t(rt,{anime:e,continueWatching:i,onRemove:()=>oe(e.id,e.name),layout:"vertical"}),!i&&!M&&t("div",{className:a.cardActions,children:[t("select",{className:a.statusSelect,value:e.status,onChange:s=>Pe.mutate({id:e.id,status:s.currentTarget.value}),children:be.map(s=>t("option",{value:s,children:s},s))}),t("button",{className:a.removeBtn,onClick:()=>oe(e.id,e.name),title:"Remove from Watchlist","aria-label":"Remove from Watchlist",children:t(h,{name:"trash",size:12})})]})]},e._id)})})]}),!x&&X.length===0&&t("div",{className:a.emptyState,children:[t("h3",{className:a.emptyTitle,children:"Your watchlist is looking a bit lonely"}),t("p",{className:a.emptyText,children:d!=="All"||f||y!=="ALL"||b!=="ALL"||S!=="ALL"||Object.keys(k).length>0?"No anime match these filters. Try adjusting them to see more titles.":"Let's find something to watch!"}),t("button",{className:a.emptyBtn,onClick:()=>v("/search"),children:[t(h,{name:"search",size:14}),t("span",{children:"Browse Anime"})]})]}),J>0&&t("div",{className:a.bottomPagination,children:t("div",{className:a.pagination,children:[t("button",{className:a.pageBtn,onClick:()=>U(m-1),disabled:m===1||x,children:[t(h,{name:"chevron-left",size:14}),t("span",{children:"Previous"})]}),t("span",{className:a.pageInfo,children:["Page ",t("strong",{children:m})]}),t("button",{className:a.pageBtn,onClick:()=>U(m+1),disabled:!ue||x,children:[t("span",{children:"Next"}),t(h,{name:"chevron-right",size:14})]})]})}),t(ae,{isOpen:!!c,onClose:de,title:i?"Reset Progress":"Remove from Watchlist",children:[t(ae.Body,{children:[t("p",{children:c?.ids&&c.ids.length>1?i?`Are you sure you want to remove watch progress for ${c.ids.length} items?`:`Are you sure you want to remove ${c.ids.length} items from your watchlist?`:i?`Are you sure you want to remove your watch progress for "${c?.name}"?`:`Are you sure you want to remove "${c?.name}" from your watchlist?`}),i&&t("label",{children:[t("input",{type:"checkbox",checked:V,onChange:e=>z(e.target.checked)}),"Also remove from my watchlist"]}),!i&&!(c?.ids&&c.ids.length>1)&&t("label",{children:[t("input",{type:"checkbox",checked:le,onChange:e=>D(e.target.checked)}),"Remember my choice"]})]}),t(ae.Actions,{children:[t(B,{variant:"secondary",onClick:de,children:"No"}),t(B,{variant:"danger",onClick:ze,children:"Yes"})]})]})]})};export{xt as default};
1
+ import{h as he,n as je,a as qe,o as Ke,d as u,A as pe,T as j,u as t,S as Ve}from"./vendor-core-8R2fFbyN.js";import{u as Qe,a as ge}from"./vendor-query-BXRECSI6.js";import{u as He,d as Je,r as Ze,t as ve,v as fe,z as Xe,q as ye,i as et,w as tt,x as at,y as nt,A as st,C as lt,B,M as ae}from"./index-lo-bz7f2.js";import{I as h}from"./vendor-icons-CDMuNDeL.js";import{A as rt}from"./AnimeCard-OKU7LaSN.js";import{S as it}from"./SkeletonGrid-Du10CNfq.js";import{E as ct}from"./ErrorMessage-z4f4WGgP.js";import{s as a}from"./Watchlist.module-XGtVQr1d.js";import"./useAnimeInfoData-CbNnHRj8.js";import"./QueueOptionsButton-DKWi-9kd.js";import"./vendor-ui-CUDCvRS_.js";import"./MediaCard-DszKDA4s.js";import"./useIsMobile-Dm_b6Ob3.js";const ot=(d,v)=>{const l=new URLSearchParams(v);return l.delete("page"),l.sort(),`${d}|${l.toString()}`},dt=(d,v)=>{const l=new Set(d);return v.forEach(A=>l.add(A)),l},mt=(d,v)=>{const l=new Set(d);return v.forEach(A=>l.delete(A)),l},Se=["All","Continue Watching","Watching","Completed","On-Hold","Dropped","Planned"],be=Se.slice(2),ut=[{value:"ALL",label:"All Types"},{value:"TV",label:"TV Series"},{value:"Movie",label:"Movie"},{value:"OVA",label:"OVA"},{value:"ONA",label:"ONA"},{value:"TV_SHORT",label:"TV Short"},{value:"SPECIAL",label:"Special"},{value:"ADULT",label:"Adult (18+)"}],ht=[{value:"ALL",label:"All Seasons"},{value:"WINTER",label:"Winter"},{value:"SPRING",label:"Spring"},{value:"SUMMER",label:"Summer"},{value:"FALL",label:"Fall"}],xt=()=>{he(()=>{document.title="Watchlist - dango"},[]);const{filter:d="All"}=je(),v=qe(),[l,A]=Ke(),ne=Qe(),[m,R]=u(parseInt(l.get("page")||"1")),[f,T]=u(l.get("query")||""),[C,q]=u(l.get("sortBy")||"last_added"),[y,P]=u(l.get("type")||"ALL"),[b,W]=u(l.get("season")||"ALL"),[S,I]=u(l.get("year")||"ALL"),[k,$]=u(()=>{const e={},n=l.get("genres")?.split(",").map(r=>r.trim()).filter(Boolean)||[],s=l.get("excludeGenres")?.split(",").map(r=>r.trim()).filter(Boolean)||[];return n.forEach(r=>r&&(e[r]="include")),s.forEach(r=>r&&(e[r]="exclude")),e}),[O,Ne]=u(()=>["type","season","year","genres","excludeGenres"].some(e=>l.has(e))),{lowEndMode:Le}=He(),{titlePreference:F}=Je(),{data:Ae}=Ze(),se=Ae?.genres||[],K=pe(null),[c,w]=u(null),[V,z]=u(!1),[le,D]=u(!1),[M,Ce]=u(!1),[g,N]=u(new Set),Q=pe(null),i=d==="Continue Watching",E=j(()=>{const e=new URLSearchParams(l);return e.delete("page"),e.set("titlePreference",F),e.toString()},[l,F]),{data:G,isLoading:ke,error:we}=ve(E,m,14),{data:_,isLoading:xe,error:Be}=fe(d,E,m,14),{data:Re}=ve(E,m+1,14),{data:Te}=fe(d,E,m+1,14),H=j(()=>(i?G?.data:_?.data)||[],[i,G,_]),J=j(()=>(i?G?.total:_?.total)||0,[i,G,_]),x=i?ke:xe,re=i?we:Be,ie=i?Re:Te;he(()=>{T(l.get("query")||""),q(l.get("sortBy")||"last_added"),P(l.get("type")||"ALL"),W(l.get("season")||"ALL"),I(l.get("year")||"ALL");const e={},n=l.get("genres")?.split(",").map(o=>o.trim()).filter(Boolean)||[],s=l.get("excludeGenres")?.split(",").map(o=>o.trim()).filter(Boolean)||[];n.forEach(o=>o&&(e[o]="include")),s.forEach(o=>o&&(e[o]="exclude")),$(e),R(parseInt(l.get("page")||"1"));const r=ot(d,l);Q.current!==null&&Q.current!==r&&N(new Set),Q.current=r},[l,d]);const Pe=ge({mutationFn:async({id:e,status:n})=>{await ye("/api/watchlist/status",{method:"POST",body:JSON.stringify({id:e,status:n})})},onSuccess:()=>{ne.invalidateQueries({queryKey:["watchlist"]}),Xe.success("Status updated")}}),We=ge({mutationFn:async e=>{await ye("/api/continue-watching/remove",{method:"POST",body:JSON.stringify({showId:e})})},onSuccess:()=>ne.invalidateQueries({queryKey:["allContinueWatching"]})}),Z=et(),{data:ce}=tt("skipRemoveConfirmation"),Ie=at(),X=j(()=>{const e=n=>n[F]||n.name||"";return[...H].sort((n,s)=>C==="name_asc"?e(n).localeCompare(e(s)):C==="name_desc"?e(s).localeCompare(e(n)):0)},[H,C,F]),ee=new Date().getFullYear(),$e=[{value:"ALL",label:"All Years"},...Array.from({length:ee-1980+1},(e,n)=>({value:String(ee-n),label:String(ee-n)}))],p=(e=C,n=1)=>{const s=new URLSearchParams;f.trim()&&s.set("query",f.trim()),e!=="last_added"&&s.set("sortBy",e),y!=="ALL"&&s.set("type",y),b!=="ALL"&&s.set("season",b),S!=="ALL"&&s.set("year",S);const r=Object.entries(k).filter(([,L])=>L==="include").map(([L])=>L),o=Object.entries(k).filter(([,L])=>L==="exclude").map(([L])=>L);r.length>0&&s.set("genres",r.join(",")),o.length>0&&s.set("excludeGenres",o.join(",")),n>1&&s.set("page",n.toString()),A(s),n!==m&&R(n)},U=e=>{if(p(C,e),K.current){const n=K.current.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:n,behavior:"smooth"})}},Oe=()=>{T(""),q("last_added"),P("ALL"),W("ALL"),I("ALL"),$({}),A(new URLSearchParams),R(1)},Fe=e=>{$(n=>{const s=n[e],r={...n};return s==="include"?r[e]="exclude":s==="exclude"?delete r[e]:r[e]="include",r})},oe=(e,n)=>{if(i){w({id:e,name:n});return}String(ce)==="true"||String(ce)==="1"?Z.mutate(e):w({id:e,name:n})},ze=()=>{if(c){if(c.ids){i?(De.mutate(c.ids),V&&me.mutate(c.ids)):me.mutate(c.ids),N(new Set),w(null),z(!1),D(!1);return}i?(We.mutate(c.id),V&&Z.mutate(c.id)):Z.mutate(c.id),le&&Ie.mutate({key:"skipRemoveConfirmation",value:!0}),w(null),z(!1),D(!1)}},de=()=>{w(null),z(!1),D(!1)},me=nt(),De=st(),Me=lt(),Ee=()=>{Ce(e=>{const n=!e;return n||N(new Set),n})},Ge=e=>{N(n=>{const s=new Set(n);return s.has(e)?s.delete(e):s.add(e),s})},Y=X.map(e=>e.id),te=Y.length>0&&Y.every(e=>g.has(e)),_e=()=>{N(te?e=>mt(e,Y):e=>dt(e,Y))},Ue=e=>{g.size!==0&&(Me.mutate({ids:[...g],status:e}),N(new Set))},Ye=()=>{g.size!==0&&w({ids:[...g]})},ue=H.length>=14&&ie&&ie.data.length>0;return t("div",{className:"page-container",children:[t("header",{className:a.header,children:[t("h2",{className:a.title,children:"My Watchlist"}),t("p",{className:a.subtitle,children:"Track and manage your anime collection"})]}),t("div",{className:a.controls,children:[t("div",{className:a.filters,children:Se.map(e=>t("button",{className:`${a.filterBtn} ${d===e?a.active:""}`,onClick:()=>{const n=new URLSearchParams(l);n.delete("page"),v({pathname:`/watchlist/${e}`,search:n.toString()}),R(1)},children:e},e))}),t("div",{children:t("select",{className:a.sortSelect,value:C,onChange:e=>{const n=e.currentTarget.value;q(n),p(n,m)},children:[t("option",{value:"last_added",children:"Recently Added"}),t("option",{value:"name_asc",children:"Name (A-Z)"}),t("option",{value:"name_desc",children:"Name (Z-A)"})]})})]}),t("div",{className:a.filterContainer,children:[t("div",{className:a.searchBarWrapper,children:[t("div",{className:a.inputIconWrapper,children:[t(h,{name:"search",className:a.searchIcon}),t("input",{className:a.searchInput,placeholder:"Search your watchlist by title...",value:f,onInput:e=>T(e.currentTarget.value),onKeyDown:e=>e.key==="Enter"&&p()})]}),t("div",{className:a.searchActions,children:[t(B,{onClick:()=>p(),className:a.searchBtn,children:"Search"}),t("button",{className:`${a.filterToggleBtn} ${O?a.active:""}`,onClick:()=>Ne(!O),children:[t(h,{name:"filter",size:14}),t("span",{children:"Filters"}),O?t(h,{name:"chevron-up",size:12}):t(h,{name:"chevron-down",size:12})]})]})]}),t("div",{className:`${a.advancedFilters} ${O?a.show:""}`,children:[t("div",{className:a.filterDivider}),t("div",{className:a.filterGrid,children:[t("div",{className:a.filterItem,children:[t("label",{children:"Type"}),t("select",{value:y,onChange:e=>P(e.currentTarget.value),children:ut.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:a.filterItem,children:[t("label",{children:"Season"}),t("select",{value:b,onChange:e=>W(e.currentTarget.value),children:ht.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:a.filterItem,children:[t("label",{children:"Year"}),t("select",{value:S,onChange:e=>I(e.currentTarget.value),children:$e.map(e=>t("option",{value:e.value,children:e.label},e.value))})]})]}),se.length>0&&t("div",{className:a.genreSection,children:[t("label",{className:a.genreLabel,children:"Genres"}),t("div",{className:a.genreContainer,children:se.map(e=>t("button",{className:`${a.genreButton} ${a[k[e]||""]}`,onClick:()=>Fe(e),children:e},e))})]}),t("div",{className:a.filterActions,children:[t(B,{variant:"secondary",onClick:Oe,children:"Reset All"}),t(B,{onClick:()=>p(),className:a.applyBtn,children:"Apply Filters"})]})]})]}),t("div",{className:a.resultsHeader,ref:K,children:[t("h3",{className:a.resultsTitle,children:[i?"Continue Watching":d,t("span",{className:a.itemCount,children:["(",J," items)"]})]}),t("div",{className:a.headerActions,children:[t("button",{className:`${a.manageBtn} ${M?a.active:""}`,onClick:Ee,children:[t(h,{name:"pencil-alt",size:13}),t("span",{children:"Bulk Manage"})]}),J>0&&t("div",{className:a.pagination,children:[t("button",{className:a.pageBtn,onClick:()=>U(m-1),disabled:m===1||x,"aria-label":"Previous page",children:t(h,{name:"chevron-left",size:14})}),t("span",{className:a.pageInfo,children:["Page ",t("strong",{children:m})]}),t("button",{className:a.pageBtn,onClick:()=>U(m+1),disabled:!ue||x,"aria-label":"Next page",children:t(h,{name:"chevron-right",size:14})})]})]})]}),M&&t("div",{className:a.manageBar,children:[t("button",{className:a.selectAllBtn,onClick:_e,children:[t("span",{className:`${a.selectAllBox} ${te?a.selectAllBoxChecked:""}`,"aria-hidden":"true"}),t("span",{children:te?"Clear Page":"Select All"})]}),t("span",{className:a.manageCount,children:[g.size," selected"]}),t("div",{className:a.manageSpacer}),!i&&t("select",{className:a.manageStatusSelect,value:"",onChange:e=>{e.currentTarget.value&&Ue(e.currentTarget.value)},disabled:g.size===0,title:"Set status for selected items",children:[t("option",{value:"",children:"Set status…"}),be.map(e=>t("option",{value:e,children:e},e))]}),t("button",{className:a.manageRemoveBtn,onClick:Ye,disabled:g.size===0,children:[t(h,{name:"trash",size:13}),t("span",{children:"Remove Selected"})]})]}),x?t(it,{}):re?t(ct,{message:re.message}):t(Ve,{children:[(y!=="ALL"||b!=="ALL"||S!=="ALL"||Object.keys(k).length>0||f.trim())&&t("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center",marginBottom:"1.5rem"},children:[t("span",{style:{fontSize:"0.8rem",color:"var(--text-muted)",fontWeight:600},children:"Active Filters:"}),f.trim()&&t("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Search: ",f,t("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),T(""),p()},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),y!=="ALL"&&t("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Type: ",y,t("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),P("ALL"),p()},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),b!=="ALL"&&t("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Season: ",b,t("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),W("ALL"),p()},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),S!=="ALL"&&t("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Year: ",S,t("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),I("ALL"),p()},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),Object.entries(k).map(([e,n])=>t("span",{className:`badge ${n==="include"?"badge-primary":"badge-danger"}`,style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[n==="include"?`+ ${e}`:`- ${e}`,t("button",{onClick:s=>{s.stopPropagation(),s.preventDefault(),$(r=>{const o={...r};return delete o[e],o}),p()},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]},e))]}),t("div",{className:`${a.grid} ${Le?a.lowEnd:""}`,children:X.map(e=>{const n=g.has(e.id);return t("div",{className:`${a.itemWrapper} ${n?a.selected:""}`,children:[M&&t("div",{className:a.selectOverlay,onClick:()=>Ge(e.id),title:n?"Deselect":"Select",children:t("span",{className:a.selectBadge,children:n?t(h,{name:"check",size:12}):null})}),t(rt,{anime:e,continueWatching:i,onRemove:()=>oe(e.id,e.name),layout:"vertical"}),!i&&!M&&t("div",{className:a.cardActions,children:[t("select",{className:a.statusSelect,value:e.status,onChange:s=>Pe.mutate({id:e.id,status:s.currentTarget.value}),children:be.map(s=>t("option",{value:s,children:s},s))}),t("button",{className:a.removeBtn,onClick:()=>oe(e.id,e.name),title:"Remove from Watchlist","aria-label":"Remove from Watchlist",children:t(h,{name:"trash",size:12})})]})]},e._id)})})]}),!x&&X.length===0&&t("div",{className:a.emptyState,children:[t("h3",{className:a.emptyTitle,children:"Your watchlist is looking a bit lonely"}),t("p",{className:a.emptyText,children:d!=="All"||f||y!=="ALL"||b!=="ALL"||S!=="ALL"||Object.keys(k).length>0?"No anime match these filters. Try adjusting them to see more titles.":"Let's find something to watch!"}),t("button",{className:a.emptyBtn,onClick:()=>v("/search"),children:[t(h,{name:"search",size:14}),t("span",{children:"Browse Anime"})]})]}),J>0&&t("div",{className:a.bottomPagination,children:t("div",{className:a.pagination,children:[t("button",{className:a.pageBtn,onClick:()=>U(m-1),disabled:m===1||x,children:[t(h,{name:"chevron-left",size:14}),t("span",{children:"Previous"})]}),t("span",{className:a.pageInfo,children:["Page ",t("strong",{children:m})]}),t("button",{className:a.pageBtn,onClick:()=>U(m+1),disabled:!ue||x,children:[t("span",{children:"Next"}),t(h,{name:"chevron-right",size:14})]})]})}),t(ae,{isOpen:!!c,onClose:de,title:i?"Reset Progress":"Remove from Watchlist",children:[t(ae.Body,{children:[t("p",{children:c?.ids&&c.ids.length>1?i?`Are you sure you want to remove watch progress for ${c.ids.length} items?`:`Are you sure you want to remove ${c.ids.length} items from your watchlist?`:i?`Are you sure you want to remove your watch progress for "${c?.name}"?`:`Are you sure you want to remove "${c?.name}" from your watchlist?`}),i&&t("label",{children:[t("input",{type:"checkbox",checked:V,onChange:e=>z(e.target.checked)}),"Also remove from my watchlist"]}),!i&&!(c?.ids&&c.ids.length>1)&&t("label",{children:[t("input",{type:"checkbox",checked:le,onChange:e=>D(e.target.checked)}),"Remember my choice"]})]}),t(ae.Actions,{children:[t(B,{variant:"secondary",onClick:de,children:"No"}),t(B,{variant:"danger",onClick:ze,children:"Yes"})]})]})]})};export{xt as default};
@@ -1 +1 @@
1
- import{_ as n}from"./index-IZgh1beL.js";let a=null,e=null;async function r(){return a||(e||(e=n(()=>import("./hls-BOLXTnjL.js"),[]).then(l=>(a=l.default,a)).catch(()=>null)),e)}function c(l){return l.canPlayType("application/vnd.apple.mpegurl")!==""||l.canPlayType("application/x-mpegURL")!==""}export{c,r as l};
1
+ import{_ as n}from"./index-lo-bz7f2.js";let a=null,e=null;async function r(){return a||(e||(e=n(()=>import("./hls-BOLXTnjL.js"),[]).then(l=>(a=l.default,a)).catch(()=>null)),e)}function c(l){return l.canPlayType("application/vnd.apple.mpegurl")!==""||l.canPlayType("application/x-mpegURL")!==""}export{c,r as l};
@@ -0,0 +1,178 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-CQ4Ikeja.js","assets/vendor-core-8R2fFbyN.js","assets/vendor-query-BXRECSI6.js","assets/vendor-icons-CDMuNDeL.js","assets/AnimeCard-OKU7LaSN.js","assets/useAnimeInfoData-CbNnHRj8.js","assets/QueueOptionsButton-DKWi-9kd.js","assets/vendor-ui-CUDCvRS_.js","assets/QueueOptionsButton-CM15uQn8.css","assets/MediaCard-DszKDA4s.js","assets/useIsMobile-Dm_b6Ob3.js","assets/MediaCard-DB6Yjgky.css","assets/SkeletonGrid-Du10CNfq.js","assets/SkeletonGrid-DhPYefXr.css","assets/ErrorMessage-z4f4WGgP.js","assets/ErrorMessage-CXoRbrLN.css","assets/ResetProgressModal-8mcLXaAb.js","assets/QueueRail-DAcIex5B.js","assets/QueueRail-BUYEjdaq.css","assets/useMangaPopup-BvgtZ53s.js","assets/useMangaLibrary-BXhgN-dl.js","assets/MangaResetProgressModal-WjKH_G_f.js","assets/useProviders-xlftutIo.js","assets/useMatureConsent-CT7-KfzG.js","assets/useTv-DTqrJEWp.js","assets/TvPopup-CP41CncZ.js","assets/useTvLibrary-BHeWSd1F.js","assets/AsmrResetProgressModal-C8i6weqW.js","assets/useAsmr-BEcgHwxg.js","assets/Home-DtRtTuI9.css","assets/Watchlist-BHLshSPX.js","assets/Watchlist.module-XGtVQr1d.js","assets/Watchlist-BiDEU0iV.css","assets/Settings-bSA7BG7h.js","assets/Settings-AuFxQcJF.css","assets/Player-C3yWQkXb.js","assets/AvSyncCalibrator-oK6LlG61.js","assets/AvSyncCalibrator-BPa6KaGC.css","assets/hls-B_yo8-yR.js","assets/AnimeMetaDetails-BPvv5xIl.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-BcpwT5iw.js","assets/SynopsisText-CYv2W3yR.css","assets/Player-B036Ic3m.css","assets/Search-DxX021dj.js","assets/Search.module-CMEai-B-.js","assets/Search-Cs45oAwI.css","assets/Mature-Ckx99wFj.js","assets/Mature-DJmUUtlF.css","assets/Asmr-4S6uoevp.js","assets/Asmr.module-ChUXDZKx.js","assets/Asmr-Cq2ua6Zk.css","assets/useAsmrPopup-BXD3y2m1.js","assets/Manga-pJEpcUpo.js","assets/Manga.module-BcfOdsNP.js","assets/Manga-Dp_-l1Pw.css","assets/MangaInfoPage-BEQsjTHH.js","assets/MangaReadPage-C0WAtK-1.js","assets/ReadingList-BLnkwB--.js","assets/LibraryListPage-B0MDTnEc.js","assets/Radio-BhTsgGGd.js","assets/Radio.module-DGSZLpKM.js","assets/Radio-CCHNFN7R.css","assets/Music-CU6TBHF5.js","assets/Music-BGH_0voi.css","assets/TvSearch-BlqTQYJa.js","assets/TvInfo-Z0c1Wh3i.js","assets/TvInfo-Bu36xJyO.css","assets/Tv-DJTbg4VW.js","assets/OptionListMenu-CkK2BvEz.js","assets/Tv-C2SWcVzN.css","assets/TvWatchlist-COCWPkgh.js","assets/ListeningList-Dxkhy6E2.js","assets/Trackers-BXSONaRD.js","assets/Trackers-D5XBOCDp.css","assets/Insights-DiAo0UAc.js","assets/Insights-DKtoVe6L.css","assets/Map-Dj51g5zL.js","assets/Map-CXFqXmsZ.css","assets/AnimeInfoPage-BZWl-TJY.js","assets/PlayerRedirect-D70t8VUW.js","assets/VirtualKeyboard-6ZNTym4R.js","assets/VirtualKeyboard-KIPc5ZGH.css"])))=>i.map(i=>d[i]);
2
+ import{N as Et,k as D,A as q,q as R,h as _,S as F,d as v,X as te,x as ne,g as Ee,u as t,L as K,$ as Xe,a as et,c as Ce,e as Ct,f as $t,D as Lt,P as Re,i as Pt,j as S,l as qe,z as I,T as le,m as At,B as Ot}from"./vendor-core-8R2fFbyN.js";import{u as O,a as j,b as M,c as $e,Q as Dt,d as Rt}from"./vendor-query-BXRECSI6.js";import{I as g}from"./vendor-icons-CDMuNDeL.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();const qt="modulepreload",Mt=function(e){return"/"+e},Me={},T=function(n,r,s){let o=Promise.resolve();if(r&&r.length>0){let d=function(u){return Promise.all(u.map(l=>Promise.resolve(l).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),c=i?.nonce||i?.getAttribute("nonce");o=d(r.map(u=>{if(u=Mt(u),u in Me)return;Me[u]=!0;const l=u.endsWith(".css"),m=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${m}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":qt,l||(h.as="script"),h.crossOrigin="",h.href=u,c&&h.setAttribute("nonce",c),document.head.appendChild(h),l)return new Promise((b,L)=>{h.addEventListener("load",b),h.addEventListener("error",()=>L(new Error(`Unable to preload CSS for ${u}`)))})}))}function a(i){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=i,window.dispatchEvent(c),!c.defaultPrevented)throw i}return o.then(i=>{for(const c of i||[])c.status==="rejected"&&a(c.reason);return n().catch(a)})};let Bt={data:""},Ft=e=>{if(typeof window=="object"){let n=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return n.nonce=window.__nonce__,n.parentNode||(e||document.head).appendChild(n),n.firstChild}return e||Bt},Kt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,jt=/\/\*[^]*?\*\/| +/g,Be=/\n+/g,X=(e,n)=>{let r="",s="",o="";for(let a in e){let i=e[a];a[0]=="@"?a[1]=="i"?r=a+" "+i+";":s+=a[1]=="f"?X(i,a):a+"{"+X(i,a[1]=="k"?"":n)+"}":typeof i=="object"?s+=X(i,n?n.replace(/([^,])+/g,c=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,d=>/&/.test(d)?d.replace(/&/g,c):c?c+" "+d:d)):a):i!=null&&(a=a[1]=="-"?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=X.p?X.p(a,i):a+":"+i+";")}return r+(n&&o?n+"{"+o+"}":o)+s},Z={},tt=e=>{if(typeof e=="object"){let n="";for(let r in e)n+=r+tt(e[r]);return n}return e},zt=(e,n,r,s,o)=>{let a=tt(e),i=Z[a]||(Z[a]=(d=>{let u=0,l=11;for(;u<d.length;)l=101*l+d.charCodeAt(u++)>>>0;return"go"+l})(a));if(!Z[i]){let d=a!==e?e:(u=>{let l,m,h=[{}];for(;l=Kt.exec(u.replace(jt,""));)l[4]?h.shift():l[3]?(m=l[3].replace(Be," ").trim(),h.unshift(h[0][m]=h[0][m]||{})):h[0][l[1]]=l[2].replace(Be," ").trim();return h[0]})(e);Z[i]=X(o?{["@keyframes "+i]:d}:d,r?"":"."+i)}let c=r&&Z.g;return r&&(Z.g=Z[i]),((d,u,l,m)=>{m?u.data=u.data.replace(m,d):u.data.indexOf(d)===-1&&(u.data=l?d+u.data:u.data+d)})(Z[i],n,s,c),i},Wt=(e,n,r)=>e.reduce((s,o,a)=>{let i=n[a];if(i&&i.call){let c=i(r),d=c&&c.props&&c.props.className||/^go/.test(c)&&c;i=d?"."+d:c&&typeof c=="object"?c.props?"":X(c,""):c===!1?"":c}return s+o+(i??"")},"");function ve(e){let n=this||{},r=e.call?e(n.p):e;return zt(r.unshift?r.raw?Wt(r,[].slice.call(arguments,1),n.p):r.reduce((s,o)=>Object.assign(s,o&&o.call?o(n.p):o),{}):r,Ft(n.target),n.g,n.o,n.k)}let nt,Ne,Ie;ve.bind({g:1});let J=ve.bind({k:1});function Ut(e,n,r,s){X.p=n,nt=e,Ne=r,Ie=s}function ee(e,n){let r=this||{};return function(){let s=arguments;function o(a,i){let c=Object.assign({},a),d=c.className||o.className;r.p=Object.assign({theme:Ne&&Ne()},c),r.o=/go\d/.test(d),c.className=ve.apply(r,s)+(d?" "+d:"");let u=e;return e[0]&&(u=c.as||e,delete c.as),Ie&&u[0]&&Ie(c),nt(u,c)}return o}}var Vt=e=>typeof e=="function",ge=(e,n)=>Vt(e)?e(n):e,Qt=(()=>{let e=0;return()=>(++e).toString()})(),rt=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let n=matchMedia("(prefers-reduced-motion: reduce)");e=!n||n.matches}return e}})(),Ht=20,Le="default",st=(e,n)=>{let{toastLimit:r}=e.settings;switch(n.type){case 0:return{...e,toasts:[n.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(i=>i.id===n.toast.id?{...i,...n.toast}:i)};case 2:let{toast:s}=n;return st(e,{type:e.toasts.find(i=>i.id===s.id)?1:0,toast:s});case 3:let{toastId:o}=n;return{...e,toasts:e.toasts.map(i=>i.id===o||o===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return n.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==n.toastId)};case 5:return{...e,pausedAt:n.time};case 6:let a=n.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+a}))}}},pe=[],ot={toasts:[],pausedAt:void 0,settings:{toastLimit:Ht}},V={},at=(e,n=Le)=>{V[n]=st(V[n]||ot,e),pe.forEach(([r,s])=>{r===n&&s(V[n])})},it=e=>Object.keys(V).forEach(n=>at(e,n)),Jt=e=>Object.keys(V).find(n=>V[n].toasts.some(r=>r.id===e)),ye=(e=Le)=>n=>{at(n,e)},Yt={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Gt=(e={},n=Le)=>{let[r,s]=v(V[n]||ot),o=q(V[n]);_(()=>(o.current!==V[n]&&s(V[n]),pe.push([n,s]),()=>{let i=pe.findIndex(([c])=>c===n);i>-1&&pe.splice(i,1)}),[n]);let a=r.toasts.map(i=>{var c,d,u;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((c=e[i.type])==null?void 0:c.removeDelay)||e?.removeDelay,duration:i.duration||((d=e[i.type])==null?void 0:d.duration)||e?.duration||Yt[i.type],style:{...e.style,...(u=e[i.type])==null?void 0:u.style,...i.style}}});return{...r,toasts:a}},Zt=(e,n="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:n,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||Qt()}),de=e=>(n,r)=>{let s=Zt(n,e,r);return ye(s.toasterId||Jt(s.id))({type:2,toast:s}),s.id},$=(e,n)=>de("blank")(e,n);$.error=de("error");$.success=de("success");$.loading=de("loading");$.custom=de("custom");$.dismiss=(e,n)=>{let r={type:3,toastId:e};n?ye(n)(r):it(r)};$.dismissAll=e=>$.dismiss(void 0,e);$.remove=(e,n)=>{let r={type:4,toastId:e};n?ye(n)(r):it(r)};$.removeAll=e=>$.remove(void 0,e);$.promise=(e,n,r)=>{let s=$.loading(n.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let a=n.success?ge(n.success,o):void 0;return a?$.success(a,{id:s,...r,...r?.success}):$.dismiss(s),o}).catch(o=>{let a=n.error?ge(n.error,o):void 0;a?$.error(a,{id:s,...r,...r?.error}):$.dismiss(s)}),e};var Xt=1e3,en=(e,n="default")=>{let{toasts:r,pausedAt:s}=Gt(e,n),o=q(new Map).current,a=R((m,h=Xt)=>{if(o.has(m))return;let b=setTimeout(()=>{o.delete(m),i({type:4,toastId:m})},h);o.set(m,b)},[]);_(()=>{if(s)return;let m=Date.now(),h=r.map(b=>{if(b.duration===1/0)return;let L=(b.duration||0)+b.pauseDuration-(m-b.createdAt);if(L<0){b.visible&&$.dismiss(b.id);return}return setTimeout(()=>$.dismiss(b.id,n),L)});return()=>{h.forEach(b=>b&&clearTimeout(b))}},[r,s,n]);let i=R(ye(n),[n]),c=R(()=>{i({type:5,time:Date.now()})},[i]),d=R((m,h)=>{i({type:1,toast:{id:m,height:h}})},[i]),u=R(()=>{s&&i({type:6,time:Date.now()})},[s,i]),l=R((m,h)=>{let{reverseOrder:b=!1,gutter:L=8,defaultPosition:z}=h||{},B=r.filter(w=>(w.position||z)===(m.position||z)&&w.height),Q=B.findIndex(w=>w.id===m.id),W=B.filter((w,C)=>C<Q&&w.visible).length;return B.filter(w=>w.visible).slice(...b?[W+1]:[0,W]).reduce((w,C)=>w+(C.height||0)+L,0)},[r]);return _(()=>{r.forEach(m=>{if(m.dismissed)a(m.id,m.removeDelay);else{let h=o.get(m.id);h&&(clearTimeout(h),o.delete(m.id))}})},[r,a]),{toasts:r,handlers:{updateHeight:d,startPause:c,endPause:u,calculateOffset:l}}},tn=J`
3
+ from {
4
+ transform: scale(0) rotate(45deg);
5
+ opacity: 0;
6
+ }
7
+ to {
8
+ transform: scale(1) rotate(45deg);
9
+ opacity: 1;
10
+ }`,nn=J`
11
+ from {
12
+ transform: scale(0);
13
+ opacity: 0;
14
+ }
15
+ to {
16
+ transform: scale(1);
17
+ opacity: 1;
18
+ }`,rn=J`
19
+ from {
20
+ transform: scale(0) rotate(90deg);
21
+ opacity: 0;
22
+ }
23
+ to {
24
+ transform: scale(1) rotate(90deg);
25
+ opacity: 1;
26
+ }`,sn=ee("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: ${tn} 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: ${nn} 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: ${rn} 0.15s ease-out forwards;
56
+ animation-delay: 180ms;
57
+ transform: rotate(90deg);
58
+ }
59
+ `,on=J`
60
+ from {
61
+ transform: rotate(0deg);
62
+ }
63
+ to {
64
+ transform: rotate(360deg);
65
+ }
66
+ `,an=ee("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: ${on} 1s linear infinite;
75
+ `,cn=J`
76
+ from {
77
+ transform: scale(0) rotate(45deg);
78
+ opacity: 0;
79
+ }
80
+ to {
81
+ transform: scale(1) rotate(45deg);
82
+ opacity: 1;
83
+ }`,ln=J`
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
+ }`,dn=ee("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: ${cn} 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: ${ln} 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
+ `,un=ee("div")`
125
+ position: absolute;
126
+ `,mn=ee("div")`
127
+ position: relative;
128
+ display: flex;
129
+ justify-content: center;
130
+ align-items: center;
131
+ min-width: 20px;
132
+ min-height: 20px;
133
+ `,hn=J`
134
+ from {
135
+ transform: scale(0.6);
136
+ opacity: 0.4;
137
+ }
138
+ to {
139
+ transform: scale(1);
140
+ opacity: 1;
141
+ }`,pn=ee("div")`
142
+ position: relative;
143
+ transform: scale(0.6);
144
+ opacity: 0.4;
145
+ min-width: 20px;
146
+ animation: ${hn} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
147
+ forwards;
148
+ `,gn=({toast:e})=>{let{icon:n,type:r,iconTheme:s}=e;return n!==void 0?typeof n=="string"?D(pn,null,n):n:r==="blank"?null:D(mn,null,D(an,{...s}),r!=="loading"&&D(un,null,r==="error"?D(sn,{...s}):D(dn,{...s})))},fn=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
+ `,vn=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
+ `,yn="0%{opacity:0;} 100%{opacity:1;}",_n="0%{opacity:1;} 100%{opacity:0;}",bn=ee("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
+ `,wn=ee("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
+ `,Sn=(e,n)=>{let r=e.includes("top")?1:-1,[s,o]=rt()?[yn,_n]:[fn(r),vn(r)];return{animation:n?`${J(s)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${J(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},kn=Et(({toast:e,position:n,style:r,children:s})=>{let o=e.height?Sn(e.position||n||"top-center",e.visible):{opacity:0},a=D(gn,{toast:e}),i=D(wn,{...e.ariaProps},ge(e.message,e));return D(bn,{className:e.className,style:{...o,...r,...e.style}},typeof s=="function"?s({icon:a,message:i}):D(F,null,a,i))});Ut(D);var Nn=({id:e,className:n,style:r,onHeightUpdate:s,children:o})=>{let a=R(i=>{if(i){let c=()=>{let d=i.getBoundingClientRect().height;s(e,d)};c(),new MutationObserver(c).observe(i,{subtree:!0,childList:!0,characterData:!0})}},[e,s]);return D("div",{ref:a,className:n,style:r},o)},In=(e,n)=>{let r=e.includes("top"),s=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:rt()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${n*(r?1:-1)}px)`,...s,...o}},Tn=ve`
174
+ z-index: 9999;
175
+ > * {
176
+ pointer-events: auto;
177
+ }
178
+ `,me=16,xn=({reverseOrder:e,position:n="top-center",toastOptions:r,gutter:s,children:o,toasterId:a,containerStyle:i,containerClassName:c})=>{let{toasts:d,handlers:u}=en(r,a);return D("div",{"data-rht-toaster":a||"",style:{position:"fixed",zIndex:9999,top:me,left:me,right:me,bottom:me,pointerEvents:"none",...i},className:c,onMouseEnter:u.startPause,onMouseLeave:u.endPause},d.map(l=>{let m=l.position||n,h=u.calculateOffset(l,{reverseOrder:e,gutter:s,defaultPosition:n}),b=In(m,h);return D(Nn,{id:l.id,key:l.id,onHeightUpdate:u.updateHeight,className:l.visible?Tn:"",style:b},l.type==="custom"?ge(l.message,l):o?o(l):D(kn,{toast:l,position:m}))}))},f=$;const ce=new Map,En=500,Cn=(e,n,r)=>{if(!e||e.trim()==="")return"/placeholder.svg";if(e.includes("/api/image-proxy")){let i=e;if(n&&!i.includes("w=")){const c=i.includes("?")?"&":"?";i+=`${c}w=${n}`}if(r&&!i.includes("h=")){const c=i.includes("?")?"&":"?";i+=`${c}h=${r}`}return i}let s=e;s.includes("aln.youtube-anime.com")&&(s=s.replace(/https?:\/\/allanime\.day\/aln\.youtube-anime\.com/,"https://aln.youtube-anime.com"),s.includes("/images/mcovers")&&(s=s.replace("/images/mcovers","/mcovers")),s.includes("/images/images2")&&(s=s.replace("/images/images2","/images2"))),s.includes("allanime.day/s4.anilist.co")&&(s=s.replace(/https?:\/\/allanime\.day\/s4\.anilist\.co/,"https://s4.anilist.co")),s.includes("wp.youtube-anime.com/s4.anilist.co")&&(s=s.replace(/https?:\/\/wp\.youtube-anime\.com\/s4\.anilist\.co/,"https://s4.anilist.co"));const o=`${s}-${n}-${r}`;if(ce.has(o))return ce.get(o);let a;if(s.startsWith("https://s4.anilist.co"))a=s,n&&(a+=`${a.includes("?")?"&":"?"}w=${n}`),r&&(a+=`${a.includes("?")?"&":"?"}h=${r}`);else if(s.includes("animepahe")){a=`/api/image-proxy?url=${encodeURIComponent(s)}`;const i=localStorage.getItem("animepahe_cookie"),c=localStorage.getItem("animepahe_ua");i&&(a+=`&cookie=${encodeURIComponent(i)}`),c&&(a+=`&ua=${encodeURIComponent(c)}`)}else if(s.startsWith("http"))a=`/api/image-proxy?url=${encodeURIComponent(s)}`,n&&(a+=`&w=${n}`),r?a+=`&h=${r}`:n||(a+="&w=300");else{const c=`${s.startsWith("mcovers")||s.startsWith("images2")?"https://aln.youtube-anime.com":"https://aln.youtube-anime.com/images"}/${s}`;a=`/api/image-proxy?url=${encodeURIComponent(c)}`,n&&(a+=`&w=${n}`),r?a+=`&h=${r}`:n||(a+="&w=300")}return ce.size>En&&ce.clear(),ce.set(o,a),a},Ia=e=>{if(isNaN(e)||e<=0)return"00:00";const n=new Date(e*1e3).toISOString().slice(11,19);return parseInt(n.slice(0,2),10)>0?n:n.slice(3)};function Ta(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 xa(e){return e==null?e:e>10?Number((e/10).toFixed(1)):e}const ct=te(void 0),$n=()=>{const e=ne(ct);if(e===void 0)throw new Error("useTitlePreference must be used within a TitlePreferenceProvider");return e},Te={lan:new Set,animepahe:new Set,jasmr:new Set};function we(e){for(const n of[...Te[e]])try{n()}catch(r){console.error(`auth-bus listener failed (${e}):`,r)}}function lt(e,n){return Te[e].add(n),()=>{Te[e].delete(n)}}const Ln=e=>new Promise(n=>setTimeout(n,e)),y=async(e,n)=>{const r={"Content-Type":"application/json"};if(e.startsWith("/")||typeof window<"u"&&e.startsWith(window.location.origin)){const a=localStorage.getItem("animepahe_ua"),i=localStorage.getItem("animepahe_cookie"),c=localStorage.getItem("jasmr_ua"),d=localStorage.getItem("jasmr_cookie");a&&(r["x-animepahe-ua"]=a),i&&(r["x-animepahe-cookie"]=i),c&&(r["x-jasmr-ua"]=c),d&&(r["x-jasmr-cookie"]=d)}let o=await fetch(e,{...n,headers:{...r,...n?.headers}});for(let a=0;o.status===503&&a<8;a++)await Ln(Math.min(500*2**a,4e3)),o=await fetch(e,{...n,headers:{...r,...n?.headers}});if(!o.ok){const a=await o.text().catch(()=>"");let i={};try{i=JSON.parse(a)}catch{}const c=typeof i.error=="string"?i.error:"";throw o.status===403&&c==="AUTH_REQUIRED"&&i.provider==="animepahe"&&we("animepahe"),o.status===403&&c==="AUTH_REQUIRED"&&i.provider==="jasmr"&&we("jasmr"),o.status===401&&c==="LAN_AUTH_REQUIRED"&&we("lan"),new Error(c||`Failed to fetch from ${e}`)}return o.json()},Ea=()=>M({queryKey:["spotlight"],queryFn:()=>y("/api/spotlight"),staleTime:1e3*60*5,retry:1}),Ca=(e="TRENDING_DESC",n=10)=>$e({queryKey:["trendingList",e,n],queryFn:({pageParam:r=1})=>y(`/api/popular-list?sort=${e}&page=${r}&size=${n}`),initialPageParam:1,getNextPageParam:(r,s)=>r.length>=n?s.length+1:void 0}),$a=(e="TV",n=12)=>$e({queryKey:["latestReleases",e,n],queryFn:({pageParam:r=1})=>y(`/api/latest-releases?format=${e}&page=${r}&size=${n}`),initialPageParam:1,getNextPageParam:(r,s)=>r.length>=n?s.length+1:void 0}),La=(e,n="TV",r=!0)=>M({queryKey:["currentSeason",e,n],queryFn:()=>y(`/api/seasonal?page=${e}&format=${n}&size=14`),enabled:r,staleTime:1e3*60*5}),Pa=(e,n,r=14)=>M({queryKey:["searchAnime",e,n,r],queryFn:async()=>{const s=new URLSearchParams(e);return s.set("page",n.toString()),s.set("limit",r.toString()),y(`/api/search?${s.toString()}`)},enabled:e!=null}),Aa=()=>M({queryKey:["queue"],queryFn:()=>y("/api/queue")}),Pn=()=>{const e=O();return j({mutationFn:async n=>y("/api/queue/add",{method:"POST",body:JSON.stringify(n)}),onSuccess:n=>{n.queued?f.success("Added to queue"):f.success("Removed from queue"),e.invalidateQueries({queryKey:["queue"]}),e.invalidateQueries({queryKey:["queue-remaining"]})},onError:n=>{f.error(`Failed to update queue: ${n.message}`)}})},Oa=()=>{const e=O();return j({mutationFn:async n=>{await y("/api/queue/remove",{method:"POST",body:JSON.stringify(n)})},onSuccess:()=>{f.success("Removed from queue"),e.invalidateQueries({queryKey:["queue"]}),e.invalidateQueries({queryKey:["queue-remaining"]}),e.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{f.error(`Failed to remove: ${n.message}`)}})},Da=(e,n=!0)=>M({queryKey:["queue-remaining",e],queryFn:()=>y(`/api/queue/remaining/${e}`),enabled:!!e&&n,staleTime:1e3*60}),Ra=()=>{const e=O();return j({mutationFn:async({episodeNumbers:n,...r})=>y("/api/queue/batch",{method:"POST",body:JSON.stringify({...r,episodeNumbers:n})}),onSuccess:(n,r)=>{const s=n.added??r.episodeNumbers.length;f.success(`${s} ${s===1?"episode":"episodes"} added to queue`),e.invalidateQueries({queryKey:["queue"]}),e.invalidateQueries({queryKey:["queue-remaining"]})},onError:n=>{f.error(`Failed to update queue: ${n.message}`)}})},qa=()=>{const e=O();return j({mutationFn:async({showId:n,episodeNumbers:r})=>{await y("/api/queue/remove-many",{method:"POST",body:JSON.stringify({showId:n,episodeNumbers:r})})},onSuccess:()=>{f.success("Removed from queue"),e.invalidateQueries({queryKey:["queue"]}),e.invalidateQueries({queryKey:["queue-remaining"]}),e.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{f.error(`Failed to remove: ${n.message}`)}})},Ma=()=>{const e=O();return j({mutationFn:async()=>{await y("/api/queue/clear",{method:"POST"})},onSuccess:()=>{f.success("Queue cleared"),e.invalidateQueries({queryKey:["queue"]}),e.invalidateQueries({queryKey:["queue-remaining"]}),e.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{f.error(`Failed to clear queue: ${n.message}`)}})},Ba=()=>{const e=O();return j({mutationFn:async n=>{await y("/api/queue/reorder",{method:"POST",body:JSON.stringify({items:n})})},onMutate:async n=>{await e.cancelQueries({queryKey:["queue"]});const r=e.getQueryData(["queue"]);return e.setQueryData(["queue"],s=>{if(!s)return s;const o=new Map(s.map(a=>[a.id,a]));return n.map((a,i)=>{const c=o.get(a.id);return c?{...c,queue_order:i}:void 0}).filter(a=>!!a)}),{previousQueue:r}},onError:(n,r,s)=>{s?.previousQueue&&e.setQueryData(["queue"],s.previousQueue)},onSettled:()=>{e.invalidateQueries({queryKey:["queue"]})}})},Fa=(e,n="",r,s=14)=>M({queryKey:["watchlist",e,n,r,s],queryFn:async()=>{const o=new URLSearchParams(n);return o.set("status",e),o.set("page",String(r)),o.set("limit",String(s)),y(`/api/watchlist?${o.toString()}`)}}),Ka=(e="")=>$e({queryKey:["allContinueWatching",e],queryFn:async({pageParam:n=1})=>{const r=new URLSearchParams(e);return r.set("page",String(n)),r.set("limit","14"),await y(`/api/continue-watching/all?${r.toString()}`)},initialPageParam:1,getNextPageParam:n=>{if(!(n.data.length===0||n.page*n.limit>=n.total))return n.page+1},select:n=>({...n,pages:n.pages.flatMap(r=>r.data)})}),ja=(e="",n,r=14)=>M({queryKey:["allContinueWatching",e,n,r],queryFn:async()=>{const s=new URLSearchParams(e);return s.set("page",String(n)),s.set("limit",String(r)),y(`/api/continue-watching/all?${s.toString()}`)}}),za=()=>{const e=O();return j({mutationFn:async n=>{await y("/api/watchlist/remove",{method:"POST",body:JSON.stringify({id:n})})},onSuccess:()=>{f.success("Removed from watchlist"),e.invalidateQueries({queryKey:["watchlist"]})},onError:n=>{f.error(`Failed to remove: ${n.message}`)}})},Wa=()=>{const e=O();return j({mutationFn:async({ids:n,status:r})=>y("/api/watchlist/batch-status",{method:"POST",body:JSON.stringify({ids:n,status:r})}),onSuccess:n=>{f.success(`Status updated for ${n.updated??0} items`),e.invalidateQueries({queryKey:["watchlist"]}),e.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{f.error(`Failed to update statuses: ${n.message}`)}})},Ua=()=>{const e=O();return j({mutationFn:async n=>y("/api/watchlist/remove-many",{method:"POST",body:JSON.stringify({ids:n})}),onSuccess:n=>{const r=n.removed??0;f.success(`Removed ${r} ${r===1?"item":"items"} from watchlist`),e.invalidateQueries({queryKey:["watchlist"]}),e.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{f.error(`Failed to remove: ${n.message}`)}})},Va=()=>{const e=O();return j({mutationFn:async n=>y("/api/continue-watching/remove-many",{method:"POST",body:JSON.stringify({ids:n})}),onSuccess:n=>{const r=n.removed??0;f.success(`Removed ${r} ${r===1?"item":"items"} from continue watching`),e.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{f.error(`Failed to remove: ${n.message}`)}})},dt=(e=!0)=>M({queryKey:["notifications"],queryFn:()=>y("/api/notifications"),enabled:e,refetchInterval:3e4}),ut=(e=!0)=>M({queryKey:["system-notifications"],queryFn:()=>y("/api/system-notifications"),enabled:e,refetchInterval:3e4}),mt=(e=!0)=>M({queryKey:["discovery-status"],queryFn:()=>y("/api/discovery/status"),enabled:e,refetchInterval:n=>n.state.data?.running?2e3:!1}),An=()=>{const e=O();return j({mutationFn:async()=>y("/api/discovery/refresh",{method:"POST"}),onSuccess:n=>{e.setQueryData(["discovery-status"],{running:n.running,state:n.state,total:n.total,done:n.done,lastRunAt:n.lastRunAt}),e.invalidateQueries({queryKey:["notifications"]})},onError:()=>{e.invalidateQueries({queryKey:["discovery-status"]})}})},On=()=>{const e=O();return j({mutationFn:async({showId:n,episodeNumber:r})=>{await y("/api/notifications/dismiss",{method:"POST",body:JSON.stringify({showId:n,episodeNumber:r})})},onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})},Dn=()=>{const e=O();return j({mutationFn:async n=>{await y("/api/notifications/clear-all",{method:"POST",body:JSON.stringify({showId:n})})},onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})},Qa=()=>M({queryKey:["thisWeekSchedule"],queryFn:()=>y("/api/continue-watching/this-week"),staleTime:1e3*60*5}),Ha=()=>M({queryKey:["genresAndTags"],queryFn:()=>y("/api/genres-and-tags"),staleTime:1e3*60*60}),Ja=()=>M({queryKey:["genreCards"],queryFn:()=>y("/api/insights/genre-cards")}),Rn="_container_z68uz_1",qn="_bellBtn_z68uz_7",Mn="_badge_z68uz_56",Bn="_dropdown_z68uz_96",Fn="_dropdownHeader_z68uz_127",Kn="_clearAllBtn_z68uz_141",jn="_discoveryStatusRow_z68uz_156",zn="_statusDot_z68uz_167",Wn="_statusDotRunning_z68uz_174",Un="_statusDotOk_z68uz_179",Vn="_statusDotInfo_z68uz_183",Qn="_statusDotError_z68uz_187",Hn="_statusDotIdle_z68uz_191",Jn="_list_z68uz_205",Yn="_item_z68uz_219",Gn="_thumbnail_z68uz_234",Zn="_itemInfo_z68uz_243",Xn="_itemTitle_z68uz_248",er="_itemMeta_z68uz_259",tr="_systemItemMeta_z68uz_269",nr="_removeItem_z68uz_286",rr="_queueItem_z68uz_316",sr="_emptyState_z68uz_320",p={container:Rn,bellBtn:qn,badge:Mn,dropdown:Bn,dropdownHeader:Fn,clearAllBtn:Kn,discoveryStatusRow:jn,statusDot:zn,statusDotRunning:Wn,statusDotOk:Un,statusDotInfo:Vn,statusDotError:Qn,statusDotIdle:Hn,list:Jn,item:Yn,thumbnail:Gn,itemInfo:Zn,itemTitle:Xn,itemMeta:er,systemItemMeta:tr,removeItem:nr,queueItem:rr,emptyState:sr},or=({notification:e})=>{const n=On(),r=Pn(),[s,o]=Ee.useState(!1),a=l=>{l.preventDefault(),l.stopPropagation(),n.mutate({showId:e.showId,episodeNumber:e.episodeNumber})},i=()=>{n.mutate({showId:e.showId,episodeNumber:e.episodeNumber})},c=l=>{l.preventDefault(),l.stopPropagation(),o(!0),r.mutate({showId:e.showId,episodeNumber:e.episodeNumber,showName:e.name,showThumbnail:e.thumbnail,nativeName:e.nativeName,englishName:e.englishName}),n.mutate({showId:e.showId,episodeNumber:e.episodeNumber}),window.setTimeout(()=>o(!1),1e3)},{titlePreference:d}=$n(),u=d==="nativeName"?e.nativeName||e.name:d==="englishName"&&e.englishName||e.name;return t(K,{to:`/watch/${e.showId}/${e.episodeNumber}`,className:p.item,onClick:i,children:[t("img",{src:Cn(e.thumbnail,48,64),alt:e.name,className:p.thumbnail,loading:"lazy",decoding:"async"}),t("div",{className:p.itemInfo,children:[t("span",{className:p.itemTitle,children:u}),t("span",{className:p.itemMeta,children:["New Episode ",e.episodeNumber]})]}),t("button",{className:`${p.removeItem} ${p.queueItem}`,onClick:c,"aria-label":"Add notification to queue",children:s?t(g,{name:"check"}):t(g,{name:"plus"})}),t("button",{className:p.removeItem,onClick:a,"aria-label":"Remove notification",children:t(g,{name:"times"})})]})};function Se({width:e="100%",height:n="1em",variant:r="rectangular",className:s="",style:o}){return t("div",{className:`skeleton skeleton-${r} ${s}`,style:{width:e,height:n,...o}})}const ar=({count:e=3})=>t(F,{children:Array.from({length:e}).map((n,r)=>t("div",{className:p.item,style:{borderBottom:"1px solid var(--border-primary)",pointerEvents:"none"},children:[t("div",{className:p.thumbnail,style:{overflow:"hidden"},children:t(Se,{width:"100%",height:"100%",variant:"rectangular"})}),t("div",{className:p.itemInfo,children:[t(Se,{width:"80%",height:"1rem",variant:"text",style:{marginBottom:"4px"}}),t(Se,{width:"40%",height:"0.7rem",variant:"rectangular",style:{borderRadius:"var(--radius-sm)"}})]})]},r))}),ir=()=>{const{data:e=[],isLoading:n}=dt(),{data:r=[]}=ut(),{data:s}=mt(),o=Dn(),a=O(),[i,c]=v(null);_(()=>{a.invalidateQueries({queryKey:["notifications"]})},[a]);const d=()=>{o.mutate(void 0)},u=r.find(l=>l.id===i)??null;return t("div",{className:p.dropdown,children:[t("div",{className:p.dropdownHeader,children:[t("h4",{children:"Notifications"}),e.length>0&&t("button",{className:p.clearAllBtn,onClick:d,children:"Clear All"})]}),t("div",{className:p.discoveryStatusRow,children:s?.running?t(F,{children:[t("span",{className:`${p.statusDot} ${p.statusDotRunning}`,"aria-hidden":"true"}),t("span",{children:s.total>0?`Checking ${Math.min(s.done,s.total)}/${s.total} shows...`:"Checking for new episodes..."})]}):s?.state==="complete"?t(F,{children:[t("span",{className:`${p.statusDot} ${p.statusDotOk}`,"aria-hidden":"true"}),t("span",{children:["Discovery complete — checked ",s.total," ",s.total===1?"show":"shows"]})]}):s?.state==="empty"?t(F,{children:[t("span",{className:`${p.statusDot} ${p.statusDotInfo}`,"aria-hidden":"true"}),t("span",{children:"No shows set to Watching — nothing to check"})]}):s?.state==="error"?t(F,{children:[t("span",{className:`${p.statusDot} ${p.statusDotError}`,"aria-hidden":"true"}),t("span",{children:"Last check failed — will retry automatically"})]}):t(F,{children:[t("span",{className:`${p.statusDot} ${p.statusDotIdle}`,"aria-hidden":"true"}),t("span",{children:s?.lastRunAt?`Last checked ${Math.max(1,Math.round((Date.now()-s.lastRunAt)/1e3))}s ago`:"Auto-checks every few minutes"})]})}),t("div",{className:p.list,children:n&&r.length===0?t(ar,{count:4}):t(F,{children:[r.map(l=>t("div",{className:p.item,children:[t("div",{className:p.thumbnail,style:{background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:0,boxShadow:"none"},children:t(g,{name:"info-circle",size:32,color:"#6c9fff"})}),t("div",{className:p.itemInfo,children:[t("span",{className:p.itemTitle,children:l.title}),t("button",{type:"button",className:p.systemItemMeta,onClick:()=>c(l.id),title:"View full status",children:l.message.length>40?l.message.slice(0,40)+"…":l.message})]}),t("button",{className:p.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:t(g,{name:"plus"})}),t("button",{className:p.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:t(g,{name:"times"})})]},l.id)),r.length>0&&e.length>0&&t("div",{className:p.notificationDivider}),e.length>0?e.map(l=>t(or,{notification:l},l.id)):!n&&r.length===0&&t("div",{className:p.emptyState,children:"No new notifications"})]})}),u&&Xe(t("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:t("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:l=>l.stopPropagation(),children:[t("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1rem"},children:[t(g,{name:"info-circle",color:"#6c9fff"}),t("span",{style:{color:"#fff",fontWeight:600,fontSize:"1rem"},children:u.title})]}),t("p",{style:{color:"var(--text-secondary)",marginBottom:"1.5rem",lineHeight:1.5},children:u.message}),t("div",{style:{display:"flex",justifyContent:"flex-end"},children:t("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)]})},cr=()=>{const[e,n]=v(!1),r=q(null),s=O(),o=An(),{data:a=[]}=dt(),{data:i=[]}=ut(),{data:c}=mt(),d=a.length+i.length,u=d>5?"5+":d,l=q(!1);_(()=>{const h=b=>{r.current&&!r.current.contains(b.target)&&n(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),_(()=>{const h=!!c?.running;l.current&&!h&&(s.invalidateQueries({queryKey:["notifications"]}),s.invalidateQueries({queryKey:["discovery-status"]})),l.current=h},[c?.running,s]);const m=()=>{const h=!e;n(h),h&&o.mutate()};return t("div",{className:p.container,ref:r,children:[t("button",{className:p.bellBtn,onClick:m,"aria-label":"Notifications",children:[t(g,{name:"bell"}),d>0&&t("span",{className:p.badge,children:u})]}),e&&t(ir,{})]})},ht=te(void 0),pt=()=>{const e=ne(ht);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Ya=[{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"}],Fe={iris:"/logo.png",mochi:"/logo-mochi.png",sakura:"/logo-sakura.png"},gt=({className:e})=>{const{theme:n}=pt(),r=Fe[n]||Fe.iris;return t("img",{src:r,alt:"dango",className:e,decoding:"async",style:{height:"var(--logo-height, 75px)",width:"auto",display:"block",objectFit:"contain"}})},ft=te(void 0),Pe=()=>{const e=ne(ft);if(e===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return e},vt=te(void 0),yt=()=>{const e=ne(vt);if(e===void 0)throw new Error("useContentType must be used within a ContentTypeProvider");return e},xe="virtual-keyboard:hide",Ke="virtual-keyboard:enabled-change",_t="virtual_keyboard_enabled",lr=!1;function je(){const e=localStorage.getItem(_t);return e===null?lr:e==="true"}const ze=e=>e instanceof HTMLInputElement&&e.type==="text"&&!e.disabled&&!e.readOnly;function dr(){window.dispatchEvent(new CustomEvent(xe))}function ur(){const[e,n]=v(!1),[r,s]=v(je),o=q(null);return _(()=>{const a=l=>{r&&ze(l.target)&&(o.current=l.target,n(!0))},i=l=>{l.target===o.current&&window.setTimeout(()=>{if(ze(document.activeElement)){o.current=document.activeElement,n(!0);return}o.current=null,n(!1)},0)},c=()=>{o.current=null,n(!1)},d=l=>{if(l.key!==_t)return;const m=l.newValue==="true";s(m),m||c()},u=()=>{const l=je();s(l),l||c()};return document.addEventListener("focusin",a),document.addEventListener("focusout",i),window.addEventListener(xe,c),window.addEventListener("storage",d),window.addEventListener(Ke,u),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",i),window.removeEventListener(xe,c),window.removeEventListener("storage",d),window.removeEventListener(Ke,u)}},[r]),{activeInputRef:o,isVisible:r&&e,hide:()=>n(!1)}}const mr="_header_rlbx9_1",hr="_hidden_rlbx9_21",pr="_scrolled_rlbx9_25",gr="_logo_rlbx9_31",fr="_headerInner_rlbx9_44",vr="_leftSection_rlbx9_54",yr="_desktopNav_rlbx9_60",_r="_navLink_rlbx9_67",br="_navLinkActive_rlbx9_83",wr="_rightSection_rlbx9_102",Sr="_searchWrapper_rlbx9_108",kr="_searchInput_rlbx9_114",Nr="_searchButton_rlbx9_146",Ir="_searchIcon_rlbx9_170",Tr="_profileBtn_rlbx9_180",xr="_profileImg_rlbx9_213",Er="_hamburgerBtn_rlbx9_219",Cr="_mobileSearchBar_rlbx9_247",$r="_mobileSearchInner_rlbx9_283",Lr="_mobileSearchIcon_rlbx9_293",Pr="_mobileSearchInput_rlbx9_300",k={header:mr,hidden:hr,scrolled:pr,logo:gr,headerInner:fr,leftSection:vr,desktopNav:yr,navLink:_r,navLinkActive:br,rightSection:wr,searchWrapper:Sr,searchInput:kr,searchButton:Nr,searchIcon:Ir,profileBtn:Tr,profileImg:xr,hamburgerBtn:Er,mobileSearchBar:Cr,mobileSearchInner:$r,mobileSearchIcon:Lr,mobileSearchInput:Pr},Ar=async()=>{const e=await fetch("/api/auth/settings/sync");if(!e.ok)return null;const r=(await e.json()).actualActiveProvider;if(r==="github"){const s=await fetch("/api/auth/github/status");if(s.ok){const o=await s.json();if(o.authenticated&&o.user)return{name:o.user.name||o.user.login,picture:o.user.avatarUrl,provider:"github"}}}if(r==="google"){const s=await fetch("/api/auth/user");if(s.ok){const o=await s.json();if(o)return{name:o.name,picture:o.picture,email:o.email,provider:"google"}}}return null},Or=()=>{const{toggleSidebar:e}=Pe(),{contentType:n}=yt(),[r,s]=v(""),[o,a]=v(!0),[i,c]=v(!1),[d,u]=v(!0),[l,m]=v(!1),h=et(),b=Ce(),L=q(null),z=q(!1),B=q(null),Q=q(null),W=q(null),{data:w}=M({queryKey:["sync-profile"],queryFn:Ar,staleTime:3e4});_(()=>{const P=()=>{L.current&&(window.clearTimeout(L.current),L.current=null)},G=()=>{z.current||(z.current=!0,B.current=requestAnimationFrame(()=>{z.current=!1,B.current=null;const H=window.scrollY<=10;u(ie=>ie===H?ie:H),a(ie=>ie||!0),P(),H||(L.current=window.setTimeout(()=>{a(!1)},2500))}))},De=H=>{(H.metaKey||H.ctrlKey)&&H.key==="k"?(H.preventDefault(),C.current?.focus()):H.key==="Escape"&&document.activeElement===C.current&&C.current?.blur()};return window.addEventListener("scroll",G,{passive:!0}),window.addEventListener("keydown",De),()=>{window.removeEventListener("scroll",G),window.removeEventListener("keydown",De),P(),B.current!==null&&(cancelAnimationFrame(B.current),B.current=null),z.current=!1}},[i]);const C=Ee.useRef(null),oe=()=>window.innerWidth<=1024,_e=()=>{oe()?(m(!0),setTimeout(()=>W.current?.focus(),50)):document.activeElement===C.current&&r.trim()?be():C.current?.focus()},Y=P=>{Q.current?.contains(P.relatedTarget)||m(!1)},ue=n==="manga"?"Search manga...":n==="tv"?"Search TV & movies...":n==="asmr"?"Search ASMR...":"Search anime...",ae=n==="manga"?{to:"/reading-list",label:"Reading List"}:n==="tv"?{to:"/tv-watchlist",label:"TV Watchlist"}:n==="asmr"?{to:"/listening-list",label:"Listening List"}:{to:"/watchlist",label:"Watchlist"},be=P=>{dr();const G=r.trim();G&&h(n==="manga"?`/manga?q=${encodeURIComponent(G)}`:n==="tv"?`/tv-search?q=${encodeURIComponent(G)}`:n==="asmr"?`/asmr?q=${encodeURIComponent(G)}`:`/search?query=${encodeURIComponent(G)}`)};return t(F,{children:[t("header",{className:`${k.header} ${o?"":k.hidden} ${d?"":k.scrolled}`,children:t("div",{className:k.headerInner,children:[t("div",{className:k.leftSection,children:[t("button",{className:k.hamburgerBtn,onClick:e,"aria-label":"Menu",children:t(g,{name:"bars"})}),t(K,{to:"/",className:k.logo,"aria-label":"Ani-Web Home",children:t(gt,{})}),t("nav",{className:k.desktopNav,children:[t(K,{to:"/",className:`${k.navLink} ${b.pathname==="/"?k.navLinkActive:""}`,children:"Home"}),t(K,{to:ae.to,className:`${k.navLink} ${b.pathname.startsWith(ae.to)?k.navLinkActive:""}`,children:ae.label}),t(K,{to:"/insights",className:`${k.navLink} ${b.pathname==="/insights"?k.navLinkActive:""}`,children:"Insights"}),t(K,{to:"/settings",className:`${k.navLink} ${b.pathname.startsWith("/settings")?k.navLinkActive:""}`,children:"Settings"})]})]}),t("div",{className:k.rightSection,children:[t("div",{className:k.searchWrapper,children:[t("input",{ref:C,type:"text","data-virtual-keyboard":"true",className:k.searchInput,placeholder:ue,value:r,onChange:P=>s(P.target.value),onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:P=>{P.key==="Enter"&&be()}}),t("button",{type:"button",className:k.searchButton,"aria-label":"Search",onMouseDown:P=>P.preventDefault(),onClick:_e,children:t(g,{name:"search",className:k.searchIcon})})]}),t(cr,{}),t(K,{to:"/settings?tab=sync",className:k.profileBtn,"aria-label":"Sync settings",children:w?.picture?t("img",{src:w.picture,alt:w.name,className:k.profileImg,referrerPolicy:"no-referrer",decoding:"async"}):w?.provider==="github"?t(g,{name:"github"}):t(g,{name:"cloud"})})]})]})}),l&&t("div",{className:k.mobileSearchBar,ref:Q,onBlur:Y,children:t("div",{className:k.mobileSearchInner,children:[t(g,{name:"search",className:k.mobileSearchIcon}),t("input",{ref:W,type:"text","data-virtual-keyboard":"true",className:k.mobileSearchInput,placeholder:ue,value:r,onChange:P=>s(P.target.value),onKeyDown:P=>{P.key==="Enter"?(be(),m(!1)):P.key==="Escape"&&m(!1)}})]})})]})},Dr="_sidebar_153jc_1",Rr="_open_153jc_20",qr="_sidebarHeader_153jc_25",Mr="_closeBtn_153jc_33",Br="_logo_153jc_57",Fr="_navSection_153jc_69",Kr="_navLink_153jc_75",jr="_active_153jc_108",zr="_overlay_153jc_118",Wr="_versionInfo_153jc_138",U={sidebar:Dr,open:Rr,sidebarHeader:qr,closeBtn:Mr,logo:Br,navSection:Fr,navLink:Kr,active:jr,overlay:zr,versionInfo:Wr},Ur="dango-client",Vr="3.3.6",Qr="module",Hr={node:">=22.12.0"},Jr={start:"vite",dev:"vite",build:"tsc && vite build",lint:"eslint .",test:"vitest run",preview:"vite preview","start:prod":"vite preview",format:"prettier --write ."},Yr={"@floating-ui/react":"^0.27.20","@tanstack/react-query":"^5.99.2","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"},Gr={"@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"},Ae={name:Ur,private:!0,version:Vr,type:Qr,engines:Hr,scripts:Jr,dependencies:Yr,devDependencies:Gr},Zr=()=>{const{isOpen:e,setIsOpen:n}=Pe(),{contentType:r}=yt(),[s,o]=v(()=>localStorage.getItem("agreedToViewMature")==="true");_(()=>{const l=()=>o(localStorage.getItem("agreedToViewMature")==="true");return window.addEventListener("storage",l),window.addEventListener("focus",l),()=>{window.removeEventListener("storage",l),window.removeEventListener("focus",l)}},[]);const a=()=>{n(!1)},i=r==="manga",c=r==="tv",d=r==="asmr",u=[{to:"/",icon:t(g,{name:"home"}),label:"Home"},i?{to:"/manga",icon:t(g,{name:"book"}),label:"Manga"}:c?{to:"/tv-search",icon:t(g,{name:"tv"}),label:"TV and Movies"}:d?{to:"/asmr",icon:t(g,{name:"headphones"}),label:"ASMR"}:{to:"/search",icon:t(g,{name:"search"}),label:"Search"},i?{to:"/reading-list",icon:t(g,{name:"bookmark"}),label:"Reading List"}:c?{to:"/tv-watchlist",icon:t(g,{name:"clock"}),label:"TV Watchlist"}:d?{to:"/listening-list",icon:t(g,{name:"history"}),label:"Listening List"}:{to:"/watchlist",icon:t(g,{name:"clock"}),label:"Watchlist"},{to:"/insights",icon:t(g,{name:"chart-pie"}),label:"Insights"},{to:"/trackers",icon:t(g,{name:"sync-alt"}),label:"Trackers"},{to:"/radio",icon:t(g,{name:"broadcast-tower"}),label:"Radio"},{to:"/music",icon:t(g,{name:"headphones"}),label:"Music"},...s?[{to:"/mature",icon:t(g,{name:"pepper-hot"}),label:"Mature"}]:[],{to:"/settings",icon:t(g,{name:"cog"}),label:"Settings"}];return t(F,{children:[t("aside",{className:`${U.sidebar} ${e?U.open:""} sidebar`,children:[t("div",{className:U.sidebarHeader,children:[t("button",{className:U.closeBtn,onClick:()=>n(!1),"aria-label":"Close menu",children:"×"}),t(K,{to:"/",className:U.logo,onClick:a,children:t(gt,{})})]}),t("nav",{className:U.navSection,children:u.map(l=>t(Ct,{to:l.to,className:({isActive:m})=>`${U.navLink} ${m?U.active:""}`,onClick:a,end:l.to==="/",children:[l.icon,t("span",{children:l.label})]},l.to))}),t("div",{className:U.versionInfo,children:["v",Ae.version]})]}),e&&t("div",{className:U.overlay,onClick:()=>n(!1),"aria-label":"Close sidebar"})]})},Xr="_footer_1p5nb_1",es="_footerInner_1p5nb_15",ts="_brandSection_1p5nb_27",ns="_logoRow_1p5nb_39",rs="_logoText_1p5nb_59",ss="_brandMeta_1p5nb_65",os="_brandTagline_1p5nb_74",as="_statusPill_1p5nb_81",is="_statusDot_1p5nb_94",cs="_linksGrid_1p5nb_102",ls="_linkColumn_1p5nb_110",ds="_columnTitle_1p5nb_116",us="_bottomBar_1p5nb_140",ms="_copyright_1p5nb_150",hs="_brand_1p5nb_27",ps="_heartIcon_1p5nb_166",gs="_backToTop_1p5nb_171",x={footer:Xr,footerInner:es,brandSection:ts,logoRow:ns,logoText:rs,brandMeta:ss,brandTagline:os,statusPill:as,statusDot:is,linksGrid:cs,linkColumn:ls,columnTitle:ds,bottomBar:us,copyright:ms,brand:hs,heartIcon:ps,backToTop:gs},We={iris:"/logo.png",mochi:"/logo-mochi.png",sakura:"/logo-sakura.png"},fs=()=>{const{theme:e}=pt(),n=We[e]||We.iris,r=new Date().getFullYear(),s=()=>{window.scrollTo({top:0,behavior:"smooth"})};return t("footer",{className:x.footer,children:[t("div",{className:x.footerInner,children:[t("div",{className:x.brandSection,children:[t("div",{className:x.logoRow,children:t("img",{src:n,className:x.logoText,alt:"dango",loading:"lazy",decoding:"async"})}),t("div",{className:x.brandMeta,children:[t("div",{className:x.statusPill,children:[t("span",{className:x.statusDot}),t("span",{children:["v",Ae.version]})]}),t("p",{className:x.brandTagline,children:"Fast, local anime streaming."})]})]}),t("div",{className:x.linksGrid,children:[t("div",{className:x.linkColumn,children:[t("h4",{className:x.columnTitle,children:"Navigation"}),t(K,{to:"/",children:"Home"}),t(K,{to:"/watchlist",children:"Watchlist"}),t(K,{to:"/settings",children:"Settings"})]}),t("div",{className:x.linkColumn,children:[t("h4",{className:x.columnTitle,children:"Features"}),t(K,{to:"/search",children:"Search Anime"}),t(K,{to:"/trackers",children:"Trackers"}),t(K,{to:"/insights",children:"Insights"})]}),t("div",{className:x.linkColumn,children:[t("h4",{className:x.columnTitle,children:"Community"}),t("a",{href:"https://discord.gg/2FTSPXCsvn",target:"_blank",rel:"noopener noreferrer",children:[t(g,{name:"discord",style:{marginRight:"6px"}})," Discord"]}),t("a",{href:"https://github.com/serifpersia/dango",target:"_blank",rel:"noopener noreferrer",children:[t(g,{name:"github",style:{marginRight:"6px"}})," GitHub"]})]}),t("div",{className:x.linkColumn,children:[t("h4",{className:x.columnTitle,children:"Project"}),t("a",{href:"https://github.com/serifpersia/dango/releases",target:"_blank",rel:"noopener noreferrer",children:"Releases"}),t("a",{href:"https://github.com/serifpersia/dango/issues",target:"_blank",rel:"noopener noreferrer",children:"Feedback"})]})]})]}),t("div",{className:x.bottomBar,children:[t("p",{className:x.copyright,children:["© ",r," ",t("span",{className:x.brand,children:"dango"})," • Crafted with"," ",t(g,{name:"heart",className:x.heartIcon})," by"," ",t("a",{href:"https://github.com/serifpersia",target:"_blank",rel:"noopener noreferrer",children:"serifpersia"})]}),t("button",{className:x.backToTop,onClick:s,"aria-label":"Back to top",children:[t(g,{name:"chevron-up",size:14}),t("span",{children:"Top"})]})]})]})},vs=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2)+Date.now().toString(36),fe="https://script.google.com/macros/s/AKfycbxpllCbhqNjqFN02er9WV-0Tv-Y9br13UqXZqGHzSMetAgqKaFX5oFKGHgxji1fxJ6udw/exec",ys=()=>{const e=navigator.userAgent;let n="Unknown Browser",r="Unknown OS";return e.includes("Firefox")?n="Firefox":e.includes("SamsungBrowser")?n="Samsung Browser":e.includes("Opera")||e.includes("OPR")?n="Opera":e.includes("Trident")?n="Internet Explorer":e.includes("Edge")?n="Edge":e.includes("Chrome")?n="Chrome":e.includes("Safari")&&(n="Safari"),e.includes("Windows")?r="Windows":e.includes("Mac")?r="MacOS":e.includes("Linux")?r="Linux":e.includes("Android")?r="Android":(e.includes("iPhone")||e.includes("iPad")||e.includes("iPod"))&&(r="iOS"),`${n} on ${r}`},_s=async()=>{localStorage.removeItem("last_telemetry_ping");const e=localStorage.getItem("installation_id");if(e&&fe)try{await fetch(fe,{method:"POST",mode:"no-cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"delete"})})}catch(n){console.error("Telemetry delete request failed:",n)}};let ke=!1;const bs=async()=>{if(!ke){ke=!0,localStorage.setItem("last_telemetry_ping",Date.now().toString());try{let e=localStorage.getItem("installation_id");if(!e)try{const r=await(await fetch("/api/installation-id")).json();r.id&&(e=r.id,localStorage.setItem("installation_id",e))}catch(n){console.error("Failed to fetch hardware ID:",n)}e||(e=vs(),localStorage.setItem("installation_id",e)),await fetch(fe,{method:"POST",mode:"no-cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,version:Ae.version,userAgent:ys(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})})}catch(e){console.error("Telemetry ping failed:",e)}finally{ke=!1}}},ws=()=>{const[e,n]=v(!1);return _(()=>{if(!localStorage.getItem("telemetry_notice_v2")){const s=setTimeout(()=>n(!0),3e3);return()=>clearTimeout(s)}},[]),_(()=>{if(!(localStorage.getItem("telemetry_enabled")!=="false")||!fe)return;const s=localStorage.getItem("last_telemetry_ping"),o=Date.now(),a=1440*60*1e3;s&&o-parseInt(s)<a||bs()},[]),{showTelemetryModal:e,setShowTelemetryModal:n}},Ss="_overlay_1juub_1",ks="_fadeIn_1juub_1",Ns="_content_1juub_11",Is="_modalIn_1juub_1",Ts="_sm_1juub_29",xs="_md_1juub_33",Es="_lg_1juub_37",Cs="_title_1juub_41",$s="_body_1juub_48",Ls="_footer_1juub_52",re={overlay:Ss,fadeIn:ks,content:Ns,modalIn:Is,sm:Ts,md:xs,lg:Es,title:Cs,body:$s,footer:Ls};function bt({children:e}){return t("h2",{className:re.title,children:e})}function wt({children:e}){return t("div",{className:re.body,children:e})}function St({children:e}){return t("div",{className:re.footer,children:e})}function se({isOpen:e,onClose:n,title:r,children:s,footer:o,width:a="md"}){const i=q(null);return _(()=>{if(!e)return;const c=u=>{u.key==="Escape"&&n?.()};document.addEventListener("keydown",c);const d=document.body.style.overflow;return document.body.style.overflow="hidden",i.current?.focus(),()=>{document.removeEventListener("keydown",c),document.body.style.overflow=d}},[e,n]),e?Xe(t("div",{role:"presentation",onMouseDown:c=>c.stopPropagation(),children:[t("div",{className:re.overlay,onClick:()=>n?.(),"aria-hidden":"true"}),t("div",{ref:i,className:`${re.content} ${re[a]}`,role:"dialog","aria-modal":"true","aria-label":r,tabIndex:-1,children:[r&&t(bt,{children:r}),t(wt,{children:s}),o&&t(St,{children:o})]})]}),document.body):null}se.Header=bt;se.Body=wt;se.Actions=St;const Ps="_slider_1f1gi_15",Ue={switch:"_switch_1f1gi_1",slider:Ps},As=({isChecked:e,onChange:n,id:r,disabled:s=!1})=>t("label",{className:Ue.switch,htmlFor:r,children:[t("input",{type:"checkbox",id:r,checked:e,onChange:n,disabled:s}),t("span",{className:Ue.slider})]}),Os="_container_1hh92_1",Ds="_description_1hh92_8",Rs="_dataList_1hh92_14",qs="_dataTitle_1hh92_20",Ms="_toggleRow_1hh92_39",Bs="_toggleLabel_1hh92_46",Fs="_actions_1hh92_50",Ks="_okButton_1hh92_55",js="_previewToggle_1hh92_71",zs="_chevron_1hh92_89",Ws="_chevronOpen_1hh92_94",Us="_previewBox_1hh92_98",Vs="_previewItem_1hh92_107",Qs="_previewKey_1hh92_114",Hs="_previewVal_1hh92_118",N={container:Os,description:Ds,dataList:Rs,dataTitle:qs,toggleRow:Ms,toggleLabel:Bs,actions:Fs,okButton:Ks,previewToggle:js,chevron:zs,chevronOpen:Ws,previewBox:Us,previewItem:Vs,previewKey:Qs,previewVal:Hs},Js="3.3.6",Ys={version:Js},Gs=()=>{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"},Zs=()=>{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"},Xs=({isOpen:e,onClose:n})=>{const[r,s]=v(!0),[o,a]=v(!1),i=()=>{localStorage.setItem("telemetry_enabled",String(r)),localStorage.setItem("telemetry_notice_v2","true"),r||_s(),n()};return t(se,{isOpen:e,onClose:()=>{},title:"Telemetry",children:t("div",{className:N.container,children:[t("p",{className:N.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."}),t("div",{className:N.dataList,children:[t("p",{className:N.dataTitle,children:"What is collected:"}),t("ul",{children:[t("li",{children:"Browser type and operating system"}),t("li",{children:"Your timezone (e.g. Europe/Berlin)"}),t("li",{children:"Anonymous timestamps (first seen / last seen)"})]})]}),t("button",{className:N.previewToggle,onClick:()=>a(!o),children:[t("span",{children:"See exactly what data is sent"}),t(g,{name:"chevron-down",className:`${N.chevron} ${o?N.chevronOpen:""}`})]}),o&&t("div",{className:N.previewBox,children:[t("div",{className:N.previewItem,children:[t("span",{className:N.previewKey,children:"Browser:"}),t("span",{className:N.previewVal,children:Gs()})]}),t("div",{className:N.previewItem,children:[t("span",{className:N.previewKey,children:"OS:"}),t("span",{className:N.previewVal,children:Zs()})]}),t("div",{className:N.previewItem,children:[t("span",{className:N.previewKey,children:"Timezone:"}),t("span",{className:N.previewVal,children:Intl.DateTimeFormat().resolvedOptions().timeZone})]}),t("div",{className:N.previewItem,children:[t("span",{className:N.previewKey,children:"App Version:"}),t("span",{className:N.previewVal,children:Ys.version})]})]}),t("div",{className:N.toggleRow,children:[t("span",{className:N.toggleLabel,children:"Send anonymous telemetry"}),t(As,{isChecked:r,onChange:c=>s(c.target.checked),id:"telemetry-notice-toggle"})]}),t("div",{className:N.actions,children:t("button",{className:N.okButton,onClick:i,children:"Ok"})})]})})},eo="_promoWrapper_1vfnt_1",to="_visible_1vfnt_11",no="_panel_1vfnt_16",ro="_closeBtn_1vfnt_29",so="_header_1vfnt_55",oo="_discordIcon_1vfnt_62",ao="_headerText_1vfnt_74",io="_body_1vfnt_89",co="_rolePreview_1vfnt_96",lo="_badge_1vfnt_103",uo="_badgeRank_1vfnt_111",mo="_badgeDere_1vfnt_117",ho="_actions_1vfnt_123",po="_btnJoin_1vfnt_129",go="_btnSettings_1vfnt_155",fo="_skipLink_1vfnt_180",vo="_hint_1vfnt_200",E={promoWrapper:eo,visible:to,panel:no,closeBtn:ro,header:so,discordIcon:oo,headerText:ao,body:io,rolePreview:co,badge:lo,badgeRank:uo,badgeDere:mo,actions:ho,btnJoin:po,btnSettings:go,skipLink:fo,hint:vo},Ve="discord_community_promo_dismissed",yo=4500;function _o({workerUrl:e}){const n=et(),[r,s]=v(!1),o=q(!1);_(()=>{if(localStorage.getItem(Ve)==="true"||localStorage.getItem("dango_discord_user"))return;const c=setTimeout(()=>s(!0),yo);return()=>clearTimeout(c)},[]);const a=()=>{o.current||(o.current=!0,s(!1),localStorage.setItem(Ve,"true"))},i=()=>{a(),n("/settings?tab=community")};return e?t("div",{className:`${E.promoWrapper} ${r?E.visible:""}`,"aria-live":"polite",children:t("div",{className:E.panel,children:[t("button",{className:E.closeBtn,onClick:a,"aria-label":"Dismiss",children:"✕"}),t("div",{className:E.header,children:[t("div",{className:E.discordIcon,children:t("svg",{width:"20",height:"16",viewBox:"0 0 71 55",fill:"white","aria-hidden":"true",children:t("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"})})}),t("div",{className:E.headerText,children:[t("h4",{children:"Join the Dango Community"}),t("p",{children:"Earn roles based on your watch stats"})]})]}),t("div",{className:E.body,children:[t("p",{style:{margin:"0 0 6px"},children:"Connect your Discord account and earn exclusive server roles based on how much you watch:"}),t("div",{className:E.rolePreview,children:[t("span",{className:`${E.badge} ${E.badgeRank}`,children:"S-Rank"}),t("span",{className:`${E.badge} ${E.badgeRank}`,children:"F–A Rank"}),t("span",{className:`${E.badge} ${E.badgeDere}`,children:"Tsundere"}),t("span",{className:`${E.badge} ${E.badgeDere}`,children:"Kamidere…"})]})]}),t("div",{className:E.actions,children:[t("a",{className:E.btnJoin,href:"https://discord.gg/6yPAZjDzg8",target:"_blank",rel:"noopener noreferrer",children:[t("svg",{width:"16",height:"12",viewBox:"0 0 71 55",fill:"currentColor","aria-hidden":"true",children:t("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"]}),t("button",{className:E.btnSettings,onClick:i,children:[t("span",{children:"⚙"})," Get Roles & Settings"]})]}),t("button",{className:E.skipLink,onClick:a,children:"Skip — don't show again"}),t("p",{className:E.hint,children:"You can always find this in Settings → Community"})]})}):null}const bo=async e=>(await y(`/api/settings?key=${e}`)).value,wo=async({key:e,value:n})=>y("/api/settings",{method:"POST",body:JSON.stringify({key:e,value:n})}),Oe=e=>M({queryKey:["settings",e],queryFn:()=>bo(e)}),kt=()=>{const e=O();return j({mutationFn:wo,onSuccess:()=>{f.success("Setting updated!"),e.invalidateQueries({queryKey:["settings"]})},onError:n=>{f.error(`Failed to update setting: ${n.message}`)}})};function So(){const e=Ce(),{data:n}=Oe("discordRPCEnabled"),r=q("");r.current||(r.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`tab-${Date.now()}-${Math.random().toString(36).slice(2)}`),_(()=>{if(n===!1||n==="false")return;const s=r.current,o=()=>fetch("/api/discord/heartbeat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s})}).catch(()=>{});o();const a=setInterval(o,15e3),i=()=>{navigator.sendBeacon("/api/discord/heartbeat",new Blob([JSON.stringify({sessionId:s,bye:!0})],{type:"application/json"}))};return window.addEventListener("pagehide",i),()=>{clearInterval(a),window.removeEventListener("pagehide",i)}},[n]),_(()=>{if(n===!1||n==="false")return;const s=e.pathname;if(s.startsWith("/watch/")||s.startsWith("/player/"))return;let o="home";s.startsWith("/search")||s.startsWith("/mature")?o="search":s.startsWith("/watchlist")?o="watchlist":s.startsWith("/anime/")?o="anime":s.startsWith("/insights")?o="insights":s.startsWith("/settings")?o="settings":s.startsWith("/map")?o="map":s.startsWith("/trackers")?o="trackers":s.startsWith("/asmr")?o="asmr":s.startsWith("/manga")?o="manga":s.startsWith("/radio")?o="radio":s.startsWith("/music")?o="music":s.startsWith("/tv")&&(o="tv"),fetch("/api/discord/status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:o})}).catch(()=>{})},[e.pathname,n])}function Nt(e,n){const[r,s]=v(()=>{try{const a=localStorage.getItem(e);if(a===null)return n;if(typeof n=="string")return a;try{return JSON.parse(a)}catch{return a}}catch{return n}});_(()=>{const a=i=>{if(i.key===e)try{if(i.newValue===null){s(n);return}if(typeof n=="string"){s(i.newValue);return}try{s(JSON.parse(i.newValue))}catch{s(i.newValue)}}catch{}};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[e,n]);const o=R(a=>{s(i=>{const c=typeof a=="function"?a(i):a;try{typeof c=="string"?localStorage.setItem(e,c):localStorage.setItem(e,JSON.stringify(c))}catch{}return c})},[e]);return[r,o]}const It=te(void 0),ko=()=>{const e=ne(It);if(!e)throw new Error("useAnimePaheCookie must be used within an AnimePaheCookieProvider");return e},No="_container_e96gf_1",Io="_field_e96gf_9",To="_textarea_e96gf_20",xo="_input_e96gf_40",Eo="_button_e96gf_58",Co="_secondaryButton_e96gf_78",$o="_actions_e96gf_95",Lo="_hint_e96gf_104",Po="_link_e96gf_117",A={container:No,field:Io,textarea:To,input:xo,button:Eo,secondaryButton:Co,actions:$o,hint:Lo,link:Po},Ao="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",Oo=e=>{try{return JSON.parse(e.detail)}catch{return null}},Do=({isOpen:e,onClose:n,onSuccess:r})=>{const[s,o]=v(1),[a,i]=v(navigator.userAgent),[c,d]=v(""),[u,l]=v(!1),m=q(null),h=navigator.userAgent,b=/android/i.test(h),L=/firefox|fxios/i.test(h)&&!b,z=!L&&!b&&/chrome|chromium|edg|brave/i.test(h),B=L||z;_(()=>{e&&(o(1),i(navigator.userAgent),d(""),l(!1))},[e]),_(()=>()=>{m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null)},[]);const Q=()=>{localStorage.setItem("animepahe_ua",a),window.open("https://animepahe.pw","_blank","noopener,noreferrer"),o(2)},W=()=>{if(u)return;l(!0);const C=window.setTimeout(()=>{l(!1),m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null),f.error("Helper not detected — install it via about:debugging first.")},3e3),oe=_e=>{window.clearTimeout(C),window.removeEventListener("dango:pahe-cookie",oe),m.current=null,l(!1);const Y=Oo(_e);if(Y?.ok&&Y.cookie)d(Y.cookie),f.success("Cookie extracted from helper!");else if(Y?.error==="NO_COOKIE"){const ue=Y.debug?.stores?.length??0,ae=Y.debug?.names??[];f.error(`Helper found no cf_clearance (checked ${ue} stores, saw: ${ae.join(", ")||"none"}) — solve the challenge on the AnimePahe tab first.`)}else f.error("Helper request failed — try again.")};m.current=oe,window.addEventListener("dango:pahe-cookie",oe),window.dispatchEvent(new CustomEvent("dango:get-pahe-cookie"))},w=()=>{const C=c.trim();if(!C){f.error("Please enter the cf_clearance cookie");return}try{localStorage.setItem("animepahe_cookie",C),f.success("Cookie updated successfully! Reloading…"),r?.(),n(),window.setTimeout(()=>window.location.reload(),1e3)}catch{f.error("Failed to save cookie")}};return t(se,{isOpen:e,onClose:n,title:"AnimePahe Verification Required",children:t("div",{className:A.container,children:s===1?t(F,{children:[t("p",{children:"AnimePahe requires a manual verification to bypass Cloudflare/DDoS-Guard protection."}),t("div",{className:A.field,children:[t("label",{children:"Your User-Agent (will be used for requests):"}),t("textarea",{value:a,readOnly:!0,rows:3,className:A.textarea})]}),t("div",{className:A.actions,children:[t("button",{className:A.secondaryButton,onClick:n,children:"Cancel"}),t("button",{className:A.button,onClick:Q,children:"Start Verification (Opens AnimePahe)"})]})]}):t(F,{children:[t("p",{children:["1. Solve the challenge on the ",t("strong",{children:"AnimePahe tab"})," (keep that tab open).",t("br",{}),"2. Copy the ",t("strong",{children:"cf_clearance"})," cookie value using one of these:",t("br",{}),t("br",{}),t("strong",{children:"Chrome / Edge — DevTools:"})," press ",t("code",{children:"F12"})," →"," ",t("strong",{children:"Application"})," → ",t("strong",{children:"Cookies"})," →"," ",t("code",{children:"https://animepahe.pw"}),". Find ",t("strong",{children:"cf_clearance"}),", double-click its ",t("strong",{children:"Value"})," to select it, then copy.",t("br",{}),t("br",{}),t("strong",{children:"Firefox — Storage Inspector:"})," press ",t("code",{children:"F12"})," →"," ",t("strong",{children:"Storage"})," → ",t("strong",{children:"Cookies"})," →"," ",t("code",{children:"https://animepahe.pw"}),". Find ",t("strong",{children:"cf_clearance"}),", right-click the value → ",t("strong",{children:"Copy Value"}),".",t("br",{}),t("br",{}),t("strong",{children:"Either browser — extension:"})," open"," ",t("strong",{children:"Cookie Manager"})," while on the AnimePahe tab, find"," ",t("strong",{children:"cf_clearance"}),", and copy its value (or use the extension's export).",t("br",{}),t("br",{}),"3. Paste it below. Copy ",t("strong",{children:"only the value"})," — remove any"," ",t("code",{children:"cf_clearance="})," prefix or quotes if they were included."]}),B&&t("div",{className:A.hint,children:[t("strong",{children:"Dango helper (one-time setup):"})," ",L?t(F,{children:["type ",t("code",{children:"about:debugging"})," in the address bar →"," ",t("strong",{children:"This Firefox"})," → ",t("strong",{children:"Load Temporary Add-on"})," ","→ open the ",t("code",{children:"dango-extension/firefox"})," folder and pick"," ",t("code",{children:"manifest.json"}),". (Temporary helpers unload when Firefox closes — repeat after a restart.)"]}):t(F,{children:["type ",t("code",{children:"chrome://extensions"})," in the address bar → enable"," ",t("strong",{children:"Developer mode"})," → ",t("strong",{children:"Load unpacked"})," → open the ",t("code",{children:"dango-extension/chrome"})," folder. (Unpacked helpers show a developer-mode notice — expected.)"]})," ","Use this link to download the extension and extract it:"," ",t("a",{href:Ao,target:"_blank",rel:"noreferrer",className:A.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",t("div",{className:A.actions,children:t("button",{className:A.button,onClick:W,disabled:u,type:"button",children:u?"Extracting…":"Extract cookie from helper"})})]}),t("div",{className:A.field,children:[t("label",{children:"cf_clearance cookie value:"}),t("input",{type:"text",value:c,onChange:C=>d(C.target.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:A.input})]}),t("div",{className:A.actions,children:[t("button",{className:A.secondaryButton,onClick:n,children:"Cancel"}),t("button",{className:A.secondaryButton,onClick:()=>o(1),children:"Back"}),t("button",{className:A.button,onClick:w,children:"Submit"})]})]})})})};function Ro(){const[e,n]=v(!1);return _(()=>{const r=window.setTimeout(()=>n(!0),120);return()=>window.clearTimeout(r)},[]),e?t("div",{className:"top-progress-bar",role:"progressbar","aria-label":"Loading"}):null}class qo extends $t{state={hasError:!1};static getDerivedStateFromError(n){return{hasError:!0}}componentDidCatch(n,r){console.error("Uncaught error:",n,r)}render(){return this.state.hasError?t("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100%",backgroundColor:"#1a1b1c",color:"#fff",textAlign:"center",padding:"2rem"},children:[t(g,{name:"exclamation-triangle",style:{fontSize:"4rem",color:"#ff4d4d",marginBottom:"1rem"}}),t("h1",{style:{marginBottom:"1rem"},children:"Something went wrong"}),t("p",{style:{color:"#aaa",marginBottom:"2rem"},children:"The application encountered an unexpected error."}),t("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:n=>n.currentTarget.style.backgroundColor="#536dfe",onMouseOut:n=>n.currentTarget.style.backgroundColor="var(--accent, #3d5afe)",children:[t(g,{name:"home"}),"Go back Home"]})]}):this.props.children}}const Tt=te(void 0),Mo=({children:e})=>{const[n,r]=v(!1),s=R(()=>r(!0),[]),o=R(()=>r(!1),[]);return _(()=>lt("lan",s),[s]),t(Tt.Provider,{value:{isOpen:n,openModal:s,closeModal:o},children:e})},Bo=()=>{const e=ne(Tt);if(!e)throw new Error("useLanAuth must be used within a LanAuthProvider");return e},Fo="_container_88bss_1",Ko="_field_88bss_8",jo="_input_88bss_19",zo="_actions_88bss_37",he={container:Fo,field:Ko,input:jo,actions:zo},Qe=Lt(({variant:e="primary",size:n="md",loading:r,children:s,className:o="",disabled:a,...i},c)=>{const d=["btn",`btn-${e}`,n!=="md"&&`btn-${n}`,r&&"btn-loading",o].filter(Boolean).join(" ");return t("button",{className:d,disabled:a||r,ref:c,...i,children:r?t("span",{className:"btn-spinner"}):s})}),Wo=({isOpen:e,onClose:n,onSuccess:r})=>{const[s,o]=v(""),[a,i]=v(!1);Ee.useEffect(()=>{e&&o("")},[e]);const c=async()=>{if(!s){f.error("Please enter your password");return}i(!0);try{const d=await fetch("/api/auth/app-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:s})}),u=await d.json().catch(()=>({}));if(!d.ok){f.error(u.error||"Login failed");return}f.success("Authenticated successfully"),r(),n(),window.location.reload()}catch{f.error("Network error")}finally{i(!1)}};return t(se,{isOpen:e,onClose:n,title:"LAN Authentication Required",children:t("div",{className:he.container,children:[t("p",{children:"This instance is protected. Enter the password to access from this device."}),t("div",{className:he.field,children:[t("label",{htmlFor:"lan-password",children:"Password"}),t("input",{id:"lan-password",type:"password",value:s,onChange:d=>o(d.target.value),placeholder:"Enter password...",className:he.input,onKeyDown:d=>d.key==="Enter"&&c()})]}),t("div",{className:he.actions,children:[t(Qe,{variant:"secondary",onClick:n,disabled:a,children:"Cancel"}),t(Qe,{variant:"primary",onClick:c,loading:a,children:"Unlock"})]})]})})},Uo=I(()=>T(()=>import("./Home-CQ4Ikeja.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]))),Vo=I(()=>T(()=>import("./Watchlist-BHLshSPX.js"),__vite__mapDeps([30,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,31,32]))),Qo=I(()=>T(()=>import("./Settings-bSA7BG7h.js"),__vite__mapDeps([33,1,2,3,34]))),He=I(()=>T(()=>import("./Player-C3yWQkXb.js"),__vite__mapDeps([35,1,2,36,3,37,38,23,10,17,18,6,7,8,22,39,40,41,42,43]))),Ho=I(()=>T(()=>import("./Search-DxX021dj.js"),__vite__mapDeps([44,1,3,4,5,2,6,7,8,9,10,11,12,13,14,15,45,46]))),Jo=I(()=>T(()=>import("./Mature-Ckx99wFj.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,23,22,45,46,48]))),Je=I(()=>T(()=>import("./Asmr-4S6uoevp.js"),__vite__mapDeps([49,1,3,2,9,7,10,11,28,50,51,52,38]))),Yo=I(()=>T(()=>import("./Manga-pJEpcUpo.js"),__vite__mapDeps([53,1,3,14,15,9,7,10,11,19,20,2,22,54,55]))),Go=I(()=>T(()=>import("./MangaInfoPage-BEQsjTHH.js"),__vite__mapDeps([56,1,3,14,15,20,2,54,55]))),Zo=I(()=>T(()=>import("./MangaReadPage-C0WAtK-1.js"),__vite__mapDeps([57,1,14,3,15,2,20,54,55]))),Xo=I(()=>T(()=>import("./ReadingList-BLnkwB--.js"),__vite__mapDeps([58,1,9,7,3,10,11,59,12,13,14,15,31,32,19,20,2,21,16]))),ea=I(()=>T(()=>import("./Radio-BhTsgGGd.js"),__vite__mapDeps([60,1,3,2,50,51,61,62]))),ta=I(()=>T(()=>import("./Music-CU6TBHF5.js"),__vite__mapDeps([63,1,3,50,51,61,62,2,64]))),Ye=I(()=>T(()=>import("./TvSearch-BlqTQYJa.js"),__vite__mapDeps([65,1,3,24,9,7,10,11,25,26,2,12,13,14,15,45,46]))),na=I(()=>T(()=>import("./TvInfo-Z0c1Wh3i.js"),__vite__mapDeps([66,1,3,23,26,2,67]))),ra=I(()=>T(()=>import("./Tv-DJTbg4VW.js"),__vite__mapDeps([68,1,2,3,36,37,69,23,22,26,38,10,41,42,70]))),sa=I(()=>T(()=>import("./TvWatchlist-COCWPkgh.js"),__vite__mapDeps([71,1,9,7,3,10,11,59,12,13,14,15,31,32,16,25,26,2]))),oa=I(()=>T(()=>import("./ListeningList-Dxkhy6E2.js"),__vite__mapDeps([72,1,9,7,3,10,11,59,12,13,14,15,31,32,52,28,2,50,51,27,16]))),aa=I(()=>T(()=>import("./Trackers-BXSONaRD.js"),__vite__mapDeps([73,1,2,3,74]))),ia=I(()=>T(()=>import("./Insights-DiAo0UAc.js"),__vite__mapDeps([75,1,2,3,76]))),ca=I(()=>T(()=>import("./Map-Dj51g5zL.js"),__vite__mapDeps([77,1,3,78]))),la=I(()=>T(()=>import("./AnimeInfoPage-BZWl-TJY.js"),__vite__mapDeps([79,1,2,3]))),da=I(()=>T(()=>import("./PlayerRedirect-D70t8VUW.js"),__vite__mapDeps([80,1]))),ua=I(()=>T(()=>import("./VirtualKeyboard-6ZNTym4R.js"),__vite__mapDeps([81,1,82])));function ma(){const{isOpen:e,closeModal:n,onSuccess:r}=ko(),{isOpen:s,setIsOpen:o}=Pe(),{isOpen:a,openModal:i,closeModal:c}=Bo(),d=Ce(),u=ur(),{showTelemetryModal:l,setShowTelemetryModal:m}=ws();So();const[h,b]=v("");_(()=>{y("/api/discord-roles-config").then(w=>{w.workerUrl&&b(w.workerUrl)}).catch(()=>{})},[]);const[L,z]=v(!1);_(()=>{fetch("/api/auth/app-status").then(w=>w.json()).then(w=>{w.hasPassword&&!w.isAuthenticated&&(z(!0),i())}).catch(()=>{})},[i]);const[B,Q]=Nt("lan_auth_notice_shown","false"),W=q(!1);return _(()=>{if(B==="true"||W.current)return;W.current=!0,Q("true");const w=setTimeout(()=>{f("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(w)},[B,Q]),_(()=>{window.scrollTo(0,0)},[d.pathname]),_(()=>{const w=C=>{s&&C.key==="Escape"&&o(!1)};return s?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open"),window.addEventListener("keydown",w),()=>{window.removeEventListener("keydown",w),document.body.classList.remove("sidebar-open")}},[s,o]),t("div",{className:"app-container",children:[t(Do,{isOpen:e,onClose:n,onSuccess:r}),t(Xs,{isOpen:l,onClose:()=>m(!1)}),t(Wo,{isOpen:a,onClose:L?()=>{}:c,onSuccess:()=>{z(!1),c()}}),h&&t(_o,{workerUrl:h}),t(xn,{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"}}}}),t(Or,{}),t(Zr,{}),t("main",{className:"main-content",children:t(qo,{children:t(Re,{fallback:t(Ro,{}),children:t(Pt,{children:[t(S,{path:"/",element:t(Uo,{})}),t(S,{path:"/watchlist/:filter?",element:t(Vo,{})}),t(S,{path:"/reading-list/:filter?",element:t(Xo,{})}),t(S,{path:"/search",element:t(Ho,{})}),t(S,{path:"/mature",element:t(Jo,{})}),t(S,{path:"/asmr",element:t(Je,{})}),t(S,{path:"/asmr/:rj",element:t(Je,{})}),t(S,{path:"/manga",element:t(Yo,{})}),t(S,{path:"/manga/:provider/:id",element:t(Go,{})}),t(S,{path:"/manga/:provider/:id/read",element:t(Zo,{})}),t(S,{path:"/radio",element:t(ea,{})}),t(S,{path:"/music",element:t(ta,{})}),t(S,{path:"/tv",element:t(Ye,{})}),t(S,{path:"/tv/:id",element:t(na,{})}),t(S,{path:"/tv/:id/watch",element:t(ra,{})}),t(S,{path:"/tv-search",element:t(Ye,{})}),t(S,{path:"/tv-watchlist/:filter?",element:t(sa,{})}),t(S,{path:"/listening-list/:filter?",element:t(oa,{})}),t(S,{path:"/settings",element:t(Qo,{})}),t(S,{path:"/trackers",element:t(aa,{})}),t(S,{path:"/mal",element:t(qe,{to:"/trackers",replace:!0})}),t(S,{path:"/insights",element:t(ia,{})}),t(S,{path:"/map",element:t(ca,{})}),t(S,{path:"/anime/:id",element:t(la,{})}),t(S,{path:"/watch/:id",element:t(He,{})}),t(S,{path:"/watch/:id/:episodeNumber",element:t(He,{})}),t(S,{path:"/player/:id/:episodeNumber?",element:t(da,{})}),t(S,{path:"*",element:t(qe,{to:"/",replace:!0})})]})})})}),t(fs,{}),u.isVisible&&t(Re,{fallback:null,children:t(ua,{activeInputRef:u.activeInputRef,isVisible:u.isVisible,onClose:u.hide})})]})}function ha(){return t(Mo,{children:t(ma,{})})}const pa=({children:e})=>{const[n,r]=v(!1),s=R(()=>{r(a=>!a)},[]),o=le(()=>({isOpen:n,setIsOpen:r,toggleSidebar:s}),[n,s]);return t(ft.Provider,{value:o,children:e})},ga=({children:e})=>{const[n,r]=Nt("dango_content_type","anime"),s=le(()=>({contentType:n,setContentType:r}),[n,r]);return t(vt.Provider,{value:s,children:e})},fa=({children:e})=>{const[n,r]=v("englishName"),[s,o]=v(!0);_(()=>{(async()=>{try{const c=await fetch("/api/settings?key=titlePreference");if(c.ok){const d=await c.json();d.value&&r(d.value)}}catch(c){console.error("Error fetching title preference in context:",c)}finally{o(!1)}})()},[]);const a=le(()=>({titlePreference:n,setTitlePreference:r,loading:s}),[n,s]);return t(ct.Provider,{value:a,children:e})},xt=te(void 0),Ga=()=>{const e=ne(xt);if(e===void 0)throw new Error("useLowEndMode must be used within a LowEndModeProvider");return e},va=({children:e})=>{const{data:n,isLoading:r}=Oe("lowEndMode"),s=kt(),[o,a]=v(!1);_(()=>{n!==void 0&&a(n==="true"||n===!0)},[n]),_(()=>{o?document.body.classList.add("low-end"):document.body.classList.remove("low-end")},[o]);const i=R(d=>{a(d),s.mutate({key:"lowEndMode",value:String(d)})},[s]),c=le(()=>({lowEndMode:o,setLowEndMode:i,loading:r}),[o,i,r]);return t(xt.Provider,{value:c,children:e})},ya=["iris","mochi","sakura"];function Ge(e){e==="iris"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const _a=({children:e})=>{const{data:n,isLoading:r}=Oe("theme"),s=kt(),[o,a]=v("iris");_(()=>{typeof n=="string"&&ya.includes(n)&&a(n)},[n]),_(()=>{Ge(o)},[o]);const i=R(d=>{d!==o&&(a(d),Ge(d),s.mutate({key:"theme",value:d}))},[s,o]),c=le(()=>({theme:o,setTheme:i,loading:r}),[o,i,r]);return t(ht.Provider,{value:c,children:e})},ba=({children:e})=>{const[n,r]=v(!1),[s,o]=v(void 0),a=R(c=>{o(()=>c),r(!0)},[]),i=R(()=>{r(!1),o(void 0)},[]);return _(()=>lt("animepahe",()=>a()),[a]),t(It.Provider,{value:{isOpen:n,openModal:a,closeModal:i,onSuccess:s},children:e})},wa=new Dt({defaultOptions:{queries:{staleTime:1e3*60*5,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,retry:1}}}),Ze=document.getElementById("root");Ze&&At(t(Ot,{children:t(Rt,{client:wa,children:t(ba,{children:t(pa,{children:t(ga,{children:t(fa,{children:t(va,{children:t(_a,{children:t(ha,{})})})})})})})})}),Ze);export{qa as $,Va as A,Qe as B,Wa as C,$ as D,pt as E,Ya as F,je as G,Ys as H,ys as I,Ke as J,bs as K,_s as L,se as M,xa as N,Do as O,Pa as P,dr as Q,A as R,Se as S,As as T,lt as U,_t as V,Pe as W,Ja as X,Ro as Y,Ra as Z,T as _,Nt as a,Da as a0,Ca as b,$a as c,$n as d,Ia as e,Cn as f,La as g,yt as h,za as i,Aa as j,Oa as k,Ma as l,Ba as m,Qa as n,Ka as o,Ea as p,y as q,Ha as r,Ta as s,ja as t,Ga as u,Fa as v,Oe as w,kt as x,Ua as y,f as z};
@@ -1 +1 @@
1
- import{q as d}from"./vendor-core-8R2fFbyN.js";import{u as g,b as w,a as q}from"./vendor-query-BXRECSI6.js";import{q as W,z as l}from"./index-IZgh1beL.js";import{u as b}from"./QueueOptionsButton-B6BMq66e.js";function Q(t){const i=g(),{data:n,isLoading:u,error:r}=b(t),{data:h}=w({queryKey:["watchlist-check",t],queryFn:async()=>t?W(`/api/watchlist/check/${t}`):{inWatchlist:!1},enabled:!!t}),s=h?.inWatchlist??!1,{mutateAsync:c}=q({mutationFn:async({wasIn:a,meta:e})=>{const m=a?"/api/watchlist/remove":"/api/watchlist/add",p={id:t,name:e?.name||e?.names?.romaji,thumbnail:e?.thumbnail,nativeName:e?.names?.native,englishName:e?.names?.english,type:e?.type,isAdult:e?.isAdult},o=await fetch(m,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(!o.ok){const f=await o.json().catch(()=>null);throw new Error(f?.error||"Watchlist update failed")}return!a},onMutate:async({wasIn:a})=>{await i.cancelQueries({queryKey:["watchlist-check",t]}),i.setQueryData(["watchlist-check",t],e=>({...e,inWatchlist:!a}))},onError:a=>{i.invalidateQueries({queryKey:["watchlist-check",t]}),l.error(a instanceof Error?a.message:"Failed to update watchlist")},onSuccess:a=>{l.success(a?"Added to watchlist":"Removed from watchlist"),i.invalidateQueries({queryKey:["watchlist"]})}}),y=d(async()=>{!t||!n||await c({wasIn:s,meta:n})},[t,n,s,c]);return{showMeta:n,inWatchlist:s,loadingMeta:u,error:r?r.message:null,toggleWatchlist:y}}export{Q as u};
1
+ import{q as d}from"./vendor-core-8R2fFbyN.js";import{u as g,b as w,a as q}from"./vendor-query-BXRECSI6.js";import{q as W,z as l}from"./index-lo-bz7f2.js";import{u as b}from"./QueueOptionsButton-DKWi-9kd.js";function Q(t){const i=g(),{data:n,isLoading:u,error:r}=b(t),{data:h}=w({queryKey:["watchlist-check",t],queryFn:async()=>t?W(`/api/watchlist/check/${t}`):{inWatchlist:!1},enabled:!!t}),s=h?.inWatchlist??!1,{mutateAsync:c}=q({mutationFn:async({wasIn:a,meta:e})=>{const m=a?"/api/watchlist/remove":"/api/watchlist/add",p={id:t,name:e?.name||e?.names?.romaji,thumbnail:e?.thumbnail,nativeName:e?.names?.native,englishName:e?.names?.english,type:e?.type,isAdult:e?.isAdult},o=await fetch(m,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(!o.ok){const f=await o.json().catch(()=>null);throw new Error(f?.error||"Watchlist update failed")}return!a},onMutate:async({wasIn:a})=>{await i.cancelQueries({queryKey:["watchlist-check",t]}),i.setQueryData(["watchlist-check",t],e=>({...e,inWatchlist:!a}))},onError:a=>{i.invalidateQueries({queryKey:["watchlist-check",t]}),l.error(a instanceof Error?a.message:"Failed to update watchlist")},onSuccess:a=>{l.success(a?"Added to watchlist":"Removed from watchlist"),i.invalidateQueries({queryKey:["watchlist"]})}}),y=d(async()=>{!t||!n||await c({wasIn:s,meta:n})},[t,n,s,c]);return{showMeta:n,inWatchlist:s,loadingMeta:u,error:r?r.message:null,toggleWatchlist:y}}export{Q as u};