-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostscript.js
5 lines (5 loc) · 50.4 KB
/
postscript.js
1
2
3
4
5
(function(){var H='<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg>',q='<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true"><path fill-rule="evenodd" fill="rgb(63, 185, 80)" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>';document.addEventListener("nav",()=>{let _=document.getElementsByTagName("pre");for(let I=0;I<_.length;I++){let z=_[I].getElementsByTagName("code")[0];if(z){let U=function(){navigator.clipboard.writeText(O).then(()=>{C.blur(),C.innerHTML=q,setTimeout(()=>{C.innerHTML=H,C.style.borderColor=""},2e3)},W=>console.error(W))};var F=U;let O=z.innerText.replace(/\n\n/g,`
`),C=document.createElement("button");C.className="clipboard-button",C.type="button",C.innerHTML=H,C.ariaLabel="Copy source",C.addEventListener("click",U),window.addCleanup(()=>C.removeEventListener("click",U)),_[I].prepend(C)}}})})(),function(){var H,q=new IntersectionObserver(O=>{let C=document.getElementById("explorer-ul");if(C)for(let W of O)W.isIntersecting?C.classList.add("no-background"):C.classList.remove("no-background")});function _(){this.classList.toggle("collapsed"),this.setAttribute("aria-expanded",this.getAttribute("aria-expanded")==="true"?"false":"true");let O=this.nextElementSibling;O&&(O.classList.toggle("collapsed"),O.style.maxHeight=O.style.maxHeight==="0px"?O.scrollHeight+"px":"0px")}function F(O){O.stopPropagation();let C=O.target;if(!C)return;let W=C.nodeName==="svg",V=W?C.parentElement?.nextSibling:C.parentElement?.parentElement?.nextElementSibling,k=W?C.nextElementSibling:C.parentElement;if(!(V&&k))return;V.classList.toggle("open");let G=V.classList.contains("open");z(V,!G);let D=k.dataset.folderpath;U(H,D);let j=JSON.stringify(H);localStorage.setItem("fileTree",j)}function I(){let O=document.getElementById("explorer");if(!O)return;if(O.dataset.behavior==="collapse")for(let D of document.getElementsByClassName("folder-button"))D.addEventListener("click",F),window.addCleanup(()=>D.removeEventListener("click",F));O.nodeName==="BUTTON"&&(O.addEventListener("click",_),window.addCleanup(()=>O.removeEventListener("click",_)));for(let D of document.getElementsByClassName("folder-icon"))D.addEventListener("click",F),window.addCleanup(()=>D.removeEventListener("click",F));let C=localStorage.getItem("fileTree"),W=O?.dataset.savestate==="true",V=C&&W?JSON.parse(C):[],k=new Map(V.map(D=>[D.path,D.collapsed])),G=O.dataset.tree?JSON.parse(O.dataset.tree):[];H=[];for(let{path:D,collapsed:j}of G)H.push({path:D,collapsed:k.get(D)??j});H.map(D=>{let j=document.querySelector(`[data-folderpath='${D.path}']`)?.parentElement?.nextElementSibling;j&&z(j,D.collapsed)})}window.addEventListener("resize",I),document.addEventListener("nav",()=>{I(),q.disconnect();let O=document.getElementById("explorer-end");O&&q.observe(O)});function z(O,C){return C?O.classList.remove("open"):O.classList.add("open")}function U(O,C){let W=O.find(V=>V.path===C);W&&(W.collapsed=!W.collapsed)}}(),function(){var H=new IntersectionObserver(F=>{for(let I of F){let z=I.target.id,U=document.querySelector(`a[data-for="${z}"]`),O=I.rootBounds?.height;O&&U&&(I.boundingClientRect.y<O?U.classList.add("in-view"):U.classList.remove("in-view"))}});function q(){this.classList.toggle("collapsed"),this.setAttribute("aria-expanded",this.getAttribute("aria-expanded")==="true"?"false":"true");let F=this.nextElementSibling;F&&(F.classList.toggle("collapsed"),F.style.maxHeight=F.style.maxHeight==="0px"?F.scrollHeight+"px":"0px")}function _(){let F=document.getElementById("toc");if(F){let I=F.classList.contains("collapsed"),z=F.nextElementSibling;if(!z)return;z.style.maxHeight=I?"0px":z.scrollHeight+"px",F.addEventListener("click",q),window.addCleanup(()=>F.removeEventListener("click",q))}}window.addEventListener("resize",_),document.addEventListener("nav",()=>{_(),H.disconnect(),document.querySelectorAll("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").forEach(F=>H.observe(F))})}(),function(){var H=Object.create,q=Object.defineProperty,_=Object.getOwnPropertyDescriptor,F=Object.getOwnPropertyNames,I=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),O=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of F(t))!z.call(e,i)&&i!==n&&q(e,i,{get:()=>t[i],enumerable:!(r=_(t,i))||r.enumerable});return e},C=(e,t,n)=>(n=e!=null?H(I(e)):{},O(t||!e||!e.__esModule?q(n,"default",{value:e,enumerable:!0}):n,e)),W=U(()=>{}),V=U((e,t)=>{"use strict";t.exports=r;function n(l){return l instanceof Buffer?Buffer.from(l):new l.constructor(l.buffer.slice(),l.byteOffset,l.length)}function r(l){if(l=l||{},l.circles)return i(l);let a=new Map;if(a.set(Date,u=>new Date(u)),a.set(Map,(u,p)=>new Map(g(Array.from(u),p))),a.set(Set,(u,p)=>new Set(g(Array.from(u),p))),l.constructorHandlers)for(let u of l.constructorHandlers)a.set(u[0],u[1]);let s=null;return l.proto?m:d;function g(u,p){let h=Object.keys(u),f=new Array(h.length);for(let y=0;y<h.length;y++){let w=h[y],v=u[w];typeof v!="object"||v===null?f[w]=v:v.constructor!==Object&&(s=a.get(v.constructor))?f[w]=s(v,p):ArrayBuffer.isView(v)?f[w]=n(v):f[w]=p(v)}return f}function d(u){if(typeof u!="object"||u===null)return u;if(Array.isArray(u))return g(u,d);if(u.constructor!==Object&&(s=a.get(u.constructor)))return s(u,d);let p={};for(let h in u){if(Object.hasOwnProperty.call(u,h)===!1)continue;let f=u[h];typeof f!="object"||f===null?p[h]=f:f.constructor!==Object&&(s=a.get(f.constructor))?p[h]=s(f,d):ArrayBuffer.isView(f)?p[h]=n(f):p[h]=d(f)}return p}function m(u){if(typeof u!="object"||u===null)return u;if(Array.isArray(u))return g(u,m);if(u.constructor!==Object&&(s=a.get(u.constructor)))return s(u,m);let p={};for(let h in u){let f=u[h];typeof f!="object"||f===null?p[h]=f:f.constructor!==Object&&(s=a.get(f.constructor))?p[h]=s(f,m):ArrayBuffer.isView(f)?p[h]=n(f):p[h]=m(f)}return p}}function i(l){let a=[],s=[],g=new Map;if(g.set(Date,h=>new Date(h)),g.set(Map,(h,f)=>new Map(m(Array.from(h),f))),g.set(Set,(h,f)=>new Set(m(Array.from(h),f))),l.constructorHandlers)for(let h of l.constructorHandlers)g.set(h[0],h[1]);let d=null;return l.proto?p:u;function m(h,f){let y=Object.keys(h),w=new Array(y.length);for(let v=0;v<y.length;v++){let E=y[v],L=h[E];if(typeof L!="object"||L===null)w[E]=L;else if(L.constructor!==Object&&(d=g.get(L.constructor)))w[E]=d(L,f);else if(ArrayBuffer.isView(L))w[E]=n(L);else{let N=a.indexOf(L);N!==-1?w[E]=s[N]:w[E]=f(L)}}return w}function u(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return m(h,u);if(h.constructor!==Object&&(d=g.get(h.constructor)))return d(h,u);let f={};a.push(h),s.push(f);for(let y in h){if(Object.hasOwnProperty.call(h,y)===!1)continue;let w=h[y];if(typeof w!="object"||w===null)f[y]=w;else if(w.constructor!==Object&&(d=g.get(w.constructor)))f[y]=d(w,u);else if(ArrayBuffer.isView(w))f[y]=n(w);else{let v=a.indexOf(w);v!==-1?f[y]=s[v]:f[y]=u(w)}}return a.pop(),s.pop(),f}function p(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return m(h,p);if(h.constructor!==Object&&(d=g.get(h.constructor)))return d(h,p);let f={};a.push(h),s.push(f);for(let y in h){let w=h[y];if(typeof w!="object"||w===null)f[y]=w;else if(w.constructor!==Object&&(d=g.get(w.constructor)))f[y]=d(w,p);else if(ArrayBuffer.isView(w))f[y]=n(w);else{let v=a.indexOf(w);v!==-1?f[y]=s[v]:f[y]=p(w)}}return a.pop(),s.pop(),f}}}),k;function G(e){return typeof e<"u"?e:!0}function D(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=j();return t}function j(){return Object.create(null)}function st(e,t){return t.length-e.length}function P(e){return typeof e=="string"}function J(e){return typeof e=="object"}function ee(e){return typeof e=="function"}function De(e,t){var n=qe;if(e&&(t&&(e=Ee(e,t)),this.H&&(e=Ee(e,this.H)),this.J&&1<e.length&&(e=Ee(e,this.J)),n||n==="")){if(t=e.split(n),this.filter){e=this.filter,n=t.length;let r=[];for(let i=0,l=0;i<n;i++){let a=t[i];a&&!e[a]&&(r[l++]=a)}e=r}else e=t;return e}return e}var qe=/[\p{Z}\p{S}\p{P}\p{C}]+/u,ze=/[\u0300-\u036f]/g;function xe(e,t){let n=Object.keys(e),r=n.length,i=[],l="",a=0;for(let s=0,g,d;s<r;s++)g=n[s],(d=e[g])?(i[a++]=B(t?"(?!\\b)"+g+"(\\b|_)":g),i[a++]=d):l+=(l?"|":"")+g;return l&&(i[a++]=B(t?"(?!\\b)("+l+")(\\b|_)":"("+l+")"),i[a]=""),i}function Ee(e,t){for(let n=0,r=t.length;n<r&&(e=e.replace(t[n],t[n+1]),e);n+=2);return e}function B(e){return new RegExp(e,"g")}function Ke(e){let t="",n="";for(let r=0,i=e.length,l;r<i;r++)(l=e[r])!==n&&(t+=n=l);return t}var Me={encode:_e,F:!1,G:""};function _e(e){return De.call(this,(""+e).toLowerCase(),!1)}var Ue={},te={};function Ge(e){we(e,"add"),we(e,"append"),we(e,"search"),we(e,"update"),we(e,"remove")}function we(e,t){e[t+"Async"]=function(){let n=this,r=arguments;var i=r[r.length-1];let l;return ee(i)&&(l=i,delete r[r.length-1]),i=new Promise(function(a){setTimeout(function(){n.async=!0;let s=n[t].apply(n,r);n.async=!1,a(s)})}),l?(i.then(l),this):i}}function he(e,t,n,r){let i=e.length,l=[],a,s,g=0;r&&(r=[]);for(let d=i-1;0<=d;d--){let m=e[d],u=m.length,p=j(),h=!a;for(let f=0;f<u;f++){let y=m[f],w=y.length;if(w)for(let v=0,E,L;v<w;v++)if(L=y[v],a){if(a[L]){if(!d){if(n)n--;else if(l[g++]=L,g===t)return l}(d||r)&&(p[L]=1),h=!0}if(r&&(E=(s[L]||0)+1,s[L]=E,E<i)){let N=r[E-2]||(r[E-2]=[]);N[N.length]=L}}else p[L]=1}if(r)a||(s=p);else if(!h)return[];a=p}if(r)for(let d=r.length-1,m,u;0<=d;d--){m=r[d],u=m.length;for(let p=0,h;p<u;p++)if(h=m[p],!a[h]){if(n)n--;else if(l[g++]=h,g===t)return l;a[h]=1}}return l}function Je(e,t){let n=j(),r=j(),i=[];for(let l=0;l<e.length;l++)n[e[l]]=1;for(let l=0,a;l<t.length;l++){a=t[l];for(let s=0,g;s<a.length;s++)g=a[s],n[g]&&!r[g]&&(r[g]=1,i[i.length]=g)}return i}function Se(e){this.l=e!==!0&&e,this.cache=j(),this.h=[]}function Re(e,t,n){J(e)&&(e=e.query);let r=this.cache.get(e);return r||(r=this.search(e,t,n),this.cache.set(e,r)),r}Se.prototype.set=function(e,t){if(!this.cache[e]){var n=this.h.length;for(n===this.l?delete this.cache[this.h[n-1]]:n++,--n;0<n;n--)this.h[n]=this.h[n-1];this.h[0]=e}this.cache[e]=t},Se.prototype.get=function(e){let t=this.cache[e];if(this.l&&t&&(e=this.h.indexOf(e))){let n=this.h[e-1];this.h[e-1]=this.h[e],this.h[e]=n}return t};var at={memory:{charset:"latin:extra",D:3,B:4,m:!1},performance:{D:3,B:3,s:!1,context:{depth:2,D:1}},match:{charset:"latin:extra",G:"reverse"},score:{charset:"latin:advanced",D:20,B:3,context:{depth:3,D:9}},default:{}};function Pe(e,t,n,r,i,l,a,s){setTimeout(function(){let g=e(n?n+"."+r:r,JSON.stringify(a));g&&g.then?g.then(function(){t.export(e,t,n,i,l+1,s)}):t.export(e,t,n,i,l+1,s)})}function de(e,t){if(!(this instanceof de))return new de(e);var n;if(e){P(e)?e=at[e]:(n=e.preset)&&(e=Object.assign({},n[n],e)),n=e.charset;var r=e.lang;P(n)&&(n.indexOf(":")===-1&&(n+=":default"),n=te[n]),P(r)&&(r=Ue[r])}else e={};let i,l,a=e.context||{};if(this.encode=e.encode||n&&n.encode||_e,this.register=t||j(),this.D=i=e.resolution||9,this.G=t=n&&n.G||e.tokenize||"strict",this.depth=t==="strict"&&a.depth,this.l=G(a.bidirectional),this.s=l=G(e.optimize),this.m=G(e.fastupdate),this.B=e.minlength||1,this.C=e.boost,this.map=l?D(i):j(),this.A=i=a.resolution||1,this.h=l?D(i):j(),this.F=n&&n.F||e.rtl,this.H=(t=e.matcher||r&&r.H)&&xe(t,!1),this.J=(t=e.stemmer||r&&r.J)&&xe(t,!0),n=t=e.filter||r&&r.filter){n=t,r=j();for(let s=0,g=n.length;s<g;s++)r[n[s]]=1;n=r}this.filter=n,this.cache=(t=e.cache)&&new Se(t)}k=de.prototype,k.append=function(e,t){return this.add(e,t,!0)},k.add=function(e,t,n,r){if(t&&(e||e===0)){if(!r&&!n&&this.register[e])return this.update(e,t);if(t=this.encode(t),r=t.length){let d=j(),m=j(),u=this.depth,p=this.D;for(let h=0;h<r;h++){let f=t[this.F?r-1-h:h];var i=f.length;if(f&&i>=this.B&&(u||!m[f])){var l=Fe(p,r,h),a="";switch(this.G){case"full":if(2<i){for(l=0;l<i;l++)for(var s=i;s>l;s--)if(s-l>=this.B){var g=Fe(p,r,h,i,l);a=f.substring(l,s),Le(this,m,a,g,e,n)}break}case"reverse":if(1<i){for(s=i-1;0<s;s--)a=f[s]+a,a.length>=this.B&&Le(this,m,a,Fe(p,r,h,i,s),e,n);a=""}case"forward":if(1<i){for(s=0;s<i;s++)a+=f[s],a.length>=this.B&&Le(this,m,a,l,e,n);break}default:if(this.C&&(l=Math.min(l/this.C(t,f,h)|0,p-1)),Le(this,m,f,l,e,n),u&&1<r&&h<r-1){for(i=j(),a=this.A,l=f,s=Math.min(u+1,r-h),i[l]=1,g=1;g<s;g++)if((f=t[this.F?r-1-h-g:h+g])&&f.length>=this.B&&!i[f]){i[f]=1;let y=this.l&&f>l;Le(this,d,y?l:f,Fe(a+(r/2>a?0:1),r,h,s-1,g-1),e,n,y?f:l)}}}}}this.m||(this.register[e]=1)}}return this};function Fe(e,t,n,r,i){return n&&1<e?t+(r||0)<=e?n+(i||0):(e-1)/(t+(r||0))*(n+(i||0))+1|0:0}function Le(e,t,n,r,i,l,a){let s=a?e.h:e.map;(!t[n]||a&&!t[n][a])&&(e.s&&(s=s[r]),a?(t=t[n]||(t[n]=j()),t[a]=1,s=s[a]||(s[a]=j())):t[n]=1,s=s[n]||(s[n]=[]),e.s||(s=s[r]||(s[r]=[])),l&&s.includes(i)||(s[s.length]=i,e.m&&(e=e.register[i]||(e.register[i]=[]),e[e.length]=s)))}k.search=function(e,t,n){n||(!t&&J(e)?(n=e,e=n.query):J(t)&&(n=t));let r=[],i,l,a=0;if(n){e=n.query||e,t=n.limit,a=n.offset||0;var s=n.context;l=n.suggest}if(e&&(e=this.encode(""+e),i=e.length,1<i)){n=j();var g=[];for(let m=0,u=0,p;m<i;m++)if((p=e[m])&&p.length>=this.B&&!n[p])if(this.s||l||this.map[p])g[u++]=p,n[p]=1;else return r;e=g,i=e.length}if(!i)return r;t||(t=100),s=this.depth&&1<i&&s!==!1,n=0;let d;s?(d=e[0],n=1):1<i&&e.sort(st);for(let m,u;n<i;n++){if(u=e[n],s?(m=pe(this,r,l,t,a,i===2,u,d),l&&m===!1&&r.length||(d=u)):m=pe(this,r,l,t,a,i===1,u),m)return m;if(l&&n===i-1){if(g=r.length,!g){if(s){s=0,n=-1;continue}return r}if(g===1)return $(r[0],t,a)}}return he(r,t,a,l)};function pe(e,t,n,r,i,l,a,s){let g=[],d=s?e.h:e.map;if(e.s||(d=ie(d,a,s,e.l)),d){let m=0,u=Math.min(d.length,s?e.A:e.D);for(let p=0,h=0,f,y;p<u&&!((f=d[p])&&(e.s&&(f=ie(f,a,s,e.l)),i&&f&&l&&(y=f.length,y<=i?(i-=y,f=null):(f=f.slice(i),i=0)),f&&(g[m++]=f,l&&(h+=f.length,h>=r))));p++);if(m){if(l)return $(g,r,0);t[t.length]=g;return}}return!n&&g}function $(e,t,n){return e=e.length===1?e[0]:[].concat.apply([],e),n||e.length>t?e.slice(n,n+t):e}function ie(e,t,n,r){return n?(r=r&&t>n,e=(e=e[r?t:n])&&e[r?n:t]):e=e[t],e}k.contain=function(e){return!!this.register[e]},k.update=function(e,t){return this.remove(e).add(e,t)},k.remove=function(e,t){let n=this.register[e];if(n){if(this.m)for(let r=0,i;r<n.length;r++)i=n[r],i.splice(i.indexOf(e),1);else Ae(this.map,e,this.D,this.s),this.depth&&Ae(this.h,e,this.A,this.s);if(t||delete this.register[e],this.cache){t=this.cache;for(let r=0,i,l;r<t.h.length;r++)l=t.h[r],i=t.cache[l],i.includes(e)&&(t.h.splice(r--,1),delete t.cache[l])}}return this};function Ae(e,t,n,r,i){let l=0;if(e.constructor===Array)if(i)t=e.indexOf(t),t!==-1?1<e.length&&(e.splice(t,1),l++):l++;else{i=Math.min(e.length,n);for(let a=0,s;a<i;a++)(s=e[a])&&(l=Ae(s,t,n,r,i),r||l||delete e[a])}else for(let a in e)(l=Ae(e[a],t,n,r,i))||delete e[a];return l}k.searchCache=Re,k.export=function(e,t,n,r,i,l){let a=!0;typeof l>"u"&&(a=new Promise(d=>{l=d}));let s,g;switch(i||(i=0)){case 0:if(s="reg",this.m){g=j();for(let d in this.register)g[d]=1}else g=this.register;break;case 1:s="cfg",g={doc:0,opt:this.s?1:0};break;case 2:s="map",g=this.map;break;case 3:s="ctx",g=this.h;break;default:typeof n>"u"&&l&&l();return}return Pe(e,t||this,n,s,r,i,g,l),a},k.import=function(e,t){if(t)switch(P(t)&&(t=JSON.parse(t)),e){case"cfg":this.s=!!t.opt;break;case"reg":this.m=!1,this.register=t;break;case"map":this.map=t;break;case"ctx":this.h=t}},Ge(de.prototype);function X(e){e=e.data;var t=self._index;let n=e.args;var r=e.task;switch(r){case"init":r=e.options||{},e=e.factory,t=r.encode,r.cache=!1,t&&t.indexOf("function")===0&&(r.encode=Function("return "+t)()),e?(Function("return "+e)()(self),self._index=new self.FlexSearch.Index(r),delete self.FlexSearch):self._index=new de(r);break;default:e=e.id,t=t[r].apply(t,n),postMessage(r==="search"?{id:e,msg:t}:{id:e})}}var Y=0;function ge(e){if(!(this instanceof ge))return new ge(e);var t;e?ee(t=e.encode)&&(e.encode=t.toString()):e={},(t=(self||window)._factory)&&(t=t.toString());let n=typeof window>"u"&&self.exports,r=this;this.o=ct(t,n,e.worker),this.h=j(),this.o&&(n?this.o.on("message",function(i){r.h[i.id](i.msg),delete r.h[i.id]}):this.o.onmessage=function(i){i=i.data,r.h[i.id](i.msg),delete r.h[i.id]},this.o.postMessage({task:"init",factory:t,options:e}))}oe("add"),oe("append"),oe("search"),oe("update"),oe("remove");function oe(e){ge.prototype[e]=ge.prototype[e+"Async"]=function(){let t=this,n=[].slice.call(arguments);var r=n[n.length-1];let i;return ee(r)&&(i=r,n.splice(n.length-1,1)),r=new Promise(function(l){setTimeout(function(){t.h[++Y]=l,t.o.postMessage({task:e,id:Y,args:n})})}),i?(r.then(i),this):r}}function ct(e,t,n){let r;try{r=t?new(W()).Worker(__dirname+"/node/node.js"):e?new Worker(URL.createObjectURL(new Blob(["onmessage="+X.toString()],{type:"text/javascript"}))):new Worker(P(n)?n:"worker/worker.js",{type:"module"})}catch{}return r}function ae(e){if(!(this instanceof ae))return new ae(e);var t=e.document||e.doc||e,n;this.K=[],this.h=[],this.A=[],this.register=j(),this.key=(n=t.key||t.id)&&ve(n,this.A)||"id",this.m=G(e.fastupdate),this.C=(n=t.store)&&n!==!0&&[],this.store=n&&j(),this.I=(n=t.tag)&&ve(n,this.A),this.l=n&&j(),this.cache=(n=e.cache)&&new Se(n),e.cache=!1,this.o=e.worker,this.async=!1,n=j();let r=t.index||t.field||t;P(r)&&(r=[r]);for(let i=0,l,a;i<r.length;i++)l=r[i],P(l)||(a=l,l=l.field),a=J(a)?Object.assign({},e,a):e,this.o&&(n[l]=new ge(a),n[l].o||(this.o=!1)),this.o||(n[l]=new de(a,this.register)),this.K[i]=ve(l,this.A),this.h[i]=l;if(this.C)for(e=t.store,P(e)&&(e=[e]),t=0;t<e.length;t++)this.C[t]=ve(e[t],this.A);this.index=n}function ve(e,t){let n=e.split(":"),r=0;for(let i=0;i<n.length;i++)e=n[i],0<=e.indexOf("[]")&&(e=e.substring(0,e.length-2))&&(t[r]=!0),e&&(n[r++]=e);return r<n.length&&(n.length=r),1<r?n:n[0]}function Ne(e,t){if(P(t))e=e[t];else for(let n=0;e&&n<t.length;n++)e=e[t[n]];return e}function ke(e,t,n,r,i){if(e=e[i],r===n.length-1)t[i]=e;else if(e)if(e.constructor===Array)for(t=t[i]=Array(e.length),i=0;i<e.length;i++)ke(e,t,n,r,i);else t=t[i]||(t[i]=j()),i=n[++r],ke(e,t,n,r,i)}function ce(e,t,n,r,i,l,a,s){if(e=e[a])if(r===t.length-1){if(e.constructor===Array){if(n[r]){for(t=0;t<e.length;t++)i.add(l,e[t],!0,!0);return}e=e.join(" ")}i.add(l,e,s,!0)}else if(e.constructor===Array)for(a=0;a<e.length;a++)ce(e,t,n,r,i,l,a,s);else a=t[++r],ce(e,t,n,r,i,l,a,s)}k=ae.prototype,k.add=function(e,t,n){if(J(e)&&(t=e,e=Ne(t,this.key)),t&&(e||e===0)){if(!n&&this.register[e])return this.update(e,t);for(let r=0,i,l;r<this.h.length;r++)l=this.h[r],i=this.K[r],P(i)&&(i=[i]),ce(t,i,this.A,0,this.index[l],e,i[0],n);if(this.I){let r=Ne(t,this.I),i=j();P(r)&&(r=[r]);for(let l=0,a,s;l<r.length;l++)if(a=r[l],!i[a]&&(i[a]=1,s=this.l[a]||(this.l[a]=[]),!n||!s.includes(e))&&(s[s.length]=e,this.m)){let g=this.register[e]||(this.register[e]=[]);g[g.length]=s}}if(this.store&&(!n||!this.store[e])){let r;if(this.C){r=j();for(let i=0,l;i<this.C.length;i++)l=this.C[i],P(l)?r[l]=t[l]:ke(t,r,l,0,l[0])}this.store[e]=r||t}}return this},k.append=function(e,t){return this.add(e,t,!0)},k.update=function(e,t){return this.remove(e).add(e,t)},k.remove=function(e){if(J(e)&&(e=Ne(e,this.key)),this.register[e]){for(var t=0;t<this.h.length&&(this.index[this.h[t]].remove(e,!this.o),!this.m);t++);if(this.I&&!this.m)for(let n in this.l){t=this.l[n];let r=t.indexOf(e);r!==-1&&(1<t.length?t.splice(r,1):delete this.l[n])}this.store&&delete this.store[e],delete this.register[e]}return this},k.search=function(e,t,n,r){n||(!t&&J(e)?(n=e,e=""):J(t)&&(n=t,t=0));let i=[],l=[],a,s,g,d,m,u,p=0;if(n)if(n.constructor===Array)g=n,n=null;else{if(e=n.query||e,g=(a=n.pluck)||n.index||n.field,d=n.tag,s=this.store&&n.enrich,m=n.bool==="and",t=n.limit||t||100,u=n.offset||0,d&&(P(d)&&(d=[d]),!e)){for(let f=0,y;f<d.length;f++)(y=Z.call(this,d[f],t,u,s))&&(i[i.length]=y,p++);return p?i:[]}P(g)&&(g=[g])}g||(g=this.h),m=m&&(1<g.length||d&&1<d.length);let h=!r&&(this.o||this.async)&&[];for(let f=0,y,w,v;f<g.length;f++){let E;if(w=g[f],P(w)||(E=w,w=E.field,e=E.query||e,t=E.limit||t,s=E.enrich||s),h)h[f]=this.index[w].searchAsync(e,t,E||n);else{if(r?y=r[f]:y=this.index[w].search(e,t,E||n),v=y&&y.length,d&&v){let L=[],N=0;m&&(L[0]=[y]);for(let Q=0,ne,le;Q<d.length;Q++)ne=d[Q],(v=(le=this.l[ne])&&le.length)&&(N++,L[L.length]=m?[le]:le);N&&(y=m?he(L,t||100,u||0):Je(y,L),v=y.length)}if(v)l[p]=w,i[p++]=y;else if(m)return[]}}if(h){let f=this;return new Promise(function(y){Promise.all(h).then(function(w){y(f.search(e,t,n,w))})})}if(!p)return[];if(a&&(!s||!this.store))return i[0];for(let f=0,y;f<l.length;f++){if(y=i[f],y.length&&s&&(y=Oe.call(this,y)),a)return y;i[f]={field:l[f],result:y}}return i};function Z(e,t,n,r){let i=this.l[e],l=i&&i.length-n;if(l&&0<l)return(l>t||n)&&(i=i.slice(n,n+t)),r&&(i=Oe.call(this,i)),{tag:e,result:i}}function Oe(e){let t=Array(e.length);for(let n=0,r;n<e.length;n++)r=e[n],t[n]={id:r,doc:this.store[r]};return t}k.contain=function(e){return!!this.register[e]},k.get=function(e){return this.store[e]},k.set=function(e,t){return this.store[e]=t,this},k.searchCache=Re,k.export=function(e,t,n,r,i,l){let a;if(typeof l>"u"&&(a=new Promise(s=>{l=s})),i||(i=0),r||(r=0),r<this.h.length){let s=this.h[r],g=this.index[s];t=this,setTimeout(function(){g.export(e,t,i?s:"",r,i++,l)||(r++,i=1,t.export(e,t,s,r,i,l))})}else{let s,g;switch(i){case 1:s="tag",g=this.l,n=null;break;case 2:s="store",g=this.store,n=null;break;default:l();return}Pe(e,this,n,s,r,i,g,l)}return a},k.import=function(e,t){if(t)switch(P(t)&&(t=JSON.parse(t)),e){case"tag":this.l=t;break;case"reg":this.m=!1,this.register=t;for(let r=0,i;r<this.h.length;r++)i=this.index[this.h[r]],i.register=t,i.m=!1;break;case"store":this.store=t;break;default:e=e.split(".");let n=e[0];e=e[1],n&&e&&this.index[n].import(e,t)}},Ge(ae.prototype);var fe={encode:Te,F:!1,G:""},Xe=[B("[\xE0\xE1\xE2\xE3\xE4\xE5]"),"a",B("[\xE8\xE9\xEA\xEB]"),"e",B("[\xEC\xED\xEE\xEF]"),"i",B("[\xF2\xF3\xF4\xF5\xF6\u0151]"),"o",B("[\xF9\xFA\xFB\xFC\u0171]"),"u",B("[\xFD\u0177\xFF]"),"y",B("\xF1"),"n",B("[\xE7c]"),"k",B("\xDF"),"s",B(" & ")," and "];function Te(e){var t=e=""+e;return t.normalize&&(t=t.normalize("NFD").replace(ze,"")),De.call(this,t.toLowerCase(),!e.normalize&&Xe)}var Ye={encode:Qe,F:!1,G:"strict"},Ze=/[^a-z0-9]+/,me={b:"p",v:"f",w:"f",z:"s",x:"s",\u00DF:"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function Qe(e){e=Te.call(this,e).join(" ");let t=[];if(e){let n=e.split(Ze),r=n.length;for(let i=0,l,a=0;i<r;i++)if((e=n[i])&&(!this.filter||!this.filter[e])){l=e[0];let s=me[l]||l,g=s;for(let d=1;d<e.length;d++){l=e[d];let m=me[l]||l;m&&m!==g&&(s+=m,g=m)}t[a++]=s}}return t}var et={encode:be,F:!1,G:""},ft=[B("ae"),"a",B("oe"),"o",B("sh"),"s",B("th"),"t",B("ph"),"f",B("pf"),"f",B("(?![aeo])h(?![aeo])"),"",B("(?!^[aeo])h(?!^[aeo])"),""];function be(e,t){return e&&(e=Qe.call(this,e).join(" "),2<e.length&&(e=Ee(e,ft)),t||(1<e.length&&(e=Ke(e)),e&&(e=e.split(" ")))),e||[]}var ut={encode:tt,F:!1,G:""},ht=B("(?!\\b)[aeo]");function tt(e){return e&&(e=be.call(this,e,!0),1<e.length&&(e=e.replace(ht,"")),1<e.length&&(e=Ke(e)),e&&(e=e.split(" "))),e||[]}te["latin:default"]=Me,te["latin:simple"]=fe,te["latin:balance"]=Ye,te["latin:advanced"]=et,te["latin:extra"]=ut;var dt={Index:de,Document:ae,Worker:ge,registerCharset:function(e,t){te[e]=t},registerLanguage:function(e,t){Ue[e]=t}};function pt(e,t){if(!e)return;function n(i){i.target===this&&(i.preventDefault(),i.stopPropagation(),t())}function r(i){i.key.startsWith("Esc")&&(i.preventDefault(),t())}e?.addEventListener("click",n),window.addCleanup(()=>e?.removeEventListener("click",n)),document.addEventListener("keydown",r),window.addCleanup(()=>document.removeEventListener("keydown",r))}function Be(e){for(;e.firstChild;)e.removeChild(e.firstChild)}var gt=Object.hasOwnProperty,nt=C(V(),1),Lt=(0,nt.default)();function mt(e){let t=bt(vt(e,"index"),!0);return t.length===0?"/":t}var rt=(e,t,n)=>{let r=new URL(e.getAttribute(t),n);e.setAttribute(t,r.pathname+r.hash)};function yt(e,t){e.querySelectorAll('[href^="./"], [href^="../"]').forEach(n=>rt(n,"href",t)),e.querySelectorAll('[src^="./"], [src^="../"]').forEach(n=>rt(n,"src",t))}function He(e){let t=e.split("/").filter(n=>n!=="").slice(0,-1).map(n=>"..").join("/");return t.length===0&&(t="."),t}function it(e,t){return ot(He(e),mt(t))}function ot(...e){return e.filter(t=>t!=="").join("/").replace(/\/\/+/g,"/")}function wt(e,t){return e===t||e.endsWith("/"+t)}function vt(e,t){return wt(e,t)&&(e=e.slice(0,-t.length)),e}function bt(e,t){return e.startsWith("/")&&(e=e.substring(1)),!t&&e.endsWith("/")&&(e=e.slice(0,-1)),e}var ue="basic",K="",xt=e=>e.toLowerCase().split(/([^a-z]|[^\x00-\x7F])/),Ce=new dt.Document({charset:"latin:extra",encode:xt,document:{id:"id",tag:"tags",index:[{field:"title",tokenize:"forward"},{field:"content",tokenize:"forward"},{field:"tags",tokenize:"forward"}]}}),At=new DOMParser,Ie=new Map,Ve=30,je=8,Et=5,lt=e=>{let t=e.split(/\s+/).filter(r=>r.trim()!==""),n=t.length;if(n>1)for(let r=1;r<n;r++)t.push(t.slice(0,r+1).join(" "));return t.sort((r,i)=>i.length-r.length)};function We(e,t,n){let r=lt(e),i=t.split(/\s+/).filter(g=>g!==""),l=0,a=i.length-1;if(n){let g=p=>r.some(h=>p.toLowerCase().startsWith(h.toLowerCase())),d=i.map(g),m=0,u=0;for(let p=0;p<Math.max(i.length-Ve,0);p++){let h=d.slice(p,p+Ve).reduce((f,y)=>f+(y?1:0),0);h>=m&&(m=h,u=p)}l=Math.max(u-Ve,0),a=Math.min(l+2*Ve,i.length-1),i=i.slice(l,a)}let s=i.map(g=>{for(let d of r)if(g.toLowerCase().includes(d.toLowerCase())){let m=new RegExp(d.toLowerCase(),"gi");return g.replace(m,'<span class="highlight">$&</span>')}return g}).join(" ");return`${l===0?"":"..."}${s}${a===i.length-1?"":"..."}`}function o(e,t){let n=new DOMParser,r=lt(e),i=n.parseFromString(t.innerHTML,"text/html"),l=s=>{let g=document.createElement("span");return g.className="highlight",g.textContent=s,g},a=(s,g)=>{if(s.nodeType===Node.TEXT_NODE){let d=s.nodeValue??"",m=new RegExp(g.toLowerCase(),"gi"),u=d.match(m);if(!u||u.length===0)return;let p=document.createElement("span"),h=0;for(let f of u){let y=d.indexOf(f,h);p.appendChild(document.createTextNode(d.slice(h,y))),p.appendChild(l(f)),h=y+f.length}p.appendChild(document.createTextNode(d.slice(h))),s.parentNode?.replaceChild(p,s)}else if(s.nodeType===Node.ELEMENT_NODE){if(s.classList.contains("highlight"))return;Array.from(s.childNodes).forEach(d=>a(d,g))}};for(let s of r)a(i.body,s);return i.body}document.addEventListener("nav",async e=>{let t=e.detail.url,n=await fetchData,r=document.getElementById("search-container"),i=r?.closest(".sidebar"),l=document.getElementById("search-button"),a=document.getElementById("search-bar"),s=document.getElementById("search-layout"),g=Object.keys(n),d=b=>{s?.querySelector(`#${b.id}`)===null&&s?.appendChild(b)},m=s?.dataset?.preview==="true",u,p,h=document.createElement("div");h.id="results-container",d(h),m&&(u=document.createElement("div"),u.id="preview-container",d(u));function f(){r?.classList.remove("active"),a&&(a.value=""),i&&(i.style.zIndex="unset"),h&&Be(h),u&&Be(u),s&&s.classList.remove("display-results"),ue="basic",l?.focus()}function y(b){ue=b,i&&(i.style.zIndex="1"),r?.classList.add("active"),a?.focus()}let w=null;async function v(b){if(b.key==="k"&&(b.ctrlKey||b.metaKey)&&!b.shiftKey){b.preventDefault(),r?.classList.contains("active")?f():y("basic");return}else if(b.shiftKey&&(b.ctrlKey||b.metaKey)&&b.key.toLowerCase()==="k"){b.preventDefault(),r?.classList.contains("active")?f():y("tags"),a&&(a.value="#");return}if(w&&w.classList.remove("focus"),!!r?.classList.contains("active")){if(b.key==="Enter")if(h?.contains(document.activeElement)){let x=document.activeElement;if(x.classList.contains("no-match"))return;await R(x),x.click()}else{let x=document.getElementsByClassName("result-card")[0];if(!x||x?.classList.contains("no-match"))return;await R(x),x.click()}else if(b.key==="ArrowUp"||b.shiftKey&&b.key==="Tab"){if(b.preventDefault(),h?.contains(document.activeElement)){let x=w||document.activeElement,A=x?.previousElementSibling;x?.classList.remove("focus"),A?.focus(),A&&(w=A),await R(A)}}else if((b.key==="ArrowDown"||b.key==="Tab")&&(b.preventDefault(),document.activeElement===a||w!==null)){let x=w||document.getElementsByClassName("result-card")[0],A=x?.nextElementSibling;x?.classList.remove("focus"),A?.focus(),A&&(w=A),await R(A)}}}let E=(b,x)=>{let A=g[x];return{id:x,slug:A,title:ue==="tags"?n[A].title:We(b,n[A].title??""),content:We(b,n[A].content??"",!0),tags:L(b.substring(1),n[A].tags)}};function L(b,x){return!x||ue!=="tags"?[]:x.map(A=>A.toLowerCase().includes(b.toLowerCase())?`<li><p class="match-tag">#${A}</p></li>`:`<li><p>#${A}</p></li>`).slice(0,Et)}function N(b){return new URL(it(t,b),location.toString())}let Q=({slug:b,title:x,content:A,tags:T})=>{let S=T.length>0?`<ul class="tags">${T.join("")}</ul>`:"",M=document.createElement("a");M.classList.add("result-card"),M.id=b,M.href=N(b).toString(),M.innerHTML=`<h3>${x}</h3>${S}${m&&window.innerWidth>600?"":`<p>${A}</p>`}`,M.addEventListener("click",re=>{re.altKey||re.ctrlKey||re.metaKey||re.shiftKey||f()});let se=re=>{re.altKey||re.ctrlKey||re.metaKey||re.shiftKey||f()};async function $e(re){if(!re.target)return;let kt=re.target;await R(kt)}return M.addEventListener("mouseenter",$e),window.addCleanup(()=>M.removeEventListener("mouseenter",$e)),M.addEventListener("click",se),window.addCleanup(()=>M.removeEventListener("click",se)),M};async function ne(b){if(h)if(Be(h),b.length===0?h.innerHTML=`<a class="result-card no-match">
<h3>No results.</h3>
<p>Try another search term?</p>
</a>`:h.append(...b.map(Q)),b.length===0&&u)Be(u);else{let x=h.firstElementChild;x.classList.add("focus"),w=x,await R(x)}}async function le(b){if(Ie.has(b))return Ie.get(b);let x=N(b).toString(),A=await fetch(x).then(T=>T.text()).then(T=>{if(T===void 0)throw new Error(`Could not fetch ${x}`);let S=At.parseFromString(T??"","text/html");return yt(S,x),[...S.getElementsByClassName("popover-hint")]});return Ie.set(b,A),A}async function R(b){if(!s||!m||!b||!u)return;let x=b.id,A=await le(x).then(T=>T.flatMap(S=>[...o(K,S).children]));p=document.createElement("div"),p.classList.add("preview-inner"),p.append(...A),u.replaceChildren(p),[...u.querySelectorAll(".highlight")].sort((T,S)=>S.innerHTML.length-T.innerHTML.length)[0]?.scrollIntoView({block:"start"})}async function ye(b){if(!s||!Ce)return;K=b.target.value,s.classList.toggle("display-results",K!==""),ue=K.startsWith("#")?"tags":"basic";let x;if(ue==="tags"){K=K.substring(1).trim();let S=K.indexOf(" ");if(S!=-1){let M=K.substring(0,S),se=K.substring(S+1).trim();x=await Ce.searchAsync({query:se,limit:Math.max(je,1e4),index:["title","content"],tag:M});for(let $e of x)$e.result=$e.result.slice(0,je);ue="basic",K=se}else x=await Ce.searchAsync({query:K,limit:je,index:["tags"]})}else ue==="basic"&&(x=await Ce.searchAsync({query:K,limit:je,index:["title","content"]}));let A=S=>{let M=x.filter(se=>se.field===S);return M.length===0?[]:[...M[0].result]},T=[...new Set([...A("title"),...A("content"),...A("tags")])].map(S=>E(K,S));await ne(T)}document.addEventListener("keydown",v),window.addCleanup(()=>document.removeEventListener("keydown",v)),l?.addEventListener("click",()=>y("basic")),window.addCleanup(()=>l?.removeEventListener("click",()=>y("basic"))),a?.addEventListener("input",ye),window.addCleanup(()=>a?.removeEventListener("input",ye)),pt(r,f),await c(n)});async function c(e){let t=0,n=[];for(let[r,i]of Object.entries(e))n.push(Ce.addAsync(t++,{id:t,slug:r,title:i.title,content:i.content,tags:i.tags}));return await Promise.all(n)}}(),function(){var H=Object.create,q=Object.defineProperty,_=Object.getOwnPropertyDescriptor,F=Object.getOwnPropertyNames,I=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty,U=(o,c)=>()=>(c||o((c={exports:{}}).exports,c),c.exports),O=(o,c,e,t)=>{if(c&&typeof c=="object"||typeof c=="function")for(let n of F(c))!z.call(o,n)&&n!==e&&q(o,n,{get:()=>c[n],enumerable:!(t=_(c,n))||t.enumerable});return o},C=(o,c,e)=>(e=o!=null?H(I(o)):{},O(c||!o||!o.__esModule?q(e,"default",{value:o,enumerable:!0}):e,o)),W=U((o,c)=>{"use strict";c.exports=t;function e(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function t(r){if(r=r||{},r.circles)return n(r);let i=new Map;if(i.set(Date,d=>new Date(d)),i.set(Map,(d,m)=>new Map(a(Array.from(d),m))),i.set(Set,(d,m)=>new Set(a(Array.from(d),m))),r.constructorHandlers)for(let d of r.constructorHandlers)i.set(d[0],d[1]);let l=null;return r.proto?g:s;function a(d,m){let u=Object.keys(d),p=new Array(u.length);for(let h=0;h<u.length;h++){let f=u[h],y=d[f];typeof y!="object"||y===null?p[f]=y:y.constructor!==Object&&(l=i.get(y.constructor))?p[f]=l(y,m):ArrayBuffer.isView(y)?p[f]=e(y):p[f]=m(y)}return p}function s(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return a(d,s);if(d.constructor!==Object&&(l=i.get(d.constructor)))return l(d,s);let m={};for(let u in d){if(Object.hasOwnProperty.call(d,u)===!1)continue;let p=d[u];typeof p!="object"||p===null?m[u]=p:p.constructor!==Object&&(l=i.get(p.constructor))?m[u]=l(p,s):ArrayBuffer.isView(p)?m[u]=e(p):m[u]=s(p)}return m}function g(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return a(d,g);if(d.constructor!==Object&&(l=i.get(d.constructor)))return l(d,g);let m={};for(let u in d){let p=d[u];typeof p!="object"||p===null?m[u]=p:p.constructor!==Object&&(l=i.get(p.constructor))?m[u]=l(p,g):ArrayBuffer.isView(p)?m[u]=e(p):m[u]=g(p)}return m}}function n(r){let i=[],l=[],a=new Map;if(a.set(Date,u=>new Date(u)),a.set(Map,(u,p)=>new Map(g(Array.from(u),p))),a.set(Set,(u,p)=>new Set(g(Array.from(u),p))),r.constructorHandlers)for(let u of r.constructorHandlers)a.set(u[0],u[1]);let s=null;return r.proto?m:d;function g(u,p){let h=Object.keys(u),f=new Array(h.length);for(let y=0;y<h.length;y++){let w=h[y],v=u[w];if(typeof v!="object"||v===null)f[w]=v;else if(v.constructor!==Object&&(s=a.get(v.constructor)))f[w]=s(v,p);else if(ArrayBuffer.isView(v))f[w]=e(v);else{let E=i.indexOf(v);E!==-1?f[w]=l[E]:f[w]=p(v)}}return f}function d(u){if(typeof u!="object"||u===null)return u;if(Array.isArray(u))return g(u,d);if(u.constructor!==Object&&(s=a.get(u.constructor)))return s(u,d);let p={};i.push(u),l.push(p);for(let h in u){if(Object.hasOwnProperty.call(u,h)===!1)continue;let f=u[h];if(typeof f!="object"||f===null)p[h]=f;else if(f.constructor!==Object&&(s=a.get(f.constructor)))p[h]=s(f,d);else if(ArrayBuffer.isView(f))p[h]=e(f);else{let y=i.indexOf(f);y!==-1?p[h]=l[y]:p[h]=d(f)}}return i.pop(),l.pop(),p}function m(u){if(typeof u!="object"||u===null)return u;if(Array.isArray(u))return g(u,m);if(u.constructor!==Object&&(s=a.get(u.constructor)))return s(u,m);let p={};i.push(u),l.push(p);for(let h in u){let f=u[h];if(typeof f!="object"||f===null)p[h]=f;else if(f.constructor!==Object&&(s=a.get(f.constructor)))p[h]=s(f,m);else if(ArrayBuffer.isView(f))p[h]=e(f);else{let y=i.indexOf(f);y!==-1?p[h]=l[y]:p[h]=m(f)}}return i.pop(),l.pop(),p}}}),V=Math.min,k=Math.max,G=Math.round,D=o=>({x:o,y:o}),j={left:"right",right:"left",bottom:"top",top:"bottom"},st={start:"end",end:"start"};function P(o,c,e){return k(o,V(c,e))}function J(o,c){return typeof o=="function"?o(c):o}function ee(o){return o.split("-")[0]}function De(o){return o.split("-")[1]}function qe(o){return o==="x"?"y":"x"}function ze(o){return o==="y"?"height":"width"}function xe(o){return["top","bottom"].includes(ee(o))?"y":"x"}function Ee(o){return qe(xe(o))}function B(o,c,e){e===void 0&&(e=!1);let t=De(o),n=Ee(o),r=ze(n),i=n==="x"?t===(e?"end":"start")?"right":"left":t==="start"?"bottom":"top";return c.reference[r]>c.floating[r]&&(i=te(i)),[i,te(i)]}function Ke(o){let c=te(o);return[Me(o),c,Me(c)]}function Me(o){return o.replace(/start|end/g,c=>st[c])}function _e(o,c,e){let t=["left","right"],n=["right","left"],r=["top","bottom"],i=["bottom","top"];switch(o){case"top":case"bottom":return e?c?n:t:c?t:n;case"left":case"right":return c?r:i;default:return[]}}function Ue(o,c,e,t){let n=De(o),r=_e(ee(o),e==="start",t);return n&&(r=r.map(i=>i+"-"+n),c&&(r=r.concat(r.map(Me)))),r}function te(o){return o.replace(/left|right|bottom|top/g,c=>j[c])}function Ge(o){return{top:0,right:0,bottom:0,left:0,...o}}function we(o){return typeof o!="number"?Ge(o):{top:o,right:o,bottom:o,left:o}}function he(o){let{x:c,y:e,width:t,height:n}=o;return{width:t,height:n,top:e,left:c,right:c+t,bottom:e+n,x:c,y:e}}function Je(o,c,e){let{reference:t,floating:n}=o,r=xe(c),i=Ee(c),l=ze(i),a=ee(c),s=r==="y",g=t.x+t.width/2-n.width/2,d=t.y+t.height/2-n.height/2,m=t[l]/2-n[l]/2,u;switch(a){case"top":u={x:g,y:t.y-n.height};break;case"bottom":u={x:g,y:t.y+t.height};break;case"right":u={x:t.x+t.width,y:d};break;case"left":u={x:t.x-n.width,y:d};break;default:u={x:t.x,y:t.y}}switch(De(c)){case"start":u[i]-=m*(e&&s?-1:1);break;case"end":u[i]+=m*(e&&s?-1:1);break}return u}var Se=async(o,c,e)=>{let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i}=e,l=r.filter(Boolean),a=await(i.isRTL==null?void 0:i.isRTL(c)),s=await i.getElementRects({reference:o,floating:c,strategy:n}),{x:g,y:d}=Je(s,t,a),m=t,u={},p=0;for(let h=0;h<l.length;h++){let{name:f,fn:y}=l[h],{x:w,y:v,data:E,reset:L}=await y({x:g,y:d,initialPlacement:t,placement:m,strategy:n,middlewareData:u,rects:s,platform:i,elements:{reference:o,floating:c}});g=w??g,d=v??d,u={...u,[f]:{...u[f],...E}},L&&p<=50&&(p++,typeof L=="object"&&(L.placement&&(m=L.placement),L.rects&&(s=L.rects===!0?await i.getElementRects({reference:o,floating:c,strategy:n}):L.rects),{x:g,y:d}=Je(s,m,a)),h=-1)}return{x:g,y:d,placement:m,strategy:n,middlewareData:u}};async function Re(o,c){var e;c===void 0&&(c={});let{x:t,y:n,platform:r,rects:i,elements:l,strategy:a}=o,{boundary:s="clippingAncestors",rootBoundary:g="viewport",elementContext:d="floating",altBoundary:m=!1,padding:u=0}=J(c,o),p=we(u),h=l[m?d==="floating"?"reference":"floating":d],f=he(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(h)))==null||e?h:h.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:s,rootBoundary:g,strategy:a})),y=d==="floating"?{...i.floating,x:t,y:n}:i.reference,w=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),v=await(r.isElement==null?void 0:r.isElement(w))?await(r.getScale==null?void 0:r.getScale(w))||{x:1,y:1}:{x:1,y:1},E=he(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return{top:(f.top-E.top+p.top)/v.y,bottom:(E.bottom-f.bottom+p.bottom)/v.y,left:(f.left-E.left+p.left)/v.x,right:(E.right-f.right+p.right)/v.x}}var at=function(o){return o===void 0&&(o={}),{name:"flip",options:o,async fn(c){var e,t;let{placement:n,middlewareData:r,rects:i,initialPlacement:l,platform:a,elements:s}=c,{mainAxis:g=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...f}=J(o,c);if((e=r.arrow)!=null&&e.alignmentOffset)return{};let y=ee(n),w=ee(l)===l,v=await(a.isRTL==null?void 0:a.isRTL(s.floating)),E=m||(w||!h?[te(l)]:Ke(l));!m&&p!=="none"&&E.push(...Ue(l,h,p,v));let L=[l,...E],N=await Re(c,f),Q=[],ne=((t=r.flip)==null?void 0:t.overflows)||[];if(g&&Q.push(N[y]),d){let b=B(n,i,v);Q.push(N[b[0]],N[b[1]])}if(ne=[...ne,{placement:n,overflows:Q}],!Q.every(b=>b<=0)){var le,R;let b=(((le=r.flip)==null?void 0:le.index)||0)+1,x=L[b];if(x)return{data:{index:b,overflows:ne},reset:{placement:x}};let A=(R=ne.filter(T=>T.overflows[0]<=0).sort((T,S)=>T.overflows[1]-S.overflows[1])[0])==null?void 0:R.placement;if(!A)switch(u){case"bestFit":{var ye;let T=(ye=ne.map(S=>[S.placement,S.overflows.filter(M=>M>0).reduce((M,se)=>M+se,0)]).sort((S,M)=>S[1]-M[1])[0])==null?void 0:ye[0];T&&(A=T);break}case"initialPlacement":A=l;break}if(n!==A)return{reset:{placement:A}}}return{}}}};function Pe(o){let c=V(...o.map(r=>r.left)),e=V(...o.map(r=>r.top)),t=k(...o.map(r=>r.right)),n=k(...o.map(r=>r.bottom));return{x:c,y:e,width:t-c,height:n-e}}function de(o){let c=o.slice().sort((n,r)=>n.y-r.y),e=[],t=null;for(let n=0;n<c.length;n++){let r=c[n];!t||r.y-t.y>t.height/2?e.push([r]):e[e.length-1].push(r),t=r}return e.map(n=>he(Pe(n)))}var Fe=function(o){return o===void 0&&(o={}),{name:"inline",options:o,async fn(c){let{placement:e,elements:t,rects:n,platform:r,strategy:i}=c,{padding:l=2,x:a,y:s}=J(o,c),g=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(t.reference))||[]),d=de(g),m=he(Pe(g)),u=we(l);function p(){if(d.length===2&&d[0].left>d[1].right&&a!=null&&s!=null)return d.find(f=>a>f.left-u.left&&a<f.right+u.right&&s>f.top-u.top&&s<f.bottom+u.bottom)||m;if(d.length>=2){if(xe(e)==="y"){let R=d[0],ye=d[d.length-1],b=ee(e)==="top",x=R.top,A=ye.bottom,T=b?R.left:ye.left,S=b?R.right:ye.right,M=S-T,se=A-x;return{top:x,bottom:A,left:T,right:S,width:M,height:se,x:T,y:x}}let f=ee(e)==="left",y=k(...d.map(R=>R.right)),w=V(...d.map(R=>R.left)),v=d.filter(R=>f?R.left===w:R.right===y),E=v[0].top,L=v[v.length-1].bottom,N=w,Q=y,ne=Q-N,le=L-E;return{top:E,bottom:L,left:N,right:Q,width:ne,height:le,x:N,y:E}}return m}let h=await r.getElementRects({reference:{getBoundingClientRect:p},floating:t.floating,strategy:i});return n.reference.x!==h.reference.x||n.reference.y!==h.reference.y||n.reference.width!==h.reference.width||n.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Le=function(o){return o===void 0&&(o={}),{name:"shift",options:o,async fn(c){let{x:e,y:t,placement:n}=c,{mainAxis:r=!0,crossAxis:i=!1,limiter:l={fn:f=>{let{x:y,y:w}=f;return{x:y,y:w}}},...a}=J(o,c),s={x:e,y:t},g=await Re(c,a),d=xe(ee(n)),m=qe(d),u=s[m],p=s[d];if(r){let f=m==="y"?"top":"left",y=m==="y"?"bottom":"right",w=u+g[f],v=u-g[y];u=P(w,u,v)}if(i){let f=d==="y"?"top":"left",y=d==="y"?"bottom":"right",w=p+g[f],v=p-g[y];p=P(w,p,v)}let h=l.fn({...c,[m]:u,[d]:p});return{...h,data:{x:h.x-e,y:h.y-t}}}}};function pe(o){return Ae(o)?(o.nodeName||"").toLowerCase():"#document"}function $(o){var c;return(o==null||(c=o.ownerDocument)==null?void 0:c.defaultView)||window}function ie(o){var c;return(c=(Ae(o)?o.ownerDocument:o.document)||window.document)==null?void 0:c.documentElement}function Ae(o){return o instanceof Node||o instanceof $(o).Node}function X(o){return o instanceof Element||o instanceof $(o).Element}function Y(o){return o instanceof HTMLElement||o instanceof $(o).HTMLElement}function ge(o){return typeof ShadowRoot>"u"?!1:o instanceof ShadowRoot||o instanceof $(o).ShadowRoot}function oe(o){let{overflow:c,overflowX:e,overflowY:t,display:n}=Z(o);return/auto|scroll|overlay|hidden|clip/.test(c+t+e)&&!["inline","contents"].includes(n)}function ct(o){return["table","td","th"].includes(pe(o))}function ae(o){return[":popover-open",":modal"].some(c=>{try{return o.matches(c)}catch{return!1}})}function ve(o){let c=ke(),e=X(o)?Z(o):o;return e.transform!=="none"||e.perspective!=="none"||(e.containerType?e.containerType!=="normal":!1)||!c&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!c&&(e.filter?e.filter!=="none":!1)||["transform","perspective","filter"].some(t=>(e.willChange||"").includes(t))||["paint","layout","strict","content"].some(t=>(e.contain||"").includes(t))}function Ne(o){let c=fe(o);for(;Y(c)&&!ce(c);){if(ve(c))return c;if(ae(c))return null;c=fe(c)}return null}function ke(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ce(o){return["html","body","#document"].includes(pe(o))}function Z(o){return $(o).getComputedStyle(o)}function Oe(o){return X(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:{scrollLeft:o.scrollX,scrollTop:o.scrollY}}function fe(o){if(pe(o)==="html")return o;let c=o.assignedSlot||o.parentNode||ge(o)&&o.host||ie(o);return ge(c)?c.host:c}function Xe(o){let c=fe(o);return ce(c)?o.ownerDocument?o.ownerDocument.body:o.body:Y(c)&&oe(c)?c:Xe(c)}function Te(o,c,e){var t;c===void 0&&(c=[]),e===void 0&&(e=!0);let n=Xe(o),r=n===((t=o.ownerDocument)==null?void 0:t.body),i=$(n);return r?c.concat(i,i.visualViewport||[],oe(n)?n:[],i.frameElement&&e?Te(i.frameElement):[]):c.concat(n,Te(n,[],e))}function Ye(o){let c=Z(o),e=parseFloat(c.width)||0,t=parseFloat(c.height)||0,n=Y(o),r=n?o.offsetWidth:e,i=n?o.offsetHeight:t,l=G(e)!==r||G(t)!==i;return l&&(e=r,t=i),{width:e,height:t,$:l}}function Ze(o){return X(o)?o:o.contextElement}function me(o){let c=Ze(o);if(!Y(c))return D(1);let e=c.getBoundingClientRect(),{width:t,height:n,$:r}=Ye(c),i=(r?G(e.width):e.width)/t,l=(r?G(e.height):e.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}var Qe=D(0);function et(o){let c=$(o);return!ke()||!c.visualViewport?Qe:{x:c.visualViewport.offsetLeft,y:c.visualViewport.offsetTop}}function ft(o,c,e){return c===void 0&&(c=!1),!e||c&&e!==$(o)?!1:c}function be(o,c,e,t){c===void 0&&(c=!1),e===void 0&&(e=!1);let n=o.getBoundingClientRect(),r=Ze(o),i=D(1);c&&(t?X(t)&&(i=me(t)):i=me(o));let l=ft(r,e,t)?et(r):D(0),a=(n.left+l.x)/i.x,s=(n.top+l.y)/i.y,g=n.width/i.x,d=n.height/i.y;if(r){let m=$(r),u=t&&X(t)?$(t):t,p=m,h=p.frameElement;for(;h&&t&&u!==p;){let f=me(h),y=h.getBoundingClientRect(),w=Z(h),v=y.left+(h.clientLeft+parseFloat(w.paddingLeft))*f.x,E=y.top+(h.clientTop+parseFloat(w.paddingTop))*f.y;a*=f.x,s*=f.y,g*=f.x,d*=f.y,a+=v,s+=E,p=$(h),h=p.frameElement}}return he({width:g,height:d,x:a,y:s})}function ut(o){let{elements:c,rect:e,offsetParent:t,strategy:n}=o,r=n==="fixed",i=ie(t),l=c?ae(c.floating):!1;if(t===i||l&&r)return e;let a={scrollLeft:0,scrollTop:0},s=D(1),g=D(0),d=Y(t);if((d||!d&&!r)&&((pe(t)!=="body"||oe(i))&&(a=Oe(t)),Y(t))){let m=be(t);s=me(t),g.x=m.x+t.clientLeft,g.y=m.y+t.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-a.scrollLeft*s.x+g.x,y:e.y*s.y-a.scrollTop*s.y+g.y}}function ht(o){return Array.from(o.getClientRects())}function tt(o){return be(ie(o)).left+Oe(o).scrollLeft}function dt(o){let c=ie(o),e=Oe(o),t=o.ownerDocument.body,n=k(c.scrollWidth,c.clientWidth,t.scrollWidth,t.clientWidth),r=k(c.scrollHeight,c.clientHeight,t.scrollHeight,t.clientHeight),i=-e.scrollLeft+tt(o),l=-e.scrollTop;return Z(t).direction==="rtl"&&(i+=k(c.clientWidth,t.clientWidth)-n),{width:n,height:r,x:i,y:l}}function pt(o,c){let e=$(o),t=ie(o),n=e.visualViewport,r=t.clientWidth,i=t.clientHeight,l=0,a=0;if(n){r=n.width,i=n.height;let s=ke();(!s||s&&c==="fixed")&&(l=n.offsetLeft,a=n.offsetTop)}return{width:r,height:i,x:l,y:a}}function Be(o,c){let e=be(o,!0,c==="fixed"),t=e.top+o.clientTop,n=e.left+o.clientLeft,r=Y(o)?me(o):D(1),i=o.clientWidth*r.x,l=o.clientHeight*r.y,a=n*r.x,s=t*r.y;return{width:i,height:l,x:a,y:s}}function gt(o,c,e){let t;if(c==="viewport")t=pt(o,e);else if(c==="document")t=dt(ie(o));else if(X(c))t=Be(c,e);else{let n=et(o);t={...c,x:c.x-n.x,y:c.y-n.y}}return he(t)}function nt(o,c){let e=fe(o);return e===c||!X(e)||ce(e)?!1:Z(e).position==="fixed"||nt(e,c)}function Lt(o,c){let e=c.get(o);if(e)return e;let t=Te(o,[],!1).filter(l=>X(l)&&pe(l)!=="body"),n=null,r=Z(o).position==="fixed",i=r?fe(o):o;for(;X(i)&&!ce(i);){let l=Z(i),a=ve(i);!a&&l.position==="fixed"&&(n=null),(r?!a&&!n:!a&&l.position==="static"&&n&&["absolute","fixed"].includes(n.position)||oe(i)&&!a&&nt(o,i))?t=t.filter(s=>s!==i):n=l,i=fe(i)}return c.set(o,t),t}function mt(o){let{element:c,boundary:e,rootBoundary:t,strategy:n}=o,r=[...e==="clippingAncestors"?ae(c)?[]:Lt(c,this._c):[].concat(e),t],i=r[0],l=r.reduce((a,s)=>{let g=gt(c,s,n);return a.top=k(g.top,a.top),a.right=V(g.right,a.right),a.bottom=V(g.bottom,a.bottom),a.left=k(g.left,a.left),a},gt(c,i,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function rt(o){let{width:c,height:e}=Ye(o);return{width:c,height:e}}function yt(o,c,e){let t=Y(c),n=ie(c),r=e==="fixed",i=be(o,!0,r,c),l={scrollLeft:0,scrollTop:0},a=D(0);if(t||!t&&!r)if((pe(c)!=="body"||oe(n))&&(l=Oe(c)),t){let d=be(c,!0,r,c);a.x=d.x+c.clientLeft,a.y=d.y+c.clientTop}else n&&(a.x=tt(n));let s=i.left+l.scrollLeft-a.x,g=i.top+l.scrollTop-a.y;return{x:s,y:g,width:i.width,height:i.height}}function He(o){return Z(o).position==="static"}function it(o,c){return!Y(o)||Z(o).position==="fixed"?null:c?c(o):o.offsetParent}function ot(o,c){let e=$(o);if(ae(o))return e;if(!Y(o)){let n=fe(o);for(;n&&!ce(n);){if(X(n)&&!He(n))return n;n=fe(n)}return e}let t=it(o,c);for(;t&&ct(t)&&He(t);)t=it(t,c);return t&&ce(t)&&He(t)&&!ve(t)?e:t||Ne(o)||e}var wt=async function(o){let c=this.getOffsetParent||ot,e=this.getDimensions,t=await e(o.floating);return{reference:yt(o.reference,await c(o.floating),o.strategy),floating:{x:0,y:0,width:t.width,height:t.height}}};function vt(o){return Z(o).direction==="rtl"}var bt={convertOffsetParentRelativeRectToViewportRelativeRect:ut,getDocumentElement:ie,getClippingRect:mt,getOffsetParent:ot,getElementRects:wt,getClientRects:ht,getDimensions:rt,getScale:me,isElement:X,isRTL:vt},ue=Le,K=at,xt=Fe,Ce=(o,c,e)=>{let t=new Map,n={platform:bt,...e},r={...n.platform,_c:t};return Se(o,c,{...n,platform:r})},At=Object.hasOwnProperty,Ie=C(W(),1),Ve=(0,Ie.default)(),je=(o,c,e)=>{let t=new URL(o.getAttribute(c),e);o.setAttribute(c,t.pathname+t.hash)};function Et(o,c){o.querySelectorAll('[href^="./"], [href^="../"]').forEach(e=>je(e,"href",c)),o.querySelectorAll('[src^="./"], [src^="../"]').forEach(e=>je(e,"src",c))}var lt=new DOMParser;async function We({clientX:o,clientY:c}){let e=this;if(e.dataset.noPopover==="true")return;async function t(p){let{x:h,y:f}=await Ce(e,p,{middleware:[xt({x:o,y:c}),ue(),K()]});Object.assign(p.style,{left:`${h}px`,top:`${f}px`})}let n=()=>[...e.children].some(p=>p.classList.contains("popover"));if(n())return t(e.lastChild);let r=new URL(document.location.href);r.hash="",r.search="";let i=new URL(e.href),l=decodeURIComponent(i.hash);i.hash="",i.search="";let a=await fetch(`${i}`).catch(p=>{console.error(p)});if(n()||!a)return;let[s]=a.headers.get("Content-Type").split(";"),[g,d]=s.split("/"),m=document.createElement("div");m.classList.add("popover");let u=document.createElement("div");switch(u.classList.add("popover-inner"),m.appendChild(u),u.dataset.contentType=s??void 0,g){case"image":let p=document.createElement("img");p.src=i.toString(),p.alt=i.pathname,u.appendChild(p);break;case"application":switch(d){case"pdf":let w=document.createElement("iframe");w.src=i.toString(),u.appendChild(w);break;default:break}break;default:let h=await a.text(),f=lt.parseFromString(h,"text/html");Et(f,i);let y=[...f.getElementsByClassName("popover-hint")];if(y.length===0)return;y.forEach(w=>u.appendChild(w))}if(t(m),e.appendChild(m),l!==""){let p=u.querySelector(l);p&&u.scroll({top:p.offsetTop-12,behavior:"instant"})}}document.addEventListener("nav",()=>{let o=[...document.getElementsByClassName("internal")];for(let c of o)c.addEventListener("mouseenter",We),window.addCleanup(()=>c.removeEventListener("mouseenter",We))})}(),function(){window.spaNavigate=(q,_)=>window.location.assign(q),window.addCleanup=()=>{};const H=new CustomEvent("nav",{detail:{url:document.body.dataset.slug}});document.dispatchEvent(H)}();