@serifpersia/dango 3.7.9 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/client/dist/assets/{AnimeCard-DWnU-rCc.js → AnimeCard-BURLDiUV.js} +1 -1
- package/client/dist/assets/{AnimeInfo-Ck-fMvdY.js → AnimeInfo-D2coN_ZJ.js} +1 -1
- package/client/dist/assets/{AnimeInfoPage-_iM5y3E4.js → AnimeInfoPage-BfPP9trp.js} +2 -2
- package/client/dist/assets/{Asmr-CzqLNY2c.js → Asmr-CiuBtMGl.js} +1 -1
- package/client/dist/assets/{AsmrResetProgressModal-73jUOcAL.js → AsmrResetProgressModal-BDFeO6fQ.js} +1 -1
- package/client/dist/assets/{Home--RCZI3_q.js → Home-GShTLEbZ.js} +1 -1
- package/client/dist/assets/{Insights-B5oANHfN.js → Insights-CKk02Whw.js} +1 -1
- package/client/dist/assets/{LibraryListPage-CV2FpbUe.js → LibraryListPage-AGyVc7pR.js} +1 -1
- package/client/dist/assets/{ListeningList-Bb7qLeQy.js → ListeningList-DeAdvRjS.js} +1 -1
- package/client/dist/assets/{Manga-RzxC02lH.js → Manga-CiPWc8Ly.js} +1 -1
- package/client/dist/assets/{MangaInfoPage-DLANpxOs.js → MangaInfoPage-3jObt7zd.js} +1 -1
- package/client/dist/assets/{MangaReadPage-DuMOiKID.js → MangaReadPage-V5M2BLWG.js} +1 -1
- package/client/dist/assets/{MangaResetProgressModal-Y2PuLQHz.js → MangaResetProgressModal-CXRvdwD9.js} +1 -1
- package/client/dist/assets/{Mature-DfO3sop8.js → Mature-B9IEX0IP.js} +1 -1
- package/client/dist/assets/{MatureConsentModal-DiWSp3Of.js → MatureConsentModal-LTZSG_Kx.js} +1 -1
- package/client/dist/assets/{MediaCard-ChUKs5Sb.js → MediaCard-l2gAJctz.js} +1 -1
- package/client/dist/assets/{OptionListMenu-Cwb6MHoZ.js → OptionListMenu-CHJb3qot.js} +1 -1
- package/client/dist/assets/{Player-JA7rXoBD.js → Player-BTimy0Mp.js} +2 -2
- package/client/dist/assets/{PlayerProvider--aaVRFly.js → PlayerProvider-BXBzQc8G.js} +1 -1
- package/client/dist/assets/{PlayerSettings-CxlbcdU4.js → PlayerSettings-B-_QOjfP.js} +1 -1
- package/client/dist/assets/{QueueOptionsButton-C6ArqpM5.js → QueueOptionsButton-BCxERY1G.js} +1 -1
- package/client/dist/assets/{QueueRail-Derl5yzz.js → QueueRail-BX4CwNHY.js} +1 -1
- package/client/dist/assets/{ReadingList-BYbV0CvS.js → ReadingList-BLUM-leI.js} +1 -1
- package/client/dist/assets/{ResetProgressModal-DtUE-wCy.js → ResetProgressModal-DLs9yqI-.js} +1 -1
- package/client/dist/assets/{Search-CzTO0VVY.js → Search-tnIvsV_a.js} +1 -1
- package/client/dist/assets/{Settings-DKGEpLWL.js → Settings-CibKc1Rt.js} +1 -1
- package/client/dist/assets/{SkeletonGrid-BO0am1za.js → SkeletonGrid-nW7P1jQU.js} +1 -1
- package/client/dist/assets/{Trackers-uUzceJl6.js → Trackers-Cynvnhc3.js} +1 -1
- package/client/dist/assets/{Tv-CuM6Jhjn.js → Tv-BePMuQoo.js} +1 -1
- package/client/dist/assets/{TvInfo-4DOit0hL.js → TvInfo-DGIpvh-v.js} +1 -1
- package/client/dist/assets/{TvPopup-DYYtMp7D.js → TvPopup-BS4iiQMd.js} +1 -1
- package/client/dist/assets/{TvSearch-C-IYU0V4.js → TvSearch-p0kCDTee.js} +1 -1
- package/client/dist/assets/{TvWatchlist--kFfdVIF.js → TvWatchlist-CmXQkDQp.js} +1 -1
- package/client/dist/assets/{VirtualKeyboard-BYc_6hb4.js → VirtualKeyboard-CroH8QGP.js} +1 -1
- package/client/dist/assets/{WatchAlong-zZPGaH2D.js → WatchAlong-iCJlxiZA.js} +1 -1
- package/client/dist/assets/{WatchAlongPanel-DxC7pX1I.js → WatchAlongPanel-R7Nd5MXr.js} +1 -1
- package/client/dist/assets/{Watchlist-CX9qGh-b.js → Watchlist-D2sHodVo.js} +1 -1
- package/client/dist/assets/{index-DbRDs7tF.js → index-DYanm9eZ.js} +2 -2
- package/client/dist/assets/{libraryInvalidation-cJ1WjrJq.js → libraryInvalidation-DlwONLN-.js} +1 -1
- package/client/dist/assets/{playbackCompletion-CnxK6_Vz.js → playbackCompletion-CxGa4g7a.js} +1 -1
- package/client/dist/assets/{useAnimeInfoData-YbePqj-M.js → useAnimeInfoData-DMeGA3wY.js} +1 -1
- package/client/dist/assets/{useAsmr-DO5DUI_t.js → useAsmr-B88X71vs.js} +1 -1
- package/client/dist/assets/{useAsmrPopup-S_XfgKDh.js → useAsmrPopup-DEhKwHLC.js} +1 -1
- package/client/dist/assets/{useMangaLibrary-B4ZJLZXD.js → useMangaLibrary-CX_0zLJK.js} +1 -1
- package/client/dist/assets/{useMangaPopup-B4ntcNg0.js → useMangaPopup-Dkq2Yw-e.js} +1 -1
- package/client/dist/assets/{useProviders-Bnw0sBAP.js → useProviders-D9QoFCnY.js} +1 -1
- package/client/dist/assets/{useTv-gF7SJCl9.js → useTv-BGXZmuV8.js} +1 -1
- package/client/dist/assets/{useTvLibrary-DTWM3iOC.js → useTvLibrary-TnVQ2e21.js} +1 -1
- package/client/dist/assets/{useWatchAlongPlayer-Do0c9QsI.js → useWatchAlongPlayer-3HXJvQR2.js} +1 -1
- package/client/dist/index.html +1 -1
- package/package.json +2 -2
- package/server/dist/server.js +1 -1
- package/server/dist/shipped-defaults.js +1 -1
- package/server/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as fe,o as He,a as Ze,p as Je,d as h,A as ye,T,u as t,S as Xe}from"./vendor-core-DfaOB3Rn.js";import{u as et,a as Se}from"./vendor-query-BBT5_sHx.js";import{l as tt,u as at,d as nt,C as st,D as _e,E as we,q as Ae,F as lt,t as rt,o as ct,G as it,H as ot,I as dt,J as ht,K as ut,B as W,L as se}from"./index-DbRDs7tF.js";import{I as g}from"./vendor-icons-DrybRNxP.js";import{A as mt}from"./AnimeCard-DWnU-rCc.js";import{S as pt}from"./SkeletonGrid-BO0am1za.js";import{E as gt}from"./ErrorMessage-DAxegITP.js";import{P as Le}from"./MediaCard-ChUKs5Sb.js";import{s as n}from"./LibraryListPage.module-r6k9nyT9.js";import{A as vt}from"./ActiveFilterChips-olGfwxle.js";import"./useAnimeInfoData-YbePqj-M.js";import"./QueueOptionsButton-C6ArqpM5.js";import"./vendor-ui-3qrARCPr.js";import"./playbackCompletion-CnxK6_Vz.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-DiWSp3Of.js";const ft=(d,v)=>{const l=new URLSearchParams(v);return l.delete("page"),l.sort(),`${d}|${l.toString()}`},yt=(d,v)=>{const l=new Set(d);return v.forEach(w=>l.add(w)),l},St=(d,v)=>{const l=new Set(d);return v.forEach(w=>l.delete(w)),l},_t="_sortSelect_cahhw_1",wt="_filterContainer_cahhw_30",At="_slideUpIn_cahhw_1",Lt="_searchBarWrapper_cahhw_44",Ct="_inputIconWrapper_cahhw_50",Nt="_searchIcon_cahhw_55",bt="_searchInput_cahhw_64",Bt="_searchActions_cahhw_84",kt="_searchBtn_cahhw_89",Rt="_filterToggleBtn_cahhw_94",Tt="_advancedFilters_cahhw_115",Wt="_show_cahhw_122",It="_filterDivider_cahhw_128",xt="_filterGrid_cahhw_134",$t="_filterItem_cahhw_141",Pt="_genreSection_cahhw_183",Ft="_genreLabel_cahhw_189",Gt="_genreContainer_cahhw_199",Mt="_genreButton_cahhw_205",Ot="_include_cahhw_222",Et="_exclude_cahhw_228",Dt="_filterActions_cahhw_235",zt="_applyBtn_cahhw_246",c={sortSelect:_t,filterContainer:wt,slideUpIn:At,searchBarWrapper:Lt,inputIconWrapper:Ct,searchIcon:Nt,searchInput:bt,searchActions:Bt,searchBtn:kt,filterToggleBtn:Rt,advancedFilters:Tt,show:Wt,filterDivider:It,filterGrid:xt,filterItem:$t,genreSection:Pt,genreLabel:Ft,genreContainer:Gt,genreButton:Mt,include:Ot,exclude:Et,filterActions:Dt,applyBtn:zt},Ne=["All","Continue Watching","Watching","Completed","On-Hold","Dropped","Planned"],Ce=Ne.slice(2),Ut=[{value:"ALL",label:"All Types"},{value:"TV",label:"TV Series"},{value:"Movie",label:"Movie"},{value:"OVA",label:"OVA"},{value:"ONA",label:"ONA"},{value:"TV_SHORT",label:"TV Short"},{value:"SPECIAL",label:"Special"},{value:"ADULT",label:"Adult (18+)"}],qt=[{value:"ALL",label:"All Seasons"},{value:"WINTER",label:"Winter"},{value:"SPRING",label:"Spring"},{value:"SUMMER",label:"Summer"},{value:"FALL",label:"Fall"}],ca=()=>{fe(()=>{document.title="Watchlist - dango"},[]);const{filter:d="All"}=He(),v=Ze(),[l,w]=Je(),Q=et(),le=tt(),[f,I]=h(parseInt(l.get("page")||"1")),[A,x]=h(l.get("query")||""),[L,V]=h(l.get("sortBy")||"last_added"),[C,$]=h(l.get("type")||"ALL"),[N,P]=h(l.get("season")||"ALL"),[b,F]=h(l.get("year")||"ALL"),[k,G]=h(()=>{const e={},a=l.get("genres")?.split(",").map(r=>r.trim()).filter(Boolean)||[],s=l.get("excludeGenres")?.split(",").map(r=>r.trim()).filter(Boolean)||[];return a.forEach(r=>r&&(e[r]="include")),s.forEach(r=>r&&(e[r]="exclude")),e}),[M,be]=h(()=>["type","season","year","genres","excludeGenres"].some(e=>l.has(e))),{lowEndMode:Be}=at(),{titlePreference:O}=nt(),{data:ke}=st(),re=ke?.genres||[],H=ye(null),[o,B]=h(null),[Z,E]=h(!1),[ce,D]=h(!1),[z,Re]=h(!1),[p,y]=h(new Set),J=ye(null),i=d==="Continue Watching",U=T(()=>{const e=new URLSearchParams(l);return e.delete("page"),e.set("titlePreference",O),e.toString()},[l,O]),{data:q,isLoading:Te,error:We}=_e(U,f,14),{data:Y,isLoading:Ie,error:xe}=we(d,U,f,14),{data:$e}=_e(U,f+1,14),{data:Pe}=we(d,U,f+1,14),X=T(()=>(i?q?.data:Y?.data)||[],[i,q,Y]),R=T(()=>(i?q?.total:Y?.total)||0,[i,q,Y]),j=i?Te:Ie,ie=i?We:xe,oe=i?$e:Pe;fe(()=>{x(l.get("query")||""),V(l.get("sortBy")||"last_added"),$(l.get("type")||"ALL"),P(l.get("season")||"ALL"),F(l.get("year")||"ALL");const e={},a=l.get("genres")?.split(",").map(u=>u.trim()).filter(Boolean)||[],s=l.get("excludeGenres")?.split(",").map(u=>u.trim()).filter(Boolean)||[];a.forEach(u=>u&&(e[u]="include")),s.forEach(u=>u&&(e[u]="exclude")),G(e),I(parseInt(l.get("page")||"1"));const r=ft(d,l);J.current!==null&&J.current!==r&&y(new Set),J.current=r},[l,d]);const Fe=Se({mutationFn:async({id:e,status:a})=>{await rt.watchlist.setStatus.mutate({id:e,status:a})},onSuccess:()=>{Q.invalidateQueries({queryKey:[Ae.watchlist]}),lt.success("Status updated")}}),Ge=Se(le.continueWatching.remove.mutationOptions({onSuccess:()=>{Q.invalidateQueries(le.continueWatching.pathFilter()),Q.invalidateQueries({queryKey:[Ae.continueWatching]})}})),ee=ct(),{data:de}=it("skipRemoveConfirmation"),Me=ot(),te=T(()=>{const e=a=>a[O]||a.name||"";return[...X].sort((a,s)=>L==="name_asc"?e(a).localeCompare(e(s)):L==="name_desc"?e(s).localeCompare(e(a)):0)},[X,L,O]),ae=new Date().getFullYear(),Oe=[{value:"ALL",label:"All Years"},...Array.from({length:ae-1980+1},(e,a)=>({value:String(ae-a),label:String(ae-a)}))],m=(e=L,a=1)=>{const s=new URLSearchParams;A.trim()&&s.set("query",A.trim()),e!=="last_added"&&s.set("sortBy",e),C!=="ALL"&&s.set("type",C),N!=="ALL"&&s.set("season",N),b!=="ALL"&&s.set("year",b);const r=Object.entries(k).filter(([,_])=>_==="include").map(([_])=>_),u=Object.entries(k).filter(([,_])=>_==="exclude").map(([_])=>_);r.length>0&&s.set("genres",r.join(",")),u.length>0&&s.set("excludeGenres",u.join(",")),a>1&&s.set("page",a.toString()),w(s),a!==f&&I(a)},he=e=>{if(m(L,e),H.current){const a=H.current.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:a,behavior:"smooth"})}},Ee=()=>{x(""),V("last_added"),$("ALL"),P("ALL"),F("ALL"),G({}),w(new URLSearchParams),I(1)},De=e=>{G(a=>{const s=a[e],r={...a};return s==="include"?r[e]="exclude":s==="exclude"?delete r[e]:r[e]="include",r})},ue=(e,a)=>{if(i){B({id:e,name:a});return}String(de)==="true"||String(de)==="1"?ee.mutate({id:e}):B({id:e,name:a})},ze=()=>{if(o){if(o.ids){i?(Ue.mutate({ids:o.ids}),Z&&pe.mutate({ids:o.ids})):pe.mutate({ids:o.ids}),y(new Set),B(null),E(!1),D(!1);return}i?(Ge.mutate({showId:o.id}),Z&&ee.mutate({id:o.id})):ee.mutate({id:o.id}),ce&&Me.mutate({key:"skipRemoveConfirmation",value:!0}),B(null),E(!1),D(!1)}},me=()=>{B(null),E(!1),D(!1)},pe=dt(),Ue=ht(),qe=ut(),Ye=()=>{Re(e=>{const a=!e;return a||y(new Set),a})},je=e=>{y(a=>{const s=new Set(a);return s.has(e)?s.delete(e):s.add(e),s})},K=te.map(e=>e.id),ne=K.length>0&&K.every(e=>p.has(e)),Ke=()=>{y(ne?e=>St(e,K):e=>yt(e,K))},Qe=e=>{p.size!==0&&(qe.mutate({ids:[...p],status:e}),y(new Set))},Ve=()=>{p.size!==0&&B({ids:[...p]})},ge=X.length>=14&&oe&&oe.data.length>0,ve=T(()=>Math.max(1,Math.ceil(R/14)),[R]),S=[];A.trim()&&S.push({key:"query",label:`Search: ${A}`,onRemove:()=>{x(""),m()}}),C!=="ALL"&&S.push({key:"type",label:`Type: ${C}`,onRemove:()=>{$("ALL"),m()}}),N!=="ALL"&&S.push({key:"season",label:`Season: ${N}`,onRemove:()=>{P("ALL"),m()}}),b!=="ALL"&&S.push({key:"year",label:`Year: ${b}`,onRemove:()=>{F("ALL"),m()}});for(const[e,a]of Object.entries(k))S.push({key:e,label:a==="include"?`+ ${e}`:`-${e}`,tone:a==="include"?"primary":"danger",onRemove:()=>{G(s=>{const r={...s};return delete r[e],r}),m()}});return t("div",{className:"page-container",children:[t("header",{className:n.header,children:[t("h2",{className:n.title,children:"My Watchlist"}),t("p",{className:n.subtitle,children:"Track and manage your anime collection"})]}),t("div",{className:n.controls,children:[t("div",{className:n.filters,children:Ne.map(e=>t("button",{className:`${n.filterBtn} ${d===e?n.active:""}`,onClick:()=>{const a=new URLSearchParams(l);a.delete("page"),v({pathname:`/watchlist/${e}`,search:a.toString()}),I(1)},children:e},e))}),t("div",{children:t("select",{className:c.sortSelect,value:L,onChange:e=>{const a=e.currentTarget.value;V(a),m(a,f)},children:[t("option",{value:"last_added",children:"Recently Added"}),t("option",{value:"name_asc",children:"Name (A-Z)"}),t("option",{value:"name_desc",children:"Name (Z-A)"})]})})]}),t("div",{className:c.filterContainer,children:[t("div",{className:c.searchBarWrapper,children:[t("div",{className:c.inputIconWrapper,children:[t(g,{name:"search",className:c.searchIcon}),t("input",{className:c.searchInput,placeholder:"Search your watchlist by title...",value:A,onInput:e=>x(e.currentTarget.value),onKeyDown:e=>e.key==="Enter"&&m()})]}),t("div",{className:c.searchActions,children:[t(W,{onClick:()=>m(),className:c.searchBtn,children:"Search"}),t("button",{className:`${c.filterToggleBtn} ${M?n.active:""}`,onClick:()=>be(!M),children:[t(g,{name:"filter",size:14}),t("span",{children:"Filters"}),M?t(g,{name:"chevron-up",size:12}):t(g,{name:"chevron-down",size:12})]})]})]}),t("div",{className:`${c.advancedFilters} ${M?c.show:""}`,children:[t("div",{className:c.filterDivider}),t("div",{className:c.filterGrid,children:[t("div",{className:c.filterItem,children:[t("label",{children:"Type"}),t("select",{value:C,onChange:e=>$(e.currentTarget.value),children:Ut.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:c.filterItem,children:[t("label",{children:"Season"}),t("select",{value:N,onChange:e=>P(e.currentTarget.value),children:qt.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:c.filterItem,children:[t("label",{children:"Year"}),t("select",{value:b,onChange:e=>F(e.currentTarget.value),children:Oe.map(e=>t("option",{value:e.value,children:e.label},e.value))})]})]}),re.length>0&&t("div",{className:c.genreSection,children:[t("label",{className:c.genreLabel,children:"Genres"}),t("div",{className:c.genreContainer,children:re.map(e=>t("button",{className:`${c.genreButton} ${c[k[e]||""]}`,onClick:()=>De(e),children:e},e))})]}),t("div",{className:c.filterActions,children:[t(W,{variant:"secondary",onClick:Ee,children:"Reset All"}),t(W,{onClick:()=>m(),className:c.applyBtn,children:"Apply Filters"})]})]})]}),t("div",{className:n.resultsHeader,ref:H,children:[t("h3",{className:n.resultsTitle,children:[i?"Continue Watching":d,t("span",{className:n.itemCount,children:["(",R," items)"]})]}),t("div",{className:n.headerActions,children:[t("button",{className:`${n.manageBtn} ${z?n.active:""}`,onClick:Ye,children:[t(g,{name:"pencil-alt",size:13}),t("span",{children:"Bulk Manage"})]}),R>0&&t(Le,{page:f,totalPages:ve,canGoNext:ge,onChange:he,isLoading:j})]})]}),z&&t("div",{className:n.manageBar,children:[t("button",{className:n.selectAllBtn,onClick:Ke,children:[t("span",{className:`${n.selectAllBox} ${ne?n.selectAllBoxChecked:""}`,"aria-hidden":"true"}),t("span",{children:ne?"Clear Page":"Select All"})]}),t("span",{className:n.manageCount,children:[p.size," selected"]}),t("div",{className:n.manageSpacer}),!i&&t("select",{className:n.manageStatusSelect,value:"",onChange:e=>{e.currentTarget.value&&Qe(e.currentTarget.value)},disabled:p.size===0,title:"Set status for selected items",children:[t("option",{value:"",children:"Set status…"}),Ce.map(e=>t("option",{value:e,children:e},e))]}),t("button",{className:n.manageRemoveBtn,onClick:Ve,disabled:p.size===0,children:[t(g,{name:"trash",size:13}),t("span",{children:"Remove Selected"})]})]}),j?t(pt,{}):ie?t(gt,{message:ie.message}):t(Xe,{children:[S.length>0&&t(vt,{chips:S}),t("div",{className:`${n.grid} ${Be?n.lowEnd:""}`,children:te.map(e=>{const a=p.has(e.id);return t("div",{className:`${n.itemWrapper} ${a?n.selected:""}`,children:[z&&t("div",{className:n.selectOverlay,onClick:()=>je(e.id),title:a?"Deselect":"Select",children:t("span",{className:n.selectBadge,children:a?t(g,{name:"check",size:12}):null})}),t(mt,{anime:e,continueWatching:i,onRemove:()=>ue(e.id,e.name),layout:"vertical"}),!i&&!z&&t("div",{className:n.cardActions,children:[t("select",{className:n.statusSelect,value:e.status,onChange:s=>Fe.mutate({id:e.id,status:s.currentTarget.value}),children:Ce.map(s=>t("option",{value:s,children:s},s))}),t("button",{className:n.removeBtn,onClick:()=>ue(e.id,e.name),title:"Remove from Watchlist","aria-label":"Remove from Watchlist",children:t(g,{name:"trash",size:12})})]})]},e._id)})})]}),!j&&te.length===0&&t("div",{className:n.emptyState,children:[t("h3",{className:n.emptyTitle,children:"Your watchlist is looking a bit lonely"}),t("p",{className:n.emptyText,children:d!=="All"||A||C!=="ALL"||N!=="ALL"||b!=="ALL"||Object.keys(k).length>0?"No anime match these filters. Try adjusting them to see more titles.":"Let's find something to watch!"}),t("button",{className:n.emptyBtn,onClick:()=>v("/search"),children:[t(g,{name:"search",size:14}),t("span",{children:"Browse Anime"})]})]}),R>0&&t("div",{className:n.bottomPagination,children:t(Le,{page:f,totalPages:ve,canGoNext:ge,onChange:he,isLoading:j,variant:"labeled"})}),t(se,{isOpen:!!o,onClose:me,title:i?"Reset Progress":"Remove from Watchlist",children:[t(se.Body,{children:[t("p",{children:o?.ids&&o.ids.length>1?i?`Are you sure you want to remove watch progress for ${o.ids.length} items?`:`Are you sure you want to remove ${o.ids.length} items from your watchlist?`:i?`Are you sure you want to remove your watch progress for "${o?.name}"?`:`Are you sure you want to remove "${o?.name}" from your watchlist?`}),i&&t("label",{children:[t("input",{type:"checkbox",checked:Z,onChange:e=>E(e.currentTarget.checked)}),"Also remove from my watchlist"]}),!i&&!(o?.ids&&o.ids.length>1)&&t("label",{children:[t("input",{type:"checkbox",checked:ce,onChange:e=>D(e.currentTarget.checked)}),"Remember my choice"]})]}),t(se.Actions,{children:[t(W,{variant:"secondary",onClick:me,children:"No"}),t(W,{variant:"danger",onClick:ze,children:"Yes"})]})]})]})};export{ca as default};
|
|
1
|
+
import{h as fe,o as He,a as Ze,p as Je,d as h,A as ye,T,u as t,S as Xe}from"./vendor-core-DfaOB3Rn.js";import{u as et,a as Se}from"./vendor-query-BBT5_sHx.js";import{l as tt,u as at,d as nt,C as st,D as _e,E as we,q as Ae,F as lt,t as rt,o as ct,G as it,H as ot,I as dt,J as ht,K as ut,B as W,L as se}from"./index-DYanm9eZ.js";import{I as g}from"./vendor-icons-DrybRNxP.js";import{A as mt}from"./AnimeCard-BURLDiUV.js";import{S as pt}from"./SkeletonGrid-nW7P1jQU.js";import{E as gt}from"./ErrorMessage-DAxegITP.js";import{P as Le}from"./MediaCard-l2gAJctz.js";import{s as n}from"./LibraryListPage.module-r6k9nyT9.js";import{A as vt}from"./ActiveFilterChips-olGfwxle.js";import"./useAnimeInfoData-DMeGA3wY.js";import"./QueueOptionsButton-BCxERY1G.js";import"./vendor-ui-3qrARCPr.js";import"./playbackCompletion-CxGa4g7a.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-LTZSG_Kx.js";const ft=(d,v)=>{const l=new URLSearchParams(v);return l.delete("page"),l.sort(),`${d}|${l.toString()}`},yt=(d,v)=>{const l=new Set(d);return v.forEach(w=>l.add(w)),l},St=(d,v)=>{const l=new Set(d);return v.forEach(w=>l.delete(w)),l},_t="_sortSelect_cahhw_1",wt="_filterContainer_cahhw_30",At="_slideUpIn_cahhw_1",Lt="_searchBarWrapper_cahhw_44",Ct="_inputIconWrapper_cahhw_50",Nt="_searchIcon_cahhw_55",bt="_searchInput_cahhw_64",Bt="_searchActions_cahhw_84",kt="_searchBtn_cahhw_89",Rt="_filterToggleBtn_cahhw_94",Tt="_advancedFilters_cahhw_115",Wt="_show_cahhw_122",It="_filterDivider_cahhw_128",xt="_filterGrid_cahhw_134",$t="_filterItem_cahhw_141",Pt="_genreSection_cahhw_183",Ft="_genreLabel_cahhw_189",Gt="_genreContainer_cahhw_199",Mt="_genreButton_cahhw_205",Ot="_include_cahhw_222",Et="_exclude_cahhw_228",Dt="_filterActions_cahhw_235",zt="_applyBtn_cahhw_246",c={sortSelect:_t,filterContainer:wt,slideUpIn:At,searchBarWrapper:Lt,inputIconWrapper:Ct,searchIcon:Nt,searchInput:bt,searchActions:Bt,searchBtn:kt,filterToggleBtn:Rt,advancedFilters:Tt,show:Wt,filterDivider:It,filterGrid:xt,filterItem:$t,genreSection:Pt,genreLabel:Ft,genreContainer:Gt,genreButton:Mt,include:Ot,exclude:Et,filterActions:Dt,applyBtn:zt},Ne=["All","Continue Watching","Watching","Completed","On-Hold","Dropped","Planned"],Ce=Ne.slice(2),Ut=[{value:"ALL",label:"All Types"},{value:"TV",label:"TV Series"},{value:"Movie",label:"Movie"},{value:"OVA",label:"OVA"},{value:"ONA",label:"ONA"},{value:"TV_SHORT",label:"TV Short"},{value:"SPECIAL",label:"Special"},{value:"ADULT",label:"Adult (18+)"}],qt=[{value:"ALL",label:"All Seasons"},{value:"WINTER",label:"Winter"},{value:"SPRING",label:"Spring"},{value:"SUMMER",label:"Summer"},{value:"FALL",label:"Fall"}],ca=()=>{fe(()=>{document.title="Watchlist - dango"},[]);const{filter:d="All"}=He(),v=Ze(),[l,w]=Je(),Q=et(),le=tt(),[f,I]=h(parseInt(l.get("page")||"1")),[A,x]=h(l.get("query")||""),[L,V]=h(l.get("sortBy")||"last_added"),[C,$]=h(l.get("type")||"ALL"),[N,P]=h(l.get("season")||"ALL"),[b,F]=h(l.get("year")||"ALL"),[k,G]=h(()=>{const e={},a=l.get("genres")?.split(",").map(r=>r.trim()).filter(Boolean)||[],s=l.get("excludeGenres")?.split(",").map(r=>r.trim()).filter(Boolean)||[];return a.forEach(r=>r&&(e[r]="include")),s.forEach(r=>r&&(e[r]="exclude")),e}),[M,be]=h(()=>["type","season","year","genres","excludeGenres"].some(e=>l.has(e))),{lowEndMode:Be}=at(),{titlePreference:O}=nt(),{data:ke}=st(),re=ke?.genres||[],H=ye(null),[o,B]=h(null),[Z,E]=h(!1),[ce,D]=h(!1),[z,Re]=h(!1),[p,y]=h(new Set),J=ye(null),i=d==="Continue Watching",U=T(()=>{const e=new URLSearchParams(l);return e.delete("page"),e.set("titlePreference",O),e.toString()},[l,O]),{data:q,isLoading:Te,error:We}=_e(U,f,14),{data:Y,isLoading:Ie,error:xe}=we(d,U,f,14),{data:$e}=_e(U,f+1,14),{data:Pe}=we(d,U,f+1,14),X=T(()=>(i?q?.data:Y?.data)||[],[i,q,Y]),R=T(()=>(i?q?.total:Y?.total)||0,[i,q,Y]),j=i?Te:Ie,ie=i?We:xe,oe=i?$e:Pe;fe(()=>{x(l.get("query")||""),V(l.get("sortBy")||"last_added"),$(l.get("type")||"ALL"),P(l.get("season")||"ALL"),F(l.get("year")||"ALL");const e={},a=l.get("genres")?.split(",").map(u=>u.trim()).filter(Boolean)||[],s=l.get("excludeGenres")?.split(",").map(u=>u.trim()).filter(Boolean)||[];a.forEach(u=>u&&(e[u]="include")),s.forEach(u=>u&&(e[u]="exclude")),G(e),I(parseInt(l.get("page")||"1"));const r=ft(d,l);J.current!==null&&J.current!==r&&y(new Set),J.current=r},[l,d]);const Fe=Se({mutationFn:async({id:e,status:a})=>{await rt.watchlist.setStatus.mutate({id:e,status:a})},onSuccess:()=>{Q.invalidateQueries({queryKey:[Ae.watchlist]}),lt.success("Status updated")}}),Ge=Se(le.continueWatching.remove.mutationOptions({onSuccess:()=>{Q.invalidateQueries(le.continueWatching.pathFilter()),Q.invalidateQueries({queryKey:[Ae.continueWatching]})}})),ee=ct(),{data:de}=it("skipRemoveConfirmation"),Me=ot(),te=T(()=>{const e=a=>a[O]||a.name||"";return[...X].sort((a,s)=>L==="name_asc"?e(a).localeCompare(e(s)):L==="name_desc"?e(s).localeCompare(e(a)):0)},[X,L,O]),ae=new Date().getFullYear(),Oe=[{value:"ALL",label:"All Years"},...Array.from({length:ae-1980+1},(e,a)=>({value:String(ae-a),label:String(ae-a)}))],m=(e=L,a=1)=>{const s=new URLSearchParams;A.trim()&&s.set("query",A.trim()),e!=="last_added"&&s.set("sortBy",e),C!=="ALL"&&s.set("type",C),N!=="ALL"&&s.set("season",N),b!=="ALL"&&s.set("year",b);const r=Object.entries(k).filter(([,_])=>_==="include").map(([_])=>_),u=Object.entries(k).filter(([,_])=>_==="exclude").map(([_])=>_);r.length>0&&s.set("genres",r.join(",")),u.length>0&&s.set("excludeGenres",u.join(",")),a>1&&s.set("page",a.toString()),w(s),a!==f&&I(a)},he=e=>{if(m(L,e),H.current){const a=H.current.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:a,behavior:"smooth"})}},Ee=()=>{x(""),V("last_added"),$("ALL"),P("ALL"),F("ALL"),G({}),w(new URLSearchParams),I(1)},De=e=>{G(a=>{const s=a[e],r={...a};return s==="include"?r[e]="exclude":s==="exclude"?delete r[e]:r[e]="include",r})},ue=(e,a)=>{if(i){B({id:e,name:a});return}String(de)==="true"||String(de)==="1"?ee.mutate({id:e}):B({id:e,name:a})},ze=()=>{if(o){if(o.ids){i?(Ue.mutate({ids:o.ids}),Z&&pe.mutate({ids:o.ids})):pe.mutate({ids:o.ids}),y(new Set),B(null),E(!1),D(!1);return}i?(Ge.mutate({showId:o.id}),Z&&ee.mutate({id:o.id})):ee.mutate({id:o.id}),ce&&Me.mutate({key:"skipRemoveConfirmation",value:!0}),B(null),E(!1),D(!1)}},me=()=>{B(null),E(!1),D(!1)},pe=dt(),Ue=ht(),qe=ut(),Ye=()=>{Re(e=>{const a=!e;return a||y(new Set),a})},je=e=>{y(a=>{const s=new Set(a);return s.has(e)?s.delete(e):s.add(e),s})},K=te.map(e=>e.id),ne=K.length>0&&K.every(e=>p.has(e)),Ke=()=>{y(ne?e=>St(e,K):e=>yt(e,K))},Qe=e=>{p.size!==0&&(qe.mutate({ids:[...p],status:e}),y(new Set))},Ve=()=>{p.size!==0&&B({ids:[...p]})},ge=X.length>=14&&oe&&oe.data.length>0,ve=T(()=>Math.max(1,Math.ceil(R/14)),[R]),S=[];A.trim()&&S.push({key:"query",label:`Search: ${A}`,onRemove:()=>{x(""),m()}}),C!=="ALL"&&S.push({key:"type",label:`Type: ${C}`,onRemove:()=>{$("ALL"),m()}}),N!=="ALL"&&S.push({key:"season",label:`Season: ${N}`,onRemove:()=>{P("ALL"),m()}}),b!=="ALL"&&S.push({key:"year",label:`Year: ${b}`,onRemove:()=>{F("ALL"),m()}});for(const[e,a]of Object.entries(k))S.push({key:e,label:a==="include"?`+ ${e}`:`-${e}`,tone:a==="include"?"primary":"danger",onRemove:()=>{G(s=>{const r={...s};return delete r[e],r}),m()}});return t("div",{className:"page-container",children:[t("header",{className:n.header,children:[t("h2",{className:n.title,children:"My Watchlist"}),t("p",{className:n.subtitle,children:"Track and manage your anime collection"})]}),t("div",{className:n.controls,children:[t("div",{className:n.filters,children:Ne.map(e=>t("button",{className:`${n.filterBtn} ${d===e?n.active:""}`,onClick:()=>{const a=new URLSearchParams(l);a.delete("page"),v({pathname:`/watchlist/${e}`,search:a.toString()}),I(1)},children:e},e))}),t("div",{children:t("select",{className:c.sortSelect,value:L,onChange:e=>{const a=e.currentTarget.value;V(a),m(a,f)},children:[t("option",{value:"last_added",children:"Recently Added"}),t("option",{value:"name_asc",children:"Name (A-Z)"}),t("option",{value:"name_desc",children:"Name (Z-A)"})]})})]}),t("div",{className:c.filterContainer,children:[t("div",{className:c.searchBarWrapper,children:[t("div",{className:c.inputIconWrapper,children:[t(g,{name:"search",className:c.searchIcon}),t("input",{className:c.searchInput,placeholder:"Search your watchlist by title...",value:A,onInput:e=>x(e.currentTarget.value),onKeyDown:e=>e.key==="Enter"&&m()})]}),t("div",{className:c.searchActions,children:[t(W,{onClick:()=>m(),className:c.searchBtn,children:"Search"}),t("button",{className:`${c.filterToggleBtn} ${M?n.active:""}`,onClick:()=>be(!M),children:[t(g,{name:"filter",size:14}),t("span",{children:"Filters"}),M?t(g,{name:"chevron-up",size:12}):t(g,{name:"chevron-down",size:12})]})]})]}),t("div",{className:`${c.advancedFilters} ${M?c.show:""}`,children:[t("div",{className:c.filterDivider}),t("div",{className:c.filterGrid,children:[t("div",{className:c.filterItem,children:[t("label",{children:"Type"}),t("select",{value:C,onChange:e=>$(e.currentTarget.value),children:Ut.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:c.filterItem,children:[t("label",{children:"Season"}),t("select",{value:N,onChange:e=>P(e.currentTarget.value),children:qt.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:c.filterItem,children:[t("label",{children:"Year"}),t("select",{value:b,onChange:e=>F(e.currentTarget.value),children:Oe.map(e=>t("option",{value:e.value,children:e.label},e.value))})]})]}),re.length>0&&t("div",{className:c.genreSection,children:[t("label",{className:c.genreLabel,children:"Genres"}),t("div",{className:c.genreContainer,children:re.map(e=>t("button",{className:`${c.genreButton} ${c[k[e]||""]}`,onClick:()=>De(e),children:e},e))})]}),t("div",{className:c.filterActions,children:[t(W,{variant:"secondary",onClick:Ee,children:"Reset All"}),t(W,{onClick:()=>m(),className:c.applyBtn,children:"Apply Filters"})]})]})]}),t("div",{className:n.resultsHeader,ref:H,children:[t("h3",{className:n.resultsTitle,children:[i?"Continue Watching":d,t("span",{className:n.itemCount,children:["(",R," items)"]})]}),t("div",{className:n.headerActions,children:[t("button",{className:`${n.manageBtn} ${z?n.active:""}`,onClick:Ye,children:[t(g,{name:"pencil-alt",size:13}),t("span",{children:"Bulk Manage"})]}),R>0&&t(Le,{page:f,totalPages:ve,canGoNext:ge,onChange:he,isLoading:j})]})]}),z&&t("div",{className:n.manageBar,children:[t("button",{className:n.selectAllBtn,onClick:Ke,children:[t("span",{className:`${n.selectAllBox} ${ne?n.selectAllBoxChecked:""}`,"aria-hidden":"true"}),t("span",{children:ne?"Clear Page":"Select All"})]}),t("span",{className:n.manageCount,children:[p.size," selected"]}),t("div",{className:n.manageSpacer}),!i&&t("select",{className:n.manageStatusSelect,value:"",onChange:e=>{e.currentTarget.value&&Qe(e.currentTarget.value)},disabled:p.size===0,title:"Set status for selected items",children:[t("option",{value:"",children:"Set status…"}),Ce.map(e=>t("option",{value:e,children:e},e))]}),t("button",{className:n.manageRemoveBtn,onClick:Ve,disabled:p.size===0,children:[t(g,{name:"trash",size:13}),t("span",{children:"Remove Selected"})]})]}),j?t(pt,{}):ie?t(gt,{message:ie.message}):t(Xe,{children:[S.length>0&&t(vt,{chips:S}),t("div",{className:`${n.grid} ${Be?n.lowEnd:""}`,children:te.map(e=>{const a=p.has(e.id);return t("div",{className:`${n.itemWrapper} ${a?n.selected:""}`,children:[z&&t("div",{className:n.selectOverlay,onClick:()=>je(e.id),title:a?"Deselect":"Select",children:t("span",{className:n.selectBadge,children:a?t(g,{name:"check",size:12}):null})}),t(mt,{anime:e,continueWatching:i,onRemove:()=>ue(e.id,e.name),layout:"vertical"}),!i&&!z&&t("div",{className:n.cardActions,children:[t("select",{className:n.statusSelect,value:e.status,onChange:s=>Fe.mutate({id:e.id,status:s.currentTarget.value}),children:Ce.map(s=>t("option",{value:s,children:s},s))}),t("button",{className:n.removeBtn,onClick:()=>ue(e.id,e.name),title:"Remove from Watchlist","aria-label":"Remove from Watchlist",children:t(g,{name:"trash",size:12})})]})]},e._id)})})]}),!j&&te.length===0&&t("div",{className:n.emptyState,children:[t("h3",{className:n.emptyTitle,children:"Your watchlist is looking a bit lonely"}),t("p",{className:n.emptyText,children:d!=="All"||A||C!=="ALL"||N!=="ALL"||b!=="ALL"||Object.keys(k).length>0?"No anime match these filters. Try adjusting them to see more titles.":"Let's find something to watch!"}),t("button",{className:n.emptyBtn,onClick:()=>v("/search"),children:[t(g,{name:"search",size:14}),t("span",{children:"Browse Anime"})]})]}),R>0&&t("div",{className:n.bottomPagination,children:t(Le,{page:f,totalPages:ve,canGoNext:ge,onChange:he,isLoading:j,variant:"labeled"})}),t(se,{isOpen:!!o,onClose:me,title:i?"Reset Progress":"Remove from Watchlist",children:[t(se.Body,{children:[t("p",{children:o?.ids&&o.ids.length>1?i?`Are you sure you want to remove watch progress for ${o.ids.length} items?`:`Are you sure you want to remove ${o.ids.length} items from your watchlist?`:i?`Are you sure you want to remove your watch progress for "${o?.name}"?`:`Are you sure you want to remove "${o?.name}" from your watchlist?`}),i&&t("label",{children:[t("input",{type:"checkbox",checked:Z,onChange:e=>E(e.currentTarget.checked)}),"Also remove from my watchlist"]}),!i&&!(o?.ids&&o.ids.length>1)&&t("label",{children:[t("input",{type:"checkbox",checked:ce,onChange:e=>D(e.currentTarget.checked)}),"Remember my choice"]})]}),t(se.Actions,{children:[t(W,{variant:"secondary",onClick:me,children:"No"}),t(W,{variant:"danger",onClick:ze,children:"Yes"})]})]})]})};export{ca as default};
|