import{N as z,aW as O,fj as H,y as M,l as B,B as m,Q as P,aP as L,o as n,c,a as o,V as T,X as r,a1 as N,a0 as v,Y as C,Z as I,_ as R,a3 as U,ak as D,d3 as W,fl as Y,cN as $,ae as j,ab as Q,S as X,a7 as Z,a8 as q,ad as J}from"./index.2e2ba873.js";import{D as E,b as K,i as x,g as ee,P as te}from"./DownloadItem.8dd8afed.js";import{P as se}from"./playAll.e0426393.js";import{k as oe}from"./App.4a38a252.js";import{_ as ae}from"./plugin-vue_export-helper.21dcd24c.js";import"./MoreFeedback.7a64cae1.js";import"./style.488e5a30.js";import"./index.f1458219.js";import"./modulepreload-polyfill.b7f2da20.js";import"./ico_max_exit.795e9ef8.js";import"./index.36d4c5c3.js";import"./isUdf.1a76b9f4.js";import"./btn_devtools.210a42a8.js";import"./ico_pin.548219aa.js";/* empty css               */import"./theme-map.83df99de.js";import"./index.53c6cc19.js";const _=g=>(Z("data-v-5235d7e5"),g=g(),q(),g),le={class:"download-collection i_page_content page_scroller i_wrapper"},ne={class:"header mt_xxl"},re={class:"cover"},ce=_(()=>o("div",{class:"collection"},null,-1)),ie=_(()=>o("div",{class:"cover-bg"},null,-1)),ue=["src","onload"],de={key:1,class:"badge"},_e=_(()=>o("div",{class:"tapper"},null,-1)),pe=["textContent"],me={class:"info"},ve=["textContent"],ge=["textContent"],fe=_(()=>o("span",null,"\u64AD\u653E\u5168\u90E8",-1)),be=_(()=>o("span",{class:"gamepad-cursor"},null,-1)),he={class:"content"},ye={key:0},Pe={class:"tabs"},Ce=["onClick"],Ie=_(()=>o("span",{class:"gamepad-cursor","data-tp":"subTab"},null,-1)),xe={class:"row gutter_md"},ke={key:1,class:"row gutter_md"},we=z({__name:"DownloadCollection",setup(g){oe(".download-collection");const A=O(),b=H(),{openedGroup:a}=M(b),k=J(),h=B(""),p=B(0),V=m(()=>K(a.value)),y=m(()=>{var t,s,l;const e=(s=(t=a.value)==null?void 0:t.itemList)==null?void 0:s[0];switch((l=a.value)==null?void 0:l.type){case"ogv":return"ogv";default:return x(e)?"ugc-season":(e==null?void 0:e.bvid)===(e==null?void 0:e.groupId)?"ugc-pages":"ugc-season"}}),F=m(()=>{var e,t;return y.value==="ogv"?"":"\u5408\u96C6 "+((e=a.value)!=null&&e.uname?"\xB7 UP\u4E3B\uFF1A"+((t=a.value)==null?void 0:t.uname):"")}),w=m(()=>{var t,s;const e=(s=(t=a.value)==null?void 0:t.itemList)==null?void 0:s[0];return y.value==="ogv"&&!x(e)?W[e.seasonType]:""}),f=m(()=>{var e;return(((e=a.value)==null?void 0:e.itemList)||[]).reduce((t,s)=>{if(x(s)){let l=t.find(d=>d.tabP===s.epInfo.tabP);l?l.itemList.push(s):t.push({tabP:s.epInfo.tabP,tabName:s.epInfo.tabName,itemList:[s]})}else{let l=t.find(d=>d.tabP===s.tabP);l?l.itemList.push(s):t.push({tabP:s.tabP,tabName:s.tabName,itemList:[s]})}return t},[])}),S=async()=>{var e,t;h.value=await Y((e=a.value)==null?void 0:e.coverImg,$(j(((t=a.value)==null?void 0:t.coverUrl)||"",320*k,180*k)))},G=()=>{let e=ee(a.value);Q({type:e.type||"ugc",fromSpmid:X.mineDownload+".pv",mediaList:{bizType:-1,bizId:e.itemId,bizTitle:"\u79BB\u7EBF\u7F13\u5B58"}})};return P([p,f,a],()=>A.flashPageCursors(200)),S(),P(a,S),P(f,(e,t)=>{e.length<t.length&&(p.value=0)}),L("download/itemListEvent",({data:e})=>{b.refreshOpenedGroupList()}),L("download/statusChange",({data:e})=>{e.status==="completed"&&b.refreshOpenedGroupList()}),(e,t)=>{var s,l,d;return n(),c("div",le,[o("div",ne,[o("div",re,[ce,ie,T(r(te),{class:"cover-ph"}),h.value?(n(),c("img",{key:0,class:"cover-img",src:h.value,loading:"lazy",onload:i=>i.target.style.backgroundColor="transparent",onerror:"this.remove()"},null,8,ue)):N("",!0),r(w)?(n(),c("div",de,v(r(w)),1)):N("",!0),_e,o("div",{class:"collection-count",textContent:v(`${r(V)}\u4E2A\u5185\u5BB9`)},null,8,pe)]),o("div",me,[o("div",{class:"title",textContent:v((s=r(a))==null?void 0:s.title)},null,8,ve),o("div",{class:"sub-title",textContent:v(r(F))},null,8,ge),o("div",{class:"play-all p_relative",onClick:G},[T(r(se)),fe,be])])]),o("div",he,[["ogv","ugc-season"].includes(r(y))?(n(),c("div",ye,[o("ul",Pe,[(n(!0),c(C,null,I(r(f),(i,u)=>(n(),c("li",{class:R(["p_relative",{active:p.value===u}]),key:u,onClick:Se=>p.value=u},[U(v(i.tabName)+" ",1),Ie],10,Ce))),128))]),o("div",xe,[(n(!0),c(C,null,I(((l=r(f)[p.value])==null?void 0:l.itemList)||[],(i,u)=>(n(),D(E,{key:u,item:i,class:"col_3 col_sm_1_5 mb_md al-flex-end","is-first-card":u===0},null,8,["item","is-first-card"]))),128))])])):(n(),c("div",ke,[(n(!0),c(C,null,I(((d=r(a))==null?void 0:d.itemList)||[],(i,u)=>(n(),D(E,{key:i.itemId,item:i,class:"col_3 col_sm_1_5 mb_md al-flex-end","is-first-card":u===0},null,8,["item","is-first-card"]))),128))]))])])}}});var Ye=ae(we,[["__scopeId","data-v-5235d7e5"]]);export{Ye as default};
