import{z as s,E as e,r as a}from"./vendor-s2rfM_Vj.js";import"./apis-DdFSvwR4.js";import{a as o}from"./constant-Dkm_Y9q1.js";import{A as n,c as r,i as l,C as i,f as c}from"./newtab-BWIjnu6l.js";import{D as t,I as d}from"./t-r-vendor-gn7FMrPE.js";import"./index-Bf7N7lFc.js";const p=e("div")({name:"WrapUI",class:"w14jv38w",propsAsIs:!1}),m=e("div")({name:"ContentUI",class:"c27dun6",propsAsIs:!1,vars:{"c27dun6-0":[s=>s.backgroundcolor]}}),h=e("h3")({name:"TitleUI",class:"t4xojb0",propsAsIs:!1}),u=e("div")({name:"LinkUI",class:"l124zwpp",propsAsIs:!1}),j=({icon:e,background:a,name:o="",id:r,handleComponentClick:l})=>s.jsxs(p,{children:[s.jsx(m,{backgroundcolor:a||"transparent",children:s.jsx(u,{onClick:()=>{l(r,o)},children:e?s.jsx("i",{className:e,style:{fontSize:56}}):s.jsx(n,{text:o,bg:a,size:"100%"})})}),s.jsx(h,{children:o})]}),v=e("div")({name:"WrapUI",class:"wjspktr",propsAsIs:!1}),x=e("div")({name:"ContentUI",class:"cbfjmle",propsAsIs:!1,vars:{"cbfjmle-0":[s=>s.backgroundcolor]}}),b=e("h3")({name:"TitleUI",class:"tkzpgms",propsAsIs:!1}),g=e("div")({name:"LinkUI",class:"l15um38z",propsAsIs:!1}),I=({url:e,icon:a,background:o,name:r=""})=>s.jsxs(v,{children:[s.jsx(x,{backgroundcolor:o||"transparent",children:s.jsx(g,{onClick:()=>{window.open(e,"_blank")},children:a?s.jsx("img",{loading:"lazy",fetchPriority:"low",decoding:"async",src:a,alt:r}):s.jsx(n,{text:r,bg:o,size:"100%"})})}),s.jsx(b,{children:r})]}),f=e("div")({name:"WrapUI",class:"wgkbgn6",propsAsIs:!1}),k=e("div")({name:"InputWrapUI",class:"i17imcub",propsAsIs:!1,vars:{"i17imcub-0":[({focus:s})=>s?"0 16px":"0 30%"]}}),w=e("div")({name:"AppsUI",class:"a1dhcnms",propsAsIs:!1}),A="_local-search-dialog_5ke6a_1",C=({visible:e,handleVisible:n})=>{const{allApps:p,navigationInfo:m,setCurrentNavId:h}=r(),[u,v]=a.useState(""),[x,b]=a.useState(!1),g=a.useMemo((()=>p.filter((s=>{const e=!l(s)||l(s)&&i.get(s.id);return!(!e||u)||s.name.includes(u)&&e}))),[u,p]),{handleMessage:C}=c(),U=(s,e)=>{n(!1);for(let a=0;a<m.length;a++){const o=m[a];if(o.apps.some((e=>e.id===s))){h(o.id),C.success(`应用【${e}】位于导航【${o.name}】下，已为您切换至【${o.name}】`,1e3);break}}};return s.jsx(t,{className:A,style:{padding:0,height:480,overflow:"visible",backgroundColor:"var(--theme-black7)",backdropFilter:"url(#ovo-filter) brightness(1.1)",boxShadow:"var(--shadow-elevation-medium)"},width:"var(--local-search-dialog-width)",closeOnOverlayClick:!0,visible:e,mode:"modal",onClose:()=>n(!1),preventScrollThrough:!0,showOverlay:!0,theme:"default",footer:!1,header:!1,closeBtn:!1,children:s.jsxs(f,{children:[s.jsx(k,{focus:x?1:0,children:s.jsx(d,{autofocus:!0,clearable:!0,prefixIcon:s.jsx("i",{className:"ovo search"}),onFocus:()=>b(!0),onBlur:()=>b(!1),onChange:s=>v(s),placeholder:"搜索应用 OVO"})}),s.jsx(w,{children:g.map((e=>s.jsxs(s.Fragment,{children:[e.type===o.website&&s.jsx(I,{...e},e.id),e.type===o.component&&s.jsx(j,{...e,handleComponentClick:U},e.id)]})))})]})})};export{C as default};
