@serifpersia/dango 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +1 -1
  2. package/client/dist/assets/AnimeCard-B-3qrNhu.js +1 -0
  3. package/client/dist/assets/AnimeInfo-DXoNbSao.js +1 -0
  4. package/client/dist/assets/{AnimeInfoPage-DLf7SyVa.js → AnimeInfoPage-CRWoCwXo.js} +2 -2
  5. package/client/dist/assets/{Asmr-Dsuu6xgC.js → Asmr-z6PNn8Ld.js} +1 -1
  6. package/client/dist/assets/{AsmrPopup-CQC440HI.js → AsmrPopup-Cc-aIYXd.js} +1 -1
  7. package/client/dist/assets/{AsmrResetProgressModal-CEnhUV7K.js → AsmrResetProgressModal-D4Mp_-lx.js} +1 -1
  8. package/client/dist/assets/Home-9ZTaG1WX.js +1 -0
  9. package/client/dist/assets/Home-Bmc4hGfd.css +1 -0
  10. package/client/dist/assets/Insights-Bf92STPA.js +1 -0
  11. package/client/dist/assets/{LibraryListPage-DnwV1dP1.js → LibraryListPage-CNjzasIi.js} +1 -1
  12. package/client/dist/assets/{ListeningList-DR4z9phs.js → ListeningList-1mBIfxxH.js} +1 -1
  13. package/client/dist/assets/{Manga-Cd_q6M_o.js → Manga-B3_TdzgY.js} +1 -1
  14. package/client/dist/assets/MangaInfoPage-DnDwJDWC.js +1 -0
  15. package/client/dist/assets/{MangaReadPage-Dh4rEwtO.js → MangaReadPage-Cq4NYq31.js} +1 -1
  16. package/client/dist/assets/{MangaResetProgressModal-DVJbgVwK.js → MangaResetProgressModal-DaZmK9CX.js} +1 -1
  17. package/client/dist/assets/{Mature-DCBXh2Dl.js → Mature-CbQWqjUS.js} +1 -1
  18. package/client/dist/assets/{MatureConsentModal-D34i8744.js → MatureConsentModal-CEoZ_OA0.js} +1 -1
  19. package/client/dist/assets/MediaCard-B-TmXdgl.js +1 -0
  20. package/client/dist/assets/MediaCard-BfQaS9n5.css +1 -0
  21. package/client/dist/assets/{OptionListMenu-BjsiUrW1.js → OptionListMenu-ArbsAjlv.js} +1 -1
  22. package/client/dist/assets/{Player-Cy24aKqh.js → Player-4wh-a_ee.js} +3 -3
  23. package/client/dist/assets/{PlayerProvider-BbsS7ai1.js → PlayerProvider-CbamWD19.js} +1 -1
  24. package/client/dist/assets/{PlayerSettings-cJWnEwcK.js → PlayerSettings-DehU56D4.js} +1 -1
  25. package/client/dist/assets/{QueueOptionsButton-JAUAWTzf.js → QueueOptionsButton-DqoDQST5.js} +1 -1
  26. package/client/dist/assets/QueueRail-ClrcV9LL.js +1 -0
  27. package/client/dist/assets/{ReadingList-EboHnXxk.js → ReadingList-Cy1BKzJs.js} +1 -1
  28. package/client/dist/assets/{ResetProgressModal-Daj-RqHv.js → ResetProgressModal-BdcBPlC1.js} +1 -1
  29. package/client/dist/assets/{Search-83zyS4iX.js → Search-5PvZ8pAC.js} +1 -1
  30. package/client/dist/assets/Settings-O0oOrEUd.js +21 -0
  31. package/client/dist/assets/{SkeletonGrid-D2FNyELs.js → SkeletonGrid-DqN0laN_.js} +1 -1
  32. package/client/dist/assets/{Trackers-Da4Q2-ta.js → Trackers-DxBWYwss.js} +2 -2
  33. package/client/dist/assets/{Tv-lRDoqQLs.js → Tv-Ox6p6iEx.js} +3 -3
  34. package/client/dist/assets/TvInfo-DjPQ7BZn.js +1 -0
  35. package/client/dist/assets/{TvPopup-vBayJw7b.js → TvPopup-CCTQiS84.js} +1 -1
  36. package/client/dist/assets/{TvSearch-Vg-ncyei.js → TvSearch-Baig87wj.js} +1 -1
  37. package/client/dist/assets/{TvWatchlist-CEt3I21U.js → TvWatchlist-D-yxvaKC.js} +1 -1
  38. package/client/dist/assets/{VirtualKeyboard-CADCu5f_.js → VirtualKeyboard-Bf7wvuX3.js} +1 -1
  39. package/client/dist/assets/{WatchAlong-Cc2HhkiG.js → WatchAlong-D9NsqbWz.js} +1 -1
  40. package/client/dist/assets/{WatchAlongPanel-D3FLPJz0.js → WatchAlongPanel-DRsYyjM7.js} +1 -1
  41. package/client/dist/assets/{Watchlist-CUFpDT9-.js → Watchlist-oYAx_dFL.js} +1 -1
  42. package/client/dist/assets/{index-B9fL2VIP.js → index-CPhXtUuw.js} +5 -5
  43. package/client/dist/assets/index-YxVpiwVZ.css +1 -0
  44. package/client/dist/assets/{libraryInvalidation-Cnx2xRQb.js → libraryInvalidation-hcASRQHn.js} +1 -1
  45. package/client/dist/assets/{playbackCompletion-CKlwK8SG.js → playbackCompletion-D1Gm0GbH.js} +1 -1
  46. package/client/dist/assets/{useAnimeInfoData-hTms4q2e.js → useAnimeInfoData-BsFz9uiF.js} +1 -1
  47. package/client/dist/assets/{useMangaLibrary-CUNeIgcg.js → useMangaLibrary-DbvnlYV9.js} +1 -1
  48. package/client/dist/assets/{useMangaPopup-s5QTNQMd.js → useMangaPopup-2lqmdmS5.js} +1 -1
  49. package/client/dist/assets/{useProviders-twwSG5Ji.js → useProviders-BgAgACS8.js} +1 -1
  50. package/client/dist/assets/{useTv-CmriRQC3.js → useTv-OX_q_uaI.js} +1 -1
  51. package/client/dist/assets/{useTvLibrary-abNJVIr4.js → useTvLibrary-DaLHYFID.js} +1 -1
  52. package/client/dist/assets/useWatchAlongPlayer-B7Yj2s3s.js +10 -0
  53. package/client/dist/index.html +2 -2
  54. package/package.json +2 -2
  55. package/server/dist/server.js +1 -1
  56. package/server/package.json +1 -1
  57. package/client/dist/assets/AnimeCard-SI0B6et0.js +0 -1
  58. package/client/dist/assets/AnimeInfo-SoCwFMy3.js +0 -1
  59. package/client/dist/assets/Home-D_Hd4SUo.css +0 -1
  60. package/client/dist/assets/Home-ioBgiYqI.js +0 -1
  61. package/client/dist/assets/Insights-DZx-ZzP2.js +0 -1
  62. package/client/dist/assets/MangaInfoPage-DVGzzTOa.js +0 -1
  63. package/client/dist/assets/MediaCard-CJ-18Ma8.css +0 -1
  64. package/client/dist/assets/MediaCard-JRLogrma.js +0 -1
  65. package/client/dist/assets/QueueRail-Ck96ehEp.js +0 -1
  66. package/client/dist/assets/Settings-Bv8Y_ao5.js +0 -21
  67. package/client/dist/assets/TvInfo-9UDA16_u.js +0 -1
  68. package/client/dist/assets/index-B8IsmFl4.css +0 -1
  69. package/client/dist/assets/useWatchAlongPlayer-CtnbRVOZ.js +0 -10
@@ -1 +0,0 @@
1
- import{d as B,A as z,h as P,q as x,g as q,u as e,L as Oe,T as Q,S as oe,a as ee,_ as et}from"./vendor-core-DfaOB3Rn.js";import{u as ke,a as ie,b as tt,c as at,q as Ve,t as nt,d as Fe,s as rt,f as Ne,B as ze,e as ot,g as st,m as Ce,p as ne,h as re,i as lt,j as it,k as ct,l as Ie,M as dt,T as ut,n as ht,o as mt,r as Me,v as pt,w as gt,x as vt,y as _t,z as yt,A as bt,C as ft,D as Tt,E as Nt,F as wt}from"./index-B9fL2VIP.js";import{b as St,u as kt,a as Ct}from"./vendor-query-BBT5_sHx.js";import{M as ge,P as It}from"./MediaCard-JRLogrma.js";import{A as ce}from"./AnimeCard-SI0B6et0.js";import{S as je,A as Ge}from"./SkeletonGrid-D2FNyELs.js";import{I as E}from"./vendor-icons-C1Pj_eSX.js";import{u as Rt}from"./vendor-ui-3qrARCPr.js";import{E as Re}from"./ErrorMessage-hMt90aG4.js";import{R as Ue}from"./ResetProgressModal-Daj-RqHv.js";import{Q as At}from"./QueueRail-Ck96ehEp.js";import{u as qe,M as Qe}from"./useMangaPopup-s5QTNQMd.js";import{M as Lt}from"./MangaResetProgressModal-DVJbgVwK.js";import{u as Ye,m as Se,i as He,a as Xe,b as $t}from"./useMangaLibrary-CUNeIgcg.js";import{u as Mt}from"./useProviders-twwSG5Ji.js";import{u as Ke,a as Be,T as Bt}from"./useTv-CmriRQC3.js";import{T as Pt}from"./TvPopup-vBayJw7b.js";import{u as xt,a as Et,b as Dt}from"./useTvLibrary-abNJVIr4.js";import{A as Wt}from"./AsmrResetProgressModal-CEnhUV7K.js";import{u as Ot,a as Vt,A as Ft,b as zt,c as jt}from"./AsmrPopup-CQC440HI.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-D34i8744.js";import"./useAnimeInfoData-hTms4q2e.js";import"./QueueOptionsButton-JAUAWTzf.js";import"./playbackCompletion-CKlwK8SG.js";import"./usePopup-DS9jMzp6.js";import"./libraryInvalidation-Cnx2xRQb.js";const Gt="_sectionWrapper_10ckl_9",Ut="_sectionTitleNoMargin_10ckl_13",qt="_carousel_10ckl_189",M={"section-header":"_section-header_10ckl_1",sectionWrapper:Gt,sectionTitleNoMargin:Ut,"title-wrapper":"_title-wrapper_10ckl_17","header-controls":"_header-controls_10ckl_24","header-select":"_header-select_10ckl_31","collapse-button":"_collapse-button_10ckl_80","title-link":"_title-link_10ckl_100","continue-watching":"_continue-watching_10ckl_119","nav-arrows":"_nav-arrows_10ckl_141","nav-button":"_nav-button_10ckl_147","carousel-container":"_carousel-container_10ckl_189",carousel:qt,"carousel-inner":"_carousel-inner_10ckl_198","carousel-card":"_carousel-card_10ckl_203"};function ve({align:n="start",containScroll:l="trimSnaps",scrollFraction:h=.8,threshold:t=.6,onReachThreshold:o,slideCount:i=0}={}){const[g,s]=Rt({align:n,containScroll:l,dragFree:!0}),[k,y]=B(!1),[N,m]=B(!1),c=z({scrollFraction:h,threshold:t,onReachThreshold:o}),r=z(!1);P(()=>{c.current={scrollFraction:h,threshold:t,onReachThreshold:o}});const w=x(p=>{y(p.canScrollPrev()),m(p.canScrollNext())},[]);P(()=>{if(!s)return;const p=()=>{const u=s.scrollProgress();u>=c.current.threshold&&!r.current?(r.current=!0,c.current.onReachThreshold?.()):u<c.current.threshold&&(r.current=!1),w(s)};return s.on("init",p),s.on("reInit",p),s.on("scroll",p),s.on("resize",p),()=>{s.off("init",p),s.off("reInit",p),s.off("scroll",p),s.off("resize",p)}},[s,w]),P(()=>{s?.reInit()},[s,i]);const C=x(p=>{const u=p.containerNode().firstElementChild;if(!u)return 1;const f=p.rootNode().getBoundingClientRect().width,R=u.getBoundingClientRect().width;return R?Math.max(1,Math.round(f/R)):1},[]),S=x((p,u=!1)=>{if(!s)return;const f=Math.max(1,Math.round(C(s)*c.current.scrollFraction)),R=s.selectedScrollSnap()+(p==="left"?-f:f);s.scrollTo(R,u)},[s,C]),d=x((p=!1)=>{s?.scrollTo(0,p)},[s]);return{emblaRef:g,api:s,canScrollPrev:k,canScrollNext:N,stepBy:S,scrollToStart:d}}const Z=({title:n,eyebrow:l,titleLink:h,loading:t,emptyState:o,carousel:i,layout:g,collapsible:s,defaultExpanded:k=!0,onReachThreshold:y,scrollThreshold:N,isFetchingNextPage:m,resetScrollOnShrink:c,itemCount:r=0,highlight:w,headerActions:C,loadingSkeleton:S,skeletonCount:d=7,children:p})=>{const{lowEndMode:u}=ke(),{emblaRef:f,stepBy:R,scrollToStart:V,canScrollPrev:A,canScrollNext:D}=ve({onReachThreshold:y,threshold:N,slideCount:r}),[L,F]=q.useState(k);q.useEffect(()=>{F(k)},[k]);const j=q.useRef(0);return q.useEffect(()=>{c&&r>0&&L&&(r<=j.current||j.current===0)&&V(),r>0&&(j.current=r)},[r,c,L,V]),!t&&r===0&&!o&&!s?null:e("section",{className:`${M.sectionWrapper} ${w?M["continue-watching"]:""}`,children:[e("div",{className:M["section-header"],children:[e("div",{className:M["title-wrapper"],children:e("div",{className:"title-stack",children:[l&&e("div",{className:"section-eyebrow",children:l}),h?e(Oe,{to:h,className:M["title-link"],children:e("div",{className:`section-title ${M.sectionTitleNoMargin}`,children:n})}):e("div",{className:`section-title ${M.sectionTitleNoMargin}`,children:n})]})}),e("div",{className:M["header-controls"],children:[C,i&&r>0&&L&&(A||D)&&e("div",{className:M["nav-arrows"],children:[A&&e("button",{className:M["nav-button"],type:"button","aria-label":"Scroll left",onClick:I=>{I.preventDefault(),R("left",u)},children:e(E,{name:"chevron-left"})}),D&&e("button",{className:M["nav-button"],type:"button","aria-label":"Scroll right",onClick:I=>{I.preventDefault(),R("right",u)},children:e(E,{name:"chevron-right"})})]}),s&&e("button",{className:M["collapse-button"],type:"button",onClick:()=>F(I=>!I),"aria-expanded":L,"aria-label":L?`Collapse ${n}`:`Expand ${n}`,children:L?e(E,{name:"chevron-up"}):e(E,{name:"chevron-down"})})]})]}),L&&(i?!t&&r===0&&o?e("div",{children:o}):e("div",{className:M["carousel-container"],children:e("div",{className:M.carousel,ref:f,children:e("div",{className:M["carousel-inner"],children:[t&&r===0?Array.from({length:d}).map((I,U)=>e("div",{className:M["carousel-card"],children:S},U)):q.Children.map(p,(I,U)=>e("div",{className:M["carousel-card"],children:I},q.isValidElement(I)&&I.key!=null?I.key:`slide-${U}`)),m&&S&&e("div",{className:M["carousel-card"],children:S})]})})}):e("div",{className:"grid-container",children:t&&r===0?e(je,{count:6,layout:g}):r>0?p:t?null:e("div",{style:{gridColumn:"1 / -1"},children:o})}))]})},Qt=({title:n,eyebrow:l,animeList:h,continueWatching:t,titleLink:o,onRemove:i,loading:g,emptyState:s,carousel:k,cardConfig:y,layout:N,onReachThreshold:m,scrollThreshold:c,isFetchingNextPage:r,collapsible:w,defaultExpanded:C=!0})=>{const S=N||"vertical";return e(Z,{title:n,eyebrow:l,titleLink:o,loading:g,emptyState:s,carousel:k,layout:S,collapsible:w,defaultExpanded:C,onReachThreshold:m,scrollThreshold:c,isFetchingNextPage:r,resetScrollOnShrink:t,highlight:t,itemCount:h.length,loadingSkeleton:e(Ge,{layout:S}),skeletonCount:7,children:h.map(d=>e(ce,{anime:d,continueWatching:t,onRemove:i,config:y,layout:S},d._id))})},Pe=q.memo(Qt),Yt="_wrapper_j52nn_1",Ht="_arrow_j52nn_6",Xt="_select_j52nn_15",we={wrapper:Yt,arrow:Ht,select:Xt},J=({value:n,options:l,onChange:h,ariaLabel:t,width:o})=>e("span",{className:we.wrapper,children:[e("select",{className:we.select,style:o!==void 0?{width:o}:void 0,value:n,"aria-label":t,onChange:i=>h(i.currentTarget.value),children:l.map(i=>e("option",{value:i.value,children:i.label},i.value))}),e(E,{name:"chevron-down",size:12,className:we.arrow})]}),Kt="_sectionWrapper_1dwd0_2",Zt="_sectionTitleNoMargin_1dwd0_6",Jt="_carouselContainer_1dwd0_94",ea="_carousel_1dwd0_94",ta="_carouselInner_1dwd0_105",aa="_carouselItem_1dwd0_110",na="_rankCard_1dwd0_147",ra="_rankPill_1dwd0_151",oa="_rankGold_1dwd0_162",sa="_rankSilver_1dwd0_166",la="_rankBronze_1dwd0_170",ia="_skeletonPoster_1dwd0_181",ca="_skeletonText_1dwd0_182",_={sectionWrapper:Kt,sectionTitleNoMargin:Zt,"section-header":"_section-header_1dwd0_11","title-wrapper":"_title-wrapper_1dwd0_19","header-actions":"_header-actions_1dwd0_39","nav-arrows":"_nav-arrows_1dwd0_45","nav-button":"_nav-button_1dwd0_51",carouselContainer:Jt,carousel:ea,carouselInner:ta,carouselItem:aa,rankCard:na,rankPill:ra,rankGold:oa,rankSilver:sa,rankBronze:la,skeletonPoster:ia,skeletonText:ca},xe="TRENDING_DESC",da="POPULARITY_DESC",ua=10;function ha({title:n,eyebrow:l}){const{lowEndMode:h}=ke(),[t,o]=ie("trending_sort",xe),i=[{value:xe,label:"Trending"},{value:da,label:"All Time"}],{data:g,fetchNextPage:s,hasNextPage:k,isFetchingNextPage:y,isLoading:N,isError:m,error:c}=tt(t,ua),r=Q(()=>g?.pages.flatMap(u=>u)||[],[g]),w=x(()=>{k&&!y&&!N&&s()},[k,y,N,s]),{emblaRef:C,stepBy:S,canScrollPrev:d,canScrollNext:p}=ve({onReachThreshold:w,slideCount:r.length});return e("section",{className:_.sectionWrapper,children:[e("div",{className:_["section-header"],children:[e("div",{className:_["title-wrapper"],children:e("div",{className:"title-stack",children:[l&&e("div",{className:"section-eyebrow",children:l}),e("div",{className:`section-title ${_.sectionTitleNoMargin}`,children:n})]})}),e("div",{className:_["header-actions"],children:[e(J,{ariaLabel:"Trending sort",width:120,value:t,options:i,onChange:o}),(d||p)&&e("div",{className:_["nav-arrows"],children:[d&&e("button",{className:_["nav-button"],type:"button",onClick:u=>{u.preventDefault(),S("left",h)},"aria-label":"Scroll left",children:e(E,{name:"chevron-left"})}),p&&e("button",{className:_["nav-button"],type:"button",onClick:u=>{u.preventDefault(),S("right",h)},"aria-label":"Scroll right",children:e(E,{name:"chevron-right"})})]})]})]}),N?e("div",{className:_.carouselContainer,children:e("div",{className:_.carousel,children:e("div",{className:_.carouselInner,children:Array.from({length:7}).map((u,f)=>e("div",{className:_.carouselItem,children:[e("div",{className:_.skeletonPoster}),e("div",{className:_.skeletonText})]},f))})})}):m?e(Re,{message:c instanceof Error?c.message:"An unknown error occurred"}):e("div",{className:_.carouselContainer,children:e("div",{className:_.carousel,ref:C,children:e("div",{className:_.carouselInner,children:[r.map((u,f)=>e("div",{className:_.carouselItem,children:[e("div",{className:_.rankCard,children:e(ce,{anime:u})}),e("div",{className:`${_.rankPill} ${f===0?_.rankGold:f===1?_.rankSilver:f===2?_.rankBronze:""}`,children:f+1})]},u._id)),y&&e("div",{className:_.carouselItem,style:{minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{className:_.skeletonPoster})})]})})})]})}const ma=[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}],pa=10;function ga({eyebrow:n}){const{lowEndMode:l}=ke(),[h,t]=ie("latest_releases_format","TV"),{data:o,fetchNextPage:i,hasNextPage:g,isFetchingNextPage:s,isLoading:k,isError:y,error:N}=at(h,pa),m=Q(()=>o?.pages.flatMap(d=>d)||[],[o]),c=x(()=>{g&&!s&&!k&&i()},[g,s,k,i]),{emblaRef:r,stepBy:w,canScrollPrev:C,canScrollNext:S}=ve({onReachThreshold:c,slideCount:m.length});return e("section",{className:_.sectionWrapper,children:[e("div",{className:_["section-header"],children:[e("div",{className:_["title-wrapper"],children:e("div",{className:"title-stack",children:[n&&e("div",{className:"section-eyebrow",children:n}),e("div",{className:`section-title ${_.sectionTitleNoMargin}`,children:"Latest Releases"})]})}),e("div",{className:_["header-actions"],children:[e(J,{ariaLabel:"Latest releases format",width:120,value:h,options:ma,onChange:t}),(C||S)&&e("div",{className:_["nav-arrows"],children:[C&&e("button",{className:_["nav-button"],type:"button",onClick:d=>{d.preventDefault(),w("left",l)},"aria-label":"Scroll left",children:e(E,{name:"chevron-left"})}),S&&e("button",{className:_["nav-button"],type:"button",onClick:d=>{d.preventDefault(),w("right",l)},"aria-label":"Scroll right",children:e(E,{name:"chevron-right"})})]})]})]}),k?e("div",{className:_.carouselContainer,children:e("div",{className:_.carousel,children:e("div",{className:_.carouselInner,children:Array.from({length:7}).map((d,p)=>e("div",{className:_.carouselItem,children:[e("div",{className:_.skeletonPoster}),e("div",{className:_.skeletonText})]},p))})})}):y?e(Re,{message:N instanceof Error?N.message:"An unknown error occurred"}):e("div",{className:_.carouselContainer,children:e("div",{className:_.carousel,ref:r,children:e("div",{className:_.carouselInner,children:[m.map(d=>e("div",{className:_.carouselItem,children:e(ce,{anime:d})},d._id)),s&&e("div",{className:_.carouselItem,style:{minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{className:_.skeletonPoster})})]})})})]})}const va="_scheduleSection_1o82r_1",_a="_sectionTitleRow_1o82r_5",ya="_sectionTitleNoMargin_1o82r_11",ba="_sectionHeader_1o82r_15",fa="_headerActions_1o82r_25",Ta="_daySelectorContainer_1o82r_33",Na="_daySelector_1o82r_33",wa="_daySelectorInner_1o82r_50",Sa="_dayBtn_1o82r_61",ka="_active_1o82r_84",Ca="_dayMonth_1o82r_92",Ia="_dayNum_1o82r_100",Ra="_dayName_1o82r_106",Aa="_navArrows_1o82r_119",La="_navButton_1o82r_125",$a="_carouselContainer_1o82r_168",Ma="_carousel_1o82r_168",Ba="_carouselInner_1o82r_180",Pa="_carouselCard_1o82r_185",$={scheduleSection:va,sectionTitleRow:_a,sectionTitleNoMargin:ya,sectionHeader:ba,headerActions:fa,daySelectorContainer:Ta,daySelector:Na,daySelectorInner:wa,dayBtn:Sa,active:ka,dayMonth:Ca,dayNum:Ia,dayName:Ra,navArrows:Aa,navButton:La,carouselContainer:$a,carousel:Ma,carouselInner:Ba,carouselCard:Pa},de=n=>{const l=n.getFullYear(),h=String(n.getMonth()+1).padStart(2,"0"),t=String(n.getDate()).padStart(2,"0");return`${l}-${h}-${t}`},xa=async(n,l)=>await nt.data.schedule.query({date:n,format:l}),Ea=({eyebrow:n})=>{const[l,h]=B(()=>de(new Date)),[t,o]=ie("schedule_format","TV"),i=z(null),g=z(!0),{data:s=[],isLoading:k,error:y}=St({queryKey:[Ve.schedule,l,t],queryFn:()=>xa(l,t),staleTime:1e3*60*5}),{emblaRef:N,canScrollPrev:m,canScrollNext:c,stepBy:r,scrollToStart:w}=ve({slideCount:s.length}),C=Q(()=>{const d=[],p=new Date,u=de(p),f=new Date(p);f.setDate(p.getDate()-1);const R=de(f),V=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];for(let A=-6;A<=6;A++){const D=new Date(p);D.setDate(p.getDate()+A),d.push(D)}return d.map(A=>{const D=de(A),j=D===u?"Today":D===R?"Yest":V[A.getDay()],I=A.getDate(),U=new Intl.DateTimeFormat("en-US",{month:"short"}).format(A);return{dateString:D,dayLabel:j,dayNum:I,monthName:U}})},[]);P(()=>{const d=i.current,p=d?.querySelector(`[data-date="${l}"]`);if(!d||!p)return;const u=d.getBoundingClientRect(),f=p.getBoundingClientRect(),R=d.scrollLeft+(f.left-u.left)-(u.width-f.width)/2;d.scrollTo({left:Math.max(0,R),behavior:g.current?"auto":"smooth"}),g.current=!1},[l]),P(()=>{w(!0)},[l,w]);const S=[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}];return e("div",{className:$.scheduleSection,children:[e("div",{className:$.sectionHeader,children:[e("div",{className:$.sectionTitleRow,children:e("div",{className:"title-stack",children:[n&&e("div",{className:"section-eyebrow",children:n}),e("h2",{className:`section-title ${$.sectionTitleNoMargin}`,children:"Episode Schedule"})]})}),e("div",{className:$.headerActions,children:[e(J,{ariaLabel:"Schedule format",width:120,value:t,options:S,onChange:o}),s.length>0&&(m||c)&&e("div",{className:$.navArrows,children:[m&&e("button",{className:$.navButton,onClick:()=>r("left"),"aria-label":"Scroll left",children:e(E,{name:"chevron-left"})}),c&&e("button",{className:$.navButton,onClick:()=>r("right"),"aria-label":"Scroll right",children:e(E,{name:"chevron-right"})})]})]})]}),e("div",{className:$.daySelectorContainer,children:e("div",{className:$.daySelector,ref:i,children:e("div",{className:$.daySelectorInner,children:C.map(d=>e("button",{type:"button","data-date":d.dateString,"aria-pressed":l===d.dateString,className:`${$.dayBtn} ${l===d.dateString?$.active:""}`,onClick:()=>h(d.dateString),children:[e("span",{className:$.dayMonth,children:d.monthName}),e("span",{className:$.dayNum,children:d.dayNum}),e("span",{className:$.dayName,children:d.dayLabel})]},d.dateString))})})}),e("div",{className:$.carouselContainer,children:e("div",{className:$.carousel,ref:N,children:e("div",{className:$.carouselInner,children:k?Array.from({length:7}).map((d,p)=>e("div",{className:$.carouselCard,children:e(Ge,{layout:"vertical"})},p)):y?e("div",{style:{width:"100%"},children:e(Re,{message:y instanceof Error?y.message:"An unknown error occurred"})}):s.length===0?e("p",{style:{textAlign:"center",marginTop:"1rem",width:"100%"},children:"No episodes scheduled for this day."}):s.map(d=>e("div",{className:$.carouselCard,children:e(ce,{anime:d,continueWatching:!1,layout:"vertical"},d._id)},d._id))})})})]})},Da="_bannerContainer_lye2m_1",Wa="_hero_lye2m_28",Oa="_ambient_lye2m_37",Va="_ambientShow_lye2m_49",Fa="_scrim_lye2m_53",za="_progressLine_lye2m_64",ja="_paused_lye2m_84",Ga="_dots_lye2m_98",Ua="_dot_lye2m_98",qa="_dotActive_lye2m_121",Qa="_viewport_lye2m_132",Ya="_track_lye2m_139",Ha="_slide_lye2m_145",Xa="_slideInner_lye2m_153",Ka="_poster_lye2m_163",Za="_posterLandscape_lye2m_174",Ja="_info_lye2m_198",en="_kicker_lye2m_207",tn="_featureLabel_lye2m_214",an="_scoreChip_lye2m_226",nn="_rise_lye2m_244",rn="_active_lye2m_248",on="_metaRow_lye2m_304",sn="_metaItem_lye2m_315",ln="_metaDivider_lye2m_321",cn="_title_lye2m_328",dn="_genres_lye2m_347",un="_genreTag_lye2m_355",hn="_summary_lye2m_366",mn="_actions_lye2m_378",pn="_watchBtn_lye2m_386",gn="_detailsBtn_lye2m_418",vn="_secondaryRow_lye2m_449",_n="_secondaryBtn_lye2m_456",yn="_navArrow_lye2m_479",bn="_prevArrow_lye2m_512",fn="_nextArrow_lye2m_516",v={bannerContainer:Da,hero:Wa,ambient:Oa,ambientShow:Va,scrim:Fa,progressLine:za,paused:ja,dots:Ga,dot:Ua,dotActive:qa,viewport:Qa,track:Ya,slide:Ha,slideInner:Xa,poster:Ka,posterLandscape:Za,info:Ja,kicker:en,featureLabel:tn,scoreChip:an,rise:nn,active:rn,metaRow:on,metaItem:sn,metaDivider:ln,title:cn,genres:dn,genreTag:un,summary:hn,actions:mn,watchBtn:pn,detailsBtn:gn,secondaryRow:vn,secondaryBtn:_n,navArrow:yn,prevArrow:bn,nextArrow:fn},Tn=8e3,ue=()=>e("div",{className:"skeleton",style:{width:"100vw",maxWidth:"100vw",position:"relative",left:"50%",right:"50%",marginLeft:"-50vw",marginRight:"-50vw",height:"clamp(480px, 72vh, 660px)",marginTop:"calc(-1 * var(--header-height))",marginBottom:"2.5rem"}}),_e=({slides:n,posterAspect:l="portrait",eyebrow:h="Spotlight"})=>{const[t,o]=B(0),[i,g]=B(0),[s,k]=B(!1),[y,N]=B(null),[m,c]=B(0),[r,w]=B({front:"",back:"",flip:!1}),C=z(0),S=z(0),d=z(new Set),p=z(null),u=z(0),f=x(a=>a.bannerSrc,[]),R=x(()=>{g(a=>a+1)},[]),V=x(a=>{p.current!==null&&(window.clearTimeout(p.current),p.current=null),N(null),R();const b=f(n[a]);w(T=>T.flip?{front:b,back:T.back,flip:!1}:{front:T.front,back:b,flip:!0}),o(a)},[R,n,f]),A=x(a=>{if(n.length===0)return;const b=(a%n.length+n.length)%n.length;d.current.has(f(n[b]))?V(b):N(b)},[n,f,V]);P(()=>{let a=!1;return n.forEach(b=>{const T=f(b);if(!T||d.current.has(T))return;const W=new Image;W.src=T;const X=()=>{a||d.current.has(T)||(d.current.add(T),c(G=>G+1))};W.onload=X,W.onerror=X}),()=>{a=!0}},[n,f]),P(()=>{if(n.length!==0&&!r.front){const a=f(n[0]);w({front:a,back:"",flip:!1})}},[n,r.front,f]),P(()=>{if(y!==null){if(y<0||y>=n.length){N(null);return}d.current.has(f(n[y]))&&V(y)}},[y,m,n,f,V]),P(()=>{if(y===null)return;p.current!==null&&window.clearTimeout(p.current);const a=y;return p.current=window.setTimeout(()=>{p.current=null,V(a)},2500),()=>{p.current!==null&&(window.clearTimeout(p.current),p.current=null)}},[y,V]);const D=x(a=>{A(a)},[A]),L=x(()=>{A(u.current+1)},[A]),F=x(()=>{A(u.current-1)},[A]),j=z(null);if(P(()=>{const a=j.current;if(!a)return;const b=T=>{if(Math.abs(T.deltaY)>Math.abs(T.deltaX)&&Math.abs(T.deltaY)>5){T.preventDefault(),T.stopPropagation();const W=Date.now();if(W-C.current<300)return;C.current=W,R(),T.deltaY>0?L():F()}};return a.addEventListener("wheel",b,{passive:!1}),()=>a.removeEventListener("wheel",b)},[n.length,L,F,R]),P(()=>{if(n.length===0||s)return;const a=setTimeout(L,Tn);return()=>clearTimeout(a)},[t,L,n.length,i,s]),P(()=>{const a=b=>{const T=b.target;T&&(T.tagName==="INPUT"||T.tagName==="TEXTAREA"||T.tagName==="SELECT"||T.isContentEditable)||(b.key==="ArrowRight"?(b.preventDefault(),L()):b.key==="ArrowLeft"&&(b.preventDefault(),F()))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[L,F]),P(()=>{t>=n.length&&o(0)},[n.length,t]),n.length===0)return null;const I=t>=n.length?0:t;u.current=I;const U=a=>{S.current=a.touches[0].clientX},H=a=>{const T=a.changedTouches[0].clientX-S.current;Math.abs(T)>50&&(R(),T>0?F():L())};return e("div",{className:v.bannerContainer,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:e("div",{className:`${v.hero} ${s?v.paused:""}`,onTouchStart:U,onTouchEnd:H,children:[r.front&&e("img",{src:r.front,alt:"","aria-hidden":"true",className:`${v.ambient} ${r.flip?"":v.ambientShow}`}),r.back&&e("img",{src:r.back,alt:"","aria-hidden":"true",className:`${v.ambient} ${r.flip?v.ambientShow:""}`}),e("div",{className:v.scrim,"aria-hidden":"true"}),n.length>1&&e("div",{className:v.progressLine,"aria-hidden":"true"},`progress-${i}-${I}`),n.length>1&&e("div",{className:v.dots,ref:j,role:"tablist","aria-label":"Spotlight slides",children:n.map((a,b)=>e("button",{role:"tab","aria-selected":b===I,"aria-label":`Go to slide ${b+1}: ${a.title}`,className:`${v.dot} ${b===I?v.dotActive:""}`,onClick:()=>D(b),tabIndex:b===I?0:-1},a.key))}),e("div",{className:v.viewport,children:e("div",{className:v.track,style:{transform:`translateX(-${I*100}%)`},children:n.map((a,b)=>e("div",{className:`${v.slide} ${b===I?v.active:""}`,"aria-hidden":b!==I,children:e("div",{className:v.slideInner,children:[e("img",{src:a.posterSrc,alt:a.posterAlt,className:l==="landscape"?v.posterLandscape:v.poster,decoding:"async"}),e("div",{className:v.info,children:[e("div",{className:`${v.kicker} ${v.rise}`,children:[e("span",{className:v.featureLabel,children:h}),a.score!==void 0&&a.score!==null&&a.score!==""&&e("span",{className:v.scoreChip,children:[e(E,{name:"star",size:12}),e("span",{children:a.score})]})]}),e(Oe,{to:a.detailTo,className:`${v.title} ${v.rise}`,"aria-label":`View details for ${a.title}`,tabIndex:b===I?0:-1,children:a.title}),a.metaItems.length>0&&e("div",{className:`${v.metaRow} ${v.rise}`,children:a.metaItems.map((T,W)=>e(q.Fragment,{children:[e("span",{className:v.metaItem,children:T}),W<a.metaItems.length-1&&e("div",{className:v.metaDivider})]},W))}),a.tags.length>0&&e("div",{className:`${v.genres} ${v.rise}`,children:a.tags.slice(0,3).map(T=>e("span",{className:v.genreTag,children:T},T))}),a.synopsis&&e("p",{className:`${v.summary} ${v.rise}`,children:a.synopsis}),e("div",{className:`${v.actions} ${v.rise}`,children:[e("button",{className:v.watchBtn,onClick:a.onPrimary,tabIndex:b===I?0:-1,children:[e(E,{name:a.primaryIcon,size:14}),e("span",{children:a.primaryLabel})]}),e("div",{className:v.secondaryRow,children:[e("button",{className:v.detailsBtn,onClick:a.onDetails,tabIndex:b===I?0:-1,children:[e(E,{name:"info-circle",size:15}),e("span",{children:"Details"})]}),a.onWatchlist&&e("button",{className:v.secondaryBtn,onClick:a.onWatchlist,tabIndex:b===I?0:-1,children:[e(E,{name:"plus",size:14}),e("span",{children:"Watchlist"})]})]})]})]})]})},a.key))})}),n.length>1&&e(oe,{children:[e("button",{className:`${v.navArrow} ${v.prevArrow}`,onClick:()=>{R(),F()},"aria-label":"Previous slide",children:e(E,{name:"chevron-left",size:20})}),e("button",{className:`${v.navArrow} ${v.nextArrow}`,onClick:()=>{R(),L()},"aria-label":"Next slide",children:e(E,{name:"chevron-right",size:20})})]})]})})},Nn=({animeList:n})=>{const{titlePreference:l}=Fe(),h=ee(),t=Q(()=>n.slice(0,6).map(o=>{const i=l==="nativeName"?o.nativeName||o.name:l==="englishName"&&o.englishName||o.name;return{key:o._id,bannerSrc:o.bannerImage?Ne(o.bannerImage,1280,560):Ne(o.thumbnail,1280,450),posterSrc:Ne(o.thumbnail,460,650),posterAlt:i,title:i,detailTo:`/anime/${o._id}`,score:o.score,metaItems:[o.type||"Anime",o.status,o.episodeCount?`${o.episodeCount} Episodes`:void 0,o.rating].filter(g=>!!g),tags:(o.genres??[]).slice(0,3).map(g=>typeof g=="string"?g:g?.name).filter(g=>!!g),synopsis:rt(o.description??""),primaryLabel:"Watch Now",primaryIcon:"play",onPrimary:()=>h(`/watch/${o._id}`),onDetails:()=>h(`/anime/${o._id}`)}}),[n,l,h]);return e(_e,{slides:t})},wn="_emptyState_19tmt_1",Sn="_emptyStateIcon_19tmt_16",kn="_emptyStateTitle_19tmt_23",Cn="_emptyStateText_19tmt_30",he={emptyState:wn,emptyStateIcon:Sn,emptyStateTitle:kn,emptyStateText:Cn},ye=({icon:n,text:l,actionLabel:h,onAction:t,title:o="Nothing is here..."})=>e("div",{className:he.emptyState,children:[e(E,{name:n,size:48,className:he.emptyStateIcon}),e("div",{children:[e("h3",{className:he.emptyStateTitle,children:o}),e("p",{className:he.emptyStateText,children:l})]}),e(ze,{variant:"primary",size:"sm",onClick:t,style:{marginTop:"1rem"},children:h})]}),In="_tabBar_1mv4x_1",Rn="_tabIndicator_1mv4x_24",An="_tabButton_1mv4x_38",Ln="_tabActive_1mv4x_53",me={tabBar:In,tabIndicator:Rn,tabButton:An,tabActive:Ln};function $n({options:n,value:l,onChange:h,ariaLabel:t},o){const i=z(null),g=z(new Map),s=z(null),[k,y]=B({left:0,width:0}),N=x((m,c)=>{const r=g.current.get(m),w=i.current;if(r&&w){const C=w.getBoundingClientRect(),S=r.getBoundingClientRect();y({left:S.left-C.left+w.scrollLeft,width:S.width}),c&&r.scrollIntoView({block:"nearest",inline:"nearest"})}},[]);return et(()=>{const m=s.current!==null&&s.current!==l;s.current=l,N(l,m)},[l,n.length,N]),P(()=>{if(N(l,!1),typeof ResizeObserver>"u")return;let m=0;const c=i.current;if(!c)return;const r=new ResizeObserver(()=>{cancelAnimationFrame(m),m=requestAnimationFrame(()=>N(l,!1))});r.observe(c);let w=!1;return document.fonts?.ready&&document.fonts.ready.then(()=>{w||N(l,!1)}),()=>{w=!0,cancelAnimationFrame(m),r.disconnect()}},[l,n.length,N]),e("div",{className:me.tabBar,ref:m=>{i.current=m,typeof o=="function"?o(m):o&&(o.current=m)},"aria-label":t,children:[e("div",{className:me.tabIndicator,style:{left:k.left,width:k.width}}),n.map(m=>e(ze,{ref:c=>{c&&g.current.set(m.value,c)},variant:"secondary",size:"sm",className:`${me.tabButton} ${l===m.value?me.tabActive:""}`,onClick:()=>h(m.value),children:m.label},m.value))]})}const pe=q.forwardRef($n),Mn=[{value:"popular",label:"Popular"},{value:"followed",label:"Most Followed"},{value:"rating",label:"Top Rated"}],Ee=({title:n,eyebrow:l,sort:h,mature:t,headerActions:o})=>{const{toggle:i,bookmarkedIds:g}=Ye(),{popup:s,openPopup:k,scheduleClose:y,cancelClose:N,closePopup:m}=qe(),{data:c,isLoading:r,fetchNextPage:w,hasNextPage:C,isFetchingNextPage:S}=st({provider:"",query:"",sort:h,status:"",type:"",rating:t?"safe,suggestive,erotica,pornographic":"safe",mature:t}),d=Q(()=>c?.pages.flatMap(u=>u.items)??[],[c]),p=x(()=>{C&&!S&&!r&&w()},[C,S,r,w]);return e(oe,{children:[e(Z,{title:n,eyebrow:l,loading:r,carousel:!0,itemCount:d.length,headerActions:o,onReachThreshold:p,isFetchingNextPage:S,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,children:d.map(u=>{const f=Se(u.provider,u.id);return e(ge,{item:{id:f,title:u.title,...Xe(u),thumbnail:Ce(u.provider,u.cover),typeBadge:u.type||void 0,chapterBadge:u.latestChapter?`Ch. ${u.latestChapter}`:null,isAdult:He(u)},linkTo:`/manga/${u.provider}/${encodeURIComponent(u.id)}`,hoverIcon:"info",showInfoButton:!0,display:{elements:{poster:{typeBadge:!0,chapterBadge:!0,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!1,meta:!1}}},onOpenDetails:R=>k(R,{provider:u.provider,mangaId:u.id,title:u.title,altTitle:u.altTitle,cover:u.cover,contentRating:u.contentRating,readTarget:`/manga/${u.provider}/${encodeURIComponent(u.id)}`,mature:t}),onPopupHoverIntent:R=>R?N():y(),rawThumbnail:!0},`${u.provider}-${u.id}`)})}),s&&e(Qe,{data:s.data,anchorRect:s.rect,bookmarked:g.has(Se(s.data.provider,s.data.mangaId)),onToggleBookmark:()=>i({id:s.data.mangaId,provider:s.data.provider,title:s.data.title,cover:s.data.cover,altTitle:s.data.altTitle??void 0,contentRating:s.data.contentRating}),onMouseEnter:N,onMouseLeave:y,onRequestClose:m})]})},Bn=()=>{const{options:n}=Mt(),l=Q(()=>n.some(s=>s.kind==="manga"),[n]),{hasConsent:h}=ot(),[t,o]=ie("manga_discover_tab","latest"),[i,g]=ie("manga_trending_sort","popular");return l?e(oe,{children:[e(pe,{ariaLabel:"Discover manga",options:[{value:"latest",label:"Latest Releases"},{value:"trending",label:"Trending"}],value:t,onChange:o}),t==="latest"?e(Ee,{title:"Latest Releases",eyebrow:"Fresh chapters",sort:"latest",mature:h}):e(Ee,{title:"Trending",eyebrow:"Discover",sort:i,mature:h,headerActions:e("select",{className:M["header-select"],value:i,onChange:s=>g(s.currentTarget.value),"aria-label":"Trending sort",children:Mn.map(s=>e("option",{value:s.value,children:s.label},s.value))})})]}):null},Pn=()=>{const n=ee(),{data:l,isLoading:h}=$t(24),[t,o]=B(null),{popup:i,openPopup:g,scheduleClose:s,cancelClose:k,closePopup:y}=qe(),{toggle:N,bookmarkedIds:m}=Ye(),c=l?.data??[];return e("div",{style:{paddingBottom:"2rem"},children:[e(Z,{title:"Continue Reading",eyebrow:"Pick up where you left off",titleLink:"/reading-list/Continue Reading",loading:h,carousel:!0,collapsible:!0,defaultExpanded:c.length>0,highlight:!0,itemCount:c.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,emptyState:e(ye,{icon:"book",text:"You haven't read anything yet. Browse manga and open a chapter to start tracking.",actionLabel:"Browse Manga",onAction:()=>n("/manga")}),children:c.map(r=>{const w=r.page??0,C=r.pageCount??0,S=r.chapterId&&r.provider?`/manga/${r.provider}/${encodeURIComponent(r.mangaId)}/read?chapter=${encodeURIComponent(r.chapterId)}`:r.provider?`/manga/${r.provider}/${encodeURIComponent(r.mangaId)}`:"#";return e(ge,{item:{id:r.id,title:r.title||"",...Xe({title:r.title||"",altTitle:r.altTitle}),thumbnail:r.provider?Ce(r.provider,r.cover||""):r.cover||"",chapterBadge:r.chapterNumber?`Ch. ${r.chapterNumber}`:null,isAdult:He(r)},linkTo:S,hoverIcon:"book",progress:C>0?{percent:w/C*100,label:`Ch. ${r.chapterNumber} · p. ${w}/${C}`}:void 0,showProgress:!0,display:{elements:{poster:{typeBadge:!1,chapterBadge:!0,adultBadge:!0,removeButton:!0},info:{title:!0,mobileBadges:!0,progress:!0,meta:!1}}},onRemove:()=>o({libId:r.id,title:r.title||""}),onOpenDetails:d=>g(d,{provider:r.provider||"",mangaId:r.mangaId||"",title:r.title||"",altTitle:r.altTitle,cover:r.cover||"",contentRating:r.contentRating||void 0,readTarget:S}),onPopupHoverIntent:d=>d?k():s(),rawThumbnail:!0},r.id)})}),e(Lt,{mangaId:t?t.libId:null,title:t?.title,onClose:()=>o(null)}),i&&i.data.provider&&e(Qe,{data:i.data,anchorRect:i.rect,bookmarked:m.has(Se(i.data.provider,i.data.mangaId)),onToggleBookmark:()=>N({id:i.data.mangaId,provider:i.data.provider,title:i.data.title,cover:i.data.cover,altTitle:i.data.altTitle??void 0,contentRating:i.data.contentRating}),onMouseEnter:k,onMouseLeave:s,onRequestClose:y}),e(Bn,{})]})},xn="_emptyState_bpz5x_1",De={emptyState:xn},En=[{value:"latest",label:"Latest Releases"},{value:"trending",label:"Trending"}],Dn=[{value:"trending_week",label:"Trending Now"},{value:"trending_day",label:"Trending Today"},{value:"popular",label:"Popular All Time"},{value:"top_rated",label:"Top Rated"}],Wn=()=>{const n=ee(),{data:l,isLoading:h}=xt(24),t=Et(),o=Dt(),[i,g]=B(null),[s,k]=B(()=>ne.getItem("tv_home_activeTab")||"latest"),[y,N]=B("tv"),[m,c]=B("trending_week"),[r,w]=B("multi"),C=l?.data??[];q.useEffect(()=>{ne.setItem("tv_home_activeTab",s)},[s]);const S=m.startsWith("trending_"),d=m==="trending_day"?"day":"week",p={popular:"popularity.desc",top_rated:"vote_average.desc"},{data:u,isLoading:f}=Ke(r==="multi"?"all":r,d,1,S&&s==="trending"),{data:R,isLoading:V}=Be({type:r,sort_by:p[m]||"popularity.desc",page:1}),A=S?u?.results||[]:R?.results||[],D=S?f:V,{data:L,isLoading:F}=Be({type:y,sort_by:"primary_release_date.desc",page:1}),j=L?.results||[],I=a=>{i&&(o.mutate({mediaId:i.libId}),a&&t.mutate(i.libId))},U=x(a=>e(Bt,{item:{id:a.id,title:a.title,year:a.year,type:a.type,image:a.image,vote_average:a.vote_average,adult:a.adult}},`${a.type}-${a.id}`),[]),H=()=>{switch(s){case"latest":return e(Z,{title:"Latest Releases",eyebrow:"Fresh picks",loading:F,carousel:!0,itemCount:j.length,headerActions:e(J,{ariaLabel:"Latest type",value:y,onChange:a=>N(a),options:[{value:"tv",label:"TV Shows"},{value:"movie",label:"Movies"}]}),loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4",borderRadius:"var(--radius-lg)"}}),emptyState:e("div",{className:De.emptyState,children:e("p",{children:"No latest releases available right now."})}),children:j.map(U)});case"trending":return e(Z,{title:"Trending",eyebrow:"Discover",loading:D,carousel:!0,itemCount:A.length,headerActions:e(oe,{children:[e(J,{ariaLabel:"Trending sort",value:m,onChange:c,options:Dn.map(a=>({value:a.value,label:a.label}))}),e(J,{ariaLabel:"Trending type",value:r,onChange:a=>w(a),options:[{value:"multi",label:"All"},{value:"tv",label:"TV Shows"},{value:"movie",label:"Movies"}]})]}),loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4",borderRadius:"var(--radius-lg)"}}),emptyState:e("div",{className:De.emptyState,children:e("p",{children:"No trending content available right now."})}),children:A.map(U)})}};return e("div",{style:{paddingBottom:"2rem"},children:[e(Z,{title:"Continue Watching",eyebrow:"Pick up where you left off",titleLink:"/tv-watchlist/Continue Watching",loading:h,carousel:!0,collapsible:!0,defaultExpanded:C.length>0,highlight:!0,itemCount:C.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,emptyState:e(ye,{icon:"tv",text:"You haven't watched anything yet. Search TV & Movies and start watching to track progress.",actionLabel:"Browse TV & Movies",onAction:()=>n("/tv-search")}),children:C.map(a=>{const b=a.currentTime??0,T=a.duration??0,W=a.season??1,X=a.episode??1,G=a.mediaType==="movie",K=G?"Movie":`S${W} E${X}`,te=a.completed===1||T>0&&b>=T*.8,ae=te?100:T>0&&b>0?b/T*100:0,be=te?"Watched":T>0?G?`${re(b)} / ${re(T)}`:`${K} · ${re(b)} / ${re(T)}`:K;return e(ge,{item:{id:a.id,title:a.title||"",thumbnail:a.poster||"",typeBadge:G?"Movie":"TV",chapterBadge:K,isAdult:it({adult:a.adult===1})},linkTo:lt(a.mediaType,a.tmdbId??0,G?void 0:W,G?void 0:X),hoverIcon:"play",progress:(T>0||te)&&ae>0?{percent:ae,label:be}:void 0,showProgress:!0,metaRow:a.year?e("span",{style:{opacity:.75},children:a.year}):void 0,onRemove:()=>g({libId:a.id,title:a.title||""}),renderPopup:(fe,se)=>e(Pt,{item:{id:a.tmdbId??0,title:a.title||"",year:a.year||"",type:a.mediaType||"tv",image:a.poster||""},anchorRect:fe,onMouseEnter:se.onMouseEnter,onMouseLeave:se.onMouseLeave,onRequestClose:se.close})},a.id)})}),e(pe,{ariaLabel:"Browse TV",options:En,value:s,onChange:k}),e("div",{children:H()}),e(Ue,{isOpen:!!i,itemName:i?.title,progressKind:"watch",listLabel:"my TV watchlist",onClose:()=>{g(null)},onConfirm:I})]})};function We(n){const l=n.currentTime??0,h=n.duration??0,t=(n.trackIndex??0)+1;return h>0?`Track ${t} · ${re(l)} / ${re(h)}`:n.trackLabel?`Track ${t} · ${n.trackLabel}`:`Track ${t}`}const On=({title:n="Continue Listening",limit:l=24,titleLink:h,showEmptyState:t=!0})=>{const o=ee(),{data:i,isLoading:g}=Ot(l),{toggle:s,bookmarkedIds:k}=Vt(),[y,N]=B(null),m=i?.data??[];return e(oe,{children:[e(Z,{title:n,eyebrow:"Pick up where you left off",titleLink:h??"/listening-list/Continue Listening",loading:g,carousel:!0,collapsible:!0,defaultExpanded:m.length>0,highlight:!0,itemCount:m.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"16 / 9"}}),skeletonCount:7,emptyState:t?e(ye,{icon:"headphones",text:"You haven't listened to anything yet. Browse ASMR and play a track to start tracking.",actionLabel:"Browse ASMR",onAction:()=>o("/asmr")}):void 0,children:m.map(c=>{const r=c.currentTime??0,w=c.duration??0,C=c.rjCode||c.id;return e(ge,{item:{id:c.id,title:c.title||"",thumbnail:c.thumbnail||"",chapterBadge:`Track ${(c.trackIndex??0)+1}`,isAdult:!!c.isAdult},linkTo:`/asmr/${encodeURIComponent(C)}`,hoverIcon:"play",layout:"horizontal",progress:w>0?{percent:Math.min(100,r/w*100),label:We(c)??""}:void 0,showProgress:!0,display:{elements:{poster:{typeBadge:!1,chapterBadge:!0,adultBadge:!0,removeButton:!0},info:{title:!0,mobileBadges:!0,progress:!0,meta:!1}}},onRemove:()=>N({workId:c.id,title:c.title||""}),renderPopup:(S,d)=>e(Ft,{data:{rjCode:c.rjCode||c.id,title:c.title||"",thumbnail:c.thumbnail||"",isAdult:!!c.isAdult,listenTarget:`/asmr/${encodeURIComponent(c.rjCode||c.id)}`,progressLabel:We(c)},anchorRect:S,bookmarked:k.has(zt(c.rjCode||c.id)),onToggleBookmark:()=>s({rjCode:c.rjCode||c.id,title:c.title||"",thumbnail:c.thumbnail||"",isAdult:!!c.isAdult}),onMouseEnter:d.onMouseEnter,onMouseLeave:d.onMouseLeave,onRequestClose:d.close}),rawThumbnail:!0},c.id)})}),e(Wt,{workId:y?y.workId:null,title:y?.title,onClose:()=>N(null)})]})},Vn=()=>e("div",{style:{paddingBottom:"2rem"},children:e(On,{})}),Fn=({items:n})=>{const l=ee(),h=Q(()=>n.slice(0,6).map(t=>{const o=ct(t.type,t.id);return{key:String(t.id),bannerSrc:t.backdrop?t.backdrop:t.image,posterSrc:t.image,posterAlt:t.title,title:t.title,detailTo:o,score:t.vote_average>0?Number(t.vote_average).toFixed(1):null,metaItems:[t.type==="tv"?"TV Show":"Movie",t.year].filter(Boolean),tags:t.genre_ids.slice(0,3).map(i=>dt[i]??ut[i]).filter(Boolean),synopsis:Ie(t.overview,200),primaryLabel:"Watch Now",primaryIcon:"play",onPrimary:()=>l(o),onDetails:()=>l(o)}}),[n,l]);return e(_e,{slides:h,eyebrow:"TV Spotlight"})},zn=({mangaList:n})=>{const l=ee(),h=Q(()=>n.slice(0,6).map(t=>{const o=`/manga/${t.provider||"mangadex"}/${t.id}`,i=Ce(t.provider||"mangadex",t.cover||"");return{key:`${t.provider}-${t.id}`,bannerSrc:i,posterSrc:i,posterAlt:t.title,title:t.title,detailTo:o,metaItems:[t.year?String(t.year):void 0,t.status??void 0].filter(g=>!!g),tags:t.tags.slice(0,3),synopsis:Ie(t.description,200,""),primaryLabel:"Read Now",primaryIcon:"book",onPrimary:()=>l(o),onDetails:()=>l(o)}}),[n,l]);return e(_e,{slides:h,eyebrow:"Manga Spotlight"})};function jn(n){const l=n.availableEpisodes?.sub;if(typeof l=="number"&&l>0)return l;const h=n.availableEpisodesDetail?.sub,t=n.availableEpisodesDetail?.dub,o=(Array.isArray(h)?h.length:0)+(Array.isArray(t)?t.length:0);return o>0?o:null}const Gn=({works:n})=>{const l=ee(),h=Q(()=>n.slice(0,6).map((t,o)=>{const i=ht(t),g=`/asmr/${encodeURIComponent(i)}`,s=jn(t);return{key:i||t._id||String(o),bannerSrc:t.thumbnail||"",posterSrc:t.thumbnail||"",posterAlt:t.name,title:t.name,detailTo:g,metaItems:[t.rating?t.rating.toUpperCase():void 0,s?`${s} track${s===1?"":"s"}`:void 0].filter(k=>!!k),tags:[],synopsis:Ie(t.description,160,""),primaryLabel:"Listen Now",primaryIcon:"play",onPrimary:()=>l(g),onDetails:()=>l(g)}}),[n,l]);return e(_e,{slides:h,eyebrow:"ASMR Spotlight",posterAspect:"landscape"})},Un="_seasonGrid_168jc_34",le={"section-header":"_section-header_168jc_1","content-type-nav":"_content-type-nav_168jc_8","title-wrapper":"_title-wrapper_168jc_18","pagination-controls":"_pagination-controls_168jc_24",seasonGrid:Un},qn=[{value:"anime",label:"Anime"},{value:"manga",label:"Manga"},{value:"tv",label:"TV & Movies"},{value:"asmr",label:"ASMR"}],fr=()=>{const n=kt(),l=mt(),[h,t]=q.useState(1),[o,i]=B(()=>ne.getItem("home_activeTab")||"latest"),[g,s]=B(()=>ne.getItem("season_format")||"TV"),k=z(null),{data:y}=Me(h+1,g,o==="season"),{titlePreference:N}=Fe(),{contentType:m,setContentType:c}=pt(),[r,w]=q.useState(null),C=gt(),{data:S=[]}=vt(),d=_t(),p=yt(),u=bt();P(()=>{document.title="Home - dango"},[]);const{data:f,isLoading:R}=ft();P(()=>{ne.setItem("home_activeTab",o)},[o]),P(()=>{ne.setItem("season_format",g),t(1)},[g]),P(()=>{f!==void 0&&f.length===0&&o==="week"&&i("latest")},[f,o]);const{data:V,isLoading:A,fetchNextPage:D,hasNextPage:L,isFetchingNextPage:F}=Tt(),j=x(()=>{L&&!F&&!A&&D()},[L,F,A,D]),{data:I,isLoading:U}=Nt(),{data:H,isLoading:a}=Ke("all","week",1,m==="tv"),{data:b,isLoading:T}=jt(m==="asmr"),{data:W,isLoading:X}=wt(),G=Q(()=>V?.pages||[],[V]),{data:K,isLoading:te}=Me(h,g,o==="season"),ae=14,be=K&&K.length>=ae&&y&&y.length>0,fe=Ct(l.continueWatching.remove.mutationOptions({onSuccess:async()=>{n.invalidateQueries(l.continueWatching.pathFilter()),await n.invalidateQueries({queryKey:[Ve.continueWatching]}),L&&G.length-1<14&&D()}})),se=x(O=>{const Y=G?.find(Te=>String(Te.id)===String(O));if(Y){const Te=Y[N]||Y.name;w({id:O,name:Te})}},[G,N]),Ae=[{key:"latest",label:"Latest Releases"},{key:"season",label:"Current Season"},{key:"popular",label:"Trending"}],Le=f!==void 0&&f.length>0,Ze=Le?[{key:"week",label:"This Week"},...Ae]:Ae,$e=o==="week"&&!Le?"latest":o,Je=()=>{switch($e){case"latest":return e(ga,{eyebrow:"Fresh episodes"});case"season":return e("section",{style:{marginBottom:"2.5rem"},children:[e("div",{className:le["section-header"],ref:k,children:[e("div",{className:le["title-wrapper"],children:e("div",{className:"title-stack",children:[e("div",{className:"section-eyebrow",children:"This season"}),e("div",{className:"section-title",style:{marginBottom:0},children:"Current Season"})]})}),e("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e(J,{ariaLabel:"Season format",width:90,value:g,onChange:s,options:[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}]}),e("div",{className:le["pagination-controls"],children:e(It,{page:h,canGoNext:be,onChange:O=>{if(t(O),k.current){const Y=k.current.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:Y,behavior:"smooth"})}},isLoading:te})})]})]}),e("div",{className:`grid-container ${le.seasonGrid}`,style:{minHeight:"300px",alignContent:"start"},children:te?e(je,{count:ae}):K?.slice(0,ae).map(O=>e(ce,{anime:O},O._id))})]});case"popular":return e(ha,{title:"Trending",eyebrow:"Discover"});case"week":return e(Pe,{title:"This Week",eyebrow:"Aired this week",animeList:f||[],continueWatching:!1,carousel:!0,loading:R});default:return null}};return e("div",{style:{paddingBottom:"2rem"},children:[m==="anime"&&(U&&!I?.length?e(ue,{}):I&&I.length>0&&e(Nn,{animeList:I})),m==="tv"&&(a&&!H?.results?.length?e(ue,{}):H?.results&&H.results.length>0&&e(Fn,{items:H.results})),m==="manga"&&(X&&!W?.length?e(ue,{}):W&&W.length>0&&e(zn,{mangaList:W})),m==="asmr"&&(T&&!b?.length?e(ue,{}):b&&b.length>0&&e(Gn,{works:b})),e("div",{className:le["content-type-nav"],children:e(pe,{ariaLabel:"Content type",options:qn,value:m,onChange:c})}),m==="manga"?e(Pn,{}):m==="tv"?e(Wn,{}):m==="asmr"?e(Vn,{}):e(oe,{children:[e(Pe,{title:"Continue Watching",eyebrow:"Pick up where you left off",titleLink:"/watchlist/Continue Watching",animeList:G,continueWatching:!0,carousel:!0,collapsible:!0,defaultExpanded:G.length>0,onRemove:se,loading:A,onReachThreshold:j,scrollThreshold:.7,isFetchingNextPage:F,emptyState:e(ye,{icon:"history",text:"You haven't watched anything yet. Start exploring and watch something first!",actionLabel:"Explore Trending",onAction:()=>i("popular")})}),e(At,{title:"Queue",eyebrow:"Up next",items:S,onRemove:O=>d.mutate({showId:O.showId,episodeNumber:O.episodeNumber}),showClearAll:!0,onClear:()=>p.mutate(),onReorder:O=>u.mutate(O.map(Y=>({id:Y.id,showId:Y.showId,episodeNumber:Y.episodeNumber})))}),e(pe,{ariaLabel:"Browse anime",options:Ze.map(O=>({value:O.key,label:O.label})),value:$e,onChange:i}),e("div",{children:Je()}),e(Ea,{eyebrow:"Never miss an episode"}),e(Ue,{isOpen:!!r,itemName:r?.name,progressKind:"watch",listLabel:"my watchlist",onClose:()=>{w(null)},onConfirm:O=>{r&&(fe.mutate({showId:r.id}),O&&C.mutate({id:r.id}))}})]})]})};export{fr as default};
@@ -1 +0,0 @@
1
- import{d as M,h as U,T as d,u as e,L as T}from"./vendor-core-DfaOB3Rn.js";import{b as $,u as z,a as G}from"./vendor-query-BBT5_sHx.js";import{q as m,t as u,aq as j,e as J,d as X,J as f,f as P}from"./index-B9fL2VIP.js";import{I as c}from"./vendor-icons-C1Pj_eSX.js";const Z="_header_45wm0_1",ee="_fadeIn_45wm0_1",ae="_personaBadge_45wm0_9",te="_personaInfo_45wm0_32",se="_personaLabel_45wm0_37",ne="_personaValue_45wm0_46",re="_statsGrid_45wm0_52",oe="_slideUpIn_45wm0_1",ce="_statCard_45wm0_62",le="_statIcon_45wm0_71",ie="_statInfo_45wm0_82",de="_statValue_45wm0_87",me="_statLabel_45wm0_96",he="_wideSection_45wm0_104",_e="_sectionHeader_45wm0_113",pe="_yearSelect_45wm0_128",ue="_heatmapLayout_45wm0_157",ge="_dayLabels_45wm0_164",we="_heatmapWrapper_45wm0_176",Ne="_heatmapMonthLabels_45wm0_182",ve="_heatmapGrid_45wm0_193",ye="_heatBox_45wm0_201",fe="_hiddenBox_45wm0_210",be="_level0_45wm0_221",Ce="_level1_45wm0_224",Se="_level2_45wm0_228",ke="_level3_45wm0_232",Be="_level4_45wm0_236",Le="_heatmapFooter_45wm0_241",Ie="_heatLegend_45wm0_248",De="_chartsContainer_45wm0_258",xe="_chartWrapper_45wm0_268",Re="_hourlyChart_45wm0_285",Me="_hourlyBarContainer_45wm0_293",Te="_hourlyBar_45wm0_293",$e="_hourlyLabel_45wm0_319",Ge="_chartSubtext_45wm0_326",Pe="_popScale_45wm0_339",We="_popTrack_45wm0_343",Oe="_popThumb_45wm0_351",qe="_popLabels_45wm0_363",Fe="_popDescription_45wm0_373",Ae="_seasonalChart_45wm0_386",Ve="_seasonalBarContainer_45wm0_394",He="_seasonalBar_45wm0_394",Ye="_seasonalLabel_45wm0_416",Ee="_genreList_45wm0_424",Ke="_genreRow_45wm0_431",Qe="_genreInfo_45wm0_437",Ue="_genreName_45wm0_444",ze="_genreCount_45wm0_451",je="_genreBarBg_45wm0_458",Je="_genreBar_45wm0_458",Xe="_warningSection_45wm0_471",Ze="_warningHeader_45wm0_477",ea="_droppedGrid_45wm0_493",aa="_droppedCard_45wm0_498",ta="_droppedName_45wm0_507",sa="_droppedDate_45wm0_514",na="_genreGrid_45wm0_561",ra="_genreCard_45wm0_579",oa="_rankBadge_45wm0_585",ca="_rankNumber_45wm0_598",la="_genreTitle_45wm0_604",ia="_genreStats_45wm0_612",da="_posterRow_45wm0_620",ma="_miniPoster_45wm0_627",ha="_genreCardSkeleton_45wm0_641",_a="_pulse_45wm0_1",pa="_skeletonRank_45wm0_647",ua="_skeletonTitle_45wm0_661",ga="_skeletonStats_45wm0_674",wa="_skeletonPosters_45wm0_686",Na="_recSection_45wm0_717",va="_recHeader_45wm0_721",ya="_recSubtext_45wm0_736",fa="_recControls_45wm0_742",ba="_recControlBtn_45wm0_748",Ca="_recPosterButton_45wm0_776",Sa="_recAddBtn_45wm0_777",ka="_recGrid_45wm0_787",Ba="_recEmpty_45wm0_793",La="_recCard_45wm0_801",Ia="_recCover_45wm0_819",Da="_recInfo_45wm0_827",xa="_recTitle_45wm0_834",Ra="_recMatch_45wm0_845",Ma="_recMeta_45wm0_851",Ta="_recWhy_45wm0_856",$a="_recNote_45wm0_865",Ga="_loading_45wm0_900",Pa="_error_45wm0_906",a={header:Z,fadeIn:ee,personaBadge:ae,personaInfo:te,personaLabel:se,personaValue:ne,statsGrid:re,slideUpIn:oe,statCard:ce,statIcon:le,statInfo:ie,statValue:de,statLabel:me,wideSection:he,sectionHeader:_e,yearSelect:pe,heatmapLayout:ue,dayLabels:ge,heatmapWrapper:we,heatmapMonthLabels:Ne,heatmapGrid:ve,heatBox:ye,hiddenBox:fe,level0:be,level1:Ce,level2:Se,level3:ke,level4:Be,heatmapFooter:Le,heatLegend:Ie,chartsContainer:De,chartWrapper:xe,hourlyChart:Re,hourlyBarContainer:Me,hourlyBar:Te,hourlyLabel:$e,chartSubtext:Ge,popScale:Pe,popTrack:We,popThumb:Oe,popLabels:qe,popDescription:Fe,seasonalChart:Ae,seasonalBarContainer:Ve,seasonalBar:He,seasonalLabel:Ye,genreList:Ee,genreRow:Ke,genreInfo:Qe,genreName:Ue,genreCount:ze,genreBarBg:je,genreBar:Je,warningSection:Xe,warningHeader:Ze,droppedGrid:ea,droppedCard:aa,droppedName:ta,droppedDate:sa,genreGrid:na,genreCard:ra,rankBadge:oa,rankNumber:ca,genreTitle:la,genreStats:ia,posterRow:da,miniPoster:ma,genreCardSkeleton:ha,pulse:_a,skeletonRank:pa,skeletonTitle:ua,skeletonStats:ga,skeletonPosters:wa,recSection:Na,recHeader:va,recSubtext:ya,recControls:fa,recControlBtn:ba,recPosterButton:Ca,recAddBtn:Sa,recGrid:ka,recEmpty:Ba,recCard:La,recCover:Ia,recInfo:Da,recTitle:xa,recMatch:Ra,recMeta:Ma,recWhy:Ta,recNote:$a,loading:Ga,error:Pa},Aa=()=>{const[b,C]=M(0);U(()=>{document.title="Insights - dango"},[]);const{data:n,isLoading:W,isError:O}=$({queryKey:[m.insights],queryFn:async()=>await u.insights.summary.query()}),{data:q,isLoading:S}=j(),{hasConsent:F}=J(),{titlePreference:A}=X(),g=z(),{data:w,isLoading:k,isFetching:B,isError:N}=$({queryKey:[m.insightsRecommendations],queryFn:async()=>await u.insights.recommendations.query(),staleTime:300*1e3,retry:1}),v=G({mutationFn:()=>u.insights.recommendations.query({refresh:!0}),onSuccess:t=>{g.setQueryData([m.insightsRecommendations],t),C(0)},onError:()=>f.error("Could not refresh recommendations")}),L=G({mutationFn:async t=>{await u.watchlist.add.mutate({id:String(t.id),name:t.title,thumbnail:t.cover||"",status:"Plan to Watch",type:t.format})},onSuccess:()=>{g.invalidateQueries({queryKey:[m.watchlist]}),g.invalidateQueries({queryKey:[m.insightsRecommendations]}),f.success("Added to Plan to Watch")},onError:()=>f.error("Could not add to watchlist")}),l=d(()=>[...w?.candidates||[]].sort((t,s)=>s.matchPct-t.matchPct),[w]),y=d(()=>{if(!l.length)return[];const t=b%l.length;return[...l,...l].slice(t,t+Math.min(6,l.length))},[l,b]),I=t=>{const s=t.name||t.englishName||t.nativeName||"";switch(A){case"nativeName":return t.nativeName||s;case"englishName":return t.englishName||s;default:return s}},[h,V]=M(new Date().getFullYear()),H=d(()=>{if(!n?.activityGrid)return[new Date().getFullYear()];const t=new Set(n.activityGrid.map(s=>parseInt(s.day.split("-")[0])));return t.add(new Date().getFullYear()),Array.from(t).sort((s,r)=>r-s)},[n]),D=d(()=>{if(!n?.activityGrid)return[];const t=new Map(n.activityGrid.map(p=>[p.day,p.count])),s=[],r=new Date(h,0,1),i=new Date(h,11,31),_=r.getDay(),o=new Date(r);for(o.setDate(o.getDate()-_);(o<=i||o.getDay()!==0)&&!(o>i&&o.getDay()===0);){const p=o.getFullYear(),K=String(o.getMonth()+1).padStart(2,"0"),Q=String(o.getDate()).padStart(2,"0"),x=`${p}-${K}-${Q}`,R=o<r||o>i;s.push({date:x,count:R?0:t.get(x)||0,month:o.getMonth(),isOutOfRange:R}),o.setDate(o.getDate()+1)}return s},[n,h]),Y=d(()=>n?.seasonality?.length?Math.max(...n.seasonality.map(t=>t.seconds),1):0,[n]),E=d(()=>n?.hourlyDist?.length?Math.max(...n.hourlyDist.map(t=>t.count),1):0,[n]);return W||S?e("div",{className:a.loading,children:"Analyzing your anime lifestyle..."}):O?e("div",{className:a.error,children:"Could not load insights. Data might be syncing."}):n?e("div",{className:"page-container",children:[e("div",{className:a.header,children:[e("div",{className:"title-stack",children:[e("div",{className:"section-eyebrow",children:"Your viewing habits"}),e("h2",{className:"section-title",children:"Watch Insights"})]}),e("div",{className:a.personaBadge,children:[e(c,{name:"user-astronaut"}),e("div",{className:a.personaInfo,children:[e("span",{className:a.personaLabel,children:"Your Persona"}),e("span",{className:a.personaValue,children:n.persona})]})]})]}),e("div",{className:a.statsGrid,children:[e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(138, 79, 255, 0.2)",color:"var(--accent)"},children:e(c,{name:"clock"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.totalHours,"h"]}),e("span",{className:a.statLabel,children:"Watch Time"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(167, 139, 250, 0.2)",color:"#a78bfa"},children:e(c,{name:"bookmark"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.totalAnime}),e("span",{className:a.statLabel,children:"Total Anime"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(34, 197, 94, 0.2)",color:"#22c55e"},children:e(c,{name:"check-circle"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.totalEpisodes}),e("span",{className:a.statLabel,children:"Episodes Watched"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(34, 197, 94, 0.2)",color:"#22c55e"},children:e(c,{name:"check-circle"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.completionRate,"%"]}),e("span",{className:a.statLabel,children:"Completion Rate"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(45, 212, 191, 0.2)",color:"#2dd4bf"},children:e(c,{name:"tv"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.completedAnime}),e("span",{className:a.statLabel,children:"Completed Shows"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(239, 68, 68, 0.2)",color:"#ef4444"},children:e(c,{name:"fire"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.bingeFactor}),e("span",{className:a.statLabel,children:"Max Daily Binge"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(59, 130, 246, 0.2)",color:"#3b82f6"},children:e(c,{name:"history"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.avgSessionMinutes,"m"]}),e("span",{className:a.statLabel,children:"Avg. Session"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(251, 191, 36, 0.2)",color:"#fbbf24"},children:e(c,{name:"layer-group"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.avgCompletionDays,"d"]}),e("span",{className:a.statLabel,children:"Avg. Speed"})]})]})]}),e("div",{className:a.wideSection,children:[e("div",{className:a.sectionHeader,children:[e("h3",{children:"Activity"}),e("select",{className:a.yearSelect,value:h,onChange:t=>V(Number(t.currentTarget.value)),children:H.map(t=>e("option",{value:t,children:t},t))})]}),e("div",{className:a.heatmapLayout,children:[e("div",{className:a.dayLabels,children:[e("span",{style:{gridRow:2},children:"Mon"}),e("span",{style:{gridRow:4},children:"Wed"}),e("span",{style:{gridRow:6},children:"Fri"})]}),e("div",{className:a.heatmapWrapper,children:[e("div",{className:a.heatmapMonthLabels,children:(()=>{const t=[];let s=-1;return D.forEach((r,i)=>{if(r.month!==s&&!r.isOutOfRange){const _=Math.floor(i/7)+1;_>(t.length>0?t[t.length-1].props.style?.gridColumn+2:-1)&&(t.push(e("span",{style:{gridColumn:_,whiteSpace:"nowrap"},children:new Date(0,r.month).toLocaleString("default",{month:"short"})},i)),s=r.month)}}),t})()}),e("div",{className:a.heatmapGrid,children:D.map((t,s)=>{let r=0;return t.count>0&&!t.isOutOfRange&&(r=1),t.count>2&&!t.isOutOfRange&&(r=2),t.count>5&&!t.isOutOfRange&&(r=3),t.count>10&&!t.isOutOfRange&&(r=4),e("div",{className:`${a.heatBox} ${a[`level${r}`]} ${t.isOutOfRange?a.hiddenBox:""}`,title:t.isOutOfRange?"":`${t.count} episodes on ${t.date}`},s)})}),e("div",{className:a.heatmapFooter,children:e("div",{className:a.heatLegend,children:[e("span",{children:"Less"}),e("div",{className:`${a.heatBox} ${a.level0}`}),e("div",{className:`${a.heatBox} ${a.level1}`}),e("div",{className:`${a.heatBox} ${a.level2}`}),e("div",{className:`${a.heatBox} ${a.level3}`}),e("div",{className:`${a.heatBox} ${a.level4}`}),e("span",{children:"More"})]})})]})]})]}),e("div",{className:a.chartsContainer,children:[e("div",{className:a.chartWrapper,children:[e("h3",{children:"Time Distribution (24h)"}),e("div",{className:a.hourlyChart,children:n.hourlyDist?.map((t,s)=>e("div",{className:a.hourlyBarContainer,children:[e("div",{className:a.hourlyBar,style:{height:`${t.count/E*100||2}%`,width:"100%",maxWidth:"12px"},title:`${t.count} watches at ${t.hour}:00`}),e("span",{className:a.hourlyLabel,style:{visibility:s%4===0?"visible":"hidden"},children:t.hour})]},s))}),e("div",{className:a.chartSubtext,children:(()=>{if(!n.hourlyDist?.length)return"Watch more to see your peak hours!";const t=parseInt([...n.hourlyDist].sort((s,r)=>r.count-s.count)[0].hour);return t>=6&&t<19?"You prefer daytime watching ☀️":"You're a confirmed Night Owl 🦉"})()})]}),e("div",{className:a.chartWrapper,children:[e("h3",{children:"Popularity Bias"}),e("div",{className:a.popScale,children:[e("div",{className:a.popTrack,children:e("div",{className:a.popThumb,style:{left:`${Math.max(0,Math.min(100,100-n.popularityScore*10))}%`}})}),e("div",{className:a.popLabels,children:[e("span",{children:"Mainstream"}),e("span",{children:"Underground"})]})]}),e("p",{className:a.popDescription,children:["Your taste score is ",e("strong",{children:[n.popularityScore,"/10"]}),".",n.popularityScore>=5?" You follow the big hits!":" You're a connoisseur of the obscure!"]})]}),e("div",{className:a.chartWrapper,children:[e("h3",{children:"Monthly Activity"}),e("div",{className:a.seasonalChart,children:n.seasonality?.map((t,s)=>e("div",{className:a.seasonalBarContainer,children:[e("div",{className:a.seasonalBar,style:{height:`${t.seconds/Y*100||5}%`,width:"100%",maxWidth:"24px"},title:`${Math.round(t.seconds/3600)}h in ${new Date(0,s).toLocaleString("default",{month:"long"})}`}),e("span",{className:a.seasonalLabel,children:new Date(0,s).toLocaleString("default",{month:"short"})})]},s))})]})]}),e("div",{className:a.genreGrid,children:S?Array.from({length:4}).map((t,s)=>e("div",{className:a.genreCardSkeleton,children:[e("div",{className:a.skeletonRank}),e("div",{className:a.skeletonTitle}),e("div",{className:a.skeletonStats}),e("div",{className:a.skeletonPosters})]},s)):q?.filter(t=>F||t.name.toLowerCase()!=="hentai").map(t=>e("div",{className:a.genreCard,children:[e("div",{className:a.rankBadge,children:e("span",{className:a.rankNumber,children:t.rank})}),e("h3",{className:a.genreTitle,children:t.name}),e("div",{className:a.genreStats,children:[e("span",{children:[t.count," episodes"]}),e("span",{children:t.meanScore>0?`${t.meanScore.toFixed(1)} avg score`:"-"}),e("span",{children:t.timeWatched})]}),e("div",{className:a.posterRow,children:t.topShows.map(s=>e("img",{src:P(s.thumbnail),alt:I(s),className:a.miniPoster,title:I(s),loading:"lazy",decoding:"async"},s.id))})]},t.name))}),(y.length>0||k||N||w)&&e("div",{className:a.recSection,children:[e("div",{className:a.recHeader,children:[e("div",{children:[e("h3",{children:"Recommended For You"}),e("p",{className:a.recSubtext,children:"Based on your completed shows and genre taste"})]}),e("div",{className:a.recControls,children:[l.length>6&&e("button",{className:a.recControlBtn,onClick:()=>C(t=>(t+6)%l.length),children:"Different picks"}),e("button",{className:a.recControlBtn,onClick:()=>v.mutate(),disabled:B||v.isPending,children:[e(c,{name:"sync-alt"}),B||v.isPending?"Refreshing…":"Refresh"]})]})]}),N||!k&&y.length===0?e("p",{className:a.recEmpty,children:N?"Recommendations could not load. Try refreshing.":"No new recommendations yet. Keep watching or try again later."}):e("div",{className:a.recGrid,children:y.map(t=>e("div",{className:a.recCard,children:[t.cover&&e(T,{to:`/anime/${t.id}`,className:a.recPosterButton,"aria-label":`View ${t.title}`,children:e("img",{src:P(t.cover),alt:"",className:a.recCover,loading:"lazy",decoding:"async"})}),e("div",{className:a.recInfo,children:[e(T,{to:`/anime/${t.id}`,className:a.recTitle,children:t.title}),e("span",{className:a.recMatch,children:[t.matchPct,"% taste match"]}),e("span",{className:a.recMeta,children:[t.year,t.format,t.episodes?`${t.episodes}ep`:null].filter(Boolean).join(" · ")}),e("span",{className:a.recWhy,children:["Shares ",t.sharedGenres.join(", "),t.exemplars.length>0&&` - like ${t.exemplars.join(", ")}`]}),t.kind==="continue"&&e("span",{className:a.recNote,children:"Continue - you watched the earlier part."}),t.kind==="sequel"&&t.prequelTitle&&e("span",{className:a.recNote,children:['Sequel - start with "',t.prequelTitle,'" first.']}),e("button",{className:a.recAddBtn,onClick:()=>L.mutate(t),disabled:L.isPending,children:[e(c,{name:"plus"})," Plan to Watch"]})]})]},t.id))})]}),n.droppedShows?.length>0&&e("div",{className:a.warningSection,children:[e("div",{className:a.warningHeader,children:[e(c,{name:"exclamation-triangle"}),e("h3",{children:"Dusty Watchlist (Inactive 90+ days)"})]}),e("div",{className:a.droppedGrid,children:n.droppedShows.map(t=>e("div",{className:a.droppedCard,children:[e("span",{className:a.droppedName,children:t.name}),e("span",{className:a.droppedDate,children:["Last watched: ",new Date(t.lastActivity).toLocaleDateString()]})]},t.id))})]})]}):null};export{Aa as default};
@@ -1 +0,0 @@
1
- import{u as e,a as Q,d as z,S as E,o as O,p as G,T as $,h as Y}from"./vendor-core-DfaOB3Rn.js";import{I as x}from"./vendor-icons-C1Pj_eSX.js";import{a8 as H,m as D,af as U,B as M,e as J,ag as K,d as V}from"./index-B9fL2VIP.js";import{E as X}from"./ErrorMessage-hMt90aG4.js";import{s as r}from"./Manga.module-depGEacJ.js";import{c as Z,d as j,e as ee,m as A,f as te,g as ae,r as re,h as ne,j as se,p as ie,k as oe,M as le}from"./useMangaLibrary-CUNeIgcg.js";import{p as ce}from"./page.module-C1MlZzf3.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-Cnx2xRQb.js";const de=({detail:a,altTitle:c,onBack:k,onOpenChapter:v,bookmarkButton:n,statusSelect:g,primaryAction:b,progressByChapter:d})=>{const h=[a.type,a.status,a.year?String(a.year):"",a.author?`by ${a.author}`:""].filter(Boolean);return e("div",{children:[e("button",{className:r.backBtn,onClick:k,children:[e(x,{name:"chevron-left",size:12})," Back to browse"]}),e("div",{className:r.detail,children:[a.cover&&e(H,{className:r.detailCover,src:D(a.provider,a.cover),alt:a.title,decoding:"async",draggable:!1}),e("div",{className:r.detailInfo,children:[e("h2",{className:r.detailTitle,children:a.title}),c&&e("p",{className:r.detailAltTitle,children:["Also known as: ",c]}),h.length>0&&e("div",{className:r.detailMeta,children:h.map(t=>e("span",{className:r.badge,children:t},t))}),a.genres&&a.genres.length>0&&e("div",{className:r.detailMeta,children:a.genres.map(t=>e("span",{className:r.badge,children:t},t))}),a.description&&e("p",{className:r.detailDesc,children:a.description}),(n||g||b)&&e("div",{className:r.detailActions,children:[b,n,g]})]})]}),e("h3",{className:r.detailTitle,style:{fontSize:"1rem"},children:["Chapters (",a.chapters.length,")"]}),a.chapters.length===0?e("p",{className:r.statusMsg,children:"No chapters found for this title on this provider."}):e("div",{className:r.chapterList,children:a.chapters.map(t=>{const o=d?.get(t.id),p=!!o&&o.pageCount>0&&o.page>=o.pageCount;return e("button",{className:`${r.chapterRow} ${p?r.chapterDone:""}`,onClick:()=>v(t),title:t.externalUrl?"External only - opens on source site":void 0,children:[e("span",{children:["Ch. ",t.number,t.title?` - ${t.title}`:""]}),e("span",{className:r.chapterMeta,children:[o&&o.pageCount>0?p?"read":`p. ${o.page}/${o.pageCount}`:"",t.group,t.externalUrl?"external":""].filter(Boolean).join(" · ")})]},t.id)})})]})},pe=({libId:a,anilistId:c})=>{const k=Q(),v=Z(a),n=v.data?.item,[g,b]=z(null),[d,h]=z(null),t=g??n?.title??"",o=U({provider:"mangadex",query:t,page:1,sort:"",status:"",type:"",rating:"safe",mature:!1},!!t),p=U({provider:"mangapill",query:t,page:1,sort:"",status:"",type:"",rating:"safe",mature:!1},!!t),S=j(),y=ee(),I=async s=>{const u=A(s.provider,s.id);h(u);try{await S.mutateAsync({provider:s.provider,mangaId:s.id,title:s.title,cover:s.cover,altTitle:s.altTitle,contentRating:s.contentRating,silent:!0}),await y.mutateAsync({id:u,anilistId:c}),k(`/manga/${s.provider}/${encodeURIComponent(s.id)}`)}catch{return}finally{h(null)}},C=(s,u,T)=>e("div",{style:{marginTop:"12px"},children:[e("div",{style:{fontWeight:600,textTransform:"capitalize",marginBottom:"6px"},children:s}),T?e("div",{style:{color:"var(--text-tertiary)",fontSize:"0.85rem"},children:"Searching…"}):!u||u.length===0?e("div",{style:{color:"var(--text-tertiary)",fontSize:"0.85rem"},children:"No matches."}):u.slice(0,6).map(l=>{const B=A(l.provider,l.id),N=d===B;return e("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"6px 0",borderTop:"1px solid var(--border, #223)"},children:[l.cover&&e("img",{src:D(l.provider,l.cover),alt:"",loading:"lazy",style:{width:"34px",height:"48px",objectFit:"cover",borderRadius:"4px"}}),e("div",{style:{flex:1,minWidth:0},children:[e("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.title}),l.latestChapter&&e("div",{style:{color:"var(--text-tertiary)",fontSize:"0.75rem"},children:l.latestChapter})]}),e(M,{onClick:()=>I(l),disabled:N,children:[e(x,{name:"external-link-alt",size:12})," ",N?"Linking…":"Link"]})]},B)})]});return e("div",{children:[e("button",{onClick:()=>k("/manga"),style:{background:"none",border:"none",color:"var(--accent)",cursor:"pointer",marginBottom:"12px"},children:[e(x,{name:"chevron-left",size:12})," Back to browse"]}),v.isLoading?e("div",{style:{color:"var(--text-tertiary)"},children:"Loading library entry…"}):n?e(E,{children:[e("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[n.cover&&e("img",{src:n.cover,alt:"",style:{width:"64px",height:"90px",objectFit:"cover",borderRadius:"6px"}}),e("div",{children:[e("h2",{style:{margin:"0 0 4px"},children:n.title}),e("div",{style:{color:"var(--text-tertiary)",fontSize:"0.85rem"},children:["Tracked on AniList",n.lastChapterNumber?` · Ch. ${n.lastChapterNumber}`:"",n.status?` · ${n.status}`:""]})]})]}),e("p",{style:{color:"var(--text-tertiary)",fontSize:"0.85rem",marginTop:"12px"},children:"AniList doesn't host chapters. Search your providers below and link the matching manga - your AniList status and chapter progress will sync to it from now on."}),e("div",{style:{display:"flex",gap:"8px",marginTop:"8px"},children:e("input",{type:"text",value:g??n.title,onChange:s=>b(s.currentTarget.value),placeholder:"Search providers…",style:{flex:1,padding:"8px 10px",borderRadius:"6px",border:"1px solid var(--border, #223)",background:"var(--bg-secondary, transparent)",color:"inherit"}})}),C("mangadex",o.data?.items,o.isLoading),C("mangapill",p.data?.items,p.isLoading)]}):e("div",{style:{color:"var(--text-tertiary)"},children:"This AniList entry is no longer in your library."})]})};function xe(){const{provider:a="",id:c=""}=O(),[k]=G(),v=Q(),{hasConsent:n}=J(),g=k.get("rating")||"safe",b=n?g:"safe",d=a&&c?A(a,c):void 0,h=K(a||null,c||null,b,n),t=h.data,o=te(d),p=ae(d),{titlePreference:S}=V(),y=$(()=>t&&{...t,title:re(t,S)},[t,S]),I=j(),C=ne(),s=se();Y(()=>{y&&(document.title=`${y.title} - dango`)},[y]);const u=$(()=>{const i=new Map;for(const m of p.data?.progress??[])i.set(m.chapterId,m);return i},[p.data]),T=a.toLowerCase()==="anilist"&&/^\d+$/.test(c)?parseInt(c,10):null,l=o.data?.inLibrary??!1,B=o.data?.status??"Reading",N=$(()=>(t?.chapters??[]).filter(i=>!i.externalUrl),[t]),f=$(()=>{if(!t)return null;const i=[...p.data?.progress??[]].sort((m,L)=>L.updatedAt-m.updatedAt);for(const m of i){const L=t.chapters.find(w=>w.id===m.chapterId);if(L&&!L.externalUrl)return L;const P=ie(m.chapterId);if(P!=null){const w=oe(t.chapters,P);if(w&&!w.externalUrl)return w}}return N[0]??null},[t,p.data,N]),F=f?u.get(f.id):void 0,W=(p.data?.progress?.length??0)>0,_=f&&(F||W)?`Continue Ch. ${f?.number}`:"Start Reading",R=i=>{if(i.externalUrl){window.open(i.externalUrl,"_blank","noopener,noreferrer");return}const m=new URLSearchParams;m.set("chapter",i.id),n&&g!=="safe"&&m.set("rating",g),v(`/manga/${a}/${encodeURIComponent(c)}/read?${m.toString()}`)},q=()=>{!t||!d||(l?C.mutate(d):I.mutate({provider:a,mangaId:c,title:t.title,cover:t.cover,author:t.author,altTitle:t.altTitle,contentRating:t.contentRating}))};return e("div",{className:ce.page,children:h.isLoading?e("div",{"aria-hidden":!0,children:[e("div",{className:`${r.skeletonThumb} ${r.shimmer}`,style:{maxWidth:"12rem"}}),e("div",{className:`${r.skeletonLine} ${r.shimmer}`,style:{width:"40%"}}),e("div",{className:`${r.skeletonLine} ${r.shimmer}`,style:{width:"70%"}})]}):h.isError||!t||!y?T!=null&&d?e(pe,{libId:d,anilistId:T}):e(E,{children:[e("button",{className:r.backBtn,onClick:()=>v("/manga"),children:[e(x,{name:"chevron-left",size:12})," Back to browse"]}),e(X,{message:"Failed to load this title. Please try again."})]}):e(de,{detail:y,altTitle:t.altTitle!==y.title?t.altTitle:void 0,onBack:()=>v("/manga"),onOpenChapter:R,progressByChapter:u,primaryAction:f?e(M,{onClick:()=>f&&R(f),children:[e(x,{name:"book",size:13})," ",_]}):void 0,bookmarkButton:e(M,{variant:l?"secondary":"primary",onClick:q,disabled:I.isPending||C.isPending,children:[e(x,{name:"bookmark",size:13})," ",l?"Bookmarked":"Bookmark"]}),statusSelect:l?e("select",{className:r.detailSelect,value:B,onChange:i=>d&&s.mutate({id:d,status:i.currentTarget.value}),"aria-label":"Reading status",children:le.map(i=>e("option",{value:i,children:i},i))}):void 0})})}export{xe as default};
@@ -1 +0,0 @@
1
- ._pagination_zelsc_1{display:flex;align-items:center;gap:var(--space-2)}._pageBtn_zelsc_7{background:none;border:none;color:var(--text-primary);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:6px;min-width:28px;border-radius:var(--radius-full);transition:all var(--transition-fast);gap:var(--space-2);font-size:var(--font-size-sm)}._pageBtn_zelsc_7:hover:not(:disabled){background:var(--bg-tertiary);color:var(--accent)}._pageBtn_zelsc_7:disabled{opacity:.3;cursor:not-allowed}._pageBtn_zelsc_7 span{font-size:var(--font-size-xs);font-weight:600}._pageInfo_zelsc_38{font-size:var(--font-size-sm);color:var(--text-secondary);white-space:nowrap}._pageInfo_zelsc_38 strong{color:var(--text-primary)}._pagePicker_zelsc_48{position:relative}._dropdown_zelsc_52{position:absolute;bottom:calc(100% + 8px);left:50%;transform:translate(-50%);z-index:50;background:var(--bg-secondary);border:1px solid var(--border-secondary);border-radius:var(--radius-lg);padding:10px;width:210px;max-width:calc(100vw - 32px);box-shadow:0 12px 32px #00000059;touch-action:manipulation}._dropdown_zelsc_52._flipDown_zelsc_68{bottom:auto;top:calc(100% + 8px)}._jumpRow_zelsc_73{display:flex;gap:8px;margin-bottom:8px}._jumpInput_zelsc_79{flex:1;min-width:0;background:var(--bg-tertiary);border:1px solid var(--border-primary);color:var(--text-primary);border-radius:8px;padding:6px 10px;font-size:.85rem}._jumpGo_zelsc_90{background:var(--bg-tertiary);border:1px solid var(--border-primary);color:var(--text-primary);border-radius:8px;padding:6px 12px;font-size:.8rem;font-weight:700;cursor:pointer}._jumpGo_zelsc_90:hover{border-color:var(--accent)}._optionList_zelsc_105{display:grid;grid-template-columns:repeat(5,1fr);gap:4px;max-height:180px;overflow-y:auto}._optionBtn_zelsc_113{background:none;border:none;color:var(--text-primary);border-radius:6px;padding:6px 0;font-size:.8rem;cursor:pointer}._optionBtn_zelsc_113:hover:not(:disabled){background:var(--bg-tertiary);color:var(--accent)}._optionBtn_zelsc_113:disabled{cursor:default}._optionBtn_zelsc_113._current_zelsc_132{font-weight:800;background:var(--bg-tertiary)}@media(pointer:coarse){._dropdown_zelsc_52{width:240px;padding:12px}._jumpInput_zelsc_79{min-height:44px;font-size:1rem}._jumpGo_zelsc_90{min-height:44px;padding:6px 16px}._optionList_zelsc_105{grid-template-columns:repeat(4,1fr);gap:6px;max-height:220px}._optionBtn_zelsc_113{min-height:44px;font-size:.9rem}._pageBtn_zelsc_7{min-width:36px;min-height:36px}}._popupPortal_1d6yy_1{z-index:var(--z-popover);pointer-events:none}._popupContent_1d6yy_6{pointer-events:auto;width:320px;background-color:var(--bg-secondary);border-radius:var(--radius-lg);box-shadow:0 10px 30px #00000080;border:1px solid var(--border-secondary);overflow:hidden;display:flex;flex-direction:column;animation:_fadeIn_1d6yy_1 .2s ease-out;color:var(--text-primary)}@keyframes _fadeIn_1d6yy_1{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}._popupBackdrop_1d6yy_31{position:fixed;inset:0;z-index:var(--z-popover);background:#0009}._popupPortal_1d6yy_1._mobile_1d6yy_38{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:calc(var(--z-popover) + 1);pointer-events:auto}._popupPortal_1d6yy_1._mobile_1d6yy_38 ._popupContent_1d6yy_6{width:min(340px,calc(100vw - 32px));max-height:85svh;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}@media(orientation:landscape)and (max-height:500px){._popupPortal_1d6yy_1._mobile_1d6yy_38 ._popupContent_1d6yy_6{width:min(460px,calc(100vw - 24px));max-height:calc(100svh - 16px)}}._header_1d6yy_62{padding:var(--space-4);background:linear-gradient(to bottom,rgba(0,0,0,.3),transparent)}._title_1d6yy_67{font-size:var(--font-size-lg);font-weight:var(--font-weight-bold);margin-bottom:var(--space-1);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--accent-light)}._altTitle_1d6yy_78{font-size:var(--font-size-xs);color:var(--text-muted);display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}._cover_1d6yy_87{display:block;width:100%;aspect-ratio:16 / 9;object-fit:cover;border-radius:var(--radius-md);margin-bottom:var(--space-3);background:var(--bg-tertiary)}._body_1d6yy_97{padding:0 var(--space-4) var(--space-4) var(--space-4);display:flex;flex-direction:column;gap:var(--space-3)}._metaRow_1d6yy_104{display:flex;align-items:center;gap:var(--space-4);font-size:var(--font-size-sm)}._metaItem_1d6yy_111{display:flex;align-items:center;gap:var(--space-1)}._scoreIcon_1d6yy_117{color:var(--accent-lighter)}._synopsis_1d6yy_121{font-size:var(--font-size-sm);color:var(--text-secondary);line-height:1.5;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}._details_1d6yy_131{display:flex;flex-direction:column;gap:var(--space-1);font-size:var(--font-size-xs);color:var(--text-muted)}._detailItem_1d6yy_139 strong{color:var(--text-secondary)}._genres_1d6yy_143{display:flex;flex-wrap:wrap;gap:var(--space-1);margin-top:var(--space-1)}._genre_1d6yy_143{background:var(--bg-tertiary);padding:2px 8px;border-radius:var(--radius-sm);font-size:12px;color:var(--text-secondary)}._footer_1d6yy_158{padding:var(--space-4);border-top:1px solid var(--border-secondary);background-color:var(--bg-tertiary);display:flex;flex-direction:column;gap:var(--space-2)}._primaryAction_1d6yy_167{width:100%}._watchBtn_1d6yy_171{width:100%;height:48px;background-color:var(--accent);color:var(--accent-text);border:none;border-radius:var(--radius-md);font-weight:var(--font-weight-bold);display:flex;align-items:center;justify-content:center;gap:var(--space-2);cursor:pointer;transition:all .2s;text-decoration:none;font-size:var(--font-size-base)}._watchBtn_1d6yy_171:hover{background-color:var(--accent-dark);transform:translateY(-1px)}._secondaryActions_1d6yy_194{display:flex;gap:var(--space-2)}._watchlistBtn_1d6yy_199,._detailsBtn_1d6yy_200{flex:1;height:36px;display:flex;align-items:center;justify-content:center;gap:var(--space-2);background-color:var(--bg-elevated);color:var(--text-primary);border:1px solid var(--border-secondary);border-radius:var(--radius-md);cursor:pointer;font-size:11px;font-weight:var(--font-weight-semibold);transition:all .2s;text-decoration:none;white-space:nowrap}._watchlistBtn_1d6yy_199:hover,._detailsBtn_1d6yy_200:hover{background-color:var(--bg-secondary);border-color:var(--accent);color:var(--accent)}._watchlistBtn_1d6yy_199._active_1d6yy_226{background-color:var(--accent);border-color:var(--accent);color:var(--accent-text)}._watchlistBtn_1d6yy_199._active_1d6yy_226:hover{background-color:var(--accent-dark);border-color:var(--accent-dark)}._loading_1d6yy_237{padding:var(--space-8);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-4);color:var(--text-muted)}._spinner_1d6yy_247{width:30px;height:30px;border:3px solid rgba(255,255,255,.1);border-top-color:var(--accent);border-radius:50%;animation:_spin_1d6yy_247 1s linear infinite}@keyframes _spin_1d6yy_247{to{transform:rotate(360deg)}}._cardWrapper_erb2k_1{position:relative;width:100%;height:100%;min-width:0;z-index:1;transition:z-index var(--transition-fast);content-visibility:auto;contain-intrinsic-size:200px 300px;border-radius:var(--radius-md)}._cardWrapper_erb2k_1:hover{z-index:5}._card_erb2k_1{display:flex;flex-direction:column;background-color:var(--bg-secondary);border-radius:var(--radius-md);overflow:hidden;height:100%;min-width:0;box-shadow:none;border:1px solid var(--border-secondary);transition:border-color var(--transition-base),background-color var(--transition-base),box-shadow var(--transition-base);-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}._cardButton_erb2k_36{width:100%;padding:0;text-align:left;font:inherit;border:1px solid var(--border-secondary);cursor:pointer}._cardButton_erb2k_36:focus-visible{outline:2px solid var(--accent);outline-offset:2px}._cardWrapper_erb2k_1:hover ._card_erb2k_1,._cardWrapper_erb2k_1:focus-within ._card_erb2k_1{border-color:color-mix(in srgb,var(--accent) 45%,transparent);background-color:var(--bg-tertiary);box-shadow:0 4px 20px #00000080,0 0 0 1px color-mix(in srgb,var(--accent) 20%,transparent)}._cardWrapper_erb2k_1:focus-within{z-index:5}._hoverOverlay_erb2k_63{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#fff;background:#0c0d1285;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);opacity:0;transition:opacity .25s ease,transform .25s var(--ease-smooth);pointer-events:none;z-index:8;border-radius:var(--radius-md) var(--radius-md) 0 0}._hoverOverlay_erb2k_63 svg{filter:drop-shadow(0 4px 12px rgba(0,0,0,.6));transform:scale(.9);transition:transform .25s cubic-bezier(.175,.885,.32,1.275)}._cardWrapper_erb2k_1:hover ._hoverOverlay_erb2k_63 svg,._cardWrapper_erb2k_1:focus-within ._hoverOverlay_erb2k_63 svg{transform:scale(1.1)}._cardWrapper_erb2k_1:hover ._hoverOverlay_erb2k_63,._cardWrapper_erb2k_1:focus-within ._hoverOverlay_erb2k_63{opacity:1}._cardWrapper_erb2k_1:has(._matureOverlay_erb2k_98) ._hoverOverlay_erb2k_63{display:none}@media(hover:none),(pointer:coarse){._hoverOverlay_erb2k_63{display:none}}._posterContainer_erb2k_108{position:relative;width:100%;aspect-ratio:3 / 4;overflow:hidden;background:var(--bg-tertiary);border-radius:var(--radius-md) var(--radius-md) 0 0}._card_erb2k_1._horizontal_erb2k_117 ._posterContainer_erb2k_108{aspect-ratio:16 / 9}._posterImg_erb2k_121{width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .4s ease,transform var(--transition-base),filter var(--transition-base);border-radius:var(--radius-md) var(--radius-md) 0 0}._posterImg_erb2k_121._blurred_erb2k_133{filter:blur(15px)}._matureOverlay_erb2k_98{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#00000073;z-index:10;cursor:pointer;flex-direction:column;gap:var(--space-2);padding:var(--space-2);text-align:center;transition:background-color var(--transition-base)}._matureOverlay_erb2k_98._flat_erb2k_156{background-color:#000000f2}._posterImg_erb2k_121._loaded_erb2k_160{opacity:1}._cardWrapper_erb2k_1:hover ._posterImg_erb2k_121{transform:scale(1.06);filter:brightness(1.05)}._progressSection_erb2k_169{padding:var(--space-2) var(--space-3);display:flex;flex-direction:column;gap:2px}._titleSection_erb2k_176{padding:var(--space-3) var(--space-3) 0;display:flex;flex-direction:column;gap:var(--space-1)}._title_erb2k_176{font-weight:var(--font-weight-semibold);font-size:var(--font-size-sm);line-height:1.3;color:#e2e8f0;height:2.6em;margin-bottom:0;transition:color var(--transition-base);word-break:break-word;min-width:0}._titleText_erb2k_195{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-height:2.6em}._cardWrapper_erb2k_1:hover ._title_erb2k_176{color:var(--accent-light)}._badge_erb2k_207{position:absolute;padding:var(--space-1) var(--space-2);border-radius:var(--radius-sm);font-size:var(--font-size-xs);font-weight:var(--font-weight-bold);z-index:2;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}._typeBadge_erb2k_218{top:var(--space-2);left:var(--space-2);background-color:#000000b3;color:#fff;border:1px solid rgba(255,255,255,.1)}._epBadge_erb2k_227{bottom:var(--space-2);left:var(--space-2);background-color:var(--accent);color:var(--accent-text);border-radius:var(--radius-full)}._airTime_erb2k_236{margin-left:6px;font-size:12px;opacity:.85;font-weight:500}._adultBadge_erb2k_243{bottom:var(--space-2);right:var(--space-2);background-color:var(--color-danger);color:#fff;border:none;font-size:14px;padding:5px 10px;z-index:5;box-shadow:0 2px 8px #0006}._posterContainer_erb2k_108 ._adultBadge_erb2k_243._gated_erb2k_256{background-color:#000000bf;border:1px solid rgba(220,53,69,.45);color:#ff4a5a}._notAiredBadge_erb2k_262{top:var(--space-2);right:var(--space-2);background-color:var(--badge-info-bg);color:var(--badge-info-text);border:none;font-size:11px;font-weight:800;letter-spacing:.06em;padding:4px 8px;z-index:5;box-shadow:0 2px 8px #0006}._metaRow_erb2k_277{display:flex;align-items:center;gap:var(--space-2);font-size:var(--font-size-xs);color:#94a3b8;margin-top:auto;min-width:0;height:24px}._metaItem_erb2k_288{display:flex;align-items:center;gap:var(--space-1);background-color:var(--bg-tertiary);padding:2px var(--space-2);border-radius:var(--radius-sm);transition:background-color var(--transition-base),color var(--transition-base)}._metaItem_erb2k_288:hover{background-color:var(--bg-elevated);color:var(--text-primary)}._progressContainer_erb2k_305{width:100%;height:4px;background-color:var(--bg-tertiary);border-radius:var(--radius-sm);overflow:hidden}._progressBar_erb2k_313{height:100%;background:linear-gradient(90deg,var(--accent) 0%,var(--accent-light) 100%);border-radius:var(--radius-sm);box-shadow:0 0 8px var(--accent-glow);transition:width .3s ease}._timestamp_erb2k_321{font-size:var(--font-size-xs);color:var(--text-muted)}._removeBtn_erb2k_326,._infoBtn_erb2k_327{position:absolute;top:var(--space-2);right:var(--space-2);width:28px;height:28px;border-radius:50%;background-color:#0009;color:#fff;border:1px solid rgba(255,255,255,.2);display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;transition:opacity .15s ease,background-color .15s ease,transform .15s ease;z-index:20;font-size:14px}._cardWrapper_erb2k_1:hover ._removeBtn_erb2k_326,._card_erb2k_1:hover ._removeBtn_erb2k_326,._cardWrapper_erb2k_1:hover ._infoBtn_erb2k_327,._card_erb2k_1:hover ._infoBtn_erb2k_327{opacity:1}@media(hover:none),(pointer:coarse){._removeBtn_erb2k_326,._infoBtn_erb2k_327{display:none}}._cardWrapper_erb2k_1 ._removeBtn_erb2k_326:hover{background-color:color-mix(in srgb,var(--color-danger) 90%,transparent);border-color:color-mix(in srgb,var(--color-danger) 90%,transparent);color:var(--color-danger-text);transform:scale(1.08)}._infoBtn_erb2k_327:hover{background-color:var(--accent);border-color:var(--accent);color:var(--accent-text);transform:scale(1.08)}._mobileBadges_erb2k_378{display:flex;flex-wrap:wrap;gap:var(--space-1);margin-bottom:var(--space-1)}._mobileBadgeBase_erb2k_385{font-size:10px;font-weight:var(--font-weight-bold);padding:1px var(--space-1);border-radius:4px;text-transform:uppercase}._mobileType_erb2k_393{background-color:#ffffff1a;color:var(--text-secondary);border:1px solid rgba(255,255,255,.1)}._mobileEp_erb2k_400{background-color:var(--accent);color:var(--accent-text)}@media(max-width:768px){._cardWrapper_erb2k_1,._card_erb2k_1{height:auto}._progressSection_erb2k_169{padding:4px 8px}._titleSection_erb2k_176{padding:8px 8px 0}._cardWrapper_erb2k_1 ._title_erb2k_176{height:2.5em;max-height:2.5em;overflow:hidden;font-size:.82rem;line-height:1.25;color:#e2e8f0}._titleText_erb2k_195{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-height:2.5em;word-break:break-word;color:#e2e8f0}._removeBtn_erb2k_326,._infoBtn_erb2k_327{min-width:36px;min-height:36px;width:36px;height:36px;font-size:14px}._mobileBadges_erb2k_378{justify-content:center;margin-bottom:4px;gap:4px}._metaRow_erb2k_277{margin-top:auto;justify-content:center;height:20px}._typeBadge_erb2k_218{display:none}._cardWrapper_erb2k_1 ._removeBtn_erb2k_326{opacity:1;background-color:#00000080}}._cardWrapper_erb2k_1._lowEnd_erb2k_470 ._card_erb2k_1,._cardWrapper_erb2k_1._lowEnd_erb2k_470 ._posterImg_erb2k_121{transition:none}
@@ -1 +0,0 @@
1
- import{d as $,A as z,h as F,T as Ee,u as e,g as x,S as H,$ as Re,L as Y,q as C,N as Ie,a as ze}from"./vendor-core-DfaOB3Rn.js";import{I as k}from"./vendor-icons-C1Pj_eSX.js";import{a8 as $e,t as Se,d as Le,u as De,e as xe,f as Oe}from"./index-B9fL2VIP.js";import{a as Ae,b as je,f as Fe,s as Ue}from"./vendor-ui-3qrARCPr.js";import{u as re}from"./useIsMobile-Dvx1uJ82.js";import{M as We}from"./MatureConsentModal-D34i8744.js";const Ve="_pagination_zelsc_1",Ge="_pageBtn_zelsc_7",Xe="_pageInfo_zelsc_38",Ye="_pagePicker_zelsc_48",He="_dropdown_zelsc_52",Ke="_flipDown_zelsc_68",qe="_jumpRow_zelsc_73",Je="_jumpInput_zelsc_79",Qe="_jumpGo_zelsc_90",Ze="_optionList_zelsc_105",et="_optionBtn_zelsc_113",tt="_current_zelsc_132",w={pagination:Ve,pageBtn:Ge,pageInfo:Xe,pagePicker:Ye,dropdown:He,flipDown:Ke,jumpRow:qe,jumpInput:Je,jumpGo:Qe,optionList:Ze,optionBtn:et,current:tt},vn=({page:t,totalPages:p,canGoNext:l,onChange:i,isLoading:h=!1,variant:f="compact"})=>{const[s,b]=$(!1),[B,_]=$(""),[y,v]=$(0),[N,E]=$(!1),M=z(null),d=z(null),g=z(null);F(()=>{if(!s)return;const r=m=>{M.current&&!M.current.contains(m.target)&&b(!1)},n=m=>{m.key==="Escape"&&b(!1)};return document.addEventListener("pointerdown",r),document.addEventListener("keydown",n),()=>{document.removeEventListener("pointerdown",r),document.removeEventListener("keydown",n)}},[s]),F(()=>{if(!s)return;v(0),E(!1);const r=requestAnimationFrame(()=>{const n=g.current?.getBoundingClientRect(),m=d.current?.getBoundingClientRect();if(!n)return;let P=0;n.right>window.innerWidth-8?P=window.innerWidth-8-n.right:n.left<8&&(P=8-n.left),v(Math.round(P)),m&&m.top<n.height+24&&E(!0)});return()=>cancelAnimationFrame(r)},[s]);const a=p,S=Ee(()=>{if(a!==void 0){if(a<=100)return Array.from({length:a},(m,P)=>P+1);const n=new Set([1,a]);for(let m=t-10;m<=t+10;m++)m>=1&&m<=a&&n.add(m);return[...n].sort((m,P)=>m-P)}const r=l?t+1:t;return Array.from({length:r},(n,m)=>m+1)},[a,t,l]),T=r=>{const n=a!==void 0?Math.min(Math.max(1,r),a):Math.max(1,r);b(!1),_(""),n!==t&&i(n)},L=()=>{const r=parseInt(B,10);Number.isNaN(r)||T(r)},D=h||(a!==void 0?t>=a:!l);return e("div",{className:w.pagination,ref:M,children:[e("button",{className:w.pageBtn,onClick:()=>i(t-1),disabled:t<=1||h,"aria-label":"Previous page",children:[e(k,{name:"chevron-left",size:14}),f==="labeled"&&e("span",{children:"Previous"})]}),e("div",{className:w.pagePicker,ref:d,children:[e("button",{className:w.pageBtn,onClick:()=>{_(""),b(r=>!r)},disabled:h,"aria-label":"Jump to page","aria-expanded":s,children:e("span",{className:w.pageInfo,children:["Page ",e("strong",{children:t}),a!==void 0&&` of ${a}`]})}),s&&e("div",{ref:g,className:`${w.dropdown} ${N?w.flipDown:""}`,style:y!==0?{marginLeft:y}:void 0,children:[e("div",{className:w.jumpRow,children:[e("input",{className:w.jumpInput,type:"number",inputMode:"numeric",min:1,max:a,value:B,placeholder:"Page #",onChange:r=>_(r.currentTarget.value),onKeyDown:r=>{r.key==="Enter"&&L()}}),e("button",{className:w.jumpGo,onClick:L,children:"Go"})]}),e("div",{className:w.optionList,children:S.map(r=>e("button",{className:`${w.optionBtn} ${r===t?w.current:""}`,onClick:()=>T(r),disabled:r===t,children:r},r))})]})]}),e("button",{className:w.pageBtn,onClick:()=>i(t+1),disabled:D,"aria-label":"Next page",children:[f==="labeled"&&e("span",{children:"Next"}),e(k,{name:"chevron-right",size:14})]})]})},nt="_popupPortal_1d6yy_1",ot="_popupContent_1d6yy_6",st="_popupBackdrop_1d6yy_31",rt="_mobile_1d6yy_38",at="_header_1d6yy_62",ct="_title_1d6yy_67",lt="_altTitle_1d6yy_78",it="_cover_1d6yy_87",dt="_body_1d6yy_97",ut="_metaRow_1d6yy_104",pt="_metaItem_1d6yy_111",_t="_scoreIcon_1d6yy_117",mt="_synopsis_1d6yy_121",ft="_genres_1d6yy_143",ht="_genre_1d6yy_143",gt="_footer_1d6yy_158",bt="_primaryAction_1d6yy_167",yt="_watchBtn_1d6yy_171",vt="_secondaryActions_1d6yy_194",Bt="_watchlistBtn_1d6yy_199",wt="_detailsBtn_1d6yy_200",kt="_active_1d6yy_226",Nt="_loading_1d6yy_237",Ct="_spinner_1d6yy_247",c={popupPortal:nt,popupContent:ot,popupBackdrop:st,mobile:rt,header:at,title:ct,altTitle:lt,cover:it,body:dt,metaRow:ut,metaItem:pt,scoreIcon:_t,synopsis:mt,genres:ft,genre:ht,footer:gt,primaryAction:bt,watchBtn:yt,secondaryActions:vt,watchlistBtn:Bt,detailsBtn:wt,active:kt,loading:Nt,spinner:Ct},Pt=({anchorRect:t,onMouseEnter:p,onMouseLeave:l,onRequestClose:i,children:h})=>{const f=re(),s=x.useMemo(()=>({getBoundingClientRect:()=>t}),[t]),{refs:b,floatingStyles:B}=Ae({placement:"right-start",middleware:[Fe({fallbackAxisSideDirection:"start"}),Ue({padding:20})],whileElementsMounted:je});x.useEffect(()=>{b.setPositionReference(s)},[b,s]),x.useEffect(()=>{if(!f)return;const y=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=y}},[f]);const _=e(H,{children:[f&&e("div",{className:c.popupBackdrop,onClick:()=>i?.()}),e("div",{ref:f?void 0:b.setFloating,className:`${c.popupPortal} ${f?c.mobile:""}`,style:f?void 0:B,onMouseEnter:p,onMouseLeave:l,children:e("div",{className:c.popupContent,children:h})})]});return Re(_,document.body)},Bn=({anchorRect:t,title:p,subtitle:l,cover:i,loading:h,error:f,meta:s=[],genres:b=[],synopsis:B,primaryAction:_,secondaryAction:y,bookmarked:v,bookmarkLabel:N="Watchlist",onToggleBookmark:E,extraActions:M,onMouseEnter:d,onMouseLeave:g,onRequestClose:a})=>{const S=z(!1),T=()=>{S.current=!0,d()},L=()=>{S.current=!1,g()},D=n=>{!n&&!S.current&&g()},r=!!_||!!y||!!M;return e(Pt,{anchorRect:t,onMouseEnter:T,onMouseLeave:L,onRequestClose:a,children:h?e("div",{className:c.loading,children:[e("div",{className:c.spinner}),e("span",{children:"Fetching details..."})]}):f?e("div",{className:c.loading,children:f}):e(H,{children:[p&&e("div",{className:c.header,children:[i&&e($e,{src:i,alt:p,loading:"lazy",decoding:"async",className:c.cover}),e("div",{className:c.title,children:p}),l&&e("div",{className:c.altTitle,children:l})]}),e("div",{className:c.body,children:[s.length>0&&e("div",{className:c.metaRow,children:s.map((n,m)=>e("div",{className:c.metaItem,children:[n.icon&&e(k,{name:n.icon,className:n.accent?c.scoreIcon:void 0,size:14}),e("span",{children:n.label})]},`${n.label}-${m}`))}),b.length>0&&e("div",{className:c.genres,children:b.map(n=>e("span",{className:c.genre,children:n},n))}),B&&e("div",{className:c.synopsis,children:B})]}),r&&e("div",{className:c.footer,children:[_&&e("div",{className:c.primaryAction,children:_.disabled?e("span",{className:c.watchBtn,"aria-disabled":"true",style:{opacity:.5,pointerEvents:"none"},children:[e(k,{name:_.icon??"play",size:14}),_.label]}):e(Y,{to:_.to,className:c.watchBtn,onClick:a,children:[e(k,{name:_.icon??"play",size:14}),_.label]})}),e("div",{className:c.secondaryActions,children:[e("button",{className:`${c.watchlistBtn} ${v?c.active:""}`,onClick:n=>{n.preventDefault(),n.stopPropagation(),E()},children:[v?e(k,{name:"check",size:12}):e(k,{name:"plus",size:12}),e("span",{children:v?"Remove":N})]}),M?.(D),y&&e(Y,{to:y.to,className:c.detailsBtn,onClick:a,children:[y.icon&&e(k,{name:y.icon,size:12}),e("span",{children:y.label})]})]})]})]})})},Mt=t=>!t||t.trim()===""?!0:t.includes("placeholder");function Tt(t,p){const[l,i]=$(p);return F(()=>{i(p)},[p]),F(()=>{if(!Mt(p)||!t)return;let h=!1;return Se.data.showMeta.query({id:t}).then(f=>{const s=f?.thumbnail;!h&&s&&s.trim()!==""&&!s.includes("placeholder")&&i(s)}).catch(()=>{}),()=>{h=!0}},[t,p]),{thumbnail:l}}const Et="_cardWrapper_erb2k_1",Rt="_card_erb2k_1",It="_cardButton_erb2k_36",zt="_hoverOverlay_erb2k_63",$t="_matureOverlay_erb2k_98",St="_posterContainer_erb2k_108",Lt="_horizontal_erb2k_117",Dt="_posterImg_erb2k_121",xt="_blurred_erb2k_133",Ot="_flat_erb2k_156",At="_loaded_erb2k_160",jt="_progressSection_erb2k_169",Ft="_titleSection_erb2k_176",Ut="_title_erb2k_176",Wt="_titleText_erb2k_195",Vt="_badge_erb2k_207",Gt="_typeBadge_erb2k_218 _badge_erb2k_207",Xt="_epBadge_erb2k_227 _badge_erb2k_207",Yt="_airTime_erb2k_236",Ht="_adultBadge_erb2k_243 _badge_erb2k_207",Kt="_gated_erb2k_256",qt="_notAiredBadge_erb2k_262 _badge_erb2k_207",Jt="_metaRow_erb2k_277",Qt="_metaItem_erb2k_288",Zt="_progressContainer_erb2k_305",en="_progressBar_erb2k_313",tn="_timestamp_erb2k_321",nn="_removeBtn_erb2k_326",on="_infoBtn_erb2k_327",sn="_mobileBadges_erb2k_378",rn="_mobileBadgeBase_erb2k_385",an="_mobileType_erb2k_393 _mobileBadgeBase_erb2k_385",cn="_mobileEp_erb2k_400 _mobileBadgeBase_erb2k_385",ln="_lowEnd_erb2k_470",o={cardWrapper:Et,card:Rt,cardButton:It,hoverOverlay:zt,matureOverlay:$t,posterContainer:St,horizontal:Lt,posterImg:Dt,blurred:xt,flat:Ot,loaded:At,progressSection:jt,titleSection:Ft,title:Ut,titleText:Wt,badge:Vt,typeBadge:Gt,epBadge:Xt,airTime:Yt,adultBadge:Ht,gated:Kt,notAiredBadge:qt,metaRow:Jt,metaItem:Qt,progressContainer:Zt,progressBar:en,timestamp:tn,removeBtn:nn,infoBtn:on,mobileBadges:sn,mobileBadgeBase:rn,mobileType:an,mobileEp:cn,lowEnd:ln},dn=500,se=20,un=300;function pn(t){const p=z(null),l=z(null),i=z(!1),h=z({x:0,y:0}),f=z(null),s=C(()=>{l.current&&(clearTimeout(l.current),l.current=null)},[]),b=C(()=>{p.current&&(clearTimeout(p.current),p.current=null)},[]),B=C(d=>{p.current&&clearTimeout(p.current),p.current=setTimeout(d,un)},[]),_=C((d,g=!1)=>{i.current=g,t(d,g)},[t]),y=C((d,g)=>{if(g||d.pointerType==="mouse")return;f.current=d.pointerType,i.current=!1,h.current={x:d.clientX,y:d.clientY};const a=d.currentTarget.getBoundingClientRect();s(),l.current=setTimeout(()=>{l.current=null,_(a,!0)},dn)},[s,_]),v=C(d=>{if(!l.current)return;const g=Math.abs(d.clientX-h.current.x),a=Math.abs(d.clientY-h.current.y);(g>se||a>se)&&s()},[s]),N=C(()=>{s(),f.current=null},[s]),E=C((d,g)=>{d.preventDefault(),d.stopPropagation(),f.current==="touch"?l.current&&(clearTimeout(l.current),l.current=null,_(d.currentTarget.getBoundingClientRect(),!0)):!g&&!i.current&&_(d.currentTarget.getBoundingClientRect())},[_]),M=C(()=>i.current?(i.current=!1,!0):!1,[]);return{longPressFiredRef:i,cancelLongPress:s,clearPopupTimeout:b,schedulePopupClose:B,openViaHold:_,handlePointerDown:y,handlePointerMove:v,handlePointerUpOrCancel:N,handleContextMenu:E,consumeLongPressClick:M}}const X={elements:{poster:{typeBadge:!0,chapterBadge:!0,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!0,meta:!0}}},wn=Ie(({item:t,linkTo:p,hoverIcon:l,progress:i,showProgress:h=!1,metaRow:f,display:s,layout:b="vertical",onRemove:B,showRemoveButton:_,showInfoButton:y=!1,onOpenDetails:v,renderPopup:N,onPopupHoverIntent:E,rawThumbnail:M,enrichedId:d})=>{const g=ze(),a=re(),{titlePreference:S}=Le(),{lowEndMode:T}=De(),[L,D]=$(!1),[r,n]=$(!1),{thumbnail:m}=Tt(d,t.thumbnail),[P,K]=$(!1),[q,J]=$(null),Q=u=>{J(u),K(!0)},U=C(()=>{K(!1),J(null)},[]),R=pn(u=>{if(v){v(u);return}N&&Q(u)}),W=C(()=>{R.schedulePopupClose(U)},[R,U]),Z=R.clearPopupTimeout,ae=u=>{if(a)return;const oe=u.currentTarget.getBoundingClientRect();if(v){v(oe);return}N&&Q(oe)},ce=()=>{N&&W()},le=()=>{Z()},ie=()=>{N&&W()},de=u=>{R.handlePointerDown(u,I)},ue=u=>{R.handlePointerMove(u)},ee=()=>{R.handlePointerUpOrCancel()},pe=u=>{if(v){u.preventDefault(),u.stopPropagation(),v(u.currentTarget.getBoundingClientRect());return}if(N){R.handleContextMenu(u,I);return}R.handleContextMenu(u,I)},te={...s,elements:{...X.elements,...s?.elements||{},poster:{...X.elements?.poster,...s?.elements?.poster||{}},info:{...X.elements?.info,...s?.elements?.info||{}}}},V=t[S]||t.title,O=te.elements?.poster,A=te.elements?.info,_e=(O?.typeBadge??!0)&&!!t.typeBadge,me=(O?.chapterBadge??!0)&&!!t.chapterBadge,fe=_??O?.removeButton??!!B,he=O?.adultBadge??!0,ge=A?.mobileBadges??!0,be=A?.progress??!0,ye=A?.meta??!0,ve=h&&!!i&&i.percent>0,ne=!!t.isAdult,{hasConsent:Be,grant:we}=xe(),[ke,G]=x.useState(!1),j=x.useRef(null),Ne=()=>{we(),G(!1),j.current&&(g(j.current),j.current=null)},I=ne&&!Be,Ce=u=>{if(R.consumeLongPressClick()){u.preventDefault(),u.stopPropagation();return}I&&(u.preventDefault(),u.stopPropagation(),j.current=p,G(!0))},Pe=l==="book"?e(k,{name:"book",size:28}):l==="play"?e(k,{name:"play",size:28}):l==="info"?e(k,{name:"info-circle",size:28}):e(k,{name:"info-circle",size:28}),Me=C(u=>{u.preventDefault(),u.stopPropagation(),B&&B(t.id)},[B,t.id]),Te=M?m??t.thumbnail:Oe(m,T?100:150,T?150:200);return e("div",{className:`${o.cardWrapper} ${T?o.lowEnd:""}`,onMouseEnter:()=>{n(!0),E?.(!0),P&&Z()},onMouseLeave:()=>{n(!1),E?.(!1),P&&W()},children:[e(Y,{to:p,className:`${o.card} ${o[b]} ${I?o.cardButton:""}`,onClick:Ce,onContextMenu:pe,onPointerDown:de,onPointerMove:ue,onPointerUp:ee,onPointerCancel:ee,children:[e("div",{className:o.posterContainer,children:[I&&e("div",{className:`${o.matureOverlay} ${T?o.flat:""}`}),e("img",{src:Te,alt:V,className:`${o.posterImg} ${L?o.loaded:""} ${I&&!T?o.blurred:""}`,loading:"lazy",decoding:"async",onLoad:()=>D(!0)}),!a&&e(H,{children:[_e&&e("div",{className:o.typeBadge,children:t.typeBadge}),me&&e("div",{className:o.epBadge,children:[t.chapterBadge,t.airMeta&&e("span",{className:o.airTime,children:t.airMeta})]})]}),he&&ne&&e("div",{className:`${o.adultBadge} ${I?o.gated:""}`,children:"18+"}),t.notAired&&e("div",{className:o.notAiredBadge,children:"NOT AIRED"}),!a&&r&&e("div",{className:o.hoverOverlay,children:Pe})]}),be&&h&&ve&&i&&e("div",{className:o.progressSection,children:[e("div",{className:o.progressContainer,children:e("div",{className:o.progressBar,style:{width:`${i.percent}%`}})}),e("div",{className:o.timestamp,children:i.label})]}),e("div",{className:o.titleSection,children:[a&&ge&&e("div",{className:o.mobileBadges,children:[!!t.typeBadge&&e("span",{className:o.mobileType,children:t.typeBadge}),t.chapterBadge&&e("span",{className:o.mobileEp,children:t.chapterBadge})]}),A?.title!==!1&&e("div",{className:o.title,title:V,children:e("span",{className:o.titleText,children:V})}),ye&&f&&e("div",{className:o.metaRow,children:f})]})]}),ke&&e(We,{isOpen:!0,showResetHint:!0,onClose:()=>G(!1),onGrant:Ne}),fe&&e("button",{className:o.removeBtn,onClick:Me,"aria-label":"Remove",children:e(k,{name:"times",size:10})}),y&&!a&&!I&&e("button",{className:o.infoBtn,onMouseEnter:ae,onMouseLeave:ce,"aria-label":"Info",children:e(k,{name:"info",size:11})}),N&&P&&q?N(q,{close:U,onMouseEnter:le,onMouseLeave:ie}):null]})});export{wn as M,vn as P,Bn as a,o as m,c as p};
@@ -1 +0,0 @@
1
- import{g as s,u as n,a as X}from"./vendor-core-DfaOB3Rn.js";import{I as D}from"./vendor-icons-C1Pj_eSX.js";import{d as Y,f as L}from"./index-B9fL2VIP.js";const z="_section_5peha_1",F="_header_5peha_10",O="_headerToggle_5peha_20",j="_headerActions_5peha_34",J="_title_5peha_40",K="_badge_5peha_50",V="_clearBtn_5peha_65",W="_nextBtn_5peha_83",Z="_list_5peha_101",ee="_item_5peha_115",ne="_active_5peha_135",te="_dragging_5peha_143",re="_dragHandle_5peha_150",ae="_thumbnail_5peha_168",oe="_meta_5peha_176",ce="_name_5peha_183",se="_episode_5peha_205",ie="_iconBtn_5peha_211",le="_metaGap_5peha_257",r={section:z,header:F,headerToggle:O,headerActions:j,title:J,badge:K,clearBtn:V,nextBtn:W,list:Z,item:ee,active:ne,dragging:te,dragHandle:re,thumbnail:ae,meta:oe,name:ce,episode:se,iconBtn:ie,metaGap:le},ue=({item:a,isActive:w,index:g,onRemove:v,onTouchPointerDown:x,onTouchPointerMove:B,onTouchPointerUp:I,onTouchPointerCancel:y,shouldIgnoreClick:_,onDragStart:R,onDragEnter:f,onDragEnd:c,isDragging:b})=>{const o=X(),{titlePreference:i}=Y(),l=a[i]||a.name||"Unknown show";return n("div",{"data-queue-index":g,className:`${r.item} ${w?r.active:""} ${b?r.dragging:""}`,draggable:!0,onDragStart:R,onDragEnter:f,onDragOver:u=>u.preventDefault(),onDragEnd:c,onPointerDown:u=>x(g,u),onPointerMove:B,onPointerUp:I,onPointerCancel:y,children:[n("button",{className:r.dragHandle,type:"button","aria-label":"Drag queue item",children:n(D,{name:"bars"})}),n("img",{className:r.thumbnail,src:L(a.thumbnail||"",72,96),alt:l,loading:"lazy",decoding:"async",onError:u=>{u.currentTarget.src="/placeholder.svg"}}),n("div",{className:r.meta,children:[n("button",{className:r.name,type:"button",onClick:()=>{_()||o(`/watch/${a.showId}/${a.episodeNumber}`)},children:l}),n("div",{className:r.episode,children:["Episode ",a.episodeNumber]})]}),n("button",{className:r.iconBtn,type:"button",onClick:()=>{_()||v(a)},"aria-label":`Remove ${l} episode ${a.episodeNumber} from queue`,children:n(D,{name:"times"})})]})},me=({title:a="Queue",eyebrow:w,items:g,currentShowId:v,currentEpisode:x,onRemove:B,onReorder:I,onNextQueue:y,onClear:_,showClearAll:R=!1,defaultExpanded:f=!0})=>{const[c,b]=s.useState([]),[o,i]=s.useState(null),[l,u]=s.useState(f),N=s.useRef(null),T=s.useRef(null),d=s.useRef(null),h=s.useRef(!1),C=s.useRef(!1);s.useEffect(()=>{b(g)},[g]),s.useEffect(()=>{u(f)},[f]);const $=e=>{i(e)},k=e=>{if(o===null||o===e)return;const t=[...c],p=t[o];t.splice(o,1),t.splice(e,0,p),i(e),b(t)},A=()=>{o!==null&&I(c.map(e=>({id:e.id,showId:e.showId,episodeNumber:e.episodeNumber}))),i(null)},E=(e=!1)=>{d.current!==null&&(window.clearTimeout(d.current),d.current=null),e&&h.current&&(I(c.map(t=>({id:t.id,showId:t.showId,episodeNumber:t.episodeNumber}))),C.current=!0,window.setTimeout(()=>{C.current=!1},0)),N.current=null,T.current=null,h.current=!1,i(null)},Q=(e,t)=>{if(t.pointerType==="mouse")return;const p=t.currentTarget,m=t.pointerId;N.current=t.pointerId,T.current={x:t.clientX,y:t.clientY},d.current!==null&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>{h.current=!0,i(e);try{p.setPointerCapture(m)}catch{}},220)},S=e=>{if(e.pointerType==="mouse"||N.current!==e.pointerId)return;if(!h.current&&T.current){const H=Math.abs(e.clientX-T.current.x),G=Math.abs(e.clientY-T.current.y);(H>8||G>8)&&E(!1);return}if(!h.current)return;e.preventDefault();const p=document.elementFromPoint(e.clientX,e.clientY)?.closest?.("[data-queue-index]"),m=p?Number(p.dataset.queueIndex):NaN;if(Number.isNaN(m)||o===null||m===o)return;const P=[...c],U=P[o];P.splice(o,1),P.splice(m,0,U),i(m),b(P)},q=e=>{e.pointerType!=="mouse"&&N.current===e.pointerId&&E(h.current)},M=e=>{e.pointerType!=="mouse"&&N.current===e.pointerId&&E(!1)};return c.length===0?null:n("section",{className:r.section,children:[n("div",{className:r.header,children:[n("button",{className:r.headerToggle,type:"button",onClick:()=>u(e=>!e),"aria-expanded":l,"aria-label":l?`Collapse ${a}`:`Expand ${a}`,children:[n("span",{className:r.title,children:[n("span",{className:"title-stack",children:[w&&n("div",{className:"section-eyebrow",children:w}),n("span",{children:a})]}),n("span",{className:r.badge,children:c.length})]}),l?n(D,{name:"chevron-up"}):n(D,{name:"chevron-down"})]}),R&&_&&n("div",{className:r.headerActions,children:[y&&c.length>1&&n("button",{className:r.nextBtn,type:"button",onClick:y,children:"Next"}),n("button",{className:r.clearBtn,type:"button",onClick:_,children:"Clear All"})]})]}),l&&n("div",{className:r.list,children:c.map((e,t)=>n(ue,{item:e,isActive:e.showId===v&&e.episodeNumber===x,index:t,onRemove:B,onTouchPointerDown:Q,onTouchPointerMove:S,onTouchPointerUp:q,onTouchPointerCancel:M,shouldIgnoreClick:()=>C.current,onDragStart:()=>$(t),onDragEnter:()=>k(t),onDragEnd:A,isDragging:o===t},e.id))})]})};export{me as Q,r as s};
@@ -1,21 +0,0 @@
1
- import{d as r,u as e,S as le,A as Z,h as z,q as pe,T as Ke,p as Ue,g as Ce,_ as Ee}from"./vendor-core-DfaOB3Rn.js";import{b as fe,u as te}from"./vendor-query-BBT5_sHx.js";import{R as ee,S as V,U as K,V as ke,B as C,W as Fe,Q as E,d as $e,L as Pe,t as k,v as Ie,o as We,J as Se,X,q as H,Y as Ne,Z as He,_ as Be,u as je,e as Qe,$ as Ve,K as de,p as Ye,a0 as Je,a1 as Xe}from"./index-B9fL2VIP.js";import{I as j}from"./vendor-icons-C1Pj_eSX.js";import{T as F}from"./ToggleSwitch-CN_ppEc9.js";import{l as Ze,s as et}from"./playbackCompletion-CKlwK8SG.js";import{M as tt}from"./MatureConsentModal-D34i8744.js";const at="_sectionCard_1vuib_1",nt="_dangerCard_1vuib_20",rt="_settingRow_1vuib_31",T={sectionCard:at,dangerCard:nt,settingRow:rt};function st(){const{data:t}=fe(ee),{data:s}=fe({queryKey:["profiles"],queryFn:()=>V("/api/profiles/status"),enabled:!!t?.owner}),c=te(),[g,f]=r(null),[d,S]=r(""),[m,i]=r(""),[a,p]=r(""),[v,u]=r(""),[I,l]=r(""),[y,_]=r(!1),[P,M]=r(null),[L,w]=r(null),[x,O]=r(""),G=async o=>{_(!0),l("");try{await V("/api/profiles/update",{method:"POST",body:JSON.stringify(o)}),await c.invalidateQueries({queryKey:ee.queryKey}),S(""),i(""),l("Profile saved")}catch(R){l(R.message)}finally{_(!1)}};return t?e("section",{className:T.sectionCard,children:[e("h3",{children:"Your profile"}),e("p",{children:"Keep using this profile, rename it, or add another person with their own library and connections."}),e("div",{className:K.avatarRow,children:[e(ke,{image:t.image,name:t.name}),e("label",{className:K.uploadButton,children:[e(j,{name:"upload"}),e("span",{children:"Upload image"}),e("input",{className:K.fileInput,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",disabled:y,onChange:async o=>{const R=o.currentTarget.files?.[0];if(o.currentTarget.value="",!R)return;if(R.size>2*1024*1024){l("Image must be smaller than 2 MB");return}const A=new FileReader;A.onerror=()=>l("Could not read image"),A.onload=()=>{G({avatar:A.result})},A.readAsDataURL(R)}})]}),t.avatar&&e(C,{variant:"secondary",disabled:y,onClick:()=>G({avatar:null}),children:"Clear uploaded image"})]}),e("p",{children:"Your uploaded image takes priority, followed by your active cloud account image, then the default user icon."}),e("form",{className:K.form,onSubmit:o=>{o.preventDefault(),G({name:g??t.name})},children:[e("label",{className:K.field,children:["Profile name",e("input",{value:g??t.name,maxLength:60,required:!0,onChange:o=>f(o.currentTarget.value)})]}),e(C,{type:"submit",disabled:y,children:"Save name"})]}),e("form",{className:K.form,onSubmit:o=>{o.preventDefault(),G({password:d,currentPassword:m})},children:[t.protected&&e("label",{className:K.field,children:["Current password",e("input",{type:"password",autoComplete:"current-password",value:m,required:!0,maxLength:256,onChange:o=>i(o.currentTarget.value)})]}),e("label",{className:K.field,children:[t.protected?"New password (empty removes protection)":"Protect this profile",e("input",{type:"password",autoComplete:"new-password",value:d,minLength:8,maxLength:256,onChange:o=>S(o.currentTarget.value)})]}),e(C,{type:"submit",disabled:y,children:"Save password"})]}),e(C,{variant:"secondary",disabled:y,onClick:async()=>{_(!0);try{await V("/api/profiles/logout",{method:"POST"}),Fe()}catch(o){l(o.message),_(!1)}},children:"Switch profile / sign out"}),t.owner&&e("form",{className:K.form,onSubmit:async o=>{o.preventDefault(),_(!0),l("");try{await V("/api/profiles/create",{method:"POST",body:JSON.stringify({name:a,password:v})}),p(""),u(""),await c.invalidateQueries({queryKey:["profiles"]}),l("Profile created. Sign out to switch to it.")}catch(R){l(R.message)}finally{_(!1)}},children:[e("h3",{children:"Add another profile"}),e("p",{children:"Protect your owner profile first. New profiles start empty and do not inherit your accounts. A profile without a password is accessible to anyone who passes the LAN lock."}),e("label",{className:K.field,children:["Name",e("input",{required:!0,maxLength:60,value:a,onChange:o=>p(o.currentTarget.value)})]}),e("label",{className:K.field,children:["Password (optional)",e("input",{type:"password",autoComplete:"new-password",minLength:8,maxLength:256,value:v,onChange:o=>u(o.currentTarget.value)})]}),e(C,{type:"submit",disabled:y||!t.protected,children:"Create profile"})]}),t.owner&&s?.profiles.some(o=>!o.owner)&&e(le,{children:[e("h3",{children:"Other profiles"}),e("ul",{className:K.profileList,children:s.profiles.filter(o=>!o.owner).map(o=>e("li",{children:[e("span",{className:K.smallAvatar,children:e(ke,{image:o.avatar??o.cloudAvatar,name:o.name})}),e("span",{className:K.profileName,children:o.name}),e(C,{variant:"secondary",size:"sm",disabled:y,onClick:()=>{l(""),O(""),w(o)},children:"Reset password"}),e(C,{variant:"danger",size:"sm",disabled:y,onClick:()=>{l(""),M(o)},children:"Delete"})]},o.id))})]}),e(E,{isOpen:!!L,onClose:y?void 0:()=>w(null),title:"Reset password",width:"sm",footer:e(le,{children:[e(C,{variant:"secondary",disabled:y,onClick:()=>w(null),children:"Cancel"}),e(C,{loading:y,onClick:async()=>{if(L){_(!0),l("");try{await V("/api/profiles/reset-password",{method:"POST",body:JSON.stringify({id:L.id,password:x})}),await c.invalidateQueries({queryKey:["profiles"]}),w(null),O(""),l("Password updated. The profile has been signed out.")}catch(o){l(o.message)}finally{_(!1)}}},children:"Save password"})]}),children:[e("p",{children:["Set a new password for ",e("strong",{children:L?.name}),". They will be signed out and must use the new password next time."]}),e("label",{className:K.field,children:["New password",e("input",{type:"password",autoComplete:"new-password",minLength:8,maxLength:256,placeholder:"Leave empty to remove their password",value:x,onChange:o=>O(o.currentTarget.value)})]})]}),e(E,{isOpen:!!P,onClose:y?void 0:()=>M(null),title:"Delete profile?",width:"sm",footer:e(le,{children:[e(C,{variant:"secondary",disabled:y,onClick:()=>M(null),children:"Cancel"}),e(C,{variant:"danger",loading:y,onClick:async()=>{if(P){_(!0);try{await V("/api/profiles/delete",{method:"POST",body:JSON.stringify({id:P.id,confirm:!0})}),await c.invalidateQueries({queryKey:["profiles"]}),M(null),l("Profile deleted. Local files will be removed when Dango restarts.")}catch(o){l(o.message),M(null)}finally{_(!1)}}},children:"Delete profile"})]}),children:[e("p",{children:["Delete ",e("strong",{children:P?.name}),"? This signs them out immediately. Their local libraries, settings and connections will be removed when Dango next restarts."]}),e("p",{children:"Cloud backups and tracker lists will stay intact. Export any library you want to keep before deleting."})]}),I&&e("p",{role:"status",children:I})]}):null}const ue={"title-preference-container":"_title-preference-container_sdqgs_1","toggle-button":"_toggle-button_sdqgs_21","toggle-label":"_toggle-label_sdqgs_51"},he=["name","nativeName","englishName"],ge={name:"Default (Romaji)",nativeName:"Native",englishName:"English"},it=()=>{const{titlePreference:t,setTitlePreference:s,loading:c}=$e(),g=Pe(),[f,d]=r(ge[t]),[S,m]=r(!1),i=Z(null);z(()=>{c||d(ge[t])},[t,c]);const a=async()=>{if(S)return;m(!0);const v=(he.indexOf(t)+1)%he.length,u=he[v],I=ge[u];i.current&&(i.current.style.transform="translateX(-100%)",i.current.style.opacity="0"),setTimeout(async()=>{d(I),s(u),i.current&&(i.current.style.transition="none",i.current.style.transform="translateX(100%)",i.current.style.opacity="0",i.current.offsetWidth,i.current.style.transition="transform 0.3s ease-out, opacity 0.3s ease-out",i.current.style.transform="translateX(0)",i.current.style.opacity="1");try{await g.mutateAsync({key:"titlePreference",value:u})}catch(l){console.error("Error saving title preference:",l)}finally{m(!1)}},300)};return c?e("p",{children:"Loading title preference..."}):e("div",{className:ue["title-preference-container"],children:[e("h4",{children:"Anime Title Display Preference"}),e("button",{onClick:a,className:ue["toggle-button"],disabled:S,children:e("span",{ref:i,className:ue["toggle-label"],children:f})})]})},ot="_settingsHeader_gfwoa_1",lt="_pageTitle_gfwoa_6",ct="_pageSubtitle_gfwoa_14",dt="_settingsLayout_gfwoa_20",ut="_sidebar_gfwoa_27",ht="_sidebarIndicator_gfwoa_35",gt="_sidebarItem_gfwoa_50",mt="_active_gfwoa_72",pt="_mainContent_gfwoa_80",ft="_tabContent_gfwoa_85",yt="_settingItem_gfwoa_103",vt="_shortcutContainer_gfwoa_108",wt="_shortcutGroup_gfwoa_115",bt="_shortcutGroupTitle_gfwoa_121",Ct="_shortcutGrid_gfwoa_130",kt="_shortcutCard_gfwoa_136",St="_controls_gfwoa_170",Nt="_status_gfwoa_176",h={settingsHeader:ot,pageTitle:lt,pageSubtitle:ct,settingsLayout:dt,sidebar:ut,sidebarIndicator:ht,sidebarItem:gt,active:mt,mainContent:pt,tabContent:ft,settingItem:yt,shortcutContainer:vt,shortcutGroup:wt,shortcutGroupTitle:bt,shortcutGrid:Ct,shortcutCard:kt,controls:St,status:Nt},_t="_title_tm30b_11",Tt="_signIn_tm30b_18",Pt="_userInfo_tm30b_25",It="_warning_tm30b_47",Lt="_formGroup_tm30b_54",xt="_label_tm30b_58",Rt="_inputWrapper_tm30b_68",Dt="_input_tm30b_68",Ot="_select_tm30b_92",At="_actions_tm30b_109",Gt="_hr_tm30b_117",b={title:_t,signIn:Tt,userInfo:Pt,warning:It,formGroup:Lt,label:xt,inputWrapper:Rt,input:Dt,select:Ot,actions:At,hr:Gt},Mt=()=>{const t=te(),[s,c]=r(!0),[g,f]=r(!1),[d,S]=r(!1),[m,i]=r(null),[a,p]=r({status:"idle"}),[v,u]=r(!1),[I,l]=r(""),[y,_]=r(!1),P=Z(null),[M,L]=r({show:!1,message:"",type:"info"}),w=()=>{P.current&&(window.clearInterval(P.current),P.current=null)},x=pe(N=>{S(N.authenticated),i(N.user||N.device.user||null),p(N.device),u(!!N.hasCustomClientId)},[]),O=pe(async()=>{const N=await k.auth.githubStatus.query();x(N)},[x]),G=async()=>{try{const N=await k.auth.githubPoll.query();p(N),N.status==="success"?(w(),await t.invalidateQueries({queryKey:ee.queryKey}),await O(),L({show:!0,message:"GitHub authentication complete. Sync has been initialized.",type:"success"})):N.status==="error"&&(w(),L({show:!0,message:N.error||"GitHub authentication failed.",type:"error"}))}catch{w(),L({show:!0,message:"Failed to poll GitHub authentication status.",type:"error"})}},o=(N=5)=>{w(),P.current=window.setInterval(G,Math.max(N,5)*1e3)};z(()=>(O().catch(()=>{L({show:!0,message:"Failed to load GitHub sync status.",type:"error"})}).finally(()=>c(!1)),w),[O]);const R=async()=>{f(!0);try{const N=await k.auth.githubStart.mutate();p(N),o(N.verification?.interval)}catch(N){L({show:!0,message:N instanceof Error?N.message:"Failed to start GitHub authentication.",type:"error"})}finally{f(!1)}},A=async()=>{try{await k.auth.githubLogout.mutate(),await t.invalidateQueries({queryKey:ee.queryKey}),S(!1),i(null),p({status:"idle"}),L({show:!0,message:"Signed out of GitHub sync.",type:"success"})}catch{L({show:!0,message:"Failed to sign out of GitHub.",type:"error"})}},$=async()=>{_(!0);try{await k.auth.saveGithubAuth.mutate({clientId:I}),l(""),await O(),L({show:!0,message:"Custom GitHub auth saved.",type:"success"})}catch{L({show:!0,message:"Failed to save override.",type:"error"})}finally{_(!1)}},Q=async()=>{_(!0);try{await k.auth.saveGithubAuth.mutate({clientId:""}),l(""),await O(),L({show:!0,message:"Custom auth cleared. Using dango defaults.",type:"success"})}catch{L({show:!0,message:"Failed to clear override.",type:"error"})}finally{_(!1)}};return s?e("div",{style:{color:"var(--text-secondary)",padding:"1.5rem"},children:"Loading..."}):e("div",{className:T.sectionCard,children:[e("h3",{className:b.title,children:"GitHub Cloud Sync"}),e("p",{className:b.signIn,children:"Sync local data through a private GitHub repository named dango-sync-data."}),d&&m?e("div",{className:b.userInfo,children:[e("p",{children:["Signed in as: ",e("strong",{children:m.name||m.login})]}),e(C,{variant:"danger",onClick:A,children:"Sign Out"})]}):e("div",{className:b.signIn,children:e(C,{onClick:R,disabled:g||a.status==="pending",children:g||a.status==="pending"?"Waiting for GitHub...":"Sign in with GitHub"})}),a.status==="pending"&&a.verification&&e(le,{children:[e("hr",{className:b.hr}),e("div",{className:b.formGroup,children:[e("label",{className:b.label,children:"Verification URL"}),e("div",{className:b.inputWrapper,children:[e("input",{className:b.input,value:a.verification.verification_uri,readOnly:!0}),e(C,{onClick:()=>{const N=a.verification?.verification_uri;N&&/^https?:\/\//i.test(N)&&window.open(N,"_blank","noopener,noreferrer")},children:"Open"})]})]}),e("div",{className:b.formGroup,children:[e("label",{className:b.label,children:"Device Code"}),e("input",{className:b.input,value:a.verification.user_code,readOnly:!0})]})]}),a.status==="error"&&e("p",{className:b.warning,children:a.error}),e("details",{style:{marginTop:"1rem",fontSize:"var(--font-size-sm)"},children:[e("summary",{style:{cursor:"pointer",color:"var(--text-secondary)"},children:["Advanced: use your own auth ",v?"(override active)":""]}),e("div",{className:b.formGroup,style:{marginTop:"0.75rem"},children:[e("label",{className:b.label,children:"Client ID (optional)"}),e("input",{className:b.input,value:I,onChange:N=>l(N.currentTarget.value),placeholder:"Your GitHub OAuth app ID"})]}),e("div",{className:b.actions,children:[e(C,{onClick:$,disabled:y,children:"Save override"}),e(C,{variant:"secondary",onClick:Q,disabled:y,children:"Use dango defaults"})]})]}),e(E,{isOpen:M.show,onClose:()=>L(N=>({...N,show:!1})),width:"sm",children:[e(E.Body,{children:e("p",{children:M.message})}),e(E.Actions,{children:e(C,{onClick:()=>L(N=>({...N,show:!1})),children:"OK"})})]})]})},qt=()=>{const[t,s]=r(!0),[c,g]=r(null),[f,d]=r(!1),[S,m]=r(!1),[i,a]=r(""),[p,v]=r(""),[u,I]=r(""),[l,y]=r(!1),[_,P]=r({show:!1,message:"",type:"info"}),M=async()=>{try{const R=await k.auth.user.query();g(R?.email?R:null)}catch{g(null)}},L=async()=>{try{const[o,R]=await Promise.all([k.auth.configStatus.query(),k.auth.googleAuth.query()]);d(!!o.hasConfig),m(!!(R.hasCustomWorkerUrl||R.hasCustomClientId||R.hasClientSecret))}catch(o){console.error("Failed to fetch config status",o)}};z(()=>{(async()=>{s(!0),await Promise.all([M(),L()]);try{new URLSearchParams(window.location.search).get("google_auth")==="success"&&(await M(),window.history.replaceState(null,"",window.location.pathname))}catch{}s(!1)})();const R=A=>{A.origin===window.location.origin&&typeof A.data=="object"&&A.data!==null&&A.data.type==="GOOGLE_AUTH_SUCCESS"&&(g(A.data.user),window.location.reload())};return window.addEventListener("message",R),()=>window.removeEventListener("message",R)},[]);const w=async()=>{try{const o=await k.auth.googleLogin.mutate();if(o.authenticated){window.location.reload();return}if(o.url){if(typeof window.DangoBridge<"u"){window.location.href=o.url;return}const A=600,$=700,Q=window.innerWidth/2-A/2,N=window.innerHeight/2-$/2;window.open(o.url,"GoogleAuth",`width=${A},height=${$},top=${N},left=${Q}`)}else throw new Error("Auth URL not available")}catch{P({show:!0,message:"Authentication failed. Ensure server is configured correctly.",type:"error"})}},x=async()=>{try{await k.auth.logout.mutate(),g(null),P({show:!0,message:"Successfully signed out.",type:"success"}),window.location.reload()}catch(o){console.error("Sign out failed",o),P({show:!0,message:"Failed to sign out.",type:"error"})}},O=async()=>{y(!0);try{await k.auth.saveGoogleAuth.mutate({workerUrl:i,clientId:p,clientSecret:u}),a(""),v(""),I(""),await L(),P({show:!0,message:"Custom auth saved. Restart may be required.",type:"success"})}catch{P({show:!0,message:"Failed to save override.",type:"error"})}finally{y(!1)}},G=async()=>{y(!0);try{await k.auth.saveGoogleAuth.mutate({workerUrl:"",clientId:"",clientSecret:""}),a(""),v(""),I(""),await L(),P({show:!0,message:"Custom auth cleared. Using dango defaults.",type:"success"})}catch{P({show:!0,message:"Failed to clear override.",type:"error"})}finally{y(!1)}};return t?e("div",{style:{color:"var(--text-secondary)",padding:"1.5rem"},children:"Loading..."}):e("div",{className:T.sectionCard,children:[e("h3",{className:b.title,children:"Google Drive Sync"}),c?e("div",{className:b.userInfo,children:[e("p",{children:["Signed in as: ",e("strong",{children:c.name})," (",c.email,")"]}),e(C,{variant:"danger",onClick:x,children:"Sign Out"})]}):e("div",{className:b.signIn,children:[e("p",{children:"Sign in with your Google account to enable synchronization features."}),e(C,{onClick:w,disabled:!f,children:"Sign in with Google"}),!f&&e("p",{className:b.warning,children:"Google sync is not configured on the server."})]}),e("details",{style:{marginTop:"1rem",fontSize:"var(--font-size-sm)"},children:[e("summary",{style:{cursor:"pointer",color:"var(--text-secondary)"},children:["Advanced: use your own auth ",S?"(override active)":""]}),e("div",{className:b.formGroup,style:{marginTop:"0.75rem"},children:[e("label",{className:b.label,children:"Worker URL (optional)"}),e("input",{className:b.input,value:i,onChange:o=>a(o.currentTarget.value),placeholder:"https://your-worker.workers.dev"})]}),e("div",{className:b.formGroup,children:[e("label",{className:b.label,children:"Client ID (optional)"}),e("input",{className:b.input,value:p,onChange:o=>v(o.currentTarget.value),placeholder:"Your Google OAuth client ID"})]}),e("div",{className:b.formGroup,children:[e("label",{className:b.label,children:"Client Secret (optional)"}),e("input",{type:"password",className:b.input,value:u,onChange:o=>I(o.currentTarget.value),placeholder:"Your Google OAuth secret"})]}),e("div",{className:b.actions,children:[e(C,{onClick:O,disabled:l,children:"Save override"}),e(C,{variant:"secondary",onClick:G,disabled:l,children:"Use dango defaults"})]})]}),e(E,{isOpen:_.show,onClose:()=>P(o=>({...o,show:!1})),width:"sm",children:[e(E.Body,{children:e("p",{children:_.message})}),e(E.Actions,{children:e(C,{onClick:()=>P(o=>({...o,show:!1})),children:"OK"})})]})]})},zt="_settingItem_3qq0n_1",Kt="_modalOverlay_3qq0n_6",Ut="_modal_3qq0n_6",Et="_modalActions_3qq0n_41",Ft="_modalSecondary_3qq0n_47",$t="_modalPrimary_3qq0n_57",B={settingItem:zt,modalOverlay:Kt,modal:Ut,modalActions:Et,modalSecondary:Ft,modalPrimary:$t},Wt={anime:{heading:"Watchlist Preferences",blurb:"Customize your experience when managing your watchlist and series entries.",skipKey:"skipRemoveConfirmation",ignoreKey:"ignoreAdultContent",listOnlyKey:"cwWatchlistOnly",skipLabel:"Skip confirmation when removing from watchlist",ignoreLabel:"Hide adult content from continue watching",listOnlyLabel:"Only show continue watching for shows in watchlist",listNoun:"watchlist",continueNoun:"continue watching",adultCountUrl:"/api/continue-watching/adult-count",purgeUrl:"/api/continue-watching/purge-adult",purgeDoneText:t=>`Removed ${t??0} entries from continue watching`,invalidateKeys:[["allContinueWatching"]]},manga:{heading:"Reading List Preferences",blurb:"Customize your experience when managing your reading list and manga entries.",skipKey:"mangaSkipRemoveConfirmation",ignoreKey:"mangaIgnoreAdultContent",listOnlyKey:"mangaCwWatchlistOnly",skipLabel:"Skip confirmation when removing from reading list",ignoreLabel:"Hide adult content from continue reading",listOnlyLabel:"Only show continue reading for manga in reading list",listNoun:"reading list",continueNoun:"continue reading",adultCountUrl:"/api/manga/continue-reading/adult-count",purgeUrl:"/api/manga/continue-reading/purge-adult",purgeDoneText:t=>`Removed ${t??0} entries from continue reading`,invalidateKeys:[["manga-continue-reading"]]},tv:{heading:"TV Watchlist Preferences",blurb:"Customize your experience when managing your TV watchlist and series entries.",skipKey:"tvSkipRemoveConfirmation",ignoreKey:"tvIgnoreAdultContent",listOnlyKey:"tvCwWatchlistOnly",skipLabel:"Skip confirmation when removing from TV watchlist",ignoreLabel:"Hide adult content from continue watching",listOnlyLabel:"Only show continue watching for shows in TV watchlist",listNoun:"TV watchlist",continueNoun:"continue watching",adultCountUrl:"/api/tv/continue-watching/adult-count",purgeUrl:"/api/tv/continue-watching/purge-adult",purgeDoneText:t=>`Removed ${t??0} entries from continue watching`,invalidateKeys:[["tv-continue-watching"]]},asmr:{heading:"Listening List Preferences",blurb:"Customize your experience when managing your listening list and work entries.",skipKey:"asmrSkipRemoveConfirmation",ignoreKey:"asmrIgnoreAdultContent",listOnlyKey:"asmrCwWatchlistOnly",skipLabel:"Skip confirmation when removing from listening list",ignoreLabel:"Hide adult content from continue listening",listOnlyLabel:"Only show continue listening for works in listening list",listNoun:"listening list",continueNoun:"continue listening",adultCountUrl:"/api/asmr/continue-listening/adult-count",purgeUrl:"/api/asmr/continue-listening/purge-adult",purgeDoneText:t=>`Removed ${t??0} entries from continue listening`,invalidateKeys:[["asmr-continue-listening"]]}},Ht=(t,s)=>{if(t==null)return s;const c=String(t);return c==="true"||c==="1"?!0:c==="false"||c==="0"?!1:s},_e=(t,s,c)=>{const[g,f]=r(s),[d,S]=r(!1),m=te();return z(()=>{(async()=>{try{const p=await k.settings.getByKey.query({key:t});f(Ht(p.value,s))}catch(p){console.error("Failed to fetch setting",p)}})()},[t,s]),{value:g,setValue:f,isUpdating:d,toggle:async()=>{if(d)return;S(!0);const a=!g;f(a);try{await k.settings.set.mutate({key:t,value:a});for(const p of c)m.invalidateQueries({queryKey:p})}catch(p){console.error("Error saving setting:",p),f(!a)}finally{S(!1)}}}},Bt=()=>{const{contentType:t}=Ie(),s=Wt[t],[c,g]=r(!1),[f,d]=r(!0),[S,m]=r(!1),i=_e(s.ignoreKey,!0,s.invalidateKeys),a=_e(s.listOnlyKey,!1,s.invalidateKeys),[p,v]=r(null),[u,I]=r(!1),l=te(),y=We();z(()=>{d(!0),(async()=>{try{const x=await k.settings.getByKey.query({key:s.skipKey});String(x.value)==="true"||String(x.value)==="1"?g(!0):g(!1)}catch(x){console.error("Failed to fetch setting",x)}finally{d(!1)}})()},[s.skipKey]);const _=async()=>{if(S)return;m(!0);const w=!c;g(w);try{await k.settings.set.mutate({key:s.skipKey,value:w})}catch(x){console.error("Error saving setting:",x),g(!w)}finally{m(!1)}},P=async()=>{if(!i.isUpdating){if(i.value)try{let w;if(t==="anime"?w=(await k.continueWatching.adultCount.query()).count:t==="manga"?w=(await k.mangaProgress.adultCount.query()).count:t==="asmr"?w=(await k.asmrProgress.adultCount.query()).count:w=(await k.tvProgress.adultCount.query()).count,typeof w=="number"&&w>0){v(w);return}}catch(w){console.error("Failed to fetch adult count",w)}i.toggle()}},M=()=>{v(null),i.toggle()},L=async()=>{if(!u){I(!0);try{let w;t==="anime"?w=(await k.continueWatching.purgeAdult.mutate()).removed:t==="manga"?w=(await k.mangaProgress.purgeAdult.mutate()).removed:t==="asmr"?w=(await k.asmrProgress.purgeAdult.mutate()).removed:w=(await k.tvProgress.purgeAdult.mutate()).removed,Se.success(s.purgeDoneText(w??0));for(const x of s.invalidateKeys)l.invalidateQueries({queryKey:x});t==="anime"&&l.invalidateQueries(y.continueWatching.pathFilter()),t==="manga"&&l.invalidateQueries(y.mangaProgress.pathFilter()),t==="asmr"&&l.invalidateQueries(y.asmrProgress.pathFilter()),t==="tv"&&l.invalidateQueries(y.tvProgress.pathFilter())}catch(w){console.error("Failed to purge adult entries",w),Se.error("Failed to remove adult entries")}finally{I(!1),v(null)}i.toggle()}};return f?e("div",{children:"Loading settings..."}):e("div",{className:T.sectionCard,children:[e("h3",{children:s.heading}),e("p",{children:s.blurb}),e("div",{className:B.settingItem,children:e("div",{className:T.settingRow,children:[e("label",{htmlFor:"skip-confirmation-toggle",children:s.skipLabel}),e(F,{isChecked:c,onChange:_,id:"skip-confirmation-toggle",disabled:S})]})}),e("div",{className:B.settingItem,children:e("div",{className:T.settingRow,children:[e("label",{htmlFor:"ignore-adult-toggle",children:s.ignoreLabel}),e(F,{isChecked:i.value,onChange:P,id:"ignore-adult-toggle",disabled:i.isUpdating})]})}),e("div",{className:B.settingItem,children:e("div",{className:T.settingRow,children:[e("label",{htmlFor:"cw-watchlist-only-toggle",children:s.listOnlyLabel}),e(F,{isChecked:a.value,onChange:a.toggle,id:"cw-watchlist-only-toggle",disabled:a.isUpdating})]})}),p!==null&&e("div",{className:B.modalOverlay,onClick:()=>v(null),children:e("div",{className:B.modal,onClick:w=>w.stopPropagation(),children:[e("h4",{children:"Show adult entries?"}),e("p",{children:[p," adult ",p===1?"entry":"entries"," not in your"," ",s.listNoun," ",p===1?"is":"are"," currently hidden from"," ",s.continueNoun,". You can purge ",p===1?"it":"them"," from the database instead of showing ",p===1?"it":"them","."]}),e("div",{className:B.modalActions,children:[e("button",{type:"button",className:B.modalSecondary,onClick:M,disabled:u,children:"Show them"}),e("button",{type:"button",className:B.modalPrimary,onClick:L,disabled:u,children:u?"Purging...":`Purge ${p}`})]})]})})]})},jt="_statsGrid_o4nf0_1",Qt="_statCard_o4nf0_8",Vt="_statLabel_o4nf0_18",Yt="_statValue_o4nf0_26",Jt="_statMeta_o4nf0_32",Xt="_statusBanner_o4nf0_38",Zt="_statusSuccess_o4nf0_49",ea="_statusUpdating_o4nf0_55",ta="_statusError_o4nf0_61",aa="_sha_o4nf0_67",na="_settingItem_o4nf0_74",ra="_settingTitle_o4nf0_79",sa="_settingSubtitle_o4nf0_85",ia="_actionsRow_o4nf0_92",D={statsGrid:jt,statCard:Qt,statLabel:Vt,statValue:Yt,statMeta:Jt,statusBanner:Xt,statusSuccess:Zt,statusUpdating:ea,statusError:ta,sha:aa,settingItem:na,settingTitle:ra,settingSubtitle:sa,actionsRow:ia},oa=()=>{const[t,s]=r(null),[c,g]=r(!0),[f,d]=r(!1),[S,m]=r(!1),i=Z(null),a=async()=>{try{const l=await k.settings.offlineDbInfo.query();return s(l),l}catch(l){console.error("Failed to fetch offline DB info:",l)}finally{g(!1)}return null};z(()=>(a(),()=>{i.current&&window.clearInterval(i.current)}),[]),z(()=>{t?.isRefreshing?i.current||(i.current=window.setInterval(async()=>{const l=await a();l&&!l.isRefreshing&&i.current&&(window.clearInterval(i.current),i.current=null)},2e3)):i.current&&(window.clearInterval(i.current),i.current=null)},[t?.isRefreshing]);const p=async()=>{if(!t||f)return;const l=!t.autoUpdateEnabled;d(!0),s({...t,autoUpdateEnabled:l});try{await k.settings.setOfflineDbAutoUpdate.mutate({enabled:l})}catch(y){console.error("Failed to update auto update setting:",y),s({...t,autoUpdateEnabled:!l})}finally{d(!1)}},v=async()=>{if(!(t?.isRefreshing||S)){m(!0);try{await k.settings.triggerOfflineDbUpdate.mutate(),s(l=>l?{...l,isRefreshing:!0,lastStatus:"updating",lastMessage:"Downloading database..."}:null)}catch(l){console.error("Failed to trigger offline DB update:",l)}finally{m(!1)}}},u=l=>{if(!l)return"Never";try{return new Date(l).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}catch{return l}},I=t?.isRefreshing||S;return e("div",{className:T.sectionCard,children:[e("h3",{children:"Offline Metadata Database"}),e("p",{children:"Local MAL to AniList ID map used for instant imports and metadata enrichment without hitting rate-limited APIs. Updates automatically every Saturday in the background."}),e("div",{className:D.statsGrid,children:[e("div",{className:D.statCard,children:[e("span",{className:D.statLabel,children:"MAL Mapped"}),e("span",{className:D.statValue,children:c?"-":(t?.totalMalMapped??0).toLocaleString()})]}),e("div",{className:D.statCard,children:[e("span",{className:D.statLabel,children:"Release"}),e("span",{className:D.statMeta,children:c?"-":t?.releaseTag??"Never"})]}),e("div",{className:D.statCard,children:[e("span",{className:D.statLabel,children:"Last Checked"}),e("span",{className:D.statMeta,children:c?"-":u(t?.lastCheckedAt??null)})]}),e("div",{className:D.statCard,children:[e("span",{className:D.statLabel,children:"Last Updated"}),e("span",{className:D.statMeta,children:c?"-":u(t?.lastUpdatedAt??null)})]})]}),t?.lastMessage&&e("div",{className:`${D.statusBanner} ${t.lastStatus==="failed"?D.statusError:t.lastStatus==="updating"?D.statusUpdating:D.statusSuccess}`,children:[e("span",{children:t.lastMessage}),t.contentSha256&&e("span",{className:D.sha,children:["sha:",t.contentSha256.slice(0,12)]})]}),e("div",{className:D.settingItem,children:e("div",{className:T.settingRow,children:[e("div",{children:[e("span",{className:D.settingTitle,children:"Weekly Automatic Updates (Saturdays)"}),e("div",{className:D.settingSubtitle,children:"Download and index new database releases in the background. Catches up on startup if the server was offline."})]}),e(F,{id:"offline-db-auto-update-toggle",isChecked:t?t.autoUpdateEnabled:!0,onChange:p,disabled:c||f})]})}),e("div",{className:D.actionsRow,children:e(C,{onClick:v,disabled:c||I,children:I?"Updating Database...":"Update Offline Database Now"})})]})},la="_status_1wbo0_1",ca="_warningText_1wbo0_7",da="_ackLabel_1wbo0_11",me={status:la,warningText:ca,ackLabel:da},ua=()=>{const t=te(),[s,c]=r(!1),[g,f]=r(!1),[d,S]=r(!1),[m,i]=r(""),a=()=>{f(!1),i(""),c(!0)},p=()=>{d||(c(!1),f(!1))},v=async()=>{if(!(!g||d)){S(!0),i("");try{const u=await X("/api/database/clear",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirm:!0})}),I=await u.json();if(!u.ok)throw new Error(I.error||"Failed to clear database");const l=I.deleted,y=I.deletedManga,_=I.deletedTv,P=I.deletedAsmr,M=Object.values(l).reduce((O,G)=>O+(G||0),0)+Object.values(y??{}).reduce((O,G)=>O+(G||0),0)+Object.values(_??{}).reduce((O,G)=>O+(G||0),0)+Object.values(P??{}).reduce((O,G)=>O+(G||0),0),L=(y?.manga_library??0)+(y?.manga_progress??0),w=(_?.tv_library??0)+(_?.tv_progress??0),x=(P?.asmr_library??0)+(P?.asmr_progress??0);i(`Library cleared - ${l.watchlist??0} watchlist entries, ${L} manga rows, ${w} TV rows, ${x} ASMR rows and ${M} total rows removed.`),t.invalidateQueries({queryKey:[H.watchlist]}),t.invalidateQueries({queryKey:[H.continueWatching]}),t.invalidateQueries({queryKey:[H.mangaLibrary]}),t.invalidateQueries({queryKey:[H.mangaContinueReading]}),t.invalidateQueries({queryKey:[H.tvLibrary]}),t.invalidateQueries({queryKey:[H.tvContinueWatching]}),t.invalidateQueries({queryKey:[H.asmrLibrary]}),t.invalidateQueries({queryKey:[H.asmrContinueListening]}),c(!1)}catch(u){i(u.message)}finally{S(!1),f(!1)}}};return e("div",{className:`${T.sectionCard} ${T.dangerCard}`,children:[e("h3",{children:"Danger Zone"}),e("p",{children:"Permanently delete your library (watchlist, watched episodes, queue, cached show metadata, manga reading list and reading progress, TV watchlist and watch progress, ASMR listening list and listening progress) to start fresh. Your settings, sync state and the offline metadata cache are preserved."}),e(C,{variant:"danger",onClick:a,children:"Clear Library Data"}),m&&e("p",{className:me.status,children:m}),e(E,{isOpen:s,onClose:p,title:"Clear library data?",width:"sm",children:[e(E.Body,{children:[e("p",{className:me.warningText,children:"This permanently deletes everything in your library. It acts on the active database (dev or prod, per server config) and cannot be undone. Settings, sync state and the offline metadata cache are kept."}),e("label",{className:me.ackLabel,children:[e("input",{type:"checkbox",checked:g,onChange:u=>f(u.currentTarget.checked),disabled:d}),e("span",{children:"I understand this permanently deletes my library"})]})]}),e(E.Actions,{children:[e(C,{variant:"secondary",onClick:p,disabled:d,children:"Cancel"}),e(C,{variant:"danger",onClick:v,disabled:!g||d,children:d?"Clearing...":"Yes, delete everything"})]})]})]})},ha=()=>{const[t,s]=r(""),[c,g]=r([]),[f,d]=r(null),[S,m]=r(!0),[i,a]=r({show:!1,message:"",type:"info"}),p=async()=>{try{m(!0);const u=await k.auth.rcloneSettings.query();s(u.remote||""),g(u.availableRemotes||[]),d(u.activeRemote||null)}catch(u){console.error("Failed to fetch Rclone settings",u)}finally{m(!1)}};z(()=>{p()},[]);const v=async()=>{try{await k.auth.saveRclone.mutate({remote:t}),a({show:!0,message:"Rclone configuration saved successfully. You must restart the server for these changes to take effect.",type:"success"}),p()}catch{a({show:!0,message:"Failed to save Rclone configuration.",type:"error"})}};return S?e("div",{style:{color:"var(--text-secondary)",padding:"1.5rem"},children:"Loading..."}):e("div",{className:T.sectionCard,children:[e("h3",{className:b.title,children:"Rclone Cloud Sync"}),e("p",{className:b.signIn,children:"Configure which Rclone remote to use for database synchronization."}),f?e("div",{className:b.userInfo,children:e("p",{children:["Current Active Remote: ",e("strong",{children:f})]})}):e("p",{className:b.warning,style:{marginBottom:"1.5rem"},children:"Rclone sync is not currently active. Ensure rclone is installed and a remote is configured."}),e("div",{className:b.formGroup,children:[e("label",{className:b.label,children:"Remote Name"}),e("div",{className:b.inputWrapper,children:e("select",{className:b.select,value:t,onChange:u=>s(u.currentTarget.value),children:[e("option",{value:"",children:"(Disabled / None)"}),c.map(u=>e("option",{value:u,children:u},u)),t&&!c.includes(t)&&e("option",{value:t,children:[t," (Manual)"]})]})}),e("p",{className:b.warning,style:{marginTop:"12px"},children:[e("strong",{children:"Note:"})," You can choose which provider is active using the selector at the top of the page."]})]}),e("div",{className:b.actions,children:e(C,{onClick:v,children:"Save Rclone Settings"})}),e(E,{isOpen:i.show,onClose:()=>a(u=>({...u,show:!1})),width:"sm",children:[e(E.Body,{children:e("p",{children:i.message})}),e(E.Actions,{children:e(C,{onClick:()=>a(u=>({...u,show:!1})),children:"OK"})})]})]})},ga=()=>{const t=te(),[s,c]=r(null),[g,f]=r(!0),d=async()=>{try{const a=await k.auth.syncSettings.query();c(a)}catch(a){console.error("Failed to fetch sync settings",a)}finally{f(!1)}};z(()=>{d()},[]);const S=async a=>{const p=a.currentTarget.value;try{const v=await k.auth.saveSyncProvider.mutate({provider:p});c(u=>u?{...u,activeProvider:v.activeProvider}:null),await d(),await t.invalidateQueries({queryKey:ee.queryKey}),Ne.success(`Sync provider updated to ${p==="default"?"Default Order":p}`)}catch{Ne.error("Failed to update sync provider")}};if(g||!s)return null;const m=[{value:"default",label:"Default (Priority Based)"}];s.authenticatedProviders.github&&m.push({value:"github",label:"GitHub"}),s.authenticatedProviders.google&&m.push({value:"google",label:"Google Drive"}),s.authenticatedProviders.rclone&&m.push({value:"rclone",label:"Rclone"}),m.push({value:"none",label:"None (Local Only)"});const i=a=>a==="none"?"Local Only (No Sync)":a==="google"?"Google Drive":a==="github"?"GitHub":a==="rclone"?"Rclone":a;return e("div",{className:T.sectionCard,children:[e("h3",{children:"Active Sync Provider"}),e("p",{children:'Choose which provider to use for synchronization. "Default" uses the first available provider you are logged into.'}),e("div",{style:{marginBottom:"1.5rem",padding:"0.75rem",background:"rgba(255, 255, 255, 0.03)",borderRadius:"var(--radius-md)",borderLeft:"4px solid var(--accent)",fontSize:"var(--font-size-sm)"},children:["Current Status:"," ",e("strong",{style:{color:"var(--accent-light)",textTransform:"capitalize"},children:i(s.actualActiveProvider)})]}),e("div",{className:T.settingRow,children:[e("label",{htmlFor:"sync-provider-select",children:"Selected Preference"}),e("select",{id:"sync-provider-select",value:s.activeProvider,onChange:S,style:{padding:"0.5rem",borderRadius:"var(--radius-md)",background:"rgba(255, 255, 255, 0.05)",color:"var(--text-primary)",border:"1px solid var(--glass-border)",fontSize:"var(--font-size-sm)",minWidth:"220px",outline:"none",cursor:"pointer"},children:m.map(a=>e("option",{value:a.value,children:a.label},a.value))})]})]})};function ma(){return"javascript:"+encodeURIComponent(`(function(){
2
- if(!/(^|\\.)discord\\.com$/.test(location.hostname)){alert('Dango: use this bookmarklet while on discord.com');return}
3
- var t=null;
4
- try{
5
- window.webpackChunkdiscord_app.push([[Symbol()],{},function(req){
6
- if(!req.c)return;
7
- var ms=Object.values(req.c);
8
- for(var i=0;i<ms.length;i++){var m=ms[i];
9
- try{
10
- if(!m.exports||m.exports===window)continue;
11
- if(typeof m.exports.getToken==='function'){var x=m.exports.getToken();if(x){t=x;return}}
12
- for(var k in m.exports){try{var ex=m.exports[k];if(ex&&typeof ex.getToken==='function'&&ex[Symbol.toStringTag]!=='IntlMessagesProxy'){var y=ex.getToken();if(y){t=y;return}}}catch(e1){}}
13
- }catch(e2){}}
14
- }]);
15
- window.webpackChunkdiscord_app.pop();
16
- }catch(e3){}
17
- if(!t){alert('Dango: could not grab your token. Make sure you are logged in to Discord in this tab, then run the bookmarklet again.');return}
18
- function copyFallback(){var a=document.createElement('textarea');a.value=t;a.style.position='fixed';a.style.opacity='0';document.body.appendChild(a);a.select();try{document.execCommand('copy')}catch(e4){}document.body.removeChild(a)}
19
- var done=function(){window.close();setTimeout(function(){if(!window.closed){alert('Dango: token copied to clipboard! Could not close this tab, so just close it, go back to Dango Settings, paste the token and press Save.')}},250)};
20
- if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(t).then(done,function(){copyFallback();done()})}else{copyFallback();done()}
21
- })()`)}const pa=()=>{const t=Ke(ma,[]);return e("div",{style:{marginTop:"0.9rem",paddingTop:"0.9rem",borderTop:"1px dashed var(--border-color)"},children:[e("h4",{style:{margin:"0 0 0.35rem",fontSize:"0.95rem"},children:"Grab the token automatically (bookmarklet)"}),e("p",{style:{margin:"0 0 0.6rem",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Set this up once and you never have to dig through DevTools: the bookmarklet copies your Discord token to the clipboard and closes the Discord tab - then you just paste it above and press Save."}),e("ol",{style:{margin:"0 0 0.75rem",paddingLeft:"1.25rem",fontSize:"0.85rem",color:"var(--text-secondary)",display:"grid",gap:"0.3rem"},children:[e("li",{children:["Drag the ",e("strong",{style:{color:"var(--text-primary)"},children:"Dango Token Grabber"})," ","button below onto your bookmarks bar (press ",e("kbd",{children:"Ctrl"}),"+",e("kbd",{children:"Shift"}),"+",e("kbd",{children:"B"})," ","first if the bar is hidden)."]}),e("li",{children:["Click ",e("strong",{style:{color:"var(--text-primary)"},children:"Open Discord"})," and log in (skip this if you are already logged in)."]}),e("li",{children:["On the Discord tab, click the"," ",e("strong",{style:{color:"var(--text-primary)"},children:"Dango Token Grabber"})," bookmark. The token lands in your clipboard and the tab closes on its own - come back here, paste it above and press ",e("strong",{children:"Save"}),"."]})]}),e("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center",flexWrap:"wrap"},children:[e("a",{href:t,onClick:g=>{g.preventDefault(),alert("Drag this button onto your bookmarks bar instead of clicking it, then click it while you are on discord.com.")},title:"Drag me to your bookmarks bar",draggable:!0,style:{display:"inline-flex",alignItems:"center",padding:"0.4rem 0.8rem",borderRadius:"999px",border:"1px dashed var(--accent)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"0.85rem",textDecoration:"none",cursor:"grab",userSelect:"none"},children:[e(j,{name:"bookmark",style:{marginRight:"0.45rem",color:"var(--accent)"}}),"Dango Token Grabber"]}),e("a",{className:"btn btn-secondary btn-sm",href:"https://discord.com/channels/@me",target:"_blank",rel:"noopener noreferrer",children:"Open Discord"}),e(C,{variant:"ghost",size:"sm",onClick:async()=>{try{await navigator.clipboard.writeText(t),alert('Bookmarklet code copied. Create a new bookmark on your bookmarks bar, name it "Dango Token" and paste the code as its URL.')}catch{alert(`Could not copy automatically. Right-click the "Dango Token Grabber" button and choose "Copy link address" instead, then paste that into a new bookmark's URL.`)}},children:"Copy code"})]}),e("p",{style:{margin:"0.5rem 0 0",fontSize:"0.75rem",color:"var(--text-tertiary)"},children:`"Copy code" is a fallback for browsers that won't drag bookmarklets: create any bookmark, then paste the copied code as its URL.`})]})},fa="_settingItem_68mz3_1",ya="_field_68mz3_6",va="_input_68mz3_19",wa="_actions_68mz3_39",ba="_status_68mz3_45",q={settingItem:fa,field:ya,input:va,actions:wa,status:ba},Ca=()=>{const[t,s]=r(!1),[c,g]=r(""),[f,d]=r(""),[S,m]=r(!0),[i,a]=r(!1),[p,v]=r("");z(()=>{(async()=>{try{const P=await(await X("/api/auth/app-status")).json();s(P.hasPassword)}catch{console.error("Failed to fetch LAN auth status")}finally{m(!1)}})()},[]);const u=async()=>{if(v(""),c!==f){v("Passwords do not match");return}if(c.length<4){v("Password must be at least 4 characters");return}a(!0);try{const y=await X("/api/auth/app-setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:c})}),_=await y.json();if(!y.ok){v(_.error||"Failed to update password");return}s(_.hasPassword),g(""),d(""),v(_.hasPassword?"Password set successfully":"Password removed")}catch{v("Network error")}finally{a(!1)}},I=async()=>{a(!0);try{const y=await X("/api/auth/app-setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:""})}),_=await y.json();if(!y.ok){v(_.error||"Failed to remove password");return}s(!1),g(""),d(""),v("Password removed")}catch{v("Network error")}finally{a(!1)}},l=async()=>{a(!0);try{await X("/api/auth/app-logout",{method:"POST"}),v("Logged out"),window.location.reload()}catch{v("Logout failed")}finally{a(!1)}};return S?e("div",{className:T.sectionCard,children:e("p",{children:"Loading..."})}):e("div",{className:T.sectionCard,children:[e("h3",{children:"LAN Lock"}),e("p",{children:"Require a password to access this instance from any device, including this one. Sessions persist across server restarts until logout or password change."}),e("div",{className:q.settingItem,children:[e("div",{className:q.field,children:[e("label",{htmlFor:"lan-password",children:"New Password"}),e("input",{id:"lan-password",type:"password",value:c,onChange:y=>g(y.currentTarget.value),placeholder:t?"Leave empty to keep current password":"Enter a password...",className:q.input})]}),e("div",{className:q.field,children:[e("label",{htmlFor:"lan-confirm-password",children:"Confirm Password"}),e("input",{id:"lan-confirm-password",type:"password",value:f,onChange:y=>d(y.currentTarget.value),placeholder:"Confirm password...",className:q.input})]}),e("div",{className:q.actions,children:[e(C,{variant:"primary",onClick:u,loading:i,disabled:i,children:t?"Update Password":"Set Password"}),t&&e(C,{variant:"danger",onClick:l,loading:i,disabled:i,children:"Logout"}),t&&e(C,{variant:"secondary",onClick:I,loading:i,disabled:i,children:"Remove Password"})]}),p&&e("p",{className:q.status,children:p})]})]})},ka=()=>{const[t,s]=r(""),[c,g]=r(!0),[f,d]=r(!1),[S,m]=r("");z(()=>{V("/api/auth/app-status").then(a=>s(String(a.port??3e3))).catch(()=>m("Failed to load current port")).finally(()=>g(!1))},[]);const i=async()=>{const a=Number(t);if(!Number.isInteger(a)||a<1||a>65535){m("Enter a port between 1 and 65535");return}d(!0),m("");try{await k.auth.setServerPort.mutate({port:a}),m(`Saved. Restart dango, then open http://localhost:${a} - this overrides the PORT environment variable.`)}catch(p){m(p.message)}finally{d(!1)}};return c?e("div",{className:T.sectionCard,children:e("p",{children:"Loading..."})}):e("div",{className:T.sectionCard,children:[e("h3",{children:"Server Port"}),e("p",{children:"Port the backend listens on. Takes effect after a restart. Google and AniList sign-in need the matching redirect URI registered with the provider."}),e("div",{className:q.settingItem,children:[e("div",{className:q.field,children:[e("label",{htmlFor:"server-port",children:"Port"}),e("input",{id:"server-port",type:"number",min:1,max:65535,value:t,onChange:a=>s(a.currentTarget.value),className:q.input})]}),e("div",{className:q.actions,children:e(C,{variant:"primary",onClick:i,loading:f,disabled:f,children:"Save Port"})}),S&&e("p",{className:q.status,children:S})]})]})},Sa=()=>{const[t,s]=r(""),[c,g]=r(!0),[f,d]=r(!1),[S,m]=r("");z(()=>{k.auth.allowedOrigins.query().then(a=>s(a.origins.join(", "))).catch(()=>m("Failed to load allowed origins")).finally(()=>g(!1))},[]);const i=async()=>{d(!0),m("");try{const a=await k.auth.setAllowedOrigins.mutate({origins:t});s(a.origins.join(", ")),m("Saved.")}catch(a){m(a.message)}finally{d(!1)}};return c?e("div",{className:T.sectionCard,children:e("p",{children:"Loading..."})}):e("div",{className:T.sectionCard,children:[e("h3",{children:"Allowed Origins"}),e("p",{children:["Extra browser origins allowed to call the API, comma-separated. Include the scheme (e.g."," ",e("code",{children:"https://example.com"}),"). Same-origin access and reverse proxies that forward X-Forwarded-Host/X-Forwarded-Proto work automatically."]}),e("div",{className:q.settingItem,children:[e("div",{className:q.field,children:[e("label",{htmlFor:"allowed-origins",children:"Origins"}),e("input",{id:"allowed-origins",value:t,onChange:a=>s(a.currentTarget.value),className:q.input,placeholder:"https://example.com"})]}),e("div",{className:q.actions,children:e(C,{variant:"primary",onClick:i,loading:f,disabled:f,children:"Save Origins"})}),S&&e("p",{className:q.status,children:S})]})]})},Na=()=>{const{theme:t,setTheme:s,loading:c}=He();return e("div",{children:[e("h4",{style:{margin:"0 0 0.25rem",fontSize:"1rem"},children:"Palette"}),e("p",{style:{margin:"0 0 0.75rem",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Taro is the default. Pick a palette that suits you."}),e("div",{role:"radiogroup","aria-label":"Palette",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"0.6rem"},children:Be.map(g=>{const f=t===g.id;return e("button",{role:"radio","aria-checked":f,disabled:c,onClick:()=>s(g.id),style:{display:"flex",gap:"0.6rem",alignItems:"center",textAlign:"left",padding:"0.65rem 0.75rem",borderRadius:"10px",cursor:"pointer",background:f?"var(--accent-subtle)":"var(--bg-tertiary)",border:f?"1px solid var(--accent)":"1px solid var(--border-primary)",color:"var(--text-primary)"},children:[e("span",{"aria-hidden":!0,style:{width:26,height:26,borderRadius:"50%",flex:"none",background:g.swatch,border:"1px solid rgba(0,0,0,0.35)"}}),e("span",{style:{minWidth:0},children:[e("span",{style:{display:"block",fontSize:"0.85rem",fontWeight:700},children:g.label}),e("span",{style:{display:"block",fontSize:"0.75rem",color:"var(--text-secondary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:g.blurb})]})]},g.id)})})]})};function _a({variant:t="info",children:s,className:c=""}){return e("div",{className:`alert alert-${t} ${c}`,children:s})}const Ta={anime:"Watchlist",manga:"Reading List",tv:"TV Watchlist",asmr:"Listening List"},Te=["general","presence","server","sync","watchlist","database"],Aa=()=>{const{data:t}=fe(ee),[s,c]=Ue(),{contentType:g}=Ie(),f=s.get("tab"),[d,S]=r(f&&Te.includes(f)?f:"general"),[m,i]=r(""),a=Z(null),p=Z(null),v=Z(new Map),[u,I]=r({top:0,height:0,left:0,width:0}),{lowEndMode:l,setLowEndMode:y}=je(),{hasConsent:_,grant:P,revoke:M}=Qe(),[L,w]=r(!1),[x,O]=r(Ve),[G,o]=r(Ze),[R,A]=r(!0),{data:$}=de("discordRPCEnabled"),Q=Pe(),[N,ye]=r(!1),{data:ie}=de("frozenMode"),[Le,ve]=r(!0),{data:ae}=de("discordRPCHideMature"),[we,oe]=r(""),[ne,ce]=r(null);z(()=>{t?.owner&&k.discord.gatewayStatus.query().then(n=>{ce(n),n.masked&&n.masked!=="none"&&oe(n.masked)}).catch(()=>{})},[t?.owner]),z(()=>{$!==void 0&&A($==="true"||$===!0||$===null)},[$]),z(()=>{ae!==void 0&&ve(ae==="true"||ae===!0||ae===null)},[ae]);const xe=n=>{A(n),Q.mutate({key:"discordRPCEnabled",value:String(n)})};z(()=>{ie!==void 0&&ye(ie==="true"||ie===!0)},[ie]);const Re=n=>{ye(n),Q.mutate({key:"frozenMode",value:String(n)})},De=n=>{ve(n),Q.mutate({key:"discordRPCHideMature",value:String(n)})},Oe=n=>{O(n),Ye.setItem(Je,String(n)),window.dispatchEvent(new CustomEvent(Xe))},Ae=n=>{o(n),et(n)};Ce.useEffect(()=>{document.title="Settings - dango"},[]),Ce.useEffect(()=>{const n=s.get("tab");n&&Te.includes(n)&&S(n)},[s]);const Y=n=>{S(n),c(n==="general"?{}:{tab:n})},re=pe(()=>{const n=v.current.get(d),U=p.current;if(n&&U){const J=U.getBoundingClientRect(),W=n.getBoundingClientRect(),se=window.matchMedia("(max-width: 900px)").matches;I(se?{top:W.top-J.top,height:W.height,left:W.left-J.left,width:W.width}:{top:W.top-J.top,height:W.height,left:0,width:0})}},[d]);Ee(()=>{re()},[d,re]),z(()=>{const n=()=>re();window.addEventListener("resize",n);let U=!1;return document.fonts?.ready&&document.fonts.ready.then(()=>{U||re()}),()=>{U=!0,window.removeEventListener("resize",n)}},[d,re]);const Ge=()=>{i("Exporting databases...");const n=window.DangoBridge;if(n?.downloadFile){n.downloadFile("/api/backup-db","dango-backup.json"),setTimeout(()=>{i("Databases exported successfully!")},1500);return}const U=document.createElement("a");U.href="/api/backup-db",U.download="dango-backup.json",document.body.appendChild(U),U.click(),U.remove(),setTimeout(()=>{i("Databases exported successfully!")},1500)},Me=async n=>{const U=n.currentTarget.files?.[0];if(!U)return;i("Importing databases...");const J=new FormData;J.append("dbfile",U);try{const W=await X("/api/restore-db",{method:"POST",body:J}),se=await W.json();if(W.ok){const be=Array.isArray(se.restored)?se.restored.join(", "):null;i(be?`Databases imported successfully (${be})!`:"Database imported successfully!"),setTimeout(()=>window.location.reload(),2e3)}else i(`Import failed: ${se.error}`)}catch{i("Import failed: An unexpected error occurred.")}finally{n.currentTarget.value=""}},qe=()=>{a.current?.click()},ze=()=>{switch(d){case"general":return e("div",{className:h.tabContent,children:[e(st,{}),e("div",{className:T.sectionCard,children:[e("h3",{children:"Appearance & Preferences"}),e("p",{children:"Configure how titles are displayed and other general preferences."}),e("div",{className:h.settingItem,children:e(it,{})}),e("div",{className:h.settingItem,style:{marginTop:"1.5rem"},children:e(Na,{})}),e("div",{className:h.settingItem,style:{marginTop:"1.5rem"},children:e("div",{className:T.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Low End Mode"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Disables animations and heavy visual effects for better performance on older hardware."})]}),e(F,{isChecked:l,onChange:n=>y(n.currentTarget.checked),id:"low-end-mode"})]})}),e("div",{className:h.settingItem,style:{marginTop:"1.5rem"},children:e("div",{className:T.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Watched Episode Overlay"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Shows watched and completed episodes as an overlay on the player. Turn this off to use a popup instead."})]}),e(F,{isChecked:G,onChange:n=>Ae(n.currentTarget.checked),id:"watched-overlay-enabled"})]})}),e("div",{className:h.settingItem,style:{marginTop:"1.5rem"},children:e("div",{className:T.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Virtual Keyboard"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Shows an on-screen keyboard when text search fields are focused."})]}),e(F,{isChecked:x,onChange:n=>Oe(n.currentTarget.checked),id:"virtual-keyboard-enabled"})]})}),e("div",{className:h.settingItem,style:{marginTop:"1.5rem"},children:e("div",{className:T.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Frozen Mode"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"When on, nothing is saved or synced: no watchlist, progress, resume, or settings changes, and no cloud sync (GitHub/Google/rclone) or tracker push. Useful for experimentation and private sessions."})]}),e(F,{isChecked:N,onChange:n=>Re(n.currentTarget.checked),id:"frozen-mode"})]})})]}),e("section",{className:T.sectionCard,children:[e("h3",{children:"Keyboard Shortcuts"}),e("p",{children:"Use S or Ctrl+K to focus search anywhere, or use player keys while watching."}),e("div",{className:h.shortcutContainer,children:[e("div",{className:h.shortcutGroup,children:[e("h4",{className:h.shortcutGroupTitle,children:"Search"}),e("div",{className:h.shortcutGrid,children:[e("div",{className:h.shortcutCard,children:[e("kbd",{children:"S"}),e("span",{children:"Focus search"})]}),e("div",{className:h.shortcutCard,children:[e("kbd",{children:"Ctrl + K / ⌘ + K"}),e("span",{children:"Focus search"})]})]})]}),e("div",{className:h.shortcutGroup,children:[e("h4",{className:h.shortcutGroupTitle,children:"Player"}),e("div",{className:h.shortcutGrid,children:[e("div",{className:h.shortcutCard,children:[e("kbd",{children:"Space / K"}),e("span",{children:"Play / pause"})]}),e("div",{className:h.shortcutCard,children:[e("kbd",{children:"J / L · ← / →"}),e("span",{children:"Seek back / fwd"})]}),e("div",{className:h.shortcutCard,children:[e("kbd",{children:"↑ / ↓"}),e("span",{children:"Adjust volume"})]}),e("div",{className:h.shortcutCard,children:[e("kbd",{children:"M / F"}),e("span",{children:"Mute / fullscreen"})]}),e("div",{className:h.shortcutCard,children:[e("kbd",{children:"N / P"}),e("span",{children:"Next / prev episode"})]}),e("div",{className:h.shortcutCard,children:[e("kbd",{children:"T"}),e("span",{children:"Theater mode"})]})]})]})]})]})]});case"presence":return e("div",{className:h.tabContent,children:e("div",{className:T.sectionCard,children:[e("h3",{children:"Presence & Content"}),e("p",{children:"Control what Dango shares on Discord and your mature-content preference."}),t?.owner&&e("div",{className:h.settingItem,style:{marginTop:"1.5rem"},children:e("div",{className:T.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Discord Rich Presence"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Show your current anime and watch progress on your Discord profile status."})]}),e(F,{isChecked:R,onChange:n=>xe(n.currentTarget.checked),id:"discord-rpc-enabled"})]})}),t?.owner&&R&&e("div",{className:h.settingItem,style:{marginTop:"1rem"},children:e("div",{className:T.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Hide Mature Content"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Hide mature content (18+) from Discord Rich Presence."})]}),e(F,{isChecked:Le,onChange:n=>De(n.currentTarget.checked),id:"discord-hide-mature"})]})}),t?.owner&&e("div",{className:h.settingItem,style:{marginTop:"1.5rem",background:"var(--bg-tertiary)",padding:"1rem",borderRadius:"8px",border:"1px solid var(--border-color)"},children:[e("div",{className:T.settingRow,children:e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Discord Mobile Presence (Gateway)"}),e("p",{style:{margin:"0.25rem 0 0.75rem",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Paste your Discord authentication token to enable presence on mobile devices. If no token is saved, the default desktop Rich Presence is used. The token is stored locally in your configuration and never shared."})]})}),e(_a,{variant:"warning",style:{marginTop:"1.25rem",paddingTop:"1.25rem"},children:[e("strong",{children:"Use at your own risk."})," This feature uses the Discord Gateway API with your user token, which violates Discord's Terms of Service. Discord may detect this usage and take action against your account, including phone number locks, temporary suspensions, or permanent bans. While the risk is generally low, it is not zero. Only use this if you understand and accept the risks."]}),e("div",{style:{marginTop:"0.75rem",display:"flex",gap:"0.5rem",alignItems:"center",flexWrap:"wrap"},children:[e("input",{type:"password",value:we,onChange:n=>oe(n.currentTarget.value),placeholder:"Paste Discord token here...",style:{flex:"1 1 200px",padding:"0.5rem",borderRadius:"4px",border:"1px solid var(--border-color)",background:"var(--bg-primary)",color:"var(--text-primary)",fontFamily:"monospace",minWidth:0}}),e(C,{variant:"primary",size:"sm",onClick:async()=>{try{const n=await k.discord.gatewaySave.mutate({token:we});ce({hasToken:!0,masked:n.masked,enabled:!0}),oe(n.masked)}catch(n){alert(n instanceof Error?n.message:"Failed to save token")}},children:"Save"}),e(C,{variant:"secondary",size:"sm",onClick:async()=>{await k.discord.gatewayRemove.mutate().catch(()=>{}),oe(""),ce({hasToken:!1,masked:null,enabled:!1})},children:"Remove"})]}),ne&&e("p",{style:{marginTop:"0.5rem",fontSize:"0.8rem",color:ne.hasToken?"green":"var(--text-secondary)"},children:["Status:"," ",ne.hasToken?`Token saved (${ne.masked})`:"No token saved",ne.enabled?" - Gateway active":""]}),t?.owner&&e(pa,{})]}),e("div",{className:h.settingItem,style:{marginTop:"1.5rem"},children:e("div",{className:T.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Mature Content"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Allow mature content intended for adults 18 and older. Turning this off restores filtering and blur gates."})]}),e(F,{isChecked:_,onChange:n=>{n.currentTarget.checked?w(!0):(M(),window.location.reload())},id:"mature-content-enabled"})]})})]})});case"server":return e("div",{className:h.tabContent,children:[t?.owner&&e(Ca,{}),t?.owner&&e(ka,{}),t?.owner&&e(Sa,{})]});case"sync":return e("div",{className:h.tabContent,children:[e(ga,{}),e(Mt,{}),e(qt,{}),t?.owner&&e(ha,{})]});case"watchlist":return e("div",{className:h.tabContent,children:e(Bt,{})});case"database":return e("div",{className:h.tabContent,children:[e("div",{className:T.sectionCard,children:[e("h3",{children:"Database Management"}),e("p",{children:"Download a backup of all databases (anime, manga, TV and ASMR) or restore from a backup file. Legacy single-file anime (.db) backups can still be restored."}),e("div",{className:h.controls,children:[e(C,{onClick:Ge,children:"Backup Database"}),e(C,{variant:"secondary",onClick:qe,children:"Restore Database"})]}),e("input",{type:"file",ref:a,onChange:Me,style:{position:"absolute",width:1,height:1,opacity:0,overflow:"hidden"},accept:".json,.db,application/octet-stream"}),m&&e("p",{className:h.status,children:m})]}),t?.owner&&e(oa,{}),e(ua,{})]});default:return null}};return e("div",{className:"page-container",children:[e("div",{className:h.settingsHeader,children:[e("h1",{className:h.pageTitle,children:"Settings"}),e("p",{className:h.pageSubtitle,children:"Manage your preferences and data synchronization"})]}),e("div",{className:h.settingsLayout,children:[e("aside",{className:h.sidebar,ref:p,children:[e("div",{className:h.sidebarIndicator,style:{top:u.top,height:u.height,left:u.left,...u.width?{width:u.width}:{}}}),e("button",{ref:n=>{n&&v.current.set("general",n)},className:`${h.sidebarItem} ${d==="general"?h.active:""}`,onClick:()=>Y("general"),children:[e(j,{name:"cog"})," ",e("span",{children:"General"})]}),e("button",{ref:n=>{n&&v.current.set("presence",n)},className:`${h.sidebarItem} ${d==="presence"?h.active:""}`,onClick:()=>Y("presence"),children:[e(j,{name:"discord"})," ",e("span",{children:"Presence"})]}),e("button",{ref:n=>{n&&v.current.set("server",n)},className:`${h.sidebarItem} ${d==="server"?h.active:""}`,onClick:()=>Y("server"),children:[e(j,{name:"server"})," ",e("span",{children:"Server"})]}),e("button",{ref:n=>{n&&v.current.set("sync",n)},className:`${h.sidebarItem} ${d==="sync"?h.active:""}`,onClick:()=>Y("sync"),children:[e(j,{name:"cloud"})," ",e("span",{children:"Synchronization"})]}),e("button",{ref:n=>{n&&v.current.set("watchlist",n)},className:`${h.sidebarItem} ${d==="watchlist"?h.active:""}`,onClick:()=>Y("watchlist"),children:[e(j,{name:"list"})," ",e("span",{children:Ta[g]})]}),e("button",{ref:n=>{n&&v.current.set("database",n)},className:`${h.sidebarItem} ${d==="database"?h.active:""}`,onClick:()=>Y("database"),children:[e(j,{name:"database"})," ",e("span",{children:"Database"})]})]}),e("main",{className:h.mainContent,children:e("div",{className:h.tabContent,children:ze()},d)})]}),e(tt,{isOpen:L,onClose:()=>w(!1),onGrant:()=>{P(),w(!1)},scope:"section"})]})};export{Aa as default};
@@ -1 +0,0 @@
1
- import{o as R,a as q,p as E,d as c,h as C,T,u as e,g as F}from"./vendor-core-DfaOB3Rn.js";import{I as a}from"./vendor-icons-C1Pj_eSX.js";import{aj as j,e as U,ak as H,t as J,B as w,a8 as K,i as I}from"./index-B9fL2VIP.js";import{c as Q,d as X}from"./useTvLibrary-abNJVIr4.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-Cnx2xRQb.js";const Y="_container_198yg_1",Z="_heroSection_198yg_11",ee="_bannerContainer_198yg_17",ne="_banner_198yg_17",te="_bannerOverlay_198yg_37",se="_heroContent_198yg_49",ae="_posterContainer_198yg_62",oe="_poster_198yg_62",ie="_infoGlass_198yg_86",re="_title_198yg_100",le="_quickMeta_198yg_110",ce="_metaItem_198yg_118",de="_iconStar_198yg_126",_e="_iconTv_198yg_130",me="_iconType_198yg_134",he="_genres_198yg_139",ge="_genre_198yg_139",ve="_metaRow_198yg_156",pe="_metaValue_198yg_164",ue="_metaDivider_198yg_168",ye="_synopsisSection_198yg_173",ke="_sectionTitleSmall_198yg_179",be="_synopsis_198yg_173",Ne="_actions_198yg_196",Se="_watchBtn_198yg_202",fe="_watchlistBtn_198yg_226",Ce="_active_198yg_250",Te="_seasonPickerLabel_198yg_256",we="_seasonSelect_198yg_267",Ie="_detailsToggleBtn_198yg_286",Be="_expandedContent_198yg_304",De="_detailGrid_198yg_309",Me="_detailItem_198yg_315",Le="_imdbLink_198yg_333",Pe="_heroSkeleton_198yg_343",$e="_skeletonBanner_198yg_347",Ge="_skeletonContent_198yg_354",xe="_skeletonPoster_198yg_365",Oe="_skeletonInfo_198yg_373",Ae="_skeletonTitle_198yg_380",Ve="_skeletonMeta_198yg_388",We="_skeletonDesc_198yg_396",ze="_skeletonActions_198yg_404",Re="_errorState_198yg_413",qe="_matureOverlay_198yg_434",Ee="_matureContent_198yg_444",n={container:Y,heroSection:Z,bannerContainer:ee,banner:ne,bannerOverlay:te,heroContent:se,posterContainer:ae,poster:oe,infoGlass:ie,title:re,quickMeta:le,metaItem:ce,iconStar:de,iconTv:_e,iconType:me,genres:he,genre:ge,metaRow:ve,metaValue:pe,metaDivider:ue,synopsisSection:ye,sectionTitleSmall:ke,synopsis:be,actions:Ne,watchBtn:Se,watchlistBtn:fe,active:Ce,seasonPickerLabel:Te,seasonSelect:we,detailsToggleBtn:Ie,expandedContent:Be,detailGrid:De,detailItem:Me,imdbLink:Le,heroSkeleton:Pe,skeletonBanner:$e,skeletonContent:Ge,skeletonPoster:xe,skeletonInfo:Oe,skeletonTitle:Ae,skeletonMeta:Ve,skeletonDesc:We,skeletonActions:ze,errorState:Re,matureOverlay:qe,matureContent:Ee};function Qe(){const{id:o}=R(),d=q(),[B]=E(),i=j(B.get("type")),{hasConsent:D}=U(),[t,M]=c(null),[L,m]=c(!0),[u,y]=c(""),[_,P]=c(!1),[h,$]=c(1),G=H(i,o??""),x=Number(o),{data:O}=Q(t?G:void 0),g=!!O?.inLibrary,{toggle:A}=X();C(()=>{o&&(m(!0),y(""),J.tv.details.query({type:i,id:String(o)}).then(s=>{const r={id:s.id,title:s.title||"",overview:s.overview||"",vote_average:s.vote_average,year:s.year,poster:s.poster,backdrop:s.backdrop,imdb_id:s.imdb_id||void 0,adult:s.adult,seasons:s.seasons?.map(z=>({...z,name:""})),number_of_seasons:s.number_of_seasons,number_of_episodes:s.number_of_episodes,status:s.status,first_air_date:s.first_air_date,last_air_date:s.last_air_date};M(r),m(!1)}).catch(s=>{y(s.message),m(!1)}))},[o,i]),C(()=>{document.title=t?.title?`${t.title} - dango`:"TV & Movies - dango"},[t?.title]);const V=()=>{!o||!t||d(l?I(i,o):I(i,o,h,1))},W=()=>{t&&A({tmdbId:x,mediaType:i,title:t.title,poster:t.poster,year:t.year,adult:t.adult})},l=i==="movie",v=!l,k=t?.backdrop?`https://image.tmdb.org/t/p/w1280${t.backdrop}`:"",b=t?.poster?`https://image.tmdb.org/t/p/w500${t.poster}`:"",N=T(()=>t?.genres?t.genres.map(s=>s.name).slice(0,5):[],[t?.genres]),S=T(()=>t?.seasons?[...t.seasons].sort((s,r)=>s.season_number-r.season_number):[],[t?.seasons]),p=[t?.year,t?.status,v&&t?.number_of_seasons?`${t.number_of_seasons} Season${t.number_of_seasons>1?"s":""}`:null,v&&t?.number_of_episodes?`${t.number_of_episodes} Episodes`:null].filter(Boolean);if(L)return e("div",{className:n.container,children:e("div",{className:n.heroSkeleton,children:[e("div",{className:n.skeletonBanner}),e("div",{className:n.skeletonContent,children:[e("div",{className:n.skeletonPoster}),e("div",{className:n.skeletonInfo,children:[e("div",{className:n.skeletonTitle}),e("div",{className:n.skeletonMeta}),e("div",{className:n.skeletonDesc}),e("div",{className:n.skeletonActions})]})]})]})});if(u||!t)return e("div",{className:n.container,children:e("div",{className:n.errorState,children:[e(a,{name:"exclamation-triangle",size:48}),e("h2",{children:"Failed to load details"}),e("p",{children:u||"Something went wrong"}),e(w,{onClick:()=>d(-1),children:"Go Back"})]})});const f=t.adult&&!D;return e("div",{className:n.container,style:f?{filter:"blur(14px)",pointerEvents:"none",userSelect:"none"}:void 0,children:[e("div",{className:n.heroSection,children:[e("div",{className:n.bannerContainer,children:[k&&e("div",{className:n.banner,style:{backgroundImage:`url(${k})`}}),e("div",{className:n.bannerOverlay})]}),e("div",{className:n.heroContent,children:[e("div",{className:n.posterContainer,children:b&&e(K,{src:b,alt:t.title,className:n.poster,decoding:"async"})}),e("div",{className:n.infoGlass,children:[e("div",{children:[e("h1",{className:n.title,children:t.title}),e("div",{className:n.quickMeta,children:[t.vote_average!=null&&t.vote_average>0&&e("div",{className:n.metaItem,children:[e(a,{name:"star",className:n.iconStar}),e("span",{children:Number(t.vote_average).toFixed(1)})]}),e("div",{className:n.metaItem,children:[e(a,{name:"tv",className:n.iconTv}),e("span",{children:l?"Movie":"TV Show"})]}),t.vote_count!=null&&e("div",{className:n.metaItem,children:[e(a,{name:"users",className:n.iconType}),e("span",{children:[t.vote_count.toLocaleString()," votes"]})]})]}),N.length>0&&e("div",{className:n.genres,children:N.map(s=>e("span",{className:n.genre,children:s},s))})]}),p.length>0&&e("div",{className:n.metaRow,children:p.map((s,r)=>e(F.Fragment,{children:[e("span",{className:n.metaValue,children:s}),r<p.length-1&&e("span",{className:n.metaDivider,children:"·"})]},r))}),t.overview&&e("div",{className:n.synopsisSection,children:[e("h2",{className:n.sectionTitleSmall,children:"Synopsis"}),e("p",{className:n.synopsis,children:t.overview})]}),e("div",{className:n.actions,children:[e("button",{className:n.watchBtn,onClick:V,children:[e(a,{name:"play",size:14}),l?"Watch Now":`Start S${h}`]}),e("button",{className:`${n.watchlistBtn} ${g?n.active:""}`,onClick:W,children:[g?e(a,{name:"check",size:14}):e(a,{name:"plus",size:14}),g?"In Watchlist":"Add to Watchlist"]})]}),v&&S.length>1&&e("label",{className:n.seasonPickerLabel,children:[e("span",{children:"Season"}),e("select",{value:h,onChange:s=>$(parseInt(s.currentTarget.value,10)||1),className:n.seasonSelect,children:S.map(s=>e("option",{value:s.season_number,children:[s.season_number===0?"Specials":`Season ${s.season_number}`," (",s.episode_count," Episodes)"]},s.season_number))})]}),e("button",{className:n.detailsToggleBtn,onClick:()=>P(!_),children:[_?e(a,{name:"chevron-up"}):e(a,{name:"chevron-down"}),_?"Hide Details":"Show Details"]}),_&&e("div",{className:n.expandedContent,children:e("div",{className:n.detailGrid,children:[t.first_air_date&&e("div",{className:n.detailItem,children:[e("strong",{children:l?"Release Date":"First Air Date"}),e("span",{children:t.first_air_date})]}),t.last_air_date&&e("div",{className:n.detailItem,children:[e("strong",{children:"Last Air Date"}),e("span",{children:t.last_air_date})]}),t.networks&&t.networks.length>0&&e("div",{className:n.detailItem,children:[e("strong",{children:"Networks"}),e("span",{children:t.networks.map(s=>s.name).join(", ")})]}),t.created_by&&t.created_by.length>0&&e("div",{className:n.detailItem,children:[e("strong",{children:"Created By"}),e("span",{children:t.created_by.map(s=>s.name).join(", ")})]}),t.episode_run_time&&t.episode_run_time.length>0&&e("div",{className:n.detailItem,children:[e("strong",{children:"Episode Runtime"}),e("span",{children:[t.episode_run_time[0]," min"]})]}),t.imdb_id&&e("div",{className:n.detailItem,children:[e("strong",{children:"IMDb"}),e("a",{href:`https://www.imdb.com/title/${t.imdb_id}`,target:"_blank",rel:"noopener noreferrer",className:n.imdbLink,children:"View on IMDb"})]})]})})]})]})]}),f&&e("div",{className:n.matureOverlay,children:e("div",{className:n.matureContent,children:[e(a,{name:"exclamation-triangle",size:48}),e("h2",{children:"Content Warning"}),e("p",{children:"This content may contain mature themes."}),e(w,{onClick:()=>d("/"),children:"Go Back"})]})})]})}export{Qe as default};