1import{h as e,as as a,e as s,j as t,a7 as l,i as n,H as i,ag as r,a as o,aL as u,al as c,ae as d,Z as v,aW as h,b as p,af as g,$ as m,f as b,J as y,I as f,b5 as k,o as w,aw as _,aC as C}from"./BFOZ3Oa7.js";import{u as $}from"./CVEp_oFO.js";const P={class:"search-input-container"},x={class:"visually-hidden"},j={class:"input-container",style:{position:"relative"}},D={class:"input-group"},L={class:"visually-hidden",for:"search-word"},S=["placeholder"],T={class:"visually-hidden"},O={class:"visually-hidden"},q={key:0,style:{position:"absolute",top:"100%","z-index":"1000",width:"100%",margin:"0px",padding:"20px","justify-content":"space-between"},class:"search-term-list"},I={key:0,class:"d-grid gap-2"},V={key:1,class:"d-grid gap-2"},F={key:0,class:"nav search-term-list"},H=e({inheritAttrs:!1,__name:"T3CeQ3ivdeshopSearchbar",props:{header:{},headerLayout:{},headerPosition:{},headerLink:{},subheader:{},uid:{},index:{},appearance:{},data:{}},setup(e){const C=e,{$fetch:H}=a(),N=s(()=>C.data?.settings?.actionPage||""),Q=s(()=>1===C.data?.settings?.autosuggestion),z=s(()=>parseInt(C.data?.settings?.autosuggestionlength.toString()||"3",10)),A=s(()=>C.data?.settings?.termlist||[]),J=t(""),U=t([]),W=t([]),Z=s(()=>U.value.slice(0,6)),B=s(()=>W.value.slice(0,6));let E;const G=t(!1),K=t(!1);l(J,e=>
1{if(K.value)return;if(clearTimeout(E),!Q.value||e.length<z.value)return U.value=[],void(W.value=[]);const a={query:J.value||""};E=setTimeout(async()=>{try{G.value=!0;const e=await H("/api/v1/shopware/suggest",{method:"POST",credentials:"include",body:a});U.value=e?.Fachwissen.elements||[],W.value=e?.Normen.elements||[]}catch(e){U.value=[],W.value=[]}finally{G.value=!1}},300)});const M=n(),{closeHeaderDropdown:R}=$(),X=async()=>{U.value=[],W.value=[],K.value=!0;try{await M.push({path:N.value,query:{q:J.value}})}finally{K.value=!1,R()}},Y=e=>{J.value=e.name||"",U.value=[],W.value=[],e?.urlLowestOrderVariantDetailProduct?M.push(e.urlLowestOrderVariantDetailProduct):e?.urlDetailProduct?M.push(e.urlDetailProduct):X()},ee=()=>{U.value=[],W.value=[],J.value=""};return(e,a)=>{const s=k;return w(),i(y,null,[r("div",P,[r("form",{class:"content-form search-form",onSubmit:u(X,["prevent"])},[r("fieldset",null,[r("legend",x,c(e.$t("search.legend")),1),r("div",j,[r("div",D,[r("label",L,c(e.$t("search.label")),1),v(r("input",{id:"search-word","onUpdate:modelValue":a[0]||(a[0]=e=>g(J)?J.value=e:null),type:"text",name:"search-word",class:"form-control form-lg search-word",placeholder:e.$t("search.placeholder"),autocomplete:"off"},null,8,S),[[h,p(J)]]),v(d(s,{type:"button",class:"btn btn-close btn-close-suggest","aria-label":e.$t("close"),onClick:u(ee,["prevent"])},{default:b(()=>[r("span",T,c(e.$t("close")),1)]),_:1},8,["aria-label"]),[[m,p(J).length>0]])]),d(s,{type:"submit",loading:p(G)||p(K),"loading-fill":"",class:"btn-search-submit"},{default:b(()=>[r("span",O,c(e.$t("search.start")),1)]),_:1},8,["loading"]),p(Z).length>0||p(B).length>0?(w(),i("div",q,[p(B).length>0?(w(),i("div",I,[a[1]||(a[1]=r("div",{class:"search-term-list-title"},"Normen",-1)),(w(!0),i(y,null,f(p(B),(e,a)=>(w(),i("div",{key:`response-suggest-${a}`},[d(s,{class:"btn btn-md btn-link",variant:"link",onClick:a=>Y(e)},{default:b(()=>[_(c(e.name),1)]),_:2},1032,["onClick"])]))),128))])):o("",!0),p(Z).length>0?(w(),i("div",V,[a[2]||(a[2]=r("div",{class:"search-term-list-title"},"Fachwissen",-1)),(w(!0),i(y,null,f(p(Z),(e,a)=>(w(),i("div",{key:`response-suggest-${a}`},[d(s,{class:"btn btn-md btn-link",variant:"link",onClick:a=>Y(e)},{default:b(()=>[_(c(e.name),1)]),_:2},1032,["onClick"])]))),128))])):o("",!0)])):o("",!0)])])],32)]),p(A)&&p(A).length>0?(w(),i("ul",F,[(w(!0),i(y,null,f(p(A),(e,a)=>(w(),i("li",{key:a,class:"nav-item"},[d(s,{class:"btn-transparent",onClick:a=>Y(e)},{default:b(()=>[_(c(e.name),1)]),_:2},1032,["onClick"])]))),128))])):o("",!0)],64)}}}),N=Object.assign(C(H,[["__scopeId","data-v-ed365007"]]),{__name:"T3CeQ3ivdeshopSearchbar"});export{N 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.