var pathfinder=function(t){"use strict";function e(){}function n(t){return t()}function o(t){t.forEach(n)}function r(t,...n){if(null==t)return e;const o=t.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}function i(t){let e;return r(t,(t=>e=t))(),e}const c=[],s=[],u=[],l=[],a=Promise.resolve();let f=!1;function d(){return f||(f=!0,a.then(b)),a}function h(t){u.push(t)}const g=new Set;let p=0;function b(){if(0===p){do{try{for(;p{r.delete(u),0===r.size&&(o(),o=null)}}}}function w(t,n,i){const c=!Array.isArray(t),s=c?[t]:t,u=n.length<2;return l=t=>{let i=!1;const l=[];let a=0,f=e;const d=()=>{if(a)return;f();const o=n(c?l[0]:l,t);u?t(o):f="function"==typeof o?o:e},h=s.map(((t,e)=>r(t,(t=>{l[e]=t,a&=~(1<{a|=1<1&&void 0!==arguments[1]?arguments[1]:""),"#");if(t&&N.scroll){const e=M(N.scroll)?{...N.scroll,...t}:t,{top:n=0,left:o=0}=t,{scrollHeight:r,scrollWidth:i}=document.documentElement;if(n<=r&&o<=i)return Z(e);const c=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;const o=new ResizeObserver(t);o.observe(e);const r=()=>o.unobserve(e);return setTimeout(r,n),r}((t=>{if(!t[0])return c();(!n||t[0].contentRect.height>=n)&&(!o||t[0].contentRect.width>=o)&&(c(),Z(e))}),document.documentElement)}else if(e&&N.anchor){const t=M(N.anchor)?N.anchor:{},n=document.getElementById(e);if(n)return Z(t,n);const o=X((()=>{const n=document.getElementById(e);n&&(o(),Z(t,n))}))}else N.scroll&&Z()}function B(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{encode:e=encodeURIComponent}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).reduce(((n,o)=>{if(Object.prototype.hasOwnProperty.call(t,o)&&isNaN(parseInt(o,10)))if(Array.isArray(t[o]))"separator"===N.array.format?n.push(`${o}=${t[o].join(N.array.separator)}`):t[o].forEach((t=>n.push(`${o}[]=${e(t)}`)));else if(M(t[o])){let e=F(o,t[o]);n.push(G(e))}else n.push(`${o}=${e(t[o])}`);return n}),[]).join("&")}function K(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*",{loose:n=!1,sensitive:o=!1,blank:r=!1,decode:i=decodeURIComponent}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const c={},s=e instanceof RegExp?e:e.split("/").reduce(((t,e,o,r)=>{let{length:i}=r;if(e){const n=e[0];if("*"===n)c.wild=void 0,t+="/(?.*)";else if(":"===n){const n=e.indexOf("?",1),o=e.indexOf(".",1),r=!!~n,i=!!~o,s=e.substring(1,r?n:i?o:e.length);c[s]=void 0,t+=r&&!i?`(?:/(?<${s}>[^/]+?))?`:`/(?<${s}>[^/]+?)`,i&&(t+=`${r?"?":""}\\${e.substring(o)}`)}else t+=`/${e}`}return o===i-1&&(t+=n?"(?:$|/)":"/?$"),t}),"^"),u=new RegExp(s,o?"":"i").exec(t);return u?Object.entries(u.groups||{}).reduce(((t,e)=>{let[n,o]=e;const r=i(o);return t[n]=N.convertTypes?Y(r):r,t}),{}):r?c:null}function D(t){let{decode:e=decodeURIComponent}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(t)}function H(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return!(t+="")&&(arguments.length>2&&void 0!==arguments[2]&&arguments[2])?t:0!==t.indexOf(e)?e+t:t}function q(t,e){return 0===(t+"").indexOf(e)?t.substring(e.length):t}function M(t){return!Array.isArray(t)&&"object"==typeof t&&null!==t}function V(t){return"function"==typeof t}function W(){for(var t=arguments.length,e=new Array(t),n=0;nwindow.removeEventListener(...e)}function Z(){let{top:t=0,left:e=0,...n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;o?document.documentElement.scrollIntoView?o.scrollIntoView({behavior:"smooth",...n}):window.scrollTo({top:o.offsetTop-t,behavior:"smooth",...n}):window.scrollTo({top:t,left:e,behavior:"smooth",...n})}function X(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;const n=new MutationObserver(t);n.observe(document.body,{childList:!0,subtree:!0});const o=()=>n.disconnect();return setTimeout(o,e),o}function Y(t){if(Array.isArray(t))return t[t.length-1]=Y(t[t.length-1]),t;if("object"==typeof t)return Object.entries(t).reduce(((t,e)=>{let[n,o]=e;return t[n]=Y(o),t}),{});if("true"===t||"false"===t)return"true"===t;if("null"===t)return null;if("undefined"!==t){if(""!==t&&!isNaN(Number(t))&&Number(t).toString()===t)return Number(t);if("separator"===N.array.format&&"string"==typeof t){const e=t.split(N.array.separator);return e.length>1?e:t}return t}}function F(t,e){const n=/(\[[^[\]]*])/g;let o=/(\[[^[\]]*])/.exec(t),r=o?t.slice(0,o.index):t,i=[];r&&i.push(r);let c=0;for(;(o=n.exec(t))&&c=0;--e){let o,r=t[e];if("[]"===r)o=[].concat(n);else{o={};const t="["===r.charAt(0)&&"]"===r.charAt(r.length-1)?r.slice(1,-1):r,e=parseInt(t,10);!isNaN(e)&&r!==t&&String(e)===t&&e>=0?(o=[],o[e]=N.convertTypes?Y(n):n):o[t]=n}n=o}return n}(i,e)}function G(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.entries(t).map((t=>{let[n,o]=t;return"object"==typeof o?G(o,e?`${e}[${n}]`:n):`${e}[${n}]=${o}`})).join("&")}const J=et((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"string"==typeof t&&(t=q(t,"/").split("/")),Object.prototype.hasOwnProperty.call(t,"toString")?t:Object.defineProperty(t,"toString",{value(){return H(this.join("/"))},configurable:!1,writable:!1})})),Q=et((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"string"==typeof t&&(t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",{decode:e=decodeURIComponent}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t?t.replace("?","").replace(/\+/g," ").split("&").filter(Boolean).reduce(((t,n)=>{let[o,r]=n.split(/=(.*)/,2);o=e(o||""),r=e(r||"");let i=F(o,r);return t=Object.keys(i).reduce(((t,e)=>{const n=N.convertTypes?Y(i[e]):i[e];return t[e]?Array.isArray(t[e])?t[e]=t[e].concat(n):Object.assign(t[e],n):t[e]=n,t}),t),t}),{}):{}}(t)),Object.prototype.hasOwnProperty.call(t,"toString")?t:Object.defineProperty(t,"toString",{value(){return H(B(this),"?",!0)},configurable:!1,writable:!1})})),tt=et((function(){return H(D(arguments.length>0&&void 0!==arguments[0]?arguments[0]:""),"#",!0)}));function et(t){return(e,n)=>{let o=e&&e.toString();!Array.isArray(n)&&(n=[n]);const r=new Set(n),c=function(t){return function(){for(var e=arguments.length,n=new Array(e),o=0;o!1===t(...n))):r.reduce(((t,e)=>!1===e(...n)||t),!1))}}(r),{subscribe:s,set:u}=v(e=t(e),(()=>()=>r.clear()));function l(n){(n=t(n)).toString()!==o&&!1!==c(n,e,t.name)&&(o=n.toString(),u(e=n))}return c(null,e,t.name),{subscribe:s,update(t){l(t(i(this)))},set(t){l(t)},hook:n=>(V(n)&&(r.add(n),n(null,e,t.name)),()=>r.delete(n))}}}const nt=function(){const t=C().pathname;if(!t)return;return H(q(t,P()))}(),{search:ot,hash:rt}=C();let it=!0,ct=!1,st=!1,ut=0;const lt=J(nt,pt),at=Q(ot,pt),ft=tt(rt,pt),dt=v({}),ht=w([lt,at,ft],((t,e)=>{let[n,o,r]=t,i=!1;return d().then((()=>{i||e(n+o+r)})),()=>i=!0}),nt+ot+rt),gt=w(lt,(t=>K.bind(null,t.toString())));function pt(){(N.scroll||N.focus)&&dt.update((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return N.scroll&&(t._scroll={top:window.pageYOffset,left:window.pageXOffset}),N.focus&&(t._focus=document.activeElement.id),t}))}function bt(t,e){const n=t.indexOf("#")>=0?t.slice(t.indexOf("#")):"",o=document.activeElement;!M(e)&&(e={}),d().then((()=>function(t,e){function n(){return t?document.getElementById(t):document.activeElement!==e&&document.activeElement!==document.body?document.activeElement:document.querySelector("[autofocus]")}N.focus&&setTimeout((()=>{const t=n();if(t)return t.focus();const e=X((()=>{const t=n();t&&(e(),t.focus())})),o=document.body,r=o.getAttribute("tabindex");o.tabIndex=-1,o.focus({preventScroll:!0}),null!==r?o.setAttribute("tabindex",r):o.removeAttribute("tabindex"),getSelection().removeAllRanges()}))}(e._focus,o))).then((()=>z(e._scroll,n)))}if(k||S){const t=new Set;t.add(ht.subscribe((t=>{it||ct||!N.sideEffect||(E?history[st?"replaceState":"pushState"]({},null,T(t)):location.hash=T(t)),!ct&&bt(t),!st&&ut++,it=st=ct=!1}))),E?(t.add(dt.subscribe((t=>{!it&&N.sideEffect&&history.replaceState(t,null,location.pathname+location.search+location.hash)}))),t.add(W("popstate",(t=>{ct=!0,mt(location.href,t.state),bt(U(location.href),t.state)})))):t.add(W("hashchange",(()=>{if(ct=!0,!N.hashbang&&!I)return ft.set(location.hash);mt(location.hash),bt(U(location.hash))}))),t.add(W("beforeunload",(()=>{t.forEach((t=>t())),t.clear()}),!0))}function mt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{pathname:n,search:o,hash:r}=t instanceof URL?t:new URL(U(t),"file:");lt.set(n),at.set(o),ft.set(r),d().then((()=>dt.set(e||{})))}const yt=function(t){return function(e){let n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e instanceof RegExp)throw new Error("Paramable does not support RegExp patterns.");e=e.replace(/\/$/,"");const{subscribe:r}=v({},(r=>t.subscribe((t=>{var i;n=K(t.toString(),e,{blank:!0,...o}),r("object"!=typeof(i=n)||null===i?i:Object.create(Object.getPrototypeOf(i),Object.getOwnPropertyDescriptors(i)))}))));function c(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.entries(n).some((t=>{let[e,n]=t;return n!==r[e]}))&&t.update((t=>{const n=o.loose?H(t.slice(e.split("/").length-1).join("/")):"";return function(t,e){let{encode:n=encodeURIComponent}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.replace(/(\/|^)([:*][^/]*?)(\?)?(?=[/.]|$)/g,((t,o,r)=>(t=e["*"===r?"wild":r.substring(1)])?`/${n(t)}`:""))}(e+n,r)}))}return{get(){return i(this)},update(t){c(t(this.get()))},subscribe:r,set:c}}}(lt);return t.back=function(t){ut>0&&k&&N.sideEffect?(history.back(),ut--):d().then((()=>mt(t)))},t.click=function(t){if(!t.target||t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button||1!==t.which||t.defaultPrevented)return;const e=function(t,e){for(;t&&t.nodeName.toLowerCase()!==e;)t=t.parentNode;return t&&t.nodeName.toLowerCase()===e?t:null}(t.target,"a");if(!e||e.target||e.hasAttribute("download")||e.hasAttribute("rel")&&e.getAttribute("rel").includes("external"))return;const n=e.getAttribute("href"),o=e.href;!n||0!==o.indexOf(location.origin)||O.test(n)||!N.hashbang&&!I&&n.startsWith("#")||(t.preventDefault(),mt(o,Object.assign({},e.dataset)))},t.fragment=ft,t.goto=mt,t.paramable=yt,t.path=lt,t.pattern=gt,t.prefs=N,t.query=at,t.redirect=function(t,e){d().then((()=>{st=!0,mt(t,e)}))},t.state=dt,t.submit=function(t){if(!t.target||t.defaultPrevented)return;const e=t.target,n=t.submitter||_(document.activeElement)&&document.activeElement;let o=e.action,r=e.method,i=e.target;if(n&&(n.hasAttribute("formaction")&&(o=n.formAction),n.hasAttribute("formmethod")&&(r=n.formMethod),n.hasAttribute("formtarget")&&(i=n.formTarget)),r&&"get"!==r.toLowerCase())return;if(i&&"_self"!==i.toLowerCase())return;const{pathname:c,hash:s}=new URL(o),u=[],l={},a=e.elements,f=a.length;for(let t=0;t