var D=Object.defineProperty;var G=(e,t,n)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var C=(e,t,n)=>(G(e,typeof t!="symbol"?t+"":t,n),n);import{l as h,d as M,c as F,e as j,k as W,f as Q,g as T,S as y,o as U}from"./vendor-5350ab81.js";import{P as m,T as K}from"./index-f7321891.js";import{a as X,s as Y}from"./secure-cookie-7b8f2436.js";const x=()=>new DOMException("The request is not allowed","NotAllowedError"),J=async e=>{if(!navigator.clipboard)throw x();return navigator.clipboard.writeText(e)},Z=async e=>{const t=document.createElement("span");t.textContent=e,t.style.whiteSpace="pre",t.style.userSelect="all",document.body.appendChild(t);const n=window.getSelection(),a=window.document.createRange();n.removeAllRanges(),a.selectNode(t),n.addRange(a);let i=!1;try{i=window.document.execCommand("copy")}finally{n.removeAllRanges(),window.document.body.removeChild(t)}if(!i)throw x()},z=async e=>{try{await J(e),h.debug("Async: Copying to clipboard was successful!")}catch(t){try{await Z(e),h.debug("Fallback: Copying to clipboard was successful!")}catch(n){throw h.debug("Fallback: Unable to copy to clipboard."),t||n||x()}}};class tt{constructor(t,n){C(this,"overflowSlotTmpl",` ... `);C(this,"getNumSlotTmpl",(t,n,a)=>` ${n} `);var a,i,o,c,l,r,s;this.nav=document.querySelector(t),this.section=(a=this.nav)==null?void 0:a.closest("section"),this.pages=(i=this.section)==null?void 0:i.querySelectorAll(n),this.slots=(o=this.nav)==null?void 0:o.querySelectorAll("li.usa-pagination__item:not(.usa-pagination__arrow)"),this.prevItemLink=(c=this.nav)==null?void 0:c.querySelector("a.usa-pagination__previous-page"),this.nextItemLink=(l=this.nav)==null?void 0:l.querySelector("a.usa-pagination__next-page"),this.prevItem=(r=this.prevItemLink)==null?void 0:r.parentNode,this.nextItem=(s=this.nextItemLink)==null?void 0:s.parentNode,this.fisrtSlot=[],this.lastSlot=[]}getLabel(t){var n,a,i;return((i=(a=(n=this.pages)==null?void 0:n[t-1])==null?void 0:a.querySelector("img"))==null?void 0:i.getAttribute("alt"))||`${t}`}init(){var a,i,o,c;if(h.debug("pagination init"),!((a=this.pages)!=null&&a.length)||!((i=this.slots)!=null&&i.length))return;h.debug(`pagination init with ${this.pages.length} pages`),h.debug(`pagination init with ${this.slots.length} slots`);const t=(o=this.pages)==null?void 0:o.length,n=(c=this.slots)==null?void 0:c.length;this.fisrtSlot=[1,this.getLabel(1)],this.lastSlot=[t,this.getLabel(t)],this.nav.querySelectorAll("li.usa-pagination__item").forEach(l=>{l.addEventListener("click",r=>{if(r.preventDefault(),!("page"in l.dataset))return;const s=parseInt(this.nav.dataset.currentPage,10)||1,u=parseInt(l.dataset.page,10);u===s||u<1||u>t||this.updateNav(u,s,t,n)})})}updateSearchParam(t){const n=new URL(window.location.href);n.searchParams.set("page",t),window.history.replaceState({path:n.href},"",n.href)}updateNav(t,n,a,i){this.nav.dataset.currentPage=`${t}`,this.updateSearchParam(t),this.pages[t-1].hidden=!1,this.pages[n-1].hidden=!0,this.prevItem.dataset.page=`${t-1}`,this.prevItemLink.hidden=t-1<1,this.nextItem.dataset.page=`${t+1}`,this.nextItemLink.hidden=t+1>a;const o=Array(i).fill([]),c=Math.floor(i/2),l=i-c-1;let r=t-c;r<1||a<=i?r=1:t+l>a&&(r=a-i+1);for(let s=0;s=7&&(o[0]=this.fisrtSlot,o[i-1]=this.lastSlot,o[1]=o[1][0]>2?[]:o[1],o[i-2]=o[i-2][0]{const[d,b]=o[u];if(!d){s.innerHTML=this.overflowSlotTmpl,s.setAttribute("aria-label","ellipsis indicating non-visible pages"),s.classList.add("usa-pagination__overflow"),s.classList.remove("usa-pagination__page-no"),delete s.dataset.page;return}const p=d===t;s.innerHTML=this.getNumSlotTmpl(d,b.trim(),p),s.dataset.page=`${d}`,s.classList.remove("usa-pagination__overflow"),s.classList.add("usa-pagination__page-no"),s.setAttribute("aria-label","")})}}class et{constructor(){this.switcher=document.querySelector("div.lang-switcher"),this.languageNames=new Intl.DisplayNames(["en"],{type:"language"})}handelClick(t){var c,l;t.preventDefault();const n=t.target,a=(l=(c=this.switcher.querySelector('button[aria-expanded="true"]'))==null?void 0:c.dataset)==null?void 0:l.lang,i=n.dataset.lang;h.debug(`switching to ${i}`);const o=this.switcher.querySelector('button[aria-expanded="true"]');o==null||o.setAttribute("aria-expanded","false"),o.disabled=!1,n.setAttribute("aria-expanded","true"),n.disabled=!0,document.querySelectorAll(`.trans[lang="${a}"]`).forEach(r=>{r.hidden=!0}),document.querySelectorAll(`.trans[lang="${i}"]`).forEach(r=>{r.hidden=!1})}init(){this.switcher&&this.switcher.querySelectorAll("button").forEach(t=>{const n=t.dataset.lang;t.innerText=this.languageNames.of(n),t.addEventListener("click",this.handelClick.bind(this))})}}class nt{constructor(){this.buttons=null}init(){this.buttons=document.querySelectorAll(".d-button[aria-expanded][aria-controls]").forEach(t=>{new it(t)})}}class it{constructor(t){this.$button=t,this.expanded=t.getAttribute("aria-expanded"),this.controls=t.getAttribute("aria-controls"),this.$controlled=document.getElementById(this.controls),this.expanded!=="true"&&this.expanded!=="false"&&(this.expanded="false",t.setAttribute("aria-expanded",this.expanded)),this.displayPanel(),this.$button.addEventListener("click",this.onClick.bind(this))}displayPanel(){this.$controlled&&(this.$controlled.style.display=this.expanded==="true"?"revert":"none")}togglePanel(){this.expanded=this.expanded==="true"?"false":"true",this.$button.setAttribute("aria-expanded",this.expanded),this.displayPanel()}onClick(t){t.preventDefault(),this.togglePanel()}}const L="pmc-resources",at=`
`;var P,q,H;const ot=`
Something Went Wrong.
Please Try Again:
`;class E{constructor(){this.resourceSection=document.querySelector(`.${L}`),this.pagePath=""}getResource(t,n){t.innerHTML=at,E.dataController.getResource(n).then(a=>(t.innerHTML=a,t.querySelectorAll(`.${L}__see_all a`).forEach(i=>{i.dataset.gaLabel=this.pagePath}),null)).catch(()=>{var a;t.innerHTML=ot,(a=t.querySelector("button"))==null||a.addEventListener("click",()=>{this.getResource(t,n)})})}init(){if(!this.resourceSection){h.debug("No resource section found.");return}this.pagePath=this.resourceSection.dataset.pagePath;const t="hidden";this.resourceSection.querySelectorAll("button[data-action-open]").forEach(i=>{i.addEventListener("click",()=>{const o=i.getAttribute("aria-expanded")==="true";i.dataset.gaAction=o?i.dataset.actionOpen:i.dataset.actionClose})});const n=this.resourceSection.querySelectorAll("div[data-source-url]"),a=new MutationObserver(i=>{i.forEach(o=>{if(o.type!=="attributes"||o.attributeName!==t)return;const c=o.target,l=c.hidden,r=c.dataset.sourceUrl,s=c.innerHTML.trim()==="";l||!s||!r||this.getResource(c,r)})});n.forEach(i=>a.observe(i,{attributes:!0,attributeOldValue:!0,attributeFilter:[t]}))}}function st(){let e,t;return{promise:new Promise((a,i)=>{[e,t]=[a,i]}),reject:t,resolve:e}}E.dataController={resourcesLoaded:{},resources:{},async getResource(e){const t=st();if(this.resourcesLoaded[e])return t.resolve(this.resources[e]),t.promise;try{const n=await fetch(e);if(!n.ok)throw new Error("Loading of citation failed.");const a=await n.text();this.resources[e]=a,this.resourcesLoaded[e]=!0,t.resolve(a)}catch{t.reject("Loading of citation failed.")}return t.promise}};class rt{constructor(t){this.articleResources=new E,this.citeBox=null,this.collectionButton=null,this.toast=t}init(){if(h.debug("ArticleNavAdvanced: init"),this.articleResources.init(),this.activateOverlay(),!window.jQuery){h.warn("ArticleNavAdvanced: jQuery not found");return}this.initCiteButton(),this.initFavoritesButton()}activateOverlay(){document.querySelectorAll('.overlay[role="dialog"]').forEach(n=>{n.hidden=!1})}initCiteButton(){if(!window.ctxp){h.warn("ArticleNavAdvanced: ctxp not found");return}const t=window.ctxp.CiteBox,n=window.jQuery,a=window.ncbi.pmc.options.citeCookieName,i=n(".citation-dialog"),o=n(".citation-dialog-trigger"),c=X(a)||o.data("citation-style");o.data("citation-style",c),this.citeBox=new t(i,o),i.on("copy-event",(l,r,s,u)=>{var d;n(l.target).is(":visible")&&((d=this.toast)==null||d.info(u))}),i.on("change-event",(l,r,s,u)=>{Y(a,u,{expires:365*5})})}initFavoritesButton(){const t=window.jQuery,n=document.querySelector("[data-article-id]");this.collectionButton=new window.exports.CollectionsButton(t(n))}}const _="pmc-permalink",R=`${_}__dropdown`,ct=`${R}__copy__btn`;class lt{constructor(t,n){this.container=document.querySelector(`.${_}`),this.popover=t,this.toast=n}createListener(){const t=this.toast;return function(){var o;const a=(o=this.parentNode)==null?void 0:o.querySelector("input"),i=a==null?void 0:a.value;z(i).then(()=>(t.info("Permalink successfully copied."),null)).catch(()=>{t==null||t.error("Can't copy permalink. Please select text and press Ctrl+C.")})}}init(){var n;if(!this.container){h.debug("Permalink: no resource found");return}(n=this.popover)==null||n.add(document==null?void 0:document.querySelectorAll(`.${_} button`),a=>{var i,o;return(o=(i=a==null?void 0:a.closest(`.${_}`))==null?void 0:i.querySelector(`.${R}`))==null?void 0:o.innerHTML},{appendTo:"parent",trigger:"click",placement:"bottom-end",aria:null,maxWidth:"none",theme:"dropdown",plugins:[m.hideOnEsc,m.hideOnPopperBlur,m.menuBehavior],onShown(a){var o;const i=(o=a==null?void 0:a.popper)==null?void 0:o.querySelector("input");i==null||i.focus(),i==null||i.select()}});const t=this.createListener();document.body.addEventListener("click",M(`.${ct}`,t))}}const I=`${T.prefix}-current`,dt="On this page",ut="h4",ht=.1,pt="0px 0px 0px 0px",gt="1",f=`${T.prefix}-in-page-nav`,mt=`${f}__nav`,B=`${f}__list`,O=`${f}__item`,S=`${f}__link`,ft=`${f}__heading`,bt=`${O}--sub-item`,vt=`${T.prefix}-anchor`,wt="main",yt=e=>{const t=document.querySelectorAll(`.${S}`);e.map(n=>{var a;return n.isIntersecting===!0&&n.intersectionRatio>=1?(t.forEach(i=>i.classList.remove(I)),(a=document.querySelector(`.${B} a[href="#${n.target.dataset.anchorId}"]`))==null||a.classList.add(I),!0):!1})},At=e=>{const t=document.querySelectorAll(`${e} .main-article-body h2:not(.obj_head), ${e} article.sub-article h1`);return Array.from(t).filter(i=>{const o=window.getComputedStyle(i);return o.getPropertyValue("display")!=="none"&&o.getPropertyValue("visibility")!=="hidden"})},_t=e=>{let t;return e&&e.nodeType===1?t=e.getAttribute("href").replace("#",""):t=e.target.hash.replace("#",""),t},$=e=>{const t=Math.floor(window.innerHeight*ht);window.scroll({behavior:"smooth",top:e.getBoundingClientRect().top+window.scrollY-t,block:"start"}),window.location.hash.slice(1)!==e.id&&window.history.pushState(null,"",`#${e.id}`)},Lt=()=>{const e=window.location.hash.slice(1);if(e){const t=document.getElementById(e);t&&$(t)}},St=e=>{const t=y.escapeHTML`${e.dataset.titleText||dt}`,n=y.escapeHTML`${e.dataset.titleHeadingLevel||ut}`,a=y.escapeHTML`${e.dataset.rootMargin||pt}`,i=y.escapeHTML`${e.dataset.threshold||gt}`,o=y.escapeHTML`${e.dataset.mainContentSelector||wt}`,c={root:null,rootMargin:a,threshold:[i]},l=At(o);if(!l.length){e.hidden=!0;return}e.hidden=!1;const r=document.createElement("nav");r.setAttribute("aria-label",t),r.classList.add(mt);const s=document.createElement(n);s.classList.add(ft),s.setAttribute("tabindex","0"),s.textContent=t,r.appendChild(s);const u=document.createElement("ul");u.classList.add(B),r.appendChild(u);const d=[];l.forEach(p=>{const N=p.closest("section[id], article.sub-article[id]");if(!N)return;const v=N.getAttribute("id"),A=document.createElement("li"),g=document.createElement("a"),w=document.createElement("a"),k=p.textContent,V=p.tagName.toLowerCase();A.classList.add(O),V==="h3"&&A.classList.add(bt),g.dataset.anchorId=v,g.setAttribute("href",`#${v}`),g.setAttribute("class",S),g.dataset.gaCategory="article_side_nav",g.dataset.gaAction="click",g.dataset.gaLabel=k,g.textContent=k,w.setAttribute("id",`${v}-anchor`),w.dataset.anchorId=v,w.setAttribute("class",vt),p.insertAdjacentElement("afterbegin",w),d.push(w),p.dataset.anchorId=v,u.appendChild(A),A.appendChild(g)}),e.appendChild(r);const b=new window.IntersectionObserver(yt,c);d.forEach(p=>{b.observe(p)})},Et=e=>{const t=document.getElementById(e.hash.slice(1));$(t)},Ct=e=>{const t=_t(e),n=document.getElementById(t),a=n.parentElement;a&&(a.setAttribute("tabindex",0),a.focus(),a.addEventListener("blur",U(()=>{a.setAttribute("tabindex",-1)}))),$(n)},Tt=F({[j.CLICK]:{[`.${S}`](e){e.preventDefault(),!this.disabled&&Et(this)}},keydown:{[`.${S}`]:W({Enter:Ct})}},{init(e){Q(`.${f}`,e).forEach(t=>{St(t),Lt()})}}),xt={name:"addToSearch",defaultValue:!0,fn(e){const t=document.querySelector("#pmc-search"),a=M('a[data-add-to-search="true"]',i=>{i.preventDefault();const c=i.target.getAttribute("href");t.value=decodeURI(c.split("=").slice(-1).pop()),e.hide()});return{onShow(){document.body.addEventListener("click",a)},onHide(){document.body.removeEventListener("click",a)}}}};window.ncbi=window.ncbi||{};window.ncbi.pmc=window.ncbi.pmc||{};window.ncbi.pmc.articlePage={init(){var r;h.debug("articlePage.init");const e=new m,t=new K;t.init();const n=new et,a=new nt,i=new tt(".pmc-pagination__scanned",".fig-scanned"),o=new rt(t),c=new lt(e,t);n.init(),a.init(),i.init(),o.init(),c.init(),Tt.on();const l=document.querySelector(".pmc-prose");e.add('a[aria-describedby]:not([aria-describedby=""]):not([data-position])',s=>{const u=s.getAttribute("aria-describedby"),d=document.getElementById(u),b=d==null?void 0:d.innerHTML,p=!(d!=null&&d.hidden)&&`[Ref list]`||"";return`${b}${p}`},{appendTo:()=>l,touch:!1,placement:"bottom",maxWidth:"none",inlinePositioning:!0,plugins:[m.inlinePositioning],theme:"dropdown"}),e==null||e.add((r=document==null?void 0:document.querySelector(".pmc-layout__citation"))==null?void 0:r.querySelectorAll(' button:not([aria-controls=""])'),s=>{var d;const u=s.getAttribute("aria-controls");return(d=document==null?void 0:document.querySelector(`#${u}`))==null?void 0:d.innerHTML},{appendTo:"parent",arrow:!1,theme:"menu",trigger:"click",placement:"bottom-start",aria:null,plugins:[m.hideOnEsc,m.hideOnPopperBlur,m.menuBehavior,xt]})}};window.ncbi.pmc.articlePage.init();