1import{i as e}from"./chunk-aKtaBQYM.js";import{t}from"./react-DxZHKUKd.js";import{t as n}from"./jsx-runtime-BqYSgJeI.js";import{r}from"./runtime-CMH_Rwhp.js";import{t as i}from"./chevron-left-CiyDqoRV.js";import{t as a}from"./chevron-right-CXtSPApa.js";import{n as o,t as s}from"./chevrons-right-BuLyCkVS.js";import{t as c}from"./request-DGHuPtqv.js";import{hr as l,n as u,nr as d}from"./index-D8Z9unGG.js";var f=()=>`Première page`,p=()=>`First page`,m=((e={},t={})=>(t.locale??r())===`fr`?f(e):p(e)),h=()=>`Pagination`,g=()=>`Pagination`,_=((e={},t={})=>(t.locale??r())===`fr`?h(e):g(e)),v=()=>`Dernière page`,y=()=>`Last page`,b=((e={},t={})=>(t.locale??r())===`fr`?v(e):y(e)),x=()=>`Page suivante`,S=()=>`Next page`,C=((e={},t={})=>(t.locale??r())===`fr`?x(e):S(e)),w=()=>`Page précédente`,T=()=>`Previous page`,E=((e={},t={})=>(t.locale??r())===`fr`?w(e):T(e)),D=e(t(),1),O=n();function k({currentPage:e,totalPages:t,route:n,params:r,onNavigate:f,scrollTargetId:p,LinkComponent:h=u,locale:g}){let v=l(),[,y]=(0,D.useTransition)(),x=(0,D.useRef)(!1);if((0,D.useEffect)(()=>{x.current&&(x.current=!1,p&&document.getElementById(p)?.scrollIntoView({behavior:`smooth`,block:`start`}))},[e,p]),t<=1)return null;let S=A(e,t),w=g?{locale:g}:void 0,T=h!==u,k=e=>T?void 0:t=>M(t,e);function j(e){return c({route:n,params:{...r,page:e}})}function M(e,t){if(e.metaKey||e.ctrlKey||e.shiftKey||e.button===1)return;e.preventDefault();let n=j(t);if(x.current=!0,f){f(t,n);return}y(async()=>{await v({to:n,resetScroll:!1})})}return(0,O.jsxs)(`nav`,{"aria-label":_(void 0,w),className:`flex items-center justify-center gap-1 pt-2 md:pt-4`,children:[(0,O.jsx)(d,{variant:`outline`,size:`icon`,className:`h-9 w-9 bg-transparent`,asChild:e>1,disabled:e<=1,children:e>1?(0,O.jsx)(h,{href:j(1),onClick:k(1),"aria-label":m(void 0,w),children:(0,O.jsx)(o,{className:`h-4 w-4`})}):(0,O.jsx)(`span`,{"aria-label":m(void 0,w),children:(0,O.jsx)(o,{className:`h-4 w-4`})})}),(0,O.jsx)(d,{variant:`outline`,size:`icon`,className:`h-9 w-9 bg-transparent`,asChild:e>1,disabled:e<=1,children:e>1?(0,O.jsx)(h,{href:j(e-1),onClick:k(e-1),"aria-label":E(void 0,w),children:(0,O.jsx)(i,{className:`h-4 w-4`})}):(0,O.jsx)(`span`,{"aria-label":E(void 0,w),children:(0,O.jsx)(i,{className:`h-4 w-4`})})}),S.map((t,n)=>t===`...`?(0,O.jsx)(`span`,{className:`flex h-9 w-9 items-center justify-center text-muted-foreground`,children:`...`},`ellipsis-${n}`):(0,O.jsx)(d,{variant:t===e?`default`:`outline`,size:`icon`,className:`h-9 w-9 ${t===e?``:`bg-transparent`}`,asChild:t!==e,children:t===e?(0,O.jsx)(`span`,{children:t}):(0,O.jsx)(h,{href:j(t),onClick:k(t),children:t})},t)),(0,O.jsx)(d,{variant:`outline`,size:`icon`,className:`h-9 w-9 bg-transparent`,asChild:e<t,disabled:e>=t,children:e<t?(0,O.jsx)(h,{href:j(e+1),onClick:k(e+1),"aria-label":C(void 0,w),children:(0,O.jsx)(a,{className:`h-4 w-4`})}):(0,O.jsx)(`span`,{"aria-label":C(void 0,w),children:(0,O.jsx)(a,{className:`h-4 w-4`})})}),(0,O.jsx)(d,{variant:`outline`,size:`icon`,className:`h-9 w-9 bg-transparent`,asChild:e<t,disabled:e>=t,children:e<t?(0,O.jsx)(h,{href:j(t),onClick:k(t),"aria-label":b(void 0,w),children:(0,O.jsx)(s,{className:`h-4 w-4`})}):(0,O.jsx)(`span`,{"aria-label":b(void 0,w),children:(0,O.jsx)(s,{className:`h-4 w-4`})})})]})}function A(e,t){return t<=7?Array.from({length:t},(e,t)=>t+1):e<=3?[1,2,3,4,`...`,t]:e>=t-2?[1,`...`,t-3,t-2,t-1,t]:[1,`...`,e-1,e,e+1,`...`,t]}export{k as t};
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.