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,EAAcT,EAAoB,EAClCU,EAAyB,IAAZT,EAAgB,EAAIA,EAGvCjC,EAAU2C,UAAY,8DACmCF,QAAkBC,sBACnED,OAAiBC,iEAGnBT,GAAW,EAAI,uCAAyC,gGAIpDC,EAAc,sCAAwC,wBAEhDG,EAAUL,EAAoB,8BACxBA,EAAoB,+SAShCG,EAAa,sCAAwC,wBAE/CE,EAAUL,EAAoB,8BACxBA,EAAoB,uOAW1C,IAAIhC,EAAU4C,iBAAiB,MAAMC,SAAQC,IAC3CA,EAAQC,iBAAiB,SAASC,IAChCA,EAAMC,iBACNb,EAAOY,EAAME,cAAc/D,QAAQgE,MAAM,GACzC,GAEN,G","sources":["webpack://pratt-main/../pratt/static/js/components/algolia/hit-helpers.js","webpack://pratt-main/./static/js/components/algolia/tag-search.js","webpack://pratt-main/../pratt/static/js/components/algolia/search-client.js","webpack://pratt-main/../pratt/static/js/components/algolia/pagination.js"],"sourcesContent":["export const MONTHS = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\nexport const TIME_ZONE = 'America/New_York';\n\nexport class HitHelpers {\n static getTypeDisplay(type) {\n switch (type) {\n case 'post':\n return 'News';\n case 'prattfolio-story':\n return 'Prattfolio Story';\n default:\n return type[0].toLocaleUpperCase() + type.slice(1);\n }\n }\n\n static Courses = {\n /* eslint-disable */\n sectionsAsHtml(hit) {\n // prettier-ignore\n return `\n \n `;\n },\n /* eslint-enable */\n };\n\n static Events = {\n /* eslint-disable */\n dateAsHTML(hit) {\n const start = new Date(\n new Date(hit.occurrences[0].start).toLocaleString('en-US', { timeZone: TIME_ZONE }),\n );\n // prettier-ignore\n return `\n \n `;\n },\n /* eslint-enable */\n\n time(hit, opts = {}) {\n if (!hit.occurrences.length) {\n return '';\n }\n\n const start = new Date(\n new Date(hit.occurrences[0].start).toLocaleString('en-US', { timeZone: TIME_ZONE }),\n );\n const end = new Date(\n new Date(hit.occurrences[0].end).toLocaleString('en-US', { timeZone: TIME_ZONE }),\n );\n\n const timeFormat = new Intl.DateTimeFormat('en-US', { timeStyle: 'short' });\n const dateFormat = new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n });\n const dateFormatNoYear = new Intl.DateTimeFormat('en-US', { month: 'long', day: 'numeric' });\n\n const isSameDay =\n start.getFullYear() === end.getFullYear() &&\n start.getMonth() === end.getMonth() &&\n start.getDate() === end.getDate();\n\n const isSameYear = start.getFullYear() === end.getFullYear();\n\n let time;\n if (hit.is_all_day) {\n if (isSameDay) {\n time = 'All Day';\n if (opts.includeDay) {\n time = dateFormat.format(start);\n }\n } else {\n if (isSameYear) {\n time = `${dateFormatNoYear.format(start)} – ${dateFormat.format(\n end,\n )} All Day`;\n } else {\n time = `${dateFormat.format(start)} – ${dateFormat.format(\n end,\n )} All Day`;\n }\n }\n } else {\n if (isSameDay) {\n time = `${timeFormat.format(start)} – ${timeFormat.format(end)}`;\n if (opts.includeDay) {\n time = `${dateFormat.format(start)} ${time}`;\n }\n } else {\n let startDateDay = `${dateFormat.format(start)}`;\n if (isSameYear) {\n startDateDay = `${dateFormatNoYear.format(start)}`;\n }\n const endDateDay = `${dateFormat.format(end)}`;\n const startDateTime = `${timeFormat.format(start)}`;\n const endDateTime = `${timeFormat.format(end)}`;\n time = `${startDateDay} – ${endDateDay} ${startDateTime} – ${endDateTime}`;\n }\n }\n\n return time;\n },\n\n location(hit) {\n if (hit.event_type === 'hybrid') {\n return `Online and ${hit.location}`;\n } else if (hit.event_type === 'physical') {\n return hit.location;\n } else {\n return 'Online Event';\n }\n },\n };\n}\n","import instantsearch from 'instantsearch.js';\nimport { configure, stats, menu, clearRefinements, hits } from 'instantsearch.js/es/widgets';\nimport { customPagination } from '@pratt/js/components/algolia/pagination';\nimport searchClient from '@pratt/js/components/algolia/search-client';\nimport { HitHelpers } from '@pratt/js/components/algolia/hit-helpers';\n\nclass TagSearch {\n constructor(rootEl) {\n this.rootEl = rootEl;\n if (!this.rootEl) {\n throw new Error('Root tag search element not found.');\n }\n\n this.hitsPerPage = 24;\n this.tag = this.rootEl.dataset['tag'];\n\n this.search = instantsearch({\n indexName: this.rootEl.dataset['algoliaIndex'],\n searchClient: searchClient,\n routing: true,\n });\n\n this.init();\n this.search.start();\n }\n\n init() {\n this.search.addWidgets([\n // https://www.algolia.com/doc/api-reference/widgets/configure/js/\n // Parameter options: https://www.algolia.com/doc/api-reference/search-api-parameters/\n configure({\n hitsPerPage: this.hitsPerPage,\n distinct: true,\n // Force faceting to be applied after de-duplication (via the Distinct setting)\n facetingAfterDistinct: true,\n // Filter results by 'tags' facet\n // https://www.algolia.com/doc/api-reference/api-parameters/filters/#facet-filters\n filters: `tags:\"${this.tag}\"`,\n }),\n\n // https://www.algolia.com/doc/api-reference/widgets/stats/js/\n stats({\n container: '.js-tag-search-count',\n templates: {\n text: `{{ nbHits }}`,\n },\n }),\n\n // https://www.algolia.com/doc/api-reference/widgets/clear-refinements/js/\n clearRefinements({\n container: '.js-tag-search-clear',\n templates: {\n resetLabel: 'All',\n },\n }),\n\n // https://www.algolia.com/doc/api-reference/widgets/menu/js/\n menu({\n container: '.js-tag-search-menu',\n attribute: 'type',\n sortBy: ['name:asc'],\n templates: {\n item(hit) {\n return `\n \n ${HitHelpers.getTypeDisplay(hit.label)}\n \n `;\n },\n },\n }),\n\n // https://www.algolia.com/doc/api-reference/widgets/hits/js/\n hits({\n container: '.js-tag-search-hits',\n templates: {\n /* eslint-disable */\n item(hit) {\n return `\n
\n \n
\n ${hit.title}\n
\n
${HitHelpers.getTypeDisplay(hit.type)}
\n
\n ${hit.schools?.length ? hit.schools.join(', ') : ''}\n
\n
\n ${hit.thumbnail ? `\"${hit.title}\"` : ''}\n
\n
\n
\n `;\n },\n /* eslint-enable */\n },\n }),\n\n // https://www.algolia.com/doc/api-reference/widgets/pagination/js/\n customPagination({\n container: document.querySelector('.js-tag-search-pagination'),\n }),\n ]);\n }\n}\n\nexport default TagSearch;\n","import algoliasearch from 'algoliasearch/lite';\n\nconst { ALGOLIA_APPLICATION_ID, ALGOLIA_SEARCH_API_KEY } = window.pratt.env || {};\n\nlet searchClient = null;\n\ntry {\n searchClient = algoliasearch(ALGOLIA_APPLICATION_ID, ALGOLIA_SEARCH_API_KEY);\n} catch (e) {\n console.error(e);\n}\n\nexport default searchClient;\n","import { connectPagination } from 'instantsearch.js/es/connectors';\n\n// Render custom pagination widget\n// https://www.algolia.com/doc/api-reference/widgets/pagination/js/#connector\nexport const customPagination = connectPagination(function(renderOptions) {\n const { currentRefinement, nbPages, isFirstPage, isLastPage, refine, createURL, widgetParams } =\n renderOptions;\n\n const container = widgetParams.container;\n\n // Hide pagination if no results\n container.classList.toggle('visually-hidden', nbPages === 0);\n\n const currentPage = currentRefinement + 1;\n const totalPages = nbPages === 0 ? 1 : nbPages;\n\n /* eslint-disable */\n container.innerHTML = `\n
\n ${currentPage} / ${totalPages}\n
\n
\n \n Previous page\n \n \n \n \n \n Next page\n \n \n \n \n
\n `;\n /* eslint-enable */\n\n [...container.querySelectorAll('a')].forEach(element => {\n element.addEventListener('click', event => {\n event.preventDefault();\n refine(event.currentTarget.dataset.value);\n });\n });\n});\n"],"names":["MONTHS","TIME_ZONE","HitHelpers","getTypeDisplay","type","toLocaleUpperCase","slice","static","sectionsAsHtml","hit","sections","map","section","days","join","start_time","end_time","location","loc","name","dateAsHTML","start","Date","occurrences","toLocaleString","timeZone","getMonth","getDate","time","opts","length","end","timeFormat","Intl","DateTimeFormat","timeStyle","dateFormat","year","month","day","dateFormatNoYear","isSameDay","getFullYear","isSameYear","is_all_day","includeDay","format","startDateDay","event_type","constructor","rootEl","this","Error","hitsPerPage","tag","dataset","search","instantsearch","indexName","searchClient","routing","init","addWidgets","configure","distinct","facetingAfterDistinct","filters","stats","container","templates","text","clearRefinements","resetLabel","menu","attribute","sortBy","item","cssClasses","link","url","label","hits","last_modified","title","schools","thumbnail","customPagination","document","querySelector","ALGOLIA_APPLICATION_ID","ALGOLIA_SEARCH_API_KEY","window","pratt","env","algoliasearch","e","console","error","connectPagination","renderOptions","currentRefinement","nbPages","isFirstPage","isLastPage","refine","createURL","widgetParams","classList","toggle","currentPage","totalPages","innerHTML","querySelectorAll","forEach","element","addEventListener","event","preventDefault","currentTarget","value"],"sourceRoot":""}