1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4895],{44895:(e,r,a)=>{a.r(r),a.d(r,{FilterPanel:()=>m});var l=a(95155),i=a(12115),n=a(40767),s=a(14085),t=a(51686);function m(e){let{isOpen:r,filters:a,onFiltersChange:m,onApply:c,onClose:o}=e,[d,u]=i.useState(a||{});i.useEffect(()=>{u(a||{})},[a]);let x=(e,r)=>{let a={...d,[e]:r};u(a),("menu_name"===e||"chef_name"===e)&&m(a)};return r?(0,l.jsx)("div",{className:"border-t border-gray-200 bg-gray-50 py-6",children:(0,l.jsx)("div",{className:"px-6 lg:px-12 w-full",children:(0,l.jsxs)("div",{className:"w-full max-w-7xl mx-auto",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,l.jsx)("h3",{className:"text-lg font-semibold text-black",children:"Filter Results"}),o&&(0,l.jsx)("button",{onClick:o,className:"p-1 hover:bg-gray-200 rounded transition-colors","aria-label":"Close filter panel",children:(0,l.jsx)(n.A,{className:"w-5 h-5"})})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4 mb-6",children:[(0,l.jsx)("div",{className:"flex flex-col",children:(0,l.jsx)(t.I,{value:d.city||"",onChange:(e,r)=>{let a={...d,city:e};u(a),m(a)},placeholder:"Search city...",label:"City",inputClassName:"text-sm"})}),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("label",{htmlFor:"menu_name_input",className:"text-sm font-medium text-gray-700 mb-2",children:"Menu Name"}),(0,l.jsx)("input",{id:"menu_name_input",type:"text",placeholder:"Search menu...",value:d.menu_name||"",onChange:e=>x("menu_name",e.target.value),className:"px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-400 text-sm","aria-label":"Filter by menu name"})]}),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("label",{htmlFor:"chef_name_input",className:"text-sm font-medium text-gray-700 mb-2",children:"Chef Name"}),(0,l.jsx)("input",{id:"chef_name_input",type:"text",placeholder:"Search chef...",value:d.chef_name||"",onChange:e=>x("chef_name",e.target.value),className:"px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-400 text-sm","aria-label":"Filter by chef name"})]}),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("label",{htmlFor:"price_min_input",className:"text-sm font-medium text-gray-700 mb-2",children:"Min Price"}),(0,l.jsx)("input",{id:"price_min_input",type:"number",placeholder:"Min price",value:d.price_min||"",onChange:e=>x("price_min",e.target.value?Number(e.target.value):""),className:"px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-400 text-sm","aria-label":"Filter by minimum price",min:"0"})]}),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("label",{htmlFor:"price_max_input",className:"text-sm font-medium text-gray-700 mb-2",children:"Max Price"}),(0,l.jsx)("input",{id:"price_max_input",type:"number",placeholder:"Max price",value:d.price_max||"",onChange:e=>x("price_max",e.target.value?Number(e.target.value):""),className:"px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-400 text-sm","aria-label":"Filter by maximum price",min:"0"})]})]}),(0,l.jsxs)("div",{className:"flex gap-3 justify-end",children:[(0,l.jsx)(s.$,{onClick:()=>{let e={};u(e),c(e),o&&o()},variant:"ghost",className:"border border-solid border-[#CFCFCE] text-[#060605] hover:bg-gray-100 transition-colors font-medium rounded-full px-6 py-2.5",size:"md",children:"Reset Filters"}),(0,l.jsx)(s.$,{onClick:()=>{let e=d.price_min?Number(d.price_min):void 0,r=d.price_max?Number(d.price_max):void 0;if(void 0!==e&&void 0!==r&&e>r){alert("Minimum price cannot be greater than maximum price");return}let a={menu_name:d.menu_name||void 0,chef_name:d.chef_name||void 0,price_min:e,price_max:r,city:d.city||void 0};Object.keys(a).forEach(e=>void 0===a[e]&&delete a[e]),c(a),o&&o()},className:"bg-primary-400 text-white border border-primary-400 hover:bg-primary-500 transition-colors font-medium rounded-full px-6 py-2.5 shadow-sm",size:"md",children:"Apply Filters"})]})]})})}):null}}}]);
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.