var j=Object.defineProperty;var b=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var x=(r,o,e)=>o in r?j(r,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[o]=e,h=(r,o)=>{for(var e in o||(o={}))G.call(o,e)&&x(r,e,o[e]);if(b)for(var e of b(o))I.call(o,e)&&x(r,e,o[e]);return r};import{jsxs as m,jsx as s}from"react/jsx-runtime";import{S as Q}from"./search-input-Cc2brlhX.js";import{R as F,f as c}from"./ui-components-B24mpb8o.js";import{g as S}from"./route-D0xh7FtZ.js";import{usePage as $,router as E,Link as n}from"@inertiajs/react";import"./debounce-CWHP_ANh.js";import"lucide-react";import"react";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";const Nl=({setOpen:r})=>{const o=$(),e=S(o.url),{levels:_,prices:P,categories:R,category:i,categoryChild:a,translate:k}=o.props,{frontend:d,common:f}=k,t=(l,N,u)=>{const p=h({},e);return"search"in p&&delete p.search,route("category.exams",h(h({category:N,category_child:u},p),l))};return m("div",{className:"space-y-6",children:[s(Q,{onChangeValue:l=>E.get(route("category.exams",{category:"all",search:l}))}),m("div",{children:[s("h3",{className:"mb-3 font-semibold",children:f.categories}),m(F,{value:a?a==null?void 0:a.slug:(i==null?void 0:i.slug)||"all",children:[m(n,{className:"flex items-center",href:t({},"all"),children:[s(c,{className:"cursor-pointer",id:"category",value:"all"}),s("label",{htmlFor:"category",className:"cursor-pointer pl-2",children:d.all})]}),R.map((l,N)=>{var p;const u=`category${N}`;return l.slug==="default"?null:m("div",{className:"capitalize",children:[m(n,{className:"flex items-center",href:t({},l.slug),onFinish:()=>!e.search&&r&&r(!1),children:[s(c,{className:"cursor-pointer",id:u,value:l.slug}),s("label",{htmlFor:u,className:"cursor-pointer pl-2",children:l.title})]}),(p=l.category_children)==null?void 0:p.map((v,z)=>{const g=`category_child${z}`;return m(n,{className:"mt-2 flex items-center pl-3",href:t({},l.slug,v.slug),onFinish:()=>!e.search&&r&&r(!1),children:[s(c,{className:"cursor-pointer",id:g,value:v.slug}),s("label",{htmlFor:g,className:"cursor-pointer pl-2",children:v.title})]},g)})]},u)})]})]}),m("div",{children:[s("h3",{className:"mb-3 font-semibold",children:f.price}),m(F,{value:e.pricing_type||"all",children:[m(n,{className:"flex items-center",href:t({pricing_type:"all"},(i==null?void 0:i.slug)||"all",a==null?void 0:a.slug),onFinish:()=>!e.search&&r&&r(!1),children:[s(c,{className:"cursor-pointer",id:"price",value:"all"}),s("label",{htmlFor:"price",className:"cursor-pointer pl-2",children:d.all})]}),P.map(l=>m(n,{className:"flex items-center capitalize",href:t({pricing_type:l},(i==null?void 0:i.slug)||"all",a==null?void 0:a.slug),onFinish:()=>!e.search&&r&&r(!1),children:[s(c,{className:"cursor-pointer",value:l,id:l}),s("label",{htmlFor:l,className:"cursor-pointer pl-2",children:l})]},l))]})]}),m("div",{children:[s("h3",{className:"mb-3 font-semibold",children:f.level}),m(F,{value:e.level||"all",children:[m(n,{className:"flex items-center",href:t({level:"all"},(i==null?void 0:i.slug)||"all",a==null?void 0:a.slug),onFinish:()=>!e.search&&r&&r(!1),children:[s(c,{className:"cursor-pointer",id:"level",value:"all"}),s("label",{htmlFor:"level",className:"cursor-pointer pl-2",children:d.all})]}),_.map(l=>m(n,{className:"flex items-center capitalize",href:t({level:l},(i==null?void 0:i.slug)||"all",a==null?void 0:a.slug),onFinish:()=>!e.search&&r&&r(!1),children:[s(c,{className:"cursor-pointer",value:l,id:l}),s("label",{htmlFor:l,className:"cursor-pointer pl-2",children:l})]},l))]})]})]})};export{Nl as default};
