@mattilsynet/design 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var mtds=function(p){"use strict";const y=typeof window<"u"&&typeof document<"u",d={capture:!0,passive:!0};function a(t,n,o){return o===void 0?t.getAttribute(n)??null:(o===null?t.removeAttribute(n):t.getAttribute(n)!==o&&t.setAttribute(n,o),null)}let Ot=0;const kt=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function S(t){return t.id||(t.id=`${kt}${++Ot}`),t.id}const O=(t,n,o)=>{for(const e of o[0].split(","))o[0]=e,n[`${t}EventListener`](...o)},r=(t,...n)=>O("add",t,n),v=(t,...n)=>O("remove",t,n),M=new Map,_=y?document.createElement("div"):null;_&&a(_,"style","position:absolute;padding:1px;top:0;left:0px"),y&&r(window,"load,resize,scroll",()=>{for(const[t,n]of M)n()},d);const b={top:0,right:1,bottom:2,left:3};function w(t,n,o){var Ct;if(!n||!n.isConnected||!t.isConnected)return M.delete(t);if(_!=null&&_.isConnected||document.body.append(_||""),!M.has(t)){const gn=b[o]??b.bottom;return(Ct=M.set(t,()=>w(t,n,gn)).get(t))==null?void 0:Ct()}const{offsetWidth:e,offsetHeight:s}=t,{offsetWidth:c,offsetHeight:i}=n,{width:m,height:C,left:an,top:ln}=n.getBoundingClientRect(),T=Math.round(an-(c-m)/2),g=Math.round(ln-(i-C)/2),rn=T-e>0,_n=c+c+e<window.innerWidth,fn=g-s>0,un=g+i+s<window.innerHeight,pn=o===b.bottom&&_n||!rn,bn=o===b.bottom&&un||!fn,hn=Math.min(Math.max(10,T-(e-c)/2),window.innerWidth-e-10),mn=Math.min(Math.max(10,g-(s-i)/2),window.innerHeight-s-10),$t=o===b.top||o===b.bottom;t.style.left=`${Math.round($t?hn:pn?T+c:T-e)}px`,t.style.top=`${Math.round($t?bn?g+i:g-s:mn)}px`,_==null||_.style.setProperty("translate",`${Math.round(window.scrollX+T+c+e+30)} ${Math.round(window.scrollY+g+i+s+30)}px`)}function Bt(t){let n=0;const o=()=>setTimeout(e,200),e=()=>{t([],s),n=0},s=new MutationObserver(()=>{n||(n=requestAnimationFrame(o))});return s}const L=new WeakMap,Pt=t=>{var o;const n=L.get(t);if(!n||!t.isConnected)(o=n==null?void 0:n.observer)==null||o.disconnect(),L.delete(t);else for(const[,e]of n.collections)e()},h=(t,n,o)=>{const e=t.getElementsByClassName(n);let s=L.get(t);s||(s={collections:new Map,observer:Bt(()=>Pt(t))},s.observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),L.set(t,s)),o?s.collections.set(n,()=>o(e)):s.collections.delete(n)},I=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),k=({clientX:t,clientY:n,target:o})=>{if(o instanceof HTMLDialogElement&&a(o,"data-closedby")==="any"){const{top:e,right:s,bottom:c,left:i}=o.getBoundingClientRect();e<=n&&n<=c&&i<=t&&t<=s||o.close()}};function xt(t){r(t,"click",k,d)}function Dt(t){v(t,"click",k,d)}const B="_alert_10dnh_1 _ds-alert_1w6ss_1",P="_avatar_10dnh_1 _ds-avatar_1w6ss_1",x="_badge_10dnh_1",D="_breadcrumbs_10dnh_1 _ds-breadcrumbs_1w6ss_1",H="_button_10dnh_1 _ds-button_1w6ss_1",N="_card_10dnh_1",V="_chip_10dnh_1 _ds-chip_1w6ss_1",Y="_details_10dnh_1 _ds-details_1w6ss_1",R="_dialog_10dnh_1 _ds-modal_1w6ss_1",U="__fadein_10dnh_1",W="_divider_10dnh_1",F="_errorsummary_10dnh_1 _ds-error-summary_1w6ss_1",j="_field_10dnh_1 _ds-field_1w6ss_1",G="_affixes_10dnh_1 _ds-field-affixes_1w6ss_1",X="_count_10dnh_1",q="_fieldset_10dnh_1 _ds-fieldset_1w6ss_1",z="_heading_10dnh_1 _ds-heading_1w6ss_1",K="_input_10dnh_1 _ds-input_1w6ss_1",Q="_grid_10dnh_1",J="_flex_10dnh_1",Z="_app_10dnh_1",tt="_link_10dnh_1",nt="_logo_10dnh_1 _ds-focus_1w6ss_1",ot="_pagination_10dnh_1 _ds-pagination_1w6ss_1",et="_popover_10dnh_1",st="_skeleton_10dnh_1 _ds-skeleton_1w6ss_1",it="_spinner_10dnh_1",ct="_table_10dnh_1 _ds-table_1w6ss_1",dt="__scrollShadow_10dnh_1",at="_tabs_10dnh_1 _ds-tabs_1w6ss_1",lt="_tag_10dnh_1 _ds-tag_1w6ss_1",rt="__tooltip_10dnh_1",_t="_validation_10dnh_1 _ds-validation-message_1w6ss_1",ft="_body_10dnh_139",f={alert:B,avatar:P,badge:x,breadcrumbs:D,button:H,card:N,chip:V,details:Y,dialog:R,_fadein:U,divider:W,errorsummary:F,field:j,affixes:G,count:X,fieldset:q,heading:z,input:K,grid:Q,flex:J,app:Z,link:tt,logo:nt,pagination:ot,popover:et,skeleton:st,spinner:it,table:ct,_scrollShadow:dt,tabs:at,tag:lt,_tooltip:rt,validation:_t,body:ft},Ht=Object.freeze(Object.defineProperty({__proto__:null,_fadein:U,_scrollShadow:dt,_tooltip:rt,affixes:G,alert:B,app:Z,avatar:P,badge:x,body:ft,breadcrumbs:D,button:H,card:N,chip:V,count:X,default:f,details:Y,dialog:R,divider:W,errorsummary:F,field:j,fieldset:q,flex:J,grid:Q,heading:z,input:K,link:tt,logo:nt,pagination:ot,popover:et,skeleton:st,spinner:it,table:ct,tabs:at,tag:lt,validation:_t},Symbol.toStringTag,{value:"Module"})),ut=f.field.split(" ")[0],pt=f.validation.split(" "),Nt=pt[0];function Vt(t){for(const n of t){const o=[],e=[];let s=null,c=!0;for(const i of n.getElementsByTagName("*"))i instanceof HTMLLabelElement?o.push(i):I(i)?s=i:i.classList.contains(Nt)?(c=i.getAttribute("data-color")==="success",e.unshift(S(i))):i instanceof HTMLParagraphElement&&e.push(S(i));if(s){for(const i of o)i.htmlFor=S(s);ht(s),a(s,"aria-describedby",e.join(" ")),a(s,"aria-invalid",`${!c}`)}}}function bt({target:t}){I(t)&&ht(t)}function ht(t){const n=t==null?void 0:t.nextElementSibling,o=n==null?void 0:n.getAttribute("data-count");if(n&&o){const e=Number(o)-t.value.length,s=e<0;if(n.getAttribute("aria-live")==="polite"!==s){a(n,"aria-live",s?"polite":"off");for(const i of pt)n.classList.toggle(i,s)}n.textContent=`${Math.abs(e)} tegn ${s?"for mye":"igjen"}`}}function Yt(t){h(t,ut,Vt),r(t,"input",bt,d)}function Rt(t){h(t,ut,!1),v(t,"input",bt,d)}const mt=f.fieldset.split(" ")[0],Ut=f.validation.split(" ")[0];function Wt(t){for(const n of t){const o=[];let e="";for(const s of n.getElementsByTagName("*"))s.classList.contains(Ut)?e=S(s):I(s)&&o.push(s);if(e)for(const s of o)a(s,"aria-describedby",e),a(s,"aria-invalid","true")}}const Ft=t=>h(t,mt,Wt),jt=t=>h(t,mt,!1),gt=f.app.split(" ")[0],Gt=`.${gt} > header + :not(main) > button:empty:first-child`,vt=({target:t})=>{const n=(t==null?void 0:t.nodeName)==="BUTTON"&&(t==null?void 0:t.closest(Gt));if(!n)return;const o=n.closest(`.${gt} > *`),e=()=>o==null?void 0:o.setAttribute("data-expanded",`${(o==null?void 0:o.getAttribute("data-expanded"))==="false"}`);document.startViewTransition?document.startViewTransition(()=>e()):e()};function Xt(t){r(t,"click",vt,d)}function qt(t){v(t,"click",vt,d)}function zt(t){r(t,"toggle",Tt,d),r(t,"click",yt)}function Kt(t){v(t,"toggle",Tt,d),v(t,"click",yt)}const wt=f.popover.split(" ")[0];function Tt({target:t,newState:n}){var o;if(t instanceof HTMLElement&&t.classList.contains(wt)){const e=(o=t.getRootNode())==null?void 0:o.querySelector(`[popovertarget="${t.id}"]`);n==="closed"?w(t,!1):e&&w(t,e,t.getAttribute("data-position")||"bottom")}}function yt({target:t}){var o,e;const n=(o=t==null?void 0:t.closest)==null?void 0:o.call(t,"a");if(n){const s=n.getRootNode(),c=((e=s.getElementById)==null?void 0:e.call(s,a(n,"popovertarget")||""))||n.closest(`.${wt}`),i=a(n,"popovertargetaction")||"toggle";c==null||c.togglePopover(i==="show"||(i==="hide"?!1:void 0))}}const St=f.table.split(" ")[0];function Qt(t){var n,o;for(const e of t)if(e instanceof HTMLTableElement){const s=Array.from(((o=(n=e.tHead)==null?void 0:n.rows[0])==null?void 0:o.cells)||[],c=>{var i;return(i=c.innerText)==null?void 0:i.trim()});for(const c of e.tBodies)for(const i of c.rows)for(const m of i.cells)a(m,"data-th",s[m.cellIndex]||":empty")}}const Jt=t=>h(t,St,Qt),Zt=t=>h(t,St,!1),tn=f._tooltip.split(" "),Mt="aria-describedby",Lt="Escape",A="aria-labelledby",nn="--mtds-tooltip-position",on=100,E="mtds-tooltip";let u=null,At=Number.NEGATIVE_INFINITY,Et=0,l=null;function $({target:t,type:n,key:o}){if(n==="keydown"&&o!==Lt)return;const e=At+on-Date.now();clearTimeout(Et),Et=setTimeout(en,Math.max(e,0),o===Lt?null:t)}function en(t){var c;if(At=Date.now(),!l||t===l)return;let n=((c=t==null?void 0:t.closest)==null?void 0:c.call(t,"[data-tooltip]"))||null;if(n===u)return;const o=(n==null?void 0:n.getAttribute("data-tooltip"))||"",e=(n==null?void 0:n.getAttribute("data-tooltip-position"))||window.getComputedStyle(n||document.body).getPropertyValue(nn)||"top",s=!!(n!=null&&n.innerText.trim())||(n==null?void 0:n.hasAttribute(A))||(n==null?void 0:n.hasAttribute("aria-label"));(!o||o==="false"||o==="true"||e==="none")&&(n=null),n&&(l.textContent=o),u==null||u.removeAttribute(u.getAttribute(A)===E?A:Mt),w(l,!1),u=n,u==null||u.setAttribute(s?Mt:A,E),l.togglePopover(!!n),w(l,n,e)}y&&!document.getElementById(E)&&(l=document.body.appendChild(document.createElement("div")),l.classList.add(...tn),l.id=E,a(l,"popover","manual"),r(document,"blur,focus,mouseout,mouseover",$,d),r(window,"keydown",$,d),r(window,"blur",$,d));const sn=(t,n,o)=>{const e=(o-1)/2,s=Math.max(Math.min(t-Math.floor(e),n-o+1),1),c=Math.min(Math.max(t+Math.ceil(e),o),n),i=Array.from({length:c+1-s},(m,C)=>C+s);return o>4&&s>1&&i.splice(0,2,1,0),o>3&&c<n&&i.splice(-2,2,0,n),i},cn=({current:t=1,total:n=10,show:o=7})=>({prev:t>1?t-1:0,next:t<n?t+1:0,pages:sn(t,n,o).map((e,s)=>({current:e===t&&"page",key:`key-${e}-${s}`,page:e}))});if(y){const t=document.readyState==="loading",n=()=>It(document.body);t?document.addEventListener("DOMContentLoaded",n):n()}function It(t){xt(t),Yt(t),Ft(t),Xt(t),zt(t),Jt(t)}function dn(t){Dt(t),Rt(t),jt(t),qt(t),Kt(t),Zt(t)}return p.observe=It,p.pagination=cn,p.styles=Ht,p.unobserve=dn,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p}({});
1
+ var mtds=function(p){"use strict";const y=typeof window<"u"&&typeof document<"u",c={capture:!0,passive:!0};function d(t,e,o){return o===void 0?t.getAttribute(e)??null:(o===null?t.removeAttribute(e):t.getAttribute(e)!==o&&t.setAttribute(e,o),null)}let Ot=0;const kt=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function S(t){return t.id||(t.id=`${kt}${++Ot}`),t.id}const O=(t,e,o)=>{for(const n of o[0].split(","))o[0]=n,e[`${t}EventListener`](...o)},r=(t,...e)=>O("add",t,e),h=(t,...e)=>O("remove",t,e),M=new Map,_=y?document.createElement("div"):null;_&&d(_,"style","position:absolute;padding:1px;top:0;left:0px"),y&&r(window,"load,resize,scroll",()=>{for(const[t,e]of M)e()},c);const b={top:0,right:1,bottom:2,left:3};function w(t,e,o){var Ct;if(!e||!e.isConnected||!t.isConnected)return M.delete(t);if(_!=null&&_.isConnected||document.body.append(_||""),!M.has(t)){const ge=b[o]??b.bottom;return(Ct=M.set(t,()=>w(t,e,ge)).get(t))==null?void 0:Ct()}const{offsetWidth:n,offsetHeight:s}=t,{offsetWidth:a,offsetHeight:i}=e,{width:g,height:C,left:ce,top:de}=e.getBoundingClientRect(),T=Math.round(ce-(a-g)/2),v=Math.round(de-(i-C)/2),le=T-n>0,re=a+a+n<window.innerWidth,_e=v-s>0,fe=v+i+s<window.innerHeight,ue=o===b.bottom&&re||!le,pe=o===b.bottom&&fe||!_e,be=Math.min(Math.max(10,T-(n-a)/2),window.innerWidth-n-10),me=Math.min(Math.max(10,v-(s-i)/2),window.innerHeight-s-10),$t=o===b.top||o===b.bottom;t.style.left=`${Math.round($t?be:ue?T+a:T-n)}px`,t.style.top=`${Math.round($t?pe?v+i:v-s:me)}px`,_==null||_.style.setProperty("translate",`${Math.round(window.scrollX+T+a+n+30)} ${Math.round(window.scrollY+v+i+s+30)}px`)}function Bt(t){let e=0;const o=()=>setTimeout(n,200),n=()=>{t([],s),e=0},s=new MutationObserver(()=>{e||(e=requestAnimationFrame(o))});return s}const L=new WeakMap,Pt=t=>{var o;const e=L.get(t);if(!e||!t.isConnected)(o=e==null?void 0:e.observer)==null||o.disconnect(),L.delete(t);else for(const[,n]of e.collections)n()},m=(t,e,o)=>{const n=t.getElementsByClassName(e);let s=L.get(t);s||(s={collections:new Map,observer:Bt(()=>Pt(t))},s.observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),L.set(t,s)),o?s.collections.set(e,()=>o(n)):s.collections.delete(e)},I=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),k=({clientX:t,clientY:e,target:o})=>{if(o instanceof HTMLDialogElement&&d(o,"data-closedby")==="any"){const{top:n,right:s,bottom:a,left:i}=o.getBoundingClientRect();n<=e&&e<=a&&i<=t&&t<=s||o.close()}};function xt(t){r(t,"click",k,c)}function Dt(t){h(t,"click",k,c)}const B="_alert_1aace_1 _ds-alert_1w6ss_1",P="_avatar_1aace_1 _ds-avatar_1w6ss_1",x="_badge_1aace_1",D="_breadcrumbs_1aace_1 _ds-breadcrumbs_1w6ss_1",H="_button_1aace_1 _ds-button_1w6ss_1",N="_card_1aace_1",V="_chip_1aace_1 _ds-chip_1w6ss_1",Y="_details_1aace_1 _ds-details_1w6ss_1",R="_dialog_1aace_1 _ds-modal_1w6ss_1",U="__fadein_1aace_1",W="_divider_1aace_1",F="_errorsummary_1aace_1 _ds-error-summary_1w6ss_1",j="_field_1aace_1 _ds-field_1w6ss_1",G="_affixes_1aace_1 _ds-field-affixes_1w6ss_1",X="_count_1aace_1",q="_fieldset_1aace_1 _ds-fieldset_1w6ss_1",z="_heading_1aace_1 _ds-heading_1w6ss_1",K="_input_1aace_1 _ds-input_1w6ss_1",Q="_grid_1aace_1",J="_flex_1aace_1",Z="_app_1aace_1",tt="_link_1aace_1",et="_logo_1aace_1 _ds-focus_1w6ss_1",ot="_pagination_1aace_1 _ds-pagination_1w6ss_1",nt="_popover_1aace_1",st="_skeleton_1aace_1 _ds-skeleton_1w6ss_1",it="_spinner_1aace_1",at="_table_1aace_1 _ds-table_1w6ss_1",ct="__scrollShadow_1aace_1",dt="_tabs_1aace_1 _ds-tabs_1w6ss_1",lt="_tag_1aace_1 _ds-tag_1w6ss_1",rt="__tooltip_1aace_1",_t="_validation_1aace_1 _ds-validation-message_1w6ss_1",ft="_body_1aace_139",f={alert:B,avatar:P,badge:x,breadcrumbs:D,button:H,card:N,chip:V,details:Y,dialog:R,_fadein:U,divider:W,errorsummary:F,field:j,affixes:G,count:X,fieldset:q,heading:z,input:K,grid:Q,flex:J,app:Z,link:tt,logo:et,pagination:ot,popover:nt,skeleton:st,spinner:it,table:at,_scrollShadow:ct,tabs:dt,tag:lt,_tooltip:rt,validation:_t,body:ft},Ht=Object.freeze(Object.defineProperty({__proto__:null,_fadein:U,_scrollShadow:ct,_tooltip:rt,affixes:G,alert:B,app:Z,avatar:P,badge:x,body:ft,breadcrumbs:D,button:H,card:N,chip:V,count:X,default:f,details:Y,dialog:R,divider:W,errorsummary:F,field:j,fieldset:q,flex:J,grid:Q,heading:z,input:K,link:tt,logo:et,pagination:ot,popover:nt,skeleton:st,spinner:it,table:at,tabs:dt,tag:lt,validation:_t},Symbol.toStringTag,{value:"Module"})),ut=f.field.split(" ")[0],pt=f.validation.split(" "),Nt=pt[0];function Vt(t){for(const e of t){const o=[],n=[];let s=null,a=!0;for(const i of e.getElementsByTagName("*"))i instanceof HTMLLabelElement?o.push(i):I(i)?s=i:i.classList.contains(Nt)?(a=i.getAttribute("data-color")==="success",n.unshift(S(i))):i instanceof HTMLParagraphElement&&n.push(S(i));if(s){for(const i of o)i.htmlFor=S(s);mt(s),d(s,"aria-describedby",n.join(" ")),d(s,"aria-invalid",`${!a}`)}}}function bt({target:t}){I(t)&&mt(t)}function mt(t){const e=t==null?void 0:t.nextElementSibling,o=e==null?void 0:e.getAttribute("data-count");if(e&&o){const n=Number(o)-t.value.length,s=n<0;if(e.getAttribute("aria-live")==="polite"!==s){d(e,"aria-live",s?"polite":"off");for(const i of pt)e.classList.toggle(i,s)}e.textContent=`${Math.abs(n)} tegn ${s?"for mye":"igjen"}`}}function Yt(t){m(t,ut,Vt),r(t,"input",bt,c)}function Rt(t){m(t,ut,!1),h(t,"input",bt,c)}const gt=f.fieldset.split(" ")[0],Ut=f.validation.split(" ")[0];function Wt(t){for(const e of t){const o=[];let n="";for(const s of e.getElementsByTagName("*"))s.classList.contains(Ut)?n=S(s):I(s)&&o.push(s);if(n)for(const s of o)d(s,"aria-describedby",n),d(s,"aria-invalid","true")}}const Ft=t=>m(t,gt,Wt),jt=t=>m(t,gt,!1),vt=f.app.split(" ")[0],Gt=`.${vt} > header + :not(main) > button:empty:first-child`,ht=({target:t})=>{const e=(t==null?void 0:t.nodeName)==="BUTTON"&&(t==null?void 0:t.closest(Gt));if(!e)return;const o=e.closest(`.${vt} > *`),n=()=>o==null?void 0:o.setAttribute("data-expanded",`${(o==null?void 0:o.getAttribute("data-expanded"))==="false"}`);document.startViewTransition?document.startViewTransition(()=>n()):n()};function Xt(t){r(t,"click",ht,c)}function qt(t){h(t,"click",ht,c)}function zt(t){r(t,"toggle",Tt,c),r(t,"click",yt)}function Kt(t){h(t,"toggle",Tt,c),h(t,"click",yt)}const wt=f.popover.split(" ")[0];function Tt({target:t,newState:e}){var o;if(t instanceof HTMLElement&&t.classList.contains(wt)){const n=(o=t.getRootNode())==null?void 0:o.querySelector(`[popovertarget="${t.id}"]`);e==="closed"?w(t,!1):n&&w(t,n,t.getAttribute("data-position")||"bottom")}}function yt({target:t}){var o,n;const e=(o=t==null?void 0:t.closest)==null?void 0:o.call(t,"a");if(e){const s=e.getRootNode(),a=((n=s.getElementById)==null?void 0:n.call(s,d(e,"popovertarget")||""))||e.closest(`.${wt}`),i=d(e,"popovertargetaction")||"toggle";a==null||a.togglePopover(i==="show"||(i==="hide"?!1:void 0))}}const St=f.table.split(" ")[0];function Qt(t){var e,o;for(const n of t)if(n instanceof HTMLTableElement){const s=Array.from(((o=(e=n.tHead)==null?void 0:e.rows[0])==null?void 0:o.cells)||[],a=>{var i;return(i=a.innerText)==null?void 0:i.trim()});for(const a of n.tBodies)for(const i of a.rows)for(const g of i.cells)d(g,"data-th",s[g.cellIndex]||":empty")}}const Jt=t=>m(t,St,Qt),Zt=t=>m(t,St,!1),te=f._tooltip.split(" "),Mt="aria-describedby",Lt="Escape",A="aria-labelledby",ee="--mtds-tooltip-position",oe=100,E="mtds-tooltip";let u=null,At=Number.NEGATIVE_INFINITY,Et=0,l=null;function $({target:t,type:e,key:o}){if(e==="keydown"&&o!==Lt)return;const n=At+oe-Date.now();clearTimeout(Et),Et=setTimeout(ne,Math.max(n,0),o===Lt?null:t)}function ne(t){var a;if(At=Date.now(),!l||t===l)return;let e=((a=t==null?void 0:t.closest)==null?void 0:a.call(t,"[data-tooltip]"))||null;if(e===u)return;const o=(e==null?void 0:e.getAttribute("data-tooltip"))||"",n=(e==null?void 0:e.getAttribute("data-tooltip-position"))||window.getComputedStyle(e||document.body).getPropertyValue(ee)||"top",s=!!(e!=null&&e.innerText.trim())||(e==null?void 0:e.hasAttribute(A))||(e==null?void 0:e.hasAttribute("aria-label"));(!o||o==="false"||o==="true"||n==="none")&&(e=null),e&&(l.textContent=o),u==null||u.removeAttribute(u.getAttribute(A)===E?A:Mt),w(l,!1),u=e,u==null||u.setAttribute(s?Mt:A,E),l.togglePopover(!!e),w(l,e,n)}y&&!document.getElementById(E)&&(l=document.body.appendChild(document.createElement("div")),l.classList.add(...te),l.id=E,d(l,"popover","manual"),r(document,"blur,focus,mouseout,mouseover",$,c),r(window,"keydown",$,c),r(window,"blur",$,c));const se=(t,e,o)=>{const n=(o-1)/2,s=Math.max(Math.min(t-Math.floor(n),e-o+1),1),a=Math.min(Math.max(t+Math.ceil(n),o),e),i=Array.from({length:a+1-s},(g,C)=>C+s);return o>4&&s>1&&i.splice(0,2,1,0),o>3&&a<e&&i.splice(-2,2,0,e),i},ie=({current:t=1,total:e=10,show:o=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:se(t,e,o).map((n,s)=>({current:n===t&&"page",key:`key-${n}-${s}`,page:n}))});if(y){const t=document.readyState==="loading",e=()=>It(document.body);t?document.addEventListener("DOMContentLoaded",e):e()}function It(t){xt(t),Yt(t),Ft(t),Xt(t),zt(t),Jt(t)}function ae(t){Dt(t),Rt(t),jt(t),qt(t),Kt(t),Zt(t)}return p.observe=It,p.pagination=ie,p.styles=Ht,p.unobserve=ae,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p}({});
2
2
  //# sourceMappingURL=index.iife.js.map