import{a as d,aC as y,r as R,aH as T,_ as k,aj as n,c as I,o as Q,S as l,K as u,b as B,P as b,Q as H,t as N}from"./vue.D1BjjNmv.js";import{b as O,v as j}from"./index.CL7yl-Wb.js";import{_ as A}from"./_plugin-vue_export-helper.DlAUqK2U.js";const M={class:"layout-search-dialog"},P=d({name:"layoutBreadcrumbSearch"}),U=d({...P,setup($,{expose:f}){const _=O(),{tagsViewRoutes:h}=y(_),m=R(),{t:w}=j.useI18n(),p=T(),t=k({isShowSearch:!1,menuQuery:"",tagsViewList:[]}),S=()=>{t.menuQuery="",t.isShowSearch=!0,v(),N(()=>{setTimeout(()=>{m.value.focus()})})},V=()=>{t.isShowSearch=!1},g=(e,o)=>{let s=e?t.tagsViewList.filter(L(e)):t.tagsViewList;o(s)},L=e=>o=>o.path.toLowerCase().indexOf(e.toLowerCase())>-1||o.meta.title.toLowerCase().indexOf(e.toLowerCase())>-1||w(o.meta.title).indexOf(e.toLowerCase())>-1,v=()=>{if(t.tagsViewList.length>0)return!1;h.value.map(e=>{var o;(o=e.meta)!=null&&o.isHide||t.tagsViewList.push({...e})})},x=e=>{var c,r,i;let{path:o,redirect:s}=e;(c=e.meta)!=null&&c.isLink&&!((r=e.meta)!=null&&r.isIframe)?window.open((i=e.meta)==null?void 0:i.isLink):s?p.push(s):p.push(o),V()};return f({openSearch:S}),(e,o)=>{const s=n("ele-Search"),c=n("el-icon"),r=n("SvgIcon"),i=n("el-autocomplete"),C=n("el-dialog");return Q(),I("div",M,[l(C,{modelValue:t.isShowSearch,"onUpdate:modelValue":o[1]||(o[1]=a=>t.isShowSearch=a),"destroy-on-close":"","show-close":!1},{footer:u(()=>[l(i,{modelValue:t.menuQuery,"onUpdate:modelValue":o[0]||(o[0]=a=>t.menuQuery=a),"fetch-suggestions":g,placeholder:e.$t("message.user.searchPlaceholder"),ref_key:"layoutMenuAutocompleteRef",ref:m,onSelect:x,"fit-input-width":!0},{prefix:u(()=>[l(c,{class:"el-input__icon"},{default:u(()=>[l(s)]),_:1})]),default:u(({item:a})=>[B("div",null,[l(r,{name:a.meta.icon,class:"mr5"},null,8,["name"]),b(" "+H(e.$t(a.meta.title)),1)])]),_:1},8,["modelValue","placeholder"])]),_:1},8,["modelValue"])])}}}),K=A(U,[["__scopeId","data-v-a11c6061"]]);export{K as default};
