PageSourceSearch

https://www.weizmann.ac.il/pages/sites/default/files/js/js_TanrIkg…_lj0NY_NeU69Jsh96B_pki8RX6NL-6WXYX-aJzo-61Y

js weizmann.ac.il collected 2026-10-01 07:32:37 UTC 147,066 bytes, 270 lines download raw bytes

1/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
2(function(Drupal,once,drupalSettings){'use strict';window.WisAlgoliaSearch=window.WisAlgoliaSearch||{};window.WisAlgoliaSearch.limits={generalMaxValuesPerFacet:1000,generalCollapsed:20,generalCollapsedMobile:5,generalExpanded:100,peopleMaxValuesPerFacet:1000,peopleCollapsed:20,peopleExpanded:100,peopleBrowsePage:50};Drupal.behaviors.wisAlgoliaSearch={attach(context,settings){once('wis-algolia-search','[data-wis-algolia-search]',context).forEach((element)=>{initWisAlgoliaSearch(element,settings.wisAlgoliaSearch||{});});}};const SCIENTIST_NODE_TYPE={en:'Scientist',he:'מדען'};const ARTICLE_NODE_TYPE={en:'Article',he:'כתבה'};const CRAWLED_PAGE_NODE_TYPE={en:'Page',he:'דף'};const MIN_QUERY_LENGTH=2;const MINI_PEOPLE_ROWS=4;const INSTITUTES_QUERY_PARAM='institute';const QUICK_LINK_SLOTS=3;const QUICK_LINK_CANDIDATES=6;const QUICK_LINK_SCAN_DEPTH=20;const QUICK_LINK_ONE_PER_KIND=false;let lastFocusedElement=null;function getFocusableElements(container){return Array.from(container.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter((el)=>el.getClientRects().length>0&&window.getComputedStyle(el).visibility!=='hidden');}function initWisAlgoliaSearch(root,config){const currentLanguage=normalizeLanguage(drupalSettings.path.currentLanguage||document.documentElement.lang||'en');if(!window.algoliasearch){console.error('Algolia client was not loaded.');return;}if(!config.appId||!config.apiKey||!config.generalIndexName){console.error('Missing Algolia settings.');return;}const client=window.algoliasearch(config.appId,config.apiKey);const generalIndex=client.initIndex(config.generalIndexName);const peopleIndexName=config.peopleIndexName||config.generalIndexName;const publicationsUrl=safeUrl(config.publicationsUrl)||'https://weizmann.elsevierpure.com/en/publications/';const shared={root,client,appId:config.appId,apiKey:config.apiKey,generalIndex,generalIndexName:config.generalIndexName,peopleIndexName,publicationsUrl,institutesUrl:safeUrl(config.institutesUrl),centerLinks:config.centerLinks||{},currentLanguage};initInsights(config);initPlaceholders(root);initMiniWidget(shared);initModal(shared);initSearchFieldClear(root);initOpeningScreen(shared,config);initExternalTriggers(shared);if(window.WisAlgoliaGeneralSearch)window.WisAlgoliaGeneralSearch.init(shared);if(window.WisAlgoliaPeopleSearch)window.WisAlgoliaPeopleSearch.init(shared);if(window.WisAlgoliaMobile)window.WisAlgoliaMobile.init(shared);openSearchFromUrlQuery();}function ensureInsightsClient(){if(typeof window.aa==='function')return;const client=window.AlgoliaAnalytics&&window.AlgoliaAnalytics.default;if(!client)return;window.aa=(method,...args)=>(typeof client[method]==='function'?client[method](...args):undefined);}function initInsights(config){if(window.WisAlgoliaSearch.insightsInitialized)return;window.WisAlgoliaSearch.insightsInitialized=true;ensureInsightsClient();if(typeof window.aa!=='function')return;window.aa('init',{appId:config.appId,apiKey:config.apiKey,useCookie:false,region:config.analyticsRegion||undefined});window.aa('setAnonymousUserToken',true);window.aa('getUserToken',null,(error,userToken)=>{if(!error&&userToken)window.WisAlgoliaSearch.userToken=userToken;});document.addEventListener('click',(event)=>{const target=event.target.closest('[data-insights-object-id]');if(target)sendInsightsClick(target.dataset);});}function sendInsightsClick(data){if(typeof window.aa!=='function'||!data.insightsObjectId||!data.insightsIndex)return;const eventName=data.insightsEventName||'Search Result Clicked';if(data.insightsQueryId){window.aa('clickedObjectIDsAfterSearch',{index:data.insightsIndex,eventName,queryID:data.insightsQueryId,objectIDs:[data.insightsObjectId],positions:[parseInt(data.insightsPosition,10)||1]});return;}window.aa('clickedObjectIDs',{index:data.insightsIndex,eventName,objectIDs:[data.insightsObjectId]});}function insightsClickAttrs(indexName,eventName,hit,result){if(!hit||!hit.objectID||!indexName)return '';let attrs=` data-insights-index="${escapeHtml(indexName)}"`+` data-insights-event-name="${escapeHtml(eventName)}"`+` data-insights-object-id="${escapeHtml(hit.objectID)}"`;if(result&&result.queryID){const position=(result.hits||[]).indexOf(hit)+1;attrs+=` data-insights-query-id="${escapeHtml(result.queryID)}"`;if(position>0)attrs+=` data-insights-position="${position}"`;}return attrs;}function initPlaceholders(root){const config=parsePlaceholderConfig(root.dataset.wisSearchPlaceholder);if(!config)return;const targets={mini:root.querySelector('.wis-mini-search-input'),general:root.querySelector('.wis-advanced-view[data-view="general"] .wis-advanced-search-input'),people:root.querySelector('.wis-advanced-view[data-view="people"] .wis-advanced-search-input')};
2Object.entries(targets).forEach(([key,input])=>{if(input&&config[key]!=null)applyPlaceholder(input,config[key]);});}function parsePlaceholderConfig(raw){const value=String(raw||'').trim();if(!value)return null;if(value.startsWith('{')||value.startsWith('[')){const parsed=tryParseLooseJson(value);if(Array.isArray(parsed))return {mini:parsed};if(parsed&&typeof parsed==='object')return parsed;}return {mini:value};}function applyPlaceholder(input,value){if(Array.isArray(value)){const words=value.map((word)=>String(word||'').trim()).filter(Boolean);if(words.length===0)return;if(words.length===1){input.placeholder=words[0];return;}if(!input.getAttribute('aria-label'))input.setAttribute('aria-label',words.join(', '));animatePlaceholder(input,words);return;}input.placeholder=String(value);}function animatePlaceholder(input,words){const TYPE_DELAY=90;const DELETE_DELAY=45;const HOLD_DELAY=1600;const GAP_DELAY=350;const SWAP_DELAY=3000;const reducedMotion=window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches;let wordIndex=0;if(reducedMotion){input.placeholder=words[0];const swap=()=>{if(!input.isConnected)return;wordIndex=(wordIndex+1)%words.length;input.placeholder=words[wordIndex];window.setTimeout(swap,SWAP_DELAY);};window.setTimeout(swap,SWAP_DELAY);return;}let charIndex=0;let deleting=false;const tick=()=>{if(!input.isConnected)return;const chars=Array.from(words[wordIndex]);if(!deleting){charIndex+=1;input.placeholder=chars.slice(0,charIndex).join('');if(charIndex>=chars.length){deleting=true;window.setTimeout(tick,HOLD_DELAY);return;}window.setTimeout(tick,TYPE_DELAY);return;}charIndex-=1;input.placeholder=chars.slice(0,charIndex).join('');if(charIndex<=0){deleting=false;wordIndex=(wordIndex+1)%words.length;window.setTimeout(tick,GAP_DELAY);return;}window.setTimeout(tick,DELETE_DELAY);};tick();}const HISTORY_KEY='wis-search-history';const HISTORY_LIMIT=4;const HISTORY_MIN_LENGTH=2;const HISTORY_SETTLE_DELAY=1500;function readHistory(){try{const parsed=JSON.parse(window.localStorage.getItem(HISTORY_KEY)||'[]');return Array.isArray(parsed)?parsed.filter((entry)=>typeof entry==='string'):[];}catch(error){return [];}}function rememberSearch(query){const term=query.trim();if(term.length<HISTORY_MIN_LENGTH)return readHistory();const lower=term.toLowerCase();const kept=readHistory().filter((entry)=>!lower.startsWith(entry.toLowerCase()));const entries=[term,...kept].slice(0,HISTORY_LIMIT);try{window.localStorage.setItem(HISTORY_KEY,JSON.stringify(entries));}catch(error){}return entries;}function initOpeningScreen(shared,config){const opening=shared.root.querySelector('.wis-search-opening');if(!opening)return;const view=opening.closest('.wis-advanced-view');const input=view.querySelector('.wis-advanced-search-input');const modalWindow=shared.root.querySelector('.wis-search-modal-window');const hiddenWhileOpening=[view.querySelector('.wis-filters-column'),view.querySelector('.wis-results-column'),view.querySelector('[data-filter-sheet-open]')].filter(Boolean);const popular=(config.popularSearches||[]).filter((term)=>typeof term==='string'&&term.trim()!=='');const links=(config.quickLinks||[]).map((link)=>({label:String(link&&link.label||''),url:safeUrl(link&&link.url)})).filter((link)=>link.label!==''&&link.url);renderTermList(opening.querySelector('[data-suggestions="popular"]'),popular);renderQuickLinks(view.querySelector('.wis-quick-link-list'),links);opening.addEventListener('click',(event)=>{const button=event.target.closest('[data-suggestion-term]');if(!button)return;input.value=button.dataset.suggestionTerm;input.dispatchEvent(new Event('input',{bubbles:true}));input.focus();});let settleTimer=null;input.addEventListener('input',()=>{window.clearTimeout(settleTimer);settleTimer=window.setTimeout(()=>rememberSearch(input.value),HISTORY_SETTLE_DELAY);});shared.toggleOpeningScreen=(isOpening)=>{opening.classList.toggle('is-hidden',!isOpening);hiddenWhileOpening.forEach((element)=>element.classList.toggle('is-hidden',isOpening));if(modalWindow)modalWindow.classList.toggle('is-opening',isOpening&&isGeneralTabActive(shared.root));if(isOpening){const history=readHistory();renderTermList(opening.querySelector('[data-suggestions="history"]'),history);}}
2;}function renderTermList(section,terms){if(!section)return;section.classList.toggle('is-hidden',terms.length===0);section.querySelector('.wis-suggestion-list').innerHTML=terms.map((term)=>`
3        <button type="button" class="wis-suggestion" data-suggestion-term="${escapeHtml(term)}">
4          ${escapeHtml(term)}
5        </button>
6      `).join('');}function renderQuickLinks(container,links){if(!container)return;container.closest('.wis-search-quick-links').classList.toggle('is-hidden',links.length===0);container.innerHTML=links.map((link)=>{const tab=/^#(general|people)$/i.exec(link.url);const attrs=tab?` href="#" data-wis-search-open data-wis-search-tab="${escapeHtml(tab[1].toLowerCase())}"`:` href="${escapeHtml(link.url)}"`;return `
7        <a class="wis-quick-link-item"${attrs}>
8          <span>${escapeHtml(link.label)}</span>
9        </a>
10      `;}).join('');}function initSearchFieldClear(root){root.addEventListener('click',(event)=>{const button=event.target.closest('.wis-advanced-search-clear');if(!button||!root.contains(button))return;const input=button.closest('.wis-advanced-search-field').querySelector('.wis-advanced-search-input');input.value='';input.dispatchEvent(new Event('input',{bubbles:true}));input.focus();});}const PANEL_BOTTOM_GUTTER=24;function syncPanelBounds(box,panel){const pageWidth=document.documentElement.clientWidth;const rect=box.getBoundingClientRect();const isRtl=window.getComputedStyle(box).direction==='rtl';const available=isRtl?rect.right:pageWidth-rect.left;panel.style.setProperty('--wis-panel-available',`${Math.round(available)}px`);const field=box.querySelector('.wis-mini-search-input');if(field){const fieldRect=field.getBoundingClientRect();const boxStyle=window.getComputedStyle(box);const boxBorder=parseFloat(isRtl?boxStyle.borderInlineEndWidth:boxStyle.borderInlineStartWidth)||0;const fieldStart=isRtl?rect.right-boxBorder-fieldRect.right:fieldRect.left-rect.left-boxBorder;box.style.setProperty('--wis-mini-bar-start',`${Math.round(fieldStart)}px`);box.style.setProperty('--wis-mini-bar-width',`${Math.round(fieldRect.width)}px`);}const panelTop=panel.getBoundingClientRect().top;if(panelTop>0){const room=window.innerHeight-panelTop-PANEL_BOTTOM_GUTTER;panel.style.setProperty('--wis-panel-room',`${Math.max(0,Math.round(room))}px`);}}function initMiniWidget(shared){const root=shared.root;const input=root.querySelector('.wis-mini-search-input');const advancedButton=root.querySelector('.wis-mini-advanced-button');const advancedBar=root.querySelector('.wis-mini-advanced-bar');const panel=root.querySelector('.wis-mini-results-panel');const panelContent=root.querySelector('.wis-mini-panel-content');const searchBox=root.querySelector('.wis-search-box-wrap');const miniFilters=parseMiniFilters(root);function openAdvanced(){hide(advancedBar);openSearchWithPayload(shared,{tab:'general',query:input.value.trim(),filters:miniFilters});}advancedButton.addEventListener('click',openAdvanced);advancedBar.addEventListener('click',openAdvanced);if(!hasQuickSearch(root)){show(advancedButton);function syncAdvancedButton(){advancedButton.disabled=input.value.trim()==='';}syncAdvancedButton();input.addEventListener('input',syncAdvancedButton);input.addEventListener('keydown',(event)=>{if(event.key==='Enter'){event.preventDefault();if(!advancedButton.disabled)openAdvanced();}});return;}let isFocused=false;let lastQuery='';let requestId=0;syncPanelBounds(searchBox,panel);window.addEventListener('resize',()=>syncPanelBounds(searchBox,panel));const runSearch=debounce(async()=>{const query=input.value.trim();lastQuery=query;if(query.length<MIN_QUERY_LENGTH){hide(panel);if(isFocused){show(advancedButton);show(advancedBar);advancedButton.textContent=`${Drupal.t("Advanced search")}`;}return;}hide(advancedButton);hide(advancedBar);show(panel);syncPanelBounds(searchBox,panel);const currentRequestId=++requestId;try{const language=shared.currentLanguage;const baseFilters=buildMiniFilters(language,miniFilters);const peopleFilter=`${baseFilters} AND ${peopleFilters(language)}`;const otherFilter=`${baseFilters} AND ${nonPeopleFilters(language)}`;const userToken=window.WisAlgoliaSearch.userToken;const response=await shared.client.search([{indexName:shared.generalIndexName,params:cleanSearchParams({query,hitsPerPage:window.WisAlgoliaSearch.limits.generalCollapsed,filters:peopleFilter,analytics:true,analyticsTags:[`lang:${language}`],clickAnalytics:true,userToken})},{indexName:shared.generalIndexName,params:cleanSearchParams({query,hitsPerPage:4,filters:otherFilter,analytics:false,clickAnalytics:true,userToken})},{indexName:shared.generalIndexName,params:cleanSearchParams({query,hitsPerPage:1000,filters:`${baseFilters} AND ${scientistFilters(language)}`,attributesToRetrieve:['person_id','sci_person_id'],attributesToHighlight:[],analytics:false,clickAnalytics:false})},{indexName:shared.generalIndexName,params:cleanSearchParams({query,hitsPerPage:2,filters:`${baseFilters} AND (entity_type:center OR entity_type:institute)`,attributesToRetrieve:['name','wis_search_title_eng','wis_search_title_heb','entity_type','dept_code'],attributesToHighlight:[],analytics:false,clickAnalytics:false})},...['facdiv','depbranch'].map((level)=>({indexName:shared.generalIndexName,params:cleanSearchParams({query,hitsPerPage:20,filters:`${baseFilters} AND entity_type:directory`,restrictSearchableAttributes:[`department.${level}.name.${language}`],facets:[`department.${level}.name.${language}`],maxValuesPerFacet:20,attributesToRetrieve:['department'],attributesToHighlight:[],typoTolerance:language==='he',analytics:false,clickAnalytics:false})})),{indexName:shared.generalIndexName,params:cleanSearchParams({query,hitsPerPage:5,filters:`${baseFilters} AND entity_type:directory AND has_lab:true`,attributesToRetrieve:['labs'],attributesToHighlight:[],analytics:false,clickAnalytics:false})}]);const [peopleResults,otherResults,scientistIds,centreResults,facultyResults,departmentResults,labResults]=response.results;if(currentRequestId!==requestId||input.value.trim()!==lastQuery)return;const [people,duplicatePeople]=await Promise.all([buildPeopleRows(shared,peopleResults),countDuplicatePeople(shared,{query,filters:`${baseFilters} AND entity_type:directory`,scientistResult:scientistIds})]);people.rows=withNamedPlacesFirst(people.rows,namedPlaces(facultyResults,departmentResults,shared),shared);const quickLinks=await buildMiniQuickLinks(shared,{facultyResults,departmentResults,centreResults,labResults,peopleRows:people.rows,baseFilters,query});if(currentRequestId!==requestId||input.value.trim()!==lastQuery)return;const other=withoutDuplicatePersonPages(filterHitsByCurrentLanguage(otherResults.hits||[],language),people.rows);renderMiniPanel(panelContent,{people,peopleResults,otherResults,otherHits:other.hits,quickLinks,found:Math.max(0,(peopleResults.nbHits||0)-duplicatePeople)+(otherResults.nbHits||0)},shared,query,miniFilters);}catch(error){console.error(error);}},180);input.addEventListener('focus',()=>{isFocused=true;if(input.value.trim().length<MIN_QUERY_LENGTH){show(advancedButton);show(advancedBar);return;}runSearch();});input.addEventListener('input',runSearch);document.addEventListener('click',(event)=>{if(!root.querySelector('.wis-search-widget').contains(event.target)){isFocused=false;hide(panel);if(input.value.trim().length<MIN_QUERY_LENGTH)hide(advancedButton);hide(advancedBar);}});}function renderNoResults(query,shared,options={}){const withPublications=options.publications!==false;const terms=String(query||'').trim();const url=safeUrl(publicationsSearchUrl(shared,terms));return `
11      <div class="wis-no-results-block" role="status">
12        <p class="wis-no-results-title">${Drupal.t('No results found')}</p>
13        ${terms?`
14          <p class="wis-no-results-query">
15            ${Drupal.t("We couldn't find any matches for")}
16            <strong>"${escapeHtml(terms)}"</strong>
17          </p>
18        `:''}
19        <p class="wis-no-results-hint">${Drupal.t('Try these suggestions:')}</p>
20        <ul class="wis-no-results-tips">
21          <li>${Drupal.t('Check your spelling')}</li>
22          <li>${Drupal.t('Use more general keywords')}</li>
23          <li>${Drupal.t('Try different search terms')}</li>
24        </ul>
25        ${withPublications&&url?`
26          <div class="wis-no-results-publications">
27            <p>${Drupal.t('Looking for scientific publications?')}</p>
28            <a href="${escapeHtml(url)}" target="_blank" rel="noopener noreferrer">
29              ${Drupal.t('Try the Publications Search')}
30            </a>
31          </div>
32        `:''}
33      </div>
34    `;}function renderMiniPanel(container,results,shared,query,miniFilters){const peopleRows=(results.people?.rows||[]).slice(0,MINI_PEOPLE_ROWS);const otherHits=results.otherHits||[];const seen=new Set();const entries=[...peopleRows,...otherHits.map((hit)=>({source:'other',hit,display:hit,url:getHitUrl(hit,shared),result:results.otherResults}))].filter(({hit})=>{if(!hit.objectID||seen.has(hit.objectID))return !hit.objectID;seen.add(hit.objectID);return true;}).slice(0,4);const hasResults=entries.length>0;const nbHits=results.found||0;const quickLinks=results.quickLinks||[];let html='<div class="wis-mini-panel-main">';if(hasResults){html+='<div class="wis-mini-section">';html+=`<h3>${Drupal.t("Top Results")}</h3>`;html+='<div class="wis-mini-top-results">';
34entries.forEach(({hit,display,url,result})=>{const faculty=getHitFaculty(display,shared);const insightsAttrs=insightsClickAttrs(shared.generalIndexName,'Mini Search Result Clicked',hit,result);const image=hitImageUrl(display);const innerHtml=`
35    ${image?`<span class="wis-mini-result-image${isArticleNode(display)?' wis-mini-result-image-news':''}">${renderImageTag(image)}</span>`:''}
36    <span class="wis-mini-result-text">
37      <span class="wis-mini-result-title">${escapeHtml(getHitTitle(display,shared))}</span>
38      ${faculty?`<span class="wis-mini-result-meta">${escapeHtml(faculty)}</span>`:''}
39    </span>
40  `;const personId=hitPersonKey(display);if(url)html+=`
41      <a class="wis-mini-result-button wis-mini-result-link" href="${escapeHtml(url)}"${opensInNewTab(display,url)?' target="_blank" rel="noopener noreferrer"':''}${insightsAttrs}>
42        ${innerHtml}
43      </a>
44    `;else if(personId)html+=`
45      <button
46        type="button"
47        class="wis-mini-result-button wis-mini-result-link"
48        data-open-person="${escapeHtml(personId)}"
49        data-person-label="${escapeHtml(getHitTitle(display,shared))}"
50        ${insightsAttrs}
51      >
52        ${innerHtml}
53      </button>
54    `;else html+=`
55      <div class="wis-mini-result-button">
56        ${innerHtml}
57      </div>
58    `;});html+='</div></div>';if(quickLinks.length>0){html+='<div class="wis-mini-section">';html+=`<h3>${Drupal.t("Quick Links")}</h3>`;html+='<div class="wis-quick-links">';quickLinks.forEach(({label,url})=>{const target=isExternalUrl(url)?' target="_blank" rel="noopener noreferrer"':'';html+=`
59            <a class="wis-quick-link" href="${escapeHtml(url)}"${target}>${escapeHtml(label)}</a>
60          `;});html+='</div></div>';}}else html+=renderNoResults(query,shared,{publications:false});html+=`
61      <button type="button" class="wis-panel-advanced-button">
62        ${hasResults?`${Drupal.t("Show all")} ${formatNumber(nbHits)} ${Drupal.t("results")}`:`${Drupal.t("Advanced search")}`}
63      </button>
64    `;html+='</div>';html+=`
65      <div class="wis-mini-panel-aside">
66        <p class="wis-publications-teaser">
67          <span>${Drupal.t("Looking for scientific publications?")}</span>
68          <span class="only-desktop">${Drupal.t("Try the")}</span>
69        </p>
70        <button type="button" class="wis-publications-button">
71           <span class="only-mobile">${Drupal.t("Try the Publications Search")}</span>
72           <span class="only-desktop">${Drupal.t("Publications Search")}</span>
73        </button>
74      </div>
75    `;container.innerHTML=html;container.querySelectorAll('[data-open-person]').forEach((button)=>{button.addEventListener('click',()=>{openSearchWithPayload(shared,{tab:'people',query,filters:{person_id:[button.dataset.openPerson]},personLabel:button.dataset.personLabel||'',returnQuery:query});});});container.querySelector('.wis-publications-button').addEventListener('click',()=>{openPublications(shared);});container.querySelector('.wis-panel-advanced-button').addEventListener('click',()=>{openSearchWithPayload(shared,{tab:'general',query,filters:miniFilters});});}async function buildMiniQuickLinks(shared,{facultyResults,departmentResults,centreResults,labResults,peopleRows,baseFilters,query}){const language=shared.currentLanguage||'en';const seen=new Set();const parents=createParentFacultyIndex(language);const kind=(rank,rows)=>{const list=[];rows.forEach(({label,attribute,url})=>{const name=String(label||'').trim();if(!name||seen.has(name))return;seen.add(name);list.push({label:name,attribute:attribute||'',url:url||'',rank});});return list;};const departmentTarget=(level,label,url)=>{if(url||level!=='depbranch')return url;const parent=parents.parentOf(label);const parentUrl=parent?safeUrl(parent.url):'';return isViewablePageUrl(parentUrl)?parentUrl:'';};const places=(level,result)=>{const attribute=`department.${level}.name.${language}`;const counts=(result&&result.facets&&result.facets[attribute])||{};const pages=new Map();((result&&result.hits)||[]).forEach((hit)=>{parents.learn(hit);const place=hit.department&&hit.department[level];const name=place&&place.name&&place.name[language];if(name&&place.url&&!pages.has(name))pages.set(name,place.url);});return Object.keys(counts).sort((a,b)=>counts[b]-counts[a]).map((label)=>({label,attribute,url:departmentTarget(level,label,safeUrl(pages.get(label)))}));};const centres=(centreResults?.hits||[]).map((hit)=>({label:getHitTitle(hit,shared)||getHitName(hit,shared),url:institutesPageUrl(hit,shared)}));const labs=[];
75(labResults?.hits||[]).forEach((hit)=>{(Array.isArray(hit.labs)?hit.labs:[]).forEach((lab)=>{labs.push({label:labTitle(lab,language),url:safeUrl(lab&&lab.homepage)});});});const floor=placeFloor((peopleRows||[]).length);const alsoWorkHere=(level)=>{const found=new Map();(peopleRows||[]).forEach(({display})=>{parents.learn(display);const place=display&&display.department&&display.department[level];const label=place&&place.name&&place.name[language];if(!label)return;const entry=found.get(label)||{label,url:safeUrl(place.url),count:0};entry.count+=1;found.set(label,entry);});return [...found.values()].filter((place)=>place.count>=floor).sort((a,b)=>b.count-a.count).map(({label,url})=>({label,url:departmentTarget(level,label,url),attribute:`department.${level}.name.${language}`}));};const kinds=[kind(0,places('facdiv',facultyResults)),kind(1,centres),kind(2,places('depbranch',departmentResults)),kind(0,alsoWorkHere('facdiv')),kind(2,alsoWorkHere('depbranch')),kind(3,labs)];const candidates=[];if(QUICK_LINK_ONE_PER_KIND){for(let round=0;candidates.length<QUICK_LINK_CANDIDATES;round++){const taken=kinds.map((list)=>list[round]).filter(Boolean);if(taken.length===0)break;candidates.push(...taken);}}else kinds.forEach((list)=>candidates.push(...list));const looked=candidates.slice(0,QUICK_LINK_CANDIDATES);await attachQuickLinkTargets(shared,looked,baseFilters,query,parents);return looked.filter((link)=>link.url).slice(0,QUICK_LINK_SLOTS).sort((a,b)=>a.rank-b.rank);}async function attachQuickLinkTargets(shared,links,baseFilters,query,parents){const language=shared.currentLanguage||'en';const wanted=links.filter((link)=>link.attribute&&!link.url);if(wanted.length===0)return;let response;try{response=await shared.client.search(wanted.map((link)=>({indexName:shared.generalIndexName,params:cleanSearchParams({query,hitsPerPage:QUICK_LINK_SCAN_DEPTH,attributesToRetrieve:['department'],attributesToHighlight:[],filters:`${baseFilters} AND ${link.attribute}:"${link.label.replaceAll('"','\\"')}"`,analytics:false,clickAnalytics:false})})));}catch(error){console.error('Could not resolve quick link targets:',error);return;}wanted.forEach((link,index)=>{const hits=((response.results||[])[index]||{}).hits||[];const level=link.attribute.startsWith('department.facdiv')?'facdiv':'depbranch';hits.forEach((hit)=>parents.learn(hit));const place=hits.map((hit)=>hit.department&&hit.department[level]).find((unit)=>unit&&unit.name&&unit.name[language]===link.label&&unit.url);const url=place?safeUrl(place.url):'';if(isViewablePageUrl(url)){link.url=url;return;}const parent=level==='depbranch'?parents.parentOf(link.label):null;const parentUrl=parent?safeUrl(parent.url):'';link.url=isViewablePageUrl(parentUrl)?parentUrl:'';});}function opensInNewTab(hit,url){const isCentre=hit&&(hit.entity_type==='center'||hit.entity_type==='institute');return Boolean(isCentre)&&isExternalUrl(url);}function isExternalUrl(url){try{return new URL(url,window.location.href).origin!==window.location.origin;}catch(error){return false;}}const UNVIEWABLE_PATHS=[/\/taxonomy\/term(\/|$)/i,/\/node\/\d+(\/|$)/i,/\/user\/\d*(\/|$)/i,/\/comment\/\d+(\/|$)/i,/\/media\/\d+(\/|$)/i,/\/(admin|system)(\/|$)/i,/\/sites\/[^/]+\/files(\/|$)/i];function isViewablePageUrl(url){const value=safeUrl(url);if(!value)return false;let path;try{path=new URL(value,window.location.href).pathname;}catch(error){return false;}return !UNVIEWABLE_PATHS.some((pattern)=>pattern.test(path));}function publicationsSearchUrl(shared,query){const base=shared.publicationsUrl;const terms=String(query||'').trim();if(terms==='')return base;try{const url=new URL(base,window.location.origin);url.searchParams.set('search',terms);url.searchParams.set('searchBy','PartOfNameOrTitle');url.search=url.searchParams.toString().replace(/\+/g,'%20');return url.toString();}catch(error){return base;}}function currentQuery(root){const activeContent=root.querySelector('.wis-search-tab-content.is-active');const modalInput=activeContent&&activeContent.querySelector('.wis-advanced-search-input');if(modalInput&&modalInput.value.trim()!=='')return modalInput.value.trim();const miniInput=root.querySelector('.wis-mini-search-input');return miniInput?miniInput.value.trim():'';}function openPublications(shared){window.open(publicationsSearchUrl(shared,currentQuery(s
75hared.root)),'_blank','noopener');}function initModal(shared){const root=shared.root;const modal=root.querySelector('.wis-search-modal');const closeButton=root.querySelector('.wis-search-modal-close');const tabs=root.querySelectorAll('.wis-search-tab');closeButton.addEventListener('click',()=>closeModal(root));modal.addEventListener('click',(event)=>{if(event.target.classList.contains('wis-search-modal-backdrop'))closeModal(root);});tabs.forEach((tab)=>{tab.addEventListener('click',()=>{const tabId=tab.dataset.tab;if(tabId==='publications'){openPublications(shared);return;}activateTab(root,tabId);});});document.addEventListener('keydown',(event)=>{if(modal.classList.contains('is-hidden'))return;if(event.key==='Escape'){const sheetClose=root.querySelector('.wis-filters-column.is-open [data-filter-sheet-close]');if(sheetClose){sheetClose.click();return;}closeModal(root);return;}if(event.key!=='Tab')return;const trapRoot=root.querySelector('.wis-filters-column.is-open')||modal;const focusableElements=getFocusableElements(trapRoot);const firstFocusable=focusableElements[0];const lastFocusable=focusableElements[focusableElements.length-1];if(!firstFocusable||!lastFocusable){event.preventDefault();return;}if(event.shiftKey&&document.activeElement===firstFocusable){event.preventDefault();lastFocusable.focus();}else{if(!event.shiftKey&&document.activeElement===lastFocusable){event.preventDefault();firstFocusable.focus();}}});}function initExternalTriggers(shared){window.WisAlgoliaSearch.instances=window.WisAlgoliaSearch.instances||[];window.WisAlgoliaSearch.instances.push(shared);shared.open=(payload={})=>openSearchWithPayload(shared,payload);if(!window.WisAlgoliaSearch.triggersInitialized){window.WisAlgoliaSearch.triggersInitialized=true;initSearchOpenTriggers();window.WisAlgoliaSearch.open=(payload={})=>{const target=getSearchTarget();if(target)openSearchWithPayload(target,payload);};}}function initSearchOpenTriggers(){document.addEventListener('click',(event)=>{const trigger=event.target.closest('[data-wis-search-open]');if(!trigger)return;event.preventDefault();const target=getSearchTarget();if(!target)return;const payload={tab:trigger.dataset.wisSearchTab||'general',query:trigger.dataset.wisSearchQuery||'',filters:parseJsonData(trigger.dataset.wisSearchFilters)};openSearchWithPayload(target,payload);});}function openSearchFromUrlQuery(){if(window.WisAlgoliaSearch.urlQueryHandled)return;window.WisAlgoliaSearch.urlQueryHandled=true;let url;try{url=new URL(window.location.href);}catch(error){return;}if(!url.searchParams.has('wis-search')&&!url.searchParams.has('wis-search-tab'))return;const query=(url.searchParams.get('wis-search')||'').trim();const requestedTab=url.searchParams.get('wis-search-tab');const tab=requestedTab==='people'?'people':'general';url.searchParams.delete('wis-search');url.searchParams.delete('wis-search-tab');window.history.replaceState(window.history.state,'',url.pathname+url.search+url.hash);const target=getSearchTarget();if(!target)return;openSearchWithPayload(target,{tab,query});}function getSearchTarget(){const firstRoot=document.querySelector('[data-wis-algolia-search]');const instances=window.WisAlgoliaSearch.instances||[];return instances.find((shared)=>shared.root===firstRoot)||instances[0]||null;}function openSearchWithPayload(shared,payload){const tab=payload.tab||'general';activateTab(shared.root,tab);const openSheetClose=shared.root.querySelector('.wis-filters-column.is-open [data-filter-sheet-close]');if(openSheetClose)openSheetClose.click();shared.root.dispatchEvent(new CustomEvent('wisAlgoliaSearch:applyState',{detail:payload}));openModal(shared.root);}function parseJsonData(value){return parseLooseJson(value,'Invalid WIS search JSON data:');}function parseMiniFilters(root){return parseLooseJson(root.dataset.wisMiniFilters,'Invalid data-wis-mini-filters JSON:');}function hasQuickSearch(root){const holder=root.closest('[data-wis-quick-search]');if(holder){const value=holder.dataset.wisQuickSearch.trim().toLowerCase();return !(value==='off'||value==='false'||value==='0');}return Boolean(root.closest('header[role="banner"]'));}function parseLooseJson(value,errorLabel){if(!value)return {};const parsed=tryParseLooseJson(value);if(parsed===undefined){console.error(errorLabel,value);return {};}return parsed;}function tryParseLooseJson(value){try{return JSON.parse(value);}catch(error){try{return JSON.parse(value.replace(/,\s*([}\]])/g,'$1'));}catch(cleanedError){return undefined;}}}function buildMiniFilters(language,miniFilters){const baseFilter=`(${buildNodeLanguageFilter(language)})`;const facetFilters=buildAlgoliaFilterExpression(miniFilters);return facetFilters?`${baseFilter} AND ${facetFilters}`:baseFilter;}function buildAlgoliaFilterExpression(filters){const groups=[];
75Object.entries(filters).forEach(([attribute,values])=>{const valuesArray=Array.isArray(values)?values:[values];const valueFilters=valuesArray.filter(Boolean).map((value)=>`${attribute}:"${String(value).replaceAll('"','\\"')}"`);if(valueFilters.length===1)groups.push(valueFilters[0]);else{if(valueFilters.length>1)groups.push(`(${valueFilters.join(' OR ')})`);}});return groups.join(' AND ');}let lockedScrollY=0;const MODAL_ANIM_MS=260;const closeTimers=new WeakMap();function openModal(root){const modal=root.querySelector('.wis-search-modal');const closeButton=root.querySelector('.wis-search-modal-close');const activeInput=root.querySelector('.wis-search-tab-content.is-active .wis-advanced-search-input');const miniPanel=root.querySelector('.wis-mini-results-panel');if(miniPanel)hide(miniPanel);lastFocusedElement=document.activeElement;window.clearTimeout(closeTimers.get(root));modal.classList.remove('is-hidden');modal.setAttribute('aria-hidden','false');void modal.offsetHeight;modal.classList.add('is-open');if(!document.body.classList.contains('wis-search-modal-open')){lockedScrollY=window.scrollY;document.body.style.top=`-${lockedScrollY}px`;}document.body.classList.add('wis-search-modal-open');root.dispatchEvent(new CustomEvent('wisAlgoliaSearch:modalOpened'));window.setTimeout(()=>{if(activeInput)activeInput.focus();else closeButton.focus();},0);}function closeModal(root){const modal=root.querySelector('.wis-search-modal');const modalWindow=root.querySelector('.wis-search-modal-window');document.body.classList.remove('wis-search-modal-open');const openSheetClose=root.querySelector('.wis-filters-column.is-open [data-filter-sheet-close]');if(openSheetClose)openSheetClose.click();modal.classList.remove('is-open');const finish=()=>{if(modal.classList.contains('is-open'))return;modal.classList.add('is-hidden');modal.setAttribute('aria-hidden','true');};if(window.getComputedStyle(modalWindow).transitionDuration==='0s')finish();else{const timer=window.setTimeout(finish,MODAL_ANIM_MS+60);closeTimers.set(root,timer);const onTransitionEnd=(event)=>{if(event.target!==modalWindow)return;modalWindow.removeEventListener('transitionend',onTransitionEnd);window.clearTimeout(timer);finish();};modalWindow.addEventListener('transitionend',onTransitionEnd);}document.body.style.top='';window.scrollTo(0,lockedScrollY);if(lastFocusedElement&&document.contains(lastFocusedElement))lastFocusedElement.focus();lastFocusedElement=null;}function activateTab(root,tabId){root.querySelectorAll('.wis-search-tab').forEach((tab)=>{tab.classList.toggle('is-active',tab.dataset.tab===tabId);});root.querySelectorAll('.wis-search-tab-content').forEach((content)=>{content.classList.toggle('is-active',content.dataset.tabContent===tabId);});const modalWindow=root.querySelector('.wis-search-modal-window');const opening=root.querySelector('.wis-search-opening');if(modalWindow){const openingShowing=Boolean(opening)&&!opening.classList.contains('is-hidden');modalWindow.classList.toggle('is-opening',openingShowing&&isGeneralTabActive(root));}}function isGeneralTabActive(root){const activeTab=root.querySelector('.wis-search-tab.is-active');return !activeTab||activeTab.dataset.tab==='general';}function isArticleNode(hit){const names=hit.node_type&&hit.node_type.name;return Boolean(names)&&names.en===ARTICLE_NODE_TYPE.en;}function hitImageUrl(hit){const portrait=safeUrl(firstIndexValue(hit.photos&&hit.photos.main));if(portrait)return portrait;if(!isArticleNode(hit))return '';return safeUrl(firstIndexValue(hit.news_image))||newsPlaceholderUrl();}function newsPlaceholderUrl(){return safeUrl((drupalSettings.wisAlgoliaSearch||{}).newsPlaceholder);}function renderImageTag(url){return `<img src="${escapeHtml(url)}" alt="" loading="lazy" decoding="async">`;}function renderImage(hit){const image=hitImageUrl(hit);return image?renderImageTag(image):'<span class="wis-image-placeholder"></span>';}function firstIndexValue(value){const single=Array.isArray(value)?value.find(Boolean):value;return typeof single==='string'?single:'';}const HEBREW_TITLE_MAP={'פרופ':'פרופ׳','דר':'ד"ר'};function normalizeHebrewTitleToken(token){const trimmed=String(token||'').trim();if(trimmed==='')return '';
75const core=trimmed.replace(/[^\u05D0-\u05EA]/g,'');return HEBREW_TITLE_MAP[core]||trimmed;}function fixHebrewNamePeriod(name){if(typeof name!=='string')return name;return name.replace(/^\s*(\S+)/,(match,token)=>normalizeHebrewTitleToken(token));}function getHitTitle(hit,shared){if(shared.currentLanguage==="he")return fixHebrewNamePeriod(hit.wis_search_title_heb||hit.name?.he?.fullWithTitle||hit.name?.he||hit.objectID||'');return hit.wis_search_title_eng||hit.name?.en?.fullWithTitle||hit.name?.en||hit.objectID||'';}function getHitRank(hit,shared){const language=shared.currentLanguage==='he'?'he':'en';return fixHebrewNamePeriod(normalizeTextValue(hit.name?.[language]?.title||''));}function getHitName(hit,shared){const language=shared.currentLanguage==='he'?'he':'en';const name=normalizeTextValue(hit.name?.[language]?.full||'');return name||getHitTitle(hit,shared);}function getHitUrl(hit,shared){const language=shared.currentLanguage||'en';const url=language==='he'?(hit.url_he||hit.url||''):(hit.url_en||hit.url||'');return safeUrl(url)||institutesPageUrl(hit,shared);}function institutesPageUrl(hit,shared){if(hit.entity_type!=='center'&&hit.entity_type!=='institute')return '';const code=hit.dept_code||hit.department_code||'';const own=safeUrl((shared.centerLinks||{})[String(code)]);if(own)return own;const base=safeUrl(shared.institutesUrl);if(!base)return '';const name=getHitTitle(hit,shared)||getHitName(hit,shared);return name?`${base}${base.includes('?')?'&':'?'}${INSTITUTES_QUERY_PARAM}=${encodeURIComponent(name)}`:base;}function safeUrl(value){const url=String(value||'').trim();if(url==='')return '';if(/^(https?:|mailto:|tel:)/i.test(url))return url;if(/^[a-z][a-z0-9+.-]*:/i.test(url))return '';return url;}function pagePathKey(url){const value=safeUrl(url);if(value==='')return '';let path;try{path=new URL(value,'https://base.invalid').pathname;}catch(error){return '';}return path.replace(/^\/pages(-new)?(?=\/|$)/i,'').replace(/\/+$/,'').toLowerCase();}function pagePaths(hit){return [hit.url,hit.url_en,hit.url_he].map(pagePathKey).filter((key)=>key!=='');}function pagePathSet(hits){const paths=new Set();(hits||[]).forEach((hit)=>pagePaths(hit).forEach((key)=>paths.add(key)));return paths;}function hasCanonicalTwin(hit,canonicalPaths){return pagePaths(hit).some((key)=>canonicalPaths.has(key));}const CRAWLED_COPY_PATHS=/^(\/he)?\/(news|people)\//;const CRAWLED_SYSTEM_PATHS=/^(\/he)?\/(node|taxonomy\/term)\/\d+$/;function isCrawledCopyPath(hit){return pagePaths(hit).some((key)=>CRAWLED_COPY_PATHS.test(key)||CRAWLED_SYSTEM_PATHS.test(key));}function isCrawledCopy(hit){return Boolean(hit&&hit.is_crawler_data)&&isCrawledCopyPath(hit);}function withoutCrawledDuplicates(rows,canonicalPaths){const paths=canonicalPaths||new Set();return rows.filter((row)=>{const hit=row.hit||row;if(!hit.is_crawler_data)return true;return !isCrawledCopy(hit)&&!hasCanonicalTwin(hit,paths);});}function countDuplicateCrawledPages(crawledResult,canonicalPaths){const paths=canonicalPaths||new Set();return ((crawledResult&&crawledResult.hits)||[]).filter((hit)=>isCrawledCopyPath(hit)||hasCanonicalTwin(hit,paths)).length;}function getHitFaculty(hit,shared){const language=shared.currentLanguage||'en';if(isScientistNode(hit,language)){const scientistFaculty=language==='he'?hit.sci_he_faculty:hit.sci_en_faculty;if(scientistFaculty)return normalizeTextValue(scientistFaculty);}return getDepartmentFallbackLabel(hit,language);}function isScientistNode(hit,language){const nodeType=hit.node_type&&hit.node_type.name?hit.node_type.name[language]:'';return nodeType===(SCIENTIST_NODE_TYPE[language]||SCIENTIST_NODE_TYPE.en);}function departmentLabelSource(hit,language){const department=hit.department||{};return [department.facdiv,department.depbranch,department.section].find((source)=>source&&source.name&&source.name[language])||null;}function getDepartmentFallbackLabel(hit,language){const source=departmentLabelSource(hit,language);return source?normalizeTextValue(source.name[language]):'';}function getHitDepartment(hit,shared){const language=shared.currentLanguage||'en';const department=hit.department&&hit.department.depbranch;const name=department&&department.name?normalizeTextValue(department.name[language]):'';return name&&name!==getHitFaculty(hit,shared)?name:'';}function getHitDepartmentUrl(hit,shared){if(!getHitDepartment(hit,shared))return '';const department=hit.department&&hit.department.depbranch;return safeUrl(department&&department.url);}function getHitFacultyUrl(hit,shared){const language=shared.currentLanguage||'en';if(isScientistNode(hit,language)){const scientistFaculty=language==='he'?hit.sci_he_faculty:hit.sci_en_faculty;if(scientistFaculty)return '';}const source=departmentLabelSource(hit,language);return safeUrl(source&&source.url);}function normalizeTextValue(value){if(Array.isArray(value))return value.filter(Boolean).join(', ');if(typeof value==='object'&&value!==null)return value.value||value.label||'';return String(value||'');}function getPrimaryWorkPhone(hit){const phones=Array.isArray(hit.phones)?hit.phones:[];const primaryWorkPhone=phones.find((phone)=>{return phone.type==='work'&&phone.isPrimary&&phone.number;});const workPhone=primaryWorkPhone||phones.find((phone)=>{return phone.type==='work'&&phone.number;});if(!workPhone)return '';return phoneFormat(workPhone.number,false);}function phoneFormat(phone,local=false){if(!phone)return '';let phoneNumber=String(phone).replace(/[- +]/g,'');if(phoneNumber.length===4)if(phoneNumber.startsWith('9'))phoneNumber=`08952${phoneNumber}`;else if(phoneNumber.startsWith('8'))phoneNumber=`08937${phoneNumber}`;else phoneNumber=`08934${phoneNumber}`;if(phoneNumber.startsWith('972'))phoneNumber=phoneNumber.replace(/^972/,'');if(!local&&phoneNumber.startsWith('0'))phoneNumber=phoneNumber.replace(/^0/,'');if(local)return phoneNumber;if(phoneNumber.length===9)return `+972-${phoneNumber.slice(0,2)}-${phoneNumber.slice(2,5)}-${phoneNumber.slice(5)}`;return `+972-${phoneNumber.slice(0,1)}-${phoneNumber.slice(1,4)}-${phoneNumber.slice(4)}`;}function phoneToTelHref(formattedPhone){if(!formattedPhone)return '';return `tel:${formattedPhone.replace(/[^\d+]/g,'')}`;}const SHOW_POSITIONS=false;function getHitPosition(hit,shared){if(!SHOW_POSITIONS)return '';const language=shared.currentLanguage||'en';if(!hit.positions||!hit.positions[language])return '';const positions=hit.positions[language];if(!Array.isArray(positions)||positions.length===0)return '';return normalizeTextValue(positions[0]);}function debounce(callback,delay){let timeout;return function(...args){window.clearTimeout(timeout);timeout=window.setTimeout(()=>callback.apply(this,args),delay);};}function cleanSearchParams(params){return Object.fromEntries(Object.entries(params).filter(([,value])=>value!==undefined&&value!==null));}function escapeHtml(value){return String(value).replaceAll('&','&amp;').replaceAll('<','&lt;').replaceAll('>','&gt;').replaceAll('"','&quot;').replaceAll("'",'&#039;');}function formatNumber(number){return Number(number||0).toLocaleStr
75ing();}function show(element){element.classList.remove('is-hidden');}function hide(element){element.classList.add('is-hidden');}function normalizeLanguage(language){return String(language).startsWith('he')?'he':'en';}function buildNodeLanguageFilter(language){return `NOT entity_type:node OR search_api_language:${language}`;}function filterHitsByCurrentLanguage(hits,language){return hits.filter((hit)=>{if(hit.entity_type!=='node')return true;return hit.search_api_language===language;});}function scientistFilters(language){const name=SCIENTIST_NODE_TYPE[language]||SCIENTIST_NODE_TYPE.en;return `entity_type:node AND search_api_language:${language} AND node_type.name.${language}:"${name}"`;}function peopleFilters(language){const scientist=SCIENTIST_NODE_TYPE[language]||SCIENTIST_NODE_TYPE.en;return `(entity_type:directory OR node_type.name.${language}:"${scientist}")`+` AND (${buildNodeLanguageFilter(language)})`;}function nonPeopleFilters(language){const scientist=SCIENTIST_NODE_TYPE[language]||SCIENTIST_NODE_TYPE.en;return `NOT entity_type:directory AND NOT node_type.name.${language}:"${scientist}"`;}async function countDuplicatePeople(shared,{query,filters,facetFilters,scientistResult}){const ids=[...new Set(((scientistResult&&scientistResult.hits)||[]).map(hitPersonKey).filter(Boolean))];if(ids.length===0)return 0;try{const response=await shared.client.search([{indexName:shared.generalIndexName,params:cleanSearchParams({query,hitsPerPage:0,filters,facetFilters:[...(facetFilters||[]),ids.map((id)=>`person_id:${id}`)],analytics:false,clickAnalytics:false})}]);return (response.results[0]||{}).nbHits||0;}catch(error){console.error('Could not count duplicate people:',error);return 0;}}function placeFacets(language){return [`department.facdiv.name.${language}`,`department.depbranch.name.${language}`];}function labTitle(lab,language){const name=lab&&lab.name&&lab.name[language]&&lab.name[language].fullWithTitle;if(!name)return '';return language==='he'?`המעבדה של ${fixHebrewNamePeriod(name)}`:`${name}'s Lab`;}function personKey(value){if(value===null||value===undefined)return '';return String(value).trim().replace(/["':]/g,'').replace(/^-+/,'');}function hitPersonKey(hit){return personKey(hit&&(hit.person_id||hit.sci_person_id));}const PERSON_PAGE_PATH=/\/people\/(\d+)\/?$/;function pagePersonKey(hit){const path=String((hit&&(hit.path||hit.url||hit.url_en||hit.url_he))||'');const match=path.match(PERSON_PAGE_PATH);return match?personKey(match[1]):'';}function resultsSignature(state,facets){return `${state.query}\u0000${JSON.stringify(facets.selected(state))}`;}function markResultsDrawn(state,facets){state.drawnResults=resultsSignature(state,facets);}function clearStaleResults(view,state,facets){if(state.drawnResults===undefined||state.drawnResults===resultsSignature(state,facets))return;const resultsColumn=view.querySelector('.wis-results-column');const statsLabel=view.querySelector('.wis-stats-label');if(resultsColumn)resultsColumn.innerHTML='';if(statsLabel)statsLabel.classList.add('is-hidden');state.drawnResults=undefined;}const PLACE_MIN_SHARE=0.25;const PLACE_MIN_PEOPLE=2;function placeFloor(peopleCount){return Math.max(PLACE_MIN_PEOPLE,Math.ceil(PLACE_MIN_SHARE*peopleCount));}function createParentFacultyIndex(language){const byDepartment=new Map();const learn=(record)=>{const department=record&&record.department;const branch=department&&department.depbranch;const faculty=department&&department.facdiv;const branchName=branch&&branch.name&&branch.name[language];const facultyName=faculty&&faculty.name&&faculty.name[language];if(!branchName||!facultyName)return;const byFaculty=byDepartment.get(branchName)||new Map();const entry=byFaculty.get(facultyName)||{name:facultyName,url:'',count:0};entry.count+=1;entry.url=entry.url||safeUrl(faculty.url);byFaculty.set(facultyName,entry);byDepartment.set(branchName,byFaculty);};const parentOf=(departmentName)=>{const byFaculty=byDepartment.get(departmentName);if(!byFaculty)return null;return [...byFaculty.values()].sort((a,b)=>b.count-a.count)[0]||null;};return {learn,parentOf};}function withNamedPlacesFirst(rows,named,shared){const language=shared.currentLanguage||'en';if(!named||(!named.facdiv.size&&!named.depbranch.size))return rows;const rank=(row)=>{const department=(row&&row.display&&row.display.department)||{};const faculty=department.facdiv&&department.facdiv.name&&department.facdiv.name[language];const branch=department.depbranch&&department.depbranch.name&&department.depbranch.name[language];if(faculty&&named.facdiv.has(faculty))return 0;if(branch&&named.depbranch.has(branch))return 1;return 2;};return [...rows].sort((a,b)=>rank(a)-rank(b));}function namedPlaces(facultyResult,departmentResult,shared){const language=shared.currentLanguage||'en';const values=(result,level)=>new Set(Object.keys((result&&result.facets&&result.facets[`department.${level}.name.${language}`])||{}));return {facdiv:values(facultyResult,'facdiv'),depbranch:values(departmentResult,'depbranch')};}function withoutDuplicatePersonPages(hits,peopleRows){const listed=new Set();
75(peopleRows||[]).forEach((row)=>{const key=hitPersonKey(row.display)||hitPersonKey(row.hit);if(key)listed.add(key);});if(listed.size===0)return {hits,dropped:0};const kept=hits.filter((hit)=>{const key=pagePersonKey(hit);return !(key&&listed.has(key));});return {hits:kept,dropped:hits.length-kept.length};}function indexByPerson(hits,into=new Map()){hits.forEach((hit)=>{const key=hitPersonKey(hit);if(key&&!into.has(key))into.set(key,hit);});return into;}async function fetchPersonCounterparts(shared,wanted){const counterparts={directory:new Map(),scientists:new Map()};const language=shared.currentLanguage||'en';const halves=[{half:'directory',ids:uniquePersonKeys(wanted.directoryFor),filters:'entity_type:directory'},{half:'scientists',ids:uniquePersonKeys(wanted.scientistsFor),filters:scientistFilters(language)}].filter((question)=>question.ids.length>0);if(halves.length===0)return counterparts;let response;try{response=await shared.client.search(halves.map(({ids,filters})=>({indexName:shared.generalIndexName,params:cleanSearchParams({hitsPerPage:Math.min(ids.length*2,1000),filters,facetFilters:[ids.map((id)=>`person_id:${id}`)],analytics:false,clickAnalytics:false})})));}catch(error){console.error('Could not join person records:',error);return counterparts;}halves.forEach(({half},index)=>{indexByPerson(((response.results||[])[index]||{}).hits||[],counterparts[half]);});return counterparts;}function uniquePersonKeys(ids){return [...new Set((ids||[]).map(personKey).filter(Boolean))];}function mergePeopleRows(peopleHits,counterparts,shared){const rows=[];const claimed=new Set();peopleHits.forEach((hit)=>{const key=hitPersonKey(hit);if(key){if(claimed.has(key))return;claimed.add(key);}const isDirectory=hit.entity_type==='directory';const directory=isDirectory?hit:(key&&counterparts.directory.get(key));const scientist=isDirectory?(key&&counterparts.scientists.get(key)):hit;rows.push({source:isDirectory?'directory':'scientist',hit,display:directory||hit,url:(scientist&&getHitUrl(scientist,shared))||getHitUrl(hit,shared)});});return rows;}async function buildPeopleRows(shared,peopleResult){const peopleHits=filterHitsByCurrentLanguage((peopleResult&&peopleResult.hits)||[],shared.currentLanguage);const directoryHits=peopleHits.filter((hit)=>hit.entity_type==='directory');const scientistHits=peopleHits.filter((hit)=>hit.entity_type!=='directory');const counterparts={directory:indexByPerson(directoryHits),scientists:indexByPerson(scientistHits)};const missing=(hits,into)=>hits.map(hitPersonKey).filter((key)=>key&&!into.has(key));const fetched=await fetchPersonCounterparts(shared,{directoryFor:missing(scientistHits,counterparts.directory),scientistsFor:missing(directoryHits,counterparts.scientists)});fetched.directory.forEach((hit,key)=>counterparts.directory.set(key,hit));fetched.scientists.forEach((hit,key)=>counterparts.scientists.set(key,hit));const rows=mergePeopleRows(peopleHits,counterparts,shared).map((row)=>({...row,result:peopleResult}));return {rows,peopleHits,directoryHits};}window.WisAlgoliaSearch.SCIENTIST_NODE_TYPE=SCIENTIST_NODE_TYPE;window.WisAlgoliaSearch.ARTICLE_NODE_TYPE=ARTICLE_NODE_TYPE;window.WisAlgoliaSearch.MIN_QUERY_LENGTH=MIN_QUERY_LENGTH;window.WisAlgoliaSearch.CRAWLED_PAGE_NODE_TYPE=CRAWLED_PAGE_NODE_TYPE;window.WisAlgoliaSearch.pagePathKey=pagePathKey;window.WisAlgoliaSearch.pagePathSet=pagePathSet;window.WisAlgoliaSearch.withoutCrawledDuplicates=withoutCrawledDuplicates;window.WisAlgoliaSearch.countDuplicateCrawledPages=countDuplicateCrawledPages;window.WisAlgoliaSearch.hitImageUrl=hitImageUrl;window.WisAlgoliaSearch.renderImageTag=renderImageTag;window.WisAlgoliaSearch.debounce=debounce;window.WisAlgoliaSearch.escapeHtml=escapeHtml;window.WisAlgoliaSearch.formatNumber=formatNumber;window.WisAlgoliaSearch.renderImage=renderImage;window.WisAlgoliaSearch.getHitTitle=getHitTitle;window.WisAlgoliaSearch.fixHebrewNamePeriod=fixHebrewNamePeriod;window.WisAlgoliaSearch.getHitRank=getHitRank;window.WisAlgoliaSearch.getHitName=getHitName;window.WisAlgoliaSearch.getHitUrl=getHitUrl;window.WisAlgoliaSearch.safeUrl=safeUrl;window.WisAlgoliaSearch.getHitFaculty=getHitFaculty;window.WisAlgoliaSearch.getHitDepartment=getHitDepartment;window.WisAlgoliaSearch.getHitDepartmentUrl=getHitDepartmentUrl;window.WisAlgoliaSearch.getHitFacultyUrl=getHitFacultyUrl;window.WisAlgoliaSearch.getPrimaryWorkPhone=getPrimaryWorkPhone;window.WisAlgoliaSearch.phoneFormat=phoneFormat;window.WisAlgoliaSearch.phoneToTelHref=phoneToTelHref;window.WisAlgoliaSearch.getHitPosition=getHitPosition;window.WisAlgoliaSearch.buildNodeLanguageFilter=buildNodeLanguageFilter;window.WisAlgoliaSearch.filterHitsByCurrentLanguage=filterHitsByCurrentLanguage;window.WisAlgoliaSearch.publicationsSearchUrl=publicationsSearchUrl;window.WisAlgoliaSearch.scientistFilters=scientistFilters;window.WisAlgoliaSearch.peopleFilters=peopleFilters;window.WisAlgoliaSearch.nonPeopleFilters=nonPeopleFilters;window.WisAlgoliaSearch.countDuplicatePeople=countDuplicatePeople;window.WisAlgoliaSearch.placeFacets=placeFacets;window.WisAlgoliaSearch.labTitle=labTitle;window.WisAlgoliaSearch.personKey=personKey;window.WisAlgoliaSearch.hitPersonKey=hitPersonKey;window.WisAlgoliaSearch.pagePersonKey=pagePersonKey;window.WisAlgoliaSearch.withoutDuplicatePersonPages=withoutDuplicatePersonPages;window.WisAlgoliaSearch.fetchPersonCounterparts=fetchPersonCounterparts;window.WisAlgoliaSearch.mergePeopleRows=mergePeopleRows;window.WisAlgoliaSearch.isExternalUrl=isExternalUrl;window.WisAlgoliaSearch.opensInNewTab=opensInNewTab;window.WisAlgoliaSearch.isViewablePageUrl=isViewablePageUrl;window.WisAlgoliaSearch.buildPeopleRows=buildPeopleRows;window.WisAlgoliaSearch.withNamedPlacesFirst=withNamedPlacesFirst;window.WisAlgoliaSearch.createParentFacultyIndex=createParentFacultyIndex;window.WisAlgoliaSearch.placeFloor=placeFloor;window.WisAlgoliaSearch.markResultsDrawn=markResultsDrawn;window.WisAlgoliaSearch.clearStaleResults=clearStaleResults;window.WisAlgoliaSearch.namedPlaces=namedPlaces;window.WisAlgoliaSearch.insightsClickAttrs=insightsClickAttrs;window.WisAlgoliaSearch.sendInsightsClick=sendInsightsClick;window.WisAlgoliaSearch.renderNoResults=renderNoResults;})(Drupal,once,drupalSettings);;
76(function(Drupal){'use strict';const DEFAULT_MAX_VALUES_PER_FACET=1000;const COLLAPSED_FACET_ITEMS=5;function escapeHtml(value){return window.WisAlgoliaSearch.escapeHtml(value);}function formatNumber(number){return window.WisAlgoliaSearch.formatNumber(number);}function cleanParams(params){return Object.fromEntries(Object.entries(params).filter(([,value])=>value!==undefined&&value!==null));}function attributesForLanguage(attributes,language){return attributes.map((attribute)=>(NON_MULTI_LANGUAGE_ATTRIBUTES.has(attribute)?attribute:`${attribute}.${language}`));}function groupsForLanguage(groups,language){return Object.fromEntries(Object.entries(groups).map(([groupId,attributes])=>[groupId,attributesForLanguage(attributes,language)]));}const NON_MULTI_LANGUAGE_ATTRIBUTES=new Set(['entity_type','search_api_language','person_id','department.facdiv.dept_code']);
76function normalizeExternalFilters(filters,language){const normalized={};Object.entries(filters).forEach(([attribute,values])=>{const isAlreadyLanguageSpecific=attribute.endsWith('.en')||attribute.endsWith('.he');const baseAttribute=attribute.replace(/\.(en|he)$/,'');const finalAttribute=!isAlreadyLanguageSpecific&&!NON_MULTI_LANGUAGE_ATTRIBUTES.has(baseAttribute)?`${baseAttribute}.${language}`:attribute;normalized[finalAttribute]=new Set(Array.isArray(values)?values:[values]);});return normalized;}function selection(state){return state.draft||state.filters;}function hasDraft(state){return Boolean(state.draft);}function beginDraft(state){state.draft=Object.fromEntries(Object.entries(state.filters).map(([attribute,values])=>[attribute,new Set(values)]));}function commitDraft(state){if(!state.draft)return false;state.filters=state.draft;delete state.draft;return true;}function discardDraft(state){delete state.draft;}function toggle(state,attribute,value){const filters=selection(state);if(!filters[attribute])filters[attribute]=new Set();if(filters[attribute].has(value))filters[attribute].delete(value);else filters[attribute].add(value);if(filters[attribute].size===0)delete filters[attribute];}function remove(state,attribute,value){const filters=selection(state);if(!filters[attribute])return;filters[attribute].delete(value);if(filters[attribute].size===0)delete filters[attribute];}function clearGroup(state,attributes){const filters=selection(state);let cleared=false;(attributes||[]).forEach((attribute)=>{if(filters[attribute]&&filters[attribute].size>0)cleared=true;delete filters[attribute];});return cleared;}function clearAttribute(state,attribute){delete selection(state)[attribute];}function clearAll(state){if(state.draft)state.draft={};else state.filters={};}function isSelected(state,attribute,value){const filters=selection(state);return Boolean(filters[attribute]&&filters[attribute].has(value));}function selected(state){const list=[];Object.entries(selection(state)).forEach(([attribute,values])=>{values.forEach((value)=>list.push({attribute,value}));});return list;}function facetFilters(state,exceptAttribute){const filters=[];Object.entries(state.filters).forEach(([attribute,values])=>{if(attribute===exceptAttribute)return;const list=Array.from(values).map((value)=>`${attribute}:${value}`);if(list.length===1)filters.push(list[0]);else{if(list.length>1)filters.push(list);}});return filters.length>0?filters:undefined;}function renderRail(view,state,options){const maxValues=options.maxValues||DEFAULT_MAX_VALUES_PER_FACET;const label=options.label||(({value})=>value);let hasAnyFilterItems=false;Object.entries(options.groups).forEach(([groupId,attributes])=>{const group=view.querySelector(`[data-filter-group="${groupId}"]`);const wrapper=view.querySelector(`[data-filter-list-wrapper="${groupId}"]`);if(!group||!wrapper)return;const lists=attributes.map((attribute)=>({attribute,items:Object.entries(state.facets[attribute]||{}).sort((a,b)=>b[1]-a[1]).slice(0,maxValues)})).filter(({items})=>items.length>0);let groupHtml='';const groupHasItems=lists.length>0;if(groupHasItems){hasAnyFilterItems=true;const nothingPicked=lists.every(({attribute})=>(!selection(state)[attribute]||selection(state)[attribute].size===0));const everythingPicked=lists.every(({attribute,items})=>(items.every(([value])=>isSelected(state,attribute,value))));groupHtml+=`
77          <label class="wis-refinement-all">
78            <input
79              type="checkbox"
80              ${nothingPicked||everythingPicked?'checked':''}
81              data-toggle-all-visible
82              data-group="${escapeHtml(groupId)}"
83            >
84            <span>${Drupal.t('All')}</span>
85          </label>
86        `;}
86lists.forEach(({attribute,items})=>{groupHtml+=`
87          <div class="wis-refinement-list ${state.facetShowMore[attribute]?'is-showing-more':''}">
88            <ul>
89        `;items.forEach(([value,count],index)=>{groupHtml+=`
90            <li class="${index>=COLLAPSED_FACET_ITEMS?'wis-extra-facet-item':''}">
91              <label class="wis-refinement-item">
92                <span>
93                  <input
94                    type="checkbox"
95                    ${isSelected(state,attribute,value)?'checked':''}
96                    data-filter-toggle
97                    data-attribute="${escapeHtml(attribute)}"
98                    data-value="${escapeHtml(value)}"
99                  >
100                  <span>${escapeHtml(label({attribute,value}))}</span>
101                </span>
102                <span class="wis-refinement-count">${formatNumber(count)}</span>
103              </label>
104            </li>
105          `;});groupHtml+='</ul>';if(items.length>COLLAPSED_FACET_ITEMS)groupHtml+=`
106            <button
107              type="button"
108              class="wis-facet-show-more"
109              data-toggle-facet-more
110              data-attribute="${escapeHtml(attribute)}"
111            >
112              ${state.facetShowMore[attribute]?Drupal.t('Show less'):Drupal.t('Show more')}
113            </button>
114          `;groupHtml+='</div>';});wrapper.innerHTML=groupHtml;group.classList.toggle('is-hidden',!groupHasItems);const clearButton=group.querySelector('.wis-filter-clear');if(clearButton){clearButton.classList.remove('is-hidden');clearButton.dataset.clearFilterGroup=groupId;}});view.querySelector('.wis-filters-title').classList.toggle('is-hidden',!hasAnyFilterItems);const sheetTrigger=view.querySelector('[data-filter-sheet-open]');const opening=view.querySelector('.wis-search-opening');const isOpening=Boolean(opening)&&!opening.classList.contains('is-hidden');if(sheetTrigger)sheetTrigger.classList.toggle('is-hidden',!hasAnyFilterItems||isOpening);}function renderChips(container,state,options={}){const list=selected(state);if(list.length===0){container.innerHTML='';return;}const label=options.label||(({value})=>value);let html='<div class="wis-selected-filter-list">';list.forEach((entry)=>{html+=`
115        <button
116          type="button"
117          class="wis-selected-filter-tag"
118          data-clear-single-filter
119          data-attribute="${escapeHtml(entry.attribute)}"
120          data-value="${escapeHtml(entry.value)}"
121        >
122          <span>${escapeHtml(String(label(entry)))}</span>
123          <span>×</span>
124        </button>
125      `;});html+=`
126      <button type="button" class="wis-selected-filter-tag wis-clear-all-tag" data-clear-all-filters>
127        <span>${Drupal.t('Clear all')}</span>
128        <span>×</span>
129      </button>
130    `;container.innerHTML=`${html}</div>`;}
130function renderStats(element,nbHits,isSearching,hasFilters){if(!isSearching&&!hasFilters){element.classList.add('is-hidden');element.textContent='';return;}element.classList.remove('is-hidden');element.innerHTML=`${Drupal.t('Found')} ${formatNumber(nbHits)} ${Drupal.t('results')}`+(hasFilters?` <span class="wis-stats-suffix">${Drupal.t('(FILTERED)')}</span>`:'');}function collectFacets(state,attributes,results){state.facets={};attributes.forEach((attribute,index)=>{const facets=results[index]&&results[index].facets;state.facets[attribute]=(facets&&facets[attribute])||{};});}window.WisAlgoliaFacets={attributesForLanguage,beginDraft,cleanParams,clearAll,clearAttribute,clearGroup,collectFacets,commitDraft,discardDraft,facetFilters,groupsForLanguage,hasDraft,isSelected,normalizeExternalFilters,remove,renderChips,renderRail,renderStats,selected,toggle};})(Drupal);;
131(function(Drupal){'use strict';const facets=window.WisAlgoliaFacets;const FILTER_GROUPS={categories:['node_type.name','entity_type'],faculty:['department.facdiv.name'],department:['department.depbranch.name'],section:['department.section.name']};const FACET_ATTRIBUTES_BASE=['node_type.name','entity_type','department.facdiv.name','department.depbranch.name','department.section.name'];const OTHER_RESULT_GROUP={id:'other',title:Drupal.t('Other'),getFilters:(language)=>buildOtherResultsFilter(language)};const KNOWN_NODE_TYPES={scientist:window.WisAlgoliaSearch.SCIENTIST_NODE_TYPE,article:window.WisAlgoliaSearch.ARTICLE_NODE_TYPE};const PEOPLE_GROUP_ID='people';const DEPARTMENT_GROUP_ID='department';const PLACE_FACETS=window.WisAlgoliaSearch.placeFacets;const MIN_QUERY_LENGTH=window.WisAlgoliaSearch.MIN_QUERY_LENGTH;const OTHER_OVERFETCH=8;const OTHER_FETCH_CAP=500;const OTHER_ATTRIBUTES=['*','-content','-layout_content','-headers','-wis_search_body_eng','-wis_search_body_heb'];const RESULT_GROUPS=[{id:PEOPLE_GROUP_ID,title:Drupal.t('People',{},{context:'Algolia'}),getFilters:(language)=>window.WisAlgoliaSearch.peopleFilters(language)},{id:'faculty',title:Drupal.t('Faculty'),filters:'entity_type:directory',facet:'department.facdiv.name',place:(hit)=>hit.department&&hit.department.facdiv},{id:'center',title:Drupal.t('Institute / Center'),filters:'entity_type:center OR entity_type:institute'},{id:'department',title:Drupal.t('Department'),filters:'entity_type:directory',facet:'department.depbranch.name',place:(hit)=>hit.department&&hit.department.depbranch},{id:'lab',title:Drupal.t('Lab'),filters:'entity_type:directory AND has_lab:true',labs:true},{id:'news',title:Drupal.t('News'),getFilters:(language)=>`entity_type:node AND search_api_language:${language} AND node_type.name.${language}:"${KNOWN_NODE_TYPES.article[language]}"`}];const ENTITY_TYPE_LABELS=()=>({directory:Drupal.t('People',{},{context:'Algolia'}),center:Drupal.t('Institute / Center'),institute:Drupal.t('Institute / Center')});function facetValueLabel({attribute,value}){return attribute==='entity_type'?(ENTITY_TYPE_LABELS()[value]||value):value;}function pruneEntityTypeFacet(state){const values=state.facets.entity_type;if(values)delete values.node;}function foldScientistsIntoPeople(state,language,duplicatePeople){const nodeTypes=state.facets[`node_type.name.${language}`];const entityTypes=state.facets.entity_type;const label=window.WisAlgoliaSearch.SCIENTIST_NODE_TYPE[language]||window.WisAlgoliaSearch.SCIENTIST_NODE_TYPE.en;const scientists=(nodeTypes&&nodeTypes[label])||0;if(nodeTypes)delete nodeTypes[label];if(!entityTypes)return;const people=Math.max(0,(entityTypes.directory||0)+scientists-(duplicatePeople||0));if(people)entityTypes.directory=people;else delete entityTypes.directory;}function foldCrawledPagesIntoTheirNodes(state,language,duplicateCrawledPages){const nodeTypes=state.facets[`node_type.name.${language}`];const label=window.WisAlgoliaSearch.CRAWLED_PAGE_NODE_TYPE[language]||window.WisAlgoliaSearch.CRAWLED_PAGE_NODE_TYPE.en;if(!nodeTypes||!nodeTypes[label])return;const pages=Math.max(0,nodeTypes[label]-(duplicateCrawledPages||0));if(pages)nodeTypes[label]=pages;else delete nodeTypes[label];}function countPlacesOnce(state,language){PLACE_FACETS(language).forEach((attribute)=>{const values=state.facets[attribute];
131if(values)Object.keys(values).forEach((value)=>{values[value]=1;});});}function isPlaceGroup(group){return Boolean(group.facet||group.labs);}const ALL_GROUPS=[...RESULT_GROUPS,OTHER_RESULT_GROUP];window.WisAlgoliaGeneralSearch={init};function limits(){return window.WisAlgoliaSearch.limits;}function init(shared){const view=shared.root.querySelector('.wis-advanced-view[data-view="general"]');if(!view)return;const input=view.querySelector('.wis-advanced-search-input');const state={query:'',filters:{},facets:{},facetShowMore:{},groupOpen:{},groupShowMore:{},requestId:0};ALL_GROUPS.forEach((group)=>{state.groupOpen[group.id]=true;state.groupShowMore[group.id]=false;});input.addEventListener('input',window.WisAlgoliaSearch.debounce(()=>{state.query=input.value.trim();render(shared,view,state);},180));shared.root.addEventListener('wisAlgoliaSearch:applyState',(event)=>{const detail=event.detail||{};if(detail.tab&&detail.tab!=='general')return;if(typeof detail.query==='string'){state.query=detail.query.trim();input.value=state.query;}if(detail.filters&&typeof detail.filters==='object')state.filters=facets.normalizeExternalFilters(detail.filters,shared.currentLanguage);window.WisAlgoliaSearch.clearStaleResults(view,state,facets);render(shared,view,state);});view.addEventListener('click',(event)=>{if(handleFilterClick(shared,view,state,event))return;const openPerson=event.target.closest('[data-open-person]');if(openPerson){shared.open({tab:'people',query:state.query,filters:{person_id:[openPerson.dataset.openPerson]},personLabel:openPerson.dataset.personLabel||'',returnQuery:state.query});return;}const groupHeader=event.target.closest('[data-toggle-result-group]');if(groupHeader){const groupId=groupHeader.dataset.toggleResultGroup;state.groupOpen[groupId]=!state.groupOpen[groupId];render(shared,view,state);return;}const groupMore=event.target.closest('[data-toggle-group-more]');if(groupMore){const groupId=groupMore.dataset.toggleGroupMore;state.groupShowMore[groupId]=!state.groupShowMore[groupId];render(shared,view,state);}});render(shared,view,state);}function handleFilterClick(shared,view,state,event){const rerender=()=>(facets.hasDraft(state)?renderRailOnly(shared,view,state):render(shared,view,state));const sheetOpen=event.target.closest('[data-filter-sheet-open]');if(sheetOpen){facets.beginDraft(state);renderRailOnly(shared,view,state);window.WisAlgoliaMobile.openFilterSheet(view);return true;}const sheetApply=event.target.closest('[data-filter-sheet-apply]');if(sheetApply){facets.commitDraft(state);window.WisAlgoliaMobile.closeFilterSheet(view);render(shared,view,state);return true;}const sheetClose=event.target.closest('[data-filter-sheet-close]');if(sheetClose){facets.discardDraft(state);window.WisAlgoliaMobile.closeFilterSheet(view);renderRailOnly(shared,view,state);return true;}const filterToggle=event.target.closest('[data-filter-toggle]');if(filterToggle){facets.toggle(state,filterToggle.dataset.attribute,filterToggle.dataset.value);rerender();return true;}const clearGroup=event.target.closest('[data-clear-filter-group]');if(clearGroup){const groups=facets.groupsForLanguage(FILTER_GROUPS,shared.currentLanguage);if(facets.clearGroup(state,groups[clearGroup.dataset.clearFilterGroup]))rerender();return true;}const clearAll=event.target.closest('[data-clear-all-filters]');if(clearAll){facets.clearAll(state);rerender();return true;}const clearSingle=event.target.closest('[data-clear-single-filter]');if(clearSingle){facets.remove(state,clearSingle.dataset.attribute,clearSingle.dataset.value);rerender();return true;}const toggleAll=event.target.closest('[data-toggle-all-visible]');if(toggleAll){const allGroups=facets.groupsForLanguage(FILTER_GROUPS,shared.currentLanguage);if(facets.clearGroup(state,allGroups[toggleAll.dataset.group]))rerender();return true;}const showMoreFacet=event.target.closest('[data-toggle-facet-more]');if(showMoreFacet){const attribute=showMoreFacet.dataset.attribute;state.facetShowMore[attribute]=!state.facetShowMore[attribute];rerender();return true;}return false;}function renderRailOnly(shared,view,state){facets.renderRail(view,state,{groups:facets.groupsForLanguage(FILTER_GROUPS,shared.currentLanguage),maxValues:limits().generalMaxValuesPerFacet,label:facetValueLabel});}async function render(shared,view,state){const queryLabel=view.querySelector('.wis-query-label');const statsLabel=view.querySelector('.wis-stats-label');const resultsColumn=view.querySelector('.wis-results-column');const minQueryMessage=view.querySelector('.wis-min-query-message');const hasQuery=state.query.length>0;const hasFilters=facets.selected(state).length>0;const tooShort=hasQuery&&state.query.length<MIN_QUERY_LENGTH;if(minQueryMessage)minQueryMessage.classList.toggle('is-hidden',!tooShort);const nothingToSearchOn=tooShort||(!hasQuery&&!hasFilters);if(shared.toggleOpeningScreen)shared.toggleOpeningScreen(nothingToSearchOn);queryLabel.classList.toggle('is-hidden',!hasQuery||tooShort);resultsColumn.classList.toggle('is-hidden',nothingToSearchOn);facets.renderChips(view.querySelector('.wis-selected-filters'),state,{label:facetValueLabel});if(tooShort){statsLabel.classList.add('is-hidden');state.requestId++;return;}const currentRequestId=++state.requestId;try{const facetAttributes=facets.attributesForLanguage(FACET_ATTRIBUTES_BASE,shared.currentLanguage);const languageFilter=window.WisAlgoliaSearch.buildNodeLanguageFilter(shared.currentLanguage);const response=await shared.client.search([{indexName:shared.generalIndexName,params:facets.cleanParams({query:state.query,hitsPerPage:0,filters:languageFilter,facetFilters:facets.facetFilters(state),analytics:hasQuery,analyticsTags:[`lang:${shared.currentLanguage}`],clickAnalytics:false,userToken:window.WisAlgoliaSearch.userToken})},...facetAttributes.map((attribute)=>({indexName:shared.generalIndexName,params:facets.cleanParams({query:state.query,hitsPerPage:0,filters:languageFilter,facets:[attribute],maxValuesPerFacet:limits().generalMaxValuesPerFacet,facetFilters:facets.facetFilters(state,attribute),analytics:false,clickAnalytics:false})}))]);if(currentRequestId!==state.requestId)return;const facetResults=response.results.slice(1);facets.collectFacets(state,facetAttributes,facetResults);pruneEntityTypeFacet(state);countPlacesOnce(state,shared.currentLanguage);const drawn=await renderGroupedResults(shared,view,state,currentRequestId);if(drawn!==null){foldScientistsIntoPeople(state,shared.currentLanguage,drawn.duplicatePeople);foldCrawledPagesIntoTheirNodes(state,shared.currentLanguage,drawn.duplicateCrawledPages);facets.renderRail(view,state,{groups:facets.groupsForLanguage(FILTER_GROUPS,shared.currentLanguage),maxValues:limits().generalMaxValuesPerFacet,label:facetValueLabel});facets.renderStats(statsLabel,drawn.found,hasQuery,hasFilters);renderScopes(shared,view,drawn.found,hasQuery||hasFilters,state.query);}}catch(error){console.error('General search error:',error);resultsColumn.innerHTML=`<div class="wis-search-error">${Drupal.t('Search error.')}</div>`;window.WisAlgoliaSearch.markResultsDrawn(state,facets);}}function groupHitsPerPage(state,group){return state.groupShowMore[group.id]?limits().generalExpanded:limits().generalCollapsed;}function collapsedLimit(){return window.WisAlgoliaMobile&&window.WisAlgoliaMobile.isMobile()?limits().generalCollapsedMobile:limits().generalCollapsed;}function groupRowsShown(state,group){return state.groupShowMore[group.id]?limits().generalExpanded:collapsedLimit();}function buildGroupQueries(shared,state){const queries=[];const seen=new Map();const resultIndex=[];const send=(params)=>{const key=JSON.stringify(params);if(!seen.has(key)){seen.set(key,queries.length);queries.push({indexName:shared.generalIndexName,params});}return seen.get(key);};const placeParams=(group)=>{const attribute=`${group.facet}.${shared.currentLanguage}`;return facets.cleanParams({query:state.query,hitsPerPage:100,filters:'entity_type:directory',restrictSearchableAttributes:[attribute],facets:[attribute],maxValuesPerFacet:100,attributesToRetrieve:['department'],attributesToHighlight:[],typoTolerance:shared.currentLanguage==='he',facetFilters:facets.facetFilters(state),analytics:false,clickAnalytics:false});};const groupParams=(group,filters)=>facets.cleanParams({query:state.query,hitsPerPage:group.id===OTHER_RESULT_GROUP.id?Math.min(OTHER_FETCH_CAP,groupHitsPerPage(state,group)*OTHER_OVERFETCH):groupHitsPerPage(state,group),attributesToRetrieve:group.id===OTHER_RESULT_GROUP.id?OTHER_ATTRIBUTES:undefined,filters,facets:group.getFacets?group.getFacets(shared.currentLanguage):undefined,facetFilters:facets.facetFilters(state),analytics:false,clickAnalytics:true,userToken:window.WisAlgoliaSearch.userToken});
131ALL_GROUPS.forEach((group)=>{if(group.facet){resultIndex.push(send(placeParams(group)));return;}if(group.labs){resultIndex.push(-1);return;}resultIndex.push(send(groupParams(group,group.getFilters?group.getFilters(shared.currentLanguage):group.filters)));});const scientistIdsIndex=send(facets.cleanParams({query:state.query,hitsPerPage:1000,filters:window.WisAlgoliaSearch.scientistFilters(shared.currentLanguage),attributesToRetrieve:['person_id','sci_person_id'],attributesToHighlight:[],facetFilters:facets.facetFilters(state),analytics:false,clickAnalytics:false}));const language=shared.currentLanguage;const crawledPage=`node_type.name.${language}:"${crawledPageLabel(language)}"`;const urlsOnly=(filters)=>facets.cleanParams({query:state.query,hitsPerPage:1000,filters:`search_api_language:${language} AND ${filters}`,attributesToRetrieve:['url','url_en','url_he'],attributesToHighlight:[],facetFilters:facets.facetFilters(state),analytics:false,clickAnalytics:false});const crawledPagesIndex=send(urlsOnly(crawledPage));const canonicalPagesIndex=send(urlsOnly(`NOT ${crawledPage}`));return {queries,resultIndex,scientistIdsIndex,crawledPagesIndex,canonicalPagesIndex};}function crawledPageLabel(language){const label=window.WisAlgoliaSearch.CRAWLED_PAGE_NODE_TYPE;return label[language]||label.en;}async function renderGroupedResults(shared,view,state,requestId){const resultsColumn=view.querySelector('.wis-results-column');const {queries,resultIndex,scientistIdsIndex,crawledPagesIndex,canonicalPagesIndex}=buildGroupQueries(shared,state);const response=await shared.client.search(queries);if(requestId!==state.requestId)return null;const peoplePosition=ALL_GROUPS.findIndex((group)=>group.id===PEOPLE_GROUP_ID);const canonicalPaths=window.WisAlgoliaSearch.pagePathSet((response.results[canonicalPagesIndex]||{}).hits);const duplicateCrawledPages=window.WisAlgoliaSearch.countDuplicateCrawledPages(response.results[crawledPagesIndex],canonicalPaths);await resolvePlacePages(shared,placeNamesToResolve(shared,state,response,resultIndex));const [people,duplicatePeople]=await Promise.all([window.WisAlgoliaSearch.buildPeopleRows(shared,response.results[resultIndex[peoplePosition]]),window.WisAlgoliaSearch.countDuplicatePeople(shared,{query:state.query,filters:'entity_type:directory',facetFilters:facets.facetFilters(state),scientistResult:response.results[scientistIdsIndex]})]);if(requestId!==state.requestId)return null;let html='';let anyResults=false;let found=0;const peopleShown=people.rows.slice(0,groupRowsShown(state,ALL_GROUPS.find((group)=>group.id===PEOPLE_GROUP_ID)));const namedResult=(id)=>{const position=ALL_GROUPS.findIndex((group)=>group.id===id);return position>=0&&resultIndex[position]>=0?response.results[resultIndex[position]]:null;};people.rows=window.WisAlgoliaSearch.withNamedPlacesFirst(people.rows,window.WisAlgoliaSearch.namedPlaces(namedResult('faculty'),namedResult('department'),shared),shared);ALL_GROUPS.forEach((group,position)=>{const result=resultIndex[position]>=0?response.results[resultIndex[position]]:null;const perPage=groupRowsShown(state,group);const isPeople=group.id===PEOPLE_GROUP_ID;const isOther=group.id===OTHER_RESULT_GROUP.id;const isPlace=isPlaceGroup(group);const allRows=isPeople?people.rows:(isPlace?(group.facet?buildPlaceSection(group,result,peopleShown,shared):buildPlaceRows(group,peopleShown,shared)):window.WisAlgoliaSearch.filterHitsByCurrentLanguage(result.hits||[],shared.currentLanguage).map((hit)=>({hit,display:hit,url:window.WisAlgoliaSearch.getHitUrl(hit,shared),result})));const groupRows=isOther?sitePagesFirst(window.WisAlgoliaSearch.withoutCrawledDuplicates(allRows,canonicalPaths)):allRows;const rows=groupRows.slice(0,perPage);const hasResults=rows.length>0;anyResults=anyResults||hasResults;const isOpen=hasResults&&state.groupOpen[group.id];const total=isPlace?allRows.length:groupTotal(result,rows,{isPeople,isOther,duplicatePeople,duplicateCrawledPages});if(!isPlace)found+=total;const hasMore=total>collapsedLimit();if(!hasResults)return;html+=`
132        <section class="wis-result-group">
133          <button
134            type="button"
135            class="wis-result-group-header ${isOpen?'is-open':''}"
136            data-toggle-result-group="${group.id}"
137          >
138            <span>${escapeHtml(group.title)}</span>
139            <span class="wis-collapse-toggle"></span>
140          </button>
141      `;if(isOpen){html+='<div class="wis-results-grid">';rows.forEach((row)=>{html+=isPlace?renderPlaceCard(row):renderResultCard(row,shared,group.id);});html+='</div>';if(hasMore)html+=`
142            <button type="button" class="wis-show-more-button" data-toggle-group-more="${group.id}">
143              ${state.groupShowMore[group.id]?Drupal.t('Show less'):Drupal.t('Show more')}
144            </button>
145          `;}html+='</section>';});resultsColumn.innerHTML=anyResults?html:window.WisAlgoliaSearch.renderNoResults(state.query,shared);window.WisAlgoliaSearch.markResultsDrawn(state,facets);return {found,duplicatePeople,duplicateCrawledPages};}function renderScopes(shared,view,nbHits,isSearching,query){const container=view.querySelector('.wis-search-scopes');if(!container)return;container.classList.toggle('is-hidden',!isSearching);if(!isSearching){container.innerHTML='';return;}const publicationsUrl=window.WisAlgoliaSearch.safeUrl(window.WisAlgoliaSearch.publicationsSearchUrl(shared,query));container.innerHTML=`
146      <span class="wis-search-scope is-active">
147        ${Drupal.t('General')}
148        <span class="wis-search-scope-count">${formatNumber(nbHits)}</span>
149      </span>
150      ${publicationsUrl?`
151        <a class="wis-search-scope" href="${escapeHtml(publicationsUrl)}" target="_blank" rel="noopener noreferrer">
152          ${Drupal.t('Publications')}
153        </a>
154      `:''}
155    `;}function renderResultCard(row,shared,groupId){const {hit,display,url,result}=row;const faculty=window.WisAlgoliaSearch.getHitFaculty(display,shared);const position=window.WisAlgoliaSearch.getHitPosition(display,shared);const name=escapeHtml(window.WisAlgoliaSearch.getHitTitle(display,shared));let innerHtml='';switch(groupId){case PEOPLE_GROUP_ID:innerHtml=`
156          <span class="wis-result-image">
157            ${window.WisAlgoliaSearch.renderImage(display)}
158          </span>
159          <span class="wis-result-content">
160            <span class="wis-result-title">${name}</span>
161            ${position?`<span class="wis-result-meta">${escapeHtml(position)}</span>`:''}
162            ${faculty?`<span class="wis-result-meta">(${escapeHtml(faculty)})</span>`:''}
163          </span>
164        `;break;case 'news':{const image=window.WisAlgoliaSearch.hitImageUrl(display);innerHtml=`
165          ${image?`
166            <span class="wis-result-image wis-result-image-news">
167              ${window.WisAlgoliaSearch.renderImageTag(image)}
168            </span>
169          `:''}
170          <span class="wis-result-content">
171            <span class="wis-result-title">${name}</span>
172          </span>
173        `;break;}default:innerHtml=`
174          <span class="wis-result-content">
175            <span class="wis-result-title">${name}</span>
176          </span>
177        `;break;}const personId=groupId===PEOPLE_GROUP_ID?window.WisAlgoliaSearch.hitPersonKey(display):'';if(!url&&personId)return `
178        <button
179          type="button"
180          class="wis-result-card wis-result-card-link"
181          data-open-person="${escapeHtml(personId)}"
182          data-person-label="${name}"
183        >
184          ${innerHtml}
185        </button>
186      `;if(url){const insightsAttrs=window.WisAlgoliaSearch.insightsClickAttrs(shared.generalIndexName,'Search Result Clicked',hit,result);return `
187        <a class="wis-result-card wis-result-card-link" href="${escapeHtml(url)}"${window.WisAlgoliaSearch.opensInNewTab(display,url)?' target="_blank" rel="noopener noreferrer"':''}${insightsAttrs}>
188          ${innerHtml}
189        </a>
190      `;}return `
191      <div class="wis-result-card">
192        ${innerHtml}
193      </div>
194    `;}const placePages=new Map();const parentFaculties=new Map();function parentFacultyIndex(language){if(!parentFaculties.has(language))parentFaculties.set(language,window.WisAlgoliaSearch.createParentFacultyIndex(language));return parentFaculties.get(language);}function placeCacheKey(attribute,name){return `${attribute}\u0000${name}`;}const PLACE_LOOKUP_BATCH=40;const MAX_PLACE_LOOKUPS=80;const PLACE_LOOKUP_HEADROOM=8;async function resolvePlacePages(shared,wanted){const pending=wanted.filter((item)=>!placePages.has(placeCacheKey(item.attribute,item.name))).slice(0,MAX_PLACE_LOOKUPS);if(pending.length===0)return;const batches=[];for(let start=0;start<pending.length;start+=PLACE_LOOKUP_BATCH)batches.push(pending.slice(start,start+PLACE_LOOKUP_BATCH));await Promise.all(batches.map((batch)=>resolvePlacePageBatch(shared,batch)));}async function resolvePlacePageBatch(shared,pending){let response;try{response=await shared.client.search(pending.map((item)=>({indexName:shared.generalIndexName,params:facets.cleanParams({query:'',hitsPerPage:1,filters:`entity_type:directory AND ${item.attribute}:"${item.name.replaceAll('"','\\"')}"`,attributesToRetrieve:['department'],attributesToHighlight:[],analytics:false,clickAnalytics:false})})));}catch(error){console.error('Could not resolve place pages:',error);return;}pending.forEach((item,index)=>{const hit=(((response.results||[])[index]||{}).hits||[])[0];const place=hit&&item.place(hit);if(hit)parentFacultyIndex(shared.currentLanguage||'en').learn(hit);placePages.set(placeCacheKey(item.attribute,item.name),window.WisAlgoliaSearch.safeUrl(place&&place.url));});}
194function placeNamesToResolve(shared,state,response,resultIndex){const language=shared.currentLanguage||'en';const wanted=[];ALL_GROUPS.forEach((group,position)=>{if(!group.facet||resultIndex[position]<0)return;const drawn=groupRowsShown(state,group)+PLACE_LOOKUP_HEADROOM;const attribute=`${group.facet}.${language}`;const result=response.results[resultIndex[position]];const known=new Set();((result&&result.hits)||[]).forEach((hit)=>{const place=group.place(hit);if(place&&place.url&&place.name&&place.name[language])known.add(place.name[language]);});const counts=(result&&result.facets&&result.facets[attribute])||{};Object.keys(counts).sort((a,b)=>counts[b]-counts[a]).slice(0,drawn).filter((name)=>!known.has(name)).forEach((name)=>wanted.push({attribute,name,place:group.place}));});return wanted;}function buildNamedPlaceRows(group,result,shared){const language=shared.currentLanguage||'en';const attribute=`${group.facet}.${language}`;const counts=(result&&result.facets&&result.facets[attribute])||{};const pages=new Map();((result&&result.hits)||[]).forEach((hit)=>{parentFacultyIndex(language).learn(hit);const place=group.place(hit);const name=place&&place.name&&place.name[language];if(name&&place.url&&!pages.has(name))pages.set(name,place.url);});return Object.keys(counts).sort((a,b)=>counts[b]-counts[a]).map((name)=>({label:name,url:window.WisAlgoliaSearch.safeUrl(pages.get(name))||placePages.get(placeCacheKey(attribute,name))||''}));}function placesFromPeople(group,peopleRows,shared){const language=shared.currentLanguage||'en';const found=new Map();peopleRows.forEach(({display})=>{parentFacultyIndex(language).learn(display);const place=display&&group.place(display);const name=place&&place.name&&place.name[language];if(!name)return;const entry=found.get(name)||{label:name,url:'',count:0};entry.count+=1;entry.url=entry.url||window.WisAlgoliaSearch.safeUrl(place.url);found.set(name,entry);});return [...found.values()].sort((a,b)=>b.count-a.count);}function placeRowTarget(group,row,shared){if(row.url||group.id!==DEPARTMENT_GROUP_ID)return row;const language=shared.currentLanguage||'en';const parent=parentFacultyIndex(language).parentOf(row.label);if(!parent)return row;const url=parent.url||placePages.get(placeCacheKey(`department.facdiv.name.${language}`,parent.name))||'';return url?{...row,url}:row;}function buildPlaceSection(group,result,peopleRows,shared){const named=buildNamedPlaceRows(group,result,shared);const seen=new Set(named.map((row)=>row.label));const language=shared.currentLanguage||'en';const attribute=`${group.facet}.${language}`;const floor=window.WisAlgoliaSearch.placeFloor(peopleRows.length);const alsoWorkHere=placesFromPeople(group,peopleRows,shared).filter((place)=>place.count>=floor&&!seen.has(place.label)).map((place)=>({label:place.label,url:place.url||placePages.get(placeCacheKey(attribute,place.label))||''}));return [...named,...alsoWorkHere].map((row)=>placeRowTarget(group,row,shared)).filter((row)=>row.url);}function buildPlaceRows(group,peopleRows,shared){const language=shared.currentLanguage||'en';const rows=[];const seen=new Set();const add=(label,url)=>{const name=String(label||'').trim();if(!name||seen.has(name))return;seen.add(name);rows.push({label:name,url:window.WisAlgoliaSearch.safeUrl(url)});};peopleRows.forEach(({display})=>{if(!display)return;if(group.labs){(Array.isArray(display.labs)?display.labs:[]).forEach((lab)=>{add(window.WisAlgoliaSearch.labTitle(lab,language),lab&&lab.homepage);});return;}const place=group.place(display);add(place&&place.name&&place.name[language],place&&place.url);});return rows;}function renderPlaceCard({label,url}){const inner=`
195      <span class="wis-result-content">
196        <span class="wis-result-title">${escapeHtml(label)}</span>
197      </span>
198    `;if(!url)return `<div class="wis-result-card">${inner}</div>`;const target=window.WisAlgoliaSearch.isExternalUrl(url)?' target="_blank" rel="noopener noreferrer"':'';return `
199      <a class="wis-result-card wis-result-card-link" href="${escapeHtml(url)}"${target}>
200        ${inner}
201      </a>
202    `;}function sitePagesFirst(rows){const rank=(row)=>((row.hit||row).is_crawler_data?0:1);return [...rows].sort((a,b)=>rank(a)-rank(b));}function groupTotal(result,rows,{isPeople,isOther,duplicatePeople,duplicateCrawledPages}){const nbHits=result.nbHits||0;if(isPeople)return Math.max(0,nbHits-duplicatePeople);if(isOther)return Math.max(0,nbHits-duplicateCrawledPages);return result.nbHits||rows.length;}function buildOtherResultsFilter(language){const attribute=`node_type.name.${language}`;const excluded=Object.values(KNOWN_NODE_TYPES).map((nodeType)=>nodeType[language]).filter(Boolean).map((label)=>`NOT ${attribute}:"${label}"`).join(' AND ');return `search_api_language:${language} AND ${excluded}`;}function escapeHtml(value){return window.WisAlgoliaSearch.escapeHtml(value);}function formatNumber(number){return window.WisAlgoliaSearch.formatNumber(number);}})(Drupal);;
203(function(Drupal){'use strict';const facets=window.WisAlgoliaFacets;const MIN_QUERY_LENGTH=window.WisAlgoliaSearch.MIN_QUERY_LENGTH;const DIRECTORY_FILTER='entity_type:directory';const CARD_ATTRIBUTES=['name','person_id','photos','positions','department','phones','email','homepage','location'];const FILTER_GROUPS={faculty:['department.facdiv.name'],department:['department.depbranch.name'],section:['department.section.name']};const FACET_ATTRIBUTES_BASE=['department.facdiv.name','department.depbranch.name','department.section.name'];window.WisAlgoliaPeopleSearch={init};const TRUE_ALWAYS=true;const SHOW_STATS=false;function limits(){return window.WisAlgoliaSearch.limits;}function init(shared){const view=shared.root.querySelector('.wis-advanced-view[data-view="people"]');if(!view)return;const input=view.querySelector('.wis-advanced-search-input');const state={query:'',filters:{},facets:{},facetShowMore:{},list:null,personLabel:'',returnQuery:null,requestId:0};input.addEventListener('input',window.WisAlgoliaSearch.debounce(()=>{state.query=input.value.trim();state.personLabel='';state.returnQuery=null;delete state.filters.person_id;render(shared,view,state);},180));shared.root.addEventListener('wisAlgoliaSearch:applyState',(event)=>{const detail=event.detail||{};if(detail.tab&&detail.tab!=='people')return;if(typeof detail.query==='string'){state.query=detail.query.trim();input.value=state.query;}if(detail.filters&&typeof detail.filters==='object')state.filters=facets.normalizeExternalFilters(detail.filters,shared.currentLanguage);window.WisAlgoliaSearch.clearStaleResults(view,state,facets);state.personLabel=typeof detail.personLabel==='string'?detail.personLabel:'';state.returnQuery=typeof detail.returnQuery==='string'?detail.returnQuery:null;render(shared,view,state);});view.addEventListener('click',(event)=>{const clearSingle=event.target.closest('[data-clear-single-filter]');if(clearSingle&&clearSingle.dataset.attribute==='person_id'&&state.returnQuery!==null){const query=state.returnQuery;facets.remove(state,'person_id',clearSingle.dataset.value);state.personLabel='';state.returnQuery=null;render(shared,view,state);shared.open({tab:'general',query});return;}if(handleFilterClick(shared,view,state,event))return;if(event.target.closest('[data-load-more-people]'))loadMorePeople(shared,view,state);});render(shared,view,state);}function handleFilterClick(shared,view,state,event){const rerender=()=>(facets.hasDraft(state)?renderRailOnly(shared,view,state):render(shared,view,state));const sheetOpen=event.target.closest('[data-filter-sheet-open]');if(sheetOpen){facets.beginDraft(state);renderRailOnly(shared,view,state);window.WisAlgoliaMobile.openFilterSheet(view);return true;}const sheetApply=event.target.closest('[data-filter-sheet-apply]');if(sheetApply){facets.commitDraft(state);window.WisAlgoliaMobile.closeFilterSheet(view);render(shared,view,state);return true;}const sheetClose=event.target.closest('[data-filter-sheet-close]');if(sheetClose){facets.discardDraft(state);window.WisAlgoliaMobile.closeFilterSheet(view);renderRailOnly(shared,view,state);return true;}const filterToggle=event.target.closest('[data-filter-toggle]');if(filterToggle){facets.toggle(state,filterToggle.dataset.attribute,filterToggle.dataset.value);rerender();return true;}const clearGroup=event.target.closest('[data-clear-filter-group]');if(clearGroup){const groups=facets.groupsForLanguage(FILTER_GROUPS,shared.currentLanguage);if(facets.clearGroup(state,groups[clearGroup.dataset.clearFilterGroup]))rerender();return true;}const clearAll=event.target.closest('[data-clear-all-filters]');if(clearAll){facets.clearAll(state);rerender();return true;}const clearSingle=event.target.closest('[data-clear-single-filter]');if(clearSingle){facets.remove(state,clearSingle.dataset.attribute,clearSingle.dataset.value);rerender();return true;}const toggleAll=event.target.closest('[data-toggle-all-visible]');if(toggleAll){const allGroups=facets.groupsForLanguage(FILTER_GROUPS,shared.currentLanguage);if(facets.clearGroup(state,allGroups[toggleAll.dataset.group]))rerender();return true;}const showMoreFacet=event.target.closest('[data-toggle-facet-more]');if(showMoreFacet){const attribute=showMoreFacet.dataset.attribute;state.facetShowMore[attribute]=!state.facetShowMore[attribute];rerender();return true;}return false;}function renderRailOnly(shared,view,state){facets.renderRail(view,state,{groups:facets.groupsForLanguage(FILTER_GROUPS,shared.currentLanguage),maxValues:limits().peopleMaxValuesPerFacet,label:({value})=>facetLabel(value,shared.currentLanguage)});}async function render(shared,view,state){const queryLabel=view.querySelector('.wis-query-label');const statsLabel=view.querySelector('.wis-stats-label');const selectedFiltersContainer=view.querySelector('.wis-selected-filters');const resultsColumn=view.querySelector('.wis-results-column');const minQueryMessage=view.querySelector('.wis-min-query-message');const tooShort=state.query.length>0&&state.query.length<MIN_QUERY_LENGTH;if(minQueryMessage)minQueryMessage.classList.toggle('is-hidden',!tooShort);if(tooShort){queryLabel.classList.add('is-hidden');statsLabel.classList.add('is-hidden');resultsColumn.classList.add('is-hidden');renderChips(selectedFiltersContainer,state);return;}const hasQuery=state.query.length>0;const hasFilters=facets.selected(state).length>0;queryLabel.classList.toggle('is-hidden',!hasQuery);resultsColumn.classList.remove('is-hidden');renderChips(selectedFiltersContainer,state);const currentRequestId=++state.requestId;try{const facetAttributes=facets.attributesForLanguage(FACET_ATTRIBUTES_BASE,shared.currentLanguage);const response=await shared.client.search([{indexName:shared.peopleIndexName,params:facets.cleanParams({query:state.query,hitsPerPage:0,filters:DIRECTORY_FILTER,facetFilters:facets.facetFilters(state),analytics:false,clickAnalytics:false})},...facetAttributes.map((attribute)=>({indexName:shared.peopleIndexName,params:facets.cleanParams({query:state.query,hitsPerPage:0,filters:DIRECTORY_FILTER,facets:[attribute],maxValuesPerFacet:limits().peopleMaxValuesPerFacet,facetFilters:facets.facetFilters(state,attribute),analytics:false,clickAnalytics:false})}))]);if(currentRequestId!==state.requestId)return;const [stats,...facetResults]=response.results;facets.collectFacets(state,facetAttributes,facetResults);if(SHOW_STATS)facets.renderStats(statsLabel,stats.nbHits||0,TRUE_ALWAYS,hasFilters);else{statsLabel.classList.add('is-hidden');statsLabel.textContent='';}facets.renderRail(view,state,{groups:facets.groupsForLanguage(FILTER_GROUPS,shared.currentLanguage),maxValues:limits().peopleMaxValuesPerFacet,label:({value})=>facetLabel(value,shared.currentLanguage)});await renderPeopleList(shared,view,state,currentRequestId);}catch(error){console.error('People search error:',error);resultsColumn.innerHTML=`<div class="wis-search-error">${Drupal.t('Search error.')}</div>`;window.WisAlgoliaSearch.markResultsDrawn(state,facets);}}function renderChips(container,state){facets.renderChips(container,state,{label:({attribute,value})=>(attribute==='person_id'?(state.personLabel||value):value)});}const SEARCH_CEILING=1000;async function browsePeople(shared,{cursor,facetFilters}){const url=`https://${shared.appId}-dsn.algolia.net/1/indexes/`+`${encodeURIComponent(shared.peopleIndexName)}/browse`;const response=await fetch(url,{method:'POST',headers:{'X-Algolia-Application-Id':shared.appId,'X-Algolia-API-Key':shared.apiKey,'Content-Type':'application/json'},body:JSON.stringify(facets.cleanParams({filters:DIRECTORY_FILTER,facetFilters,hitsPerPage:limits().peopleBrowsePage,attributesToRetrieve:CARD_ATTRIBUTES,attributesToHighlight:[],cursor}))});if(!response.ok)throw new Error(`Algolia browse answered ${response.status}`);return response.json();}async function searchPeoplePage(shared,state,page){const index=shared.client.initIndex(shared.peopleIndexName);return index.search(state.query,facets.cleanParams({page,hitsPerPage:limits().peopleCollapsed,attributesToRetrieve:CARD_ATTRIBUTES,filters:DIRECTORY_FILTER,facetFilters:facets.facetFilters(state),analytics:page===0,analyticsTags:[`lang:${shared.currentLanguage}`],clickAnalytics:true,userToken:window.WisAlgoliaSearch.userToken}));}function listKey(state){return JSON.stringify([state.query,facets.facetFilters(state)||[]]);}function hasMore(list){if(!list)return false;return list.browsing?Boolean(list.cursor):list.hits.length<Math.min(list.nbHits,SEARCH_CEILING);}function stoppedShort(list){return Boolean(list)&&!list.browsing&&!hasMore(list)&&list.nbHits>SEARCH_CEILING;}async function fetchPage(shared,state,list){if(list.browsing){const page=await browsePeople(shared,{cursor:list.cursor,facetFilters:facets.facetFilters(state)});return {hits:page.hits||[],cursor:page.cursor,result:null};}const result=await searchPeoplePage(shared,state,list.page+1);return {hits:result.hits||[],page:list.page+1,result};}async function renderPeopleList(shared,view,state,requestId){const resultsColumn=view.querySelector('.wis-results-column');const key=listKey(state);if(!state.list||state.list.key!==key){const browsing=state.query.length===0;const first=browsing?await browsePeople(shared,{facetFilters:facets.facetFilters(state)}):await searchPeoplePage(shared,state,0);await Promise.all([loadMobilePhones(first.hits||[]),loadPersonPages(shared,first.hits||[])]);if(requestId!==state.requestId)return;state.list={key,browsing,hits:first.hits||[],cursor:browsing?first.cursor:undefined,page:0,nbHits:browsing?Infinity:(first.nbHits||0),result:browsing?null:first,loading:false};}const list=state.list;if(list.hits.length===0){resultsColumn.innerHTML=window.WisAlgoliaSearch.renderNoResults(state.query,shared);window.WisAlgoliaSearch.markResultsDrawn(state,facets);return;}resultsColumn.innerHTML='<section class="wis-result-group">'+`<div class="wis-results-grid">${list.hits.map((hit)=>renderResultCard(hit,shared,list.result)).join('')}</div>`+listFooter(state)+'</section>';window.WisAlgoliaSearch.markResultsDrawn(state,facets);}function listFooter(state){const list=state.list;if(hasMore(list))return `
204        <button type="button" class="wis-show-more-button" data-load-more-people>
205          ${list.loading?Drupal.t('Loading...'):Drupal.t('Show more')}
206        </button>
207      `;if(stoppedShort(list))return `
208        <p class="wis-list-note">
209          ${Drupal.t('Showing the first @shown of @total. Narrow the search or use the filters to 
209see the rest.',{'@shown':window.WisAlgoliaSearch.formatNumber(list.hits.length),'@total':window.WisAlgoliaSearch.formatNumber(list.nbHits)})}
210        </p>
211      `;return '';}async function loadMorePeople(shared,view,state){const list=state.list;if(!list||list.loading||!hasMore(list))return;list.loading=true;redrawListFooter(view,state);try{const next=await fetchPage(shared,state,list);await Promise.all([loadMobilePhones(next.hits),loadPersonPages(shared,next.hits)]);if(state.list!==list)return;list.hits=list.hits.concat(next.hits);if(list.browsing)list.cursor=next.cursor;else{list.page=next.page;list.result=next.result;}view.querySelector('.wis-results-grid')?.insertAdjacentHTML('beforeend',next.hits.map((hit)=>renderResultCard(hit,shared,next.result)).join(''));}catch(error){console.error('Could not load more people:',error);}finally{list.loading=false;redrawListFooter(view,state);}}function redrawListFooter(view,state){const existing=view.querySelector('[data-load-more-people], .wis-list-note');const markup=listFooter(state);if(existing){existing.outerHTML=markup;return;}if(markup)view.querySelector('.wis-result-group')?.insertAdjacentHTML('beforeend',markup);}const mobilePhones={allowed:null,numbers:new Map()};const MOBILE_LOOKUP_BATCH=100;const MOBILE_LOOKUP_TIMEOUT=1500;async function loadMobilePhones(hits){const url=(window.drupalSettings.wisAlgoliaSearch||{}).mobilePhonesUrl;const ids=[...new Set(hits.map((hit)=>String(hit.person_id||'')))].filter((id)=>/^\d+$/.test(id)&&!mobilePhones.numbers.has(id));if(!url||mobilePhones.allowed===false||ids.length===0)return;const controller=new AbortController();const timer=window.setTimeout(()=>controller.abort(),MOBILE_LOOKUP_TIMEOUT);const batches=[];for(let i=0;i<ids.length;i+=MOBILE_LOOKUP_BATCH)batches.push(ids.slice(i,i+MOBILE_LOOKUP_BATCH));try{await Promise.all(batches.map(async(batch)=>{const response=await fetch(url,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({ids:batch}),credentials:'same-origin',signal:controller.signal});const data=response.ok?await response.json():null;if(!data)return;mobilePhones.allowed=data.allowed===true;if(mobilePhones.allowed)batch.forEach((id)=>mobilePhones.numbers.set(id,(data.mobiles||{})[id]||{}));}));}catch(error){}finally{window.clearTimeout(timer);}}function mobilePhonesFor(hit,workPhone){const numbers=mobilePhones.numbers.get(String(hit.person_id||''))||{};const drawn=[workPhone];return [{label:Drupal.t('Mobile:'),number:numbers.institute},{label:Drupal.t('Personal mobile:'),number:numbers.personal}].map((line)=>({...line,number:line.number?window.WisAlgoliaSearch.phoneFormat(line.number):''})).filter((line)=>{if(!line.number||drawn.includes(line.number))return false;drawn.push(line.number);return true;});}function locationFor(hit,shared){const location=hit.location||{};const language=shared.currentLanguage==='he'?'he':'en';const names=location.name||{};const building=(names[language]||{}).long||(names[language]||{}).short||'';if(!building)return null;return {building,room:String(location.room||'').trim(),url:window.WisAlgoliaSearch.safeUrl(location.map_url||'')};}const personPages={urls:new Map()};async function loadPersonPages(shared,hits){const keyOf=window.WisAlgoliaSearch.hitPersonKey;const wanted=hits.map(keyOf).filter((key)=>key&&!personPages.urls.has(key));if(wanted.length===0)return;const counterparts=await window.WisAlgoliaSearch.fetchPersonCounterparts(shared,{scientistsFor:wanted});wanted.forEach((key)=>{const scientist=counterparts.scientists.get(key);personPages.urls.set(key,scientist?window.WisAlgoliaSearch.getHitUrl(scientist,shared):'');});}function personPageFor(hit,shared){const key=window.WisAlgoliaSearch.hitPersonKey(hit);const scientistPage=key?personPages.urls.get(key):'';if(scientistPage)return {url:scientistPage};const homepage=window.WisAlgoliaSearch.safeUrl(hit.homepage||'');return homepage?{url:homepage}:null;}function linkTarget(url){return window.WisAlgoliaSearch.isExternalUrl(url)?' target="_blank" rel="noopener noreferrer"':'';}function renderResultCard(hit,shared,result){const email=hit.email||'';const faculty=window.WisAlgoliaSearch.getHitFaculty(hit,shared);const department=window.WisAlgoliaSearch.getHitDepartment(hit,shared);const departmentUrl=window.WisAlgoliaSearch.getHitDepartmentUrl(hit,shared);const phone=window.WisAlgoliaSearch.getPrimaryWorkPhone(hit);const phoneHref=window.WisAlgoliaSearch.phoneToTelHref(phone);const mobiles=mobilePhonesFor(hit,phone);const location=locationFor(hit,shared);const position=window.WisAlgoliaSearch.getHitPosition(hit,shared);const rank=window.WisAlgoliaSearch.getHitRank(hit,shared);const name=escapeHtml(window.WisAlgoliaSearch.getHitName(hit,shared));const page=personPageFor(hit,shared);const pageHref=page?escapeHtml(page.url):'';const pageTarget=page?linkTarget(page.url):'';const facultyUrl=window.WisAlgoliaSearch.getHitFacultyUrl(hit,shared);const insightsAttrs=page?window.WisAlgoliaSearch.insightsClickAttrs(shared.peopleIndexName,'People Search Result Clicked',hit,result):'';
211const innerHtml=`
212      ${page?`<a
213            class="wis-result-image wis-result-image-link"
214            href="${pageHref}"${pageTarget}${insightsAttrs}
215            tabindex="-1"
216            aria-hidden="true"
217          >${window.WisAlgoliaSearch.renderImage(hit)}</a>`:`<span class="wis-result-image">
218            ${window.WisAlgoliaSearch.renderImage(hit)}
219          </span>`}
220
221      <span class="wis-result-content">
222        ${rank?`<span class="wis-result-rank">${escapeHtml(rank)}</span>`:''}
223
224        <span class="wis-result-title">${page?`<a class="wis-result-title-link" href="${pageHref}"${pageTarget}${insightsAttrs}>${name}</a>`:name}</span>
225
226        <span class="wis-result-details">
227          ${position?`<span class="wis-result-meta">${escapeHtml(position)}</span>`:''}
228
229          ${faculty?`<span class="wis-result-meta wis-result-meta-unit">${facultyUrl?`<a class="wis-result-link" href="${escapeHtml(facultyUrl)}"${linkTarget(facultyUrl)}>${escapeHtml(faculty)}</a>`:escapeHtml(faculty)}</span>`:''}
230
231          ${department?`<span class="wis-result-meta wis-result-meta-unit">${departmentUrl?`<a class="wis-result-link" href="${escapeHtml(departmentUrl)}"${linkTarget(departmentUrl)}>${escapeHtml(department)}</a>`:escapeHtml(department)}</span>`:''}
232
233          ${phone?`
234            <span class="wis-result-meta">
235              <span class="wis-result-meta-label">${Drupal.t('Tel:')}</span>
236              <span class="wis-result-meta-value"><a class="wis-result-link" dir="ltr" href="${escapeHtml(phoneHref)}">${escapeHtml(phone)}</a></span>
237            </span>
238          `:''}
239
240          ${mobiles.map((line)=>`
241            <span class="wis-result-meta">
242              <span class="wis-result-meta-label">${line.label}</span>
243              <span class="wis-result-meta-value"><a class="wis-result-link" dir="ltr" href="${escapeHtml(window.WisAlgoliaSearch.phoneToTelHref(line.number))}">${escapeHtml(line.number)}</a></span>
244            </span>
245          `).join('')}
246
247          ${email?`
248            <span class="wis-result-meta">
249              <span class="wis-result-meta-label">${Drupal.t('Email:')}</span>
250              <span class="wis-result-meta-value"><a class="wis-result-link" dir="ltr" href="mailto:${escapeHtml(email)}">${escapeHtml(email)}</a></span>
251            </span>
252          `:''}
253
254          ${location?`
255            <span class="wis-result-meta">
256              <span class="wis-result-meta-label">${Drupal.t('Location:')}</span>
257              <span class="wis-result-meta-value">${location.url?`<a class="wis-result-link" href="${escapeHtml(location.url)}"${linkTarget(location.url)}>${escapeHtml(location.building)}</a>`:escapeHtml(location.building)}${location.room?`, ${Drupal.t('room @room',{'@room':location.room})}`:''}</span>
258            </span>
259          `:''}
260        </span>
261      </span>
262    `;return `
263      <div class="wis-result-card">
264        ${innerHtml}
265      </div>
266    `;}const FACET_LABEL_PREFIXES={en:[/^\s*Faculty of\s+/i,/^\s*Department of\s+/i],he:[/^\s*הפקולטה ל/,/^\s*המחלקה ל/]};function facetLabel(value,language){const label=String(value);const prefixes=FACET_LABEL_PREFIXES[language==='he'?'he':'en']||[];const prefix=prefixes.find((pattern)=>pattern.test(label));return prefix?label.replace(prefix,''):label;}function escapeHtml(value){return window.WisAlgoliaSearch.escapeHtml(value);}})(Drupal);;
267(function(Drupal){'use strict';const MOBILE=window.matchMedia('(width < 1280px)');window.WisAlgoliaMobile={init,isMobile:()=>MOBILE.matches,openFilterSheet,closeFilterSheet};const QUICK_OPEN_CLASS='wis-quick-search-open';function init(shared){initQuickSearchMode(shared);initFieldScroll(shared);initFilterSheets(shared);}function initQuickSearchMode(shared){const root=shared.root;const openButton=root.querySelector('.wis-mini-open');const closeButton=root.querySelector('.wis-mini-close');const input=root.querySelector('.wis-mini-search-input');const advancedButton=root.querySelector('.wis-mini-advanced-button');const panel=root.querySelector('.wis-mini-results-panel');const modal=root.querySelector('.wis-search-modal');if(!openButton||!closeButton||!input)return;const isOpen=()=>root.classList.contains('is-quick-open');const setOpen=(open)=>{root.classList.toggle('is-quick-open',open);document.body.classList.toggle(QUICK_OPEN_CLASS,open);openButton.setAttribute('aria-expanded',String(open));if(open){input.focus();return;}input.blur();panel.classList.add('is-hidden');advancedButton.classList.add('is-hidden');};openButton.addEventListener('click',()=>setOpen(true));closeButton.addEventListener('click',()=>{setOpen(false);openButton.focus();});document.addEventListener('keydown',(event)=>{if(event.key==='Escape'&&isOpen()&&modal.classList.contains('is-hidden')){setOpen(false);openButton.focus();}});root.addEventListener('wisAlgoliaSearch:modalOpened',()=>setOpen(false));MOBILE.addEventListener('change',(event)=>{if(!event.matches&&isOpen())setOpen(false);});}function initFieldScroll(shared){shared.root.querySelectorAll('.wis-advanced-search-input').forEach((input)=>{input.addEventListener('focus',()=>{if(MOBILE.matches&&input.getBoundingClientRect().bottom>window.innerHeight/2)input.scrollIntoView({block:'start',behavior:'smooth'});});});}function initFilterSheets(shared){const root=shared.root;root.querySelectorAll('.wis-filters-column').forEach((aside)=>{aside.addEventListener('click',(event)=>{if(event.target===aside){const close=aside.querySelector('[data-filter-sheet-close]');if(close)close.click();}});});MOBILE.addEventListener('change',(event)=>{if(event.matches)return;root.querySelectorAll('.wis-filters-column.is-open [data-filter-sheet-close]').forEach((close)=>{close.click();});});}function openFilterSheet(view){const aside=view.querySelector('.wis-filters-column');const close=aside.querySelector('[data-filter-sheet-close]');aside.classList.add('is-open');if(close)close.focus();}function closeFilterSheet(view){const aside=view.querySelector('.wis-filters-column');const trigger=view.querySelector('[data-filter-sheet-open]');aside.classList.remove('is-open');if(trigger&&!trigger.classList.contains('is-hidden')&&document.body.classList.contains('wis-search-modal-open'))trigger.focus();}})(Drupal);;
268!function(_,u,l){"use strict";var t,p=void 0===l.eu_cookie_compliance.cookie_value_disagreed||""===l.eu_cookie_compliance.cookie_value_disagreed?"0":l.eu_cookie_compliance.cookie_value_disagreed,r=void 0===l.eu_cookie_compliance.cookie_value_agreed_show_thank_you||""===l.eu_cookie_compliance.cookie_value_agreed_show_thank_you?"1":l.eu_cookie_compliance.cookie_value_agreed_show_thank_you,s=void 0===l.eu_cookie_compliance.cookie_value_agreed||""===l.eu_cookie_compliance.cookie_value_agreed?"2":l.eu_cookie_compliance.cookie_value_agreed;function m(e,o,i){var c="",n=(void 0!==i.expires&&("number"==typeof i.expires&&(n=new Date,i.expires=n.setTime(n.getTime()+24*i.expires*60*60*1e3)),c="; expires="+i.expires.toUTCString()),void 0===i.path?"/":i.path),a="";void 0!==i.domain&&(a="; domain="+i.domain),document.cookie=e+"="+(o||"")+c+"; path="+n+a+"; SameSite=Strict"}function a(e){var o=document.cookie.split(";");if(void 0===e)return o;for(var i=e+"=",c=0;c<o.length;c++){for(var n=o[c];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(i))return n.substring(i.length,n.length)}return null}function k(e){document.cookie=e+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"}u.behaviors.euCookieCompliancePopup={attach:function(e){if(void 0!==l.eu_cookie_compliance){const i=document.querySelector(l.eu_cookie_compliance.containing_element);var o;i.getAttribute("data-eu-cookie-compliance-once")||(i.setAttribute("data-eu-cookie-compliance-once","true"),g=d.getCurrentStatus(),h=d.getAcceptedCategories(),l.eu_cookie_compliance.popup_eu_only_js?u.eu_cookie_compliance.showBanner()&&(o=l.path.baseUrl+l.path.pathPrefix+"eu-cookie-compliance-check",_.getJSON(o,{},function(e){e.in_eu?u.eu_cookie_compliance.execute():(u.eu_cookie_compliance.setStatus(s),l.eu_cookie_compliance.geoip_match=!1,c||"function"!=typeof euCookieComplianceLoadScripts||euCookieComplianceLoadScripts(),"categories"===l.eu_cookie_compliance.method&&(e=l.eu_cookie_compliance.cookie_categories,u.eu_cookie_compliance.setAcceptedCategories(e),u.eu_cookie_compliance.loadCategoryScripts(e)))})):l.eu_cookie_compliance.hide_the_banner||u.eu_cookie_compliance.execute(),_(i).addClass("eu-cookie-compliance-status-"+u.eu_cookie_compliance.getCurrentStatus()))}}},u.eu_cookie_compliance=u.eu_cookie_compliance||function(){(u.eu_cookie_compliance.queue=u.eu_cookie_compliance.queue||[]).push(arguments)},u.eu_cookie_compliance.a=+new Date;var d=u.eu_cookie_compliance,h=[],g=null,c=(d.updateSelectedCategories=function(e){h=e},d.updateCurrentStatus=function(e){g=e},u.eu_cookie_compliance.execute=function(){try{var e,o,i;l.eu_cookie_compliance.popup_enabled&&u.eu_cookie_compliance.cookiesEnabled()&&l.eu_cookie_compliance.modules_allow_popup&&(g=u.eu_cookie_compliance.getCurrentStatus(),void 0===u.eu_cookie_compliance.getVersion()&&u.eu_cookie_compliance.setVersion("unknown"),!0===l.eu_cookie_compliance.popup_eu_only&&!0!==l.eu_cookie_compliance.geoip_match||(e=u.eu_cookie_compliance.getVersion()!==l.eu_cookie_compliance.cookie_policy_version,o=void 0===l.eu_cookie_compliance.cookie_name||""===l.eu_cookie_compliance.cookie_name?"cookie-agreed":l.eu_cookie_compliance.cookie_name,i=!l.eu_cookie_compliance.open_by_default||null!==g&&!e||"null"===a(o)&&l.eu_cookie_compliance.settings_tab_enabled,g!==p||!l.eu_cookie_compliance.settings_tab_enabled||"opt_in"!==l.eu_cookie_compliance.method&&"categories"!==l.eu_cookie_compliance.method?g===p&&"default"===l.eu_cookie_compliance.method||null===g||g!==p&&l.eu_cookie_compliance.withdraw_enabled&&l.eu_cookie_compliance.withdraw_button_on_info_popup||g!==p&&e?!l.eu_cookie_compliance.withdraw_enabled&&l.eu_cookie_compliance.disagree_do_not_show_popup&&null!==g||(window.matchMedia("(max-width: "+l.eu_cookie_compliance.mobile_breakpoint+"px)").matches&&l.eu_cookie_compliance.use_mobile_message?u.eu_cookie_compliance.createPopup(l.eu_cookie_compliance.mobile_popup_html_info,i):u.eu_cookie_compliance.createPopup(l.eu_cookie_compliance.popup_html_info,i),u.eu_cookie_compliance.initPopup(),u.eu_cookie_compliance.resizeListener()):g===r&&l.eu_cookie_compliance.popup_agreed_enabled?(u.eu_cookie_compliance.createPopup(l.eu_cookie_compliance.popup_html_agreed),u.eu_cookie_compliance.attachHideEvents()):g===s&&l.eu_cookie_compliance.withdraw_enabled&&!l.eu_cookie_compliance.withdraw_button_on_info_popup&&(u.eu_cookie_compliance.createWithdrawBanner(l.eu_cookie_compliance.withdraw_markup),u.eu_cookie_compliance.initPopup(),u.eu_cookie_compliance.resizeListener()):(u.eu_cookie_compliance.createPopup(l.eu_cookie_compliance.popup_html_info,null!==g),_(".eu-cookie-withdraw-tab").click(u.eu_cookie_compliance.toggleWithdrawBanner),u.eu_cookie_compliance.attachAgreeEvents())))}catch(e){}},u.eu_cookie_compliance.initPopup=function(){u.eu_cookie_compliance.attachAgreeEvents(),"categories"===l.eu_cookie_compliance.method&&(u.eu_cookie_compliance.setPreferenceCheckboxes(h),u.eu_cookie_compliance.attachSavePreferencesEvents()),l.eu_cookie_compliance.withdraw_enabled&&(u.eu_cookie_compliance.attachWithdrawEvents(),g!==r&&g!==s||(_(".eu-cookie-withdraw-button").removeClass("visually-hidden"),_(".eu-cookie-compliance-reject-button").addClass("visually-hidden")))},u.eu_cookie_compliance.positionTab=function(){if(l.eu_cookie_compliance.popup_position){let e=_(".eu-cookie-withdraw-tab").outerHeight();_("#sliding-popup").length&&(e+=_("#sliding-popup").outerHeight()),_(".eu-cookie-withdraw-wrapper").length?_(".eu-cookie-withdraw-tab").css("margin-top","0"):_(".eu-cookie-withdraw-tab").css("margin-top",e+"px")}},u.eu_cookie_compliance.createWithdrawBanner=function(e){var o=_("<div></div>").html(e),e=_(".eu-cookie-withdraw-banner",o),i=(o.attr({id:"sliding-popup",role:"alertdialog","aria-describedby":"popup-text","aria-label":u.t("Cookie compliance banner")}),o.addClass("eu-cookie-withdraw-wrapper"),o.trigger("eu_cookie_compliance_popup_close"),l.eu_cookie_compliance.popup_use_bare_css||l.eu_cookie_compliance.popup_use_olivero_css||e.height(l.eu_cookie_compliance.popup_height).width(l.eu_cookie_compliance.popup_width),o.hide(),0);l.eu_cookie_compliance.popup_position?(o.prependTo(l.eu_cookie_compliance.containing_element),i=parseInt(o.outerHeight()),o.show().addClass("sliding-popup-top").addClass("clearfix").css({top:u.eu_cookie_compliance.getBannerTopHiddenPosition(i)}),setTimeout(function(){var e=o.outerHeight();o.animate({top:u.eu_cookie_compliance.getBannerTopHiddenPosition(e)},l.eu_cookie_compliance.popup_delay,null),l.eu_cookie_compliance.fixed_top_position||_("body").animate({"margin-top":-e+"px"})}.bind(o),0)):(l.eu_cookie_compliance.better_support_for_screen_readers?o.prependTo(l.eu_cookie_compliance.containing_element):o.appendTo(l.eu_cookie_compliance.containing_element),i=o.outerHeight(),o.show().addClass("sliding-popup-bottom").css({bottom:-1*i}),setTimeout(function(){var e=o.outerHeight();o.animate({bottom:-1*e},l.eu_cookie_compliance.popup_delay,null)}.bind(o),0)),_("body").removeClass("eu-cookie-compliance-popup-open"),e.attr("aria-hidden",!0).find("a, button, input").attr("tabindex",-1)},u.eu_cookie_compliance.getBannerTopPosition=function(e){let o;return l.eu_cookie_compliance.fixed_top_position?(o=0,_(".toolbar-tray-horizontal.is-active").length&&(o+=parseInt(_(".toolbar-tray-horizontal.is-active").css("height"))),_(".toolbar-bar").length&&!_("#gin-toolbar-bar").length&&(o+=parseInt(_(".toolbar-bar").css("height"))),o+"px"):0},u.eu_cookie_compliance.getBannerTopHiddenPosition=function(e){let o=0;return l.eu_cookie_compliance.fixed_top_position?o=-e:(_(".toolbar-tray-horizontal.is-active").length&&(o=-parseInt(_(".toolbar-tray-horizontal.is-active").css("height"))),_(".toolbar-bar").length&&!_("#gin-toolbar-bar").length&&(o-=parseInt(_(".toolbar-bar").css("height")))),o+"px"},u.eu_cookie_compliance.getBannerBottomHiddenPosition=function(){return-_("#sliding-popup").outerHeight()+"px"},u.eu_cookie_compliance.toggleWithdrawBanner=function(){var e,o,i,c=_("#sliding-popup"),n=parseInt(c.outerHeight()),a=c.find(".eu-cookie-compliance-banner, .eu-cookie-withdraw-banner").is(":visible");a&&(e=parseInt(c.css("top")),o=parseInt(_(l.eu_cookie_compliance.containing_element).css("padding-top")),i=parseInt(_(l.eu_cookie_compliance.containing_element).css("margin-top")),a=l.eu_cookie_compliance.popup_position?l.eu_cookie_compliance.fixed_top_position?!(e===-n):!(e===-(o+i+n)):0===parseInt(c.css("bottom"))),l.eu_cookie_compliance.popup_position?a?(l.eu_cookie_compliance.fixed_top_position||_("body").animate({"margin-top":-n+"px"},l.eu_cookie_compliance.popup_delay),c.animate({top:u.eu_cookie_compliance.getBannerTopHiddenPosition(n)},l.eu_cookie_compliance.popup_delay).trigger("eu_cookie_compliance_popup_close")):(l.eu_cookie_compliance.fixed_top_position||_("body").animate({"margin-top":"0px"},l.eu_cookie_compliance.popup_delay),c.find(".eu-cookie-compliance-banner").show(),c.animate({top:u.eu_cookie_compliance.getBannerTopPosition(n)},l.eu_cookie_compliance.popup_delay).trigger("eu_cookie_compliance_popup_open")):a?c.animate({bottom:-1*n},l.eu_cookie_compliance.popup_delay).trigger("eu_cookie_compliance_popup_close"):(c.find(".eu-cookie-compliance-banner").show(),c.animate({bottom:0},l.eu_cookie_compliance.popup_delay).trigger("eu_cookie_compliance_popup_open")),a?(_("body").removeClass("eu-cookie-compliance-popup-open"),_(".eu-cookie-compliance-banner, .eu-cookie-withdraw-banner").attr("aria-hidden",!0).find("a, button, input").attr("tabindex",-1)):(_("body").addClass("eu-cookie-compliance-popup-open"),_(".eu-cookie-compliance-banner, .eu-cookie-withdraw-banner").attr("aria-hidden",!1).find("a, button, input").attr("tabindex",0))},u.eu_cookie_compliance.resizeListener=function(){var e,o,i,c=_("#sliding-popup"),n=(e=function(){var e=c.outerHeight();l.eu_cookie_compliance.popup_position?(parseFloat(c.css("top"))<0&&(_("body").hasClass("eu-cookie-compliance-popup-open")?(l.eu_cookie_compliance.fixed_top_position||_("body").css({"margin-top":"0px"}),c.css("top",u.eu_cookie_compliance.getBannerTopPosition(e))):(l.eu_cookie_compliance.fixed_top_position||_("body").css({"margin-top":-e+"px"}),c.css("top",u.eu_cookie_co
268mpliance.getBannerTopHiddenPosition(e)))),u.eu_cookie_compliance.positionTab()):0!==parseFloat(c.css("bottom"))&&c.css("bottom",-1*e),u.eu_cookie_compliance.positionTab()},o=50,function(){clearTimeout(i),i=setTimeout(function(){clearTimeout(i),e()},o)});setTimeout(function(){n()}),window.addEventListener("resize",n)},u.eu_cookie_compliance.createPopup=function(e,o){var i=_("<div></div>").html(e),e=(i.attr({id:"sliding-popup",role:"alertdialog","aria-describedby":"popup-text","aria-label":u.t("Cookie compliance banner")}),l.eu_cookie_compliance.popup_use_bare_css||l.eu_cookie_compliance.popup_use_olivero_css||i.height(l.eu_cookie_compliance.popup_height).width(l.eu_cookie_compliance.popup_width),i.hide(),0);l.eu_cookie_compliance.popup_position?(i.prependTo(l.eu_cookie_compliance.containing_element),e=i.outerHeight(),i.addClass("sliding-popup-top clearfix").css({top:u.eu_cookie_compliance.getBannerTopHiddenPosition(e)}),!0!==o?(i.show(),i.animate({top:u.eu_cookie_compliance.getBannerTopPosition(e)},l.eu_cookie_compliance.popup_delay,null,function(){i.trigger("eu_cookie_compliance_popup_open"),u.eu_cookie_compliance.positionTab()})):(l.eu_cookie_compliance.fixed_top_position||_("body").css({"margin-top":-e+"px"}),setTimeout(function(){i.show(),u.eu_cookie_compliance.positionTab()},0))):(l.eu_cookie_compliance.better_support_for_screen_readers?i.prependTo(l.eu_cookie_compliance.containing_element):i.appendTo(l.eu_cookie_compliance.containing_element),e=i.outerHeight(),i.show().addClass("sliding-popup-bottom").css({bottom:-1*e}),!0!==o&&i.animate({bottom:0},l.eu_cookie_compliance.popup_delay,null,function(){i.trigger("eu_cookie_compliance_popup_open")})),!0!==o?(_("body").addClass("eu-cookie-compliance-popup-open"),_(".eu-cookie-compliance-banner, .eu-cookie-withdraw-banner").attr("aria-hidden",!1).find("a, button, input").attr("tabindex",0)):(_("body").removeClass("eu-cookie-compliance-popup-open"),_(".eu-cookie-compliance-banner, .eu-cookie-withdraw-banner").attr("aria-hidden",!0).find("a, button, input").attr("tabindex",-1))},u.eu_cookie_compliance.attachAgreeEvents=function(){var e,o,i=l.eu_cookie_compliance.popup_clicking_confirmation,c=l.eu_cookie_compliance.popup_scrolling_confirmation;"categories"===l.eu_cookie_compliance.method&&l.eu_cookie_compliance.enable_save_preferences_button?_(".agree-button").click(u.eu_cookie_compliance.acceptAllAction):_(".agree-button").click(u.eu_cookie_compliance.acceptAction),_(".decline-button").click(u.eu_cookie_compliance.declineAction),_(".eu-cookie-compliance-close-button").click(u.eu_cookie_compliance.closeAction),_(".eu-cookie-compliance-reject-button").click(u.eu_cookie_compliance.rejectAllAction),i&&_("a, input[type=submit], button[type=submit]").not(".popup-content *").bind("click.euCookieCompliance",u.eu_cookie_compliance.acceptAction),c&&(e=!1,o=function(){e?(u.eu_cookie_compliance.acceptAction(),_(window).off("scroll",o)):e=!0},_(window).bind("scroll",o)),_(".find-more-button").not(".find-more-button-processed").addClass("find-more-button-processed").click(u.eu_cookie_compliance.moreInfoAction)},u.eu_cookie_compliance.closeAction=function(){switch(l.eu_cookie_compliance.close_button_action){case"close_banner":u.eu_cookie_compliance.toggleWithdrawBanner();break;case"save_preferences":u.eu_cookie_compliance.savePreferencesAction();break;case"reject_all_cookies":u.eu_cookie_compliance.rejectAllAction();break;case"accept_all_cookies":u.eu_cookie_compliance.acceptAllAction()}},u.eu_cookie_compliance.attachSavePreferencesEvents=function(){_(".eu-cookie-compliance-save-preferences-button").click(u.eu_cookie_compliance.savePreferencesAction)},u.eu_cookie_compliance.attachHideEvents=function(){var e=l.eu_cookie_compliance.popup_hide_agreed,o=l.eu_cookie_compliance.popup_clicking_confirmation;_(".hide-popup-button").click(function(){u.eu_cookie_compliance.changeStatus(s)}),o&&_("a, input[type=submit], button[type=submit]").unbind("click.euCookieCompliance"),e&&_("a, input[type=submit], button[type=submit]").bind("click.euCookieComplianceHideAgreed",function(){u.eu_cookie_compliance.changeStatus(s)}),_(".find-more-button").not(".find-more-button-processed").addClass("find-more-button-processed").click(u.eu_cookie_compliance.moreInfoAction)},u.eu_cookie_compliance.attachWithdrawEvents=function(){_(".eu-cookie-withdraw-button").click(u.eu_cookie_compliance.withdrawAction),_(".eu-cookie-withdraw-tab").click(u.eu_cookie_compliance.toggleWithdrawBanner)},u.eu_cookie_compliance.acceptAction=function(){var e=l.eu_cookie_compliance.popup_agreed_enabled,o=r;e||(u.eu_cookie_compliance.setStatus(r),o=s),c||"function"!=typeof euCookieComplianceLoadScripts||euCookieComplianceLoadScripts(),void 0!==t&&clearInterval(t),"categories"===l.eu_cookie_compliance.method&&(e=_("#eu-cookie-compliance-categories input:checkbox:checked").map(function(){return _(this).val()}).get(),u.eu_cookie_compliance.setAcceptedCategories(e),u.eu_cookie_compliance.loadCategoryScripts(e),e.length||(o=p)),u.eu_cookie_compliance.changeStatus(o),l.eu_cookie_compliance.withdraw_enabled&&l.eu_cookie_compliance.withdraw_button_on_info_popup&&(u.eu_cookie_compliance.attachWithdrawEvents(),g!==r&&g!==s||(_(".eu-cookie-withdraw-button").removeClass("visually-hidden"),_(".eu-cookie-compliance-reject-button").addClass("visually-hidden")))},u.eu_cookie_compliance.acceptAllAction=function(){var e=l.eu_cookie_compliance.cookie_categories;u.eu_cookie_compliance.setPreferenceCheckboxes(e),u.eu_cookie_compliance.acceptAction()},u.eu_cookie_compliance.rejectAllAction=function(){u.eu_cookie_compliance.setStatus(p),u.eu_cookie_compliance.setPreferenceCheckboxes([]),u.eu_cookie_compliance.acceptAction()},u.eu_cookie_compliance.savePreferencesAction=function(){var e=_("#eu-cookie-compliance-categories input:checkbox:checked").map(function(){return _(this).val()}).get(),o=l.eu_cookie_compliance.popup_agreed_enabled,i=r;o||(u.eu_cookie_compliance.setStatus(r),i=s),c||"function"!=typeof euCookieComplianceLoadScripts||euCookieComplianceLoadScripts(),c=!0,u.eu_cookie_compliance.setAcceptedCategories(e),u.eu_cookie_compliance.loadCategoryScripts(e),e.length||(i=p),u.eu_cookie_compliance.changeStatus(i)},u.eu_cookie_compliance.loadCategoryScripts=function(e){for(var o in e)!0!==i[e[o
268]]&&"function"==typeof euCookieComplianceLoadScripts&&(euCookieComplianceLoadScripts(e[o]),i[e[o]]=!0)},u.eu_cookie_compliance.declineAction=function(){parseInt(l.eu_cookie_compliance.set_cookie_session_zero_on_disagree)&&(l.eu_cookie_compliance.cookie_session=1),u.eu_cookie_compliance.setStatus(p);var e,o=_("#sliding-popup");(o.hasClass("sliding-popup-top")?(e=o.outerHeight(),l.eu_cookie_compliance.fixed_top_position||_("body").animate({"margin-top":-e+"px"},l.eu_cookie_compliance.popup_delay),l.eu_cookie_compliance.settings_tab_enabled?o.animate({top:u.eu_cookie_compliance.getBannerTopHiddenPosition(e)},l.eu_cookie_compliance.popup_delay,null):o.animate({top:u.eu_cookie_compliance.getBannerTopHiddenPosition(e)},l.eu_cookie_compliance.popup_delay,null,function(){l.eu_cookie_compliance.fixed_top_position||_("body").css({"margin-top":0}),o.hide()})):l.eu_cookie_compliance.settings_tab_enabled?o.animate({bottom:-1*o.outerHeight()},l.eu_cookie_compliance.popup_delay,null):o.animate({bottom:-1*o.outerHeight()},l.eu_cookie_compliance.popup_delay,null,function(){o.hide()})).trigger("eu_cookie_compliance_popup_close"),_("body").removeClass("eu-cookie-compliance-popup-open"),_(".eu-cookie-compliance-banner, .eu-cookie-withdraw-banner").attr("aria-hidden",!0).find("a, button, input").attr("tabindex",-1)},u.eu_cookie_compliance.withdrawAction=function(){parseInt(l.eu_cookie_compliance.set_cookie_session_zero_on_disagree)&&(l.eu_cookie_compliance.cookie_session=1),u.eu_cookie_compliance.setStatus(null),u.eu_cookie_compliance.setAcceptedCategories([]),location.reload()},u.eu_cookie_compliance.moreInfoAction=function(){l.eu_cookie_compliance.disagree_do_not_show_popup?(u.eu_cookie_compliance.setStatus(p),l.eu_cookie_compliance.withdraw_enabled&&l.eu_cookie_compliance.withdraw_button_on_info_popup?_("#sliding-popup .eu-cookie-compliance-banner").trigger("eu_cookie_compliance_popup_close").hide():_("#sliding-popup").trigger("eu_cookie_compliance_popup_close").remove(),_("body").removeClass("eu-cookie-compliance-popup-open"),_(".eu-cookie-compliance-banner, .eu-cookie-withdraw-banner").attr("aria-hidden",!0).find("a, button, input").attr("tabindex",-1)):l.eu_cookie_compliance.popup_link_new_window?window.open(l.eu_cookie_compliance.popup_link):window.location.href=l.eu_cookie_compliance.popup_link},u.eu_cookie_compliance.getCookieStatus=function(){var e=a(void 0===l.eu_cookie_compliance.cookie_name||""===l.eu_cookie_compliance.cookie_name?"cookie-agreed":l.eu_cookie_compliance.cookie_name);return e=void 0!==e&&"null"!==e?e:null},u.eu_cookie_compliance.getCurrentStatus=function(){var e=new o,e=(d.handleEvent("preStatusLoad",e),g=u.eu_cookie_compliance.getCookieStatus(),new n);return d.handleEvent("postStatusLoad",e),g},u.eu_cookie_compliance.setPreferenceCheckboxes=function(e){for(var o in null===u.eu_cookie_compliance.getCookieStatus()&&u.eu_cookie_compliance.getCookieStatus()!==p||_("#eu-cookie-compliance-categories input:checkbox").not(":disabled").prop("checked",!1),e){o=document.getElementById("cookie-category-"+e[o]);null!==o&&(o.checked=!0)}},u.eu_cookie_compliance.getAcceptedCategories=function(){var e=new C;d.handleEvent("prePreferencesLoad",e);var o,e=a(void 0===l.eu_cookie_compliance.cookie_name||""===l.eu_cookie_compliance.cookie_name?"cookie-agreed-categories":l.eu_cookie_compliance.cookie_name+"-categories");for(o in h=null!=e?(-1!==e.indexOf("%")&&(e=decodeURI(e).replaceAll(/%2C/g,",")),JSON.parse(e)):[],l.eu_cookie_compliance.cookie_categories_details){var i=l.eu_cookie_compliance.cookie_categories_details[o];"required"===i.checkbox_default_state&&-1===_.inArray(i.id,h)&&h.push(i.id)}e=new S;return d.handleEvent("postPreferencesLoad",e),h},u.eu_cookie_compliance.changeStatus=function(o){var e,i=l.eu_cookie_compliance.reload_page,c=g;if(g!==parseInt(o)){if(l.eu_cookie_compliance.popup_position){let e=_("#sliding-popup").outerHeight();l.eu_cookie_compliance.fixed_top_position||_("body").animate({"margin-top":-e+"px"},l.eu_cookie_compliance.popup_delay),_(".sliding-popup-top").animate({top:u.eu_cookie_compliance.getBannerTopHiddenPosition(e)},l.eu_cookie_compliance.popup_delay,function(){o!==r||null!==c||i?c===r&&(l.eu_cookie_compliance.withdraw_enabled&&l.eu_cookie_compliance.withdraw_button_on_info_popup?(_("#sliding-popup").hide(),window.matchMedia("(max-width: "+l.eu_cookie_compliance.mobile_breakpoint+"px)").matches&&l.eu_cookie_compliance.use_mobile_message?_(".sliding-popup-top").not(".eu-cookie-withdraw-wrapper").html(l.eu_cookie_compliance.mobile_popup_html_info):_(".sliding-popup-top").not(".eu-cookie-withdraw-wrapper").html(l.eu_cookie_compliance.popup_html_info),e=_("#sliding-popup").outerHeight(),l.eu_cookie_compliance.fixed_top_position||_("body").animate({"margin-top":-e+"px"},l.eu_cookie_compliance.popup_delay),_(".sliding-popup-top").css("top",u.eu_cookie_compliance.getBannerTopHiddenPosition(e)),_(".sliding-popup-top").not(".eu-cookie-withdraw-wrapper").trigger("eu_cookie_compliance_popup_close"),u.eu_cookie_compliance.initPopup(),u.eu_cookie_compliance.resizeListener(),_("#sliding-popup").show()):(_(".sliding-popup-top").not(".eu-cookie-withdraw-wrapper").trigger("eu_cookie_compliance_popup_close").remove(),_("body").css({"margin-top":"0px"})),_("body").removeClass("eu-cookie-compliance-popup-open"),_(".eu-cookie-compliance-banner, .eu-cookie-withdraw-banner").attr("aria-hidden",!0).find("a, button, input").attr("tabindex",-1)):(l.eu_cookie_compliance.fixed_top_position||_("body").animate({"margin-top":"0px"},l.eu_cookie_compliance.popup_delay),_(".sliding-popup-top").not(".eu-cookie-withdraw-wrapper").html(l.eu_cookie_compliance.popup_html_agreed).animate({top:u.eu_cookie_compliance.getBannerTopPosition(e)},l.eu_cookie_compliance.popup_delay),u.eu_cookie_compliance.attachHideEvents()),l.eu_cookie_compliance.withdraw_enabled&&!l.eu_cookie_compliance.withdraw_button_on_info_popup&&u.eu_cookie_compliance.showWithdrawBanner(o)})}else _(".sliding-popup-bottom").animate({bottom:-1*_("#sliding-popup").outerHeight()},l.eu_cookie_compliance.popup_delay,function(){o!==r||null!==c||i?c===r&&(_("#sliding-popup").css("display","none"),l.eu_cookie_compliance.withdraw_enabled&&l.eu_cookie_compliance.withdraw_button_on_info_popup?(window.matchMedia("(max-width: "+l.eu_cookie_compliance.mobile_breakpoint+"px)").matches&&l.eu_cookie_compliance.use_mobile_message?_(".sliding-popup-bottom").not(".eu-cookie-withdraw-wrapper").html(l.eu_cookie_compliance.mobile_popup_html_info):_(".sliding-popup-bottom").not(".eu-cookie-withdraw-wrapper").html(l.eu_cookie_compliance.popup_html_info),_(".sliding-popup-bottom").css("bottom",u.eu_cookie_compliance.getBannerBottomHiddenPosition()),_(".sliding-popup-bottom").not(".eu-cookie-withdraw-wrapper").trigger("eu_cookie_compliance_popup_close"),u.eu_cookie_compliance.initPopup(),u.eu_cookie_compliance.resizeListener(),_("#sliding-popup").css("display","block")):_(".sliding-popup-bottom").not(".eu-cookie-withdraw-wrapper").trigger("eu_cookie_compliance_popup_close").remove(),_("body").removeClass("eu-cookie-compliance-popup-open"),_(".eu-cookie-compliance-banner, .eu-cookie-withdraw-banner").attr("aria-hidden",!0).find("a, button, input").attr("tabindex",-1)):(_(".sliding-popup-bottom").not(".eu-cookie-withdraw-wrapper").html(l.eu_cookie_compliance.popup_html_agreed).animate({bottom:0},l.eu_cookie_compliance.popup_delay),u.eu_cookie_compliance.attachHideEvents()),l.eu_cookie_compliance.withdraw_enabled&&!l.eu_cookie_compliance.withdraw_button_on_info_popup&&u.eu_cookie_compliance.showWithdrawBanner(o)});if(l.eu_cookie_compliance.reload_page)if(0!==(e=l.eu_cookie_compliance.reload_routes_list).length){for(var n=l.path.currentPath,a=!1,t=0;!a&&t<e.length;t++)var p=new RegExp(e[t],"g"),a=null!==n.match(p);(a&&!l.eu_cookie_compliance.reload_options||!a&&l.eu_cookie_compliance.reload_options)&&location.reload()}else location.reload();u.eu_cookie_compliance.setStatus(o)}},u.eu_cookie_compliance.showWithdrawBanner=function(e){e===s&&l.eu_cookie_compliance.withdraw_enabled&&(l.eu_cookie_compliance.withdraw_button_on_info_popup||(u.eu_cookie_compliance.createWithdrawBanner(l.eu_cookie_compliance.withdraw_markup),u.eu_cookie_compliance.resizeListener()),u.eu_cookie_compliance.attachWithdrawEvents(),l.eu_cookie_compliance.popup_position&&u.eu_cookie_compliance.positionTab())},u.eu_cookie_compliance.setStatus=function(e){var o=new b,o=(d.handleEvent("preStatusSave",o),new Date),i=l.eu_cookie_compliance.domain||"",c=l.eu_cookie_compliance.domain_all_sites?"/":l.path.baseUrl,n=void 0===l.eu_cookie_compliance.cookie_name||""===l.eu_cookie_compliance.cookie_name?"cookie-agreed":l.eu_cookie_compliance.cookie_name;1<c.length&&(a=c.length-1,c.lastIndexOf("/")===a&&(c=c.substring(0,a)));parseInt(l.eu_cookie_compliance.cookie_session)?m(n,e,{path:c,domain:i,sameSite:"strict"}):(a=parseInt(l.eu_cookie_compliance.cookie_lifetime),o.setDate(o.getDate()+a),m(n,e,{expires:o,path:c,domain:i,sameSite:"strict"}));var a="eu-cookie-compliance-status-"+g,n="eu-cookie-compliance-status-"+e,c=(_("."+a).removeClass(a).addClass(n),g=e,_(document).trigger("eu_cookie_compliance.changeStatus",[e]),u.eu_cookie_compliance.setVersion(),l.eu_cookie_compliance.store_consent&&(e===r&&l.eu_cookie_compliance.popup_agreed_enabled||e===s&&!l.eu_cookie_compliance.popup_agreed_enabled)&&(o=l.path.baseUrl+l.path.pathPrefix+"eu-cookie-compliance/store_consent/banner",_.post(o,{},function(e){})),new v);d.handleEvent("postStatusSave",c),e===p&&"opt_out"===l.eu_cookie_compliance.method&&(t=setInterval(u.eu_cookie_compliance.BlockCookies,5e3))},u.eu_cookie_compliance.setAcceptedCategories=function(e){var o=new P,o=(d.handleEvent("prePreferencesSave",o),new Date),i=l.eu_cookie_compliance.domain||"",c=l.eu_cookie_compliance.domain_all_sites?"/":l.path.baseUrl,n=void 0===l.eu_cookie_compliance.cookie_name||""===l.eu_cookie_compliance.cookie_name?"cookie-agreed-categories":l.eu_cookie_compliance.cookie_name+"-categories",a=(1<c.length&&(a=c.length-1,c.lastIndexOf("/")===a&&(c=c.substring(0,a))),JSON.stringify(e)),t=(parseInt(l.eu_cookie_compliance.cookie_session)?m(n,a,{path:c,domain:i,sameSite:"strict"}):(t=parseInt(l.eu_cookie_compliance.cookie_lifetime),o.setDate(o.getDate()+t),m(n,a,{expires:o,path:c,domain:i,sameSite:"strict"}
268)),h=e,_(document).trigger("eu_cookie_compliance.changePreferences",[e]),new B);d.handleEvent("postPreferencesSave",t)},u.eu_cookie_compliance.hasAgreed=function(e){var o=g===r||g===s;return o=void 0!==e&&o&&"categories"===l.eu_cookie_compliance.method?u.eu_cookie_compliance.hasAgreedWithCategory(e):o},u.eu_cookie_compliance.hasAgreedWithCategory=function(e){return-1!==_.inArray(e,h)},u.eu_cookie_compliance.showBanner=function(){var e=!1;return g===p&&"default"===l.eu_cookie_compliance.method||null===g?l.eu_cookie_compliance.disagree_do_not_show_popup&&null!==g||(e=!0):(g===r&&l.eu_cookie_compliance.popup_agreed_enabled||g===s&&l.eu_cookie_compliance.withdraw_enabled)&&(e=!0),e},u.eu_cookie_compliance.cookiesEnabled=function(){var e=navigator.cookieEnabled;return void 0!==navigator.cookieEnabled||e||(date.setDate(date.getDate()+100),m("testcookie","testcookie",{expires:date,sameSite:"strict"}),e=-1!==a("testcookie").indexOf("testcookie")),e},u.eu_cookie_compliance.cookieMatches=function(e,o){if(e===o)return!0;if(o.indexOf("*")<0)return!1;try{return new RegExp("^"+o.replace(/\./g,"\\.").replace(/\*/g,".+")+"$","g").test(e)}catch(e){return!1}},u.eu_cookie_compliance.isAllowed=function(e){if(0===e.indexOf("SESS")||0===e.indexOf("SSESS"))return!0;var o,i=l.eu_cookie_compliance.allowed_cookies.split(/\r\n|\n|\r/g);for(o in i.push(void 0===l.eu_cookie_compliance.cookie_name||""===l.eu_cookie_compliance.cookie_name?"cookie-agreed":l.eu_cookie_compliance.cookie_name),i.push(void 0===l.eu_cookie_compliance.cookie_name||""===l.eu_cookie_compliance.cookie_name?"cookie-agreed-categories":l.eu_cookie_compliance.cookie_name+"-categories"),i.push(void 0===l.eu_cookie_compliance.cookie_name||""===l.eu_cookie_compliance.cookie_name?"cookie-agreed-version":l.eu_cookie_compliance.cookie_name+"-version"),i)if("string"==typeof i[o]){if(u.eu_cookie_compliance.cookieMatches(e,i[o]))return!0;if("categories"===l.eu_cookie_compliance.method){var c=i[o].indexOf(":");if(-1!==c){var n=i[o].substr(0,c),c=i[o].substr(c+1);if(u.eu_cookie_compliance.cookieMatches(e,c)&&u.eu_cookie_compliance.hasAgreedWithCategory(n))return!0}}}return!1},u.eu_cookie_compliance.getVersion=function(){return!!u.eu_cookie_compliance.hasAgreed()&&a(void 0===l.eu_cookie_compliance.cookie_name||""===l.eu_cookie_compliance.cookie_name?"cookie-agreed-version":l.eu_cookie_compliance.cookie_name+"-version")},!(u.eu_cookie_compliance.setVersion=function(e){if(!u.eu_cookie_compliance.hasAgreed())return!1;var o=new Date,i=l.eu_cookie_compliance.domain||"",c=l.eu_cookie_compliance.domain_all_sites?"/":l.path.baseUrl,n=void 0===l.eu_cookie_compliance.cookie_name||""===l.eu_cookie_compliance.cookie_name?"cookie-agreed-version":l.eu_cookie_compliance.cookie_name+"-version",a=(1<c.length&&(a=c.length-1,c.lastIndexOf("/")===a&&(c=c.substring(0,a))),void 0!==e?e:l.eu_cookie_compliance.cookie_policy_version);parseInt(l.eu_cookie_compliance.cookie_session)?m(n,a,{path:c,domain:i,sameSite:"strict"}):(e=parseInt(l.eu_cookie_compliance.cookie_lifetime),o.setDate(o.getDate()+e),m(n,a,{expires:o,path:c,domain:i,sameSite:"strict"}))})),i={},o=(_(function(){void 0!==l.eu_cookie_compliance&&(u.eu_cookie_compliance.hasAgreed()||null===g&&"opt_in"!==l.eu_cookie_compliance.method&&"categories"!==l.eu_cookie_compliance.method)&&("function"==typeof euCookieComplianceLoadScripts&&euCookieComplianceLoadScripts(),c=!0,"categories"===l.eu_cookie_compliance.method&&u.eu_cookie_compliance.loadCategoryScripts(h))}),u.eu_cookie_compliance.BlockCookies=function(){var e,o=u.eu_cookie_compliance.getCookieStatus();if(o!==r&&o!==s||"categories"===l.eu_cookie_compliance.method||void 0===t)for(e in a()){var i,c=window.location.hostname,n=!1;if(!u.eu_cookie_compliance.isAllowed(e)){for(;!n&&""!==c;)k(e),(n=!a(e))||(k(e),n=!a(e)),c=-1===(i=c.indexOf("."))?"":c.substring(i+1);n||(document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/;")}}else clearInterval(t)},void 0===l.eu_cookie_compliance||!l.eu_cookie_compliance.automatic_cookies_removal||("opt_in"!==l.eu_cookie_compliance.method||null!==g&&u.eu_cookie_compliance.hasAgreed())&&("opt_out"!==l.eu_cookie_compliance.method||u.eu_cookie_compliance.hasAgreed()||null===g)&&"categories"!==l.eu_cookie_compliance.method||(t=setInterval(u.eu_cookie_compliance.BlockCookies,5e3)),d.handleEvent=function(e,o){for(var i=function(e){var o=[];if(void 0!==u.eu_cookie_compliance&&void 0!==u.eu_cookie_compliance.queue&&u.eu_cookie_compliance.queue.length)for(var i,c,n=0;n<u.eu_cookie_compliance.queue.length;n++)u.eu_cookie_compliance.queue[n].length&&(i=(c=u.eu_cookie_compliance.queue[n])[0],c=c[1],"string"==typeof i&&"function"==typeof c&&i===e&&o.push(c));return o}(e),c=0;c<i.length;c++)void 0!==i[c]&&(o.subscribe(i[c]),o.fire({currentStatus:g,currentCategories:h}),o.unsubscribe(i[c]))},(T=e.prototype).subscribe=function(e){this.handlers.push(e)},T.unsubscribe=function(o){this.handlers=this.handlers.filter(function(e){if(e!==o)return e})},T.fire=function(o,e){var i=e||window;
268this.handlers.forEach(function(e){e.call(i,o)})},e);function e(){this.handlers=[]}(T=f.prototype).subscribe=function(e){this.handlers.push(e)},T.unsubscribe=function(o){this.handlers=this.handlers.filter(function(e){if(e!==o)return e})},T.fire=function(o,e){var i=e||window;this.handlers.forEach(function(e){e.call(i,o)})};var n=f;function f(){this.handlers=[]}(T=w.prototype).subscribe=function(e){this.handlers.push(e)},T.unsubscribe=function(o){this.handlers=this.handlers.filter(function(e){if(e!==o)return e})},T.fire=function(o,e){var i=e||window;this.handlers.forEach(function(e){e.call(i,o)})};var b=w;function w(){this.handlers=[]}(T=y.prototype).subscribe=function(e){this.handlers.push(e)},T.unsubscribe=function(o){this.handlers=this.handlers.filter(function(e){if(e!==o)return e})},T.fire=function(o,e){var i=e||window;this.handlers.forEach(function(e){e.call(i,o)})};var v=y;function y(){this.handlers=[]}(T=x.prototype).subscribe=function(e){this.handlers.push(e)},T.unsubscribe=function(o){this.handlers=this.handlers.filter(function(e){if(e!==o)return e})},T.fire=function(o,e){var i=e||window;this.handlers.forEach(function(e){e.call(i,o)})};var C=x;function x(){this.handlers=[]}(T=A.prototype).subscribe=function(e){this.handlers.push(e)},T.unsubscribe=function(o){this.handlers=this.handlers.filter(function(e){if(e!==o)return e})},T.fire=function(o,e){var i=e||window;this.handlers.forEach(function(e){e.call(i,o)})};var S=A;function A(){this.handlers=[]}(T=E.prototype).subscribe=function(e){this.handlers.push(e)},T.unsubscribe=function(o){this.handlers=this.handlers.filter(function(e){if(e!==o)return e})},T.fire=function(o,e){var i=e||window;this.handlers.forEach(function(e){e.call(i,o)})};var P=E;function E(){this.handlers=[]}(T=H.prototype).subscribe=function(e){this.handlers.push(e)},T.unsubscribe=function(o){this.handlers=this.handlers.filter(function(e){if(e!==o)return e})},T.fire=function(o,e){var i=e||window;this.handlers.forEach(function(e){e.call(i,o)})};var T,B=H;function H(){this.handlers=[]}}(jQuery,Drupal,drupalSettings,window.Cookies);;
269(function($,Drupal,drupalSettings,once){'use strict';Drupal.behaviors.wisEuComplianceWpconsentPreferences={attach:function(){var settings=drupalSettings.wisEuCompliance||{};if(!settings.enableWpconsentPreferencesCookie||!Drupal.eu_cookie_compliance)return;var setPreferencesCookie=function(){if(!Drupal.eu_cookie_compliance.hasAgreed())return;var days=parseInt(settings.cookieLifetime,10);var expires='';var domain=settings.domain?'; domain='+settings.domain:'';var path=settings.path||'/';var value='{"essential":true,"statistics":true,"marketing":true}';if(days>0){var date=new Date();date.setDate(date.getDate()+days);expires='; expires='+date.toUTCString();}document.cookie='wpconsent_preferences='+value+expires+'; path='+path+domain+'; SameSite=Strict';};setPreferencesCookie();once('wis-eu-compliance-wpconsent-preferences','html').forEach(function(){$(document).on('eu_cookie_compliance.changeStatus',setPreferencesCookie);});}};})(jQuery,Drupal,drupalSettings,once);;
270(function(Drupal,once){'use strict';Drupal.behaviors.wisHomepageHeroVideoToggle={attach:function(context){once('wisHeroVideoToggle','.js-wis-hero-video-toggle',context).forEach(function(button){const targetId=button.getAttribute('data-target');if(!targetId)return;const video=document.getElementById(targetId);if(!video)return;button.addEventListener('click',function(event){event.preventDefault();event.stopPropagation();if(video.paused){video.play();button.classList.remove('is-pause');button.classList.add('is-play');}else{video.pause();button.classList.remove('is-play');button.classList.add('is-pause');}});});}};Drupal.behaviors.homeSplideCarousel={attach(context){once('homeSplideCarousel','#home-slider-zoom-news',context).forEach((el)=>{window.splideZoom=new Splide(el,{perPage:1,type:"fade",pagination:true,arrows:false});window.splideZoom.mount();});}};})(Drupal,once);;

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.