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G5B,aAAMW,CAAQX,GACb,MAAMY,EAAYlD,KAAKkB,iBAAiBC,KAAKR,aAAa,mBACpDwC,EAAcnD,KAAKW,aAAa,mBAChCE,EAAWb,KAAK4B,gBAChBW,EAAO,CACZlD,IAAKW,KAAKX,IACVmD,UAAW,CAAC,UAAW,cACvBC,aAAc,CAAC,WAAcS,EAAW,WAAeC,EAAa,KAAQb,KAAUzB,GACtFyB,KAAMA,GAGP,aAD2BtC,KAAK2C,eAAeJ,EAEhD,CAEA,cAAMa,CAASd,GACd,MAAMI,QAAqB1C,KAAKiD,QAAQX,GACxCtC,KAAK4C,sBAAsB,UAAWF,EAAaG,SACnD7C,KAAK4C,sBAAsB,aAAcF,EAAanB,WACvD,CAEA,gBAAMyB,CAAWV,GAChB,MAAMI,QAAqB1C,KAAKiD,QAAQX,GAClCe,EAAmBrD,KAAKoB,cAC7B,uCAEKkC,EAAapG,SAASqG,cAAc,OAC1CD,EAAWE,UAAYd,EAAaG,QACpC,MAAMY,EAAkBH,EAAW9B,iBAClC,4CAED,IAAK,MAAMkC,KAAkBD,EAC5BJ,EAAiBM,OAAOD,GAEzB1D,KAAK4C,sBAAsB,aAAcF,EAAanB,WACvD,EAIDrE,SAASwE,iBAAiB,oBAAoB,KAC7CkC,eAAeC,OAAO,0BAA2BnF,EAAc,CAACoF,QAAS,OAAO,G","sources":["webpack://customtheme/./node_modules/@alexspirgel/children-loaded/src/index.js","webpack://customtheme/webpack/bootstrap","webpack://customtheme/./custom-post-lists/resource-list/scripts/src/script.js"],"sourcesContent":["module.exports = (function () {\n\n\t// Initialize a weak map to hold promises.\n\tconst childrenLoadedPromises = new WeakMap();\n\n\t/**\n\t * Checks to see if children elements are loaded.\n\t * @param {object} element - Element to look for children within.\n\t * @return {boolean} Whether the children elements are loaded or not.\n\t */\n\n\tconst childrenLoadedSynchronous = (element) => {\n\n\t\t// Document ready states reference: https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState\n\t\tif (document.readyState === 'interactive' || document.readyState === 'complete') {\n\t\t\t// Children elements are assumed to be loaded.\n\t\t\treturn true;\n\t\t}\n\n\t\t// While the element exists.\n\t\twhile (element) {\n\t\t\t// If the next sibling element exists.\n\t\t\tif (element.nextSibling) {\n\t\t\t\t// The original passed element and its children have been loaded.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// Set the element to the parent element.\n\t\t\telement = element.parentNode;\n\t\t}\n\n\t\t// If code execution gets here, it's assumed children elements are not loaded.\n\t\treturn false;\n\n\t};\n\n\t/**\n\t * An asynchronous wrapper for the childrenLoadedSynchronous function.\n\t * @param {object} element - Element to look for children within.\n\t * @param {boolean} [forceNewPromise=false] - Option to invalidate existing promises.\n\t * @return {*} True if children are loaded, otherwise a promise.\n\t */\n\n\tconst childrenLoaded = (element, forceNewPromise = false) => {\n\n\t\t// If children are loaded immediately.\n\t\tif (childrenLoadedSynchronous(element)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If an existing promise for the passed element does not exist yet or if a new promise is being forced.\n\t\telse if (!childrenLoadedPromises.get(element) || forceNewPromise) {\n\t\t\t// Create a new promise.\n\t\t\tconst childrenLoadedPromise = new Promise((resolve) => {\n\t\t\t\t// Create a new mutation observer.\n\t\t\t\tconst observer = new MutationObserver(() => {\n\t\t\t\t\t// When children are loaded.\n\t\t\t\t\tif (childrenLoadedSynchronous(element)) {\n\t\t\t\t\t\t// Disconnect the mutation observer.\n\t\t\t\t\t\tobserver.disconnect();\n\t\t\t\t\t\t// Resolve the promise.\n\t\t\t\t\t\tresolve(true);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// Watch for child element updates.\n\t\t\t\tobserver.observe(element, {\n\t\t\t\t\tchildList: true\n\t\t\t\t});\n\t\t\t});\n\t\t\t// Set the promise weak map entry for the passed element.\n\t\t\tchildrenLoadedPromises.set(element, childrenLoadedPromise);\n\t\t}\n\n\t\t// Return the promise for the passed element.\n\t\t// Multiple asynchronous calls of childrenLoaded for the same element should return the same promise.\n\t\treturn childrenLoadedPromises.get(element);\n\n\t};\n\n\t// Attach the synchronous function to the export for optional use.\n\tchildrenLoaded.synchronous = childrenLoadedSynchronous;\n\t// Add shorthand alias for synchronous.\n\tchildrenLoaded.sync = childrenLoaded.synchronous;\n\t// Return the asynchronous function as the export.\n\treturn childrenLoaded;\n\n})();","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","const childrenLoaded = require(\"@alexspirgel/children-loaded\");\n\nclass ResourceList extends ESWPPostList {\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tstatic setQueryStrings(queryStrings) {\n\t\tconst searchParams = new URLSearchParams(window.location.search);\n\t\tfor (const key in queryStrings) {\n\t\t\tconst value = queryStrings[key];\n\t\t\tif (value === false\n\t\t\t\t|| (key === 'page' && (value === 1 || value === '1'))) {\n\t\t\t\tsearchParams.delete(key);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsearchParams.set(key, value);\n\t\t\t}\n\t\t}\n\t\tconst newURL = new URL(window.location.href);\n\t\tnewURL.search = searchParams.toString();\n\t\twindow.history.replaceState({path: newURL.href}, '', newURL.href);\n\t}\n\n\tasync connectedCallback() {\n\t\tawait childrenLoaded(this);\n\t\tif (this.queryStringFiltering) {\n\t\t\tthis.queryStrings = this.constructor.getQueryStrings();\n\t\t\tconst queryStringsTermIds = this.queryStringSlugsToTermIds(this.queryStrings);\n\t\t\tthis.setFormValues(queryStringsTermIds);\n\n\t\t}\n\t\tthis.formAttachEventListeners();\n\t\tthis.addUpdateTemplateElementCallback(\"form\",this.formAttachEventListeners);\n\t\tthis.formOnChangeListener();\n\t\tthis.paginationAttachEventListeners();\n\t\tthis.addUpdateTemplateElementCallback('pagination', this.paginationAttachEventListeners);\n\t}\n\n\tget queryStringFiltering() {\n\t\tconst queryStringFilteringAttribute = this.getAttribute('data-query-string-filtering');\n\t\tif (!this.constructor.isAdmin() && queryStringFilteringAttribute == 'true') {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tqueryStringSlugsToTermIds(formData) {\n\t\tformData = Object.assign({}, formData);\n\t\tif (typeof formData['resource_type'] === 'string' && formData['resource_type'].length > 0) {\n\t\t\tconst optionElement = this.templateElements.form.querySelector(`#resource_type option[data-slug=\"${formData['resource_type']}\"]`);\n\t\t\tif (optionElement) {\n\t\t\t\tformData['resource_type'] = optionElement.getAttribute('value');\n\t\t\t}\n\t\t}\n\t\tif (typeof formData['resource_topic'] === 'string' && formData['resource_topic'].length > 0) {\n\t\t\tconst optionElement = this.templateElements.form.querySelector(`#resource_topic option[data-slug=\"${formData['resource_topic']}\"]`);\n\t\t\tif (optionElement) {\n\t\t\t\tformData['resource_topic'] = optionElement.getAttribute('value');\n\t\t\t}\n\t\t}\n\t\tif (typeof formData['author'] === 'string' && formData['author'].length > 0) {\n\t\t\tconst optionElement = this.templateElements.form.querySelector(`#author option[data-slug=\"${formData['author']}\"]`);\n\t\t\tif (optionElement) {\n\t\t\t\tformData['author'] = optionElement.getAttribute('value');\n\t\t\t}\n\t\t}\n\t\tif (typeof formData['resource_genre'] === 'string' && formData['resource_genre'].length > 0) {\n\t\t\tconst optionElement = this.templateElements.form.querySelector(`#author option[data-slug=\"${formData['resource_genre']}\"]`);\n\t\t\tif (optionElement) {\n\t\t\t\tformData['resource_genre'] = optionElement.getAttribute('value');\n\t\t\t}\n\t\t}\n\t\tif (typeof formData['issue_type'] === 'string' && formData['issue_type'].length > 0) {\n\t\t\tconst optionElement = this.templateElements.form.querySelector(`#author option[data-slug=\"${formData['issue_type']}\"]`);\n\t\t\tif (optionElement) {\n\t\t\t\tformData['issue_type'] = optionElement.getAttribute('value');\n\t\t\t}\n\t\t}\n\n\t\treturn formData;\n\t}\n\n\tformDataTermIdsToSlugs(formData) {\n\t\tformData = Object.assign({}, formData);\n\t\tif (typeof formData['resource_type'] === 'string' && formData['resource_type'].length > 0) {\n\t\t\tconst optionElement = this.templateElements.form.querySelector(`#resource_type option[value=\"${formData['resource_type']}\"]`);\n\t\t\tif (optionElement) {\n\t\t\t\tformData['resource_type'] = optionElement.getAttribute('data-slug');\n\t\t\t}\n\t\t}\n\t\tif (typeof formData['resource_topic'] === 'string' && formData['resource_topic'].length > 0) {\n\t\t\tconst optionElement = this.templateElements.form.querySelector(`#resource_topic option[value=\"${formData['resource_topic']}\"]`);\n\t\t\tif (optionElement) {\n\t\t\t\tformData['resource_topic'] = optionElement.getAttribute('data-slug');\n\t\t\t}\n\t\t}\n\t\tif (typeof formData['author'] === 'string' && formData['author'].length > 0) {\n\t\t\tconst optionElement = this.templateElements.form.querySelector(`#author option[value=\"${formData['author']}\"]`);\n\t\t\tif (optionElement) {\n\t\t\t\tformData['author'] = optionElement.getAttribute('data-slug');\n\t\t\t}\n\t\t}\n\t\tif (typeof formData['resource_genre'] === 'string' && formData['resource_genre'].length > 0) {\n\t\t\tconst optionElement = this.templateElements.form.querySelector(`#author option[value=\"${formData['resource_genre']}\"]`);\n\t\t\tif (optionElement) {\n\t\t\t\tformData['resource_genre'] = optionElement.getAttribute('data-slug');\n\t\t\t}\n\t\t}\n\t\tif (typeof formData['issue_type'] === 'string' && formData['issue_type'].length > 0) {\n\t\t\tconst optionElement = this.templateElements.form.querySelector(`#author option[value=\"${formData['issue_type']}\"]`);\n\t\t\tif (optionElement) {\n\t\t\t\tformData['issue_type'] = optionElement.getAttribute('data-slug');\n\t\t\t}\n\t\t}\n\t\treturn formData;\n\t}\n\t\n\tpaginationAttachEventListeners = () => {\n\t\tconst pagerButtonElements = this.templateElements.pagination.querySelectorAll('button');\n\t\tfor (let buttonElement of pagerButtonElements) {\n\t\t\tbuttonElement.addEventListener('click', this.paginationButtonClickHandler);\n\t\t}\n\t}\n\n\tgetFormValues() {\n\t\treturn this.constructor.getFormValues(this.templateElements.form);\n\t}\n\n\tsetFormValues(values) {\n\t\treturn this.constructor.setFormValues(this.templateElements.form, values);\n\t}\n\n\tformAttachEventListeners = () => {\n\t\tthis.templateElements.form.addEventListener('submit', this.formSubmitHandler);\n\t};\n\n\tformSubmitHandler = (event) => {\n\t\tif (event.preventDefault) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tthis.submitForm();\n return false;\n\t};\n\n\tformOnChangeListener = () => {\n\t\tconst selects = this.templateElements.form.querySelectorAll('select');\n\n\t\tif (!selects.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let select of selects) {\n\t\t\tselect.addEventListener('customFilterChange', (e) => {\n\t\t\t\te.stopPropagation();\n\t\t\t\tthis.formSubmitHandler(e);\n\t\t\t});\n\t\t}\n\t};\n\n\n\tasync submitForm(page = 1) {\n\t\tconst formData = this.getFormValues();\n\t\tformData['archive_id'] = this.getAttribute('data-archive-id');\n\t\tconst args = {\n\t\t\tkey: this.key,\n\t\t\ttemplates: ['results', 'pagination'],\n\t\t\trequest_data: formData,\n\t\t\tpage: page,\n\t\t};\n\t\tconst formDataSlugs = this.formDataTermIdsToSlugs(formData);\n\t\t// if (this.queryStringFiltering) {\n\t\t// \tfor (const name in formDataSlugs) {\n\t\t// \t\tif (formDataSlugs[name] === '') {\n\t\t// \t\t\tformDataSlugs[name] = false;\n\t\t// \t\t}\n\t\t// \t}\n\t\t// \tformDataSlugs['page'] = page;\n\t\t// \tthis.constructor.setQueryStrings(formDataSlugs);\n\t\t// }\n\t\tconst newTemplates = await this.fetchTemplates(args);\n\t\tthis.updateTemplateElement('results', newTemplates.results);\n\t\tthis.updateTemplateElement('pagination', newTemplates.pagination);\n\t}\n\n\tpaginationButtonClickHandler = async (event) => {\n\t\tconst page = event.target.getAttribute('data-page');\n\t\tawait this.appendPage(page);\n\t}\n\n\tasync getPage(page) {\n\t\tconst isArchive = this.templateElements.form.getAttribute('data-is-archive');\n\t\tconst archivePost = this.getAttribute('data-archive-id');\n\t\tconst formData = this.getFormValues();\n\t\tconst args = {\n\t\t\tkey: this.key,\n\t\t\ttemplates: ['results', 'pagination'],\n\t\t\trequest_data: {'is_archive': isArchive, 'archive_id' : archivePost, 'page': page, ... formData},\n\t\t\tpage: page\n\t\t};\n\t\tconst newTemplates = await this.fetchTemplates(args);\n\t\treturn newTemplates;\n\t}\n\n\tasync goToPage(page) {\n\t\tconst newTemplates = await this.getPage(page);\n\t\tthis.updateTemplateElement('results', newTemplates.results);\n\t\tthis.updateTemplateElement('pagination', newTemplates.pagination);\n\t}\n\n\tasync appendPage(page) {\n\t\tconst newTemplates = await this.getPage(page);\n\t\tconst resultsContainer = this.querySelector(\n\t\t\t'[data-post-list-template=\"results\"]'\n\t\t);\n\t\tconst htmlObject = document.createElement(\"div\");\n\t\thtmlObject.innerHTML = newTemplates.results;\n\t\tconst newResultsItems = htmlObject.querySelectorAll(\n\t\t\t'[data-post-list-template=\"results\"] > li'\n\t\t);\n\t\tfor (const newResultsItem of newResultsItems) {\n\t\t\tresultsContainer.append(newResultsItem);\n\t\t}\n\t\tthis.updateTemplateElement(\"pagination\", newTemplates.pagination);\n\t}\n\n}\n\ndocument.addEventListener('DOMContentLoaded', () => {\n\tcustomElements.define('post-list-resource-list', ResourceList, {extends: 'div'});\n});\n"],"names":["module","exports","childrenLoadedPromises","WeakMap","childrenLoadedSynchronous","element","document","readyState","nextSibling","parentNode","childrenLoaded","forceNewPromise","get","childrenLoadedPromise","Promise","resolve","observer","MutationObserver","disconnect","observe","childList","set","sync","synchronous","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","ResourceList","ESWPPostList","constructor","super","setQueryStrings","queryStrings","searchParams","URLSearchParams","window","location","search","key","value","delete","newURL","URL","href","toString","history","replaceState","path","connectedCallback","this","queryStringFiltering","getQueryStrings","queryStringsTermIds","queryStringSlugsToTermIds","setFormValues","formAttachEventListeners","addUpdateTemplateElementCallback","formOnChangeListener","paginationAttachEventListeners","queryStringFilteringAttribute","getAttribute","isAdmin","formData","Object","assign","length","optionElement","templateElements","form","querySelector","formDataTermIdsToSlugs","pagerButtonElements","pagination","querySelectorAll","buttonElement","addEventListener","paginationButtonClickHandler","getFormValues","values","formSubmitHandler","event","preventDefault","submitForm","selects","select","e","stopPropagation","page","args","templates","request_data","newTemplates","fetchTemplates","updateTemplateElement","results","async","target","appendPage","getPage","isArchive","archivePost","goToPage","resultsContainer","htmlObject","createElement","innerHTML","newResultsItems","newResultsItem","append","customElements","define","extends"],"sourceRoot":""}