1/*! 2 * patrol-shopify-theme-a11y v3.0.0 3 * https://github.com/Patrol-AI/patrol-shopify-theme-a11y#readme 4 * Built 2026-09-17T18:00:26.451Z 5 */ 6(function(){"use strict";function kn(e){if(typeof window>"u"||!window.fetch||window.fetch.__fetchInterceptorOriginal)return;const n=window.fetch.bind(window),r=(async(...i)=>{const d=await n(...i),p=i[0],g=typeof p=="string"?p:p instanceof URL?p.toString():p.url,A=d.clone();try{e.execute(g,A)}catch(w){console.warn("[fetch-interceptor]: Unexpected error:",w)}return d});r.__fetchInterceptorOriginal=n,window.fetch=r}class Rn{#e=[];constructor(){this.#e=[]}registerInterceptor(t){this.#e.push(t)}execute(t,n){Promise.all(this.#e.map(r=>r.interceptFetchRequest(t,n)))}}const It=new Rn;function $n(){kn(It)}const In=e=>{e.style.display="block",e.style.position="absolute",e.style.margin="-1px",e.style.border="0",e.style.padding="0",e.style.width="1px",e.style.height="1px",e.style.overflow="hidden",e.style.clipPath="inset(50%)",e.style.whiteSpace="nowrap"};var Nt=(e=>(e.STATUS="STATUS",e.ALERT="ALERT",e))(Nt||{});class Nn extends HTMLElement{#e=null;#t;constructor(t){super(),this.#t=t||"STATUS"}#n(t){const n=document.createElement("div"),r=this.getAttribute("announcer-id");return r&&(n.id=r),n.setAttribute("aria-atomic","true"),n.setAttribute("role",t==="ALERT"?"alert":"status"),In(n),n}#r(t){const n=this.#n(t);return this.#e=n,this.insertAdjacentElement("afterend",n),n}getAnnouncerEl(){return this.#e}announceUpdate(t){this.#e&&(this.#e.textContent=t)}connectedCallback(){(!this.#e||!this.#e.isConnected)&&(this.#e=this.#r(this.#t))}disconnectedCallback(){this.#e&&(this.#e.remove(),this.#e=null)}}const Dn=300,xn=4e3;class et extends Nn{#e=new Map;#t=null;#n=null;announce(t,n){this.#e.set(t,n),this.#r()}#r(){this.#t&&clearTimeout(this.#t),this.#n&&clearTimeout(this.#n),this.#t=setTimeout(()=>{this.#o()},Dn)}#o(){if(this.#e.size===0)return;const t=Array.from(this.#e.values());this.#e.clear(),super.announceUpdate(t.join(". ")),this.#n=setTimeout(()=>{super.announceUpdate("")},xn)}disconnectedCallback(){super.disconnectedCallback(),this.#t&&clearTimeout(this.#t),this.#n&&clearTimeout(this.#n),this.#e.clear()}}const tt=(e,t)=>{window.customElements.get(e)?console.warn(`[${e}]: Custom element already defined`):(window.customElements.define(e,t),console.log(`[${e}]: Successfully defined custom element`))},ke='input[name="quantity"]';class Mn extends et{constructor(){super(),this.handleQtyChange=this.handleQtyChange.bind(this),this.handlePlusBtn=this.handlePlusBtn.bind(this),this.handleMinusBtn=this.handleMinusBtn.bind(this)}handleQtyChange(t){const n=t.currentTarget.parentElement.parentElement.querySelector(ke).value;this.announce("CHANGE",`Quantity updated to ${n}`)}handlePlusBtn(t){const n=t.currentTarget.parentElement.parentElement.querySelector(ke).value;this.announce("CHANGE",`Quantity updated to ${+n}`)}handleMinusBtn(t){const n=t.currentTarget.parentElement.parentElement.querySelector(ke).value;this.announce("CHANGE",`Quantity updated to ${+n}`)}connectedCallback(){super.connectedCallback(),document.querySelectorAll(ke).forEach(n=>{n.addEventListener("change",this.handleQtyChange);const r=n.parentElement.querySelectorAll("button");r[0].addEventListener("click",this.handleMinusBtn),r[1].addEventListener("click",this.handlePlusBtn)})}disconnectedCallback(){super.disconnectedCallback(),document.querySelectorAll(ke).forEach(n=>{n.removeEventListener("change",this.handleQtyChange);const r=n.parentElement.querySelectorAll("button");r[0].removeEventListener("click",this.handleMinusBtn),r[1].removeEventListener("click",this.handlePlusBtn)})}}(async()=>{try{tt("qty-announcements",Mn),document.body.insertAdjacentHTML("beforeend","<qty-announcements></qty-announcements>"),console.log("[qty-announcements]: Successfully attached to current cart")}catch(e){console.warn("[qty-announcements]: Unable to attach to current cart",e)}})();var ye=(e=>(e.ADD_TO_CART="/cart/add",e.CART_CHANGED="/cart/change.js",e.CART_CHANGED_NO_EXT="/cart/change",e.CART_UPDATED="/cart/update",e.CART_LOADED="/cart.js",e))(ye||{}),ue=(e=>(e.ON_ADD_TO_CART="on:cart:add",e.ON_CART_LOADED="on:cart:loaded",e.ON_CART_ERROR="on:cart:error",e))(ue||{});const Pn=[ye.CART_LOADED,ye.CART_CHANGED,ye.CART_CHANGED_NO_EXT,ye.CART_UPDATED],Fn=["/cart.json"];class qn{async interceptFetchRequest(t,n){try{if(Fn.some(d=>t.includes(d)))return;const r=Pn.some(d=>t.includes(d)),i=t.includes(ye.ADD_TO_CART);if(!r&&!i)return;if(Hn(n)){await this.#e(t,n);return}if(r){const d=await n.json();document.dispatchEvent(new CustomEvent(ue.ON_CART_LOADED,{detail:{cart:d}}))}if(i){const d=await n.json();document.dispatchEvent(new CustomEvent(ue.ON_ADD_TO_CART,{detail:{cart:d}}))}}catch(r){console.warn("[cart-interceptor]: Failed to parse JSON response:",r)}}async#e(t,n){const r=await Un(n),i={status:n.status,url:t,description:r.description,message:r.message};console.warn(`[cart-interceptor]: Cart request failed with ${i.status}:`,t,r),document.dispatchEvent(new CustomEvent(ue.ON_CART_ERROR,{detail:i}))}}const Un=async e=>{try{const t=await e.json();return!t||typeof t!="object"?{}
6:{...t,description:typeof t.description=="string"?t.description:Bn(t.errors),message:typeof t.message=="string"?t.message:void 0}}catch{return{}}},Bn=e=>!e||typeof e!="object"?void 0:Object.values(e).flat().find(n=>typeof n=="string"&&n.length>0),Hn=e=>typeof e.status=="number"&&e.status>=400,Gn=()=>{It.registerInterceptor(new qn)};function Kn(e,t){return new Promise(n=>{const r=document.querySelector(e);if(r)return n(r);const i=new MutationObserver(d=>{if(!d.some(A=>A.type==="childList"&&A.addedNodes.length>0))return;const g=document.querySelector(e);g&&(i.disconnect(),n(g))});i.observe(document.body,{childList:!0,subtree:!0})})}const nt={UNPROCESSABLE:"Could not update your cart. The item may be sold out or unavailable in the requested quantity.",SERVER:"Something went wrong updating your cart. Please try again.",GENERIC:"Could not update your cart. Please try again."},Vn=({status:e,description:t})=>t?`Cart error: ${t}`:e===422?nt.UNPROCESSABLE:e>=500?nt.SERVER:nt.GENERIC;class jn extends et{constructor(){super(Nt.ALERT),this.handleCartAdd=this.handleCartAdd.bind(this),this.handleCartUpdate=this.handleCartUpdate.bind(this),this.handleCartError=this.handleCartError.bind(this)}handleCartAdd(t){const n=t.detail.cart;if(n?.items&&Array.isArray(n.items)){const i=n.items;if(i.length===1){const d=i[0],p=d.product_title||d.title||"Product";this.announce("cart",`${p} added to cart`)}else this.announce("cart",`${i.length} items added to cart`);return}const r=t.detail.cart;if(r?.product_title||r?.title){const i=r.product_title||r.title||"Product";this.announce("cart",`${i} added to cart`);return}this.announce("cart","Item added to cart")}handleCartUpdate(t){const n=t.detail.cart;if(n&&n.item_count!==void 0){const r=n.item_count;r===0?this.announce("cart","Cart is now empty"):this.announce("cart",`Cart updated. ${r} item${r!==1?"s":""} in cart`)}}handleCartError(t){const n=t.detail;n&&this.announce("cart-error",Vn(n))}connectedCallback(){super.connectedCallback(),document.addEventListener(ue.ON_ADD_TO_CART,this.handleCartAdd),document.addEventListener(ue.ON_CART_LOADED,this.handleCartUpdate),document.addEventListener(ue.ON_CART_ERROR,this.handleCartError)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(ue.ON_ADD_TO_CART,this.handleCartAdd),document.removeEventListener(ue.ON_CART_LOADED,this.handleCartUpdate),document.removeEventListener(ue.ON_CART_ERROR,this.handleCartError)}}const Wn=async e=>{try{tt("cart-announcements",jn);let t=e?await Kn(e):null;t||(t=document.body),t.insertAdjacentHTML("beforeend","<cart-announcements></cart-announcements>"),console.log("[cart-announcements]: Successfully attached to current cart")}catch(t){console.warn("[cart-announcements]: Unable to attach to current cart",t)}};Gn(),Wn();const zn="data-ally",ee=e=>`${zn}-${e}`,Dt=(e,t)=>{const{position:n}=window.getComputedStyle(e);return(!n||n==="static")&&e.classList.add(t),e},Re=(e,t)=>{if(document.getElementById(e))return;const n=document.createElement("style");n.id=e,n.textContent=t,document.head.appendChild(n)},Xn='<button class="patrol-play-pause" type="button" aria-pressed="true" aria-label="Play"><svg class="patrol-play-pause__icon patrol-play-pause__icon-play" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140"><title>Play icon</title><path fill-rule="evenodd" clip-rule="evenodd" fill="white" d="M70 140L70 140c-38.7 0-70-31.3-70-70l0 0C0 31.3 31.3 0 70 0l0 0c38.7 0 70 31.3 70 70l0 0C140 108.7 108.7 140 70 140z"/><polygon fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" points="57 50.9 57 89.4 88.5 70.2 "/></svg><svg class="patrol-play-pause__icon patrol-play-pause__icon-pause" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140"><title>Pause icon</title><path fill-rule="evenodd" clip-rule="evenodd" fill="white" d="M70 140L70 140c-38.7 0-70-31.3-70-70v0C0 31.3 31.3 0 70 0h0c38.7 0 70 31.3 70 70v0C140 108.7 108.7 140 70 140z"/><rect fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" x="56" y="50.8" width="8.8" height="38.5"/><rect fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" x="75.2" y="50.8" width="8.8" height="38.5"/></svg></button>',Yn='.patrol-play-pause.patrol-play-pause{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;margin:0;appearance:none;border:0;border-radius:50%;background:#fff;box-shadow:0 1px 4px #00000059;color:#000;cursor:pointer}.patrol-play-pause.patrol-play-pause:focus-visible{outline:2px solid #000;outline-offset:2px}.patrol-play-pause .patrol-play-pause__icon{display:block;width:34px;height:34px;pointer-events:none}.patrol-play-pause .patrol-play-pause__icon[aria-hidden=true]{display:none}.patrol-play-pause-host .patrol-play-pause--reveal{opacity:0;transition:opacity .15s ease-in-out}.patrol-play-pause-host:hover .patrol-play-pause--reveal,.patrol-play-pause-host:focus-within .patrol-play-pause--reveal,.patrol-play-pause-host .patrol-play-pause--reveal:focus-visible,.patrol-play-pause-host .patrol-play-pause--reveal[aria-pressed=true]{opacity:1}@media(hover:none){.patrol-play-pause-host .patrol-play-pause--reveal{opacity:1}}@media(prefers-reduced-motion:reduce){.patrol-play-pause-host .patrol-play-pause--reveal{transition:none}}@media(pointer:coarse){.patrol-play-pause.patrol-play-pause{width:32px;height:32px;min-width:32px;min-height:32px}.patrol-play-pause .patrol-play-pause__icon{width:24px;height:24px}.patrol-play-pause.patrol-play-pause:before{content:"";position:absolute;top:50%;left:50%;width:44px;height:44px;transform:translate(-50%,-50%)}}',Qn="patrol-play-pause-styles",xt="patrol-play-pause",Zn="patrol-play-pause__icon-play",Jn="patrol-play-pause__icon-pause",rt="patrol-play-pause-host",er="patrol-play-pause--reveal",tr=ee("play-state"),ot=new WeakSet,$e=(e,t,n
6)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},Mt=e=>Array.from(e.children).filter(t=>t.classList.contains(xt)),Pt=(e,t)=>{const{labels:n,position:r="afterbegin",reveal:i=!0,onToggle:d}=t;Re(Qn,Yn),e.classList.contains(rt)||(e.classList.add(rt),ot.add(e)),e.insertAdjacentHTML(r,Xn);const p=r==="afterbegin"?e.firstElementChild:e.lastElementChild;if(!p||!p.classList.contains(xt))throw new Error("[patrol-play-pause]: the control could not be inserted into the container");i&&p.classList.add(er);const g=p.querySelector(`.${Zn}`),A=p.querySelector(`.${Jn}`);let w=t.playing??!0;const f=()=>{$e(p,"aria-pressed",String(!w)),$e(p,"aria-label",w?n.pause:n.play),$e(p,tr,w?"playing":"paused"),$e(g,"aria-hidden",String(w)),$e(A,"aria-hidden",String(!w))},E=S=>{S.preventDefault(),w=!w,f(),d?.(w)};return p.addEventListener("click",E),f(),{button:p,playIcon:g,pauseIcon:A,isPlaying:()=>w,setState:S=>{S!==w&&(w=S,f())},destroy:()=>{p.removeEventListener("click",E),p.remove(),!Mt(e).length&&ot.has(e)&&(e.classList.remove(rt),ot.delete(e))}}},nr=".patrol-animated--relative{position:relative}.patrol-animated .patrol-animated__button{position:absolute;top:50%;transform:translateY(-50%);right:8px;z-index:2}",st=ee("animated-control"),rr=`[${st}]`,or="patrol-animated-styles",sr="patrol:animated-toggle",Ft="data-state",qt="patrol-animated",Ut="patrol-animated--relative",Me="patrol-animated__button",ar=[st],ir={play:"Start animation",pause:"Stop animation"},Pe=new WeakMap,at=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},cr=e=>e.getAttribute(st)?.trim()??"",lr=()=>{try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}
6,ur=(e={})=>{const{root:t=document,observe:n=!0,pauseForReducedMotion:r=!1}=e,i={...ir,...e.labels},d=Symbol("patrol-animated-control"),p=new Map,g=new Set,A=T=>{g.has(T)||(g.add(T),console.warn(`[patrol-animated-control]: ${T}`))},w=(T,m)=>{try{return Array.from(T.querySelectorAll(m))}catch{return A(`"${m}" is not a selector the browser can read`),[]}},f=(T,m)=>{try{return T.matches(m)}catch{return!1}},E=T=>T.classList.contains(Me)||!!T.closest(`.${Me}`),S=(T,m)=>{if(!m)return[T];const L=w(T,m).filter(U=>!E(U));if(f(T,m)&&L.unshift(T),L.length)return L;const N=w(document,m).filter(U=>!E(U));return N.length?(A(`"${m}" matches nothing inside the wrapper, so ${N.length} element(s) elsewhere on the page are being used instead. If that is not what you meant, check for a positional selector such as :last-child or :nth-child - the injected control is a child of the wrapper too`),N):(A(`nothing matches "${m}", so there is no animation to stop`),N)},k=(T,m)=>Array.from(p.values()).find(L=>L!==m&&L.touched.has(T)),P=T=>{if(!T.driving)return;const m=T.playing?"running":"paused";T.touched.forEach((L,N)=>{N.isConnected||T.touched.delete(N)}),S(T.container,T.selector).forEach(L=>{T.touched.has(L)||T.touched.set(L,k(L,T)?.touched.get(L)??L.style.animationPlayState),L.style.animationPlayState!==m&&(L.style.animationPlayState=m)})},K=T=>at(T.container,Ft,T.playing?"playing":"paused"),X=(T,m)=>{T.playing=m,T.driving=!0,T.control.setState(m),K(T),P(T),T.container.dispatchEvent(new CustomEvent(sr,{bubbles:!0,detail:{playing:m}}))},W=(T,m,L)=>{Pe.set(T,d),T.classList.add(qt),Dt(T,Ut);const N=L?L.ariaLive:T.getAttribute("aria-live");at(T,"aria-live","off"),Mt(T).filter(J=>J.classList.contains(Me)).forEach(J=>J.remove());const U=!(r&&lr()),G={container:T,selector:m,playing:U,driving:!1,touched:L?.touched??new Map,ariaLive:N,control:Pt(T,{labels:i,position:"beforeend",playing:U,onToggle:J=>X(G,J)})};return G.control.button.classList.add(Me),K(G),p.set(T,G),S(T,m),U||X(G,!1),G},H=T=>{T.touched.forEach((m,L)=>{const N=k(L,T);N?L.style.animationPlayState=N.playing?"running":"paused":m?L.style.animationPlayState=m:L.style.removeProperty("animation-play-state")}),T.touched.clear()},re=T=>{H(T),T.control.destroy(),T.container.classList.remove(qt,Ut),T.container.removeAttribute(Ft),T.ariaLive===null?T.container.removeAttribute("aria-live"):at(T.container,"aria-live",T.ariaLive),Pe.get(T.container)===d&&Pe.delete(T.container)},D=()=>{const T=new Set;t.querySelectorAll(rr).forEach(m=>{const L=p.get(m),N=cr(m),U=Pe.get(m);if(!L&&U&&U!==d){A("a second animated-control directive is running over the same markup - leaving that wrapper to the first");return}if(T.add(m),L&&L.selector===N&&L.control.button.isConnected){P(L);return}L&&(L.selector!==N&&H(L),L.control.destroy(),p.delete(m));const G=W(m,N,L);L&&!L.playing&&X(G,!1)}),p.forEach((m,L)=>{T.has(L)||(re(m),p.delete(L))})},V=new MutationObserver(D),j=()=>{if(Re(or,nr),D(),!n)return;const T=t instanceof Document?t.documentElement:t;T&&V.observe(T,{childList:!0,subtree:!0,attributes:!0,attributeFilter:ar})};return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",j,{once:!0}):j(),{sync:D,toggle:(T,m)=>{const L=p.get(T);return L?(X(L,m??!L.playing),!0):!1},isPlaying:T=>p.get(T)?.playing??null,destroy:()=>{document.removeEventListener("DOMContentLoaded",j),V.disconnect(),p.forEach(re),p.clear(),g.clear()}}};(e=>{try{const t=ur(e);return console.log("[patrol-animated-control]: Animations that asked for a control were given one."),t}catch(t){return console.warn("[patrol-animated-control]: Unable to add controls to the animations that asked for one",t),null}})();const Ie=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","details > summary:first-of-type","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(", "),ge=`${Ie}, [tabindex]`,dr=e=>{if(e.getClientRects().length===0)return!1;const t=getComputedStyle(e);return t.visibility!=="hidden"&&t.contentVisibility!=="hidden"},fr=e=>{for(let t=e.closest("fieldset[disabled]");t;t=pr(t)){const n=Array.from(t.children).find(r=>r.tagName==="LEGEND");if(!n||!n.contains(e))return!0}return!1},pr=e=>e.parentElement?.closest("fieldset[disabled]")??null,hr=e=>{if(!(e instanceof HTMLInputElement)||e.type!=="radio"||e.checked||!e.name)return!1;const n=(e.form??e.ownerDocument).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}
6"]`);return Array.from(n).some(r=>r.checked)},mr=e=>Array.from(e.children).find(t=>t.tagName==="SUMMARY")??null,it=e=>{if(e.closest('[inert], [hidden], [aria-hidden="true"]')||fr(e))return!1;const t=e.closest("details:not([open])");return t&&e!==mr(t)?!1:dr(e)},br=e=>{const t=e.getAttribute("tabindex");if(t===null)return null;const n=Number.parseInt(t,10);return Number.isNaN(n)?null:n},Bt=e=>{const t=br(e);if(t!==null){if(t<0)return!1}else if(!e.matches(Ie))return!1;return it(e)&&!hr(e)},Ht=e=>Array.from(e.querySelectorAll(ge)).filter(Bt),Ne=e=>Array.from(e.querySelectorAll(ge)).find(Bt)??null,Er=".patrol-carousel--relative{position:relative}.patrol-carousel__tablist [role=tab]:focus-visible{outline:2px solid currentColor;outline-offset:-3px}.patrol-carousel__tablist [role=tab]:focus{outline:2px solid currentColor;outline-offset:-3px}.patrol-carousel__tablist [role=tab]:focus:not(:focus-visible){outline:none}.patrol-carousel__rotation{position:absolute;top:8px;left:8px;z-index:11;display:flex;align-items:center;justify-content:center;width:32px;height:32px;margin:0;border:1px solid rgba(0,0,0,.15);border-radius:50%;padding:0;background:#ffffffe6;color:#1a1a1a;cursor:pointer}.patrol-carousel__rotation:focus-visible{outline:2px solid currentColor;outline-offset:2px}.patrol-carousel__rotation-icon{display:block}.patrol-carousel__rotation[data-ally-rotation-state=playing] .patrol-carousel__rotation-icon{box-sizing:border-box;width:12px;height:13px;border-left:4px solid currentColor;border-right:4px solid currentColor}.patrol-carousel__rotation[data-ally-rotation-state=paused] .patrol-carousel__rotation-icon{width:0;height:0;margin-left:2px;border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:12px solid currentColor}",Ae=ee("carousel"),ae=ee("carousel-thumbs"),ct=ee("carousel-rotation"),Gt=ee("carousel-label"),yr=`[${Ae}]`,gr="swiper",Kt=["slideChange","activeIndexChange","realIndexChange","transitionEnd","update","observerUpdate","resize","autoplayStart","autoplayStop","autoplayPause","autoplayResume"],lt=e=>{const t=e.swiper;return!t||t.destroyed||!t.el||!t.wrapperEl||!t.slides||typeof t.on!="function"||typeof t.slideTo!="function"?null:t},ut=e=>Array.from(e.slides??[]),Vt=(e,t)=>{const n=e.getAttribute("data-swiper-slide-index");if(n!==null){const r=Number.parseInt(n,10);if(!Number.isNaN(r))return r}return t},Ar=(e,t)=>{const n=[];e.forEach((i,d)=>{const p=Vt(i,d);p>=0&&p<t&&!n[p]&&(n[p]=i)});const r=[];for(let i=0;i<t&&n[i];i+=1)r.push(n[i]);return r},vr=e=>{const t=e.params?.autoplay;return t?typeof t=="boolean"?t:t.enabled!==!1:!1},jt=e=>{const{params:t}=e;if(typeof t.a11y=="object"&&t.a11y){if(t.a11y.enabled===!1)return;t.a11y.enabled=!1}else if(t.a11y===!0)t.a11y={enabled:!1};else return;try{e.a11y?.destroy?.()}catch{}e.el.querySelectorAll(".swiper-notification").forEach(n=>n.remove()),ut(e).forEach(n=>{n.removeAttribute("role"),n.removeAttribute("aria-label"),n.removeAttribute("aria-roledescription")})},Sr=(e,t)=>{const n=e.thumbs?.swiper;if(n&<(n.el))return n;const r=t.thumbsSelector;if(!r)return null;let i=null;try{i=document.querySelector(r)}catch{return t.warn(`${ae}="${r}" is not a valid selector`),null}if(!i)return t.warn(`${ae}="${r}" matched nothing`),null;const d=lt(i);return d||(t.warn(`${ae}="${r}" is not an initialised Swiper`),null)},wr=e=>vr(e)?{control:null,labelled:!1,managesSuspension:!1,isRotating:()=>!!(e.autoplay?.running&&!e.autoplay.paused),start:()=>{const{autoplay:t}=e;t?.running&&t.paused?t.resume?.():t?.running||t?.start?.()},stop:()=>{e.autoplay?.running&&e.autoplay.stop?.()},suspend:()=>{const{autoplay:t}=e;!t?.running||t.paused||(typeof t.pause=="function"?t.pause():t.stop?.())},resume:()=>{const{autoplay:t}=e;t?.running&&t.paused?t.resume?.():t?.running||t?.start?.()}}:null,Tr={name:gr,read:(e,t)=>{const n=lt(e);if(!n)return null;const r=Sr(n,t),i=ut(n),d=i.map(Vt),p=d.reduce((E,S)=>Math.max(E,S+1),0),g=r?ut(r):[],A=Ar(g,p);r&&A.length!==p&&t.warn(`carousel has ${p} slides but ${A.length} thumbnails - the extra ones are not wired`);const w=r?.params.direction??n.params.direction;return{instance:n,root:e,track:n.wrapperEl,frame:n.el,slides:i,positions:d,total:p,current:()=>n.realIndex,tablist:r?r.wrapperEl:null,thumbs:A,thumbsRoot:r?r.el:null,vertical:w==="vertical",managesHidden:!1,parkSelector:ge,managesLiveRegion:!1,managesSlideLabels:!1,rotation:wr(n),goTo:E=>{n.params.loop&&typeof n.slideToLoop=="function"?n.slideToLoop(E):n.slideTo(E)},guardFocusScroll:!n.params.cssMode,frames:r?[n.el,r.el]:[n.el],releaseA11y:()=>{jt(n),r&&jt(r)},watch:(E,S)=>(Kt.forEach(k=>n.on(k,E)),n.on("destroy",S),()=>{Kt.forEach(k=>n.off(k,E)),n.off("destroy",S)})}}},Lr="splide",Cr="is-initialized",Fe=".splide__track",Wt=".splide__list",zt="splide__slide",_r="splide__slide--clone",dt="is-active",Or=".
6splide__toggle",kr="splide--nav",Rr="splide--ttb",$r=e=>{const t=e.splide;return!t||t.root!==e||typeof t.go!="function"||typeof t.on!="function"||!t.Components?null:t},qe=e=>e.querySelector(`:scope > ${Fe}`)??e.querySelector(Fe),Ue=e=>e.querySelector(`:scope > ${Wt}`)??e.querySelector(Wt),ve=e=>Array.from(e.children).filter(t=>t.classList.contains(zt)),he=e=>e.classList.contains(_r),Ir=e=>{const t=qe(e),n=t?Ue(t):null;return n?ve(n).filter(r=>!he(r)):[]},Xt=(e,t)=>{const n=e.findIndex(i=>!he(i));let r=0;return e.map((i,d)=>he(i)?d<n?(t-n+d+t)%t:(d-n)%t:r++)},Nr=(e,t)=>{const n=e.findIndex(i=>i.classList.contains(dt)&&!he(i));if(n!==-1)return t[n];const r=e.findIndex(i=>i.classList.contains(dt));return r===-1?0:t[r]},Dr=(e,t,n)=>{const r=[e.parentElement,e.parentElement?.parentElement];for(const i of r){if(!i)continue;const d=Array.from(i.querySelectorAll(`.${kr}`)).filter(g=>g!==e&&!g.contains(e)&&!e.contains(g));if(!d.length)continue;const p=d.filter(g=>Ir(g).length===t);return p.length===1?p[0]:(n.warn(`found ${d.length} thumbnail strips near this carousel and none of them names it - add ${ae}="<selector>" to say which one is its own`),null)}return null},xr=(e,t,n,r)=>{const i=new Set(t.map(E=>E.id).filter(Boolean));if(i.size){const E=Array.from(document.querySelectorAll(`.${zt}[aria-controls]`)).filter(k=>{const P=k.getAttribute("aria-controls")?.trim();return!!P&&P.split(/\s+/).some(K=>i.has(K))}),S=E.find(k=>!t.includes(k))?.parentElement;if(S)return{list:S,thumbs:E.filter(k=>k.parentElement===S&&!he(k))}}const d=Dr(e,n,r);if(d){const E=qe(d),S=E?Ue(E):null;if(S)return{list:S,thumbs:ve(S).filter(k=>!he(k))}}const p=r.thumbsSelector;if(!p)return null;let g=null;try{g=document.querySelector(p)}catch{return r.warn(`${ae}="${p}" is not a valid selector`),null}if(!g)return r.warn(`${ae}="${p}" matched nothing`),null;const w=qe(g),f=w?Ue(w):null;return f?{list:f,thumbs:ve(f).filter(E=>!he(E))}:(r.warn(`${ae}="${p}" is not an initialised Splide`),null)},Mr=(e,t,n)=>t?!!t.options.autoplay:n?!0:e.getAttribute("aria-live")==="off",Pr=(e,t,n,r)=>{const i=e.querySelector(Or);if(!Mr(t,n,i))return null;const d={managesSuspension:!0,suspend:()=>{},resume:()=>{}};if(i){const g=()=>i.classList.contains(dt);return{...d,control:i,labelled:!0,isRotating:g,start:()=>{g()||i.click()},stop:()=>{g()&&i.click()}}}const p=n?.Components.Autoplay;return p?{...d,control:null,labelled:!1,isRotating:()=>!p.isPaused?.(),start:()=>p.play?.(),stop:()=>p.pause?.()}:(r.warn('splide carousel rotates by itself and cannot be stopped from here - ship a <button class="splide__toggle"> inside it, or put the instance on its root with `root.splide = splide`'),null)},Fr={name:Lr,read:(e,t)=>{if(!e.classList.contains(Cr))return null;const n=qe(e),r=n?Ue(n):null;if(!n||!r)return null;const i=ve(r);if(!i.length)return null;const d=i.filter(f=>!he(f)).length;if(!d)return null;const p=Xt(i,d),g=xr(e,i,d,t),A=$r(e);return g&&g.thumbs.length!==d&&t.warn(`carousel has ${d} slides but ${g.thumbs.length} thumbnails - the extra ones are not wired`),{instance:A,root:e,track:n,frame:n,slides:i,positions:p,total:d,current:()=>A?A.index:Nr(ve(r),Xt(ve(r),d)),tablist:g?g.list:null,thumbs:g?g.thumbs.slice(0,d):[],thumbsRoot:g?.list.closest(".splide")??g?.list??null,vertical:(g?.list.closest(".splide")??e).classList.contains(Rr),managesHidden:!0,parkSelector:null,managesLiveRegion:!0,managesSlideLabels:!0,rotation:Pr(e,n,A,t),goTo:f=>A?.go(f),guardFocusScroll:!0,frames:g?.list.closest(Fe)?[n,g.list.closest(Fe)]:[n],releaseA11y:()=>{g?.thumbs.forEach(E=>{E.removeAttribute("aria-current"),E.removeAttribute("aria-label"),E.removeAttribute("aria-hidden")});const f=g?.list.closest(".splide");f&&f!==e&&(f.getAttribute("role")==="region"&&f.removeAttribute("role"),f.removeAttribute("aria-roledescription"))},watch:(f,E)=>{const S=new MutationObserver(f);return S.observe(n,{attributes:!0,attributeFilter:["class"],subtree:!0}),A?(A.on("destroyed",E),()=>{S.disconnect(),A.off("destroyed",E)}):()=>S.disconnect()}}}},qr="slick",Ur="slick-initialized",Br=".slick-slide",Hr="slick-cloned",Gr=".slick-track",Kr=".slick-dots",Vr=["textarea:not([disabled])","iframe","object","embed","audio[controls]","video[controls]","details > summary:first-of-type","area[href]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]:not
6(a):not(input):not(button):not(select)"].join(", "),be=e=>e&&e.length?e[0]:null,ft=e=>{if(!e.classList.contains(Ur))return null;const t=e.slick;return!t||t.unslicked||typeof t.slickGoTo!="function"||!t.$list||!t.$slideTrack?null:t},Be=e=>Array.from(e.querySelectorAll(Br)),pt=e=>e.classList.contains(Hr),jr=(e,t,n)=>{const r=e.getAttribute("data-slick-index");if(r===null)return t%n;const i=Number.parseInt(r,10);return Number.isNaN(i)?t%n:(i%n+n)%n},Wr=(e,t,n)=>{const{asNavFor:r}=e.options;if(r){const w=typeof r=="string"?document.querySelector(r):be(r),f=w?ft(w):null,E=f?be(f.$slideTrack):null;if(f&&E)return{root:w,list:E,thumbs:Be(E).filter(S=>!pt(S)),vertical:!!f.options.vertical};n.warn(`asNavFor points at ${typeof r=="string"?r:"an element"} which is not an initialised Slick`)}const i=be(e.$dots)??t.querySelector(Kr);if(i)return{root:i,list:i,thumbs:Array.from(i.children).filter(w=>w instanceof HTMLElement),vertical:!1};const d=n.thumbsSelector;if(!d)return null;let p=null;try{p=document.querySelector(d)}catch{return n.warn(`${ae}="${d}" is not a valid selector`),null}if(!p)return n.warn(`${ae}="${d}" matched nothing`),null;const g=ft(p),A=g?be(g.$slideTrack):p.querySelector(Gr);return A?{root:p,list:A,thumbs:Be(A).filter(w=>!pt(w)),vertical:!!g?.options.vertical}:(n.warn(`${ae}="${d}" is not an initialised Slick`),null)},zr=(e,t)=>{const n=be(e.$slideTrack);n?.getAttribute("role")==="listbox"&&n.removeAttribute("role"),t.forEach(r=>{r.querySelector('img[alt]:not([alt=""])')&&(r.removeAttribute("aria-label"),r.querySelectorAll("button, a").forEach(p=>p.removeAttribute("aria-label"))),(r.getAttribute("role")==="presentation"||r.tagName==="LI")&&r.removeAttribute("aria-selected");const d=r.getAttribute("aria-controls");d&&!document.getElementById(d)&&r.removeAttribute("aria-controls")})},Xr=e=>{if(!e.options.autoplay)return null;const t=e.options.pauseOnHover!==!1&&e.options.pauseOnFocus!==!1,n=()=>e.slickPause?.(),r=()=>e.slickPlay?.();return{control:null,labelled:!1,managesSuspension:t,isRotating:()=>!e.paused,start:r,stop:n,suspend:n,resume:r}},Yr={name:qr,read:(e,t)=>{const n=ft(e);if(!n)return null;const r=be(n.$slideTrack),i=be(n.$list);if(!r||!i)return null;const d=n.slideCount||Be(r).filter(f=>!pt(f)).length;if(!d)return null;const p=Be(r),g=p.map((f,E)=>jr(f,E,d)),A=Wr(n,e,t);return A&&A.thumbs.length!==d&&t.warn(`carousel has ${d} slides but ${A.thumbs.length} thumbnails - the extra ones are not wired`),{instance:n,root:e,track:i,frame:i,slides:p,positions:g,total:d,current:()=>n.currentSlide,tablist:A?A.list:null,thumbs:A?A.thumbs.slice(0,d):[],thumbsRoot:A?A.root:null,vertical:A?A.vertical:!!n.options.vertical,managesHidden:!0,parkSelector:Vr,managesLiveRegion:!1,managesSlideLabels:!1,rotation:Xr(n),goTo:f=>n.slickGoTo(f),guardFocusScroll:!0,frames:[i],releaseA11y:()=>zr(n,A?.thumbs??[]),watch:f=>{const E=new MutationObserver(f);return E.observe(i,{attributes:!0,attributeFilter:["class"],subtree:!0}),A&&E.observe(A.list,{attributes:!0,attributeFilter:["class","aria-selected"],subtree:!0}),()=>E.disconnect()}}}},Qr="flickity",He="flickity-enabled",Zr=".flickity-viewport",Jr=".flickity-slider",eo=".flickity-page-dots",to="is-selected",no="is-nav-selected",Yt=["select","settle","cellChange","resize"],Qt=["pointerDown","uiChange"],Zt=["deactivate","destroy"],ro=(e,t)=>{const n=e;return!n||n.element!==t||n.isActive===!1?!1:Array.isArray(n.cells)&&typeof n.selectCell=="function"&&typeof n.on=="function"},ht=e=>{const{Flickity:t,jQuery:n}=window,r=[()=>e.flickity,()=>t?.data?.(e),()=>n?.data?.(e,"flickity")];for(const i of r){let d;try{d=i()}catch{continue}if(ro(d,e))return d}return null},mt=(e,t)=>e.querySelector(`:scope > ${t}`)??e.querySelector(t),Jt=(e,t)=>{if(t?.slider&&t.viewport)return{viewport:t.viewport,slider:t.slider};const n=mt(e,Zr),r=n?mt(n,Jr):null;return n&&r?{viewport:n,slider:r}:null},bt=(e,t)=>t?t.cells.map(n=>n.element):Array.from(e.children).filter(n=>n instanceof HTMLElement),oo=(e,t)=>{if(t){const n=t.selectedCells?.[0]??t.selectedCell,r=n?t.cells.indexOf(n):-1;return Math.max(r,0)}return Math.max(bt(e,null).findIndex(n=>n.classList.contains(to)),0)},so=(e,t)=>{const n=t?.pageDots?.holder??mt(e,eo);if(!n?.isConnected)return null;const r=Array.from(n.children).filter(i=>i instanceof HTMLElement);return r.length?{holder:n,dots:r}:null},ao=e=>{if(!e)return null;if(e instanceof Element)return e;try{return document.querySelector(e)}catch{return null}},en=e=>{const t=ht(e),n=Jt(e,t);return n?{list:n.slider,root:e,thumbs:bt(n.slider,t),nav:{root:e,...n}}:null},io=(e,t)=>{for(const n of Array.from(document.querySelectorAll(`.${He}`))){if(n===e||n.contains(e)||e.contains(n))continue;const r=ht(n);if(r&&(r.navCompanion===t||ao(r.options.asNavFor)===e))return en(n)}return null},co=(e,t,n,r,i)=>{const d=i.thumbsSelector;if(d){let g=null;try{g=document.querySelector(d)}catch{return i.warn(`${ae}="${d}" is not a valid selector`),null}return g?g.classList.contains(He)?en(g):{list:g,root:g,thumbs:Array.from(g.children).filter(A=>A instanceof HTMLElement),nav:null}:(i.warn(`${ae}="${d}" matched nothing`),null)}const p=t?io(e,t):null;return p||(n&&n.dots.length===r?{list:n.holder,root:n.holder,thumbs:n.dots,nav:null}:null)},tn=e=>
6{e.thumbs.forEach(t=>{e.nav&&t.removeAttribute("aria-hidden"),t.removeAttribute("aria-current")}),e.nav?.root.getAttribute("tabindex")==="0"&&e.nav.root.removeAttribute("tabindex")},Ge=new WeakSet,lo=e=>{if(!e?.options.autoPlay||!e.player)return null;const t=()=>e.player?.state;return{control:null,labelled:!1,managesSuspension:!1,isRotating:()=>t()==="playing",wanted:()=>t()==="playing"?!0:t()!=="stopped"?null:(Ge.delete(e),!1),start:()=>{Ge.has(e)||e.playPlayer?.()},stop:()=>e.stopPlayer?.(),suspend:()=>{t()==="stopped"&&!Ge.has(e)&&e.playPlayer?.(),e.pausePlayer?.()},resume:()=>e.unpausePlayer?.()}},uo={name:Qr,read:(e,t)=>{if(!e.classList.contains(He))return null;const n=ht(e),r=Jt(e,n);if(!r)return null;const{viewport:i,slider:d}=r,p=bt(d,n),g=p.length;if(!g)return null;const A=so(e,n);let w=co(e,n,A,g,t);const f=!!n||A?.dots.length===g;w?.nav&&!f&&(w=null),!n&&!t.thumbsSelector&&Array.from(document.querySelectorAll(`.${He} .${no}`)).some(P=>!e.contains(P))&&t.warn("flickity carousel has no reachable instance, so a thumbnail strip paired with asNavFor cannot be wired and autoplay cannot be stopped - load Flickity as a global, or put the instance on its root with `root.flickity = flkty`"),w&&w.thumbs.length!==g&&t.warn(`carousel has ${g} slides but ${w.thumbs.length} thumbnails - the extra ones are not wired`);const E=w?.nav?.viewport;return{instance:n,root:e,track:d,frame:i,slides:p,positions:p.map((k,P)=>P),total:g,current:()=>oo(d,n),tablist:w?w.list:null,thumbs:w?w.thumbs.slice(0,g):[],thumbsRoot:w?w.root:null,vertical:!1,managesHidden:!0,parkSelector:ge,managesLiveRegion:!1,managesSlideLabels:!1,rotation:lo(n),goTo:k=>{n?n.selectCell(k):A?.dots.length===g&&A.dots[k]?.click()},guardFocusScroll:!0,frames:E?[i,E]:[i],releaseA11y:()=>{w&&tn(w)},watch:(k,P)=>{const K=new MutationObserver(k);K.observe(d,{attributes:!0,attributeFilter:["class","aria-hidden"],childList:!0,subtree:!0});const X=w?.nav?new MutationObserver(()=>{w&&tn(w)}):null;w?.nav&&X?.observe(w.nav.slider,{attributes:!0,attributeFilter:["aria-hidden"],subtree:!0});const W=()=>{n?.player?.state==="stopped"&&Ge.add(n),k()};return Yt.forEach(H=>n?.on(H,k)),Qt.forEach(H=>n?.on(H,W)),Zt.forEach(H=>n?.on(H,P)),()=>{K.disconnect(),X?.disconnect(),Yt.forEach(H=>n?.off(H,k)),Qt.forEach(H=>n?.off(H,W)),Zt.forEach(H=>n?.off(H,P))}}}}},fo="scroll-snap",po=2,nn=32,ho=["auto","scroll"],rn='button, a[href], [role="button"], [role="tab"], [role="link"]',Ee=e=>Array.from(e.children).filter(t=>t instanceof HTMLElement),mo=e=>`<${e.tagName.toLowerCase()}${e.className?` class="${e.className}"`:""}>`,bo=e=>{const t=[e];let n=[e];for(let r=0;r<po&&t.length<nn;r+=1){const i=[];n.forEach(d=>i.push(...Ee(d).filter(p=>!p.hasAttribute(Ae)))),t.push(...i),n=i}return t.slice(0,nn)},Eo=e=>{let t=null;for(const n of bo(e)){const r=window.getComputedStyle(n),i=r.scrollSnapType;if(i&&i!=="none")return n;!t&&[r.overflowX,r.overflowY,r.overflow].some(d=>ho.includes(d))&&(t=n)}return t??e},yo=e=>{const t=e[0].getBoundingClientRect(),n=e[e.length-1].getBoundingClientRect(),r=n.left-t.left,i=n.top-t.top,d=Math.abs(i)>Math.abs(r);return{vertical:d,reversed:!d&&r<0}},on=(e,t)=>{const n=Ee(e);return n.length!==t?!1:n.every(r=>!!r.querySelector("img")||r.matches(rn)||!!r.querySelector(rn))},go=(e,t)=>{if(t<2||!e.parentElement)return null;for(const n of Ee(e.parentElement))if(n!==e){if(on(n,t))return n;for(const r of Ee(n))if(on(r,t))return r}return null},sn=new WeakSet,Ao=(e,t,n)=>{const r=n.thumbsSelector;if(!r){if(!sn.has(e)){sn.add(e);const p=go(e,t);p&&n.warn(`scroll-snap carousel has what looks like a thumbnail strip beside it (${mo(p)}), and a scroll container says nothing about which strip is its own - pair it with ${ae}="<selector>"`)}return null}let i=null;try{i=document.querySelector(r)}catch{return n.warn(`${ae}="${r}" is not a valid selector`),null}if(!i)return n.warn(`${ae}="${r}" matched nothing`),null;const d=Ee(i);return d.length?(d.length!==t&&n.warn(`carousel has ${t} slides but ${d.length} thumbnails - the extra ones are not wired`),{list:i,root:i,thumbs:d}):(n.warn(`${ae}="${r}" has nothing in it to make tabs of`),null)},vo=[Tr,Fr,Yr,uo,{name:fo,sniffable:!1,read:(e,t)=>{const n=Eo(e),r=Ee(n),i=r.length;if(!i)return null;const{vertical:d,reversed:p}=yo(r),g=f=>d?f.top:p?f.right:f.left,A=Ao(e,i,t);return{instance:null,root:e,track:n,frame:n,slides:r,positions:r.map((f,E)=>E),total:i,current:()=>{const f=g(n.getBoundingClientRect());let E=0,S=1/0;return r.forEach((k,P)=>{const K=Math.abs(g(k.getBoundingClientRect())-f);K<S&&(S=K,E=P)}),E},tablist:A?A.list:null,thumbs:A?A.thumbs.slice(0,i):[],thumbsRoot:A?A.root:null,vertical:d,managesHidden:!1,parkSelector:ge,managesLiveRegion:!1,managesSlideLabels:!1,rotation:null,goTo:f=>{const E=r[f];if(!E)return;const S=g(E.getBoundingClientRect())-g(n.getBoundingClientRect());S&&(d?n.scrollTop+=S:n.scrollLeft+=S)},guardFocusScroll:!1,frames:[],releaseA11y:()=>{},watch:(f,E,S)=>{n.addEventListener("scroll",f,{passive:!0});const k=typeof ResizeObserver=="function"?new ResizeObserver(S):null,P=new Set,K=()=>
6{if(!k)return;const W=new Set(Ee(n));P.forEach(H=>{W.has(H)||(k.unobserve(H),P.delete(H))}),W.forEach(H=>{P.has(H)||(k.observe(H),P.add(H))})};k?.observe(n),K();const X=new MutationObserver(()=>{K(),f()});return X.observe(n,{childList:!0}),()=>{n.removeEventListener("scroll",f),X.disconnect(),k?.disconnect()}}}}}],So="patrol-carousel-styles",wo="patrol:carousel-change",To="patrol:carousel-rotation",Lo="patrol-carousel-slide-",Co="patrol-carousel-tab-",_o="patrol-carousel-label-",Oo="patrol-carousel__tablist",ko="patrol-carousel__rotation",Ro="patrol-carousel--relative",$o='h1, h2, h3, h4, h5, h6, [role="heading"]',De=ee("carousel-tabindex"),Io=ee("rotation-state"),No=[Ae,ae],Do=["class",Ae,ae],oe=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},an=(e,t)=>{e.hasAttribute(t)&&e.removeAttribute(t)},Et=(e,t,n)=>{if(e.id)return e.id;const r=`${t}${n}`;let i=r;for(let d=2;document.getElementById(i);d+=1)i=`${r}-${d}`;return e.id=i,i},xo=e=>e.getAttribute("aria-label")?.trim()||e.getAttribute("aria-labelledby")?.trim()||e.textContent?.trim()||e.getAttribute("title")?.trim()?!0:Array.from(e.querySelectorAll("img")).some(t=>t.getAttribute("alt")?.trim()),Mo=e=>`<${e.tagName.toLowerCase()}${e.className?` class="${e.className}"`:""}>`,Po={tablist:"Slides",tab:e=>`Slide ${e}`,slide:(e,t)=>`${e} of ${t}`,play:"Start automatic slide show",pause:"Stop automatic slide show"},yt=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]),Fo=(e={})=>{const{root:t=document,observe:n=!0,hideOffscreenSlides:r=!0,rotationControl:i=!0,preventFocusScroll:d=!0}=e,p={...Po,...e.labels},g=[...vo,...e.engines??[]],A=new Map,w=new WeakSet,f=new WeakSet,E=new Set,S=s=>{E.has(s)||(E.add(s),console.warn(`[patrol-carousel]: ${s}`))},k=s=>{const{root:b}=s;oe(b,"aria-roledescription","carousel");let _=!!(b.getAttribute("aria-label")?.trim()||b.getAttribute("aria-labelledby")?.trim());if(!_){const x=b.getAttribute(Gt)?.trim(),q=b.previousElementSibling?.matches($o)?b.previousElementSibling:null;x?(oe(b,"aria-label",x),_=!0):q&&(oe(b,"aria-labelledby",Et(q,_o,A.size)),_=!0)}_&&b.tagName!=="SECTION"&&oe(b,"role","region"),!_&&(oe(b,"role","group"),S(`carousel has no accessible name - add aria-label or ${Gt} to ${Mo(b)}`))},P=s=>{s.model.managesLiveRegion||oe(s.model.track,"aria-live",s.model.rotation?.isRotating()?"off":"polite")},K=s=>{if(s.model.managesHidden)return s.model.slides.filter(x=>x.getAttribute("aria-hidden")!=="true");const b=s.model.frame.getBoundingClientRect();if(b.width>0&&b.height>0){const x=s.model.slides.filter(q=>{const F=q.getBoundingClientRect();if(F.width<=0||F.height<=0)return!1;const a=Math.min(F.right,b.right)-Math.max(F.left,b.left),h=Math.min(F.bottom,b.bottom)-Math.max(F.top,b.top);return a>F.width/2&&h>F.height/2});if(x.length)return x}const _=s.model.current();return s.model.slides.filter((x,q)=>s.model.positions[q]===_)},X=(s,b)=>{if(!b||Ne(s)){f.has(s)&&(s.removeAttribute("tabindex"),f.delete(s));return}s.hasAttribute("tabindex")&&!f.has(s)||(oe(s,"tabindex","0"),f.add(s))},W=(s,b,_)=>{s.querySelectorAll(_).forEach(x=>{if(b){if(!x.hasAttribute(De))return;const q=x.getAttribute(De);q?oe(x,"tabindex",q):x.removeAttribute("tabindex"),x.removeAttribute(De);return}x.hasAttribute(De)||(x.setAttribute(De,x.getAttribute("tabindex")??""),oe(x,"tabindex","-1"))})},H=s=>{const{model:b}=s,_=r&&(!b.managesHidden||!!b.parkSelector),x=_?K(s):[];b.slides.forEach((q,F)=>{const a=b.positions[F]+1;if(Et(q,Lo,a),oe(q,"role","tabpanel"),b.managesSlideLabels||(oe(q,"aria-roledescription","slide"),oe(q,"aria-label",p.slide(a,b.total))),!_)return;const h=x.includes(q);b.managesHidden||(h?an(q,"aria-hidden"):oe(q,"aria-hidden","true")),b.parkSelector&&W(q,h,b.parkSelector),X(q,h)})},re=s=>{const b=s.querySelectorAll(Ie);return b.length===1?b[0]:s},D=(s,b)=>{for(let _=s.parentElement;_&&_!==b;_=_.parentElement)_.hasAttribute("role")||oe(_,"role","presentation")},V=s=>{const{tablist:b}=s.model;b&&(oe(b,"role","tablist"),b.classList.add(Oo),!b.getAttribute("aria-label")?.trim()&&!b.getAttribute("aria-labelledby")?.trim()&&oe(b,"aria-label",p.tablist),s.model.vertical?oe(b,"aria-orientation","vertical"):an(b,"aria-orientation"),s.tabs.forEac
6h((_,x)=>{Et(_,Co,x+1),oe(_,"role","tab");const q=s.panels[x]??[];q.length&&oe(_,"aria-controls",q.map(F=>F.id).join(" ")),xo(_)||oe(_,"aria-label",p.tab(x+1,s.model.total)),_.tagName==="BUTTON"?_.hasAttribute("type")||oe(_,"type","button"):_.tagName==="A"&&_.removeAttribute("href"),D(_,b)}))},j=(s,b)=>{const _=s.selected;s.selected=b,s.tabs.forEach((x,q)=>{const F=q===b;oe(x,"aria-selected",String(F)),x.tabIndex=F?0:-1,w.add(x)}),!(_===b||_===-1)&&s.root.dispatchEvent(new CustomEvent(wo,{bubbles:!0,detail:{index:b,previous:_,total:s.model.total,tab:s.tabs[b]??null,slide:s.panels[b]?.[0]??null,slides:s.panels[b]??[]}}))},T=(s,b,_)=>{const x=s.tabs[b];if(!x)return;_&&x.focus({preventScroll:!0});const q=s.model.current();x.click(),s.model.current()===q&&s.model.goTo(b),j(s,b)},m=s=>b=>{const _=b.target?.closest('[role="tab"]'),x=_?s.tabs.indexOf(_):-1;x!==-1&&(b.preventDefault(),j(s,x))},L=(s,b)=>{s.tabs.length&&T(s,(b+s.tabs.length)%s.tabs.length,!0)},N=s=>b=>{const _=b.target?.closest('[role="tab"]'),x=_?s.tabs.indexOf(_):-1;if(x===-1)return;const q=s.model.vertical?"ArrowDown":s.rtl?"ArrowLeft":"ArrowRight",F=s.model.vertical?"ArrowUp":s.rtl?"ArrowRight":"ArrowLeft";let a=!0;switch(b.key){case q:L(s,x+1);break;case F:L(s,x-1);break;case"Home":L(s,0);break;case"End":L(s,s.tabs.length-1);break;case"Enter":case" ":s.tabs[x].tagName==="BUTTON"?a=!1:T(s,x,!0);break;default:a=!1}a&&(b.preventDefault(),b.stopPropagation())},U=s=>{const b=s.target;b.scrollLeft&&(b.scrollLeft=0),b.scrollTop&&(b.scrollTop=0)},G=s=>s.model.rotation?.labelled===!0,J=s=>{P(s);const{rotation:b}=s;!b||G(s)||(oe(b,"aria-label",s.rotate?p.pause:p.play),oe(b,Io,s.rotate?"playing":"paused"))},v=s=>{const b=s.model.rotation?.control??null;if(b){s.rotationInjected&&s.rotation?.isConnected&&s.rotation.remove(),s.rotation=b,s.rotationInjected=!1;return}if(!s.model.rotation){s.rotationInjected&&s.rotation?.isConnected&&s.rotation.remove(),s.rotation=null,s.rotationInjected=!1;return}if(s.rotation?.isConnected)return;const _=s.root.querySelector(`[${ct}]`);if(_){s.rotation=_,s.rotationInjected=!1;return}if(!i){S(`carousel rotates by itself and has no rotation control - add ${ct} to one`);return}Re(So,Er);const{position:x}=window.getComputedStyle(s.root);(!x||x==="static")&&s.root.classList.add(Ro);const q=document.createElement("button");q.type="button",q.className=ko,q.setAttribute(ct,""),q.innerHTML='<span class="patrol-carousel__rotation-icon" aria-hidden="true"></span>',s.root.insertBefore(q,s.root.firstChild),s.rotation=q,s.rotationInjected=!0},R=s=>s.rotate&&(s.model.rotation?.managesSuspension||!s.pointerInside&&!s.focusInside),u=s=>{const{rotation:b}=s.model;b&&!G(s)&&(s.rotate?R(s)?b.start():b.suspend():b.stop()),J(s)},o=s=>{s.model.rotation&&(s.rotate=!s.rotate,u(s),s.root.dispatchEvent(new CustomEvent(To,{bubbles:!0,detail:{rotating:s.rotate}})))},l=(s,b,_,x)=>{b.addEventListener(_,x),s.teardown.push(()=>b.removeEventListener(_,x))},y=s=>{s.teardown.push(s.model.watch(Z,()=>B(s.root),pe)),s.model.tablist&&(l(s,s.model.tablist,"keydown",N(s)),l(s,s.model.tablist,"click",m(s))),d&&s.model.guardFocusScroll&&s.model.frames.forEach(a=>l(s,a,"scroll",U));const{rotation:b}=s.model;if(!b||G(s)||(s.rotation&&l(s,s.rotation,"click",()=>o(s)),b.managesSuspension))return;const _=a=>()=>{s[a]=!0,u(s)},x=a=>()=>{s[a]=!1,u(s)},{thumbsRoot:q}=s.model,F=q&&!s.root.contains(q)?[s.root,q]:[s.root];F.forEach(a=>{l(s,a,"mouseenter",_("pointerInside")),l(s,a,"mouseleave",x("pointerInside")),l(s,a,"focusin",_("focusInside")),l(s,a,"focusout",h=>{const C=h.relatedTarget;C&&F.some(M=>M.contains(C))||x("focusInside")()})})},B=s=>{const b=A.get(s);b&&(b.teardown.splice(0).forEach(_=>_()),b.tabs.forEach(_=>{w.has(_)&&(_.removeAttribute("aria-selected"),_.removeAttribute("tabindex"),w.delete(_))}),b.rotationInjected&&b.rotation?.remove(),A.delete(s))},Y=s=>{const{model:b}=s,_=[b.current(),b.total,b.slides.length,s.tabs.length,b.vertical?1:0,b.rotation?.isRotating()?1:0,s.rotate?1:0,s.rtl?1:0];for(const x of s.tabs)_.push(x.getAttribute("aria-selected")??"-",x.tabIndex);if(b.managesHidden)for(const x of b.slides)_.push(x.getAttribute("aria-hidden")??"-");return _.join("|")},c=s=>[s.model.instance,s.model.tablist,s.model.thumbsRoot,s.model.track,s.rotation,s.model.rotation?.managesSuspension??null,...s.model.frames],O=(s,b,_,x)=>{const q=A.get(s);q&&(q.engine!==b||q.model.instance!==_.instance)&&B(s);const F=A.get(s)??{root:s,engine:b,model:_,tabs:[],panels:[],rtl:window.getComputedStyle(s).direction==="rtl"||!!s.closest('[dir="rtl"]'),rotation:null,rotationInjected:!1,rotate:!1,pointerInside:!1,focusInside:!1,selected:-1,bindKey:[],fingerprint:"",slides:[],teardown:[]},a=!A.has(s);if(A.set(s,F),F.model=_,F.tabs=_.thumbs.map(re),x&&(F.rtl=window.getComputedStyle(s).direction==="rtl"||!!s.closest('[dir="rtl"]')),a||_.rotation?.labelled)F.rotate=!!_.rotation?.isRotating();else{const ne=_.rotation?.wanted?.();typeof ne=="boolean"&&(F.rotate=ne)}const h=Y(F);if(!x&&!a&&h===F.fingerprint&&yt(_.slides,F.slides)){const ne=c(F);if(yt(F.bindKey,ne))return}const C=[];
6_.slides.forEach((ne,ce)=>{const ie=_.positions[ce];C[ie]=(C[ie]??[]).concat(ne)}),F.panels=C,_.releaseA11y(),k(F),H(F),V(F),v(F);const M=c(F);yt(F.bindKey,M)||(F.teardown.splice(0).forEach(ne=>ne()),y(F),F.bindKey=M),j(F,Math.min(Math.max(_.current(),0),Math.max(F.tabs.length-1,0))),J(F),F.slides=_.slides,F.fingerprint=Y(F)},I=(s=!1)=>{const b=new Set;t.querySelectorAll(yr).forEach(_=>{n&&te.observe(_,{attributes:!0,attributeFilter:Do});const x=_.getAttribute(Ae)?.trim().toLowerCase()??"",q=x?g.filter(a=>a.name===x):g.filter(a=>a.sniffable!==!1);if(!q.length){S(`${Ae}="${x}" is not a carousel engine this knows - only ${g.map(a=>`"${a.name}"`).join(" and ")}`);return}const F={warn:S,thumbsSelector:_.getAttribute(ae)?.trim()||null};for(const a of q){const h=a.read(_,F);if(h){b.add(_),O(_,a,h,s);return}}}),Array.from(A.keys()).forEach(_=>{b.has(_)||B(_)}),Q.takeRecords(),te.takeRecords()};let $=0;const Z=()=>{$||($=requestAnimationFrame(()=>{$=0,I()}))},Q=new MutationObserver(Z),te=new MutationObserver(Z);let le=0;const pe=()=>{le||(le=requestAnimationFrame(()=>{le=0,I(!0)}))},Oe=()=>{if(I(),!n)return;window.addEventListener("resize",pe);const s=t instanceof Document?t.documentElement:t;s&&Q.observe(s,{childList:!0,subtree:!0,attributes:!0,attributeFilter:No})};return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Oe,{once:!0}):Oe(),{sync:()=>I(!0),select:(s,b=!1)=>{for(const _ of A.values())if(!(s<0||s>=_.tabs.length))return T(_,s,b),!0;return!1},destroy:()=>{document.removeEventListener("DOMContentLoaded",Oe),window.removeEventListener("resize",pe),Q.disconnect(),te.disconnect(),$&&cancelAnimationFrame($),le&&cancelAnimationFrame(le),Array.from(A.keys()).forEach(B)}}};(e=>{try{const t=Fo(e);return console.log("[patrol-carousel]: Carousels and thumbnails were wired."),t}catch(t){return console.warn("[patrol-carousel]: Unable to wire carousels and thumbnails",t),null}})();const qo=(e,t)=>{if(!e)return null;const n={preventScroll:t?.preventScroll??!1},r=Ne(e);return r?(r.focus(n),document.activeElement===r?r:null):e instanceof HTMLElement&&it(e)?(e.focus(n),document.activeElement===e?e:null):null},Se=e=>{let t=0;for(let n=e.parentElement;n;n=n.parentElement)t+=1;return t},Ke=ee("control-trigger"),gt=ee("control-target"),Uo=`[${Ke}]`,Bo=`[${gt}]`,Ho="patrol-control-",Go=["dialog","menu","listbox","tree","grid"],Ko=["class","style","hidden","open","inert","aria-hidden",Ke,gt],we=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},At=(e,t)=>e.getAttribute(t)?.trim()??"",Vo=(e,t)=>{if(e.id)return e.id;const n=`${Ho}${t.replace(/\s+/g,"-")}`;let r=n;for(let i=2;document.getElementById(r);i+=1)r=`${n}-${i}`;return e.id=r,r},cn=e=>{if(e.hidden||e.hasAttribute("inert")||e.getAttribute("aria-hidden")==="true")return!1;if(e.tagName==="DIALOG"||e.tagName==="DETAILS")return e.hasAttribute("open");const{display:t,visibility:n}=window.getComputedStyle(e);return t!=="none"&&n!=="hidden"},jo=(e={})=>{const{root:t=document,observe:n=!0,haspopup:r=!0,manageFocus:i=!0}=e,d=new Map,p=new Map,g=new Map,A=new Map,w=new Set,f=m=>{w.has(m)||(w.add(m),console.warn(`[patrol-controls]: ${m}`))},E=m=>m.opener??m.triggers[0]??null,S=m=>{m.contains(document.activeElement)||(!Ne(m)&&!m.hasAttribute("tabindex")&&we(m,"tabindex","-1"),qo(m,{}))},k=(m,L)=>{const N=document.activeElement;if(!(!N||N===document.body||m.contains(N)))return;const G=E(L);G?.isConnected&&G.focus()},P=m=>{if(m.tagName==="BUTTON"||(f(`trigger "${At(m,Ke)}" is a <${m.tagName.toLowerCase()}>, not a <button>`),m.hasAttribute("role")||we(m,"role","button"),!m.hasAttribute("tabindex")&&!m.matches(Ie)&&we(m,"tabindex","0"),A.has(m)))return;const L=N=>{(N.key===" "||N.key==="Enter"&&!m.matches("a[href]"))&&(N.preventDefault(),m.click())};m.addEventListener("keydown",L),A.set(m,L)},K=(m,L)=>{if(m.hasAttribute("aria-haspopup"))return;const N=L.getAttribute("role");N&&Go.includes(N)&&we(m,"aria-haspopup",N)},X=m=>{if(g.has(m))return;const L=()=>{const N=p.get(m);if(!N)return;const U=d.get(N);U&&(U.pending=m),requestAnimationFrame(()=>H(N))};m.addEventListener("click",L),g.set(m,L)},W=(m,L,N)=>{we(m,"aria-controls",Vo(L,N)),P(m),r&&K(m,L),i&&X(m),p.set(m,L)},H=m=>{const L=d.get(m);
6if(!L)return;const N=cn(m);L.triggers.forEach(U=>we(U,"aria-expanded",String(N))),N!==L.open&&(L.open=N,i&&(N?(L.opener=L.pending??L.triggers[0]??null,S(m)):k(m,L),L.pending=null))},re=()=>{const m=new Map;return t.querySelectorAll(Bo).forEach(L=>{const N=At(L,gt);if(N){if(m.has(N)){f(`more than one target for "${N}" - wiring the first one`);return}m.set(N,L)}}),m},D=()=>{const m=re(),L=new Map;t.querySelectorAll(Uo).forEach(N=>{const U=At(N,Ke);if(!U)return;const G=m.get(U);if(!G){f(`no target found for trigger "${U}"`);return}W(N,G,U);const J=L.get(G);J?J.push(N):L.set(G,[N])}),L.forEach((N,U)=>{const G=d.get(U);G?G.triggers=N:d.set(U,{open:cn(U),opener:null,pending:null,triggers:N}),H(U)}),d.forEach((N,U)=>{L.has(U)||d.delete(U)})},V=m=>{if(m.key!=="Escape")return;const L=m.target,[N]=Array.from(d).filter(([U,G])=>G.open&&U.contains(L)).sort(([U],[G])=>Se(G)-Se(U));N&&E(N[1])?.focus()},j=new MutationObserver(D),T=()=>{if(D(),i&&document.addEventListener("keydown",V),!n)return;const m=t instanceof Document?t.documentElement:t;m&&j.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:Ko})};return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",T,{once:!0}):T(),{sync:D,destroy:()=>{document.removeEventListener("DOMContentLoaded",T),document.removeEventListener("keydown",V),j.disconnect(),g.forEach((m,L)=>L.removeEventListener("click",m)),A.forEach((m,L)=>L.removeEventListener("keydown",m)),g.clear(),A.clear(),p.clear(),d.clear()}}};(e=>{try{const t=jo(e);return console.log("[patrol-controls]: Triggers and targets were wired."),t}catch(t){return console.warn("[patrol-controls]: Unable to wire triggers and targets",t),null}})();const ln=2,Wo=e=>{const t=e.width>=ln,n=e.height>=ln;return t&&!n||n&&!t},zo=e=>(e.tagName==="DIALOG"||e.tagName==="DETAILS")&&!e.hasAttribute("open"),Xo=(e,t)=>e.tagName==="DETAILS"&&Array.from(e.children).some(n=>n.tagName==="SUMMARY"&&n.contains(t)),se=e=>{if(window.getComputedStyle(e).visibility==="hidden"||Wo(e.getBoundingClientRect()))return!1;for(let t=e;t;t=t.parentElement)if(t.hidden||t.hasAttribute("inert")||t.getAttribute("aria-hidden")==="true"||window.getComputedStyle(t).display==="none"||zo(t)&&!Xo(t,e))return!1;return!0},Ve=ee("nav-trigger"),je=ee("nav-target"),We=`[${Ve}]`,un=`[${je}]`,dn=`${We}, a[href]`,Yo="patrol-nav-",fn='nav, [role="navigation"]',pn=["pointerover","pointerout","focusin","focusout","transitionend","animationend"],Qo=["class","style","hidden","open","inert","aria-hidden",Ve,je],Te=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},ze=(e,t)=>e.getAttribute(t)?.trim()??"",Zo=(e,t)=>{if(e.id)return e.id;const n=`${Yo}${t.replace(/\s+/g,"-")}`;let r=n;for(let i=2;document.getElementById(r);i+=1)r=`${n}-${i}`;return e.id=r,r},hn=e=>se(e),Jo=(e={})=>{const{root:t=document,observe:n=!0,arrowKeys:r=!0,single:i=!0,closeOnFocusOut:d=!0,closeOnOutsideClick:p=!0,currentPage:g=!0,toggle:A="auto"}=e,w=new Map,f=new Map,E=new Set,S=new Map,k=new Map,P=new Map,K=new Map,X=new Set;let W=0;const H=a=>{X.has(a)||(X.add(a),console.warn(`[patrol-nav]: ${a}`))},re=a=>{const h=t instanceof Document?t.body:t.parentElement,C=a.closest(fn);if(C)return C;for(let M=a.parentElement;M&&M!==h;M=M.parentElement)if(M.querySelectorAll(We).length>1)return M;return a.parentElement??document.body},D=a=>{for(const h of E)if(h.contains(a))return h;for(const h of w.values())if(h.target.contains(a))return h.nav;return null},V=(a,h)=>{if(h.length===1)return h[0];for(let C=a.parentElement;C;C=C.parentElement){const M=h.find(ne=>C.contains(ne));if(M)return M}return h[0]},j=(a,h)=>{const C=a.parentElement?.closest(un);return C&&h.contains(C)?C:h},T=(a,h)=>Array.from(a.querySelectorAll(dn)).filter(C=>j(C,h)===a&&hn(C)),m=a=>a.opener??a.triggers.find(hn)??a.triggers[0]??null,L=a=>{let h=null;return w.forEach(C=>{!C.open||!C.target.contains(a)||(!h||h.target.contains(C.target))&&(h=C)}),h},N=a=>{if(a.tagName==="BUTTON"){a.hasAttribute("type")||Te(a,"type","button");return}if(a.tagName==="SUMMARY"||(H(`trigger "${ze(a,Ve)}" is a <${a.tagName.toLowerCase()}>, not a <button>`),!a.hasAttribute("role")&&!a.matches("a[href]")&&Te(a,"role","button"),!a.hasAttribute("tabindex")&&!a.matches(Ie)&&Te(a,"tabindex","0"),k.has(a)))return;const h=C=>{(C.key===" "||C.key==="Enter"&&!a.matches("a[href]"))&&(C.preventDefault(),a.click())};a.addEventListener("keydown",h),k.set(a,h)},U=a=>
6{if(S.has(a))return;const h=()=>{const C=f.get(a),M=C?w.get(C):null;if(!M)return;M.pending=a;const ne=M.open,ce=M.changes;requestAnimationFrame(()=>{B(M),!(M.open!==ne||A==="theme")&&M.changes===ce&&(R(M,!ne),B(M))})};a.addEventListener("click",h),S.set(a,h)},G=(a,h,C)=>{Te(a,"aria-controls",Zo(h,C)),N(a),U(a),f.set(a,h)},J=a=>{a.matches(fn)&&(a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby")||H("a <nav> holding a disclosure menu has no accessible name - add aria-label to it"))},v=a=>{if(a.querySelector("[aria-current]"))return;const h=`${window.location.pathname}${window.location.search}`;a.querySelectorAll("a[href]").forEach(C=>{const M=new URL(C.href,window.location.href);M.origin===window.location.origin&&`${M.pathname}${M.search}`===h&&Te(C,"aria-current","page")})},R=(a,h)=>{h?a.target.removeAttribute("hidden"):a.target.hidden=!0},u=a=>{if(!a.matches("a[href]")){a.click();return}const h=C=>C.preventDefault();a.addEventListener("click",h,{capture:!0}),a.click(),a.removeEventListener("click",h,{capture:!0})},o=(a,h)=>{if(se(a.target)===h)return;const C=A==="self"?null:m(a);if(!C){if(A==="theme")return;R(a,h),B(a);return}u(C)},l=(a,h)=>a.target.contains(h.target)||h.target.contains(a.target)||a.triggers.some(C=>h.target.contains(C))||h.triggers.some(C=>a.target.contains(C)),y=a=>{Array.from(w.values()).filter(h=>h!==a&&h.open&&h.nav===a.nav&&!l(h,a)).forEach(h=>o(h,!1))},B=a=>{const h=se(a.target);a.triggers.forEach(C=>Te(C,"aria-expanded",String(h))),h!==a.open&&(a.open=h,a.changes+=1,h&&(a.opener=a.pending??m(a),i&&y(a)),a.pending=null)},Y=a=>requestAnimationFrame(()=>{se(a.target)&&o(a,!1)}),c=a=>w.forEach(h=>{h.nav===a&&h.open&&Y(h)}),O=(a,h,C)=>{const M=T(j(a,h),h),ne=M.indexOf(a);ne!==-1&&M[Math.min(M.length-1,Math.max(0,ne+C))]?.focus()},I=(a,h,C)=>{T(j(a,h),h).at(C)?.focus()},$=a=>{const h=a.target;if(!h)return;const C=h.closest(dn);if(!C)return;const M=D(C);if(!M)return;const ce=C.matches(We)?w.get(f.get(C)):void 0;let ie=!0;switch(a.key){case"Escape":{const xe=L(C)??(ce?.open?ce:null);if(!xe){ie=!1;break}m(xe)?.focus(),o(xe,!1);break}case"ArrowDown":case"ArrowRight":if(!r){ie=!1;break}if(ce?.open){const[xe]=T(ce.target,M);
6(xe??Ne(ce.target))?.focus();break}O(C,M,1);break;case"ArrowUp":case"ArrowLeft":r?O(C,M,-1):ie=!1;break;case"Home":r?I(C,M,0):ie=!1;break;case"End":r?I(C,M,-1):ie=!1;break;default:ie=!1}ie&&(a.preventDefault(),a.stopPropagation())},Z=a=>{if(P.has(a))return;const h=()=>setTimeout(()=>{const C=document.activeElement;!C||C===document.body||a.contains(C)||D(C)===a||c(a)},0);a.addEventListener("focusout",h),P.set(a,h)},Q=a=>{if(K.has(a))return;const h=()=>te();pn.forEach(C=>a.addEventListener(C,h)),K.set(a,h)},te=()=>{W||(W=requestAnimationFrame(()=>{W=0,w.forEach(B)}))},le=()=>{const a=new Map;return t.querySelectorAll(un).forEach(h=>{const C=ze(h,je);if(!C)return;const M=a.get(C)??[];M.push(h),a.set(C,M)}),a},pe=()=>{const a=le(),h=new Map;E.clear(),t.querySelectorAll(We).forEach(C=>{const M=ze(C,Ve);if(!M)return;const ne=a.get(M);if(!ne?.length){H(`no dropdown found for trigger "${M}"`);return}const ce=V(C,ne);G(C,ce,M);const ie=h.get(ce);ie?ie.push(C):h.set(ce,[C])}),h.forEach((C,M)=>{const ne=re(C[0]),ie=w.get(M)??{key:ze(M,je),target:M,nav:ne,open:se(M),changes:0,opener:null,pending:null,triggers:C};ie.nav=ne,ie.triggers=C,w.set(M,ie),E.add(ne)}
6),E.forEach(C=>{J(C),g&&v(C),d&&Z(C),Q(C)}),w.forEach((C,M)=>{h.has(M)?B(C):w.delete(M)}),x(),s.takeRecords()},Oe=a=>{const h=a.target;h&&E.forEach(C=>{if(C.contains(h))return;Array.from(w.values()).some(ne=>ne.nav===C&&ne.target.contains(h))||c(C)})},s=new MutationObserver(pe),b=typeof IntersectionObserver>"u"?null:new IntersectionObserver(()=>te(),{threshold:[0,.01]}),_=new Set,x=()=>{b&&(w.forEach((a,h)=>{_.has(h)||(b.observe(h),_.add(h))}),_.forEach(a=>{w.has(a)||(b.unobserve(a),_.delete(a))}))},q=()=>{if(pe(),document.addEventListener("keydown",$),p&&document.addEventListener("click",Oe),!n)return;const a=t instanceof Document?t.documentElement:t;a&&s.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:Qo})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",q,{once:!0}):q();const F=a=>Array.from(w.values()).find(h=>h.key===a)??null;return{sync:pe,open:a=>{const h=F(a);return h?(o(h,!0),!0):!1},close:a=>{if(a===void 0){w.forEach(C=>o(C,!1));return}const h=F(a);h&&o(h,!1)},destroy:()=>{document.removeEventListener("DOMContentLoaded",q),document.removeEventListener("keydown",$),document.removeEventListener("click",Oe),s.disconnect(),b?.disconnect(),_.clear(),S.forEach((a,h)=>h.removeEventListener("click",a)),k.forEach((a,h)=>h.removeEventListener("keydown",a)),P.forEach((a,h)=>h.removeEventListener("focusout",a)),K.forEach((a,h)=>pn.forEach(C=>h.removeEventListener(C,a))),W&&cancelAnimationFrame(W),S.clear(),k.clear(),P.clear(),K.clear(),f.clear(),w.clear(),E.clear()}}};(e=>{try{const t=Jo(e);return console.log("[patrol-nav]: Navigation triggers and dropdowns were wired."),t}catch(t){return console.warn("[patrol-nav]: Unable to wire navigation triggers and dropdowns",t),null}})();const vt=ee("escape-close"),es=`[${vt}]`,ts=e=>e.getAttribute(vt)?.trim()??"",ns=(e={})=>{const{root:t=document,manageFocus:n=!0}=e,r=new Set,i=f=>{r.has(f)||(r.add(f),console.warn(`[patrol-escape]: ${f}`))},d=(f,E)=>{for(let S=f;S;S=S.parentElement){const k=S.querySelector(E);if(k)return k}return null},p=f=>{const E=ts(f);if(!E)return i(`a panel carries ${vt} with no id or selector in it`),null;const S=document.getElementById(E.replace(/^#/,""));if(S)return S;let k;try{k=d(f,E)}catch{return i(`"${E}" is neither an id on the page nor a selector the browser can read`),null}return k||(i(`nothing on the page matches "${E}" to close the panel that names it`),null)},g=()=>Array.from(t.querySelectorAll(es)).filter(se).map(f=>({panel:f,trigger:p(f)})).filter(f=>f.trigger!==null),A=({panel:f,trigger:E})=>{n&&f.contains(document.activeElement)&&E.focus(),requestAnimationFrame(()=>{se(f)&&E.click()})},w=f=>{if(f.key!=="Escape")return;const E=f.target,S=!E||E===document.body||E===document.documentElement,k=g().filter(({panel:K,trigger:X})=>S||K.contains(E)||X.contains(E));if(!k.length)return;const[P]=k.sort((K,X)=>Se(X.panel)-Se(K.panel));A(P)};return document.addEventListener("keydown",w,!0),{close:f=>{const E=p(f);return!E||!se(f)?!1:(A({panel:f,trigger:E}),!0)},destroy:()=>{document.removeEventListener("keydown",w,!0),r.clear()}}},rs=e=>{try{const t=ns(e);return console.log("[patrol-escape]: Escape is wired to close the panels that ask for it."),t}catch(t){return console.warn("[patrol-escape]: Unable to wire Escape",t),null}},St=ee("escape-skip"),os=`[${St}]`,ss=/^[A-Za-z][\w-]*$/,as=e=>e.getAttribute(St)?.trim()??"",is=e=>!e||e===document.body||e===document.documentElement,cs=(e={})=>{const{root:t=document,manageTabindex:n=!0,preventScroll:r=!1}=e,i=new Set,d=new Set,p=S=>{i.has(S)||(i.add(S),console.warn(`[patrol-escape-skip]: ${S}`))},g=S=>{try{return document.querySelector(S)}catch{return p(`"${S}" is not a selector the browser can read`),null}},A=S=>{const k=as(S);if(!k)return p(`an element carries ${St} with no selector in it`),null;const P=g(k)??(ss.test(k)?document.getElementById(k):null);return P?it(P)?P:(p(`"${k}" is on the page but cannot hold focus, so Escape would strand it`),null):(p(`nothing on the page matches "${k}", so Escape has nowhere to go`),null)},w=S=>Array.from(t.querySelectorAll(os)).filter(k=>k.contains(S)).sort((k,P)=>Se(P)-Se(k)),f=({source:S,target:k})=>{n&&!k.matches(ge)&&(k.setAttribute("tabindex","-1"),d.add(k)),requestAnimationFrame(()=>{const P=document.activeElement;!S.contains(P)&&!is(P)||k.focus({preventScroll:r})})},E=S=>{if(S.key!=="Escape")return;const k=S.target,[P]=w(k);if(!P)return;const K=A(P);K&&f({source:P,target:K})};return document.addEventListener("keydown",E,!0),{skip:S=>{const k=A(S);return k?(f({source:S,target:k}),!0):!1},destroy:()=>{document.removeEventListener("keydown",E,!0),d.forEach(S=>S.removeAttribute("tabindex")),d.clear(),i.clear()}}},ls=e=>{try{const t=cs(e);return console.log("[patrol-escape-skip]: Escape is wired to move focus out of the elements that ask for it."),t}catch(t){return console.warn("[patrol-escape-skip]: Unable to wire Escape",t),null}};rs(),ls();const me=ee("search-input"),Le=ee("search-suggestions"),Xe=ee("search-results"),wt=ee("live"),Ye=ee("search-dialog"),Tt=ee("search-trigger"),Lt=ee("search-close"),us=ee("search-error"),mn=`[${me}]`,ds=`[${Le}]`,fs=`[${Xe}]`,ps=`[${Ye}]`,hs=`[${Tt}]`,ms=`[${Lt}]`,bs=`[${us}]`,Es=[`[${wt}]`,'[role="status"]','[role="alert"]','[aria-live]:not([aria-live="off"])'].join(", "),Ct=(e,t)=>
6t?document.querySelector(`[${e}="${CSS.escape(t)}"]`):null,bn="patrol-search-suggestions-",ys="patrol-search-option-",gs="patrol-search-dialog-",As="patrol-search-dialog-label-",vs="patrol-search-results-label-",z=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},de=(e,t)=>{e.hasAttribute(t)&&e.removeAttribute(t)},Ce=(e,t)=>e.getAttribute(t)?.trim()??"",_e=(e,t,n)=>{if(e.id)return e.id;const r=`${t}${String(n).replace(/\s+/g,"-")}`;let i=r;for(let d=2;document.getElementById(i);d+=1)i=`${r}-${d}`;return e.id=i,i},Qe=e=>{const t=new Set;return{warnOnce:r=>{t.has(r)||(t.add(r),console.warn(`[${e}]: ${r}`))},clear:()=>t.clear()}},_t=e=>{if(e.getAttribute("aria-label")?.trim()||e.getAttribute("title")?.trim())return!0;const t=e.getAttribute("aria-labelledby")?.trim();return t?t.split(/\s+/).some(n=>document.getElementById(n)?.textContent?.trim()):e.id&&document.querySelector(`label[for="${CSS.escape(e.id)}"]`)||e.closest("label")?.textContent?.trim()?!0:!!e.textContent?.trim()},Ze=e=>!e.hidden&&!e.hasAttribute("inert")&&e.getAttribute("aria-hidden")!=="true",Ss='h1, h2, h3, h4, h5, h6, [role="heading"]',En=e=>Array.from(e.querySelectorAll(Ss)).find(t=>t.textContent?.trim())??null,ws=e=>`<${e.tagName.toLowerCase()}${e.className?` class="${e.className}"`:""}>`,Ts=["class","style","hidden","inert","aria-hidden","open",me,Le],Ls='button[type="submit"], button:not([type])',Cs={input:"Search",submit:"Search"},_s=(e={})=>{const{root:t=document,observe:n=!0,autocomplete:r="list",landmark:i=!0,nameSubmit:d=!0}=e,p={...Cs,...e.labels},{warnOnce:g,clear:A}=Qe("patrol-search-input"),w=new WeakSet,f=new Map,E=(D,V)=>{if(_t(D))return;const j=D.getAttribute("placeholder")?.trim();j||g(`the field for "${V}" has no label - naming it "${p.input}"`),z(D,"aria-label",j||p.input)},S=D=>{D.hasAttribute("autocomplete")||z(D,"autocomplete","off")},k=D=>{if(D.closest('search, [role="search"]'))return;const V=D.closest("form");!V||V.hasAttribute("role")||z(V,"role","search")},P=D=>{const V=D.closest("form");V&&V.querySelectorAll(Ls).forEach(j=>{_t(j)||z(j,"aria-label",p.submit)})},K=(D,V,j)=>{z(D,"role","combobox"),z(D,"aria-autocomplete",r),z(D,"aria-controls",_e(V,bn,j)),z(D,"aria-expanded",String(se(V))),w.add(D)},X=D=>{w.has(D)&&(de(D,"role"),de(D,"aria-autocomplete"),de(D,"aria-controls"),de(D,"aria-expanded"),de(D,"aria-activedescendant"),w.delete(D))},W=()=>{f.clear(),t.querySelectorAll(mn).forEach(D=>{const V=Ce(D,me);if(!V){g(`a field carries ${me} with no key in it`);return}if(f.has(V)){g(`more than one field for "${V}" - wiring the first one`);return}f.set(V,D),D.tagName!=="INPUT"&&D.tagName!=="TEXTAREA"&&g(`the field for "${V}" is a ${Os(D)}, not an <input>`),E(D,V),S(D),i&&k(D),d&&P(D);const j=Ct(Le,V);j?K(D,j,V):X(D)}),H.takeRecords()},H=new MutationObserver(W),re=()=>{if(W(),!n)return;const D=t instanceof Document?t.documentElement:t;D&&H.observe(D,{childList:!0,subtree:!0,attributes:!0,attributeFilter:Ts})};return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",re,{once:!0}):re(),{sync:W,get:D=>f.get(D)??null,destroy:()=>{document.removeEventListener("DOMContentLoaded",re),H.disconnect(),f.clear(),A()}}},Os=e=>`<${e.tagName.toLowerCase()}>`,ks=e=>{try{const t=_s(e);return console.log("[patrol-search-input]: Search fields were wired."),t}catch(t){return console.warn("[patrol-search-input]: Unable to wire search fields",t),null}},yn=ee("search-option"),Rs=ee("search-item"),$s=`[${yn}]`,Is=`[${Rs}]`,Ns=[$s,'[role="option"]',"a[href]","button:not([disabled])","li"],gn=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","summary",'[role="link"]','[role="button"]','[tabindex]:not([tabindex^="-"])'],Ds=['[role="option"]','[role="menuitem"]','[role="checkbox"]','[role="radio"]','[role="tab"]'],xs=[...gn,...Ds].join(", "),Ms=gn.join(", "),Ps=(e,t)=>{for(const n of t){const r=Array.from(e.querySelectorAll(n)).filter(Ze);if(r.length)return r}return Array.from(e.children).filter(n=>n instanceof HTMLElement&&Ze(n))},Fs=e=>Ps(e,Ns),qs=e=>{const t=Array.from(e.querySelectorAll(Is)).filter(Ze);if(t.length)return t;const n=Array.from(e.querySelectorAll(Ms)).filter(Ze),r=new Set(n);return n.filter(i=>{for(let d=i.parentElement;d&&d!==e;d=d.parentElement)if(r.has(d))return!1;return!0})},Us="[data-ally-search-active]{outline:2px solid currentColor;outline-offset:-2px;background-color:#0000000d}",Bs="patrol:search-choose",Hs="patrol:search-dismiss",An=ee("search-active"),Gs="patrol-search-styles",Ks=["class","style","hidden","inert","aria-hidden","open",me,Le],Vs='a[href], button, input, select, textarea, [role="button"], [role="link"]',js={listbox:"Search suggestions"},Ws=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]),zs=(e={})=>{const{root:t=document,observe:n=!0,wrap:r=!0,dismiss:i="auto",choose:d="auto",activeStyles:p=!0}=e,g={...js,...e.labels},{warnOnce:A,clear:w}=Qe("patrol-search-suggestions"),f=new Map,E=new Map,S=new WeakSet,k=o=>o.options[o.activeIndex]??null,P=(o,l)=>{for(let y=o.parentElement;y&&y!==l;y=y.parentElement)y.hasAttribute("role")||z(y,"role","presentation")},K=o=>{const{listbox:l,key:y}=o;_e(l,bn,y),z(l,"role","listbox"),!l.hasAttribute("aria-label")&&!l.hasAttribute("aria-labelledby")&&z(l,"aria-label",g.listbox)},X=o=>{o.options.forEach((l,y)=>{_e(l,ys,`${o.key}-${y}`),z(l,"role","option"),z(l,"aria-selected",String(y===o.activeIndex)),P(l,o.listbox),l.querySelector(Vs)&&A(`the suggestion ${ws(l)} for "${o.key}" holds a control of its own - an option may not, so mark the control itself with ${yn}`)})},W=o=>{z(o.input,"aria-expanded",String(se(o.listbox)))},H=o=>{const l=k(o);if(o.options.forEach(y=>{z(y,"aria-selected",String(y===l)),y===l?z(y,An,""):de(y,An)}),!l){de(o.input,"aria-activedescendant");return}z(o.input,"aria-activedescendant",l.id),l.scrollIntoView?.({block:"nearest"})},re=(o,l)=>{o.activeIndex=l,H(o)},D=o=>{o.activeIndex!==-1&&re(o,-1)},V=(o,l)=>{const y=o.options.length;if(!y)return;const B=o.activeIndex+l;if(!r&&(B<0||B>=y)){re(o,Math.min(Math.max(B,0),y-1));return}
6re(o,(B+y)%y)},j=o=>!S.has(o.listbox)||!o.options.length?!1:(o.listbox.hidden=!1,S.delete(o.listbox),W(o),!0),T=o=>{if(D(o),!o.input.dispatchEvent(new CustomEvent(Hs,{bubbles:!0,cancelable:!0,detail:{key:o.key}}))||i==="theme"){W(o);return}se(o.listbox)&&(o.listbox.hidden=!0,S.add(o.listbox)),W(o)},m=o=>{const l=k(o);if(!l)return!1;const y=l.textContent?.trim()??"";if(!o.input.dispatchEvent(new CustomEvent(Bs,{bubbles:!0,cancelable:!0,detail:{key:o.key,option:l,value:y}})))return!0;const Y=()=>{(o.input instanceof HTMLInputElement||o.input instanceof HTMLTextAreaElement)&&(o.input.value=y,o.input.dispatchEvent(new Event("input",{bubbles:!0}))),T(o)};return d==="self"?(Y(),!0):(l.click(),D(o),d==="theme"||requestAnimationFrame(()=>{f.get(o.listbox)===o&&se(o.listbox)&&Y()}),!0)},L=o=>l=>{if(!(l.altKey||l.ctrlKey||l.metaKey))switch(l.key){case"ArrowDown":case"ArrowUp":{if(j(o),!se(o.listbox)||!o.options.length)return;l.preventDefault();const y=l.key==="ArrowDown";o.activeIndex===-1?re(o,y?0:o.options.length-1):V(o,y?1:-1);break}case"Enter":{if(o.activeIndex===-1)return;l.preventDefault(),m(o);break}case"Escape":{if(!se(o.listbox))return;l.preventDefault(),l.stopPropagation(),T(o);break}}},N=o=>()=>D(o),U=o=>{const{input:l}=o,y=E.get(l);if(y?.popup===o)return;y&&G(l);const B=L(o),Y=N(o);l.addEventListener("keydown",B),l.addEventListener("input",Y),E.set(l,{popup:o,onKeydown:B,onInput:Y})},G=(o,l)=>{const y=E.get(o);!y||l&&y.popup!==l||(o.removeEventListener("keydown",y.onKeydown),o.removeEventListener("input",y.onInput),E.delete(o))},J=()=>{const o=new Set;t.querySelectorAll(ds).forEach(l=>{const y=Ce(l,Le);if(!y){A(`a popup carries ${Le} with no key in it`);return}const B=Ct(me,y);if(!B){A(`no field found for the suggestions popup "${y}"`);return}const Y=f.get(l);Y&&Y.input!==B&&G(Y.input,Y);const c=Y??{key:y,listbox:l,input:B,options:[],activeIndex:-1},O=Y?Y.options:[],I=Y?O[Y.activeIndex]??null:null;c.key=y,c.input=B,c.options=Fs(l),c.activeIndex=I&&se(l)?c.options.indexOf(I):-1,S.has(l)&&!Ws(c.options,O)&&j(c),K(c),X(c),H(c),W(c),f.set(l,c),U(c),o.add(l)}),f.forEach((l,y)=>{o.has(y)||(G(l.input,l),f.delete(y))}),v.takeRecords()},v=new MutationObserver(J),R=o=>Array.from(f.values()).find(l=>l.key===o)??null,u=()=>{if(p&&Re(Gs,Us),J(),!n)return;const o=t instanceof Document?t.documentElement:t;o&&v.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:Ks})};return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u,{once:!0}):u(),{sync:J,activate:(o,l)=>{const y=R(o);if(!y||!y.options.length)return!1;const B=y.options.length,Y=l<0?B+l:l;return Y<0||Y>=B?!1:(re(y,Y),!0)},choose:o=>{const l=R(o);return l?m(l):!1},dismiss:o=>{const l=R(o);return l?(T(l),!0):!1},destroy:()=>{document.removeEventListener("DOMContentLoaded",u),v.disconnect(),E.forEac
6h(({onKeydown:o,onInput:l},y)=>{y.removeEventListener("keydown",o),y.removeEventListener("input",l)}),E.clear(),f.clear(),w()}}},Xs=e=>{try{const t=zs(e);return console.log("[patrol-search-suggestions]: Suggestion popups were wired."),t}catch(t){return console.warn("[patrol-search-suggestions]: Unable to wire suggestion popups",t),null}},Ys="patrol:search-results",Ot="patrol-search-announcements",Qs="patrol-search-status-",Zs=400,Js=1e4,ea="section, aside, nav, form, [role]",ta={region:"Search results",count:(e,t)=>t?e===0?`No results found for ${t}.`:e===1?`1 result found for ${t}.`:`${e} results found for ${t}.`:e===1?"1 result found.":`${e} results found.`,error:"We could not load search results. Please try again."},na=(e={})=>{const{root:t=document,observe:n=!0,announce:r=!0,busy:i=!0,stripListbox:d=!0,debounce:p=Zs}=e,g={...ta,...e.labels},{warnOnce:A,clear:w}=Qe("patrol-search-results"),f=new Map,E=new Map,S=new Map,k=new Map,P=(u,o)=>{u.getAttribute("role")==="listbox"&&(A(`the results container for "${o}" was a listbox - product results are not options`),de(u,"role")),u.querySelectorAll('[role="option"]').forEach(l=>{(l.querySelector(xs)||!l.parentElement?.closest('[role="listbox"]'))&&(de(l,"role"),de(l,"aria-selected"))})},K=(u,o)=>{if(!u.matches(ea)||u.hasAttribute("aria-label")||u.hasAttribute("aria-labelledby"))return;const l=En(u);l?z(u,"aria-labelledby",_e(l,vs,o)):z(u,"aria-label",g.region)},X=(u,o)=>{i&&(u.busyTimer&&(clearTimeout(u.busyTimer),u.busyTimer=null),u.busy=o,z(u.container,"aria-busy",String(o)),o&&(u.busyTimer=setTimeout(()=>X(u,!1),Js)))},W=u=>{const o=E.get(u);if(o?.isConnected)return o;window.customElements.get(Ot)||tt(Ot,et);const l=document.createElement(Ot);return l.setAttribute("announcer-id",`${Qs}${u}`),l.setAttribute(wt,""),document.body.appendChild(l),l.getAnnouncerEl()?.setAttribute(wt,""),E.set(u,l),l},H=u=>{E.get(u)?.remove(),E.delete(u)},re=u=>{const o=u.input;return o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?o.value.trim():""},D=u=>{const o=u.querySelector(bs);return o?o.textContent?.trim()||g.error:null},V=u=>{const{container:o}=u;d&&P(o,u.key);const l=qs(o).length,y=re(u);if(u.count=l,X(u,!1),o.dispatchEvent(new CustomEvent(Ys,{bubbles:!0,detail:{key:u.key,count:l,query:y}})),!r||!se(o))return;const B=D(o)??g.count(l,y);B!==u.announced&&(!y&&!l||(u.announced=B,W(u.key).announce(u.key,B)))},j=u=>{u.debounceTimer&&clearTimeout(u.debounceTimer),u.debounceTimer=setTimeout(()=>{u.debounceTimer=null,V(u)},p)},T=u=>{if(S.has(u.container))return;const o=new MutationObserver(()=>j(u));o.observe(u.container,{childList:!0,subtree:!0}),S.set(u.container,o)},m=u=>{S.get(u)?.disconnect(),S.delete(u)},L=u=>{const{input:o}=u;if(!o)return;const l=k.get(o);if(l?.results===u)return;l&&N(o);const y=()=>X(u,!0);o.addEventListener("input",y),k.set(o,{results:u,handler:y})},N=(u,o)=>{const l=k.get(u);!l||o&&l.results!==o||(u.removeEventListener("input",l.handler),k.delete(u))},U=(u,o)=>{for(const l of f.values())if(!(l.key!==u||l.container===o)&&!l.container.isConnected)return l;return null};let G=!0;const J=()=>{const u=new Set,o=new Set;t.querySelectorAll(fs).forEach(l=>{const y=Ce(l,Xe);if(!y){A(`a results container carries ${Xe} with no key in it`);return}const B=f.get(l),Y=Ct(me,y);B&&B.input&&B.input!==Y&&N(B.input,B);const c=B?null:U(y,l),O=B??{key:y,container:l,input:Y,count:c?.count??-1,announced:c?.announced??"",busy:c?.busy??!1,debounceTimer:null,busyTimer:null};O.key=y,O.input=Y,d&&P(l,y),K(l,y),i&&z(l,"aria-busy",String(O.busy)),f.set(l,O),o.add(y),r&&W(y),T(O),L(O),!B&&!G&&j(O),u.add(l)}),f.forEach((l,y)=>{u.has(y)||(l.debounceTimer&&clearTimeout(l.debounceTimer),l.busyTimer&&clearTimeout(l.busyTimer),l.input&&N(l.input,l),m(y),f.delete(y))}),E.forEach((l,y)=>{o.has(y)||H(y)}),G=!1,v.takeRecords()},v=new MutationObserver(J),R=()=>{if(J(),!n)return;const u=t instanceof Document?t.documentElement:t;u&&v.observe(u,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","hidden","inert","aria-hidden",Xe,me]})};return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",R,{once:!0}):R(),{sync:J,count:u=>{for(const o of f.values())if(o.key===u)return o.count;return-1},destroy:()=>{document.removeEventListener("DOMContentLoaded",R),v.disconnect(),f.forEach(u=>{u.debounceTimer&&clearTimeout(u.debounceTimer),u.busyTimer&&clearTimeout(u.busyTimer)}
6),E.forEach(u=>u.remove()),E.clear(),S.forEach(u=>u.disconnect()),k.forEach(({handler:u},o)=>o.removeEventListener("input",u)),S.clear(),k.clear(),f.clear(),w()}}},ra=e=>{try{const t=na(e);return console.log("[patrol-search-results]: Search results containers were wired."),t}catch(t){return console.warn("[patrol-search-results]: Unable to wire search results containers",t),null}},oa="patrol:search-dialog",sa=["class","style","hidden","open","inert","aria-hidden",Ye,Tt,Lt],aa={dialog:"Search",close:"Close search"},ia=e=>e.matches('input:not([type="hidden"]), textarea'),ca=(e={})=>{const{root:t=document,observe:n=!0,manageFocus:r=!0,trapFocus:i=!0,inertBackground:d=!0,close:p="auto"}=e,g={...aa,...e.labels},{warnOnce:A,clear:w}=Qe("patrol-search-dialog"),f=new Map,E=new Map,S=new Map,k=v=>{const{dialog:R,key:u}=v;if(_e(R,gs,u),R.tagName!=="DIALOG"&&z(R,"role","dialog"),z(R,"aria-modal","true"),R.hasAttribute("aria-label")||R.hasAttribute("aria-labelledby"))return;const o=En(R);o?z(R,"aria-labelledby",_e(o,As,u)):z(R,"aria-label",g.dialog)},P=(v,R)=>{if(v.tagName==="BUTTON"){v.hasAttribute("type")||z(v,"type","button");return}if(A(`the trigger for "${R}" is a <${v.tagName.toLowerCase()}>, not a <button>`),v.hasAttribute("role")||z(v,"role","button"),!v.hasAttribute("tabindex")&&!v.matches("a[href]")&&z(v,"tabindex","0"),S.has(v))return;const u=o=>{(o.key===" "||o.key==="Enter"&&!v.matches("a[href]"))&&(o.preventDefault(),v.click())};v.addEventListener("keydown",u),S.set(v,u)},K=v=>{H(v).forEach(R=>{R.tagName==="BUTTON"&&!R.hasAttribute("type")&&z(R,"type","button"),_t(R)||z(R,"aria-label",g.close)})},X=v=>{if(!(!d||v.inerted.length))for(let R=v.dialog;R&&R!==document.body;R=R.parentElement){const u=R.parentElement;if(!u)break;Array.from(u.children).forEach(o=>
6{o===R||!(o instanceof HTMLElement)||o.hasAttribute("inert")||o.matches(Es)||(o.setAttribute("inert",""),v.inerted.push(o))})}},W=v=>{v.inerted.forEach(R=>R.removeAttribute("inert")),v.inerted=[]},H=v=>Array.from(document.querySelectorAll(ms)).filter(R=>{const u=Ce(R,Lt);return u?u===v.key:v.dialog.contains(R)}),re=v=>{const{dialog:R}=v;if(R.contains(document.activeElement))return;const u=Ht(R),o=R.querySelector(mn),y=(o&&u.includes(o)?o:null)??u.find(ia)??null??u[0]??null;if(y){y.focus();return}R.hasAttribute("tabindex")||z(R,"tabindex","-1"),R.focus()},D=v=>{const R=document.activeElement;if(!(!R||R===document.body||v.dialog.contains(R)))return;const o=v.opener??v.triggers[0]??null;o?.isConnected&&o.focus()},V=(v,R)=>{const u=Ht(v.dialog);if(!u.length){R.preventDefault();return}const o=u[0],l=u[u.length-1],y=document.activeElement;if(!R.shiftKey&&y===l){R.preventDefault(),o.focus();return}if(R.shiftKey&&(y===o||y===v.dialog)){R.preventDefault(),l.focus();return}v.dialog.contains(y)||(R.preventDefault(),(R.shiftKey?l:o).focus())},j=v=>{if(!se(v.dialog))return!1;const R=p==="self"?null:H(v)[0];return!R&&p==="theme"?!1:R?(R.click(),requestAnimationFrame(()=>{se(v.dialog)&&p!=="theme"&&T(v),m(v)}),!0):(T(v),m(v),!0)},T=(v,R)=>{if(v.dialog.tagName==="DIALOG"&&"close"in v.dialog){v.dialog.close();return}v.dialog.hidden=!0},m=v=>{const R=se(v.dialog);v.triggers.forEach(u=>z(u,"aria-expanded",String(R))),R!==v.open&&(v.open=R,R?(v.opener=v.pending??v.triggers[0]??null,X(v),r&&re(v)):(W(v),r&&D(v)),v.pending=null,v.dialog.dispatchEvent(new CustomEvent(oa,{bubbles:!0,detail:{key:v.key,open:R}})))},L=(v,R)=>{if(E.has(v))return;const u=()=>{const o=f.get(R.dialog);o&&(o.pending=v,requestAnimationFrame(()=>m(o)))};v.addEventListener("click",u),E.set(v,u)},N=v=>{if(v.key!=="Tab"&&v.key!=="Escape")return;const R=v.target,u=Array.from(f.values()).find(o=>o.open&&o.dialog.contains(R));if(u){if(v.key==="Tab"){i&&V(u,v);return}j(u)}},U=()=>{const v=new Map;t.querySelectorAll(ps).forEach(u=>{const o=Ce(u,Ye);if(!o){A(`a dialog carries ${Ye} with no key in it`);return}if(v.has(o)){A(`more than one dialog for "${o}" - wiring the first one`);return}v.set(o,u)});const R=new Map;document.querySelectorAll(hs).forEach(u=>{const o=Ce(u,Tt),l=o?v.get(o):null;if(!l){o&&A(`no dialog found for the trigger "${o}"`);return}const y=R.get(l);y?y.push(u):R.set(l,[u])}),v.forEach((u,o)=>{const y=f.get(u)??{key:o,dialog:u,triggers:[],open:se(u),opener:null,pending:null,inerted:[]};y.key=o,y.triggers=R.get(u)??[],k(y),K(y),y.triggers.forEach(B=>{z(B,"aria-haspopup","dialog"),z(B,"aria-controls",u.id),P(B,o),L(B,y)}),f.set(u,y),m(y)}),E.forEach((u,o)=>{o.isConnected||(o.removeEventListener("click",u),E.delete(o))}),S.forEach((u,o)=>{o.isConnected||(o.removeEventListener("keydown",u),S.delete(o))}),f.forEach((u,o)=>{v.has(u.key)&&v.get(u.key)===o||(W(u),f.delete(o))}),G.takeRecords()},G=new MutationObserver(U),J=()=>{if(U(),document.addEventListener("keydown",N),!n)return;const v=t instanceof Document?t.documentElement:t;v&&G.observe(v,{childList:!0,subtree:!0,attributes:!0,attributeFilter:sa})};return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",J,{once:!0}):J(),{sync:U,close:v=>{for(const R of f.values())if(R.key===v)return j(R);return!1},destroy:()=>{document.removeEventListener("DOMContentLoaded",J),document.removeEventListener("keydown",N),G.disconnect(),f.forEach(W),E.forEach((v,R)=>R.removeEventListener("click",v)),S.forEach((v,R)=>R.removeEventListener("keydown",v)),E.clear(),S.clear(),f.clear(),w()}}},la=e=>{try{const t=ca(e);return console.log("[patrol-search-dialog]: Search dialogs were wired."),t}catch(t){return console.warn("[patrol-search-dialog]: Unable to wire search dialogs",t),null}};ks(),Xs(),ra(),la();const kt=ee("tab-trigger"),Rt=ee("tab-panel"),Je=`[${kt}]`,vn=`[${Rt}]`,ua="patrol:tab-change",da="patrol:tab-delete",fa="patrol:tab-menu",pa="patrol-tab-",ha="patrol-tabpanel-",ma="patrol-tablist-label-",ba=["class","style","hidden","inert","aria-hidden","open","aria-orientation",kt,Rt],Ea='h1, h2, h3, h4, h5, h6, [role="heading"]',fe=(e,t,n
6)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},Sn=(e,t)=>e.getAttribute(t)?.trim()??"",$t=(e,t,n)=>{if(e.id)return e.id;const r=`${t}${n.replace(/\s+/g,"-")}`;let i=r;for(let d=2;document.getElementById(i);d+=1)i=`${r}-${d}`;return e.id=i,i},wn=e=>{if(window.getComputedStyle(e).visibility==="hidden")return!1;for(let t=e;t;t=t.parentElement)if(t.hidden||t.hasAttribute("inert")||t.getAttribute("aria-hidden")==="true"||window.getComputedStyle(t).display==="none")return!1;return!0},ya=(e,t)=>{const n=t instanceof Document?t.body:t.parentElement;for(let r=e.parentElement;r&&r!==n;r=r.parentElement)if(r.querySelectorAll(Je).length>1)return r;return e.parentElement},ga=(e,t)=>{for(let n=e.parentElement;n&&n!==t;n=n.parentElement)n.hasAttribute("role")||fe(n,"role","presentation")},Aa=(e={})=>{const{root:t=document,observe:n=!0,activation:r="automatic",panelShortcuts:i=!0,deletable:d=!1}=e,p=new Map,g=new Map,A=new Map,w=new WeakSet,f=new WeakSet,E=new WeakSet,S=new Set,k=c=>{S.has(c)||(S.add(c),console.warn(`[patrol-tabs]: ${c}`))},P=(c,O,I)=>{$t(c,pa,I),fe(c,"role","tab"),fe(c,"aria-controls",O.map($=>$t($,ha,I)).join(" ")),O.forEach($=>fe($,"role","tabpanel")),c.tagName!=="BUTTON"?c.tagName==="A"&&c.removeAttribute("href"):c.hasAttribute("type")||fe(c,"type","button")},K=(c,O)=>{if(c.hasAttribute("aria-label")||c.hasAttribute("aria-labelledby"))return;const I=c.previousElementSibling?.matches(Ea)?c.previousElementSibling:null;if(!I){k(`tablist for "${O}" has no accessible name - add aria-label to its container`);return}fe(c,"aria-labelledby",$t(I,ma,O))},X=(c,O)=>{const I=c.panels[O]??[];H(c).forEach($=>{if(!I.includes($)||Ne($)){w.has($)&&$.removeAttribute("tabindex");return}$.hasAttribute("tabindex")&&!w.has($)||(fe($,"tabindex","0"),w.add($))})},W=(c,O)=>{const I=c.panels[O]??[];H(c).forEach($=>{if($.hasAttribute("aria-label")||$.hasAttribute("aria-labelledby")&&!f.has($))return;const Z=I.includes($)?c.tabs[O]:c.tabs.find((Q,te)=>c.panels[te].includes($));Z&&(fe($,"aria-labelledby",Z.id),f.add($))})},H=c=>Array.from(new Set(c.panels.flat())),re=c=>{let O=-1;for(let I=0;I<c.tabs.length;I+=1)if(c.panels[I].some(wn)){if(O!==-1&&c.keys[O]!==c.keys[I])return-1;O===-1&&(O=I)}return O},D=c=>{const O=c.selectedTab?c.tabs.indexOf(c.selectedTab):-1;return O!==-1?O:c.selectedKey===null?-1:c.keys.indexOf(c.selectedKey)},V=c=>{const O=c.tabs.findIndex($=>$.getAttribute("aria-selected")==="true");if(O!==-1)return O;const I=re(c);return I===-1?0:I},j=(c,O)=>{const I=c.selectedTab,$=c.selectedKey;c.selectedTab=c.tabs[O]??null,c.selectedKey=c.keys[O]??null,c.tabs.forEac
6h((Z,Q)=>{const te=Q===O;fe(Z,"aria-selected",String(te)),Z.tabIndex=te?0:-1,E.add(Z)}),W(c,O),X(c,O),I!==c.selectedTab&&c.tablist.dispatchEvent(new CustomEvent(ua,{bubbles:!0,detail:{key:c.selectedKey,previous:$,tab:c.tabs[O],panel:c.panels[O]?.[0]??null,panels:c.panels[O]??[]}}))},T=(c,O,I)=>{const $=c.tabs[O];$&&(I&&$.focus(),$.click())},m=c=>{const O=re(c);if(O===-1)return;const I=D(c);I!==-1&&c.keys[I]===c.keys[O]||j(c,O)},L=(c,O)=>{const I=(O+c.tabs.length)%c.tabs.length;r==="automatic"?T(c,I,!0):c.tabs[I]?.focus()},N=(c,O)=>{const I=c.tabs[O];if(!I.dispatchEvent(new CustomEvent(da,{bubbles:!0,cancelable:!0})))return;const $=I===c.selectedTab;c.panels[O].forEach(Q=>{c.tabs.some((te,le)=>te!==I&&c.panels[le].includes(Q))||Q.remove()}),I.remove(),o();const Z=p.get(c.tablist);!Z||!Z.tabs.length||!$||T(Z,Math.min(O,Z.tabs.length-1),!0)},U=c=>O=>{const I=O.target?.closest(Je),$=I?c.tabs.indexOf(I):-1;if($===-1)return;const Z=c.vertical?"ArrowDown":c.rtl?"ArrowLeft":"ArrowRight",Q=c.vertical?"ArrowUp":c.rtl?"ArrowRight":"ArrowLeft";let te=!0;switch(O.key){case Z:L(c,$+1);break;case Q:L(c,$-1);break;case"Home":L(c,0);break;case"End":L(c,c.tabs.length-1);break;case"Enter":case" ":c.tabs[$].tagName==="BUTTON"?te=!1:T(c,$,!0);break;case"Delete":d?N(c,$):te=!1;break;case"F10":O.shiftKey&&c.tabs[$].hasAttribute("aria-haspopup")?c.tabs[$].dispatchEvent(new CustomEvent(fa,{bubbles:!0,cancelable:!0})):te=!1;break;default:te=!1}te&&(O.preventDefault(),O.stopPropagation())},G=c=>O=>{const I=O.target.closest(Je),$=I?c.tabs.indexOf(I):-1;$!==-1&&(O.preventDefault(),j(c,$))},J=c=>{if(!c.ctrlKey||c.key!=="PageUp"&&c.key!=="PageDown")return;const O=c.target?.closest(vn);if(O)for(const I of p.values()){const $=I.panels.findIndex(Z=>Z.includes(O));if($!==-1){c.preventDefault(),T(I,($+(c.key==="PageDown"?1:-1)+I.tabs.length)%I.tabs.length,!0);return}}},v=c=>{const{tablist:O}=c;if(!g.has(O)){const I=U(c);O.addEventListener("keydown",I),g.set(O,I)}if(!A.has(O)){const I=G(c);O.addEventListener("click",I),A.set(O,I)}},R=()=>{const c=new Map;return t.querySelectorAll(vn).forEach(O=>{const I=Sn(O,Rt);if(!I)return;const $=c.get(I)??[];$.push(O),c.set(I,$)}),c},u=c=>{E.has(c)&&(c.removeAttribute("aria-selected"),c.removeAttribute("tabindex"),E.delete(c))},o=()=>{const c=R(),O=new Map;t.querySelectorAll(Je).forEach(I=>{const $=Sn(I,kt);if(!$)return;if(!wn(I)){u(I);return}const Z=c.get($);if(!Z){k(`no panel found for tab "${$}"`);return}const Q=ya(I,t);if(!Q)return;const te=O.get(Q)??{tabs:[],panels:[],keys:[]};te.tabs.push(I),te.panels.push(Z),te.keys.push($),O.set(Q,te)}),O.forEach((I,$)=>{const Z=p.get($),Q=Z??{tablist:$,tabs:[],panels:[],keys:[],selectedTab:null,selectedKey:null,vertical:!1,rtl:!1};Q.tabs=I.tabs,Q.panels=I.panels,Q.keys=I.keys,fe($,"role","tablist"),I.tabs.forEac
6h((le,pe)=>{P(le,I.panels[pe],I.keys[pe]),ga(le,$)}),K($,I.keys[0]),Q.rtl=window.getComputedStyle($).direction==="rtl"||!!$.closest('[dir="rtl"]'),Q.vertical=$.getAttribute("aria-orientation")==="vertical",p.set($,Q),v(Q);const te=Z?D(Q):-1;j(Q,te===-1?V(Q):te),m(Q)}),p.forEach((I,$)=>{if(O.has($))return;const Z=g.get($),Q=A.get($);Z&&$.removeEventListener("keydown",Z),Q&&$.removeEventListener("click",Q),g.delete($),A.delete($),p.delete($)}),l.takeRecords()},l=new MutationObserver(o);let y=0;const B=()=>{y||(y=requestAnimationFrame(()=>{y=0,o()}))},Y=()=>{if(o(),i&&document.addEventListener("keydown",J),!n)return;window.addEventListener("resize",B);const c=t instanceof Document?t.documentElement:t;c&&l.observe(c,{childList:!0,subtree:!0,attributes:!0,attributeFilter:ba})};return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Y,{once:!0}):Y(),{sync:o,select:(c,O=!1)=>{for(const I of p.values()){const $=I.keys.indexOf(c);if($!==-1)return T(I,$,O),!0}return!1},destroy:()=>{document.removeEventListener("DOMContentLoaded",Y),document.removeEventListener("keydown",J),window.removeEventListener("resize",B),l.disconnect(),y&&cancelAnimationFrame(y),g.forEach((c,O)=>O.removeEventListener("keydown",c)),A.forEach((c,O)=>O.removeEventListener("click",c)),g.clear(),A.clear(),p.clear()}}};(e=>{try{const t=Aa(e);return console.log("[patrol-tabs]: Tabs and panels were wired."),t}catch(t){return console.warn("[patrol-tabs]: Unable to wire tabs and panels",t),null}})();const va=e=>{let t=e,n=null;for(;t&&t!==document.body;){const r=t.parentElement;if(r&&getComputedStyle(r).position!=="absolute"){n=r;break}t=r}return n},Sa=".patrol-video--relative{position:relative}.patrol-video .patrol-video__button{position:absolute;right:12px;bottom:12px;z-index:2}.patrol-video[data-state=pause] .patrol-video__button{opacity:1}",wa="patrol-video-styles",Ta="patrol-video",La="patrol-video--relative",Ca="patrol-video__button",Tn="patrol-video__icon",_a="patrol-video__icon-play",Oa="patrol-video__icon-pause",ka=e=>{try{Re(wa,Sa),Ra(e).forEach($a),console.log("[video-controls]: Controls were attached to found videos.")}catch(t){console.warn("[video-controls]: Unable to add controls to found videos",t)}},Ra=e=>Array.from(document.querySelectorAll("video:not([controls])")),Ln=e=>window.getComputedStyle(e).display==="none",Cn=new WeakSet,_n=new WeakMap,$a=e=>{if(Cn.has(e))return null;const t=va(e);t.classList.add(Ta),Dt(t,La),Cn.add(e);const n=_n.get(t);if(n?.control.button.isConnected)return n.videos.push(e),On(e,t,n.control),n.control;const r={videos:[e],control:null};r.control=Pt(t,{labels:{play:"Play video",pause:"Pause video"},position:"beforeend",playing:!e.paused,onToggle:A=>{const w=r.videos.find(f=>!Ln(f));if(!w){r.control.setState(!r.videos[0].paused);return}A?w.play():w.pause()}}),_n.set(t,r);const{control:i}=r,{button:d,playIcon:p,pauseIcon:g}=i;return d.classList.add(Ca),p.classList.add(Tn,_a),g.classList.add(Tn,Oa),On(e,t,i),i},On=(e,t,n)=>{const{button:r}=n,i=()=>!Ln(e);e.addEventListener("play",function(){e.setAttribute("data-state","play"),e.setAttribute("data-state-reload","false"),i()&&(n.setState(!0),t.setAttribute("data-state","play"),r.setAttribute("data-button-state","play"),r.setAttribute("data-button-state-reload","false"),document.dispatchEvent(new CustomEvent("patrol:video-play")))}),e.addEventListener("pause",function(){e.setAttribute("data-state","pause"),i()&&(n.setState(!1),t.setAttribute("data-state","pause"),r.setAttribute("data-button-state","pause"),document.dispatchEvent(new CustomEvent("patrol:video-pause")))}),e.addEventListener("ended",function(){e.setAttribute("data-state","pause"),e.setAttribute("data-state-reload","true"),i()&&(n.setState(!1),r.setAttribute("data-button-state","pause"),r.setAttribute("data-button-state-reload","true"))})};ka(),$n()})();
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.