1import{_ as R}from"./D34e-F7J.js";import{o as t,d as s,j as c,p,a0 as u,c as o,aB as S,F as y,g as b,b as _,w as k,a as x,t as g,f as n,z as m}from"./j9eeThX6.js";import{c as K,d as A}from"./DEDF2X20.js";import{u as P}from"./DmQev-jw.js";import{u as T}from"./C7PVeIDF.js";import{u as V}from"./CgFyd5Ic.js";import{r as H,A as q,o as G,h as M,u as O}from"./BcJ5BBtZ.js";const U={class:"relative w-full z-50"},J={class:"relative w-full"},Q=["value","onInput","onKeyup"],W=["onClick"],X={key:0,class:"absolute top-full left-0 right-0 mt-3 bg-white rounded-xl shadow-2xl border border-gray-100 overflow-hidden z-[100] max-h-[600px] overflow-y-auto py-2"},Y={key:0,class:"px-4 pt-2 pb-3 border-b border-gray-100/70"},Z={class:"flex flex-wrap gap-2"},ee={key:1,class:"px-4 pt-3 pb-2"},te={class:"flex flex-wrap gap-2"},oe={key:1,class:"py-8 flex justify-center"},re={key:1,class:"absolute top-full left-0 right-0 mt-3 bg-white rounded-xl shadow-2xl border border-gray-100 overflow-hidden z-[100] max-h-[800px] flex flex-col"},se={key:0,class:"overflow-y-auto max-h-[780px] py-2"},ae={class:"w-12 h-12 rounded-md overflow-hidden bg-white shrink-0 border border-gray-100 flex items-center justify-center p-1"},le=["src","alt"],ne={key:1,class:"w-full h-full bg-gray-50 flex items-center justify-center"},ie={class:"flex-1 min-w-0"},ue={class:"text-sm font-semibold text-gray-800 truncate leading-tight mb-1"},de={key:0,class:"text-xs text-primary font-medium flex gap-1 items-center"},ce={key:0},pe={key:1,class:"text-gray-300"},ge={key:2,class:"text-gray-500"},fe={class:"text-right shrink-0"},he={class:"text-[14px] font-bold text-gray-900"},ye={key:0,class:"text-[11px] text-gray-400 line-through"},xe={key:1,class:"p-8 text-center text-gray-500"},me={class:"font-semibold text-gray-800"},ve="prod_ENPATILER",Fe={__name:"AlgoliaSearchBox",setup(be){const j=P(),F=K(),{toUrlSlug:N}=T(),i=m(!1),w=m(!1),f=m([]),h=m([]),I=async()=>{if(!(f.value.length||h.value.length))try{const[l,e]=await Promise.all([A("/ecommerce/categories?include_tags=true"),A("/ecommerce/brands?filter=featured&per_page=10")]);l?.success&&(f.value=l.data.categories.slice(0,8)||[]),e?.success&&(h.value=e.data.brands.slice(0,12)||[])}catch{}finally{w.value=!0}},L=()=>{i.value=!0,I()},$=()=>{setTimeout(()=>{i.value=!1},200)},C=l=>{!l||!l.trim()||(i.value=!1,F.push({path:"/ara",query:{q:l.trim()}}))},{clickedProduct:z}=V(),D=l=>{i.value=!1,z(l.objectID,{queryID:l.__queryID,position:l.__position})},B=l=>l?new Intl.NumberFormat("tr-TR",{minimumFractionDigits:2,maximumFractionDigits:2}).format(l):"0.00";return(l,e)=>{const v=R;return t(),s("div",U,[c(u(O),{"index-name":ve,"search-client":u(j)},{default:p(()=>[c(u(H),{hitsPerPage:10,optionalFilters:["in_stock:1<score=1>"],clickAnalytics:!0}),c(u(q),null,{default:p(({currentRefinement:d,refine:E})=>[o("div",J,[o("input",{type:"search",autocomplete:"off",value:d,onInput:a=>E(a.currentTarget.value),onFocus:L,onBlur:$,onKeyup:S(a=>C(d),["enter"]),placeholder:"Ãrün, marka veya kategori ara...",class:"w-full pl-4 pr-10 py-2 border border-cardBorder rounded-full focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary bg-gray-50 transition-all font-sans text-sm h-11"},null,40,Q),o("button",{onClick:a=>C(d),class:"absolute right-3 top-1/2 -translate-y-1/2 text-textLight hover:text-primary transition-colors"},[...e[2]||(e[2]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])],8,W)]),i.value&&d.length<=1?(t(),s("div",X,[w.value?(t(),s(y,{key:0},[f.value.length?(t(),s("div",Y,[e[3]||(e[3]=o("div",{class:"text-[11px] font-bold text-gray-400 uppercase tracking-wider mb-2.5"},"KATEGORİLER",-1)),o("div",Z,[(t(!0),s(y,null,b(f.value,a=>(t(),_(v,{key:"cat-"+a.id,to:`/${u(N)(a.slug)}`,onMousedown:k(()=>{},["prevent"]),onClick:e[0]||(e[0]=r=>i.value=!1),class:"px-3 py-1.5 rounded-full bg-primary/10 text-primary text-sm font-medium hover:bg-primary hover:text-white transition-colors"},{default:p(()=>[x(g(a.name),1)]),_:2},1032,["to"]))),128))])])):n("",!0),h.value.length?(t(),s("div",ee,[e[4]||(e[4]=o("div",{class:"text-[11px] font-bold text-gray-400 uppercase tracking-wider mb-2.5"},"ÃNE ÃIKAN MARKALAR",-1)),o("div",te,[(t(!0),s(y,null,b(h.value,a=>(t(),_(v,{key:"brand-"+a.id,to:`/marka/${a.slug||a.id}`,onMousedown:k(()=>{},["prevent"]),onClick:e[1]||(e[1]=r=>i.value=!1),class:"px-3 py-1.5 rounded-full bg-gray-100 border border-gray-200 text-gray-700 text-sm font-medium hover:bg-gray-200 hover:border-gray-300 transition-colors"},{default:p(()=>[x(g(a.name),1)]),_:2},1032,["to"]))),128))])])):n("",!0)],64)):(t(),s("div",oe,[...e[5]||(e[5]=[o("div",{class:"w-6 h-6 border-2 border-primary border-t-transparent roun
1ded-full animate-spin"},null,-1)])]))])):n("",!0),i.value&&d.length>1?(t(),s("div",re,[c(u(G),null,{default:p(({items:a})=>[a.length>0?(t(),s("div",se,[e[7]||(e[7]=o("div",{class:"px-4 py-2 text-[11px] font-bold text-gray-400 uppercase tracking-wider bg-gray-50/50"},"ÃRÃNLER",-1)),(t(!0),s(y,null,b(a,r=>(t(),_(v,{key:r.objectID,to:`/urun/${r.slug}`,class:"flex items-center gap-4 px-4 py-3 hover:bg-gray-50 transition-colors border-b border-gray-100/50 last:border-0",onMousedown:k(()=>{},["prevent"]),onClick:_e=>D(r)},{default:p(()=>[o("div",ae,[r.image?(t(),s("img",{key:0,src:r.image,alt:r.name,class:"w-full h-full object-contain"},null,8,le)):(t(),s("div",ne,[...e[6]||(e[6]=[o("svg",{class:"h-5 w-5 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)])]))]),o("div",ie,[o("h4",ue,[c(u(M),{attribute:"name",hit:r},null,8,["hit"])]),r.brand||r.category?(t(),s("p",de,[r.brand?(t(),s("span",ce,[c(u(M),{attribute:"brand",hit:r},null,8,["hit"])])):n("",!0),r.brand&&r.category?(t(),s("span",pe,"â¢")):n("",!0),r.category?(t(),s("span",ge,g(r.category),1)):n("",!0)])):n("",!0)]),o("div",fe,[o("div",he,g(B(r.price))+" âº",1),r.has_discount?(t(),s("div",ye,g(B(r.compare_price))+" âº",1)):n("",!0)])]),_:2},1032,["to","onClick"]))),128))])):(t(),s("div",xe,[e[8]||(e[8]=o("div",{class:"w-16 h-16 mx-auto mb-4 bg-gray-50 rounded-full flex items-center justify-center"},[o("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-8 w-8 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),e[9]||(e[9]=x(' "',-1)),o("span",me,g(d),1),e[10]||(e[10]=x('" ile eÅleÅen bir ürün bulamadık. ',-1))]))]),_:2},1024)])):n("",!0)]),_:1})]),_:1},8,["search-client"])])}}};export{Fe 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.