import{D as e,E as t,L as n,M as r,P as i,R as a,T as o,V as s,W as c,Y as l,b as u,d,et as f,ft as p,h as m,it as h,j as g,l as ee,n as _,nt as v,ot as y,p as b,q as x,r as S,st as C,t as w}from"../../client.js";import{g as T,v as E}from"../../components.js";import D from"../button/Button.js";import O from"../iconbutton/IconButton.js";var k=i(`<option> </option>`),A=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>`),j=i(`<span class="mc-pagination__label svelte-19eta05" aria-current="page"> </span>`),M=i(`<nav><!> <!> <!></nav>`),N={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 {height:0;width:0;overflow:hidden;position:absolute;top:-1000px;left:-1000px;text-align:left;opacity:0;}

/* 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);}.mc-select__control--readonly.svelte-19eta05 {border-color:var(--forms-color-border-read-only, #cccccc);pointer-events:none;}.mc-select__control.is-invalid.svelte-19eta05 {border-color:var(--forms-color-border-invalid, #ea302d);box-shadow:0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-invalid, #ea302d);}.mc-select__control.is-invalid.svelte-19eta05:hover {border-color:var(--forms-color-border-invalid-hover, #c61112);box-shadow:0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-invalid-hover, #c61112);}.mc-select--s.svelte-19eta05 .mc-select__control:where(.svelte-19eta05) {font-size:var(--font-size-100, 0.875rem);line-height:var(--line-height-s, 1.3);height:2rem;padding:0 2rem 0 0.5rem;background-position:right 0.5rem center;}

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