1import{a5 as te,i as N,am as se,dI as z,a1 as O,_ as U,Y as le,o as oe,aA as ie,S as R,c4 as T,c5 as ne,aP as re,aQ as ce,c7 as V,c8 as q,dJ as ue,d7 as de,W as ve}from"./CkuPa5Yr.js";import{H as fe}from"./HomeSkeleton-DwRBWDiD.js";import{d as W,r,w as G,n as D,o as K,a as X,y as x,z as g,A as k,J as pe,L as _,D as e,F as me,C as ke,E as Y,M as F,f as y,c as ge,i as he,B as H,N as _e,a5 as ye,R as J}from"./chunk-vue-TRwxe8i9.js";import{s as Q}from"./chunk-pinia-DfnRCC0j.js";import{T as we}from"./TaskAreaNew-CQkn4rF1.js";import{u as be}from"./chunk-i18n-CEBPY5W3.js";import"./chunk-alioss-Co3x7qJ6.js";import"./chunk-fabric-NyCWrAO1.js";import"./mvAgentAudioHandoff-bUl2GcuQ.js";import"./TaskVideoResultItem-C9CmcKHY.js";import"./agentRefinePlan-CRI8LK4C.js";import"./agentConfig-DEjPhl-I.js";import"./TaskRefineWithAgentBtn-BMak6Spj.js";import"./AddToCharacterAction-CbhiyPXF.js";const xe={class:"w-full relative"},Le={class:"flex gap-4"},Te=["onClick"],Se={key:0,class:"w-[72px] h-[28px] absolute right-0 top-0 bg-[--color-background-base] flex justify-end gap-2"},Ce=W({__name:"TaskSelector",props:{isLoading:{type:Boolean}},emits:["selectChange"],setup(P,{emit:u}){const o=P,{query:v}=te(),p=N(),w=se(),i=r(z[0]?.value),L=u,l=r(null),h=r(null),n=r(!1);function $(t){o.isLoading||t===i.value||(i.value=t,L("selectChange",t))}const C=t=>{h.value&&t&&(h.value.style.width=`${t.offsetWidth}px`,h.value.style.transform=`translateX(${t.offsetLeft}px)`)},f=t=>{if(!l.value)return;const s=t==="right"?200:-200;if(l.value.scrollLeft<=0&&s<0){l.value.scrollLeft=0;return}if(l.value.scrollLeft>=l.value.scrollWidth-l.value.clientWidth&&s>0){l.value.scrollLeft=l.value.scrollWidth-l.value.clientWidth;return}l.value.scrollBy({left:s,behavior:"smooth"})};G(i,()=>{D(()=>{const t=document?.querySelector(".active-tab");t&&C(t)})},{immediate:!0});const b=()=>{l.value&&(n.value=l.value.scrollWidth>l.value.clientWidth)};return K(()=>{b();const t=v.value.tab;if(t){const s=z.find(d=>d.value===t);s&&(i.value=s.value,L("selectChange",i.value))}else i.value=z[0]?.value,L("selectChange",i.value);D(()=>{const s=document.querySelector(".active-tab");s&&s.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}),window.addEventListener("resize",b)}),X(()=>{window.removeEventListener("resize",b)}),(t,s)=>(g(),x("div",xe,[k("div",{ref_key:"tabsContainer",ref:l,class:_(["w-full h-[28px] relative overflow-x-auto overflow-y-hidden no-scrollbar mt-4",{"h-[28px]":!e(p),"h-[32px]":e(N)}])},[k("div",Le,[(g(!0),x(me,null,ke(e(z),d=>(g(),x("div",{key:d.value,class:_(["text-task-select-item",{"text-[--color-text-dynamic-white-tertiary]":e(i)!==d.value,"text-[--color-text-dynamic-white-primary] active-tab":e(i)===d.value,"cursor-not-allowed":o.isLoading,"cursor-pointer":!o.isLoading}]),onClick:S=>$(d.value)},Y(t.$t(d.name)),11,Te))),128)),s[2]||(s[2]=k("div",{class:"h-[28px] min-w-[72px]"},null,-1))]),k("div",{ref_key:"tabSlider",ref:h,class:_(["tab-slider absolute bottom-1 left-0",{"tab-slider-dark":e(w),"tab-slider-light":!e(w)}])},null,2)],2),e(n)?(g(),x("div",Se,[k("div",{class:"arrow-tab select-none",onClick:s[0]||(s[0]=F(d=>f("left"),["stop"]))},[y(e(O),{name:"ai-video-generator/arrow_tab",width:"24",height:"24",class:"inner-icon"})]),k("div",{class:"arrow-tab select-none",onClick:s[1]||(s[1]=F(d=>f("right"),["stop"]))},[y(e(O),{name:"ai-video-generator/arrow_tab",width:"24",height:"24",class:"rotate-180 inner-icon"})])])):pe("",!0)]))}}),ze=Object.assign(U(Ce,[["__scopeId","data-v-be811533"]]),{__name:"TaskLibraryTaskSelector"}),Ie={class:"flex flex-col gap-[.5rem]"},Pe={class:"tip"},I=8,$e=W({__name:"Library",setup(P){le();const u=r([]),o=r({page:1,total:0,page_size:I}),v=r(0),p=r(1),w=r(!1),i=r(!1),L=r({}),{locale:l}=be(),h=ge(()=>["zh","jp","ko"].some(a=>l.value.startsWith(a))),n=N(),{isLogin:$}=Q(oe()),{taskTotalCount:C}=Q(ie()),f=r(R.all),b=r(null),t=he("toggle-popover-control",{});ye("updateLikeOrNotInfo",({taskId:a,likeOrNot:c,likeOrNotTags:m,description:A,imgsFeedback:ee})=>{const E=u.value.find(ae=>ae.task_id===a);E&&Object.assign(E,{user_data:{...E.user_data,likeOrNotInfo:{likeOrNot:c,likeOrNotTags:m,description:A,imgsFeedback:ee}}})});async function s(a,c=[R.all]){w.value=a??!0;const m=await V({pageSize:I,taskCategories:c,isLibrary:!0});w.value=!1,u.value=m?.list,m?.paginate!=null?(o.value=m?.paginate,C.value=m?.paginate?.total,o.value.total>0?v.value=o.value.total%o.value.page_size===0?o.value.total/o.value.page_size:Math.ceil(o.value.total/o.value.page_size):v.value=0):(v.value=0,C.value=0),L.value[p.value]=!0,q({taskType:[f.value],taskList:u.value,isLibrary:!0}),b.value!=null&&b.value?.checkContentHeight()}async function d(){if(p.value>v.value)return;p.value+=1,i.value=!0;const a=await V({taskCategories:[f.value],pageNumber:p.value,pageSize:I,isLibrary:!0});i.value=!1,a.list.length>0&&(u.value=[...u.value,...a.list]),L.value[p.value]=!0}async function S(a){p.value=1,o.value={page:1,total:0,page_size:I},i.value=!0,await s(a,[f.value]),i.value=!1}async function Z(a){f.value=a,await S(!0)}async function j(a){const c=a.detail;if(c?.taskResult!=null&&c?.taskId!==""){const m=u.value.find(A=>A.task_id===c.taskId);m!=null&&Object.assign(m,c.taskResult)}}async function M(a){const c=a.detail;c?.taskId!=null&&c?.taskId!==""&&(await S(!1),q({taskType:[f.value],taskList:u.value,isLibrary:!0}))}async function B(){await S(!1),ue()}return K(()=>{window.addEventListener(T.delTask,B),window.addEventListener(T.updateTask,j),window.addEventListener(T.addTask,M),t?.close?.()}),X(()=>{window.removeEventListener(T.delTask,B),window.removeEventListener(T.updateTask,j),window.removeEventListener(T.addTask,M),ne()}),G(()=>$.value,a=>{a&&S(!1)}),(a,c)=>(g(),x("section",{class:_(["w-full h-full flex flex-col",e(n)?"p-[0.5rem]":"overflow-hidden"])},[k("div",{class:_(["w-full",{"mt-2 px-6 mb-4":!e(n),"fixed left-0 bg-[--color-background-base] z-[100] px-4":e(n)}]),style:_e({top:e(n)?`calc(var(--layout-header-height,57px) + ${e(h)?43:49}px)`:void 0})},[k("div",Ie,[k("div",Pe,Y(a.$t("asset.save_time_tips")),1)]),y(ze,{"is-loading":i.value||w.value,onSelectChange:Z},null,8,["is-loading"])],6),w.value?(g(),x("div",{key:0,class:_(["flex w-full h-full justify-center items-center",{"mt-[106px]":e(n),"!mt-[100px]":e(n)&&e(h)}])},[y(e(re),{class:"w-full h-full flex justify-center items-center"})],2)):v.value>0?(g(),H(we,{key:1,ref_key:"taskAreaRef",ref:b,class:_({"mt-[106px]":e(n),"!pt-0":!e(n),"!mt-[100px]":e(n)&&e(h)}),"layout-is-full":!1,"task-list":u.value,paginate:{totalPage:v.value,currentPage:p.value,total:o.value.total},"task-category":f.value,"show-title":!1,"card-size":"normal","title-key":"menu_Libraries","is-txt-to-img-list-show":!1,onLoadMore:d},null,8,["class","task-list","paginate","task-category"])):(g(),H(ce,{key:2,"has-bg":!1,"show-title":!1,type:f.value,class:_(e(n)?"!mt-16":"")},null,8,["type","class"]))],2))}}),Ae=Object.assign(U($e,[["__scopeId","data-v-2c2830b3"]]),{__name:"TaskLibrary"}),Ee={class:"w-full h-full flex flex-col"},Ue=W({__name:"index",setup(P){return(u,o)=>{const v=ve;return g(),x("div",Ee,[y(de),y(v,null,{fallback:J(()=>[y(fe)]),default:J(()=>[y(Ae)]),_:1})])}}});
1export{Ue as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.