var A=Object.defineProperty,Q=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var w=(r,o,t)=>o in r?A(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t,i=(r,o)=>{for(var t in o||(o={}))S.call(o,t)&&w(r,t,o[t]);if(b)for(var t of b(o))U.call(o,t)&&w(r,t,o[t]);return r},k=(r,o)=>Q(r,R(o));import{jsxs as s,jsx as a}from"react/jsx-runtime";import{U as C,V as P,B as n,W as j,e as D,X as M}from"./ui-components-B24mpb8o.js";import{g as I}from"./route-D0xh7FtZ.js";import{usePage as $,router as B}from"@inertiajs/react";import"next-themes";import"sonner";import"react";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"lucide-react";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 _e=r=>{const{props:o}=$(),{translate:t}=o,{frontend:m,common:h}=t,{current_page:l,last_page:c,first_page_url:F,last_page_url:L,next_page_url:u,prev_page_url:g}=r.paginationInfo,x=$(),N=I(x.url),p=[];if(c>0)for(let e=1;e<=c;e++)p.push({key:`${e}`,value:e});else p.push({key:"1",value:1});const y=e=>{B.get(route(r.routeName,k(i(i({},r.routeParams||{}),N),{page:e})))},d=e=>{var f,_;const T=I(e);B.get(route(r.routeName,i(i(i({category:(f=x.props.category)==null?void 0:f.id,category_child:(_=x.props.categoryChild)==null?void 0:_.id},r.routeParams||{}),N),T)))},v=e=>`text-center py-1 ${l===e&&"bg-primary-50"}`;return s("div",{className:`${r.className}`,children:[s("div",{className:"mb-4 flex items-center justify-center md:hidden",children:[a("span",{className:"mr-1",children:s("strong",{children:[l," ",h.of," ",c]})}),s("span",{className:"mr-3",children:["| ",m.go_to_page_colon]}),s(C,{children:[a(P,{children:a(n,{variant:"secondary",className:"hover:border-primary h-8 w-[60px] rounded-md border border-gray-200 text-gray-700",children:l})}),a(j,{align:"end",className:"min-w-[60px]",children:a(D,{className:"",children:p.map(e=>a(M,{onClick:()=>y(e.value),className:v(e.value),children:e.value},e.key))})})]})]}),s("div",{className:"flex items-center justify-center",children:[a(n,{color:"white",disabled:!g,onClick:()=>d(F),className:"h-8 px-2 text-xs sm:px-3",children:"<<First"}),a(n,{color:"white",disabled:!g,onClick:()=>d(g),className:"mx-3 h-8 px-2 text-xs sm:px-3",children:m.prev}),s("div",{className:"hidden items-center md:flex",children:[s("span",{className:"mr-1",children:[h.page," ",s("strong",{children:[l," ",h.of," ",c]})]}),s("span",{className:"mr-3",children:["| ",m.go_to_page_colon]}),s(C,{children:[a(P,{children:a(n,{variant:"secondary",className:"hover:border-primary h-8 w-[60px] rounded-md border border-gray-200 text-gray-700",children:l})}),a(j,{align:"end",className:"min-w-[60px]",children:a(D,{className:"",children:p.map(e=>a(M,{onClick:()=>y(e.value),className:v(e.value),children:e.value},e.key))})})]})]}),a(n,{color:"white",disabled:!u,onClick:()=>d(u),className:"mx-3 h-8 px-2 text-xs sm:px-3",children:m.next}),a(n,{color:"white",disabled:!u,onClick:()=>d(L),className:"h-8 px-2 text-xs sm:px-3",children:"Last>>"})]})]})};export{_e as default};
