{"id":9,"date":"2019-03-15T11:24:56","date_gmt":"2019-03-15T11:24:56","guid":{"rendered":"http:\/\/www.editorialhccp.com\/gruponelson\/?page_id=9"},"modified":"2025-11-19T13:09:22","modified_gmt":"2025-11-19T13:09:22","slug":"search-results","status":"publish","type":"page","link":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/search-results\/","title":{"rendered":"Search Results"},"content":{"rendered":"\n<style>\n:root {\n  --hcp-collection-cols: 3;\n}\n\n.hcp-book-container {\n  max-width: 1200px;\n  margin: auto;\n  padding: 20px;\n}\n\n.hcp-book-entry img {\n  max-height: 200px;\n  object-fit: cover;\n}\n\n.card {\n  transition: transform 0.2s ease-in-out;\n}\n\n.card:hover {\n  transform: scale(1.03);\n}\n\n#book-list .ais-Hits-list,\n#book-list .ais-InfiniteHits-list {\n  display: grid;\n  grid-template-columns: repeat(var(--hcp-collection-cols), 1fr);\n  width: 100%;\n  gap: 20px;\n}\n\n#book-list.list .ais-Hits-list,\n#book-list.list .ais-InfiniteHits-list {\n  grid-template-columns: 1fr;\n}\n\n.ais-Hits-item,\n.ais-InfiniteHits-item {\n  margin: 10px;\n}\n\n.hcp-fixed-height .ais-Hits-list,\n.hcp-fixed-height .ais-InfiniteHits-list {\n  align-items: stretch;\n}\n\n.hcp-fixed-height .ais-Hits-item,\n.hcp-fixed-height .ais-InfiniteHits-item {\n  display: flex;\n  height: 100%;\n}\n\n.hcp-fixed-height .card {\n  flex: 1 1 auto;\n  display: flex;\n  flex-direction: column;\n  height: 100%;\n  min-height: 420px;\n}\n\n.hcp-fixed-height .card-img-top {\n  height: 200px;\n  object-fit: cover;\n}\n\n.card .cart-icon {\n  height: 20px;\n  width: 20px;\n  margin-right: 10px;\n  fill: #fff;\n}\n\n.ais-RefinementList-showMore--disabled,\n.ais-RefinementList-count {\n  display: none;\n}\n\n.ais-SearchBox {\n  padding: 15px 22px;\n}\n\n\/* Media CSS for Filter to set Design of Accordian *\/\nspan.arrow {\n  transition: none;\n  position: absolute;\n  top: 40%;\n  transform: translateY(-50%);\n  right: 0;\n}\n\n@media (min-width: 768px) {\n  span.arrow {\n    display: none;\n  }\n}\n\n@media (max-width: 767px) {\n  #book-filters {\n    padding: 0px !important;\n  }\n\n  body div#book-filters fieldset.mb-3 {\n    margin-bottom: 0px !important;\n    border: 0 !important;\n    border-bottom: 1px solid #000 !important;\n    padding: 8px 22px !important;\n  }\n\n  h3.h6 {\n    font-size: 20px;\n    line-height: 27px;\n    position: relative;\n    display: flex;\n    align-items: center;\n    padding: 8px 0px !important;\n    margin: 0px;\n    cursor: pointer;\n  }\n\n  .arrow {\n    transition: transform 0.3s ease;\n    display: inline-block;\n    margin-left: auto;\n  }\n\n  .h6 {\n    display: flex;\n  }\n\n  .arrow.open {\n    transform: rotate(180deg);\n    \/* Points up *\/\n  }\n\n  body div#book-filters .accordion-content {\n    display: none;\n    transition: max-height 0.3s ease;\n    overflow: hidden;\n  }\n\n  body div#book-filters .accordion-content.open {\n    display: block;\n  }\n\n  .top-container {\n    width: 100%;\n  }\n}\n\n.filter__sortby select {\n  margin-right: 5px;\n  height: 25px;\n}\n\n.filter__perpage select {\n  margin-right: 5px;\n  height: 25px;\n  min-width: 100px;\n}\n\n.ais-ClearRefinements {\n  margin-bottom: 22px;\n}\n\n.ais-ClearRefinements-button {\n  color: #000 !important;\n}\n\n#currentRefinements strong {\n  font-weight: 800;\n}\n\n#currentRefinements ul {\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n#currentRefinements li ul {\n  margin: 0;\n  padding: 0;\n  list-style: none;\n  margin-bottom: 22px;\n}\n\n#currentRefinements li ul li {\n  line-height: 20px;\n}\n\n#currentRefinements button {\n  background: transparent;\n  border: none;\n  font-size: 12px;\n  font-weight: bold;\n}\n\n@media (max-width: 767px) {\n  #currentRefinements {\n    padding: 0 22px;\n  }\n\n  #currentRefinements ul {\n    margin: 0;\n  }\n\n  .ais-ClearRefinements {\n    margin-bottom: 0;\n    padding: 22px;\n  }\n}\n\n\/* CSS to Hide Legend Tag added for Accessibility *\/\n.visually-hidden {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  padding: 0;\n  margin: -1px;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  white-space: nowrap;\n  border: 0;\n}\n\n\/* List view layout Added By Jaydeep *\/\n#book-list.ais-view-list .ais-Hits-list {\n  display: block;\n}\n\n.ais-view-list .ais-Hits-item .card {\n  display: flex;\n  flex-direction: row !important;\n  align-items: stretch;\n}\n\n\/* Image container (first anchor) *\/\n.ais-view-list .ais-Hits-item .card>a,\n.ais-view-list .ais-Hits-item .card .img-thumb {\n  flex: 0 0 25%;\n  \/* 25% width *\/\n  max-width: 25%;\n  display: block;\n}\n\n.ais-view-list .ais-Hits-item .card>a img {\n  width: 100%;\n  height: auto;\n  object-fit: cover;\n}\n\n.ais-view-list .ais-Hits-item .card-body {\n  flex: 0 0 75%;\n  max-width: 75%;\n  display: flex;\n  flex-direction: column;\n  padding: 1rem;\n}\n\n.ais-view-list .ais-Hits-item .card-body {\n  flex: 0 0 75%;\n  max-width: 75%;\n  display: flex;\n  flex-direction: column;\n  padding: 1rem;\n}\n\n.ais-view-grid .isbn,\n.ais-view-grid .description,\n.ais-view-grid .format {\n  display: none;\n}\n\n.ais-change-display span:not(.selected) svg {\n  opacity: 0.5;\n}\n\n\/* List view layout Added By Jaydeep END *\/\n\n\/* List view CSS added by Bakul Starts *\/\n#book-list.ais-view-list .ais-Hits-item {\n  border-bottom: 1px solid #e5e6e7;\n  margin-bottom: 14px;\n  padding-bottom: 14px;\n}\n\n#book-list.ais-view-list .ais-Hits-item .card {\n  border: none;\n  box-shadow: none !important;\n  transform: none !important;\n  align-items: inherit;\n}\n\n.ais-view-list .ais-Hits-list .ais-Hits-item .col .card .card-img-top {\n  box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.5);\n  border-radius: 0 !important;\n  margin-bottom: 0 !important;\n}\n\n#book-list.ais-view-list .ais-Hits-item .card .card-body {\n  padding-left: 20px;\n  width: 70%;\n  display: flex;\n  flex-wrap: nowrap;\n  flex-direction: row !important;\n  height: initial;\n}\n\n#book-list.ais-view-list .ais-Hits-item .card .card-body .card-cont {\n  width: 60%;\n}\n\n#book-list.ais-view-list .ais-Hits-item .card .card-body .card-action {\n  width: 35%;\n  border-left: 1px solid #e5e6e7;\n  padding-left: 10px;\n  margin-left: 10px;\n}\n\n#book-list.ais-view-list .ais-Hits-item .card .price {\n  display: block;\n  margin-bottom: 10px;\n}\n\n#book-list.ais-view-list .ais-Hits-item .card .card-body .card-title,\n#book-list.ais-view-list .ais-Hits-item .card .card-body .card-title a {\n  text-transform: uppercase;\n  font-size: 1.1428571429rem;\n  line-height: 1.2em;\n}\n\n#book-list.ais-view-list .ais-Hits-item .card .card-body .description {\n  margin-bottom: 0;\n  font-size: 13px;\n}\n\n#book-list.ais-view-list .ais-Hits-item .card .card-body .format {\n  font-weight: 700;\n}\n\n#book-list.ais-view-list .ais-Hits-item .plan-card .card {\n  align-items: center;\n}\n\n#book-list.ais-view-list .ais-Hits-item .plan-card .card .card-body {\n  flex-direction: column !important;\n  text-align: left !important;\n  align-items: flex-start;\n}\n\n#book-list.ais-view-list .ais-Hits-item .plan-card .card .card-body .btn {\n  width: auto;\n}\n\n#book-list.ais-view-list .ais-Hits-item .plan-card .card .card-body .format {\n  margin-top: 16px;\n}\n\n#book-list.ais-view-grid .ais-Hits-item .card .card-body .card-action {\n  margin-top: auto;\n  padding-top: 10px;\n}\n\n@media (max-width: 767px) {\n  #book-list.ais-view-list .ais-Hits-item .card .card-body {\n    flex-direction: column !important;\n  }\n\n  #book-list.ais-view-list .ais-Hits-item .card .card-body .card-cont,\n  #book-list.ais-view-list .ais-Hits-item .card .card-body .card-action {\n    width: 100%;\n  }\n\n  #book-list.ais-view-list .ais-Hits-item .card .card-body .card-action {\n    border-left: none;\n    padding: 0;\n    margin: 16px 0 0;\n  }\n\n  #book-list.ais-view-list .ais-Hits-item .plan-card .card {\n    align-items: flex-start;\n  }\n}\n\n.ais-HierarchicalMenu-item:before {\n  content: \"\\f0da\";\n  font-family: \"Font Awesome 5 Free\";\n  font-weight: 900;\n  display: inline-block;\n  font-size: 1rem;\n  line-height: .6875rem;\n  text-transform: uppercase;\n}\n\n.ais-HierarchicalMenu-item--selected:before {\n  content: \"\\f0d7\";\n}\n\n.ais-HierarchicalMenu-list--child .ais-HierarchicalMenu-item:before {\n  display: none;\n}\n\n.ais-HierarchicalMenu-item .ais-HierarchicalMenu-label {\n  transition: all .3s;\n}\n\n.ais-HierarchicalMenu-item .ais-HierarchicalMenu-count {\n  display: none;\n}\n\n.ais-HierarchicalMenu-label--parent .ais-RefinementList-checkbox {\n  display: none;\n}\n\n\/* List view CSS added by Bakul Ends *\/\nh1.search-term{font-size: 28px; line-height: 30px; margin-bottom: 20px;}\n\n<\/style>\n\n<div class=\"search-results\">\n  <div class=\"container my-4\">\n    <div class=\"row\">\n            <!-- Sidebar Filters -->\n            <aside class=\"col-md-3 booksearch-filters__wrapper\">\n        <h2 class=\"h5\">\n          <div id=\"total-books-count\" class=\"mb-3 fw-bold\"><\/div>        <\/h2>\n        <div id=\"book-filters\">\n          <div id=\"clear-filters\"><\/div>\n          <div id=\"currentRefinements\"><\/div>\n                    <fieldset class=\"mb-3\">\n            <legend class=\"visually-hidden\">Formato<\/legend>\n            <h3 class=\"h6\" role=\"button\" tabindex=\"0\" aria-expanded=\"false\"\n              aria-controls=\"facet-formatDisplay\"\n              onkeydown=\"if(event.key==='Enter' || event.key===' ') toggleAccordion(this)\"\n              onclick=\"toggleAccordion(this)\">Formato <span class=\"arrow\">\u2304<\/span><\/h3>\n                          <div id=\"facet-formatDisplay\" class=\"accordion-content\" ><\/div>\n                      <\/fieldset>\n                    <fieldset class=\"mb-3\">\n            <legend class=\"visually-hidden\">Precio<\/legend>\n            <h3 class=\"h6\" role=\"button\" tabindex=\"0\" aria-expanded=\"false\"\n              aria-controls=\"facet-webPriceRange\"\n              onkeydown=\"if(event.key==='Enter' || event.key===' ') toggleAccordion(this)\"\n              onclick=\"toggleAccordion(this)\">Precio <span class=\"arrow\">\u2304<\/span><\/h3>\n                          <div id=\"facet-webPriceRange\" class=\"accordion-content\" role=\"radiogroup\" aria-label=\"Filter by price range\"><\/div>\n                      <\/fieldset>\n                    <fieldset class=\"mb-3\">\n            <legend class=\"visually-hidden\">Sujetas<\/legend>\n            <h3 class=\"h6\" role=\"button\" tabindex=\"0\" aria-expanded=\"false\"\n              aria-controls=\"facet-bisacCodesDescription\"\n              onkeydown=\"if(event.key==='Enter' || event.key===' ') toggleAccordion(this)\"\n              onclick=\"toggleAccordion(this)\">Sujetas <span class=\"arrow\">\u2304<\/span><\/h3>\n                          <div id=\"facet-bisacCodesDescription\" class=\"accordion-content\" ><\/div>\n                      <\/fieldset>\n                    <fieldset class=\"mb-3\">\n            <legend class=\"visually-hidden\">huellas<\/legend>\n            <h3 class=\"h6\" role=\"button\" tabindex=\"0\" aria-expanded=\"false\"\n              aria-controls=\"facet-imprint\"\n              onkeydown=\"if(event.key==='Enter' || event.key===' ') toggleAccordion(this)\"\n              onclick=\"toggleAccordion(this)\">huellas <span class=\"arrow\">\u2304<\/span><\/h3>\n                          <div id=\"facet-imprint\" class=\"accordion-content\" ><\/div>\n                      <\/fieldset>\n                    <fieldset class=\"mb-3\">\n            <legend class=\"visually-hidden\">Serie<\/legend>\n            <h3 class=\"h6\" role=\"button\" tabindex=\"0\" aria-expanded=\"false\"\n              aria-controls=\"facet-seriesTitle\"\n              onkeydown=\"if(event.key==='Enter' || event.key===' ') toggleAccordion(this)\"\n              onclick=\"toggleAccordion(this)\">Serie <span class=\"arrow\">\u2304<\/span><\/h3>\n                          <div id=\"facet-seriesTitle\" class=\"accordion-content\" ><\/div>\n                      <\/fieldset>\n                    <fieldset class=\"mb-3\">\n            <legend class=\"visually-hidden\">Autoras<\/legend>\n            <h3 class=\"h6\" role=\"button\" tabindex=\"0\" aria-expanded=\"false\"\n              aria-controls=\"facet-contributorsName\"\n              onkeydown=\"if(event.key==='Enter' || event.key===' ') toggleAccordion(this)\"\n              onclick=\"toggleAccordion(this)\">Autoras <span class=\"arrow\">\u2304<\/span><\/h3>\n                          <div id=\"facet-contributorsName\" class=\"accordion-content\" ><\/div>\n                      <\/fieldset>\n                    <fieldset class=\"mb-3\">\n            <legend class=\"visually-hidden\">Sello<\/legend>\n            <h3 class=\"h6\" role=\"button\" tabindex=\"0\" aria-expanded=\"false\"\n              aria-controls=\"facet-publisherName\"\n              onkeydown=\"if(event.key==='Enter' || event.key===' ') toggleAccordion(this)\"\n              onclick=\"toggleAccordion(this)\">Sello <span class=\"arrow\">\u2304<\/span><\/h3>\n                          <div id=\"facet-publisherName\" class=\"accordion-content\" ><\/div>\n                      <\/fieldset>\n                    <div id=\"searchbox\"><\/div>\n          <!--<button aria-label=\"Apply Filters\" type=\"submit\" class=\"btn btn-primary btn-sm\">Apply Filters<\/button>-->\n        <\/div>\n      <\/aside>\n            <!-- Books Grid -->\n      <main class=\"d-flex flex-column align-items-center col-md-9\">\n                        <div class=\"top-container\">\n                              <div id=\"top-hits-per-page\" class=\"filter__perpage\"><\/div>\n                              <div id=\"top-sort-by\" class=\"filter__sortby\"><\/div>\n                    <nav id=\"pagination-top\" class=\" book-nav\" aria-label=\"Pagination\"><\/nav>                    <div class=\"ais-change-display ais-change-display--products\" role=\"group\" aria-label=\"Change product display\">\n            <span class=\"ais-change-display-block selected\" role=\"button\" tabindex=\"0\" aria-label=\"Grid view\"\n              aria-pressed=\"true\">\n              <svg fill=\"#000000\" width=\"20px\" height=\"20px\" viewBox=\"0 0 36 36\" version=\"1.1\"\n                preserveAspectRatio=\"xMidYMid meet\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n                xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\">\n                <rect class=\"clr-i-solid clr-i-solid-path-1\" x=\"4\" y=\"4\" width=\"12\" height=\"12\" rx=\"2\" ry=\"2\"><\/rect>\n                <rect class=\"clr-i-solid clr-i-solid-path-2\" x=\"20\" y=\"4\" width=\"12\" height=\"12\" rx=\"2\" ry=\"2\"><\/rect>\n                <rect class=\"clr-i-solid clr-i-solid-path-3\" x=\"4\" y=\"20\" width=\"12\" height=\"12\" rx=\"2\" ry=\"2\"><\/rect>\n                <rect class=\"clr-i-solid clr-i-solid-path-4\" x=\"20\" y=\"20\" width=\"12\" height=\"12\" rx=\"2\" ry=\"2\"><\/rect>\n                <rect x=\"0\" y=\"0\" width=\"36\" height=\"36\" fill-opacity=\"0\" \/>\n              <\/svg>\n            <\/span>\n            <span class=\"ais-change-display-list\" role=\"button\" tabindex=\"0\" aria-label=\"List view\" aria-pressed=\"false\">\n              <svg fill=\"#000000\" width=\"20px\" height=\"20px\" viewBox=\"0 0 16 16\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                <path\n                  d=\"m 13.5 2.007812 s 0.5 0.222657 0.5 0.5 v 0.988282 c 0 0.273437 -0.5 0.5 -0.5 0.5 h -1 s -0.5 -0.226563 -0.5 -0.5 v -0.988282 c 0 -0.277343 0.5 -0.5 0.5 -0.5 z m -4 0 c 0.277344 0 0.5 0.222657 0.5 0.5 v 0.988282 c 0 0.273437 -0.222656 0.5 -0.5 0.5 h -8 c -0.277344 0 -0.5 -0.226563 -0.5 -0.5 v -0.988282 c 0 -0.277343 0.222656 -0.5 0.5 -0.5 z m 4 5 s 0.5 0.222657 0.5 0.5 v 0.988282 c 0 0.273437 -0.5 0.5 -0.5 0.5 h -1 s -0.5 -0.226563 -0.5 -0.5 v -0.988282 c 0 -0.277343 0.5 -0.5 0.5 -0.5 z m -4 0 s 0.5 0.222657 0.5 0.5 v 0.988282 c 0 0.273437 -0.222656 0.5 -0.5 0.5 h -8 c -0.277344 0 -0.5 -0.226563 -0.5 -0.5 v -0.988282 c 0 -0.277343 0.5 -0.5 0.5 -0.5 z m 4 5 c 0.277344 0 0.5 0.222657 0.5 0.5 v 0.988282 c 0 0.273437 -0.5 0.5 -0.5 0.5 h -1 s -0.5 -0.226563 -0.5 -0.5 v -0.988282 c 0 -0.277343 0.222656 -0.5 0.5 -0.5 z m -4 0 c 0.277344 0 0.5 0.222657 0.5 0.5 v 0.988282 c 0 0.273437 -0.222656 0.5 -0.5 0.5 h -8 c -0.277344 0 -0.5 -0.226563 -0.5 -0.5 v -0.988282 c 0 -0.277343 0.222656 -0.5 0.5 -0.5 z m 0 0\"\n                  fill=\"#2e3436\" \/>\n              <\/svg>\n            <\/span>\n          <\/div>\n                  <\/div>\n        <div id=\"book-loading-container\"><\/div>\n        <div id=\"book-list\" class=\"  ais-view-grid\">\n        <\/div>\n\n                <div class=\"top-container\">\n                    <div id=\"bottom-hits-per-page\" class=\"filter__perpage\"><\/div>\n                              <div id=\"bottom-sort-by\" class=\"filter__sortby\"><\/div>\n                    <nav id=\"pagination-bottom\" class=\"book-nav\" aria-label=\"Pagination\"><\/nav>\n        <\/div>\n              <\/main>\n    <\/div>\n  <\/div>\n<\/div>\n\n<script>\nfunction toggleAccordion(h3El) {\n  const content = h3El.nextElementSibling;\n  const arrow = h3El.querySelector('.arrow');\n\n  content.classList.toggle('open');\n  arrow.classList.toggle('open');\n}\n<\/script>\n\n<!-- Include Algolia InstantSearch.js -->\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/algoliasearch@5.20.3\/dist\/lite\/builds\/browser.umd.js\"\n  integrity=\"sha256-I50Ef8Uw5sL5cyGN4vUNQhQ9gjyoF95aixvcciwE+ss=\" crossorigin=\"anonymous\"><\/script>\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/instantsearch.js@4.77.3\/dist\/instantsearch.production.min.js\"\n  integrity=\"sha256-lOteBl\/i\/zTTeWI1iC+\/s\/eRPgFG3pNxRamGNbR5RX0=\" crossorigin=\"anonymous\"><\/script>\n<link rel=\"stylesheet\" href=\"https:\/\/cdn.jsdelivr.net\/npm\/instantsearch.css@8.5.1\/themes\/reset-min.css\"\n  integrity=\"sha256-KvFgFCzgqSErAPu6y9gz\/AhZAvzK48VJASu3DpNLCEQ=\" crossorigin=\"anonymous\">\n\n<script>\nwindow.hcpInfiniteLoading = false;\nwindow.hcpShowFilters = true;\nwindow.hcpRowDesign = 'clickable-card';\nwindow.hcpPaginationRootClasses = 'pagination mt-4 justify-content-end';\nwindow.hcpEnableIsbnFilter =\n  false;\nwindow.hcpprice = true;\nwindow.hcpIsbnList = [];\nwindow.rewrite_rule = \"isbn\";\nwindow.rewriting_rule_church = \"\";\nwindow.rewriting_rule_faithgateway = \"\";\nwindow.format_rule = \"formatDisplay\";\nwindow.enable_layout_change = true;\nwindow.hcpEnableAuthorLink = true;\nwindow.number_of_books_per_page = '';\nwindow.show_perpage = true;\nwindow.enable_pagination_arrows = true;\n\/\/ Used for Clear refinement list label\nwindow.facetsLabel = {\n  \"bisacCodes.description\": 'Subjects',\n  \"contributors.name\": 'Authors',\n  \"imprint\": 'Imprints',\n  \"seriesTitle\": 'Series',\n  \"webPrice\": 'Price Range',\n  'academicSubjects.lvl0': 'Books By Subject',\n  'academicSubjects.lvl1': 'Books By Subject',\n  'publisherName': 'Publisher',\n}\n\nif (window.format_rule === 'formatDisplay') {\n  window.facetsLabel['formatDisplay'] = 'Formats';\n} else if (window.format_rule === 'localEditorialFormat') {\n  window.facetsLabel['localEditorialFormat'] = 'Formats';\n} else if (window.format_rule === 'formatDescription') {\n  window.facetsLabel['formatDescription'] = 'Formats';\n} else {\n  window.facetsLabel['formatDisplay'] = 'Formats';\n}\n<\/script>\n\n<script>\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n\n  \/\/  To Add the Category Filter based on parameter in HCP Canada Website.\n  const urlParams = new URLSearchParams(window.location.search);\n  const categoryParam = urlParams.get('category');\n  const contributorParam = urlParams.get('contributor');\n  const ageParam = urlParams.get('age');\n  const academicAttributes = ['academicSubjects.lvl0', 'academicSubjects.lvl1'];\n\n  const {\n    liteClient: algoliasearch\n  } = window['algoliasearch\/lite'];\n  const searchClient = algoliasearch('0IZ6GTNJFS', 'dbbf2c3d4bc506b0c30683e4defc129f');\n  const index = \"dev_dataedge_editorialhccp.com\";\n  const search = instantsearch({\n    indexName: index,\n    searchClient,\n    indexSettings: {\n      searchableAttributes: ['title', 'subtitle', 'seriesTitle', 'contributors.name', 'isbn13'],\n      attributesForFaceting: [\n        'imprint',\n        'seriesTitle',\n        'formatDescription',\n        'formatDisplay',\n        'localEditorialFormat',\n        'webPriceRange',\n        'searchable(bisacCodes.description)',\n        'searchable(contributors.name)',\n        'filterOnly(onSaleDate)',\n        'filterOnly(primaryFormat)',\n        'filterOnly(isbn13)',\n        'filterOnly(formatCode)',\n        'academicSubjects.lvl0',\n        'academicSubjects.lvl1',\n        'filterOnly(publisherName)',\n      ],\n    },\n    routing: {\n      router: instantsearch.routers.history({\n        windowTitle({\n          query\n        }) {\n          return query ? `Search: ${query}` : 'Search';\n        },\n        createURL() {\n          \/\/ Always return current pathname only (no params)\n          return window.location.pathname;\n        },\n        parseURL({\n          qsModule,\n          location\n        }) {\n          const queryParameters = qsModule.parse(location.search.slice(1));\n          const scopedParams = queryParameters[index] || {};\n          const query = queryParameters.q || scopedParams.query || '';\n          const refinementList = scopedParams.refinementList || {};\n\n          return {\n            [index]: {\n              query,\n              refinementList\n            }\n          };\n        },\n      }),\n      stateMapping: {\n        stateToRoute(uiState) {\n          \/\/ Return empty object prevents automatic updates to URL\n          return {};\n        },\n        routeToState(routeState) {\n          const scopedParams = routeState[index] || {};\n          const query = routeState.q || scopedParams.query || '';\n\n          return {\n            [index]: {\n              query,\n              ...scopedParams\n            },\n          };\n        },\n      },\n    },\n    initialUiState: {\n      \"dev_dataedge_editorialhccp.com\": {\n        hierarchicalMenu: categoryParam ?\n          Object.fromEntries(academicAttributes.map(attr => [attr, [categoryParam]])) : {}\n      }\n    },\n  });\n\n  \/\/  Primary Format = true to avoid Multiple Edition of Same book in Book List page \n  let filters = '';\n\n  if (window.hcpEnableIsbnFilter && Array.isArray(window.hcpIsbnList) && window.hcpIsbnList.length > 0) {\n    const isbnFilters = window.hcpIsbnList.map(isbn => `isbn13:\"${isbn}\"`).join(' OR ');\n    filters = isbnFilters; \/\/ conditionally add ISBN filter\n  } else {\n    filters = 'primaryFormat:\"true\"';\n  }\n\n  if (categoryParam) {\n    const categoryFilter =\n      `(subjectHeadingCode:\"${categoryParam}\" OR academicSubjects.lvl0:\"${categoryParam}\" OR academicSubjects.lvl1:\"${categoryParam}\")`;\n\n    if (filters) {\n      filters += ` AND ${categoryFilter}`;\n    } else {\n      filters = categoryFilter;\n    }\n  }\n\n  if (contributorParam) {\n    const contributorFilter = `contributors.name:\"${contributorParam}\"`;\n\n    if (filters) {\n      filters += ` AND ${contributorFilter}`;\n    } else {\n      filters = contributorFilter;\n    }\n  }\n\n  if (ageParam) {\n    const ageFilter = `ageRange:\"${ageParam}\"`;\n\n    if (filters) {\n      filters += ` AND ${ageFilter}`;\n    } else {\n      filters = ageFilter;\n    }\n  }\n\n\n  const configureParams = {\n    filters: filters\n  };\n\n  if (window.number_of_books_per_page && !show_perpage) {\n    configureParams.hitsPerPage = window.number_of_books_per_page;\n  }\n\n  search.addWidgets([\n    instantsearch.widgets.configure(configureParams)\n  ]);\n\n  const sortFiltersJson = [{\n      label: 'Relevancia',\n      value: 'dev_dataedge_editorialhccp.com'\n    },\n    {\n      label: 'Fecha - m\u00e1s reciente a m\u00e1s antiguo',\n      value: 'dev_dataedge_editorialhccp.com_onSaleDate_desc'\n    },\n    {\n      label: 'Fecha - m\u00e1s antiguo a m\u00e1s reciente',\n      value: 'dev_dataedge_editorialhccp.com_onSaleDate_asc'\n    },\n    {\n      label: 'T\u00edtulo - A a la Z',\n      value: 'dev_dataedge_editorialhccp.com_title_asc'\n    },\n    {\n      label: 'T\u00edtulo - Z a la A',\n      value: 'dev_dataedge_editorialhccp.com_title_desc'\n    },\n    {\n      label: 'Precio - menor a mayor',\n      value: 'dev_dataedge_editorialhccp.com_webPrice_asc'\n    },\n    {\n      label: 'Precio - mayor a menor',\n      value: 'dev_dataedge_editorialhccp.com_webPrice_desc'\n    },\n    {\n      label: 'Autor - A a la Z',\n      value: 'dev_dataedge_editorialhccp.com_author_asc'\n    },\n    {\n      label: 'Autor - Z a la A',\n      value: 'dev_dataedge_editorialhccp.com_author_desc'\n    },\n  ];\n\n  const perPageJson = [{\n      label: '12',\n      value: 12,\n      default: true\n    },\n    {\n      label: '24',\n      value: 24\n    },\n    {\n      label: '48',\n      value: 48\n    },\n  ]\n\n    search.addWidget(instantsearch.widgets.sortBy({\n    container: '#top-sort-by',\n    items: sortFiltersJson,\n  }));\n  \n    search.addWidget(instantsearch.widgets.sortBy({\n    container: '#bottom-sort-by',\n    items: sortFiltersJson,\n  }));\n  \n  \/\/ Create Refinement Filters, should map to the html element above\n  if (window.hcpShowFilters) {\n    const facets = {\n      \"bisacCodes.description\": \"bisacCodesDescription\",\n      \"contributors.name\": \"contributorsName\",\n      \"imprint\": \"imprint\",\n      \"seriesTitle\": \"seriesTitle\",\n      \"publisherName\": \"publisherName\",\n    };\n    if (window.format_rule === 'formatDisplay') {\n      facets['formatDisplay'] = 'formatDisplay';\n    } else if (window.format_rule === 'localEditorialFormat') {\n      facets['localEditorialFormat'] = 'localEditorialFormat';\n    } else if (window.format_rule === 'formatDescription') {\n      facets['formatDescription'] = 'formatDescription';\n    } else {\n      facets['formatDisplay'] = 'formatDisplay';\n    }\n\n    Object.keys(facets).forEach(facet => {\n      search.addWidgets([\n        instantsearch.widgets.refinementList({\n          container: `#facet-${facets[facet]}`,\n          attribute: facet,\n          searchable: false,\n          showMore: true,\n          sortBy: ['name:asc']\n        })\n      ]);\n    });\n\n    function capitalizeWords(str) {\n      return str\n        .split(' ')\n        .map(word => {\n          if (word.length === 0) return '';\n          return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n        }).join(' ');\n    }\n\n    \/*\n    search.addWidgets([\n        instantsearch.widgets.refinementList({\n            container: `#facet-webPriceRange`,\n            attribute: 'webPriceRange',\n            searchable: true,\n            showMore: true,\n            sortBy: (a, b) => {\n                const aStart = parseInt(a.name.split(':')[0], 10);\n                const bStart = parseInt(b.name.split(':')[0], 10);\n                return (aStart - bStart)\n            }\n        })\n    ]);\n    *\/\n\n    search.addWidgets([\n      instantsearch.widgets.numericMenu({\n        container: '#facet-webPriceRange',\n        attribute: 'webPrice',\n        items: [{\n            label: 'All'\n          },\n          {\n            label: '$0 - $5',\n            start: 0,\n            end: 5\n          },\n          {\n            label: '$5 - $10',\n            start: 5,\n            end: 10\n          },\n          {\n            label: '$10 - $15',\n            start: 10,\n            end: 15\n          },\n          {\n            label: '$15 - $20',\n            start: 15,\n            end: 20\n          },\n          {\n            label: '$20 - $25',\n            start: 20,\n            end: 25\n          },\n          {\n            label: '$25 - $50',\n            start: 25,\n            end: 50\n          },\n          {\n            label: '$50 - $100',\n            start: 50,\n            end: 100\n          },\n          {\n            label: '$100+',\n            start: 100\n          }\n        ],\n        templates: {\n          item: (item) => {\n            const id = `price-${item.label.replace(\/\\s|\\$|\\+\/g, '-').toLowerCase()}`;\n            return `\n                                <div class=\"ais-NumericMenu-item\">\n                                    <input \n                                    type=\"radio\" \n                                    id=\"${id}\" \n                                    name=\"price-radio-${id}\" \n                                    ${item.isRefined ? 'checked' : ''}\n                                    \/>\n                                    <label for=\"${id}\">${item.label}<\/label>\n                                <\/div>\n                                `;\n          }\n        }\n      })\n    ]);\n\n    \/\/ Search Box Widget\n    search.addWidgets([\n      instantsearch.widgets.searchBox({\n        container: '#searchbox',\n        placeholder: 'Search for books...',\n        showReset: true,\n        showSubmit: true,\n        showLoadingIndicator: false,\n      }),\n    ]);\n\n        \/\/ Create the render function\n    const createDataAttribtues = refinement =>\n      Object.keys(refinement)\n      .map(key => `data-${key}=\"${refinement[key]}\"`)\n      .join(' ');\n\n    const renderListItem = item => (\n      \/\/ console.log(\"items\", item),\n      `<li>\n                    <strong>${window.facetsLabel[item.label]}<\/strong>\n                    <ul>\n                        ${item.refinements\n                        .map(\n                            refinement =>\n                                `<li>\n                                ${capitalizeWords(refinement.label)}\n                                <button ${createDataAttribtues(refinement)}>X<\/button>\n                            <\/li>`\n                        )\n                        .join('')}\n                    <\/ul>\n                <\/li>`);\n\n    const renderCurrentRefinements = (renderOptions, isFirstRender) => {\n      const {\n        items,\n        refine,\n        widgetParams\n      } = renderOptions;\n\n      widgetParams.container.innerHTML = `<ul>${items.map(renderListItem).join('')}<\/ul>`;\n\n      \/\/ Display Clear all filter if Current refinements\n      const currentRefContainer = document.querySelector('#currentRefinements');\n      if (currentRefContainer.innerHTML === '<ul><\/ul>') {\n        document.querySelector('#clear-filters').style.display = 'none';\n      } else {\n        document.querySelector('#clear-filters').style.display = 'block';\n      }\n\n      [...widgetParams.container.querySelectorAll('button')].forEach(element => {\n        element.addEventListener('click', event => {\n          const item = Object.keys(event.currentTarget.dataset).reduce(\n            (acc, key) => ({\n              ...acc,\n              [key]: event.currentTarget.dataset[key],\n            }), {}\n          );\n\n          refine(item);\n        });\n      });\n    };\n\n    \/\/ Create the custom widget\n    const customCurrentRefinements = instantsearch.connectors.connectCurrentRefinements(\n      renderCurrentRefinements\n    );\n\n    \/\/ Instantiate the custom widget\n    search.addWidgets([\n      customCurrentRefinements({\n        container: document.querySelector('#currentRefinements')\n      })\n    ]);\n\n    \/\/ Clear Filter\n    search.addWidgets([\n      instantsearch.widgets.clearRefinements({\n        container: '#clear-filters',\n        templates: {\n          resetLabel: 'Clear All Filters',\n        },\n      }),\n    ]);\n      }\n\n  \/\/ wrapper with parameters\n  const withAria = (widget, selector, label = 'Results per page') => ({\n    ...widget,\n    render(renderOptions) {\n      widget.render(renderOptions);\n      if (!this.hasSetAria) {\n        const select = document.querySelector(`${selector} select`);\n        if (select) {\n          select.setAttribute('aria-label', label);\n          this.hasSetAria = true; \/\/ avoid duplicate set\n        }\n      }\n    },\n  });\n\n  \n  \/\/ define your base widget\n  const hitsPerPageTop = instantsearch.widgets.hitsPerPage({\n    container: '#top-hits-per-page',\n    items: perPageJson,\n  });\n\n  search.addWidgets([\n    withAria(hitsPerPageTop, '#top-hits-per-page', 'Results per page'),\n  ]);\n\n  \n  \n  const hitsPerPageBottom = instantsearch.widgets.hitsPerPage({\n    container: '#bottom-hits-per-page',\n    items: perPageJson,\n  });\n\n  search.addWidgets([\n    withAria(hitsPerPageBottom, '#bottom-hits-per-page', 'Results per page'),\n  ]);\n\n  \n  \/\/ Enable hierarchical facet menu\n  \n  \/\/ Book Results\n  instaHits = instantsearch.widgets.hits;\n  if (window.hcpInfiniteLoading) {\n    instaHits = instantsearch.widgets.infiniteHits;\n  }\n  search.addWidgets([\n    instaHits({\n      container: '#book-list',\n      templates: {\n        item: function(hit) {\n          hit.webPrice = (hit.webPrice).toFixed(2);\n          var url = '';\n          if (window.rewrite_rule === 'isbn') {\n            url = `${siteData.baseUrl}${hit.isbn13}\/${hit.slugTitle}`;\n          } else if (window.rewrite_rule === 'book') {\n            url = `\/books\/${hit.isbn13}\/${hit.slugTitle}`;\n          } else if (window.rewrite_rule === 'bookdetail') {\n            url = `\/book-details\/${hit.isbn13}`;\n          }  else if (window.rewrite_rule === 'churchsource') {\n             url = window.rewriting_rule_church.replace('{isbn}', hit.isbn13);\n          } else if (window.rewrite_rule === 'faithgateway') {\n             url = window.rewriting_rule_faithgateway.replace('{isbn}', hit.isbn13);\n          } else {\n            \/\/ Default fallback\n            url = `${siteData.baseUrl}${hit.isbn13}\/${hit.slugTitle}`;\n          }\n          const targetAttr = (url.includes('churchsource') || url.includes('faithgateway')) ? ' target=\"_blank\"' : '';\n          const onSaleDate = new Date(hit.onSaleDate); \/\/ \"1900-01-01T00:00:00Z\"\n          const today = new Date();\n\n          \/\/ If onSaleDate is greater than today's date \u2192 it's a preorder\n          var isPreOrder = onSaleDate > today;\n\n          \/\/var isPreOrder = hit.onSaleDateTimestamp && hit.onSaleDateTimestamp * 1000 > Date.now();\n\n          var cartIcon = '';\n          if (window.enable_layout_change == true) {\n            cartIcon =\n              '<svg class=\"cart-icon\" viewBox=\"0 0 30.511 30.511\"><path d=\"M26.818 19.037l3.607-10.796c.181-.519.044-.831-.102-1.037-.374-.527-1.143-.532-1.292-.532L8.646 6.668l-.544-2.581c-.147-.609-.581-1.19-1.456-1.19H.917c-.594 0-.917.278-.917.833v1.49c0 .537.322.677.938.677h4.837l3.702 15.717c-.588.623-.908 1.531-.908 2.378 0 1.864 1.484 3.582 3.38 3.582 1.79 0 3.132-1.677 3.35-2.677h7.21c.218 1 1.305 2.717 3.349 2.717 1.863 0 3.378-1.614 3.378-3.475 0-1.851-1.125-3.492-3.359-3.492-.929 0-2.031.5-2.543 1.25h-8.859c-.643-1-1.521-1.31-2.409-1.345l-.123-.655h13.479c1.016 0 1.216-.37 1.396-.86zm-.935 3.791a1.27 1.27 0 1 1-.001 2.541 1.27 1.27 0 0 1 .001-2.541zm-12.678 1.27c0 .709-.576 1.286-1.283 1.286-.709-.002-1.286-.577-1.286-1.286s.577-1.286 1.286-1.286c.707 0 1.283.577 1.283 1.286z\"><\/path><\/svg>';\n          }\n\n          if (window.hcpRowDesign === 'plain') {\n            return `\n                                <div class=\"col text-center\">\n                                    <a href=\"${url}\" class=\"text-decoration-none\" ${targetAttr}>\n                                        <img decoding=\"async\" src=\"${hit.imageUrl}\" \n                                                class=\"img-fluid mb-2 mx-auto\" \n                                                alt=\"${hit.title}\" \n                                                style=\"max-height: 200px; object-fit: contain; display: block;\" loading=\"lazy\" \/>\n                                        <h6 class=\"text-dark text-center\">${hit.title}<\/h6>\n                                        ${window.hcpprice==true ? `<span class=\"price\">$${hit.webPrice}<\/span>` : ''}\n                                    <\/a>\n                                <\/div>\n                            `;\n          } else if (window.hcpRowDesign === 'clickable-card') {\n            var html =\n              `\n                            <div class=\"col\">\n                                <div class=\"card h-100 shadow-sm\">\n                                    <a href=\"${url}\" class=\"text-decoration-none\" ${targetAttr}>\n                                        <img decoding=\"async\" src=\"${hit.imageUrl}\" class=\"card-img-top\" alt=\"${hit.title}\" loading=\"lazy\" \/>\n                                    <\/a>\n                                    <div class=\"card-body d-flex flex-column\">\n                                        <div class=\"card-cont\">\n                                        <h5 class=\"card-title\"><a href=\"${url}\" aria-label=\"${hit.title}\" class=\"text-decoration-none\">${hit.title}<\/a><\/h5>`;\n\n            if (Array.isArray(hit.contributors) && hit.contributors.length > 0) {\n              html += `<p class=\"card-text\"><strong>Autor: <\/strong>`;\n\n              const contributorNames = hit.contributors.map(c => {\n                if (window.hcpEnableAuthorLink) {\n                  return `<a href=\"${siteData.baseUrl}\/author\/${c.id}\/${c.slug}\">${c.name}<\/a>`;\n                } else {\n                  return c.name;\n                }\n              });\n\n              html += contributorNames.join(', ');\n              html += `<\/p>`;\n            }\n\n            html += `${window.hcpprice==true ? `<span class=\"price\">$${hit.webPrice}<\/span>` : ''}\n                                            <p class=\"isbn\"><span>ISBN:<\/span> ${hit.isbn13}<\/p>\n                                            <div class=\"description\">${hit.keynote}<\/div>\n                                            <\/div>\n                                            <div class=\"card-action\">\n                                            <p class=\"format\">${hit.formatDisplay}<\/p>\n                                        <a href=\"${url}\" class=\"btn btn-primary btn-sm mt-auto\" aria-label=\"${hit.title} ${isPreOrder ? 'Pre-Order' : 'Learn more'}\" ${targetAttr}>\n                                            ${cartIcon}\n                                            ${isPreOrder ? 'Hacer un dido' : 'Comprar ahora'}\n                                        <\/a>\n                                        <\/div>\n                                    <\/div>\n                                <\/div>\n                            <\/div>\n                        `;\n            return html;\n          } else {\n            var html = `\n                                <div class=\"col\">\n                                    <div class=\"card h-100 shadow-sm\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"img-thumb\">\n                                        \t<img decoding=\"async\" src=\"${hit.imageUrl}\" class=\"card-img-top\" alt=\"Book cover of ${hit.title}\" loading=\"lazy\" \/>\n\t\t\t\t\t\t\t\t\t\t<\/div>\n                                        <div class=\"card-body d-flex flex-column\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"card-cont\">\n\t\t\t\t\t\t\t\t\t\t\t\t<h5 class=\"card-title\">${hit.title}<\/h5>`;\n            if (Array.isArray(hit.contributors) && hit.contributors.length > 0) {\n              html += `<p class=\"card-text\"><strong>Author: <\/strong>`;\n\n              const contributorNames = hit.contributors.map(c => {\n                if (window.hcpEnableAuthorLink) {\n                  return `<a href=https:\/\/staging.editorialhccp.hcusweb.com\/author\/${c.id}\/${c.slug}>${c.name}<\/a>`;\n                } else {\n                  return c.name;\n                }\n              });\n\n              html += contributorNames.join(', ');\n              html += `<\/p>`;\n            }\n\n            html += `${window.hcpprice==true ? `<span class=\"price\">$${hit.webPrice}<\/span>` : ''}\n\t\t\t\t\t\t\t\t\t\t\t\t${hit.isbn13 && hit.isbn13.trim() !== ''\n\t\t\t\t\t\t\t\t\t\t\t\t\t? `<p class=\"isbn\"><span>ISBN:<\/span> ${hit.isbn13}<\/p>`\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ''}\n\n\t\t\t\t\t\t\t\t\t\t\t\t${hit.keynote && hit.keynote.trim() !== ''\n\t\t\t\t\t\t\t\t\t\t\t\t\t? `<div class=\"description\">${hit.keynote}<\/div>`\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ''}\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"card-action\">\n\t\t\t\t\t\t\t\t\t\t\t\t${hit.formatDisplay && hit.formatDisplay.trim() !== ''\n\t\t\t\t\t\t\t\t\t\t\t\t\t? `<p class=\"format\">${hit.formatDisplay}<\/p>`\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ''}\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"${url}\" class=\"btn btn-primary btn-sm mt-auto\" aria-label=\"View Details\" ${targetAttr}>View Details<\/a>\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n                                        <\/div>\n                                    <\/div>\n                                <\/div>`;\n\n            return html;\n          }\n        },\n        empty(results, {\n          html\n        }) {\n          return html `\n                        <div class=\"error-404\">\n                            <h2>\n                            Didn't find any results for the search? \n                            ${results.query ? html`<q>${results.query}<\/q>` : \"\"}\n                            <\/h2>\n                            <a role=\"button\" href=\".\" class=\"reset-button\" aria-label=\"Try a new Search\">\n                            Try a new Search?\n                            <\/a>\n                        <\/div>\n                        `;\n        },\n      },\n          }),\n  ]);\n    search.addWidgets([\n    instantsearch.widgets.pagination({\n      container: '#pagination-top',\n      scrollTo: '#book-list',\n      padding: 2,\n      showFirst: false,\n      showLast: false,\n      templates: {\n        next: (window.enable_pagination_arrows == true) ? '&rsaquo;' : 'Next >',\n        previous: (window.enable_pagination_arrows == true) ? '&lsaquo;' : '< Previous'\n      },\n      cssClasses: {\n        root: window.hcpPaginationRootClasses,\n        item: 'page-item',\n        link: 'page-link',\n        selectedItem: 'active'\n      }\n    }),\n  ]);\n      search.addWidgets([\n    instantsearch.widgets.pagination({\n      container: '#pagination-bottom',\n      scrollTo: '#book-list',\n      padding: 2,\n      showFirst: false,\n      showLast: false,\n      templates: {\n        next: (window.enable_pagination_arrows == true) ? '&rsaquo;' : 'Next >',\n        previous: (window.enable_pagination_arrows == true) ? '&lsaquo;' : '< Previous'\n      },\n      cssClasses: {\n        root: window.hcpPaginationRootClasses,\n        item: 'page-item',\n        link: 'page-link',\n        selectedItem: 'active'\n      }\n    })\n  ]);\n  \n  search.start();\n\n  search.on('render', () => {\n    const results = search.helper.lastResults;\n    if (results) {\n      const totalBooks = results.nbHits;\n      const noOfPages = results.nbPages;\n      const currentPage = parseInt(results.page) + 1; \/\/ Adjust page no\n      const hitsPerPage = parseInt(results.hitsPerPage);\n      const totalPerPage = currentPage * hitsPerPage;\n      var recordsPerPage = (parseInt(results.page) * hitsPerPage) + 1;\n      recordsPerPage = currentPage > 1 ? recordsPerPage : currentPage;\n\n      \/\/ Pagination count element\n      const countElement = document.getElementById('total-books-count');\n      if (countElement) {\n        let message = '';\n\n        if (totalBooks === 0) {\n          message = 'No results found';\n        } else if (totalBooks === 1) {\n          message = '1 result found';\n        } else {\n          if (window.enable_layout_change == true) {\n            \/\/message = `Resultados ${recordsPerPage} - ${totalPerPage} de ${totalBooks}`;\n            if(noOfPages == currentPage){\n              message = `Resultados ${recordsPerPage} - ${totalBooks} of ${totalBooks}`;\n            }else{\n              message = `Resultados ${recordsPerPage} - ${totalPerPage} of ${totalBooks}`;\n            }\n          } else {\n            message = `${totalBooks} results found`;\n          }\n        }\n\n        countElement.textContent = message;\n      }\n\n      \/\/ Show \/ hide book-nav based on pages\n      if (noOfPages < 2) {\n        document.querySelectorAll(\".book-nav\").forEach(nav => {\n          nav.classList.remove(\"d-block\");\n          nav.classList.add(\"d-none\");\n        });\n      } else {\n        document.querySelectorAll(\".book-nav\").forEach(nav => {\n          nav.classList.remove(\"d-none\");\n          nav.classList.add(\"d-block\");\n        });\n      }\n    }\n\n    \/\/ Add role=\"button\" to prev\/next links only when element is not semantic (A\/BUTTON)\n    document.querySelectorAll(\n        '.ais-Pagination-item--previousPage .ais-Pagination-link, .ais-Pagination-item--nextPage .ais-Pagination-link'\n      )\n      .forEach(function(el) {\n        const tag = el.tagName && el.tagName.toUpperCase();\n        if (tag !== 'A' && tag !== 'BUTTON' && !el.hasAttribute('role')) {\n          el.setAttribute('role', 'button');\n        }\n      });\n\n    \/\/ Mark disabled items for AT\n    document.querySelectorAll('.ais-Pagination-item--disabled .ais-Pagination-link').forEach(\n      function(el) {\n        el.setAttribute('aria-disabled', 'true');\n      });\n\n    \/\/ aria-current for selected page items\n    document.querySelectorAll('.ais-Pagination-item').forEach((li) => {\n      const link = li.querySelector('.ais-Pagination-link');\n      if (!link) return;\n\n      if (li.classList.contains('ais-Pagination-item--selected')) {\n        link.setAttribute('aria-current', 'page');\n      } else {\n        link.removeAttribute('aria-current');\n      }\n    });\n\n    \/\/ --- Make each .ais-Pagination-link keyboard-focusable and attach keydown (if not already processed) ---\n    const makeKbAccessible = (el) => {\n      if (!el) return;\n      if (el.dataset.kbAccessible === '1') return; \/\/ already processed\n\n      const parentLi = el.closest('.ais-Pagination-item');\n      const isDisabled = parentLi?.classList.contains('ais-Pagination-item--disabled') || el\n        .getAttribute('aria-disabled') === 'true';\n      const tag = el.tagName && el.tagName.toUpperCase();\n\n      \/\/ Add role only for non-semantic elements\n      if (tag !== 'A' && tag !== 'BUTTON' && !el.hasAttribute('role')) {\n        el.setAttribute('role', 'button');\n      }\n\n      \/\/ Tabindex handling\n      if (isDisabled) {\n        el.setAttribute('aria-disabled', 'true');\n        el.setAttribute('tabindex', '-1');\n      } else {\n        \/\/ anchors remain natural focusable; other tags get tabindex=0\n        if (tag !== 'A' && tag !== 'BUTTON') {\n          el.setAttribute('tabindex', '0');\n        } else {\n          \/\/ ensure anchor is focusable if it has a valid href; don't override\n          if (!el.hasAttribute('tabindex')) {\n            \/\/ leave anchor as-is\n          }\n        }\n        el.removeAttribute('aria-disabled');\n      }\n\n      \/\/ keydown handler: Enter + Space activate control (call click)\n      el.addEventListener('keydown', function(evt) {\n        const disabledNow = el.getAttribute('aria-disabled') === 'true' || el\n          .closest('.ais-Pagination-item')?.classList.contains(\n            'ais-Pagination-item--disabled');\n        if (disabledNow) {\n          evt.preventDefault();\n          evt.stopPropagation();\n          return;\n        }\n        if (evt.key === 'Enter') {\n          evt.preventDefault();\n          el.click();\n        } else if (evt.key === ' ' || evt.key === 'Spacebar') {\n          evt.preventDefault();\n          el.click();\n        }\n      }, false);\n\n      \/\/ mark processed\n      el.dataset.kbAccessible = '1';\n    };\n\n    document.querySelectorAll('.ais-Pagination-link').forEach(makeKbAccessible);\n\n    \/\/ --- Event delegation on pagination container (install once) ---\n    const paginationContainer = document.querySelector('.ais-Pagination');\n    if (paginationContainer && !paginationContainer.dataset.paginationDelegateInstalled) {\n      paginationContainer.addEventListener('click', function(e) {\n        const clicked = e.target.closest('.ais-Pagination-link');\n        if (!clicked) return;\n\n        \/\/ Ignore disabled\n        if (clicked.getAttribute('aria-disabled') === 'true' || clicked.closest(\n            '.ais-Pagination-item')?.classList.contains(\n            'ais-Pagination-item--disabled')) {\n          e.preventDefault();\n          return;\n        }\n\n        \/\/ Determine page: prefer data-page, fallback to data-action next\/previous, fallback to visible number, fallback to href parsing\n        let page = null;\n        if (clicked.dataset && typeof clicked.dataset.page !== 'undefined' && clicked\n          .dataset.page !== '') {\n          page = parseInt(clicked.dataset.page, 10);\n        } else if (clicked.getAttribute('data-page')) {\n          page = parseInt(clicked.getAttribute('data-page'), 10);\n        } else {\n          const action = (clicked.dataset.action || clicked.getAttribute(\n            'data-action') || '').toLowerCase();\n          const results = search.helper.lastResults;\n          if (action === 'next' && results) page = results.page + 1;\n          else if (action === 'previous' && results) page = results.page - 1;\n          else {\n            \/\/ fallback: parse visible number\n            const txt = (clicked.textContent || '').trim();\n            const maybeNum = parseInt(txt, 10);\n            if (!isNaN(maybeNum)) page = maybeNum - 1;\n            else {\n              \/\/ final fallback: try to parse from href like \"?page=3\" or \"#page=3\"\n              const href = clicked.getAttribute && clicked.getAttribute('href');\n              if (href) {\n                const m = href.match(\/(?:page=|p=)(\\d+)\/i);\n                if (m) {\n                  page = parseInt(m[1], 10) - 1;\n                }\n              }\n            }\n          }\n        }\n\n        if (page !== null && !isNaN(page) && window.search && search.helper &&\n          typeof search.helper.setPage === 'function') {\n          e.preventDefault();\n          \/\/ clamp to valid range if available\n          const results = search.helper.lastResults;\n          if (results) {\n            const last = Math.max(0, (results.nbPages || 1) - 1);\n            page = Math.max(0, Math.min(page, last));\n          }\n          try {\n            search.helper.setPage(page).search();\n          } catch (err) {\n            console.error('Pagination navigation failed:', err);\n          }\n        }\n        \/\/ else let default behavior occur (useful if anchors handle navigation)\n      }, false);\n\n      paginationContainer.dataset.paginationDelegateInstalled = '1';\n    }\n\n    \/\/ Loading\n    const loadingContainer = document.querySelector('#book-loading-container');\n    if (loadingContainer) {\n      if (search.status === 'loading' || search.status === 'stalled') {\n        loadingContainer.innerText = 'Loading search results...';\n      } else {\n        loadingContainer.innerText = '';\n      }\n    }\n\n    const activePage = document.querySelector('#pagination-top .ais-Pagination-item--selected');\n    if (activePage && window.enable_pagination_arrows == true) {\n\n      window.scrollTo({\n        top: 0,\n        behavior: 'smooth'\n      });\n    }\n\n\n    function getElementTop(selector) {\n      const el = document.querySelector(selector);\n      if (!el) return 0;\n      return el.getBoundingClientRect().top + window.pageYOffset;\n    }\n  });\n\n});\n<\/script>\n<!-- List View \/ Grid View JS Code  -->\n<script>\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n  const bookList = document.getElementById(\"book-list\");\n  const gridBtn = document.querySelector(\".ais-change-display-block\");\n  const listBtn = document.querySelector(\".ais-change-display-list\");\n\n  if (!listBtn) return;\n  \/\/ Default is grid (already applied in HTML)\n  gridBtn.addEventListener(\"click\", function() {\n    bookList.classList.remove(\"ais-view-list\");\n    bookList.classList.add(\"ais-view-grid\");\n\n    gridBtn.classList.add(\"selected\");\n    listBtn.classList.remove(\"selected\");\n\n    gridBtn.setAttribute(\"aria-pressed\", \"true\");\n    listBtn.setAttribute(\"aria-pressed\", \"false\");\n  });\n\n  listBtn.addEventListener(\"click\", function() {\n    bookList.classList.remove(\"ais-view-grid\");\n    bookList.classList.add(\"ais-view-list\");\n\n    listBtn.classList.add(\"selected\");\n    gridBtn.classList.remove(\"selected\");\n\n    listBtn.setAttribute(\"aria-pressed\", \"true\");\n    gridBtn.setAttribute(\"aria-pressed\", \"false\");\n\n  });\n});\ndocument.querySelectorAll('[role=\"button\"]').forEach(el => {\n  el.addEventListener('keydown', e => {\n    if (e.key === 'Enter' || e.key === ' ') {\n      e.preventDefault();\n      el.click();\n    }\n  });\n});\n<\/script>","protected":false},"excerpt":{"rendered":"","protected":false},"author":0,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-9","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Search Results - Grupo Nelson<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/search-results\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Search Results\" \/>\n<meta property=\"og:url\" content=\"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/search-results\/\" \/>\n<meta property=\"og:site_name\" content=\"Grupo Nelson\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-19T13:09:22+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/staging.editorialhccp.hcusweb.com\\\/gruponelson\\\/search-results\\\/\",\"url\":\"https:\\\/\\\/staging.editorialhccp.hcusweb.com\\\/gruponelson\\\/search-results\\\/\",\"name\":\"Search Results - Grupo Nelson\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/staging.editorialhccp.hcusweb.com\\\/gruponelson\\\/#website\"},\"datePublished\":\"2019-03-15T11:24:56+00:00\",\"dateModified\":\"2025-11-19T13:09:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/staging.editorialhccp.hcusweb.com\\\/gruponelson\\\/search-results\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/staging.editorialhccp.hcusweb.com\\\/gruponelson\\\/search-results\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/staging.editorialhccp.hcusweb.com\\\/gruponelson\\\/search-results\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/staging.editorialhccp.hcusweb.com\\\/gruponelson\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Search Results\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/staging.editorialhccp.hcusweb.com\\\/gruponelson\\\/#website\",\"url\":\"https:\\\/\\\/staging.editorialhccp.hcusweb.com\\\/gruponelson\\\/\",\"name\":\"Grupo Nelson\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/staging.editorialhccp.hcusweb.com\\\/gruponelson\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Search Results - Grupo Nelson","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/search-results\/","og_locale":"en_US","og_type":"article","og_title":"Search Results","og_url":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/search-results\/","og_site_name":"Grupo Nelson","article_modified_time":"2025-11-19T13:09:22+00:00","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/search-results\/","url":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/search-results\/","name":"Search Results - Grupo Nelson","isPartOf":{"@id":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/#website"},"datePublished":"2019-03-15T11:24:56+00:00","dateModified":"2025-11-19T13:09:22+00:00","breadcrumb":{"@id":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/search-results\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/search-results\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/search-results\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/"},{"@type":"ListItem","position":2,"name":"Search Results"}]},{"@type":"WebSite","@id":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/#website","url":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/","name":"Grupo Nelson","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/wp-json\/wp\/v2\/pages\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/wp-json\/wp\/v2\/types\/page"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":1,"href":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/wp-json\/wp\/v2\/pages\/9\/revisions"}],"predecessor-version":[{"id":2781,"href":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/wp-json\/wp\/v2\/pages\/9\/revisions\/2781"}],"wp:attachment":[{"href":"https:\/\/staging.editorialhccp.hcusweb.com\/gruponelson\/wp-json\/wp\/v2\/media?parent=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}