import{aJ as L,U as k,b as O}from"./vendor-ui-CGT0cG1n.js";import{m as s,B as T,u,i as R}from"./index-D88CvPWT.js";import{c as b,a as I}from"./index.vue_vue_type_script_setup_true_lang-CmmAEEXC.js";import{v as S,aA as P,y as x,aC as A,aD as M,ac as d,aF as B,a9 as D,aP as K,ax as n,ab as N,l as F,r as c,aO as f,af as Y,g as l,ao as U,Y as V}from"./vendor-core-BKehvho7.js";import{u as $}from"./useKeyword-CjhhChz4.js";import"./index-B9hCLAJk.js";import"./useCompMetaLocalStore-BKTMp_k8.js";import"./useCacheOssStore-OAoLDVbw.js";import"./useVscodeOpen-BBdyQ3W2.js";import"./useTeamHeaders-DxHN7-t0.js";/* empty css                */import"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import"./useMessage-Cbhfk7Nk.js";const z={class:"size-full p-[10px] pr-0"},ne=S({__name:"index",setup(H){const{t:p}=P(),_=x()?.uid,C=A(),w=M(),o=b(C.path)();d(s.PROVIDE_KEY_COMP_LIST_STORE,o);const m=new Map;d(s.PROVIDE_KEY_CALLBACKS,m);const y=B("compIframeContainer"),i=Y({data:[],search:{column:[{prop:"keyword",component:U(O),label:l(()=>p("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:l(()=>p("comp.keywordPlaceholder")),fetchSuggestions:g,triggerOnFocus:!1,style:"width: 400px",fitInputWidth:!0}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:E}),h=l(()=>i.value?.search?.column[0]?.value??"");$(h,y);function g(e,t){if(e.length<=1)return t([]);u.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:e,type:"compMyCollect"}).then(a=>{const{keywords:r=[]}=a.data||{};t(r)})}async function E(e){o.renderList([]),await V(),o.setLoading(!0),e.keyword&&window?.umami?.track(R.SEARCH_COMPONENT,{keyword:e.keyword,page:"collect"});const t=await u.v1Comp.compcontrollerCollectedcomps(e),{rows:a,total:r}=t.data??{};o.renderList(a??[]),i.value.pagination.total=r??0}function v(e){w.push({path:`/preview/${e}`})}return m.set(s.COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT,e=>{o.delCompListById(e)}),D(()=>{o.$reset()}),(e,t)=>{const a=k,r=L;return K((N(),F("div",z,[c(n(T),{tableConfig:i.value},{table:f(()=>[c(a,{always:"",wrapClass:"pr-[10px]"},{default:f(()=>[c(I,{ref:"compIframeContainer",iuid:n(_),compType:n(s).IFRAME_ROUTES.CONTAINER.COLLECT,onPreview:v},null,8,["iuid","compType"])]),_:1})]),_:1},8,["tableConfig"])])),[[r,n(o).loading]])}}});export{ne as default};
