1import{highlightSearchTerm}from"./highlight-search-term.js";const normalize=e=>(e??"").toString().trim().toLowerCase(),normalizeDoi=e=>normalize(e).replace(/^https?:\/\/(dx\.)?doi\.org\//,"").replace(/^doi:\s*/,""),CONTACT_EMAIL="[email protected]",CROSSREF_WORKS_ENDPOINT="https://api.crossref.org/works",parseNumber=e=>{const t=(e??"").toString().replace(/,/g,"").match(/-?\d+(\.\d+)?/);if(!t)return 0;const o=Number.parseFloat(t[0]);return Number.isFinite(o)?o:0},splitDelimited=e=>normalize(e).split("||").map(e=>e.trim()).filter(Boolean),createElement=(e,t="")=>{const o=document.createElement(e);return t&&(o.className=t),o},isJapanesePage=document.documentElement.lang.toLowerCase().startsWith("ja"),OTHER_FACET_VALUE="__other__",ARTICLE_TYPE_ORIGINAL="__article_type_original__",ARTICLE_TYPE_PREPRINT="__article_type_preprint__",ARTICLE_TYPE_REVIEW_OTHERS="__article_type_review_others__",AUTHOR_ROLE_FIRST_VALUE="__author_role_first__",AUTHOR_ROLE_CORRESPONDING_VALUE="__author_role_corresponding__",AUTHOR_ROLE_EITHER_VALUE="__author_role_either__",AUTHOR_ROLE_BOTH_VALUE="__author_role_both__",articleTypeFacetValue=e=>{const t=normalize(e);return"original"===t?ARTICLE_TYPE_ORIGINAL:"preprint"===t?ARTICLE_TYPE_PREPRINT:ARTICLE_TYPE_REVIEW_OTHERS},i18n={all:isJapanesePage?"\u3059\u3079\u3066":"All",any:isJapanesePage?"\u4efb\u610f":"Any",showing:isJapanesePage?"\u8868\u793a\u4e2d":"Showing",sortedResults:isJapanesePage?"\u4e26\u3073\u66ff\u3048\u7d50\u679c":"Sorted results",newest:isJapanesePage?"\u65b0\u7740\u9806":"Newest",noResults:isJapanesePage?"\u8a72\u5f53\u3059\u308b\u8ad6\u6587\u304c\u3042\u308a\u307e\u305b\u3093\u3002":"No matching publications.",badgeIdle:isJapanesePage?"\u5916\u90e8\u30d0\u30c3\u30b8\u306f\u672a\u8aad\u8fbc\u3067\u3059\u3002":"External badges are not loaded yet.",badgeLoading:isJapanesePage?"\u5916\u90e8\u30d0\u30c3\u30b8\u3092\u8aad\u307f\u8fbc\u307f\u4e2d...":"Loading external badges...",badgeLoaded:isJapanesePage?"\u5916\u90e8\u30d0\u30c3\u30b8\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3057\u305f\u3002":"External badges loaded.",badgeError:isJapanesePage?"\u5916\u90e8\u30d0\u30c3\u30b8\u306e\u8aad\u307f\u8fbc\u307f\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002":"Failed to load external badges.",citationHydrating:isJapanesePage?"\u88ab\u5f15\u7528\u6570\u3092\u66f4\u65b0\u4e2d...":"Refreshing citation counts...",citationHydrated:isJapanesePage?"\u88ab\u5f15\u7528\u6570\u3092\u66f4\u65b0\u3057\u307e\u3057\u305f\u3002":"Citation counts refreshed.",leadRoleLabel:isJapanesePage?"(\u5171)\u7b46\u982d\u307e\u305f\u306f(\u5171)\u8cac\u4efb\u8457\u8005\u306b\u7814\u7a76\u5ba4\u30e1\u30f3\u30d0\u30fc\u3092\u542b\u3080":"Lab members among (co-)first or (co-)corresponding authors",otherRoleLabel:isJapanesePage?"\u305d\u308c\u4ee5\u5916":"Other",paperCountAxisLabel:isJapanesePage?"\u8ad6\u6587\u6570":"Number of publications",firstAuthorRoleFacetOption:isJapanesePage?"(\u5171)\u7b46\u982d":"(co-)first",correspondingAuthorRoleFacetOption:isJapanesePage?"(\u5171)\u8cac\u4efb":"(co-)corresponding",eitherAuthorRolesFacetOption:isJapanesePage?"\u3044\u305a\u308c\u304b":"either",bothAuthorRolesFacetOption:isJapanesePage?"\u4e21\u65b9":"both",otherFacetOption:isJapanesePage?"\u3069\u3061\u3089\u3067\u3082\u306a\u3044":"neither",crossrefSortLabel:isJapanesePage?"\u88ab\u5f15\u7528\u9806\uff08Crossref\uff09":"Citation (Crossref)",dimensionsSortLabel:isJapanesePage?"\u88ab\u5f15\u7528\u9806\uff08Dimensions\uff09":"Citation (Dimensions)",altmetricSortLabel:"Altmetric",altmetricHint:isJapanesePage?"Altmetric\u9806\u306f`altmetric_score`\u304c\u3042\u308b\u8ad6\u6587\u3092\u512a\u5148\u3057\u3066\u4e26\u3073\u66ff\u3048\u307e\u3059\u3002":"Altmetric sort prioritizes publications with `altmetric_score` metadata."},trackAnalyticsEvent=(e,t={})=>{if(!e)return;const o={page_path:window.location.pathname,...t};"function"!=typeof window.trackSiteEvent?"function"!=typeof window.gtag?(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:e,...o})):window.gtag("event",e,o):window.trackSiteEvent(e,o)},defaultFacetConfig=[{id:"facet-year",key:"year",labeler:e=>e.toString()},{id:"facet-article-type",key:"articleType",labeler:e=>e,fixedOptions:[{value:ARTICLE_TYPE_ORIGINAL,label:"Original"},{value:ARTICLE_TYPE_PREPRINT,label:"Preprint"},{value:ARTICLE_TYPE_REVIEW_OTHERS,label:"Review / Other"}]},{id:"facet-author-role",key:"authorRole",labeler:e=>e,defaultLabel:i18n.any,fixedOptions:[{value:AUTHOR_ROLE_FIRST_VALUE,label:i18n.firstAuthorRoleFacetOption},{value:AUTHOR_ROLE_CORRESPONDING_VALUE,label:i18n.correspondingAuthorRoleFacetOption},{value:AUTHOR_ROLE_EITHER_VALUE,label:i18n.eitherAuthorRolesFacetOption},{value:AUTHOR_ROLE_BOTH_VALUE,label:i18n.bothAuthorRolesFacetOption},{value:OTHER_FACET_VALUE,label:i18n.otherFacetOption}]}];document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector(".publications"),t=document.getElementById("bibsearch");if(!e||!t)return;const o=document.getElementById("pub-sort"),a=document.getElementById("pub-reset-filters"),r=
1document.getElementById("pub-load-badges"),n=document.getElementById("pub-active-count"),i=document.getElementById("pub-badge-status"),l=Array.from(e.querySelectorAll("ol.bibliography > li"));if(!l.length)return;const s=l.map((e,t)=>{const o=e.querySelector(".publication-entry");if(!o)return null;const a=Number.parseInt(o.dataset.year??"0",10)||0,r=Number.parseInt(o.dataset.month??"0",10)||0,n=normalize(o.dataset.firstAuthor),i=splitDelimited(o.dataset.corresponding),l=splitDelimited(o.dataset.coFirst),s=splitDelimited(o.dataset.labMembers),c=articleTypeFacetValue(o.dataset.articleType),d=parseNumber(o.dataset.crossrefCount??o.dataset.citationCount),u=parseNumber(o.dataset.dimensionsCount),m=parseNumber(o.dataset.altmetricScore),p=normalizeDoi(o.dataset.doi),h=new Set(s),g=n&&h.has(n)||l.some(e=>h.has(e)),b=i.some(e=>h.has(e));let _=OTHER_FACET_VALUE;return g&&b?_=AUTHOR_ROLE_BOTH_VALUE:g?_=AUTHOR_ROLE_FIRST_VALUE:b&&(_=AUTHOR_ROLE_CORRESPONDING_VALUE),{index:t,listItem:e,publicationEntry:o,title:normalize(e.querySelector(".publication-title .title")?.textContent),searchText:normalize(e.textContent),year:a,month:r,articleType:c,firstAuthor:n,corresponding:i,coFirst:l,labMembers:s,citationCount:d,dimensionsCitationCount:u,altmetricScore:m,hasLabFirstAuthorRole:g,hasLabCorrespondingAuthorRole:b,authorRole:_,leadRole:g||b,doi:p}}).filter(Boolean),c=s.some(e=>Boolean(e.listItem.querySelector(".altmetric-embed"))),d=s.map(e=>e.year).filter(e=>Number.isInteger(e)&&e>0),u=d.length?Math.min(...d):(new Date).getFullYear(),m=d.length?Math.max(...d):u,p=Array.from({length:m-u+1},(e,t)=>(u+t).toString()),h=createElement("div","publications-results");h.id="publications-results",e.querySelectorAll("h2.bibliography, ol.bibliography").forEach(e=>e.remove()),e.appendChild(h);let g=o?.value||"newest";"citations"===g&&(g="crossref-citations",o&&(o.value="crossref-citations"));let b="idle",_=null,E=null,y=0,f=!1,R=!1,C=null,A=null,L=null,T="",O=0,I={byYear:null};c||(r&&(r.style.display="none"),i&&(i.style.display="none"));const v=(e,t="")=>{b=e,i&&(i.textContent=t||("loading"===e?i18n.badgeLoading:"loaded"===e?i18n.badgeLoaded:"error"===e?i18n.badgeError:i18n.badgeIdle))},w=(e,t,o,a=[],r=i18n.all)=>{const n=document.getElementById(e);if(!n)return;const i=n.value;n.innerHTML="";const l=document.createElement("option");l.value="",l.textContent=r,n.appendChild(l),a.forEach(e=>{const t=document.createElement("option");t.value=e.value,t.textContent=e.label,n.appendChild(t)}),t.forEach(e=>{const t=document.createElement("option");t.value=e,t.textContent=o(e),n.appendChild(t)}),i&&Array.from(n.options).some(e=>e.value===i)&&(n.value=i)},S=()=>{defaultFacetConfig.forEach(e=>{if(e.fixedOptions)return void w(e.id,[],e.labeler,e.fixedOptions,e.defaultLabel||i18n.all);const t=e.isList?s.flatMap(t=>t[e.key]):s.map(t=>"year"===e.key?t.year.toString():t[e.key]),o=[...new Set(t.filter(Boolean))],a="year"===e.key?o.sort((e,t)=>Number.parseInt(t,10)-Number.parseInt(e,10)):o.sort((e,t)=>e.localeCompare(t));w(e.id,a,e.labeler,[],e.defaultLabel||i18n.all)})},P=()=>{const e={};return defaultFacetConfig.forEach(t=>{const o=document.getElementById(t.id);e[t.key]=normalize(o?.value)}),e},x=(e,t,o)=>!(t&&!e.searchText.includes(t))&&((!o.year||e.year.toString()===o.year)&&((!o.articleType||e.articleType===o.articleType)&&(!(o.authorRole===AUTHOR_ROLE_FIRST_VALUE&&!e.hasLabFirstAuthorRole)&&(!(o.authorRole===AUTHOR_ROLE_CORRESPONDING_VALUE&&!e.hasLabCorrespondingAuthorRole)&&(!(o.authorRole===AUTHOR_ROLE_EITHER_VALUE&&!e.hasLabFirstAuthorRole&&!e.hasLabCorrespondingAuthorRole)&&(!!(o.authorRole!==AUTHOR_ROLE_BOTH_VALUE||e.hasLabFirstAuthorRole&&e.hasLabCorrespondingAuthorRole)&&(o.authorRole!==OTHER_FACET_VALUE||!e.hasLabFirstAuthorRole&&!e.hasLabCorrespondingAuthorRole))))))),N=(e,t)=>e.year!==t.year?t.year-e.year:e.month!==t.month?t.month-e.month:e.index-t.index,F=e=>"crossref-citations"===e||"citations"===e,k=e=>F(e)?i18n.crossrefSortLabel:"dimensions-citations"===e?i18n.dimensionsSortLabel:"altmetric"===e?i18n.altmetricSortLabel:i18n.newest,U=e=>{const t=[...e];return F(g)?(t.sort((e,t)=>
1t.citationCount!==e.citationCount?t.citationCount-e.citationCount:N(e,t)),t):"dimensions-citations"===g?(t.sort((e,t)=>t.dimensionsCitationCount!==e.dimensionsCitationCount?t.dimensionsCitationCount-e.dimensionsCitationCount:N(e,t)),t):"altmetric"===g?(t.sort((e,t)=>t.altmetricScore!==e.altmetricScore?t.altmetricScore-e.altmetricScore:N(e,t)),t):(t.sort(N),t)},H=e=>{if(h.innerHTML="",!e.length){const e=createElement("p","pub-empty-state");return e.textContent=i18n.noResults,void h.appendChild(e)}if("newest"===g){const t=new Map;return e.forEach(e=>{t.has(e.year)||t.set(e.year,[]),t.get(e.year).push(e)}),void[...t.keys()].sort((e,t)=>t-e).forEach(e=>{const o=createElement("h2","bibliography");o.textContent=e.toString();const a=createElement("ol","bibliography");t.get(e).forEach(e=>a.appendChild(e.listItem)),h.append(o,a)})}const t=createElement("h2","bibliography pub-sorted-heading");t.textContent=`${i18n.sortedResults} (${k(g)})`;const o=createElement("ol","bibliography");e.forEach(e=>o.appendChild(e.listItem)),h.append(t,o)},V=e=>{n&&(n.textContent=`${i18n.showing}: ${e} / ${s.length}`)},J=e=>{if("undefined"!=typeof CSS&&"highlights"in CSS&&CSS.highlights)try{highlightSearchTerm({search:e,selector:"#publications-results li"})}catch{}},$=()=>{const e=getComputedStyle(document.documentElement);return{themeColor:e.getPropertyValue("--global-theme-color").trim()||"#2f7f75",textColor:e.getPropertyValue("--global-text-color").trim()||"#334155",dividerColor:e.getPropertyValue("--global-divider-color").trim()||"#cbd5e1",secondaryColor:e.getPropertyValue("--global-text-color-light").trim()||"#94a3b8"}},B=()=>!!window.Chart||(O+=1,O>20||setTimeout(()=>D(oe),300),!1),z=(e,t,o,a,r,n={})=>{const i=document.getElementById(t);if(!i)return;const l=$();if(I[e])return I[e].data.labels=a,I[e].data.datasets=r,void I[e].update();I[e]=new window.Chart(i,{type:o,data:{labels:a,datasets:r},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!0,labels:{color:l.textColor}}},scales:{x:{ticks:{color:l.textColor},grid:{color:l.dividerColor}},y:{ticks:{color:l.textColor,precision:0},grid:{color:l.dividerColor}}},...n}})},D=e=>{if(!B())return;const t=new Map(p.map(e=>[e,{lead:0,other:0}]));e.forEach(e=>{const o=e.year.toString();if(!t.has(o))return;const a=t.get(o);e.leadRole?a.lead+=1:a.other+=1});const o=p,a=$(),r=o.map(e=>t.get(e).lead),n=o.map(e=>t.get(e).other),i=(e,t,r,n)=>{const i=Math.max(0,...e);return Array.from({length:i},(i,l)=>({label:t,data:o.map((t,o)=>e[o]>l?1:0),backgroundColor:r,borderColor:a.dividerColor,borderWidth:1,borderSkipped:!1,stack:"publication-counts",unitRole:n,unitLevel:l}))},l=[...i(r,i18n.leadRoleLabel,a.themeColor,"lead"),...i(n,i18n.otherRoleLabel,a.secondaryColor,"other")];z("byYear","pub-chart-year","bar",o,l,{plugins:{legend:{display:!0,labels:{color:a.textColor,filter:(e,t)=>{const o=t.datasets?.[e.datasetIndex];return 0===o?.unitLevel}}},tooltip:{callbacks:{label:e=>{const t=e.dataset;if(!t||0!==t.unitLevel)return null;const o=e.dataIndex;return"lead"===t.unitRole?`${i18n.leadRoleLabel}: ${r[o]}`:`${i18n.otherRoleLabel}: ${n[o]}`}}}},scales:{x:{stacked:!0,ticks:{color:a.textColor},grid:{color:a.dividerColor}},y:{stacked:!0,beginAtZero:!0,ticks:{color:a.textColor,precision:0,stepSize:1},title:{display:!0,text:i18n.paperCountAxisLabel,color:a.textColor},grid:{color:a.dividerColor}}}})},M=()=>C||(C=fetch("/assets/data/citation-counts.json",{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{const t=e?.counts;if(!t||"object"!=typeof t)return;let o=!1;s.forEach(e=>{const a=normalizeDoi(e.doi);if(!a)return;const r=parseNumber(t[a]);r>e.citationCount&&(e.citationCount=r,o=!0)}),o&&F(g)&&ae()}).catch(()=>{}),C),Y=(e,t)=>new Promise((o,a)=>{const r=document.getElementById(e);if(r)return void o(r);const n=document.createElement("script");n.id=e,n.src=t,n.async=!0,n.onload=()=>o(n),n.onerror=()=>a(new Error(`Failed to load ${t}`)),document.head.appendChild(n)}),q=()=>{"function"==typeof window._altmetric_embed_init&&window._altmetric_embed_init()},j=e=>{if(!e)return 0;const t=[e.getAttribute("data-score"),e.getAttribute("data-altmetric-score"),e.getAttribute("aria-label"),e.getAttribute("title"),e.dataset?.score,e.textContent,...Array.from(e.querySelectorAll("a, span, img")).map(e=>"IMG"===e.tagName?e.getAttribute("alt"):`${e.getAttribute("aria-label")||""} ${e.textContent||""}`.trim())];for(const e of t){const t=parseNumber(e);if(t>0)return t}return 0},G=e=>{if(!e||"object"!=typeof e)return!1;const t=parseNumber(e.score);if(t<=0)return!1;const o=normalizeDoi(e.doi),a=normalize(e.altmetric_id);let r=!1;
1return s.forEach(e=>{const n=e.listItem.querySelector(".altmetric-embed"),i=normalizeDoi(n?.dataset?.doi||n?.getAttribute("data-doi")),l=normalize(n?.dataset?.altmetricId||n?.getAttribute("data-altmetric-id"));(o&&(e.doi===o||i===o)||a&&l&&a===l)&&t>e.altmetricScore&&(e.altmetricScore=t,r=!0)}),r},W=()=>{let e=!1;return s.forEach(t=>{const o=t.listItem.querySelector(".altmetric-embed");if(!o)return;const a=j(o);a>t.altmetricScore&&(t.altmetricScore=a,e=!0)}),e},K=()=>{clearTimeout(E),y=0;const e=()=>{y+=1;if(W()&&"altmetric"===g&&ae(),y>=20)return;E=setTimeout(e,y<6?400:1e3)};E=setTimeout(e,250)},Z=()=>{if(f)return;const e=window._altmetric?.embed_callback;"function"==typeof e&&(window._altmetric.embed_callback=(...t)=>{const o=G(t[0]),a=e.apply(window._altmetric,t),r=W();return(o||r)&&"altmetric"===g&&ae(),a},f=!0)},Q=()=>c?_||(v("loading"),_=Y("pub-altmetric-script","https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js").then(()=>{Z(),q(),W(),K(),v("loaded"),trackAnalyticsEvent("publications_badges_loaded",{publication_count:s.length}),ae()}).catch(()=>{v("error"),trackAnalyticsEvent("publications_badges_load_error",{publication_count:s.length})}),_):(v("loaded"),_=Promise.resolve(),_),X=()=>{if(!c)return;if(!("IntersectionObserver"in window))return;const e=s.find(e=>e.listItem.querySelector(".badges"))?.listItem;if(!e)return;const t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(Q(),t.disconnect())},{rootMargin:"120px 0px"});t.observe(e)},ee=async e=>{const t=await fetch(`${CROSSREF_WORKS_ENDPOINT}/${encodeURIComponent(e)}?mailto=${encodeURIComponent(CONTACT_EMAIL)}`);if(!t.ok)return null;const o=await t.json(),a=Number.parseInt(o?.message?.["is-referenced-by-count"],10);return Number.isFinite(a)?a:null},te=async()=>{if(await M(),A)return A;const e=s.filter(e=>e.doi&&e.citationCount<=0);if(!e.length)return Promise.resolve();const t=4;let o=0;return v(b,i18n.citationHydrating),A=Promise.all(Array.from({length:t}).map(async()=>{for(;o<e.length;){const t=o;o+=1;const a=e[t];try{let e=a.citationCount;const t=await ee(a.doi);Number.isFinite(t)&&t>e&&(e=t),e>a.citationCount&&(a.citationCount=e)}catch{}}})).finally(()=>{v(b,i18n.citationHydrated)}),A};let oe=[...s];const ae=()=>{const e=normalize(t.value),o=P(),a=s.filter(t=>x(t,e,o)),r=U(a);H(r),V(r.length),J(e),D(r),"altmetric"===g&&n&&r.every(e=>e.altmetricScore<=0)&&(n.textContent=`${n.textContent} | ${i18n.altmetricHint}`),"loaded"===b&&q(),oe=r},re=()=>{const e=t.value.trim(),o=e?`#${encodeURIComponent(e)}`:"";history.replaceState(null,"",`${window.location.pathname}${window.location.search}${o}`)},ne=()=>{clearTimeout(L),L=setTimeout(()=>{re(),ae();const e=normalize(t.value);e!==T&&(T=e,trackAnalyticsEvent("publications_search",{query_length:e.length}))},250)},ie=()=>{t.value="",defaultFacetConfig.forEach(e=>{const t=document.getElementById(e.id);t&&(t.value="")}
1),o&&(o.value="newest",g="newest"),re(),ae(),trackAnalyticsEvent("publications_filters_reset")},le=()=>{const e=window.location.hash.replace(/^#/,"");try{t.value=decodeURIComponent(e)}catch(o){if(!(o instanceof URIError))throw o;t.value=e}};t.addEventListener("input",ne),window.addEventListener("hashchange",()=>{le(),ae()}),defaultFacetConfig.forEach(e=>{const t=document.getElementById(e.id);t&&t.addEventListener("change",()=>{ae(),trackAnalyticsEvent("publications_filter_change",{filter_name:e.key,filter_value:t.value||"all"})})}),o&&o.addEventListener("change",()=>{g=o.value,ae(),F(g)?(M().finally(()=>{F(g)&&ae()}),R||(R=!0,te()),A&&A.finally(()=>{F(g)&&ae()})):"altmetric"===g&&c&&"loaded"!==b?Q().finally(()=>{"altmetric"===g&&ae()}):"altmetric"===g&&c&&(W(),K(),ae()),trackAnalyticsEvent("publications_sort_change",{sort:g})}),a&&a.addEventListener("click",ie),r&&r.addEventListener("click",()=>{trackAnalyticsEvent("publications_badges_load_click"),Q()}),v("idle"),S(),le(),M(),ae(),X()});
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.