import{D as e,E as t,L as n,M as r,P as i,Q as a,R as o,T as s,V as c,W as l,X as u,Y as d,b as f,d as p,et as m,ft as h,h as g,it as _,j as v,n as y,nt as b,ot as x,p as S,q as C,st as w,t as T}from"../../client.js";import{g as E,v as D}from"../../components.js";import O from"../button/Button.js";import k from"../iconbutton/IconButton.js";var A=i(`<option> </option>`),j=i(`<div class="mc-pagination__field"><div class="mc-select mc-pagination__select svelte-19eta05"><select class="mc-select__control svelte-19eta05"></select></div></div>`),M=i(`<span class="mc-pagination__label svelte-19eta05" aria-current="page"> </span>`),N=i(`<nav class="mc-pagination svelte-19eta05" aria-label="pagination"><!> <!> <!></nav>`),P={hash:`svelte-19eta05`,code:`/**
 * Do not edit directly, this file was auto-generated.
 */.mc-pagination.svelte-19eta05 {align-items:center;display:flex;justify-content:center;gap:0.5rem;}.mc-pagination__label.svelte-19eta05 {clip-path:inset(100%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;padding:0;width:1px;}

/* stylelint-disable string-no-newline */.mc-select.svelte-19eta05 {position:relative;display:block;width:100%;}.mc-select.svelte-19eta05::after {content:"";pointer-events:none;position:absolute;top:50%;right:1rem;transform:translateY(-50%);width:1rem;height:1rem;background-color:var(--forms-color-icon-interactive, #000000);mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;}.mc-select__control.svelte-19eta05 {appearance:none;font-family:inherit;transition:box-shadow 200ms ease;font-size:var(--font-size-150, 1rem);line-height:var(--line-height-s, 1.3);height:3rem;padding:0 3rem 0 0.75rem;background-position:right 1rem center;border:var(--border-width-s, 0.0625rem) solid var(--forms-color-border-default, #666666);display:block;width:100%;color:var(--forms-color-text-default, #000000);background-color:var(--forms-color-background-default, #ffffff);text-overflow:ellipsis;border-radius:var(--border-radius-s, 0.25rem);}.mc-select__control.svelte-19eta05:hover {border-color:var(--forms-color-border-hover, #4d4d4d);box-shadow:0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-hover, #4d4d4d);}.mc-select__control.svelte-19eta05:focus {box-shadow:0 0 0 0.125rem var(--focus-color-mid, var(--focus-color-outline-mid, #ffffff)), 0 0 0 0.25rem var(--focus-color-outer, var(--focus-color-outline-outer, #000000));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-select__control.svelte-19eta05:disabled {background-color:var(--forms-color-background-disabled, #d9d9d9);border-color:transparent;cursor:not-allowed;box-shadow:none;color:var(--forms-color-text-disabled, #737373);}

/* stylelint-enable string-no-newline */`};function F(n,i){w(i,!0),f(n,P);let T=y(i,`id`,7),F=y(i,`value`,15,1),I=y(i,`total`,7,10),L=y(i,`compact`,7),R=y(i,`selectLabel`,7,`Page selector`),z=y(i,`prefixlabel`,7,`Page`),B=y(i,`pagelabel`,7,`of`),V=m(u(Number(F()))),H=m(()=>c(V)<=1),U=m(()=>c(V)>=I()),W=m(()=>Array.from({length:I()},(e,t)=>t+1));function G(){c(H)()||a(V,Number(c(V))-1)}function K(){c(U)()||a(V,Number(c(V))+1)}function q(e){F(Number(e.target.value))}var J={get id(){return T()},set id(e){T(e),_()},get value(){return F()},set value(e=1){F(e),_()},get total(){return I()},set total(e=10){I(e),_()},get compact(){return L()},set compact(e){L(e),_()},get selectLabel(){return R()},set selectLabel(e=`Page selector`){R(e),_()},get prefixlabel(){return z()},set prefixlabel(e=`Page`){z(e),_()},get pagelabel(){return B()},set pagelabel(e=`of`){B(e),_()}},Y=N(),X=C(Y),Z=e=>{{let t=b(()=>c(H)());O(e,{iconposition:`only`,"aria-label":`Previous page`,get disabled(){return c(t)},onclick:G,$$slots:{icon:(e,t)=>{E(e,{slot:`icon`})}}})}},Q=e=>{{let t=b(()=>c(H)());k(e,{outlined:!0,"aria-label":`Previous page`,get disabled(){return c(t)},onclick:G,$$slots:{icon:(e,t)=>{E(e,{slot:`icon`})}}})}};e(X,e=>{L()?e(Q,-1):e(Z)});var $=d(X,2),ee=e=>{var n=j(),i=C(n),u=C(i);s(u,21,()=>c(W)(),t,(e,t)=>{var n=A(),i=C(n);h(n);var a={};l((e,r)=>{S(n,e),v(i,`${z()??``}
              ${c(t)??``}
              ${B()??``}
              ${I()??``}`),a!==(a=r)&&(n.value=(n.__value=r)??``)},[()=>Number(c(t))==Number(c(V)),()=>Number(c(t))]),r(e,n)}),h(u),h(i),h(n),l(()=>{p(u,`id`,T()),p(u,`aria-label`,R()),u.disabled=I()<=1}),o(`change`,u,q),g(u,()=>c(V),e=>a(V,e)),r(e,n)},te=e=>{var t=M(),n=C(t);h(t),l(()=>v(n,`${z()??``}
      ${F()??``}
      ${B()??``}
      ${I()??``}`)),r(e,t)};e($,e=>{L()?e(te,-1):e(ee)});var ne=d($,2),re=e=>{{let t=b(()=>c(U)());O(e,{iconposition:`only`,"aria-label":`Next page`,get disabled(){return c(t)},onclick:K,$$slots:{icon:(e,t)=>{D(e,{slot:`icon`})}}})}},ie=e=>{{let t=b(()=>c(U)());k(e,{outlined:!0,"aria-label":`Next page`,get disabled(){return c(t)},onclick:K,$$slots:{icon:(e,t)=>{D(e,{slot:`icon`})}}})}};return e(ne,e=>{L()?e(ie,-1):e(re)}),h(Y),r(n,Y),x(J)}n([`change`]),customElements.define(`m-pagination`,T(F,{compact:{attribute:`compact`,reflect:!0,type:`Boolean`},id:{},value:{},total:{},selectLabel:{},prefixlabel:{},pagelabel:{}},[],[],{mode:`open`}));
//# sourceMappingURL=Pagination.js.map