1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunks/shared-components-C3Crcn7g.js","chunks/vendor-react-Cq2TKhAs.js","chunks/vendor-swiper-oRIQMlUm.js"])))=>i.map(i=>d[i]); 2import{r as g,c as C,j as m}from"./chunks/vendor-react-Cq2TKhAs.js";import{L as I}from"./chunks/LoadMoreHandler-DcYU2NQZ.js";const k="modulepreload",M=function(e){return"/js/"+e},S={},b=function(t,s,r){let n=Promise.resolve();if(s&&s.length>0){let y=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),d=l?.nonce||l?.getAttribute("nonce");n=y(s.map(u=>{if(u=M(u),u in S)return;S[u]=!0;const h=u.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${p}`))return;const o=document.createElement("link");if(o.rel=h?"stylesheet":k,h||(o.as="script"),o.crossOrigin="",o.href=u,d&&o.setAttribute("nonce",d),document.head.appendChild(o),h)return new Promise((a,i)=>{o.addEventListener("load",a),o.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${u}`)))})}))}function c(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return n.then(l=>{for(const d of l||[])d.status==="rejected"&&c(d.reason);return t().catch(c)})};if(window.__REACT_CORE_LOADED__)throw new Error("React core already loaded - check for duplicate script includes");window.__REACT_CORE_LOADED__=!0;const P=g.lazy(()=>b(()=>import("./chunks/shared-components-C3Crcn7g.js").then(e=>e.i),__vite__mapDeps([0,1,2]))),R=g.lazy(()=>b(()=>import("./chunks/shared-components-C3Crcn7g.js").then(e=>e.a),__vite__mapDeps([0,1,2]))),B=g.lazy(()=>b(()=>import("./chunks/shared-components-C3Crcn7g.js").then(e=>e.b),__vite__mapDeps([0,1,2]))),D=g.lazy(()=>b(()=>import("./chunks/shared-components-C3Crcn7g.js").then(e=>e.c),__vite__mapDeps([0,1,2]))),O=g.lazy(()=>b(()=>import("./chunks/shared-components-C3Crcn7g.js").then(e=>e.d),__vite__mapDeps([0,1,2]))),j=g.lazy(()=>b(()=>import("./chunks/shared-components-C3Crcn7g.js").then(e=>e.e),__vite__mapDeps([0,1,2]))),H=g.lazy(()=>b(()=>import("./chunks/shared-components-C3Crcn7g.js").then(e=>e.f),__vite__mapDeps([0,1,2]))),U=g.lazy(()=>b(()=>import("./chunks/shared-components-C3Crcn7g.js").then(e=>e.g),__vite__mapDeps([0,1,2]))),f=({Component:e,...t})=>m.jsx(e,{...t}),_={accordion:e=>m.jsx(f,{Component:P,...e}),"media-slider":e=>m.jsx(f,{Component:R,...e}),"hero-slider":e=>m.jsx(f,{Component:B,...e}),"card-slider":e=>m.jsx(f,{Component:D,...e}),"book-carousel":e=>m.jsx(f,{Component:O,...e}),"upcoming-events":e=>m.jsx(f,{Component:j,...e}),"recommendations-slider":e=>m.jsx(f,{Component:H,...e}),"shelf-help-builder":e=>m.jsx(f,{Component:U,...e})},A=new WeakMap;for(const e in _)document.querySelectorAll(`[data-react-mount="${e}"]`).forEach(s=>{if(!(s instanceof HTMLElement))return;let r=A.get(s);r||(s.innerHTML="",r=C.createRoot(s),A.set(s,r));const n=_[e];r.render(m.jsx(n,{...s.dataset}))});const E=e=>{const t=e.getAttribute("data-bg-image");if(t&&!e.style.backgroundImage){e.classList.add("bg-loading");const s=new Image;s.onload=()=>{e.style.backgroundImage=`url('${t}')`,e.classList.remove("bg-loading"),e.classList.add("bg-loaded")},s.onerror=()=>{e.classList.remove("bg-loading")},s.src=t}},x=()=>{document.querySelectorAll("[data-bg-image]").forEach(E)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",x):x();const z=new MutationObserver(e=>{e.forEach(t=>{t.addedNodes.forEach(s=>{s instanceof HTMLElement&&(s.hasAttribute("data-bg-image")&&E(s),s.querySelectorAll("[data-bg-image]").forEach(E))})})});z.observe(document.documentElement,{childList:!0,subtree:!0});document.querySelectorAll("[data-trigger-id]").forEach(t=>{const s=t.getAttribute("data-trigger-id");if(!s)return;const r=document.getElementById(s);if(!r)return;const n=r.classList.contains("navigation__panel--mobile");t.addEventListener("click",()=>{t.classList.toggle("is-active"),r.classList.toggle("is-active");const c=t.classList.contains("is-active");if(t.setAttribute("aria-expanded",c.toString()),n){c?(r.classList.remove("invisible","opacity-0","translate-x-full"),r.setAttribute("aria-hidden","false")):(r.classList.add("invisible","opacity-0","translate-x-full"),r.setAttribute("aria-hidden","true"));const d=r.querySelector(".back-toggle");d&&d.setAttribute("tabindex",c?"0":"-1")}const l=document.getElementById("mobile-nav-body");l&&window.innerWidth<=1280&&l.scrollTo({top:0,behavior:"smooth"})}),n||document.addEventListener("click",c=>{const l=c.target;!t.contains(l)&&!r.contains(l)&&window.innerWidth>=1280&&(t.classList.remove("is-active"),r.classList.remove("is-active"),t.setAttribute("aria-expanded","fal
2se"))})});(()=>{const e=document.querySelector(".header-search"),t=document.querySelector(".search-toggle-btn"),s=document.getElementById("mobile-search"),r=()=>{const n=e?.querySelector('input[name="Query"]');n&&setTimeout(()=>n.focus(),50)};t&&e&&t.addEventListener("click",()=>{e.classList.toggle("is-active"),t.classList.toggle("is-active");const n=t.classList.contains("is-active");t.setAttribute("aria-expanded",n.toString()),s&&(s.classList.toggle("is-active"),s.setAttribute("aria-expanded",n.toString())),n&&r()})})();(()=>{const e=document.getElementById("menu-trigger"),t=document.getElementById("mobile-nav-body");if(!e||!t)return;const s=e.querySelector("#menu-label"),r=document.getElementById("mobile-search"),n=document.querySelector(".header-search");e.addEventListener("click",()=>{e.classList.toggle("is-active");const c=e.classList.contains("is-active");e.setAttribute("aria-expanded",c.toString()),s&&(s.textContent=c?"Close":"Menu"),c?(t.classList.remove("invisible","opacity-0"),t.setAttribute("aria-hidden","false")):(t.classList.add("invisible","opacity-0"),t.setAttribute("aria-hidden","true"),t.querySelectorAll(".navigation__panel--mobile.is-active").forEach(d=>{d.classList.remove("is-active"),d.classList.add("invisible","opacity-0","translate-x-full"),d.setAttribute("aria-hidden","true")})),r&&n&&(n.classList.remove("is-active"),r.classList.remove("is-active"),r.setAttribute("aria-expanded","false"))}),r&&n&&r.addEventListener("click",()=>{e.classList.remove("is-active"),e.setAttribute("aria-expanded","false"),t.classList.add("invisible","opacity-0"),t.setAttribute("aria-hidden","true"),s&&(s.textContent="Menu"),n.classList.toggle("is-active"),r.classList.toggle("is-active");const c=n.classList.contains("is-active");r.setAttribute("aria-expanded",c.toString());const l=document.querySelector(".search-toggle-btn");if(l&&(l.classList.toggle("is-active",c),l.setAttribute("aria-expanded",c.toString())),c){const d=n.querySelector('input[name="Query"]');d&&setTimeout(()=>d.focus(),50)}})})();document.querySelectorAll(".read-more-element").forEach(t=>{const s=t.querySelector(".read-more-button"),r=t.querySelector(".read-more-button-text"),n=t.querySelector(".read-more-arrow"),c=t.querySelector(".read-more-content");!s||!c||s.addEventListener("click",()=>{const l=c.classList.toggle("max-h-[999lh]");c.classList.toggle("max-h-[6lh]",!l),r.innerText=l?"Read less":"Read more",n.classList.toggle("fa-rotate-180",l)})});const $=()=>{if(!document.getElementById("shielded-logo"))return;const t=document.createElement("script");t.src="https://staticcdn.co.nz/embed/embed.js",t.onload=()=>{new window.ds07o6pcmkorn({openElementId:"#shielded-logo",modalID:"modal"}).init()},document.body.appendChild(t)};document.addEventListener("DOMContentLoaded",$);document.querySelectorAll('[data-button-type="credit-trigger"]').forEach(t=>{t.addEventListener("click",()=>{const s=t.parentElement?.querySelector(".image-credit-text"),r=t.querySelector("i");if(!s||!r)return;const n=s.classList.contains("hidden");s.classList.toggle("hidden"),n?r.className="far fa-times-circle text-2xl":r.className="far fa-camera text-2xl"})});(()=>{const e=document.querySelectorAll(".alert-banner"),t=document.getElementById("alert-banner-container");e&&t&&(V(e,t),e.forEach(s=>{const r=s.querySelector(".close");r&&r.addEventListener("click",()=>{q(s),N(s)})}))})();function q(e){e.classList.add("hidden")}function N(e){sessionStorage.setItem(e.id,"closed")}function V(e,t){e.forEach(s=>{const r=s.id;sessionStorage.getItem(r)==="closed"&&q(s)}),t.classList.toggle("opacity-0"),t.classList.toggle("max-h-[1000px]")}class Q extends I{query="";constructor(){super({buttonSelector:"[data-search-load-more]",containerSelector:"[data-search-results]",counterSelector:"[data-results-end]"})}init(){super.init(),this.button&&(this.query=this.button.getAttribute("data-query")??"")}buildUrl(){const t=new URL(`${this.baseUrl}/loadmore`,window.location.origin);return t.searchParams.set("Query",this.query),t.searchParams.set("offset",this.currentOffset.toString()),t}}function W(){new Q().init()}function w(e){return e==="website"||e==="catalogue"||e==="heritage"}function F(e){const t=e.querySelectorAll(".search-type-btn"),s=e.querySelector("[data-search-type-field]"),r=e.querySelector('input[name="Query"]'),n=e.querySelector("[data-search-label]");if(!t.length||!s||!r||!n)return;const c=(o,a)=>({title:e.dataset[`${o}Title`]??a.title,placeholder:e.dataset[`${o}Placeholder`]??a.placeholder,helper:e.dataset[`${o}Helper`]??a.helper,url:e.dataset[`${o}Url`]??a.url}),l={website:c("website",{title:"Search this website",placeholder:"What are you looking for?",helper:"",url:""}),catalogue:c("catalogue",{title:"Search library collections",placeholder:"Search the catalogue...",helper:"",url:""}),heritage:c("heritage",{title:"Search heritage collections",placeholder:"Search heritage collections...",helper:"",url:""})};function d(o){const a=l[o];a&&(s.value=o,t.forEach(i=>
2{i.dataset.searchType===o?(i.classList.add("active"),i.setAttribute("aria-pressed","true")):(i.classList.remove("active"),i.setAttribute("aria-pressed","false"))}),n.textContent=a.title,r.placeholder=a.placeholder,y(a.helper))}function y(o){const a=n.parentElement?.querySelector("[data-search-helper]");if(!o){a?.remove();return}if(a)a.textContent=o;else{const i=document.createElement("p");i.className="text-sm text-slate-600 mb-2",i.dataset.searchHelper="",i.textContent=o;const v=n.parentElement;v&&r.parentElement===v&&v.insertBefore(i,r)}}t.forEach(o=>{o.addEventListener("click",a=>{a.preventDefault();const i=o.dataset.searchType;i&&w(i)&&d(i)}),o.setAttribute("role","tab"),o.setAttribute("aria-pressed",o.classList.contains("active")?"true":"false")});const u={normal:["border-hcl-dark-gray","hover:border-hcl-pink","focus-within:border-hcl-purple"],error:["border-bad"]};function h(o){const a=r.closest(".flex.items-stretch");if(!a)return;a.classList.add(...u.error),a.classList.remove(...u.normal),r.setAttribute("aria-invalid","true"),r.setAttribute("aria-describedby","Query-error");let i=a.parentElement?.querySelector("#Query-error");i||(i=document.createElement("p"),i.id="Query-error",i.className="text-sm text-bad mt-2",a.parentElement?.appendChild(i)),i.textContent=o}function p(){const o=r.closest(".flex.items-stretch");if(!o)return;o.classList.remove(...u.error),o.classList.add(...u.normal),r.setAttribute("aria-invalid","false"),r.removeAttribute("aria-describedby"),o.parentElement?.querySelector("#Query-error")?.remove()}r.addEventListener("input",()=>{r.value.trim()&&p()}),e.addEventListener("submit",o=>{const a=s.value,i=r.value.trim();if(!i){o.preventDefault(),h("Please enter a search term"),r.focus();return}if(p(),!w(a)){o.preventDefault();return}if(a==="website")return;o.preventDefault();const L=l[a].url;if(!L)return;const T=L+encodeURIComponent(i);window.open(T,"_blank","noopener,noreferrer")}),d("website")}function G(){document.querySelectorAll("[data-search-form]").forEach(e=>{F(e)})}G();W();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.