{"version":3,"file":"render.mjs","sources":["src/common.mjs","src/render.mjs"],"sourcesContent":["/**\n * Common utilities class\n * Invoked by both render.mjs and compile.mjs\n */\nexport default class {\n\tstatic buildStructureMap(structureMap, currentPage, highestLevelPage, api) {\n\t\tlet arrStructureMap = Object.values(structureMap);\n\t\tlet filteredStructureMap = arrStructureMap.filter((page) => !page.hideInNavigation);\n\t\tlet filteredStructureMapCopy = JSON.parse(JSON.stringify(filteredStructureMap));\n\t\tlet currentPageMap =\n\t\t\tfilteredStructureMapCopy.find((page) => page.id === currentPage) ||\n\t\t\tarrStructureMap.find((page) => page.id === currentPage);\n\t\tlet boolShowSiblings = highestLevelPage === 'sibling';\n\t\tlet currentChildren =\n\t\t\tfilteredStructureMapCopy.filter(\n\t\t\t\t(page) => currentPageMap.children && currentPageMap.children.includes(page.id)\n\t\t\t) || [];\n\t\tlet parent = arrStructureMap.find((page) => page.id === currentPageMap.parentId);\n\t\tlet navStructure = {\n\t\t\tsiblings: [\n\t\t\t\t{\n\t\t\t\t\tname: currentPageMap.name,\n\t\t\t\t\tchildren: currentChildren,\n\t\t\t\t\tparentId: currentPageMap.parentId,\n\t\t\t\t\tpageUrl: api.getPageLinkData(currentPageMap.id).href,\n\t\t\t\t\thasChildren: currentChildren.length > 0,\n\t\t\t\t\tcurrentPage: true,\n\t\t\t\t\tid: currentPageMap.id,\n\t\t\t\t\thideInNavigation: currentPageMap.hideInNavigation,\n\t\t\t\t},\n\t\t\t],\n\t\t\tparent: {\n\t\t\t\tid: currentPageMap.parentId,\n\t\t\t\tname: parent.name,\n\t\t\t\tpageUrl: api.getPageLinkData(parent.id).href,\n\t\t\t\thasChildren: parent.children.length > 0,\n\t\t\t},\n\t\t\thasSiblings: false,\n\t\t};\n\n\t\tnavStructure.siblings[0].children.forEach((child, index) => {\n\t\t\tnavStructure.siblings[0].children[index] = filteredStructureMapCopy.find(\n\t\t\t\t(page) => page.id === child.id\n\t\t\t);\n\t\t});\n\n\t\tnavStructure.siblings[0].children.forEach((child) => {\n\t\t\tchild.children = filteredStructureMapCopy.filter((page) => page.parentId === child.id);\n\t\t\t// ensure child.pageUrl is set properly as well as any additional nested children until we no longer have children\n\t\t\tchild.pageUrl = api.getPageLinkData(child.id).href;\n\t\t\tchild.children?.forEach((grandChild) => {\n\t\t\t\tgrandChild.pageUrl = api.getPageLinkData(grandChild.id).href;\n\t\t\t});\n\t\t});\n\n\t\tfilteredStructureMapCopy.forEach((page) => {\n\t\t\tlet children = filteredStructureMapCopy.filter(\n\t\t\t\t(childPage) => childPage.parentId === page.id\n\t\t\t);\n\t\t\tif (\n\t\t\t\tboolShowSiblings &&\n\t\t\t\tpage.parentId === currentPageMap.parentId &&\n\t\t\t\tpage.id !== currentPage\n\t\t\t) {\n\t\t\t\tnavStructure.siblings.push({\n\t\t\t\t\tid: page.id,\n\t\t\t\t\tname: page.name,\n\t\t\t\t\tchildren: children,\n\t\t\t\t\tparentId: page.parentId,\n\t\t\t\t\tpageUrl: api.getPageLinkData(page.id).href,\n\t\t\t\t\thasChildren: children.length > 0,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tnavStructure.siblings.forEach((sibling) => {\n\t\t\tsibling.children.forEach((child, index) => {\n\t\t\t\tsibling.children[index] = filteredStructureMapCopy.find(\n\t\t\t\t\t(page) => page.id === child.id\n\t\t\t\t);\n\t\t\t\tsibling.hasChildren = sibling.children.length > 0;\n\t\t\t});\n\n\t\t\tsibling.children.forEach((child) => {\n\t\t\t\tchild.children = filteredStructureMapCopy.filter(\n\t\t\t\t\t(page) => page.parentId === child.id\n\t\t\t\t);\n\t\t\t\tchild.pageUrl = api.getPageLinkData(child.id).href;\n\t\t\t\tchild.children?.forEach((grandChild) => {\n\t\t\t\t\tgrandChild.pageUrl = api.getPageLinkData(grandChild.id).href;\n\t\t\t\t});\n\t\t\t\tchild.hasChildren = child.children.length > 0;\n\t\t\t});\n\t\t});\n\t\treturn navStructure;\n\t}\n\n\tstatic sortItems(structureMap) {\n\t\tconst originalStructureMap = Object.values(structureMap.originalStructureMap);\n\t\t// first sort the siblings\n\t\t// we can use the first array item to determine the parent page since all siblings have the same parent\n\t\tconst parentPage = originalStructureMap.find(\n\t\t\t(page) => page.id === structureMap.navStructure.siblings[0].parentId\n\t\t);\n\t\tconst parentPageChildren = parentPage.children;\n\t\t// We now have the parent page's children, which are the siblings of the current page in the proper order\n\t\t// We can now sort the siblings array based on the order of the parent page's children\n\t\tstructureMap.navStructure.siblings.sort((a, b) => {\n\t\t\treturn parentPageChildren.indexOf(a.id) - parentPageChildren.indexOf(b.id);\n\t\t});\n\n\t\t// now sort the children of each sibling\n\t\t// We will need to loop through each sibling, look up the original page in the structure map, and sort the children\n\t\t// based on the order of the original page's children\n\t\tstructureMap.navStructure.siblings.forEach((sibling) => {\n\t\t\tconst originalPage = originalStructureMap.find((page) => page.id === sibling.id);\n\t\t\tconst originalPageChildren = originalPage.children;\n\t\t\tsibling.children.sort((a, b) => {\n\t\t\t\treturn originalPageChildren.indexOf(a.id) - originalPageChildren.indexOf(b.id);\n\t\t\t});\n\t\t});\n\n\t\t// now sort the children of each child\n\t\t// We will need to loop through each sibling, then loop through each child, look up the original page in the structure map, and sort the children\n\t\t// based on the order of the original page's children\n\t\tstructureMap.navStructure.siblings.forEach((sibling) => {\n\t\t\tsibling.children.forEach((child) => {\n\t\t\t\tconst originalPage = originalStructureMap.find((page) => page.id === child.id);\n\t\t\t\tconst originalPageChildren = originalPage.children;\n\t\t\t\t// Check if the child has any children\n\t\t\t\tif (child.children && child.children.length > 0) {\n\t\t\t\t\tchild.children.sort((a, b) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\toriginalPageChildren.indexOf(a.id) - originalPageChildren.indexOf(b.id)\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\treturn structureMap;\n\t}\n\n\tstatic renderMustacheTemplate(context, template, customStructureMap) {\n\t\ttry {\n\t\t\tcustomStructureMap.navStructure.siblings.forEach((sibling) => {\n\t\t\t\tsibling.children = sibling.children.map((child) => {\n\t\t\t\t\tchild.hasChildren = child.children.length > 0;\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tlet sortedStructureMap = this.sortItems(customStructureMap);\n\n\t\t\tlet objModel = {\n\t\t\t\t...context,\n\t\t\t\tnavStructure: sortedStructureMap.navStructure,\n\t\t\t};\n\t\t\ttemplate = context.Mustache.render(template, objModel);\n\t\t\treturn template;\n\t\t} catch (e) {\n\t\t\tconsole.log('Failed to expand Mustache template.', e);\n\t\t\treturn '';\n\t\t}\n\t}\n}\n","import CommonUtils from './common.mjs';\n\n// The Custom Component class will be the \"default\" export from the module\nexport default class {\n\tconstructor(args) {\n\t\t// store the args\n\t\tthis.id = args.id;\n\n\t\t// store the path to the /assets folder\n\t\tthis.assetsPath = import.meta.url.replace('/render.mjs', '');\n\n\t\t// get the OCM environment resources\n\t\tthis.sitesSDK = args.SitesSDK;\n\t\tthis.Mustache = SCSRenderAPI.getMustache();\n\t}\n\n\t/**\n\t * Add in the listeners for the triggers/actions and whenever the settings values change\n\t * In this case, we want to re-render the component on the screen\n\t */\n\taddEventListeners(container) {\n\t\t// listen for settings update\n\t\tthis.sitesSDK.subscribe(this.sitesSDK.MESSAGE_TYPES.SETTINGS_UPDATED, () => {\n\t\t\tthis.renderComponent();\n\t\t\tthis.hydrate(container);\n\t\t});\n\t}\n\n\t/**\n\t * Renders the component HTML\n\t */\n\tasync renderComponent() {\n\t\tconst componentResources = await Promise.all([\n\t\t\tSCSRenderAPI.importText(this.assetsPath + '/template.html'),\n\t\t\tSCSRenderAPI.importCSS(this.assetsPath + '/styles/design.css'),\n\t\t]);\n\t\tconst customSettings = this.sitesSDK.getProperty('customSettingsData');\n\t\tconst navStructure = CommonUtils.buildStructureMap(\n\t\t\tSCS.structureMap,\n\t\t\tSCS.navigationCurr,\n\t\t\tcustomSettings.highestLevelPage,\n\t\t\tSCSRenderAPI\n\t\t);\n\t\tconst objCommonContext = {\n\t\t\tMustache: this.Mustache,\n\t\t\tcomponentLayout: this.sitesSDK.getProperty('componentLayout'),\n\t\t\tcustomSettingsData: customSettings,\n\t\t\tcontentClient: this.sitesSDK.getProperty('contentClient'),\n\t\t\tnestedComponents: this.nestedComponents, // include any nested component definitions\n\t\t\ttemplate: componentResources[0],\n\t\t\tapi: SCSRenderAPI,\n\t\t\tpageRootLink: SCSRenderAPI.getPageLinkData(SCS.navigationRoot),\n\t\t\tnavStructure: navStructure,\n\t\t};\n\t\tconst componentHtml = await CommonUtils.renderMustacheTemplate(\n\t\t\tobjCommonContext,\n\t\t\tobjCommonContext.template,\n\t\t\t{\n\t\t\t\tnavStructure: navStructure,\n\t\t\t\toriginalStructureMap: SCS.structureMap,\n\t\t\t}\n\t\t);\n\t\t// replace the content of the container with the rendered HTML\n\t\tthis.container.innerHTML = componentHtml;\n\t\treturn componentHtml;\n\t}\n\n\texpandAll(container) {\n\t\tconst expandables = container.querySelectorAll(\"[data-expandable='true']\");\n\t\tconst isMobile = window.innerWidth < 768;\n\t\tif (isMobile) {\n\t\t\texpandables.forEach((expandable) => {\n\t\t\t\texpandable.classList.add('expanded');\n\t\t\t\texpandable.style.maxHeight = expandable.scrollHeight + 'px';\n\n\t\t\t\t// traverse up the DOM to find the children element. We need to set its hight to *2 so that children don't get cut off\n\t\t\t\tconst childrenClass = this.traverseUpDOM(expandable, '.children');\n\t\t\t\tif (childrenClass) {\n\t\t\t\t\tconst childClass = childrenClass.querySelectorAll('.grandchildren.expanded');\n\t\t\t\t\t// set maxHt variable to the tallest maxHeight in childClass\n\t\t\t\t\t[...childClass].sort((a, b) => {\n\t\t\t\t\t\treturn b.style.maxHeight - a.style.maxHeight;\n\t\t\t\t\t});\n\t\t\t\t\tconst maxHeight = childClass[0]?.style.maxHeight.replace('px', '');\n\t\t\t\t\tchildrenClass.style.maxHeight = Number(maxHeight) * 2 + 'px';\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\texpandables.forEach((expandable) => {\n\t\t\t\texpandable.classList.remove('expanded');\n\t\t\t\texpandable.style.maxHeight = '0px';\n\t\t\t});\n\t\t}\n\t}\n\n\taddClickHandlers(container) {\n\t\tconst chevrons = container.querySelectorAll('.chevron');\n\t\tconst sideNav = container.querySelector('.side-navigation');\n\t\tconst header = container.querySelector('.header');\n\t\tchevrons.forEach((chevron) => {\n\t\t\tchevron.addEventListener('click', async (e) => {\n\t\t\t\tconst grandparent = chevron.parentElement.parentElement;\n\t\t\t\tconst expandable = grandparent.querySelector(\"[data-expandable='true']\");\n\t\t\t\texpandable.classList.toggle('expanded');\n\t\t\t\tchevron.classList.toggle('expanded');\n\t\t\t\t// set expandable height to its actual height\n\t\t\t\tif (expandable.classList.contains('expanded')) {\n\t\t\t\t\texpandable.style.maxHeight = expandable.scrollHeight + 'px';\n\t\t\t\t\t// traverse up the DOM to find the children element. We need to set its hight to *2 so that children don't get cut off\n\t\t\t\t\tconst childrenClass = this.traverseUpDOM(expandable, '.children');\n\t\t\t\t\tif (childrenClass) {\n\t\t\t\t\t\tconst childClass =\n\t\t\t\t\t\t\tchildrenClass.querySelectorAll('.grandchildren.expanded');\n\t\t\t\t\t\t// set maxHt variable to the tallest maxHeight in childClass\n\t\t\t\t\t\t[...childClass].sort((a, b) => {\n\t\t\t\t\t\t\treturn b.style.maxHeight - a.style.maxHeight;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconst maxHeight = childClass[0]?.style.maxHeight.replace('px', '');\n\t\t\t\t\t\tchildrenClass.style.maxHeight = Number(maxHeight) * 2 + 'px';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\texpandable.style.maxHeight = '0px';\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\twindow.addEventListener('resize', () => {\n\t\t\tconst isMobile = window.innerWidth < 768 || window.outerWidth < 768;\n\t\t\tif (isMobile) sideNav.classList.add('closed');\n\t\t\telse sideNav.classList.remove('closed');\n\t\t});\n\n\t\theader?.addEventListener('click', () => {\n\t\t\tif (window.innerWidth > 768 && window.outerWidth > 768) return;\n\t\t\tconsole.log('checking if mobile closed');\n\t\t\tconst mobileClosed = sideNav.classList.contains('closed');\n\n\t\t\tconsole.log('mobileClosed', mobileClosed);\n\t\t\tif (mobileClosed) return sideNav.classList.remove('closed');\n\t\t\treturn sideNav.classList.add('closed');\n\t\t});\n\t}\n\n\ttraverseUpDOM(element, selector) {\n\t\twhile (element.parentElement) {\n\t\t\tif (element.parentElement.matches(selector)) {\n\t\t\t\treturn element.parentElement;\n\t\t\t}\n\t\t\telement = element.parentElement;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// the hydrate method is called when a component has been compiled into the page at runtime\n\t// this gives the opportunity to add any event handlers to the HTML that has been inserted into the page\n\tasync hydrate(container) {\n\t\tthis.container = container;\n\t\tthis.sitesSDK.setProperty('renderComplete', true);\n\t\tthis.addClickHandlers(container);\n\n\t\tthis.expandAll(container);\n\t}\n\n\t// the render method is called to render the component dynamically onto the page\n\tasync render(container) {\n\t\tthis.container = container;\n\t\tawait this.renderComponent();\n\t\tthis.hydrate(container);\n\t\t// This used to be necessary, before we were using the SCSRenderAPI.getPageLinkData() method\n\t\t// let hostname = window.location.hostname;\n\t\t// let isMnHousing = hostname === 'mnhousing.gov' || hostname === 'www.mnhousing.gov';\n\t\t// if (!isMnHousing) {\n\t\t// \tconst links = container.querySelectorAll('[data-pageId]');\n\t\t// \tlinks.forEach((link) => {\n\t\t// \t\t// replace href with SCSRenderAPI.getPageLinkData(10).href.split(\"/index.html\").shift()\n\t\t// \t\tlet href = link.getAttribute('href');\n\t\t// \t\tif (href) {\n\t\t// \t\t\tlink.href = SCSRenderAPI.getPageLinkData(link.dataset.pageid).href\n\t\t// \t\t\tconsole.table([href, href.split('en-US')[1], link.href])\n\t\t// \t\t}\n\t\t// \t});\n\t\t// }\n\t\tthis.addEventListeners(container);\n\t}\n}\n"],"names":["static","structureMap","currentPage","highestLevelPage","api","arrStructureMap","Object","values","filteredStructureMap","filter","page","hideInNavigation","filteredStructureMapCopy","JSON","parse","stringify","currentPageMap","find","id","boolShowSiblings","currentChildren","children","includes","parent","parentId","navStructure","siblings","name","pageUrl","getPageLinkData","href","hasChildren","length","hasSiblings","forEach","child","index","_child$children","grandChild","childPage","push","sibling","_child$children2","originalStructureMap","parentPageChildren","sort","a","b","indexOf","originalPageChildren","context","template","customStructureMap","map","this","sortItems","objModel","sortedStructureMap","Mustache","render","e","console","log","constructor","args","assetsPath","import","meta","url","replace","sitesSDK","SitesSDK","SCSRenderAPI","getMustache","addEventListeners","container","subscribe","MESSAGE_TYPES","SETTINGS_UPDATED","renderComponent","hydrate","async","componentResources","Promise","all","importText","importCSS","customSettings","getProperty","CommonUtils","buildStructureMap","SCS","navigationCurr","objCommonContext","componentLayout","customSettingsData","contentClient","nestedComponents","pageRootLink","navigationRoot","componentHtml","renderMustacheTemplate","innerHTML","expandAll","expandables","querySelectorAll","window","innerWidth","expandable","classList","add","style","maxHeight","scrollHeight","childrenClass","traverseUpDOM","_childClass$","childClass","Number","remove","addClickHandlers","chevrons","querySelector","header","chevron","addEventListener","parentElement","toggle","contains","_childClass$2","outerWidth","sideNav","mobileClosed","element","selector","matches","setProperty"],"mappings":"AAIe,QACUA,yBAACC,EAAcC,EAAaC,EAAkBC,GACrE,IAAIC,EAAkBC,OAAOC,OAAON,GAChCO,EAAuBH,EAAgBI,QAAQC,IAAUA,EAAKC,mBAC9DC,EAA2BC,KAAKC,MAAMD,KAAKE,UAAUP,IACrDQ,EACHJ,EAAyBK,MAAMP,GAASA,EAAKQ,KAAOhB,KACpDG,EAAgBY,MAAMP,GAASA,EAAKQ,KAAOhB,IACxBiB,EAAwB,YAArBhB,EACJiB,EAClBR,EAAyBH,QACvBC,GAASM,EAAeK,UAAYL,EAAeK,SAASC,SAASZ,EAAKQ,OACvE,GACFK,EAASlB,EAAgBY,MAAMP,GAASA,EAAKQ,KAAOF,EAAeQ,WACnEC,EAAe,CAClBC,SAAU,CACT,CACCC,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