From 3b2783830f76997c8d4a9f9cbe43c3326a64ab76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 24 Dec 2024 13:56:17 +0100 Subject: [PATCH] Improvements to sidebar on mobile with swup * Make sure the sidebar does not flash on load * Close the sidebar on click on mobile --- assets/js/entry/html.js | 11 ++-- assets/js/sidebar/sidebar-drawer.js | 7 ++- assets/js/sidebar/sidebar-list.js | 14 ++--- formatters/html/dist/html-HURPSPNJ.js | 56 +++++++++++++++++++ formatters/html/dist/html-XFWJYN4N.js | 56 ------------------- .../html/templates/head_template.eex | 2 +- 6 files changed, 72 insertions(+), 74 deletions(-) create mode 100644 formatters/html/dist/html-HURPSPNJ.js delete mode 100644 formatters/html/dist/html-XFWJYN4N.js diff --git a/assets/js/entry/html.js b/assets/js/entry/html.js index 8f07c2337..f125e04a6 100644 --- a/assets/js/entry/html.js +++ b/assets/js/entry/html.js @@ -3,9 +3,9 @@ import '../handlebars/helpers' import { onDocumentReady } from '../helpers' import { initialize as initTabsets } from '../tabsets' import { initialize as initContent } from '../content' -import { initialize as initSidebarDrawer } from '../sidebar/sidebar-drawer' -import { initialize as initSidebarContent } from '../sidebar/sidebar-list' -import { initialize as initSidebarSearch } from '../search-bar' +import { initialize as initSidebarDrawer, update as updateSidebarDrawer } from '../sidebar/sidebar-drawer' +import { initialize as initSidebarContent, update as updateSidebarContent } from '../sidebar/sidebar-list' +import { initialize as initSearch } from '../search-bar' import { initialize as initVersions } from '../sidebar/sidebar-version-select' import { initialize as initSearchPage } from '../search-page' import { initialize as initTheme } from '../theme' @@ -51,7 +51,8 @@ onDocumentReady(() => { }, hooks: { 'page:view': () => { - initSidebarContent() + updateSidebarDrawer() + updateSidebarContent() initSearchPage() } }, @@ -63,7 +64,7 @@ onDocumentReady(() => { initVersions() initSidebarDrawer() initSidebarContent() - initSidebarSearch() + initSearch() initModal() initKeyboardShortcuts() initQuickSwitch() diff --git a/assets/js/sidebar/sidebar-drawer.js b/assets/js/sidebar/sidebar-drawer.js index 54b5476e9..44894a4e7 100644 --- a/assets/js/sidebar/sidebar-drawer.js +++ b/assets/js/sidebar/sidebar-drawer.js @@ -33,15 +33,16 @@ const state = { sidebarPreference: userPref.NO_PREF } -/** - * Initializes the toggleable sidebar drawer. - */ export function initialize () { setDefaultSidebarState() observeResizing() addEventListeners() } +export function update () { + setDefaultSidebarState() +} + function observeResizing () { const sidebarWidth = sessionStorage.getItem('sidebar_width') diff --git a/assets/js/sidebar/sidebar-list.js b/assets/js/sidebar/sidebar-list.js index 9853d46ca..86720a5d8 100644 --- a/assets/js/sidebar/sidebar-list.js +++ b/assets/js/sidebar/sidebar-list.js @@ -8,15 +8,15 @@ const SIDEBAR_TYPE = { tasks: 'tasks' } -let sidebarInitialized = false - const SIDEBAR_TAB_TYPES = [SIDEBAR_TYPE.extras, SIDEBAR_TYPE.modules, SIDEBAR_TYPE.tasks] const sidebarNodeListSelector = type => `#${type}-full-list` -/** - * Initializes the sidebar navigation list. - */ export function initialize () { + update() + addEventListeners() +} + +export function update () { SIDEBAR_TAB_TYPES.forEach(type => { renderSidebarNodeList(getSidebarNodes(), type) }) @@ -24,10 +24,6 @@ export function initialize () { markActiveSidebarTab(getCurrentPageSidebarType()) markCurrentHashInSidebar() scrollNodeListToCurrentCategory() - - if (sidebarInitialized) return - sidebarInitialized = true - addEventListeners() } /** diff --git a/formatters/html/dist/html-HURPSPNJ.js b/formatters/html/dist/html-HURPSPNJ.js new file mode 100644 index 000000000..1403e22c5 --- /dev/null +++ b/formatters/html/dist/html-HURPSPNJ.js @@ -0,0 +1,56 @@ +(()=>{var Mi=Object.create;var Bt=Object.defineProperty;var Fi=Object.getOwnPropertyDescriptor;var Bi=Object.getOwnPropertyNames;var $i=Object.getPrototypeOf,Ui=Object.prototype.hasOwnProperty;var $t=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var qi=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bi(t))!Ui.call(e,r)&&r!==n&&Bt(e,r,{get:()=>t[r],enumerable:!(i=Fi(t,r))||i.enumerable});return e};var Ut=(e,t,n)=>(n=e!=null?Mi($i(e)):{},qi(t||!e||!e.__esModule?Bt(n,"default",{value:e,enumerable:!0}):n,e));var sn=$t((fa,rn)=>{var nn="Expected a function",en=NaN,lr="[object Symbol]",ur=/^\s+|\s+$/g,dr=/^[-+]0x[0-9a-f]+$/i,hr=/^0b[01]+$/i,fr=/^0o[0-7]+$/i,pr=parseInt,mr=typeof global=="object"&&global&&global.Object===Object&&global,gr=typeof self=="object"&&self&&self.Object===Object&&self,vr=mr||gr||Function("return this")(),yr=Object.prototype,wr=yr.toString,br=Math.max,Sr=Math.min,Ye=function(){return vr.Date.now()};function Er(e,t,n){var i,r,s,o,a,c,l=0,u=!1,h=!1,f=!0;if(typeof e!="function")throw new TypeError(nn);t=tn(t)||0,Le(n)&&(u=!!n.leading,h="maxWait"in n,s=h?br(tn(n.maxWait)||0,t):s,f="trailing"in n?!!n.trailing:f);function y(E){var P=i,B=r;return i=r=void 0,l=E,o=e.apply(B,P),o}function w(E){return l=E,a=setTimeout(m,t),u?y(E):o}function b(E){var P=E-c,B=E-l,z=t-P;return h?Sr(z,s-B):z}function g(E){var P=E-c,B=E-l;return c===void 0||P>=t||P<0||h&&B>=s}function m(){var E=Ye();if(g(E))return x(E);a=setTimeout(m,b(E))}function x(E){return a=void 0,f&&i?y(E):(i=r=void 0,o)}function C(){a!==void 0&&clearTimeout(a),l=0,i=c=r=a=void 0}function D(){return a===void 0?o:x(Ye())}function F(){var E=Ye(),P=g(E);if(i=arguments,r=this,c=E,P){if(a===void 0)return w(c);if(h)return a=setTimeout(m,t),y(c)}return a===void 0&&(a=setTimeout(m,t)),o}return F.cancel=C,F.flush=D,F}function xr(e,t,n){var i=!0,r=!0;if(typeof e!="function")throw new TypeError(nn);return Le(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Er(e,t,{leading:i,maxWait:t,trailing:r})}function Le(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Lr(e){return!!e&&typeof e=="object"}function Tr(e){return typeof e=="symbol"||Lr(e)&&wr.call(e)==lr}function tn(e){if(typeof e=="number")return e;if(Tr(e))return en;if(Le(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Le(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(ur,"");var n=hr.test(e);return n||fr.test(e)?pr(e.slice(2),n?2:8):dr.test(e)?en:+e}rn.exports=xr});var $n=$t((Fn,Bn)=>{(function(){var e=function(t){var n=new e.Builder;return n.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),n.searchPipeline.add(e.stemmer),t.call(n,n),n.build()};e.version="2.3.9";e.utils={},e.utils.warn=function(t){return function(n){t.console&&console.warn&&console.warn(n)}}(this),e.utils.asString=function(t){return t==null?"":t.toString()},e.utils.clone=function(t){if(t==null)return t;for(var n=Object.create(null),i=Object.keys(t),r=0;r0){var u=e.utils.clone(n)||{};u.position=[a,l],u.index=s.length,s.push(new e.Token(i.slice(a,o),u))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/;e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,n){n in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+n),t.label=n,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var n=t.label&&t.label in this.registeredFunctions;n||e.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,t)},e.Pipeline.load=function(t){var n=new e.Pipeline;return t.forEach(function(i){var r=e.Pipeline.registeredFunctions[i];if(r)n.add(r);else throw new Error("Cannot load unregistered function: "+i)}),n},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(n){e.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},e.Pipeline.prototype.after=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i=i+1,this._stack.splice(i,0,n)},e.Pipeline.prototype.before=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,n)},e.Pipeline.prototype.remove=function(t){var n=this._stack.indexOf(t);n!=-1&&this._stack.splice(n,1)},e.Pipeline.prototype.run=function(t){for(var n=this._stack.length,i=0;i1&&(ot&&(i=s),o!=t);)r=i-n,s=n+Math.floor(r/2),o=this.elements[s*2];if(o==t||o>t)return s*2;if(oc?u+=2:a==c&&(n+=i[l+1]*r[u+1],l+=2,u+=2);return n},e.Vector.prototype.similarity=function(t){return this.dot(t)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var t=new Array(this.elements.length/2),n=1,i=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new e.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),r.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var c=s.node.edges["*"];else{var c=new e.TokenSet;s.node.edges["*"]=c}if(s.str.length==0&&(c.final=!0),r.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&r.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}s.str.length==1&&(l.final=!0),r.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var u=s.str.charAt(0),h=s.str.charAt(1),f;h in s.node.edges?f=s.node.edges[h]:(f=new e.TokenSet,s.node.edges[h]=f),s.str.length==1&&(f.final=!0),r.push({node:f,editsRemaining:s.editsRemaining-1,str:u+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var n=new e.TokenSet,i=n,r=0,s=t.length;r=t;n--){var i=this.uncheckedNodes[n],r=i.child.toString();r in this.minimizedNodes?i.parent.edges[i.char]=this.minimizedNodes[r]:(i.child._str=r,this.minimizedNodes[r]=i.child),this.uncheckedNodes.pop()}};e.Index=function(t){this.invertedIndex=t.invertedIndex,this.fieldVectors=t.fieldVectors,this.tokenSet=t.tokenSet,this.fields=t.fields,this.pipeline=t.pipeline},e.Index.prototype.search=function(t){return this.query(function(n){var i=new e.QueryParser(t,n);i.parse()})},e.Index.prototype.query=function(t){for(var n=new e.Query(this.fields),i=Object.create(null),r=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),c=0;c1?this._b=1:this._b=t},e.Builder.prototype.k1=function(t){this._k1=t},e.Builder.prototype.add=function(t,n){var i=t[this._ref],r=Object.keys(this._fields);this._documents[i]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,n;do t=this.next(),n=t.charCodeAt(0);while(n>47&&n<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var n=t.next();if(n==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){t.escapeCharacter();continue}if(n==":")return e.QueryLexer.lexField;if(n=="~")return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if(n=="^")return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if(n=="+"&&t.width()===1||n=="-"&&t.width()===1)return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(n.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}},e.QueryParser=function(t,n){this.lexer=new e.QueryLexer(t),this.query=n,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var t=this.peekLexeme();return this.lexemeIdx+=1,t},e.QueryParser.prototype.nextClause=function(){var t=this.currentClause;this.query.clause(t),this.currentClause={}},e.QueryParser.parseClause=function(t){var n=t.peekLexeme();if(n!=null)switch(n.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(i+=" with value '"+n.str+"'"),new e.QueryParseError(i,n.start,n.end)}},e.QueryParser.parsePresence=function(t){var n=t.consumeLexeme();if(n!=null){switch(n.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+n.str+"'";throw new e.QueryParseError(i,n.start,n.end)}var r=t.peekLexeme();if(r==null){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,n.start,n.end)}switch(r.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+r.type+"'";throw new e.QueryParseError(i,r.start,r.end)}}},e.QueryParser.parseField=function(t){var n=t.consumeLexeme();if(n!=null){if(t.query.allFields.indexOf(n.str)==-1){var i=t.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),r="unrecognised field '"+n.str+"', possible fields: "+i;throw new e.QueryParseError(r,n.start,n.end)}t.currentClause.fields=[n.str];var s=t.peekLexeme();if(s==null){var r="expecting term, found nothing";throw new e.QueryParseError(r,n.start,n.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var r="expecting term, found '"+s.type+"'";throw new e.QueryParseError(r,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var n=t.consumeLexeme();if(n!=null){t.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(i==null){t.nextClause();return}switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(r,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var n=t.consumeLexeme();if(n!=null){var i=parseInt(n.str,10);if(isNaN(i)){var r="edit distance must be numeric";throw new e.QueryParseError(r,n.start,n.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(s==null){t.nextClause();return}switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(r,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var n=t.consumeLexeme();if(n!=null){var i=parseInt(n.str,10);if(isNaN(i)){var r="boost must be numeric";throw new e.QueryParseError(r,n.start,n.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(s==null){t.nextClause();return}switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(r,s.start,s.end)}}},function(t,n){typeof define=="function"&&define.amd?define(n):typeof Fn=="object"?Bn.exports=n():t.lunr=n()}(this,function(){return e})})()});Handlebars.registerHelper("groupChanged",function(e,t,n){let i=t||"";if(e.group!==i)return delete e.nestedContext,e.group=i,n.fn(this)});Handlebars.registerHelper("nestingChanged",function(e,t,n){if(t.nested_context&&t.nested_context!==e.nestedContext){if(e.nestedContext=t.nested_context,e.lastModuleSeenInGroup!==t.nested_context)return n.fn(this)}else e.lastModuleSeenInGroup=t.title});Handlebars.registerHelper("showSections",function(e,t){if(e.sections.length>0)return t.fn(this)});Handlebars.registerHelper("showSummary",function(e,t){if(e.nodeGroups)return t.fn(this)});Handlebars.registerHelper("isArray",function(e,t){return Array.isArray(e)?t.fn(this):t.inverse(this)});Handlebars.registerHelper("isNonEmptyArray",function(e,t){return Array.isArray(e)&&e.length>0?t.fn(this):t.inverse(this)});Handlebars.registerHelper("isEmptyArray",function(e,t){return Array.isArray(e)&&e.length===0?t.fn(this):t.inverse(this)});Handlebars.registerHelper("isLocal",function(e,t){let n=window.location.pathname.split("/").pop();return n===e+".html"||n===e?t.fn(this):t.inverse(this)});var d=document.querySelector.bind(document),A=document.querySelectorAll.bind(document);function qt(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Se(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function V(){return document.getElementById("main").dataset.type}function Vt(e,t){if(e){for(let n of e){let i=n.nodeGroups&&n.nodeGroups.find(r=>r.nodes.some(s=>s.anchor===t));if(i)return i.key}return null}}function Ee(e,t=!1){if(!e)return t?document.getElementById("top-content"):null;let n=document.getElementById(e);return n?n.matches(".detail")?n:["h1","h2","h3","h4","h5","h6"].includes(n.tagName.toLowerCase())?Vi(n):null:null}function Vi(e){let t=[e],n=e.nextElementSibling,i=e.tagName.toLowerCase();for(;n;){let s=n.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6"].includes(s)&&s<=i?n=null:(t.push(n),n=n.nextElementSibling)}let r=document.createElement("div");return r.append(...t),r}function ie(){return window.location.hash.replace(/^#/,"")}function jt(e){return new URLSearchParams(window.location.search).get(e)}function zt(e){return fetch(e).then(t=>t.ok).catch(()=>!1)}function Wt(e){document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)}function re(e){return!e||e.trim()===""}function Gt(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{n=null,e(...r)},t)}}function xe(){return document.head.querySelector("meta[name=project][content]").content}function se(){return/(Macintosh|iPhone|iPad|iPod)/.test(window.navigator.userAgent)}var ji="content",zi="tabs-open",Wi="tabs-close",Gi="H3",Ki="tabset";function Yt(){Yi().map(Ji).forEach(n=>er(n))}function Yi(){let e=document.createNodeIterator(document.getElementById(ji),NodeFilter.SHOW_COMMENT,{acceptNode(i){return i.nodeValue.trim()===zi?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),t=[],n;for(;n=e.nextNode();)t.push(n);return t}function Ji(e,t,n){let i=[],r=[],s={label:"",content:[]};for(;e=e.nextSibling;){if(Xi(e)){Kt(s,r,t);break}i.push(e),e.nodeName===Gi?(Kt(s,r,t),s.label=e.innerText,s.content=[]):s.content.push(e.outerHTML)}let o=document.createElement("div");return o.className=Ki,Zi(i,o),o.innerHTML=Handlebars.templates.tabset({tabs:r}),o}function Xi(e){return e.nodeName==="#comment"&&e.nodeValue.trim()===Wi}function Kt(e,t,n){if(e.label===""&&!e.content.length)return!1;let i=e.label,r=e.content;t.push({label:i,content:r,setIndex:n})}function Zi(e,t){if(!e||!e.length)return!1;e[0].parentNode.insertBefore(t,e[0]),e.forEach(n=>t.appendChild(n))}function er(e){let t={tabs:e.querySelectorAll(':scope [role="tab"]'),panels:e.querySelectorAll(':scope [role="tabpanel"]'),activeIndex:0};t.tabs.forEach((n,i)=>{n.addEventListener("click",r=>{Y(i,t)}),n.addEventListener("keydown",r=>{let s=t.tabs.length-1;r.code==="ArrowLeft"?(r.preventDefault(),t.activeIndex===0?Y(s,t):Y(t.activeIndex-1,t)):r.code==="ArrowRight"?(r.preventDefault(),t.activeIndex===s?Y(0,t):Y(t.activeIndex+1,t)):r.code==="Home"?(r.preventDefault(),Y(0,t)):r.code==="End"&&(r.preventDefault(),Y(s,t))})})}function Y(e,t){t.tabs[t.activeIndex].setAttribute("aria-selected","false"),t.tabs[t.activeIndex].tabIndex=-1,t.tabs[e].setAttribute("aria-selected","true"),t.tabs[e].tabIndex=0,t.tabs[e].focus(),t.panels[t.activeIndex].setAttribute("hidden",""),t.panels[t.activeIndex].tabIndex=-1,t.panels[e].removeAttribute("hidden"),t.panels[e].tabIndex=0,t.activeIndex=e}var Jt="ex_doc:settings",tr={tooltips:!0,theme:null,livebookUrl:null},Ke=class{constructor(){this._subscribers=[],this._settings=tr,this._loadSettings()}get(){return this._settings}update(t){let n=this._settings;this._settings={...this._settings,...t},this._subscribers.forEach(i=>i(this._settings,n)),this._storeSettings()}getAndSubscribe(t){this._subscribers.push(t),t(this._settings)}_loadSettings(){try{let t=localStorage.getItem(Jt);if(t){let n=JSON.parse(t);this._settings={...this._settings,...n}}this._loadSettingsLegacy()}catch(t){console.error(`Failed to load settings: ${t}`)}}_storeSettings(){try{this._storeSettingsLegacy(),localStorage.setItem(Jt,JSON.stringify(this._settings))}catch(t){console.error(`Failed to persist settings: ${t}`)}}_loadSettingsLegacy(){localStorage.getItem("tooltipsDisabled")!==null&&(this._settings={...this._settings,tooltips:!1}),localStorage.getItem("night-mode")==="true"&&(this._settings={...this._settings,nightMode:!0}),this._settings.nightMode===!0&&(this._settings={...this._settings,theme:"dark"})}_storeSettingsLegacy(){this._settings.tooltips?localStorage.removeItem("tooltipsDisabled"):localStorage.setItem("tooltipsDisabled","true"),this._settings.nightMode!==null?localStorage.setItem("night-mode",this._settings.nightMode===!0?"true":"false"):localStorage.removeItem("night-mode"),this._settings.theme!==null?(localStorage.setItem("night-mode",this._settings.theme==="dark"?"true":"false"),this._settings.nightMode=this._settings.theme==="dark"):(delete this._settings.nightMode,localStorage.removeItem("night-mode"))}},I=new Ke;var nr=".content",Xt=".content-inner",ir=".livebook-badge";function Zt(e){e||sr(),or(),rr()}function rr(){d(nr).querySelectorAll("a").forEach(e=>{e.querySelector("code, img")&&e.classList.add("no-underline")})}function sr(){d(Xt).setAttribute("tabindex",-1),d(Xt).focus()}function or(){let t=window.location.pathname.replace(/(\.html)?$/,".livemd"),n=new URL(t,window.location.href).toString();I.getAndSubscribe(i=>{let r=i.livebookUrl?cr(i.livebookUrl,n):ar(n);for(let s of A(ir))s.href=r})}function ar(e){return`https://livebook.dev/run?url=${encodeURIComponent(e)}`}function cr(e,t){return`${e}/import?url=${encodeURIComponent(t)}`}var an=Ut(sn());var kr=768,Je=300,oe=".sidebar-toggle",Or=".content",$={CLOSED:"closed",OPEN:"open",NO_PREF:"no_pref"},Q={opened:"sidebar-opened",openingStart:"sidebar-opening-start",opening:"sidebar-opening",closed:"sidebar-closed",closingStart:"sidebar-closing-start",closing:"sidebar-closing"},Cr=Object.values(Q),R={togglingTimeout:null,lastWindowWidth:window.innerWidth,sidebarPreference:$.NO_PREF};function cn(){Xe(),Ar(),Ir()}function ln(){Xe()}function Ar(){let e=sessionStorage.getItem("sidebar_width");e&&on(e),new ResizeObserver(n=>{for(let i of n)on(i.contentRect.width)}).observe(document.getElementById("sidebar"))}function on(e){sessionStorage.setItem("sidebar_width",e),document.body.style.setProperty("--sidebarWidth",`${e}px`)}function Xe(){sessionStorage.getItem("sidebar_state")==="closed"||un()?(j(Q.closed),d(oe).setAttribute("aria-expanded","false")):(j(Q.opened),d(oe).setAttribute("aria-expanded","true")),setTimeout(()=>d(oe).classList.add("sidebar-toggle--animated"),Je)}function un(){return window.matchMedia(`screen and (max-width: ${kr}px)`).matches}function j(...e){document.body.classList.remove(...Cr),document.body.classList.add(...e)}function Ir(){d(oe).addEventListener("click",e=>{Ze(),Rr()}),d(Or).addEventListener("click",e=>{Pr()}),window.addEventListener("resize",(0,an.default)(e=>{_r()},100))}function Ze(){return et()?hn():tt()}function et(){return document.body.classList.contains(Q.opened)||document.body.classList.contains(Q.opening)}function dn(){return document.body.classList.contains(Q.opened)}function tt(){return fn(),sessionStorage.setItem("sidebar_state","opened"),d(oe).setAttribute("aria-expanded","true"),new Promise((e,t)=>{requestAnimationFrame(()=>{j(Q.openingStart),requestAnimationFrame(()=>{j(Q.opening),R.togglingTimeout=setTimeout(()=>{j(Q.opened),e()},Je)})})})}function hn(){return fn(),sessionStorage.setItem("sidebar_state","closed"),d(oe).setAttribute("aria-expanded","false"),new Promise((e,t)=>{requestAnimationFrame(()=>{j(Q.closingStart),requestAnimationFrame(()=>{j(Q.closing),R.togglingTimeout=setTimeout(()=>{j(Q.closed),e()},Je)})})})}function fn(){R.togglingTimeout&&(clearTimeout(R.togglingTimeout),R.togglingTimeout=null)}function _r(){R.lastWindowWidth!==window.innerWidth&&(R.lastWindowWidth=window.innerWidth,(R.sidebarPreference===$.OPEN||R.sidebarPreference===$.NO_PREF)&&Xe())}function Pr(){un()&&et()&&hn()}function Rr(){switch(R.sidebarPreference){case $.OPEN:R.sidebarPreference=$.CLOSED;break;case $.CLOSED:R.sidebarPreference=$.OPEN;break;case $.NO_PREF:et()?R.sidebarPreference=$.OPEN:R.sidebarPreference=$.CLOSED}}function he(){return window.sidebarNodes||{}}function pn(){return window.versionNodes||[]}var nt={search:"search",extras:"extras",modules:"modules",tasks:"tasks"},it=[nt.extras,nt.modules,nt.tasks],ke=e=>`#${e}-full-list`;function mn(){rt(),$r()}function rt(){it.forEach(e=>{Nr(he(),e)}),Te(V()),vn(),gn()}function Nr(e,t){let n=e[t]||[],i=d(ke(t));if(!i)return;let r=Handlebars.templates["sidebar-items"]({nodes:n,group:""});i.innerHTML=r,i.querySelectorAll("ul").forEach(s=>{if(s.innerHTML.trim()===""){let o=s.previousElementSibling;o.classList.contains("expand")&&o.classList.remove("expand"),s.remove()}}),i.querySelectorAll("li a + button").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.closest("li");Qr(c)})}),i.querySelectorAll("li a").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.closest("li"),l=i.querySelector(".current-section");l&&Mr(l),s.matches(".expand")&&(s.pathname===window.location.pathname||s.pathname===window.location.pathname+".html")&&st(c)})})}function st(e){e.classList.add("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","true")}function Hr(e){e.classList.remove("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","false")}function Qr(e){e.classList.contains("open")?Hr(e):st(e)}function Dr(e){e.classList.add("current-section"),e.querySelector("a").setAttribute("aria-current","true")}function Mr(e){e.classList.remove("current-section"),e.querySelector("a").setAttribute("aria-current","false")}function Fr(e){e.classList.add("current-hash"),e.querySelector("a").setAttribute("aria-current","true")}function Br(e){e.classList.remove("current-hash"),e.querySelector("a").setAttribute("aria-current","false")}function Te(e){it.forEach(t=>{let n=d(`#${t}-list-tab-button`);if(n){let i=d(`#${n.getAttribute("aria-controls")}`);t===e?(n.parentElement.classList.add("selected"),n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0"),i.removeAttribute("hidden")):(n.parentElement.classList.remove("selected"),n.setAttribute("aria-selected","false"),n.setAttribute("tabindex","-1"),i.setAttribute("hidden","hidden"))}})}function gn(){let e=d(ke(V()));if(!e)return;let t=e.querySelector("li.current-page");t&&(t.scrollIntoView(),e.scrollTop-=40)}function vn(){let e=ie()||"content",n=he()[V()]||[],i=Vt(n,e),r=d(ke(V()));if(!r)return;let s=r.querySelector(`li.current-page a.expand[href$="#${i}"]`);s&&st(s.closest("li"));let o=r.querySelector(`li.current-page a[href$="#${e}"]`);if(o){let a=o.closest("ul");a.classList.contains("deflist")&&Dr(a.closest("li")),Fr(o.closest("li"))}}function $r(){it.forEach(t=>{let n=d(`#${t}-list-tab-button`);n&&n.addEventListener("click",i=>{Te(t),gn()})});let e=d("#sidebar-list-nav");e.addEventListener("keydown",t=>{if(t.key!=="ArrowRight"&&t.key!=="ArrowLeft")return;let n=Array.from(e.querySelectorAll('[role="tab"]')).map(r=>r.dataset.type),i=e.querySelector('[role="tab"][aria-selected="true"]').dataset.type;if(t.key==="ArrowRight"){let r=n.indexOf(i)+1;r>=n.length&&(r=0);let s=n[r];Te(s),d(`#${s}-list-tab-button`).focus()}else if(t.key==="ArrowLeft"){let r=n.indexOf(i)-1;r<0&&(r=n.length-1);let s=n[r];Te(s),d(`#${s}-list-tab-button`).focus()}}),window.addEventListener("hashchange",t=>{let n=d(ke(V()));if(!n)return;let i=n.querySelector("li.current-page li.current-hash");i&&Br(i),vn()})}var U={module:"module",moduleChild:"module-child",mixTask:"mix-task",extra:"extra",section:"section"};function wn(e,t=8){if(re(e))return[];let n=he(),i=[...ot(n.modules,e,U.module,"module"),...Ur(n.modules,e,U.moduleChild),...ot(n.tasks,e,U.mixTask,"mix task"),...ot(n.extras,e,U.extra,"page"),...at(n.modules,e,U.section,"module"),...at(n.tasks,e,U.section,"mix task"),...at(n.extras,e,U.section,"page")].filter(r=>r!==null);return Kr(i).slice(0,t)}function ot(e,t,n,i){return e.map(r=>Vr(r,t,n,i))}function Ur(e,t,n){return e.filter(i=>i.nodeGroups).flatMap(i=>i.nodeGroups.flatMap(({key:r,nodes:s})=>{let o=Gr(r);return s.map(a=>jr(a,i.id,t,n,o)||Wr(a,i.id,t,n,o))}))}function at(e,t,n,i){return e.flatMap(r=>qr(r).map(s=>zr(r,s,t,n,i)))}function qr(e){return(e.sections||[]).concat(e.headers||[])}function Vr(e,t,n,i){return Ce(e.title,t)?{link:`${e.id}.html`,title:_e(e.title,t),description:null,matchQuality:Ae(e.title,t),deprecated:e.deprecated,labels:[i],category:n}:null}function jr(e,t,n,i,r){return Ce(e.id,n)?{link:`${t}.html#${e.anchor}`,title:_e(e.id,n),labels:[r],description:t,matchQuality:Ae(e.id,n),deprecated:e.deprecated,category:i}:null}function zr(e,t,n,i,r){return bn(t.id,n)?{link:`${e.id}.html#${t.anchor}`,title:_e(t.id,n),description:e.title,matchQuality:Ae(t.id,n),labels:[r,"section"],category:i}:null}function Wr(e,t,n,i,r){let s=`${t}.${e.id}`,o=`${t}:${e.id}`,a,c;if(Ce(s,n))a=s,c=/\./g;else if(Ce(o,n))a=o,c=/:/g;else return null;let l=n.replace(c," ");return bn(e.id,l)?{link:`${t}.html#${e.anchor}`,title:_e(e.id,l),label:r,description:t,matchQuality:Ae(a,n),deprecated:e.deprecated,category:i}:null}function Gr(e){switch(e){case"callbacks":return"callback";case"types":return"type";default:return"function"}}function Kr(e){return e.slice().sort((t,n)=>t.matchQuality!==n.matchQuality?n.matchQuality-t.matchQuality:yn(t.category)-yn(n.category))}function yn(e){switch(e){case U.module:return 1;case U.moduleChild:return 2;case U.mixTask:return 3;default:return 4}}function bn(e,t){return Ie(t).some(i=>Sn(e,i))}function Ce(e,t){return Ie(t).every(i=>Sn(e,i))}function Sn(e,t){return e.toLowerCase().includes(t.toLowerCase())}function Ae(e,t){let n=Ie(t),r=n.map(o=>o.length).reduce((o,a)=>o+a,0)/e.length,s=Yr(e,n[0])?1:0;return r+s}function Yr(e,t){return e.toLowerCase().startsWith(t.toLowerCase())}function Ie(e){return e.trim().split(/\s+/)}function _e(e,t){let n=Ie(t).sort((i,r)=>r.length-i.length);return Oe(e,n)}function Oe(e,t){if(t.length===0)return e;let[n,...i]=t,r=e.match(new RegExp(`(.*)(${qt(n)})(.*)`,"i"));if(r){let[,s,o,a]=r;return Oe(s,t)+""+Se(o)+""+Oe(a,t)}else return Oe(e,i)}var Pe=null,J=null;function En(){J=document.getElementById("toast"),J.addEventListener("click",e=>{clearTimeout(Pe),e.target.classList.remove("show")})}function ct(e){J&&(clearTimeout(Pe),J.innerText=e,J.classList.add("show"),Pe=setTimeout(()=>{J.classList.remove("show"),Pe=setTimeout(function(){J.innerText=""},1e3)},5e3))}var xn="dark",lt=["system","dark","light"];function Ln(e){I.getAndSubscribe(t=>{document.body.classList.toggle(xn,kn(e||t.theme))}),Xr()}function Tn(){let e=lt[lt.indexOf(ut())+1]||lt[0];I.update({theme:e}),ct(`Set theme to "${e}"`)}function ut(){return I.get().theme||"system"}function kn(e){return e==="dark"||Jr()&&(e==null||e==="system")}function Jr(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function Xr(){window.matchMedia("(prefers-color-scheme: dark)").addListener(e=>{let t=I.get().theme,n=kn(t);(t==null||t==="system")&&(document.body.classList.toggle(xn,n),ct(`Browser changed theme to "${n?"dark":"light"}"`))})}var ae=".autocomplete",Ne=".autocomplete-suggestions",Re=".autocomplete-suggestion",_={autocompleteSuggestions:[],previewOpen:!1,selectedIdx:-1};function Zr(){d(ae).classList.add("shown")}function dt(){d(ae).classList.remove("shown")}function On(){return d(ae).classList.contains("shown")}function ht(e){_.autocompleteSuggestions=wn(e),_.selectedIdx=-1,re(e)?dt():(es({term:e,suggestions:_.autocompleteSuggestions}),He(0),Zr())}function es({term:e,suggestions:t}){let n=Handlebars.templates["autocomplete-suggestions"]({suggestions:t,term:e}),i=d(ae);i.innerHTML=n}function ft(){return _.selectedIdx===-1?null:_.autocompleteSuggestions[_.selectedIdx]}function He(e){An(ts(e))}function Cn(e){if(e.data.type==="preview"){let{contentHeight:t}=e.data,n=d(".autocomplete-preview");n&&(n.style.height=`${t+32}px`,n.classList.remove("loading"))}}function An(e){_.selectedIdx=e;let t=d(Ne),n=d(`${Re}.selected`),i=d(`${Re}[data-index="${_.selectedIdx}"]`);if(n&&n.classList.remove("selected"),i){if(_.previewOpen){_n(),window.addEventListener("message",Cn),t.classList.add("previewing");let r=document.createElement("div");r.classList.add("autocomplete-preview"),r.classList.add("loading");let s=i.href.replace(".html",`.html?preview=true&theme=${ut()}`),o=document.createElement("iframe");o.setAttribute("src",s),r.appendChild(document.createElement("div")),r.appendChild(document.createElement("span")),r.appendChild(o),i.parentNode.insertBefore(r,i.nextSibling)}i.classList.add("selected"),i.scrollIntoView({block:"nearest"})}else t&&(t.scrollTop=0)}function In(){_.previewOpen?Qe():pt()}function Qe(){_.previewOpen=!1;let e=d(Ne);e&&e.classList.remove("previewing"),_n()}function pt(e){_.previewOpen=!0,e?e=e.closest(Re):e=d(`${Re}[data-index="${_.selectedIdx}"]`),e&&An(parseInt(e.dataset.index))}function _n(){let e=d(".autocomplete-preview");e&&(e.remove(),window.removeEventListener("message",Cn))}function ts(e){let t=_.autocompleteSuggestions.length+1;return(_.selectedIdx+e+1+t)%t-1}var fe="form.search-bar input",ns="form.search-bar .search-close-button";function Nn(){is(),window.onTogglePreviewClick=function(e,t){e.preventDefault(),e.stopImmediatePropagation(),gt(),t?pt(e.target):Qe()}}function Hn(e){let t=d(fe);t.value=e}function gt(){let e=d(fe);document.body.classList.add("search-focused"),e.focus()}function is(){let e=d(fe);if(document.querySelector('meta[name="exdoc:autocomplete"][content="off"]'))return e.addEventListener("keydown",t=>{t.key==="Enter"&&Pn(t)}),!0;e.addEventListener("keydown",t=>{let n=se();t.key==="Escape"?(De(),e.blur()):t.key==="Enter"?Pn(t):t.key==="ArrowUp"||n&&t.ctrlKey&&t.key==="p"?(He(-1),t.preventDefault()):t.key==="ArrowDown"||n&&t.ctrlKey&&t.key==="n"?(He(1),t.preventDefault()):t.key==="Tab"&&ft()!==null&&(In(),t.preventDefault())}),e.addEventListener("input",t=>{ht(t.target.value)}),e.addEventListener("focus",t=>{document.body.classList.contains("search-focused")||(document.body.classList.add("search-focused"),ht(t.target.value))}),e.addEventListener("blur",t=>{let n=t.relatedTarget,i=d(Ne);if(n&&i&&i.contains(n))return setTimeout(()=>{On()&&e.focus()},1e3),null;Me()}),d(ae).addEventListener("click",t=>{t.shiftKey||t.ctrlKey?e.focus():(De(),Me())}),d(ns).addEventListener("click",t=>{De(),Me()})}function Pn(e){let t=d(fe),n=e.shiftKey||e.ctrlKey,i=ft();e.preventDefault();let r=n?"_blank":"_self",s=document.createElement("a");if(s.setAttribute("target",r),i)s.setAttribute("href",i.link);else{let o=document.querySelector('meta[name="exdoc:full-text-search-url"]'),a=o?o.getAttribute("content"):"search.html?q=";s.setAttribute("href",`${a}${encodeURIComponent(t.value)}`)}s.click(),n||(De(),Me())}function De(){let e=d(fe);e.value=""}function Me(){Qe(),document.body.classList.remove("search-focused"),dt()}var mt=window.scrollY,rs=70,Rn=-2;window.addEventListener("scroll",function(){let e=window.scrollY;e===0||mt-ers?document.body.classList.remove("scroll-sticky"):mt-e>Math.abs(Rn)&&document.body.classList.add("scroll-sticky"),mt=e<=0?0:e},!1);var Qn=".sidebar-projectVersion",Dn=".sidebar-projectVersionsDropdown";function Mn(){let e=pn();if(e.length>0){let n=d(Qn).textContent.trim(),i=os(e,n);ss({nodes:i})}}function ss({nodes:e}){let t=d(Qn),n=Handlebars.templates["versions-dropdown"]({nodes:e});t.innerHTML=n,d(Dn).addEventListener("change",cs)}function os(e,t){return as(e,t).map(i=>({...i,isCurrentVersion:i.version===t}))}function as(e,t){return e.some(i=>i.version===t)?e:[{version:t,url:"#"},...e]}function cs(e){let t=e.target.value,n=window.location.pathname.split("/").pop()+window.location.hash,i=`${t}/${n}`;zt(i).then(r=>{r?window.location.href=i:window.location.href=t})}function vt(){let e=d(Dn);e&&(e.focus(),e.addEventListener("keydown",t=>{(t.key==="Escape"||t.key==="v")&&(t.preventDefault(),e.blur())}),navigator.userActivation.isActive&&"showPicker"in HTMLSelectElement.prototype&&e.showPicker())}var M=Ut($n());var Fe=80,ls="#search";M.default.tokenizer.separator=/\s+/;M.default.QueryLexer.termSeparator=/\s+/;M.default.Pipeline.registerFunction(Vn,"docTokenSplitter");M.default.Pipeline.registerFunction(jn,"docTrimmer");function wt(){let e=window.location.pathname;if(e.endsWith("/search.html")||e.endsWith("/search")){let t=jt("q");us(t)}}async function us(e){if(re(e))yt({value:e});else{Hn(e);let t=await ds();try{let n=e.replaceAll(/(\B|\\):/g,"\\:"),i=Ss(t.search(n));yt({value:e,results:i})}catch(n){yt({value:e,errorMessage:n.message})}}}function yt({value:e,results:t,errorMessage:n}){let i=d(ls),r=Handlebars.templates["search-results"]({value:e,results:t,errorMessage:n});i.innerHTML=r}async function ds(){let e=await hs();if(e)return e;let t=ys();return fs(t),t}async function hs(){try{let e=sessionStorage.getItem(qn());if(e){let t=await ms(e);return M.default.Index.load(t)}else return null}catch(e){return console.error("Failed to load index: ",e),null}}async function fs(e){try{let t=await ps(e);sessionStorage.setItem(qn(),t)}catch(t){console.error("Failed to save index: ",t)}}async function ps(e){let t=new Blob([JSON.stringify(e)],{type:"application/json"}).stream().pipeThrough(new window.CompressionStream("gzip")),i=await(await new Response(t).blob()).arrayBuffer();return gs(i)}async function ms(e){let t=new Blob([vs(e)],{type:"application/json"}).stream().pipeThrough(new window.DecompressionStream("gzip")),n=await new Response(t).text();return JSON.parse(n)}function gs(e){let t="",n=new Uint8Array(e),i=n.byteLength;for(let r=0;r{this.add(e)})})}function ws(e){e.pipeline.before(M.default.stemmer,Vn)}function Vn(e){let t=[e],n=/\/\d+$/,i=/\:|\./,r=e.toString();if(r.replace(/^[.,;?!]+|[.,;]+$/g,""),r.startsWith("`")&&r.endsWith("`")&&(r=r.slice(1,-1)),n.test(r)){let o=e.toString().replace(n,"");t.push(e.clone().update(()=>o));let a=o.split(i);if(a.length>1){for(let l of a)t.push(e.clone().update(()=>l));let c=e.toString().split(i);t.push(e.clone().update(()=>c[c.length-1]))}r=a[a.length-1]}else r.startsWith("@")?(r=r.substring(1),t.push(e.clone().update(()=>r))):r.startsWith(":")&&(r=r.substring(1),t.push(e.clone().update(()=>r)));let s=r.split(/\_|\-/);if(s.length>1)for(let o of s)t.push(e.clone().update(()=>o));return t}function bs(e){e.pipeline.before(M.default.stemmer,jn)}function jn(e){return e.update(function(t){return t.replace(/^[^@:\w]+/,"").replace(/[^\?\!\w]+$/,"")})}function Ss(e){return e.filter(t=>Un(t.ref)).map(t=>{let n=Un(t.ref),i=t.matchData.metadata;return{...n,metadata:i,excerpts:Es(n,i)}})}function Un(e){return searchData.items.find(t=>t.ref===e)||null}function Es(e,t){let{doc:n}=e,r=Object.keys(t).filter(s=>"doc"in t[s]).map(s=>t[s].doc.position.map(([o,a])=>xs(n,o,a))).reduce((s,o)=>s.concat(o),[]);return r.length===0?[n.slice(0,Fe*2)+(Fe*20?"...":"",e.slice(i,t),""+Se(e.slice(t,t+n))+"",e.slice(t+n,r),r{let n=t.getAttribute("data-group-id");t.addEventListener("mouseenter",i=>{zn(n,!0)}),t.addEventListener("mouseleave",i=>{zn(n,!1)})})}function zn(e,t){A(`[data-group-id="${e}"]`).forEach(i=>{i.classList.toggle(Ls,t)})}var Z=".modal",ks=".modal .modal-close",Os=".modal .modal-title",Cs=".modal .modal-body",Gn='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',q={prevFocus:null,lastFocus:null,ignoreFocusChanges:!1};function Kn(){As()}function As(){let e=Handlebars.templates["modal-layout"]();document.body.insertAdjacentHTML("beforeend",e),d(Z).addEventListener("keydown",t=>{t.key==="Escape"&&X()}),d(ks).addEventListener("click",t=>{X()}),d(Z).addEventListener("click",t=>{t.target.classList.contains("modal")&&X()})}function Yn(e){if(q.ignoreFocusChanges)return;let t=d(Z);if(t.contains(e.target))q.lastFocus=e.target;else{q.ignoreFocusChanges=!0;let n=Is(t);q.lastFocus===n?_s(t).focus():n.focus(),q.ignoreFocusChanges=!1,q.lastFocus=document.activeElement}}function Is(e){return e.querySelector(Gn)}function _s(e){let t=e.querySelectorAll(Gn);return t[t.length-1]}function Be({title:e,body:t}){q.prevFocus=document.activeElement,document.addEventListener("focus",Yn,!0),d(Os).innerHTML=e,d(Cs).innerHTML=t,d(Z).classList.add("shown"),d(Z).focus()}function X(){d(Z).classList.remove("shown"),document.addEventListener("focus",Yn,!0),q.prevFocus&&q.prevFocus.focus(),q.prevFocus=null}function Jn(){return d(Z).classList.contains("shown")}var Ps="https://hexdocs.pm/%%",Rs="https://www.erlang.org/doc/apps/%%",Ns="https://hex.pm/api/packages?search=name:%%*",Hs=".display-quick-switch",bt="#quick-switch-input",Zn="#quick-switch-results",Qs=".quick-switch-result",Ds=300,Ms=9,ei=["erts","asn1","common_test","compiler","crypto","debugger","dialyzer","diameter","edoc","eldap","erl_interface","et","eunit","ftp","inets","jinterface","kernel","megaco","mnesia","observer","odbc","os_mon","parsetools","public_key","reltool","runtime_tools","sasl","snmp","ssh","ssl","stdlib","syntax_tools","tftp","tools","wx","xmerl"],Fs=["elixir","eex","ex_unit","hex","iex","logger","mix"].concat(ei).map(e=>({name:e})),ti=2,N={autocompleteResults:[],selectedIdx:null};function ni(){Bs()}function Bs(){A(Hs).forEach(e=>{e.addEventListener("click",t=>{Et()})})}function $s(e){if(e.key==="Enter"){let t=e.target.value;qs(t),e.preventDefault()}else e.key==="ArrowUp"?(Xn(-1),e.preventDefault()):e.key==="ArrowDown"&&(Xn(1),e.preventDefault())}function Us(e){let t=e.target.value;if(t.lengthn.json()).then(n=>{Array.isArray(n)&&(N.autocompleteResults=Ws(e,n),N.selectedIdx=null,d(bt).value.length>=ti&&zs({results:N.autocompleteResults}))})}function zs({results:e}){let t=d(Zn),n=Handlebars.templates["quick-switch-results"]({results:e});t.innerHTML=n,A(Qs).forEach(i=>{i.addEventListener("click",r=>{let s=i.getAttribute("data-index"),o=N.autocompleteResults[s];St(o.name)})})}function Ws(e,t){return Fs.concat(t).filter(n=>n.name.toLowerCase().includes(e.toLowerCase())).filter(n=>n.releases===void 0||n.releases[0].has_docs===!0).slice(0,Ms)}function Xn(e){N.selectedIdx=Gs(e);let t=d(".quick-switch-result.selected"),n=d(`.quick-switch-result[data-index="${N.selectedIdx}"]`);t&&t.classList.remove("selected"),n&&n.classList.add("selected")}function Gs(e){let t=N.autocompleteResults.length;if(N.selectedIdx===null){if(e>=0)return 0;if(e<0)return t-1}return(N.selectedIdx+e+t)%t}var Ks=".display-settings",Ys="#settings-modal-content",xt="#modal-settings-tab",Lt="#modal-keyboard-shortcuts-tab",ri="#settings-content",si="#keyboard-shortcuts-content",Js=[{title:"Settings",id:"modal-settings-tab"},{title:"Keyboard shortcuts",id:"modal-keyboard-shortcuts-tab"}];function oi(){Xs()}function Xs(){A(Ks).forEach(e=>{e.addEventListener("click",t=>{Tt()})})}function ii(){d(Lt).classList.remove("active"),d(xt).classList.add("active"),d(ri).classList.remove("hidden"),d(si).classList.add("hidden")}function Zs(){d(Lt).classList.add("active"),d(xt).classList.remove("active"),d(si).classList.remove("hidden"),d(ri).classList.add("hidden")}function Tt(){Be({title:Js.map(({id:s,title:o})=>``).join(""),body:Handlebars.templates["settings-modal-body"]({shortcuts:kt})});let e=d(Ys),t=e.querySelector('[name="theme"]'),n=e.querySelector('[name="tooltips"]'),i=e.querySelector('[name="direct_livebook_url"]'),r=e.querySelector('[name="livebook_url"]');I.getAndSubscribe(s=>{t.value=s.theme||"system",n.checked=s.tooltips,s.livebookUrl===null?(i.checked=!1,r.classList.add("hidden"),r.tabIndex=-1):(i.checked=!0,r.classList.remove("hidden"),r.tabIndex=0,r.value=s.livebookUrl)}),t.addEventListener("change",s=>{I.update({theme:s.target.value})}),n.addEventListener("change",s=>{I.update({tooltips:s.target.checked})}),i.addEventListener("change",s=>{let o=s.target.checked?r.value:null;I.update({livebookUrl:o})}),r.addEventListener("input",s=>{I.update({livebookUrl:s.target.value})}),d(xt).addEventListener("click",s=>{ii()}),d(Lt).addEventListener("click",s=>{Zs()}),ii()}var eo="#settings-modal-content",kt=[{key:"c",description:"Toggle sidebar",action:Ze},{key:"n",description:"Cycle themes",action:Tn},{key:"s",description:"Focus search bar",displayAs:"/ or s",action:Ot},{key:"/",action:Ot},{key:"k",hasModifier:!0,action:Ot},{key:"v",description:"Open/focus version select",action:ro},{key:"g",description:"Go to package docs",displayAs:"g",action:Et},{key:"?",displayAs:"?",description:"Bring up this modal",action:so}],Ct={shortcutBeingPressed:null};function ai(){to()}function to(){document.addEventListener("keydown",no),document.addEventListener("keyup",io)}function no(e){if(Ct.shortcutBeingPressed||e.target.matches("input, select, textarea"))return;let t=kt.find(n=>n.hasModifier?se()&&e.metaKey||e.ctrlKey?n.key===e.key:!1:e.ctrlKey||e.metaKey||e.altKey?!1:n.key===e.key);t&&(Ct.shortcutBeingPressed=t,e.preventDefault(),t.action(e))}function io(e){Ct.shortcutBeingPressed=null}function Ot(e){X(),gt()}function ro(){X(),dn()?vt():tt().then(vt)}function so(){oo()?X():Tt()}function oo(){return Jn()&&d(eo)}var ee={plain:"plain",function:"function",module:"module"},ao=[{href:"typespecs.html#basic-types",hint:{kind:ee.plain,description:"Basic type"}},{href:"typespecs.html#literals",hint:{kind:ee.plain,description:"Literal"}},{href:"typespecs.html#built-in-types",hint:{kind:ee.plain,description:"Built-in type"}}],$e={cancelHintFetching:null};function ci(e){if(ui(e))return!0;let t=/#.*\//;return e.includes("#")&&!t.test(e)?!1:e.includes(".html")}function li(e){let t=ui(e);return t?Promise.resolve(t):co(e)}function ui(e){let t=ao.find(n=>e.includes(n.href));return t?t.hint:null}function co(e){let t=e.replace(".html",".html?hint=true");return new Promise((n,i)=>{let r=document.createElement("iframe");r.setAttribute("src",t),r.style.display="none";function s(a){let{href:c,hint:l}=a.data;t===c&&(o(),n(l))}$e.cancelHintFetching=()=>{o(),i(new Error("cancelled"))};function o(){r.remove(),window.removeEventListener("message",s),$e.cancelHintFetching=null}window.addEventListener("message",s),document.body.appendChild(r)})}function di(){$e.cancelHintFetching&&$e.cancelHintFetching()}function hi(e){let n=e.querySelector("h1").textContent,i=e.querySelector(".docstring > p"),r=i?i.innerHTML:"";return{kind:ee.function,title:n.trim(),description:r.trim()}}function fi(e){let n=e.querySelector("h1 > span").textContent,i=e.querySelector("#moduledoc p"),r=i?i.innerHTML:"";return{kind:ee.module,title:n.trim(),description:r.trim()}}var lo=".content a",At=".tooltip",uo=".tooltip .tooltip-body",mi="body .content-inner",ho="#content",gi="tooltip-shown",pe=10,fo=pe*4,pi={height:450,width:768},po=100,ce={currentLinkElement:null,hoverDelayTimeout:null};function vi(){mo(),go()}function mo(){let e=Handlebars.templates["tooltip-layout"]();d(mi).insertAdjacentHTML("beforeend",e)}function go(){A(lo).forEach(e=>{vo(e)&&(e.addEventListener("mouseenter",t=>{wo(e)}),e.addEventListener("mouseleave",t=>{xo(e)}))})}function vo(e){return!(e.getAttribute("data-no-tooltip")!==null||yo(e.href)||!ci(e.href))}function yo(e){let t=e.replace(ho,"");return window.location.href.split("#")[0]===t}function wo(e){bo()&&(ce.currentLinkElement=e,ce.hoverDelayTimeout=setTimeout(()=>{li(e.href).then(t=>{So(t),Eo()}).catch(()=>{})},po))}function bo(){let e=window.innerWidthe.firstElementChild&&e.firstElementChild.tagName==="CODE").forEach(e=>e.insertAdjacentHTML("beforeend",Po)),Array.from(A(".copy-button")).forEach(e=>{let t;e.addEventListener("click",()=>{let n=e.querySelector("[aria-live]");t&&clearTimeout(t);let i=Array.from(e.parentElement.querySelector("code").childNodes).filter(r=>!(r.tagName==="SPAN"&&r.classList.contains("unselectable"))).map(r=>r.textContent).join("");navigator.clipboard.writeText(i),e.classList.add("clicked"),n.innerHTML="Copied! ✓",t=setTimeout(()=>{e.classList.remove("clicked"),n.innerHTML=""},3e3)})})}function Ei(){let e=se()?"apple-os":"non-apple-os";document.documentElement.classList.add(e)}function Li(){let e=Ee(ie(),!0);e&&No(e)}function No(e){Do(e),Ho(),Qo(),xi(),window.addEventListener("resize",t=>{xi()})}function xi(){let e=document.body.scrollHeight,t=document.getElementById("content").parentElement.offsetHeight,n={type:"preview",maxHeight:e,contentHeight:t};window.parent.postMessage(n,"*")}function Ho(){let e=document.getElementsByTagName("a");for(let t of e)t.getAttribute("target")!=="_blank"&&t.setAttribute("target","_parent")}function Qo(){window.scrollTo(0,0)}function Do(e){document.body.classList.add("preview");let t=document.getElementById("content");t.innerHTML=e.innerHTML}var It=new WeakMap;function _t(e,t,n,i){if(!e&&!It.has(t))return!1;let r=It.get(t)??new WeakMap;It.set(t,r);let s=r.get(n)??new Set;r.set(n,s);let o=s.has(i);return e?s.add(i):s.delete(i),o&&e}function Mo(e,t){let n=e.target;if(n instanceof Text&&(n=n.parentElement),n instanceof Element&&e.currentTarget instanceof Element){let i=n.closest(t);if(i&&e.currentTarget.contains(i))return i}}function Fo(e,t,n,i={}){let{signal:r,base:s=document}=i;if(r?.aborted)return;let{once:o,...a}=i,c=s instanceof Document?s.documentElement:s,l=Boolean(typeof i=="object"?i.capture:i),u=y=>{let w=Mo(y,String(e));if(w){let b=Object.assign(y,{delegateTarget:w});n.call(c,b),o&&(c.removeEventListener(t,u,a),_t(!1,c,n,h))}},h=JSON.stringify({selector:e,type:t,capture:l});_t(!0,c,n,h)||c.addEventListener(t,u,a),r?.addEventListener("abort",()=>{_t(!1,c,n,h)})}var Ue=Fo;function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;tString(e).toLowerCase().replace(/[\s/_.]+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+|-+$/g,"")||t||"",ge=({hash:e}={})=>window.location.pathname+window.location.search+(e?window.location.hash:""),Bo=(e,t={})=>{let n=k({url:e=e||ge({hash:!0}),random:Math.random(),source:"swup"},t);window.history.pushState(n,"",e)},me=(e=null,t={})=>{e=e||ge({hash:!0});let n=k({},window.history.state||{},{url:e,random:Math.random(),source:"swup"},t);window.history.replaceState(n,"",e)},$o=(e,t,n,i)=>{let r=new AbortController;return i=k({},i,{signal:r.signal}),Ue(e,t,n,i),{destroy:()=>r.abort()}},O=class extends URL{constructor(t,n=document.baseURI){super(t.toString(),n),Object.setPrototypeOf(this,O.prototype)}get url(){return this.pathname+this.search}static fromElement(t){let n=t.getAttribute("href")||t.getAttribute("xlink:href")||"";return new O(n)}static fromUrl(t){return new O(t)}};var le=class extends Error{constructor(t,n){super(t),this.url=void 0,this.status=void 0,this.aborted=void 0,this.timedOut=void 0,this.name="FetchError",this.url=n.url,this.status=n.status,this.aborted=n.aborted||!1,this.timedOut=n.timedOut||!1}};async function Uo(e,t={}){var n;e=O.fromUrl(e).url;let{visit:i=this.visit}=t,r=k({},this.options.requestHeaders,t.headers),s=(n=t.timeout)!=null?n:this.options.timeout,o=new AbortController,{signal:a}=o;t=k({},t,{headers:r,signal:a});let c,l=!1,u=null;s&&s>0&&(u=setTimeout(()=>{l=!0,o.abort("timeout")},s));try{c=await this.hooks.call("fetch:request",i,{url:e,options:t},(g,{url:m,options:x})=>fetch(m,x)),u&&clearTimeout(u)}catch(g){throw l?(this.hooks.call("fetch:timeout",i,{url:e}),new le(`Request timed out: ${e}`,{url:e,timedOut:l})):g?.name==="AbortError"||a.aborted?new le(`Request aborted: ${e}`,{url:e,aborted:!0}):g}let{status:h,url:f}=c,y=await c.text();if(h===500)throw this.hooks.call("fetch:error",i,{status:h,response:c,url:f}),new le(`Server error: ${f}`,{status:h,url:f});if(!y)throw new le(`Empty response: ${f}`,{status:h,url:f});let{url:w}=O.fromUrl(f),b={url:w,html:y};return!i.cache.write||t.method&&t.method!=="GET"||e!==w||this.cache.set(b.url,b),b}var Rt=class{constructor(t){this.swup=void 0,this.pages=new Map,this.swup=t}get size(){return this.pages.size}get all(){let t=new Map;return this.pages.forEach((n,i)=>{t.set(i,k({},n))}),t}has(t){return this.pages.has(this.resolve(t))}get(t){let n=this.pages.get(this.resolve(t));return n&&k({},n)}set(t,n){n=k({},n,{url:t=this.resolve(t)}),this.pages.set(t,n),this.swup.hooks.callSync("cache:set",void 0,{page:n})}update(t,n){t=this.resolve(t);let i=k({},this.get(t),n,{url:t});this.pages.set(t,i)}delete(t){this.pages.delete(this.resolve(t))}clear(){this.pages.clear(),this.swup.hooks.callSync("cache:clear",void 0,void 0)}prune(t){this.pages.forEach((n,i)=>{t(i,n)&&this.delete(i)})}resolve(t){let{url:n}=O.fromUrl(t);return this.swup.resolveUrl(n)}},Nt=(e,t=document)=>t.querySelector(e),Dt=(e,t=document)=>Array.from(t.querySelectorAll(e)),Ai=()=>new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{e()})})});function Ii(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function qo(e,t=[]){return new Promise((n,i)=>{let r=e(...t);Ii(r)?r.then(n,i):n(r)})}function Ti(e,t){let n=e?.closest(`[${t}]`);return n!=null&&n.hasAttribute(t)?n?.getAttribute(t)||!0:void 0}var Ht=class{constructor(t){this.swup=void 0,this.swupClasses=["to-","is-changing","is-rendering","is-popstate","is-animating","is-leaving"],this.swup=t}get selectors(){let{scope:t}=this.swup.visit.animation;return t==="containers"?this.swup.visit.containers:t==="html"?["html"]:Array.isArray(t)?t:[]}get selector(){return this.selectors.join(",")}get targets(){return this.selector.trim()?Dt(this.selector):[]}add(...t){this.targets.forEach(n=>n.classList.add(...t))}remove(...t){this.targets.forEach(n=>n.classList.remove(...t))}clear(){this.targets.forEach(t=>{let n=t.className.split(" ").filter(i=>this.isSwupClass(i));t.classList.remove(...n)})}isSwupClass(t){return this.swupClasses.some(n=>t.startsWith(n))}},je=class{constructor(t,n){this.id=void 0,this.state=void 0,this.from=void 0,this.to=void 0,this.containers=void 0,this.animation=void 0,this.trigger=void 0,this.cache=void 0,this.history=void 0,this.scroll=void 0,this.meta=void 0;let{to:i,from:r,hash:s,el:o,event:a}=n;this.id=Math.random(),this.state=1,this.from={url:r??t.location.url,hash:t.location.hash},this.to={url:i,hash:s},this.containers=t.options.containers,this.animation={animate:!0,wait:!1,name:void 0,native:t.options.native,scope:t.options.animationScope,selector:t.options.animationSelector},this.trigger={el:o,event:a},this.cache={read:t.options.cache,write:t.options.cache},this.history={action:"push",popstate:!1,direction:void 0},this.scroll={reset:!0,target:void 0},this.meta={}}advance(t){this.state=7}};function Vo(e){return new je(this,e)}var Qt=class{constructor(t){this.swup=void 0,this.registry=new Map,this.hooks=["animation:out:start","animation:out:await","animation:out:end","animation:in:start","animation:in:await","animation:in:end","animation:skip","cache:clear","cache:set","content:replace","content:scroll","enable","disable","fetch:request","fetch:error","fetch:timeout","history:popstate","link:click","link:self","link:anchor","link:newtab","page:load","page:view","scroll:top","scroll:anchor","visit:start","visit:transition","visit:abort","visit:end"],this.swup=t,this.init()}init(){this.hooks.forEach(t=>this.create(t))}create(t){this.registry.has(t)||this.registry.set(t,new Map)}exists(t){return this.registry.has(t)}get(t){let n=this.registry.get(t);if(n)return n;console.error(`Unknown hook '${t}'`)}clear(){this.registry.forEach(t=>t.clear())}on(t,n,i={}){let r=this.get(t);if(!r)return console.warn(`Hook '${t}' not found.`),()=>{};let s=k({},i,{id:r.size+1,hook:t,handler:n});return r.set(n,s),()=>this.off(t,n)}before(t,n,i={}){return this.on(t,n,k({},i,{before:!0}))}replace(t,n,i={}){return this.on(t,n,k({},i,{replace:!0}))}once(t,n,i={}){return this.on(t,n,k({},i,{once:!0}))}off(t,n){let i=this.get(t);i&&n?i.delete(n)||console.warn(`Handler for hook '${t}' not found.`):i&&i.clear()}async call(t,n,i,r){let[s,o,a]=this.parseCallArgs(t,n,i,r),{before:c,handler:l,after:u}=this.getHandlers(t,a);await this.run(c,s,o);let[h]=await this.run(l,s,o,!0);return await this.run(u,s,o),this.dispatchDomEvent(t,s,o),h}callSync(t,n,i,r){let[s,o,a]=this.parseCallArgs(t,n,i,r),{before:c,handler:l,after:u}=this.getHandlers(t,a);this.runSync(c,s,o);let[h]=this.runSync(l,s,o,!0);return this.runSync(u,s,o),this.dispatchDomEvent(t,s,o),h}parseCallArgs(t,n,i,r){return n instanceof je||typeof n!="object"&&typeof i!="function"?[n,i,r]:[void 0,n,i]}async run(t,n=this.swup.visit,i,r=!1){let s=[];for(let{hook:o,handler:a,defaultHandler:c,once:l}of t)if(n==null||!n.done){l&&this.off(o,a);try{let u=await qo(a,[n,i,c]);s.push(u)}catch(u){if(r)throw u;console.error(`Error in hook '${o}':`,u)}}return s}runSync(t,n=this.swup.visit,i,r=!1){let s=[];for(let{hook:o,handler:a,defaultHandler:c,once:l}of t)if(n==null||!n.done){l&&this.off(o,a);try{let u=a(n,i,c);s.push(u),Ii(u)&&console.warn(`Swup will not await Promises in handler for synchronous hook '${o}'.`)}catch(u){if(r)throw u;console.error(`Error in hook '${o}':`,u)}}return s}getHandlers(t,n){let i=this.get(t);if(!i)return{found:!1,before:[],handler:[],after:[],replaced:!1};let r=Array.from(i.values()),s=this.sortRegistrations,o=r.filter(({before:h,replace:f})=>h&&!f).sort(s),a=r.filter(({replace:h})=>h).filter(h=>!0).sort(s),c=r.filter(({before:h,replace:f})=>!h&&!f).sort(s),l=a.length>0,u=[];if(n&&(u=[{id:0,hook:t,handler:n}],l)){let h=a.length-1,{handler:f,once:y}=a[h],w=b=>{let g=a[b-1];return g?(m,x)=>g.handler(m,x,w(b-1)):n};u=[{id:0,hook:t,once:y,handler:f,defaultHandler:w(h)}]}return{found:!0,before:o,handler:u,after:c,replaced:l}}sortRegistrations(t,n){var i,r;return((i=t.priority)!=null?i:0)-((r=n.priority)!=null?r:0)||t.id-n.id||0}dispatchDomEvent(t,n,i){if(n!=null&&n.done)return;let r={hook:t,args:i,visit:n||this.swup.visit};document.dispatchEvent(new CustomEvent("swup:any",{detail:r,bubbles:!0})),document.dispatchEvent(new CustomEvent(`swup:${t}`,{detail:r,bubbles:!0}))}parseName(t){let[n,...i]=t.split(".");return[n,i.reduce((r,s)=>k({},r,{[s]:!0}),{})]}},jo=e=>{if(e&&e.charAt(0)==="#"&&(e=e.substring(1)),!e)return null;let t=decodeURIComponent(e),n=document.getElementById(e)||document.getElementById(t)||Nt(`a[name='${CSS.escape(e)}']`)||Nt(`a[name='${CSS.escape(t)}']`);return n||e!=="top"||(n=document.body),n},qe="transition",Pt="animation";async function zo({selector:e,elements:t}){if(e===!1&&!t)return;let n=[];if(t)n=Array.from(t);else if(e&&(n=Dt(e,document.body),!n.length))return void console.warn(`[swup] No elements found matching animationSelector \`${e}\``);let i=n.map(r=>function(s){let{type:o,timeout:a,propCount:c}=function(l){let u=window.getComputedStyle(l),h=Ve(u,`${qe}Delay`),f=Ve(u,`${qe}Duration`),y=ki(h,f),w=Ve(u,`${Pt}Delay`),b=Ve(u,`${Pt}Duration`),g=ki(w,b),m=Math.max(y,g),x=m>0?y>g?qe:Pt:null;return{type:x,timeout:m,propCount:x?x===qe?f.length:b.length:0}}(s);return!(!o||!a)&&new Promise(l=>{let u=`${o}end`,h=performance.now(),f=0,y=()=>{s.removeEventListener(u,w),l()},w=b=>{b.target===s&&((performance.now()-h)/1e3=c&&y())};setTimeout(()=>{f0?await Promise.all(i):e&&console.warn(`[swup] No CSS animation duration defined on elements matching \`${e}\``)}function Ve(e,t){return(e[t]||"").split(", ")}function ki(e,t){for(;e.lengthOi(n)+Oi(e[i])))}function Oi(e){return 1e3*parseFloat(e)}function Wo(e,t={},n={}){if(typeof e!="string")throw new Error("swup.navigate() requires a URL parameter");if(this.shouldIgnoreVisit(e,{el:n.el,event:n.event}))return void window.location.assign(e);let{url:i,hash:r}=O.fromUrl(e),s=this.createVisit(k({},n,{to:i,hash:r}));this.performNavigation(s,t)}async function Go(e,t={}){if(this.navigating){if(this.visit.state>=6)return e.state=2,void(this.onVisitEnd=()=>this.performNavigation(e,t));await this.hooks.call("visit:abort",this.visit,void 0),delete this.visit.to.document,this.visit.state=8}this.navigating=!0,this.visit=e;let{el:n}=e.trigger;t.referrer=t.referrer||this.location.url,t.animate===!1&&(e.animation.animate=!1),e.animation.animate||this.classes.clear();let i=t.history||Ti(n,"data-swup-history");typeof i=="string"&&["push","replace"].includes(i)&&(e.history.action=i);let r=t.animation||Ti(n,"data-swup-animation");var s,o;typeof r=="string"&&(e.animation.name=r),e.meta=t.meta||{},typeof t.cache=="object"?(e.cache.read=(s=t.cache.read)!=null?s:e.cache.read,e.cache.write=(o=t.cache.write)!=null?o:e.cache.write):t.cache!==void 0&&(e.cache={read:!!t.cache,write:!!t.cache}),delete t.cache;try{await this.hooks.call("visit:start",e,void 0),e.state=3;let a=this.hooks.call("page:load",e,{options:t},async(l,u)=>{let h;return l.cache.read&&(h=this.cache.get(l.to.url)),u.page=h||await this.fetchPage(l.to.url,u.options),u.cache=!!h,u.page});a.then(({html:l})=>{e.advance(5),e.to.html=l,e.to.document=new DOMParser().parseFromString(l,"text/html")});let c=e.to.url+e.to.hash;if(e.history.popstate||(e.history.action==="replace"||e.to.url===this.location.url?me(c):(this.currentHistoryIndex++,Bo(c,{index:this.currentHistoryIndex}))),this.location=O.fromUrl(c),e.history.popstate&&this.classes.add("is-popstate"),e.animation.name&&this.classes.add(`to-${Ci(e.animation.name)}`),e.animation.wait&&await a,e.done||(await this.hooks.call("visit:transition",e,void 0,async()=>{if(!e.animation.animate)return await this.hooks.call("animation:skip",void 0),void await this.renderPage(e,await a);e.advance(4),await this.animatePageOut(e),e.animation.native&&document.startViewTransition?await document.startViewTransition(async()=>await this.renderPage(e,await a)).finished:await this.renderPage(e,await a),await this.animatePageIn(e)}),e.done))return;await this.hooks.call("visit:end",e,void 0,()=>this.classes.clear()),e.state=7,this.navigating=!1,this.onVisitEnd&&(this.onVisitEnd(),this.onVisitEnd=void 0)}catch(a){if(!a||a!=null&&a.aborted)return void(e.state=8);e.state=9,console.error(a),this.options.skipPopStateHandling=()=>(window.location.assign(e.to.url+e.to.hash),!0),window.history.back()}finally{delete e.to.document}}var Ko=async function(e){await this.hooks.call("animation:out:start",e,void 0,()=>{this.classes.add("is-changing","is-animating","is-leaving")}),await this.hooks.call("animation:out:await",e,{skip:!1},(t,{skip:n})=>{if(!n)return this.awaitAnimations({selector:t.animation.selector})}),await this.hooks.call("animation:out:end",e,void 0)},Yo=function(e){var t;let n=e.to.document;if(!n)return!1;let i=((t=n.querySelector("title"))==null?void 0:t.innerText)||"";document.title=i;let r=Dt('[data-swup-persist]:not([data-swup-persist=""])'),s=e.containers.map(o=>{let a=document.querySelector(o),c=n.querySelector(o);return a&&c?(a.replaceWith(c.cloneNode(!0)),!0):(a||console.warn(`[swup] Container missing in current document: ${o}`),c||console.warn(`[swup] Container missing in incoming document: ${o}`),!1)}).filter(Boolean);return r.forEach(o=>{let a=o.getAttribute("data-swup-persist"),c=Nt(`[data-swup-persist="${a}"]`);c&&c!==o&&c.replaceWith(o)}),s.length===e.containers.length},Jo=function(e){let t={behavior:"auto"},{target:n,reset:i}=e.scroll,r=n??e.to.hash,s=!1;return r&&(s=this.hooks.callSync("scroll:anchor",e,{hash:r,options:t},(o,{hash:a,options:c})=>{let l=this.getAnchorElement(a);return l&&l.scrollIntoView(c),!!l})),i&&!s&&(s=this.hooks.callSync("scroll:top",e,{options:t},(o,{options:a})=>(window.scrollTo(k({top:0,left:0},a)),!0))),s},Xo=async function(e){if(e.done)return;let t=this.hooks.call("animation:in:await",e,{skip:!1},(n,{skip:i})=>{if(!i)return this.awaitAnimations({selector:n.animation.selector})});await Ai(),await this.hooks.call("animation:in:start",e,void 0,()=>{this.classes.remove("is-animating")}),await t,await this.hooks.call("animation:in:end",e,void 0)},Zo=async function(e,t){if(e.done)return;e.advance(6);let{url:n}=t;this.isSameResolvedUrl(ge(),n)||(me(n),this.location=O.fromUrl(n),e.to.url=this.location.url,e.to.hash=this.location.hash),await this.hooks.call("content:replace",e,{page:t},(i,{})=>{if(this.classes.remove("is-leaving"),i.animation.animate&&this.classes.add("is-rendering"),!this.replaceContent(i))throw new Error("[swup] Container mismatch, aborting");i.animation.animate&&(this.classes.add("is-changing","is-animating","is-rendering"),i.animation.name&&this.classes.add(`to-${Ci(i.animation.name)}`))}),await this.hooks.call("content:scroll",e,void 0,()=>this.scrollToContent(e)),await this.hooks.call("page:view",e,{url:this.location.url,title:document.title})},ea=function(e){var t;if(t=e,Boolean(t?.isSwupPlugin)){if(e.swup=this,!e._checkRequirements||e._checkRequirements())return e._beforeMount&&e._beforeMount(),e.mount(),this.plugins.push(e),this.plugins}else console.error("Not a swup plugin instance",e)};function ta(e){let t=this.findPlugin(e);if(t)return t.unmount(),t._afterUnmount&&t._afterUnmount(),this.plugins=this.plugins.filter(n=>n!==t),this.plugins;console.error("No such plugin",t)}function na(e){return this.plugins.find(t=>t===e||t.name===e||t.name===`Swup${String(e)}`)}function ia(e){if(typeof this.options.resolveUrl!="function")return console.warn("[swup] options.resolveUrl expects a callback function."),e;let t=this.options.resolveUrl(e);return t&&typeof t=="string"?t.startsWith("//")||t.startsWith("http")?(console.warn("[swup] options.resolveUrl needs to return a relative url"),e):t:(console.warn("[swup] options.resolveUrl needs to return a url"),e)}function ra(e,t){return this.resolveUrl(e)===this.resolveUrl(t)}var sa={animateHistoryBrowsing:!1,animationSelector:'[class*="transition-"]',animationScope:"html",cache:!0,containers:["#swup"],hooks:{},ignoreVisit:(e,{el:t}={})=>!(t==null||!t.closest("[data-no-swup]")),linkSelector:"a[href]",linkToSelf:"scroll",native:!1,plugins:[],resolveUrl:e=>e,requestHeaders:{"X-Requested-With":"swup",Accept:"text/html, application/xhtml+xml"},skipPopStateHandling:e=>{var t;return((t=e.state)==null?void 0:t.source)!=="swup"},timeout:0},ze=class{get currentPageUrl(){return this.location.url}constructor(t={}){var n,i;this.version="4.8.1",this.options=void 0,this.defaults=sa,this.plugins=[],this.visit=void 0,this.cache=void 0,this.hooks=void 0,this.classes=void 0,this.location=O.fromUrl(window.location.href),this.currentHistoryIndex=void 0,this.clickDelegate=void 0,this.navigating=!1,this.onVisitEnd=void 0,this.use=ea,this.unuse=ta,this.findPlugin=na,this.log=()=>{},this.navigate=Wo,this.performNavigation=Go,this.createVisit=Vo,this.delegateEvent=$o,this.fetchPage=Uo,this.awaitAnimations=zo,this.renderPage=Zo,this.replaceContent=Yo,this.animatePageIn=Xo,this.animatePageOut=Ko,this.scrollToContent=Jo,this.getAnchorElement=jo,this.getCurrentUrl=ge,this.resolveUrl=ia,this.isSameResolvedUrl=ra,this.options=k({},this.defaults,t),this.handleLinkClick=this.handleLinkClick.bind(this),this.handlePopState=this.handlePopState.bind(this),this.cache=new Rt(this),this.classes=new Ht(this),this.hooks=new Qt(this),this.visit=this.createVisit({to:""}),this.currentHistoryIndex=(n=(i=window.history.state)==null?void 0:i.index)!=null?n:1,this.enable()}async enable(){var t;let{linkSelector:n}=this.options;this.clickDelegate=this.delegateEvent(n,"click",this.handleLinkClick),window.addEventListener("popstate",this.handlePopState),this.options.animateHistoryBrowsing&&(window.history.scrollRestoration="manual"),this.options.native=this.options.native&&!!document.startViewTransition,this.options.plugins.forEach(i=>this.use(i));for(let[i,r]of Object.entries(this.options.hooks)){let[s,o]=this.hooks.parseName(i);this.hooks.on(s,r,o)}((t=window.history.state)==null?void 0:t.source)!=="swup"&&me(null,{index:this.currentHistoryIndex}),await Ai(),await this.hooks.call("enable",void 0,void 0,()=>{let i=document.documentElement;i.classList.add("swup-enabled"),i.classList.toggle("swup-native",this.options.native)})}async destroy(){this.clickDelegate.destroy(),window.removeEventListener("popstate",this.handlePopState),this.cache.clear(),this.options.plugins.forEach(t=>this.unuse(t)),await this.hooks.call("disable",void 0,void 0,()=>{let t=document.documentElement;t.classList.remove("swup-enabled"),t.classList.remove("swup-native")}),this.hooks.clear()}shouldIgnoreVisit(t,{el:n,event:i}={}){let{origin:r,url:s,hash:o}=O.fromUrl(t);return r!==window.location.origin||!(!n||!this.triggerWillOpenNewWindow(n))||!!this.options.ignoreVisit(s+o,{el:n,event:i})}handleLinkClick(t){let n=t.delegateTarget,{href:i,url:r,hash:s}=O.fromElement(n);if(this.shouldIgnoreVisit(i,{el:n,event:t}))return;if(this.navigating&&r===this.visit.to.url)return void t.preventDefault();let o=this.createVisit({to:r,hash:s,el:n,event:t});t.metaKey||t.ctrlKey||t.shiftKey||t.altKey?this.hooks.callSync("link:newtab",o,{href:i}):t.button===0&&this.hooks.callSync("link:click",o,{el:n,event:t},()=>{var a;let c=(a=o.from.url)!=null?a:"";t.preventDefault(),r&&r!==c?this.isSameResolvedUrl(r,c)||this.performNavigation(o):s?this.hooks.callSync("link:anchor",o,{hash:s},()=>{me(r+s),this.scrollToContent(o)}):this.hooks.callSync("link:self",o,void 0,()=>{this.options.linkToSelf==="navigate"?this.performNavigation(o):(me(r),this.scrollToContent(o))})})}handlePopState(t){var n,i,r,s;let o=(n=(i=t.state)==null?void 0:i.url)!=null?n:window.location.href;if(this.options.skipPopStateHandling(t)||this.isSameResolvedUrl(ge(),this.location.url))return;let{url:a,hash:c}=O.fromUrl(o),l=this.createVisit({to:a,hash:c,event:t});l.history.popstate=!0;let u=(r=(s=t.state)==null?void 0:s.index)!=null?r:0;u&&u!==this.currentHistoryIndex&&(l.history.direction=u-this.currentHistoryIndex>0?"forwards":"backwards",this.currentHistoryIndex=u),l.animation.animate=!1,l.scroll.reset=!1,l.scroll.target=!1,this.options.animateHistoryBrowsing&&(l.animation.animate=!0,l.scroll.reset=!0),this.hooks.callSync("history:popstate",l,{event:t},()=>{this.performNavigation(l)})}triggerWillOpenNewWindow(t){return!!t.matches('[download], [target="_blank"]')}};function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;tString(e).split(".").map(t=>String(parseInt(t||"0",10))).concat(["0","0"]).slice(0,3).join("."),We=class{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t=>t()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return typeof this.requires!="object"||Object.entries(this.requires).forEach(([t,n])=>{if(!function(i,r,s){let o=function(a,c){var l;if(a==="swup")return(l=c.version)!=null?l:"";{var u;let h=c.findPlugin(a);return(u=h?.version)!=null?u:""}}(i,s);return!!o&&((a,c)=>c.every(l=>{let[,u,h]=l.match(/^([\D]+)?(.*)$/)||[];var f,y;return((w,b)=>{let g={"":m=>m===0,">":m=>m>0,">=":m=>m>=0,"<":m=>m<0,"<=":m=>m<=0};return(g[b]||g[""])(w)})((y=h,f=_i(f=a),y=_i(y),f.localeCompare(y,void 0,{numeric:!0})),u||">=")}))(o,r)}(t,n=Array.isArray(n)?n:[n],this.swup)){let i=`${t} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${i}`)}}),!0}on(t,n,i={}){var r;n=!(r=n).name.startsWith("bound ")||r.hasOwnProperty("prototype")?n.bind(this):n;let s=this.swup.hooks.on(t,n,i);return this.handlersToUnregister.push(s),s}once(t,n,i={}){return this.on(t,n,ve({},i,{once:!0}))}before(t,n,i={}){return this.on(t,n,ve({},i,{before:!0}))}replace(t,n,i={}){return this.on(t,n,ve({},i,{replace:!0}))}off(t,n){return this.swup.hooks.off(t,n)}};(function(){if(!(typeof window>"u"||typeof document>"u"||typeof HTMLElement>"u")){var e=!1;try{var t=document.createElement("div");t.addEventListener("focus",function(s){s.preventDefault(),s.stopPropagation()},!0),t.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&typeof navigator.userAgent<"u"&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return e=!1;e=!0}}))}catch{}if(HTMLElement.prototype.nativeFocus===void 0&&!e){HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus;var n=function(s){for(var o=s.parentNode,a=[],c=document.scrollingElement||document.documentElement;o&&o!==c;)(o.offsetHeightn.replace(`{${i}}`,t[i]||""),e||"")}var Ft=class{constructor(){var t;this.id="swup-announcer",this.style="position:absolute;top:0;left:0;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;white-space:nowrap;word-wrap:normal;width:1px;height:1px;",this.region=void 0,this.region=(t=this.getRegion())!=null?t:this.createRegion()}getRegion(){return document.getElementById(this.id)}createRegion(){let t=function(n){let i=document.createElement("template");return i.innerHTML=n,i.content.children[0]}(`

`);return document.body.appendChild(t),t}announce(t,n=0){return new Promise(i=>{setTimeout(()=>{this.region.textContent===t&&(t=`${t}.`),this.region.textContent="",this.region.textContent=t,i()},n)})}};function Ri(e){let t;if(t=typeof e=="string"?document.querySelector(e):e,!(t instanceof HTMLElement))return;let n=t.getAttribute("tabindex");t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0}),n!==null&&t.setAttribute("tabindex",n)}var Ge=class extends We{constructor(t={}){super(),this.name="SwupA11yPlugin",this.requires={swup:">=4"},this.defaults={headingSelector:"h1",respectReducedMotion:!0,autofocus:!1,announcements:{visit:"Navigated to: {title}",url:"New page at {url}"}},this.options=void 0,this.announcer=void 0,this.announcementDelay=100,this.rootSelector="body",this.handleAnchorScroll=(n,{hash:i})=>{let r=this.swup.getAnchorElement(i);r instanceof HTMLElement&&Ri(r)},this.options=Mt({},this.defaults,t),this.announcer=new Ft}mount(){this.swup.hooks.create("content:announce"),this.swup.hooks.create("content:focus"),this.before("visit:start",this.prepareVisit),this.on("visit:start",this.markAsBusy),this.on("visit:end",this.unmarkAsBusy),this.on("visit:end",this.focusContent),this.on("visit:end",this.announceContent),this.on("scroll:anchor",this.handleAnchorScroll),this.before("visit:start",this.disableAnimations),this.before("link:self",this.disableAnimations),this.before("link:anchor",this.disableAnimations),this.swup.announce=this.announce.bind(this)}unmount(){this.swup.announce=void 0}async announce(t){await this.announcer.announce(t)}markAsBusy(){document.documentElement.setAttribute("aria-busy","true")}unmarkAsBusy(){document.documentElement.removeAttribute("aria-busy")}prepareVisit(t){t.a11y={announce:void 0,focus:this.rootSelector}}announceContent(t){this.swup.hooks.callSync("content:announce",t,void 0,n=>{n.a11y.announce===void 0&&(n.a11y.announce=this.getPageAnnouncement()),n.a11y.announce&&this.announcer.announce(n.a11y.announce,this.announcementDelay)})}focusContent(t){this.swup.hooks.callSync("content:focus",t,void 0,n=>{n.a11y.focus&&(this.options.autofocus&&function(){let i=function(){let r=document.querySelector("body [autofocus]");if(r&&!r.closest('[inert], [aria-disabled], [aria-hidden="true"]'))return r}();return!!i&&(i!==document.activeElement&&i.focus(),!0)}()===!0||Ri(n.a11y.focus))})}getPageAnnouncement(){let{headingSelector:t,announcements:n}=this.options;return function({headingSelector:i="h1",announcements:r={}}){var s,o;let a=document.documentElement.lang||"*",{href:c,url:l,pathname:u}=O.fromUrl(window.location.href),h=(s=(o=r[a])!=null?o:r["*"])!=null?s:r;if(typeof h!="object")return;let f=document.querySelector(i);f||console.warn(`SwupA11yPlugin: No main heading (${i}) found on new page`);let y=f?.getAttribute("aria-label")||f?.textContent||document.title||Pi(h.url,{href:c,url:l,path:u});return Pi(h.visit,{title:y,href:c,url:l,path:u})}({headingSelector:t,announcements:n})}disableAnimations(t){this.options.respectReducedMotion&&window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(t.animation.animate=!1,t.scroll.animate=!1)}};Wt(()=>{let e=new URLSearchParams(window.location.search),t=e.has("preview");Yt(),Ln(e.get("theme")),Zt(t),Wn(),vi(),bi(),Si(),Ei(),t?Li():(window.location.protocol!=="file:"&&new ze({animationSelector:!1,containers:["#main"],ignoreVisit:n=>{let i=n.split("#")[0];return i===window.location.pathname||i===window.location.pathname+".html"},hooks:{"page:view":()=>{ln(),rt(),wt()}},linkSelector:'a[href]:not([href^="/"]):not([href^="http"])',plugins:[new Ge]}),Mn(),cn(),mn(),Nn(),Kn(),ai(),ni(),En(),wt(),oi())});})(); +/*! Bundled license information: + +lunr/lunr.js: + (** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + *) + (*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + *) + (*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + *) +*/ diff --git a/formatters/html/dist/html-XFWJYN4N.js b/formatters/html/dist/html-XFWJYN4N.js deleted file mode 100644 index 778695f6c..000000000 --- a/formatters/html/dist/html-XFWJYN4N.js +++ /dev/null @@ -1,56 +0,0 @@ -(()=>{var Mi=Object.create;var Ft=Object.defineProperty;var Di=Object.getOwnPropertyDescriptor;var Fi=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,$i=Object.prototype.hasOwnProperty;var Bt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ui=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Fi(t))!$i.call(e,r)&&r!==n&&Ft(e,r,{get:()=>t[r],enumerable:!(i=Di(t,r))||i.enumerable});return e};var $t=(e,t,n)=>(n=e!=null?Mi(Bi(e)):{},Ui(t||!e||!e.__esModule?Ft(n,"default",{value:e,enumerable:!0}):n,e));var rn=Bt((ha,nn)=>{var tn="Expected a function",Zt=NaN,cr="[object Symbol]",lr=/^\s+|\s+$/g,ur=/^[-+]0x[0-9a-f]+$/i,dr=/^0b[01]+$/i,hr=/^0o[0-7]+$/i,fr=parseInt,pr=typeof global=="object"&&global&&global.Object===Object&&global,mr=typeof self=="object"&&self&&self.Object===Object&&self,gr=pr||mr||Function("return this")(),vr=Object.prototype,yr=vr.toString,wr=Math.max,br=Math.min,Ye=function(){return gr.Date.now()};function Sr(e,t,n){var i,r,s,o,a,c,l=0,u=!1,h=!1,f=!0;if(typeof e!="function")throw new TypeError(tn);t=en(t)||0,Le(n)&&(u=!!n.leading,h="maxWait"in n,s=h?wr(en(n.maxWait)||0,t):s,f="trailing"in n?!!n.trailing:f);function y(E){var P=i,B=r;return i=r=void 0,l=E,o=e.apply(B,P),o}function w(E){return l=E,a=setTimeout(m,t),u?y(E):o}function b(E){var P=E-c,B=E-l,z=t-P;return h?br(z,s-B):z}function g(E){var P=E-c,B=E-l;return c===void 0||P>=t||P<0||h&&B>=s}function m(){var E=Ye();if(g(E))return x(E);a=setTimeout(m,b(E))}function x(E){return a=void 0,f&&i?y(E):(i=r=void 0,o)}function C(){a!==void 0&&clearTimeout(a),l=0,i=c=r=a=void 0}function M(){return a===void 0?o:x(Ye())}function F(){var E=Ye(),P=g(E);if(i=arguments,r=this,c=E,P){if(a===void 0)return w(c);if(h)return a=setTimeout(m,t),y(c)}return a===void 0&&(a=setTimeout(m,t)),o}return F.cancel=C,F.flush=M,F}function Er(e,t,n){var i=!0,r=!0;if(typeof e!="function")throw new TypeError(tn);return Le(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Sr(e,t,{leading:i,maxWait:t,trailing:r})}function Le(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function xr(e){return!!e&&typeof e=="object"}function Lr(e){return typeof e=="symbol"||xr(e)&&yr.call(e)==cr}function en(e){if(typeof e=="number")return e;if(Lr(e))return Zt;if(Le(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Le(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(lr,"");var n=dr.test(e);return n||hr.test(e)?fr(e.slice(2),n?2:8):ur.test(e)?Zt:+e}nn.exports=Er});var Bn=Bt((Dn,Fn)=>{(function(){var e=function(t){var n=new e.Builder;return n.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),n.searchPipeline.add(e.stemmer),t.call(n,n),n.build()};e.version="2.3.9";e.utils={},e.utils.warn=function(t){return function(n){t.console&&console.warn&&console.warn(n)}}(this),e.utils.asString=function(t){return t==null?"":t.toString()},e.utils.clone=function(t){if(t==null)return t;for(var n=Object.create(null),i=Object.keys(t),r=0;r0){var u=e.utils.clone(n)||{};u.position=[a,l],u.index=s.length,s.push(new e.Token(i.slice(a,o),u))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/;e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,n){n in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+n),t.label=n,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var n=t.label&&t.label in this.registeredFunctions;n||e.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,t)},e.Pipeline.load=function(t){var n=new e.Pipeline;return t.forEach(function(i){var r=e.Pipeline.registeredFunctions[i];if(r)n.add(r);else throw new Error("Cannot load unregistered function: "+i)}),n},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(n){e.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},e.Pipeline.prototype.after=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i=i+1,this._stack.splice(i,0,n)},e.Pipeline.prototype.before=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,n)},e.Pipeline.prototype.remove=function(t){var n=this._stack.indexOf(t);n!=-1&&this._stack.splice(n,1)},e.Pipeline.prototype.run=function(t){for(var n=this._stack.length,i=0;i1&&(ot&&(i=s),o!=t);)r=i-n,s=n+Math.floor(r/2),o=this.elements[s*2];if(o==t||o>t)return s*2;if(oc?u+=2:a==c&&(n+=i[l+1]*r[u+1],l+=2,u+=2);return n},e.Vector.prototype.similarity=function(t){return this.dot(t)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var t=new Array(this.elements.length/2),n=1,i=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new e.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),r.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var c=s.node.edges["*"];else{var c=new e.TokenSet;s.node.edges["*"]=c}if(s.str.length==0&&(c.final=!0),r.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&r.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}s.str.length==1&&(l.final=!0),r.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var u=s.str.charAt(0),h=s.str.charAt(1),f;h in s.node.edges?f=s.node.edges[h]:(f=new e.TokenSet,s.node.edges[h]=f),s.str.length==1&&(f.final=!0),r.push({node:f,editsRemaining:s.editsRemaining-1,str:u+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var n=new e.TokenSet,i=n,r=0,s=t.length;r=t;n--){var i=this.uncheckedNodes[n],r=i.child.toString();r in this.minimizedNodes?i.parent.edges[i.char]=this.minimizedNodes[r]:(i.child._str=r,this.minimizedNodes[r]=i.child),this.uncheckedNodes.pop()}};e.Index=function(t){this.invertedIndex=t.invertedIndex,this.fieldVectors=t.fieldVectors,this.tokenSet=t.tokenSet,this.fields=t.fields,this.pipeline=t.pipeline},e.Index.prototype.search=function(t){return this.query(function(n){var i=new e.QueryParser(t,n);i.parse()})},e.Index.prototype.query=function(t){for(var n=new e.Query(this.fields),i=Object.create(null),r=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),c=0;c1?this._b=1:this._b=t},e.Builder.prototype.k1=function(t){this._k1=t},e.Builder.prototype.add=function(t,n){var i=t[this._ref],r=Object.keys(this._fields);this._documents[i]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,n;do t=this.next(),n=t.charCodeAt(0);while(n>47&&n<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var n=t.next();if(n==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){t.escapeCharacter();continue}if(n==":")return e.QueryLexer.lexField;if(n=="~")return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if(n=="^")return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if(n=="+"&&t.width()===1||n=="-"&&t.width()===1)return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(n.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}},e.QueryParser=function(t,n){this.lexer=new e.QueryLexer(t),this.query=n,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var t=this.peekLexeme();return this.lexemeIdx+=1,t},e.QueryParser.prototype.nextClause=function(){var t=this.currentClause;this.query.clause(t),this.currentClause={}},e.QueryParser.parseClause=function(t){var n=t.peekLexeme();if(n!=null)switch(n.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(i+=" with value '"+n.str+"'"),new e.QueryParseError(i,n.start,n.end)}},e.QueryParser.parsePresence=function(t){var n=t.consumeLexeme();if(n!=null){switch(n.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+n.str+"'";throw new e.QueryParseError(i,n.start,n.end)}var r=t.peekLexeme();if(r==null){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,n.start,n.end)}switch(r.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+r.type+"'";throw new e.QueryParseError(i,r.start,r.end)}}},e.QueryParser.parseField=function(t){var n=t.consumeLexeme();if(n!=null){if(t.query.allFields.indexOf(n.str)==-1){var i=t.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),r="unrecognised field '"+n.str+"', possible fields: "+i;throw new e.QueryParseError(r,n.start,n.end)}t.currentClause.fields=[n.str];var s=t.peekLexeme();if(s==null){var r="expecting term, found nothing";throw new e.QueryParseError(r,n.start,n.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var r="expecting term, found '"+s.type+"'";throw new e.QueryParseError(r,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var n=t.consumeLexeme();if(n!=null){t.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(i==null){t.nextClause();return}switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(r,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var n=t.consumeLexeme();if(n!=null){var i=parseInt(n.str,10);if(isNaN(i)){var r="edit distance must be numeric";throw new e.QueryParseError(r,n.start,n.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(s==null){t.nextClause();return}switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(r,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var n=t.consumeLexeme();if(n!=null){var i=parseInt(n.str,10);if(isNaN(i)){var r="boost must be numeric";throw new e.QueryParseError(r,n.start,n.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(s==null){t.nextClause();return}switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(r,s.start,s.end)}}},function(t,n){typeof define=="function"&&define.amd?define(n):typeof Dn=="object"?Fn.exports=n():t.lunr=n()}(this,function(){return e})})()});Handlebars.registerHelper("groupChanged",function(e,t,n){let i=t||"";if(e.group!==i)return delete e.nestedContext,e.group=i,n.fn(this)});Handlebars.registerHelper("nestingChanged",function(e,t,n){if(t.nested_context&&t.nested_context!==e.nestedContext){if(e.nestedContext=t.nested_context,e.lastModuleSeenInGroup!==t.nested_context)return n.fn(this)}else e.lastModuleSeenInGroup=t.title});Handlebars.registerHelper("showSections",function(e,t){if(e.sections.length>0)return t.fn(this)});Handlebars.registerHelper("showSummary",function(e,t){if(e.nodeGroups)return t.fn(this)});Handlebars.registerHelper("isArray",function(e,t){return Array.isArray(e)?t.fn(this):t.inverse(this)});Handlebars.registerHelper("isNonEmptyArray",function(e,t){return Array.isArray(e)&&e.length>0?t.fn(this):t.inverse(this)});Handlebars.registerHelper("isEmptyArray",function(e,t){return Array.isArray(e)&&e.length===0?t.fn(this):t.inverse(this)});Handlebars.registerHelper("isLocal",function(e,t){let n=window.location.pathname.split("/").pop();return n===e+".html"||n===e?t.fn(this):t.inverse(this)});var d=document.querySelector.bind(document),A=document.querySelectorAll.bind(document);function Ut(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Se(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function V(){return document.getElementById("main").dataset.type}function qt(e,t){if(e){for(let n of e){let i=n.nodeGroups&&n.nodeGroups.find(r=>r.nodes.some(s=>s.anchor===t));if(i)return i.key}return null}}function Ee(e,t=!1){if(!e)return t?document.getElementById("top-content"):null;let n=document.getElementById(e);return n?n.matches(".detail")?n:["h1","h2","h3","h4","h5","h6"].includes(n.tagName.toLowerCase())?qi(n):null:null}function qi(e){let t=[e],n=e.nextElementSibling,i=e.tagName.toLowerCase();for(;n;){let s=n.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6"].includes(s)&&s<=i?n=null:(t.push(n),n=n.nextElementSibling)}let r=document.createElement("div");return r.append(...t),r}function ie(){return window.location.hash.replace(/^#/,"")}function Vt(e){return new URLSearchParams(window.location.search).get(e)}function jt(e){return fetch(e).then(t=>t.ok).catch(()=>!1)}function zt(e){document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)}function re(e){return!e||e.trim()===""}function Wt(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{n=null,e(...r)},t)}}function xe(){return document.head.querySelector("meta[name=project][content]").content}function se(){return/(Macintosh|iPhone|iPad|iPod)/.test(window.navigator.userAgent)}var Vi="content",ji="tabs-open",zi="tabs-close",Wi="H3",Gi="tabset";function Kt(){Ki().map(Yi).forEach(n=>Zi(n))}function Ki(){let e=document.createNodeIterator(document.getElementById(Vi),NodeFilter.SHOW_COMMENT,{acceptNode(i){return i.nodeValue.trim()===ji?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),t=[],n;for(;n=e.nextNode();)t.push(n);return t}function Yi(e,t,n){let i=[],r=[],s={label:"",content:[]};for(;e=e.nextSibling;){if(Ji(e)){Gt(s,r,t);break}i.push(e),e.nodeName===Wi?(Gt(s,r,t),s.label=e.innerText,s.content=[]):s.content.push(e.outerHTML)}let o=document.createElement("div");return o.className=Gi,Xi(i,o),o.innerHTML=Handlebars.templates.tabset({tabs:r}),o}function Ji(e){return e.nodeName==="#comment"&&e.nodeValue.trim()===zi}function Gt(e,t,n){if(e.label===""&&!e.content.length)return!1;let i=e.label,r=e.content;t.push({label:i,content:r,setIndex:n})}function Xi(e,t){if(!e||!e.length)return!1;e[0].parentNode.insertBefore(t,e[0]),e.forEach(n=>t.appendChild(n))}function Zi(e){let t={tabs:e.querySelectorAll(':scope [role="tab"]'),panels:e.querySelectorAll(':scope [role="tabpanel"]'),activeIndex:0};t.tabs.forEach((n,i)=>{n.addEventListener("click",r=>{Y(i,t)}),n.addEventListener("keydown",r=>{let s=t.tabs.length-1;r.code==="ArrowLeft"?(r.preventDefault(),t.activeIndex===0?Y(s,t):Y(t.activeIndex-1,t)):r.code==="ArrowRight"?(r.preventDefault(),t.activeIndex===s?Y(0,t):Y(t.activeIndex+1,t)):r.code==="Home"?(r.preventDefault(),Y(0,t)):r.code==="End"&&(r.preventDefault(),Y(s,t))})})}function Y(e,t){t.tabs[t.activeIndex].setAttribute("aria-selected","false"),t.tabs[t.activeIndex].tabIndex=-1,t.tabs[e].setAttribute("aria-selected","true"),t.tabs[e].tabIndex=0,t.tabs[e].focus(),t.panels[t.activeIndex].setAttribute("hidden",""),t.panels[t.activeIndex].tabIndex=-1,t.panels[e].removeAttribute("hidden"),t.panels[e].tabIndex=0,t.activeIndex=e}var Yt="ex_doc:settings",er={tooltips:!0,theme:null,livebookUrl:null},Ke=class{constructor(){this._subscribers=[],this._settings=er,this._loadSettings()}get(){return this._settings}update(t){let n=this._settings;this._settings={...this._settings,...t},this._subscribers.forEach(i=>i(this._settings,n)),this._storeSettings()}getAndSubscribe(t){this._subscribers.push(t),t(this._settings)}_loadSettings(){try{let t=localStorage.getItem(Yt);if(t){let n=JSON.parse(t);this._settings={...this._settings,...n}}this._loadSettingsLegacy()}catch(t){console.error(`Failed to load settings: ${t}`)}}_storeSettings(){try{this._storeSettingsLegacy(),localStorage.setItem(Yt,JSON.stringify(this._settings))}catch(t){console.error(`Failed to persist settings: ${t}`)}}_loadSettingsLegacy(){localStorage.getItem("tooltipsDisabled")!==null&&(this._settings={...this._settings,tooltips:!1}),localStorage.getItem("night-mode")==="true"&&(this._settings={...this._settings,nightMode:!0}),this._settings.nightMode===!0&&(this._settings={...this._settings,theme:"dark"})}_storeSettingsLegacy(){this._settings.tooltips?localStorage.removeItem("tooltipsDisabled"):localStorage.setItem("tooltipsDisabled","true"),this._settings.nightMode!==null?localStorage.setItem("night-mode",this._settings.nightMode===!0?"true":"false"):localStorage.removeItem("night-mode"),this._settings.theme!==null?(localStorage.setItem("night-mode",this._settings.theme==="dark"?"true":"false"),this._settings.nightMode=this._settings.theme==="dark"):(delete this._settings.nightMode,localStorage.removeItem("night-mode"))}},I=new Ke;var tr=".content",Jt=".content-inner",nr=".livebook-badge";function Xt(e){e||rr(),sr(),ir()}function ir(){d(tr).querySelectorAll("a").forEach(e=>{e.querySelector("code, img")&&e.classList.add("no-underline")})}function rr(){d(Jt).setAttribute("tabindex",-1),d(Jt).focus()}function sr(){let t=window.location.pathname.replace(/(\.html)?$/,".livemd"),n=new URL(t,window.location.href).toString();I.getAndSubscribe(i=>{let r=i.livebookUrl?ar(i.livebookUrl,n):or(n);for(let s of A(nr))s.href=r})}function or(e){return`https://livebook.dev/run?url=${encodeURIComponent(e)}`}function ar(e,t){return`${e}/import?url=${encodeURIComponent(t)}`}var on=$t(rn());var Tr=768,Je=300,oe=".sidebar-toggle",kr=".content",$={CLOSED:"closed",OPEN:"open",NO_PREF:"no_pref"},Q={opened:"sidebar-opened",openingStart:"sidebar-opening-start",opening:"sidebar-opening",closed:"sidebar-closed",closingStart:"sidebar-closing-start",closing:"sidebar-closing"},Or=Object.values(Q),R={togglingTimeout:null,lastWindowWidth:window.innerWidth,sidebarPreference:$.NO_PREF};function an(){cn(),Cr(),Ar()}function Cr(){let e=sessionStorage.getItem("sidebar_width");e&&sn(e),new ResizeObserver(n=>{for(let i of n)sn(i.contentRect.width)}).observe(document.getElementById("sidebar"))}function sn(e){sessionStorage.setItem("sidebar_width",e),document.body.style.setProperty("--sidebarWidth",`${e}px`)}function cn(){sessionStorage.getItem("sidebar_state")==="closed"||ln()?(j(Q.closed),d(oe).setAttribute("aria-expanded","false")):(j(Q.opened),d(oe).setAttribute("aria-expanded","true")),setTimeout(()=>d(oe).classList.add("sidebar-toggle--animated"),Je)}function ln(){return window.matchMedia(`screen and (max-width: ${Tr}px)`).matches}function j(...e){document.body.classList.remove(...Or),document.body.classList.add(...e)}function Ar(){d(oe).addEventListener("click",e=>{Xe(),Pr()}),d(kr).addEventListener("click",e=>{_r()}),window.addEventListener("resize",(0,on.default)(e=>{Ir()},100))}function Xe(){return Ze()?dn():et()}function Ze(){return document.body.classList.contains(Q.opened)||document.body.classList.contains(Q.opening)}function un(){return document.body.classList.contains(Q.opened)}function et(){return hn(),sessionStorage.setItem("sidebar_state","opened"),d(oe).setAttribute("aria-expanded","true"),new Promise((e,t)=>{requestAnimationFrame(()=>{j(Q.openingStart),requestAnimationFrame(()=>{j(Q.opening),R.togglingTimeout=setTimeout(()=>{j(Q.opened),e()},Je)})})})}function dn(){return hn(),sessionStorage.setItem("sidebar_state","closed"),d(oe).setAttribute("aria-expanded","false"),new Promise((e,t)=>{requestAnimationFrame(()=>{j(Q.closingStart),requestAnimationFrame(()=>{j(Q.closing),R.togglingTimeout=setTimeout(()=>{j(Q.closed),e()},Je)})})})}function hn(){R.togglingTimeout&&(clearTimeout(R.togglingTimeout),R.togglingTimeout=null)}function Ir(){R.lastWindowWidth!==window.innerWidth&&(R.lastWindowWidth=window.innerWidth,(R.sidebarPreference===$.OPEN||R.sidebarPreference===$.NO_PREF)&&cn())}function _r(){ln()&&Ze()&&dn()}function Pr(){switch(R.sidebarPreference){case $.OPEN:R.sidebarPreference=$.CLOSED;break;case $.CLOSED:R.sidebarPreference=$.OPEN;break;case $.NO_PREF:Ze()?R.sidebarPreference=$.OPEN:R.sidebarPreference=$.CLOSED}}function he(){return window.sidebarNodes||{}}function fn(){return window.versionNodes||[]}var tt={search:"search",extras:"extras",modules:"modules",tasks:"tasks"},pn=!1,nt=[tt.extras,tt.modules,tt.tasks],ke=e=>`#${e}-full-list`;function it(){nt.forEach(e=>{Rr(he(),e)}),Te(V()),gn(),mn(),!pn&&(pn=!0,Br())}function Rr(e,t){let n=e[t]||[],i=d(ke(t));if(!i)return;let r=Handlebars.templates["sidebar-items"]({nodes:n,group:""});i.innerHTML=r,i.querySelectorAll("ul").forEach(s=>{if(s.innerHTML.trim()===""){let o=s.previousElementSibling;o.classList.contains("expand")&&o.classList.remove("expand"),s.remove()}}),i.querySelectorAll("li a + button").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.closest("li");Hr(c)})}),i.querySelectorAll("li a").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.closest("li"),l=i.querySelector(".current-section");l&&Mr(l),s.matches(".expand")&&(s.pathname===window.location.pathname||s.pathname===window.location.pathname+".html")&&rt(c)})})}function rt(e){e.classList.add("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","true")}function Nr(e){e.classList.remove("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","false")}function Hr(e){e.classList.contains("open")?Nr(e):rt(e)}function Qr(e){e.classList.add("current-section"),e.querySelector("a").setAttribute("aria-current","true")}function Mr(e){e.classList.remove("current-section"),e.querySelector("a").setAttribute("aria-current","false")}function Dr(e){e.classList.add("current-hash"),e.querySelector("a").setAttribute("aria-current","true")}function Fr(e){e.classList.remove("current-hash"),e.querySelector("a").setAttribute("aria-current","false")}function Te(e){nt.forEach(t=>{let n=d(`#${t}-list-tab-button`);if(n){let i=d(`#${n.getAttribute("aria-controls")}`);t===e?(n.parentElement.classList.add("selected"),n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0"),i.removeAttribute("hidden")):(n.parentElement.classList.remove("selected"),n.setAttribute("aria-selected","false"),n.setAttribute("tabindex","-1"),i.setAttribute("hidden","hidden"))}})}function mn(){let e=d(ke(V()));if(!e)return;let t=e.querySelector("li.current-page");t&&(t.scrollIntoView(),e.scrollTop-=40)}function gn(){let e=ie()||"content",n=he()[V()]||[],i=qt(n,e),r=d(ke(V()));if(!r)return;let s=r.querySelector(`li.current-page a.expand[href$="#${i}"]`);s&&rt(s.closest("li"));let o=r.querySelector(`li.current-page a[href$="#${e}"]`);if(o){let a=o.closest("ul");a.classList.contains("deflist")&&Qr(a.closest("li")),Dr(o.closest("li"))}}function Br(){nt.forEach(t=>{let n=d(`#${t}-list-tab-button`);n&&n.addEventListener("click",i=>{Te(t),mn()})});let e=d("#sidebar-list-nav");e.addEventListener("keydown",t=>{if(t.key!=="ArrowRight"&&t.key!=="ArrowLeft")return;let n=Array.from(e.querySelectorAll('[role="tab"]')).map(r=>r.dataset.type),i=e.querySelector('[role="tab"][aria-selected="true"]').dataset.type;if(t.key==="ArrowRight"){let r=n.indexOf(i)+1;r>=n.length&&(r=0);let s=n[r];Te(s),d(`#${s}-list-tab-button`).focus()}else if(t.key==="ArrowLeft"){let r=n.indexOf(i)-1;r<0&&(r=n.length-1);let s=n[r];Te(s),d(`#${s}-list-tab-button`).focus()}}),window.addEventListener("hashchange",t=>{let n=d(ke(V()));if(!n)return;let i=n.querySelector("li.current-page li.current-hash");i&&Fr(i),gn()})}var U={module:"module",moduleChild:"module-child",mixTask:"mix-task",extra:"extra",section:"section"};function yn(e,t=8){if(re(e))return[];let n=he(),i=[...st(n.modules,e,U.module,"module"),...$r(n.modules,e,U.moduleChild),...st(n.tasks,e,U.mixTask,"mix task"),...st(n.extras,e,U.extra,"page"),...ot(n.modules,e,U.section,"module"),...ot(n.tasks,e,U.section,"mix task"),...ot(n.extras,e,U.section,"page")].filter(r=>r!==null);return Gr(i).slice(0,t)}function st(e,t,n,i){return e.map(r=>qr(r,t,n,i))}function $r(e,t,n){return e.filter(i=>i.nodeGroups).flatMap(i=>i.nodeGroups.flatMap(({key:r,nodes:s})=>{let o=Wr(r);return s.map(a=>Vr(a,i.id,t,n,o)||zr(a,i.id,t,n,o))}))}function ot(e,t,n,i){return e.flatMap(r=>Ur(r).map(s=>jr(r,s,t,n,i)))}function Ur(e){return(e.sections||[]).concat(e.headers||[])}function qr(e,t,n,i){return Ce(e.title,t)?{link:`${e.id}.html`,title:_e(e.title,t),description:null,matchQuality:Ae(e.title,t),deprecated:e.deprecated,labels:[i],category:n}:null}function Vr(e,t,n,i,r){return Ce(e.id,n)?{link:`${t}.html#${e.anchor}`,title:_e(e.id,n),labels:[r],description:t,matchQuality:Ae(e.id,n),deprecated:e.deprecated,category:i}:null}function jr(e,t,n,i,r){return wn(t.id,n)?{link:`${e.id}.html#${t.anchor}`,title:_e(t.id,n),description:e.title,matchQuality:Ae(t.id,n),labels:[r,"section"],category:i}:null}function zr(e,t,n,i,r){let s=`${t}.${e.id}`,o=`${t}:${e.id}`,a,c;if(Ce(s,n))a=s,c=/\./g;else if(Ce(o,n))a=o,c=/:/g;else return null;let l=n.replace(c," ");return wn(e.id,l)?{link:`${t}.html#${e.anchor}`,title:_e(e.id,l),label:r,description:t,matchQuality:Ae(a,n),deprecated:e.deprecated,category:i}:null}function Wr(e){switch(e){case"callbacks":return"callback";case"types":return"type";default:return"function"}}function Gr(e){return e.slice().sort((t,n)=>t.matchQuality!==n.matchQuality?n.matchQuality-t.matchQuality:vn(t.category)-vn(n.category))}function vn(e){switch(e){case U.module:return 1;case U.moduleChild:return 2;case U.mixTask:return 3;default:return 4}}function wn(e,t){return Ie(t).some(i=>bn(e,i))}function Ce(e,t){return Ie(t).every(i=>bn(e,i))}function bn(e,t){return e.toLowerCase().includes(t.toLowerCase())}function Ae(e,t){let n=Ie(t),r=n.map(o=>o.length).reduce((o,a)=>o+a,0)/e.length,s=Kr(e,n[0])?1:0;return r+s}function Kr(e,t){return e.toLowerCase().startsWith(t.toLowerCase())}function Ie(e){return e.trim().split(/\s+/)}function _e(e,t){let n=Ie(t).sort((i,r)=>r.length-i.length);return Oe(e,n)}function Oe(e,t){if(t.length===0)return e;let[n,...i]=t,r=e.match(new RegExp(`(.*)(${Ut(n)})(.*)`,"i"));if(r){let[,s,o,a]=r;return Oe(s,t)+""+Se(o)+""+Oe(a,t)}else return Oe(e,i)}var Pe=null,J=null;function Sn(){J=document.getElementById("toast"),J.addEventListener("click",e=>{clearTimeout(Pe),e.target.classList.remove("show")})}function at(e){J&&(clearTimeout(Pe),J.innerText=e,J.classList.add("show"),Pe=setTimeout(()=>{J.classList.remove("show"),Pe=setTimeout(function(){J.innerText=""},1e3)},5e3))}var En="dark",ct=["system","dark","light"];function xn(e){I.getAndSubscribe(t=>{document.body.classList.toggle(En,Tn(e||t.theme))}),Jr()}function Ln(){let e=ct[ct.indexOf(lt())+1]||ct[0];I.update({theme:e}),at(`Set theme to "${e}"`)}function lt(){return I.get().theme||"system"}function Tn(e){return e==="dark"||Yr()&&(e==null||e==="system")}function Yr(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function Jr(){window.matchMedia("(prefers-color-scheme: dark)").addListener(e=>{let t=I.get().theme,n=Tn(t);(t==null||t==="system")&&(document.body.classList.toggle(En,n),at(`Browser changed theme to "${n?"dark":"light"}"`))})}var ae=".autocomplete",Ne=".autocomplete-suggestions",Re=".autocomplete-suggestion",_={autocompleteSuggestions:[],previewOpen:!1,selectedIdx:-1};function Xr(){d(ae).classList.add("shown")}function ut(){d(ae).classList.remove("shown")}function kn(){return d(ae).classList.contains("shown")}function dt(e){_.autocompleteSuggestions=yn(e),_.selectedIdx=-1,re(e)?ut():(Zr({term:e,suggestions:_.autocompleteSuggestions}),He(0),Xr())}function Zr({term:e,suggestions:t}){let n=Handlebars.templates["autocomplete-suggestions"]({suggestions:t,term:e}),i=d(ae);i.innerHTML=n}function ht(){return _.selectedIdx===-1?null:_.autocompleteSuggestions[_.selectedIdx]}function He(e){Cn(es(e))}function On(e){if(e.data.type==="preview"){let{contentHeight:t}=e.data,n=d(".autocomplete-preview");n&&(n.style.height=`${t+32}px`,n.classList.remove("loading"))}}function Cn(e){_.selectedIdx=e;let t=d(Ne),n=d(`${Re}.selected`),i=d(`${Re}[data-index="${_.selectedIdx}"]`);if(n&&n.classList.remove("selected"),i){if(_.previewOpen){In(),window.addEventListener("message",On),t.classList.add("previewing");let r=document.createElement("div");r.classList.add("autocomplete-preview"),r.classList.add("loading");let s=i.href.replace(".html",`.html?preview=true&theme=${lt()}`),o=document.createElement("iframe");o.setAttribute("src",s),r.appendChild(document.createElement("div")),r.appendChild(document.createElement("span")),r.appendChild(o),i.parentNode.insertBefore(r,i.nextSibling)}i.classList.add("selected"),i.scrollIntoView({block:"nearest"})}else t&&(t.scrollTop=0)}function An(){_.previewOpen?Qe():ft()}function Qe(){_.previewOpen=!1;let e=d(Ne);e&&e.classList.remove("previewing"),In()}function ft(e){_.previewOpen=!0,e?e=e.closest(Re):e=d(`${Re}[data-index="${_.selectedIdx}"]`),e&&Cn(parseInt(e.dataset.index))}function In(){let e=d(".autocomplete-preview");e&&(e.remove(),window.removeEventListener("message",On))}function es(e){let t=_.autocompleteSuggestions.length+1;return(_.selectedIdx+e+1+t)%t-1}var fe="form.search-bar input",ts="form.search-bar .search-close-button";function Rn(){ns(),window.onTogglePreviewClick=function(e,t){e.preventDefault(),e.stopImmediatePropagation(),mt(),t?ft(e.target):Qe()}}function Nn(e){let t=d(fe);t.value=e}function mt(){let e=d(fe);document.body.classList.add("search-focused"),e.focus()}function ns(){let e=d(fe);if(document.querySelector('meta[name="exdoc:autocomplete"][content="off"]'))return e.addEventListener("keydown",t=>{t.key==="Enter"&&_n(t)}),!0;e.addEventListener("keydown",t=>{let n=se();t.key==="Escape"?(Me(),e.blur()):t.key==="Enter"?_n(t):t.key==="ArrowUp"||n&&t.ctrlKey&&t.key==="p"?(He(-1),t.preventDefault()):t.key==="ArrowDown"||n&&t.ctrlKey&&t.key==="n"?(He(1),t.preventDefault()):t.key==="Tab"&&ht()!==null&&(An(),t.preventDefault())}),e.addEventListener("input",t=>{dt(t.target.value)}),e.addEventListener("focus",t=>{document.body.classList.contains("search-focused")||(document.body.classList.add("search-focused"),dt(t.target.value))}),e.addEventListener("blur",t=>{let n=t.relatedTarget,i=d(Ne);if(n&&i&&i.contains(n))return setTimeout(()=>{kn()&&e.focus()},1e3),null;De()}),d(ae).addEventListener("click",t=>{t.shiftKey||t.ctrlKey?e.focus():(Me(),De())}),d(ts).addEventListener("click",t=>{Me(),De()})}function _n(e){let t=d(fe),n=e.shiftKey||e.ctrlKey,i=ht();e.preventDefault();let r=n?"_blank":"_self",s=document.createElement("a");if(s.setAttribute("target",r),i)s.setAttribute("href",i.link);else{let o=document.querySelector('meta[name="exdoc:full-text-search-url"]'),a=o?o.getAttribute("content"):"search.html?q=";s.setAttribute("href",`${a}${encodeURIComponent(t.value)}`)}s.click(),n||(Me(),De())}function Me(){let e=d(fe);e.value=""}function De(){Qe(),document.body.classList.remove("search-focused"),ut()}var pt=window.scrollY,is=70,Pn=-2;window.addEventListener("scroll",function(){let e=window.scrollY;e===0||pt-eis?document.body.classList.remove("scroll-sticky"):pt-e>Math.abs(Pn)&&document.body.classList.add("scroll-sticky"),pt=e<=0?0:e},!1);var Hn=".sidebar-projectVersion",Qn=".sidebar-projectVersionsDropdown";function Mn(){let e=fn();if(e.length>0){let n=d(Hn).textContent.trim(),i=ss(e,n);rs({nodes:i})}}function rs({nodes:e}){let t=d(Hn),n=Handlebars.templates["versions-dropdown"]({nodes:e});t.innerHTML=n,d(Qn).addEventListener("change",as)}function ss(e,t){return os(e,t).map(i=>({...i,isCurrentVersion:i.version===t}))}function os(e,t){return e.some(i=>i.version===t)?e:[{version:t,url:"#"},...e]}function as(e){let t=e.target.value,n=window.location.pathname.split("/").pop()+window.location.hash,i=`${t}/${n}`;jt(i).then(r=>{r?window.location.href=i:window.location.href=t})}function gt(){let e=d(Qn);e&&(e.focus(),e.addEventListener("keydown",t=>{(t.key==="Escape"||t.key==="v")&&(t.preventDefault(),e.blur())}),navigator.userActivation.isActive&&"showPicker"in HTMLSelectElement.prototype&&e.showPicker())}var D=$t(Bn());var Fe=80,cs="#search";D.default.tokenizer.separator=/\s+/;D.default.QueryLexer.termSeparator=/\s+/;D.default.Pipeline.registerFunction(qn,"docTokenSplitter");D.default.Pipeline.registerFunction(Vn,"docTrimmer");function yt(){let e=window.location.pathname;if(e.endsWith("/search.html")||e.endsWith("/search")){let t=Vt("q");ls(t)}}async function ls(e){if(re(e))vt({value:e});else{Nn(e);let t=await us();try{let n=e.replaceAll(/(\B|\\):/g,"\\:"),i=bs(t.search(n));vt({value:e,results:i})}catch(n){vt({value:e,errorMessage:n.message})}}}function vt({value:e,results:t,errorMessage:n}){let i=d(cs),r=Handlebars.templates["search-results"]({value:e,results:t,errorMessage:n});i.innerHTML=r}async function us(){let e=await ds();if(e)return e;let t=vs();return hs(t),t}async function ds(){try{let e=sessionStorage.getItem(Un());if(e){let t=await ps(e);return D.default.Index.load(t)}else return null}catch(e){return console.error("Failed to load index: ",e),null}}async function hs(e){try{let t=await fs(e);sessionStorage.setItem(Un(),t)}catch(t){console.error("Failed to save index: ",t)}}async function fs(e){let t=new Blob([JSON.stringify(e)],{type:"application/json"}).stream().pipeThrough(new window.CompressionStream("gzip")),i=await(await new Response(t).blob()).arrayBuffer();return ms(i)}async function ps(e){let t=new Blob([gs(e)],{type:"application/json"}).stream().pipeThrough(new window.DecompressionStream("gzip")),n=await new Response(t).text();return JSON.parse(n)}function ms(e){let t="",n=new Uint8Array(e),i=n.byteLength;for(let r=0;r{this.add(e)})})}function ys(e){e.pipeline.before(D.default.stemmer,qn)}function qn(e){let t=[e],n=/\/\d+$/,i=/\:|\./,r=e.toString();if(r.replace(/^[.,;?!]+|[.,;]+$/g,""),r.startsWith("`")&&r.endsWith("`")&&(r=r.slice(1,-1)),n.test(r)){let o=e.toString().replace(n,"");t.push(e.clone().update(()=>o));let a=o.split(i);if(a.length>1){for(let l of a)t.push(e.clone().update(()=>l));let c=e.toString().split(i);t.push(e.clone().update(()=>c[c.length-1]))}r=a[a.length-1]}else r.startsWith("@")?(r=r.substring(1),t.push(e.clone().update(()=>r))):r.startsWith(":")&&(r=r.substring(1),t.push(e.clone().update(()=>r)));let s=r.split(/\_|\-/);if(s.length>1)for(let o of s)t.push(e.clone().update(()=>o));return t}function ws(e){e.pipeline.before(D.default.stemmer,Vn)}function Vn(e){return e.update(function(t){return t.replace(/^[^@:\w]+/,"").replace(/[^\?\!\w]+$/,"")})}function bs(e){return e.filter(t=>$n(t.ref)).map(t=>{let n=$n(t.ref),i=t.matchData.metadata;return{...n,metadata:i,excerpts:Ss(n,i)}})}function $n(e){return searchData.items.find(t=>t.ref===e)||null}function Ss(e,t){let{doc:n}=e,r=Object.keys(t).filter(s=>"doc"in t[s]).map(s=>t[s].doc.position.map(([o,a])=>Es(n,o,a))).reduce((s,o)=>s.concat(o),[]);return r.length===0?[n.slice(0,Fe*2)+(Fe*20?"...":"",e.slice(i,t),""+Se(e.slice(t,t+n))+"",e.slice(t+n,r),r{let n=t.getAttribute("data-group-id");t.addEventListener("mouseenter",i=>{jn(n,!0)}),t.addEventListener("mouseleave",i=>{jn(n,!1)})})}function jn(e,t){A(`[data-group-id="${e}"]`).forEach(i=>{i.classList.toggle(xs,t)})}var Z=".modal",Ts=".modal .modal-close",ks=".modal .modal-title",Os=".modal .modal-body",Wn='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',q={prevFocus:null,lastFocus:null,ignoreFocusChanges:!1};function Gn(){Cs()}function Cs(){let e=Handlebars.templates["modal-layout"]();document.body.insertAdjacentHTML("beforeend",e),d(Z).addEventListener("keydown",t=>{t.key==="Escape"&&X()}),d(Ts).addEventListener("click",t=>{X()}),d(Z).addEventListener("click",t=>{t.target.classList.contains("modal")&&X()})}function Kn(e){if(q.ignoreFocusChanges)return;let t=d(Z);if(t.contains(e.target))q.lastFocus=e.target;else{q.ignoreFocusChanges=!0;let n=As(t);q.lastFocus===n?Is(t).focus():n.focus(),q.ignoreFocusChanges=!1,q.lastFocus=document.activeElement}}function As(e){return e.querySelector(Wn)}function Is(e){let t=e.querySelectorAll(Wn);return t[t.length-1]}function Be({title:e,body:t}){q.prevFocus=document.activeElement,document.addEventListener("focus",Kn,!0),d(ks).innerHTML=e,d(Os).innerHTML=t,d(Z).classList.add("shown"),d(Z).focus()}function X(){d(Z).classList.remove("shown"),document.addEventListener("focus",Kn,!0),q.prevFocus&&q.prevFocus.focus(),q.prevFocus=null}function Yn(){return d(Z).classList.contains("shown")}var _s="https://hexdocs.pm/%%",Ps="https://www.erlang.org/doc/apps/%%",Rs="https://hex.pm/api/packages?search=name:%%*",Ns=".display-quick-switch",wt="#quick-switch-input",Xn="#quick-switch-results",Hs=".quick-switch-result",Qs=300,Ms=9,Zn=["erts","asn1","common_test","compiler","crypto","debugger","dialyzer","diameter","edoc","eldap","erl_interface","et","eunit","ftp","inets","jinterface","kernel","megaco","mnesia","observer","odbc","os_mon","parsetools","public_key","reltool","runtime_tools","sasl","snmp","ssh","ssl","stdlib","syntax_tools","tftp","tools","wx","xmerl"],Ds=["elixir","eex","ex_unit","hex","iex","logger","mix"].concat(Zn).map(e=>({name:e})),ei=2,N={autocompleteResults:[],selectedIdx:null};function ti(){Fs()}function Fs(){A(Ns).forEach(e=>{e.addEventListener("click",t=>{St()})})}function Bs(e){if(e.key==="Enter"){let t=e.target.value;Us(t),e.preventDefault()}else e.key==="ArrowUp"?(Jn(-1),e.preventDefault()):e.key==="ArrowDown"&&(Jn(1),e.preventDefault())}function $s(e){let t=e.target.value;if(t.lengthn.json()).then(n=>{Array.isArray(n)&&(N.autocompleteResults=zs(e,n),N.selectedIdx=null,d(wt).value.length>=ei&&js({results:N.autocompleteResults}))})}function js({results:e}){let t=d(Xn),n=Handlebars.templates["quick-switch-results"]({results:e});t.innerHTML=n,A(Hs).forEach(i=>{i.addEventListener("click",r=>{let s=i.getAttribute("data-index"),o=N.autocompleteResults[s];bt(o.name)})})}function zs(e,t){return Ds.concat(t).filter(n=>n.name.toLowerCase().includes(e.toLowerCase())).filter(n=>n.releases===void 0||n.releases[0].has_docs===!0).slice(0,Ms)}function Jn(e){N.selectedIdx=Ws(e);let t=d(".quick-switch-result.selected"),n=d(`.quick-switch-result[data-index="${N.selectedIdx}"]`);t&&t.classList.remove("selected"),n&&n.classList.add("selected")}function Ws(e){let t=N.autocompleteResults.length;if(N.selectedIdx===null){if(e>=0)return 0;if(e<0)return t-1}return(N.selectedIdx+e+t)%t}var Gs=".display-settings",Ks="#settings-modal-content",Et="#modal-settings-tab",xt="#modal-keyboard-shortcuts-tab",ii="#settings-content",ri="#keyboard-shortcuts-content",Ys=[{title:"Settings",id:"modal-settings-tab"},{title:"Keyboard shortcuts",id:"modal-keyboard-shortcuts-tab"}];function si(){Js()}function Js(){A(Gs).forEach(e=>{e.addEventListener("click",t=>{Lt()})})}function ni(){d(xt).classList.remove("active"),d(Et).classList.add("active"),d(ii).classList.remove("hidden"),d(ri).classList.add("hidden")}function Xs(){d(xt).classList.add("active"),d(Et).classList.remove("active"),d(ri).classList.remove("hidden"),d(ii).classList.add("hidden")}function Lt(){Be({title:Ys.map(({id:s,title:o})=>``).join(""),body:Handlebars.templates["settings-modal-body"]({shortcuts:Tt})});let e=d(Ks),t=e.querySelector('[name="theme"]'),n=e.querySelector('[name="tooltips"]'),i=e.querySelector('[name="direct_livebook_url"]'),r=e.querySelector('[name="livebook_url"]');I.getAndSubscribe(s=>{t.value=s.theme||"system",n.checked=s.tooltips,s.livebookUrl===null?(i.checked=!1,r.classList.add("hidden"),r.tabIndex=-1):(i.checked=!0,r.classList.remove("hidden"),r.tabIndex=0,r.value=s.livebookUrl)}),t.addEventListener("change",s=>{I.update({theme:s.target.value})}),n.addEventListener("change",s=>{I.update({tooltips:s.target.checked})}),i.addEventListener("change",s=>{let o=s.target.checked?r.value:null;I.update({livebookUrl:o})}),r.addEventListener("input",s=>{I.update({livebookUrl:s.target.value})}),d(Et).addEventListener("click",s=>{ni()}),d(xt).addEventListener("click",s=>{Xs()}),ni()}var Zs="#settings-modal-content",Tt=[{key:"c",description:"Toggle sidebar",action:Xe},{key:"n",description:"Cycle themes",action:Ln},{key:"s",description:"Focus search bar",displayAs:"/ or s",action:kt},{key:"/",action:kt},{key:"k",hasModifier:!0,action:kt},{key:"v",description:"Open/focus version select",action:io},{key:"g",description:"Go to package docs",displayAs:"g",action:St},{key:"?",displayAs:"?",description:"Bring up this modal",action:ro}],Ot={shortcutBeingPressed:null};function oi(){eo()}function eo(){document.addEventListener("keydown",to),document.addEventListener("keyup",no)}function to(e){if(Ot.shortcutBeingPressed||e.target.matches("input, select, textarea"))return;let t=Tt.find(n=>n.hasModifier?se()&&e.metaKey||e.ctrlKey?n.key===e.key:!1:e.ctrlKey||e.metaKey||e.altKey?!1:n.key===e.key);t&&(Ot.shortcutBeingPressed=t,e.preventDefault(),t.action(e))}function no(e){Ot.shortcutBeingPressed=null}function kt(e){X(),mt()}function io(){X(),un()?gt():et().then(gt)}function ro(){so()?X():Lt()}function so(){return Yn()&&d(Zs)}var ee={plain:"plain",function:"function",module:"module"},oo=[{href:"typespecs.html#basic-types",hint:{kind:ee.plain,description:"Basic type"}},{href:"typespecs.html#literals",hint:{kind:ee.plain,description:"Literal"}},{href:"typespecs.html#built-in-types",hint:{kind:ee.plain,description:"Built-in type"}}],$e={cancelHintFetching:null};function ai(e){if(li(e))return!0;let t=/#.*\//;return e.includes("#")&&!t.test(e)?!1:e.includes(".html")}function ci(e){let t=li(e);return t?Promise.resolve(t):ao(e)}function li(e){let t=oo.find(n=>e.includes(n.href));return t?t.hint:null}function ao(e){let t=e.replace(".html",".html?hint=true");return new Promise((n,i)=>{let r=document.createElement("iframe");r.setAttribute("src",t),r.style.display="none";function s(a){let{href:c,hint:l}=a.data;t===c&&(o(),n(l))}$e.cancelHintFetching=()=>{o(),i(new Error("cancelled"))};function o(){r.remove(),window.removeEventListener("message",s),$e.cancelHintFetching=null}window.addEventListener("message",s),document.body.appendChild(r)})}function ui(){$e.cancelHintFetching&&$e.cancelHintFetching()}function di(e){let n=e.querySelector("h1").textContent,i=e.querySelector(".docstring > p"),r=i?i.innerHTML:"";return{kind:ee.function,title:n.trim(),description:r.trim()}}function hi(e){let n=e.querySelector("h1 > span").textContent,i=e.querySelector("#moduledoc p"),r=i?i.innerHTML:"";return{kind:ee.module,title:n.trim(),description:r.trim()}}var co=".content a",Ct=".tooltip",lo=".tooltip .tooltip-body",pi="body .content-inner",uo="#content",mi="tooltip-shown",pe=10,ho=pe*4,fi={height:450,width:768},fo=100,ce={currentLinkElement:null,hoverDelayTimeout:null};function gi(){po(),mo()}function po(){let e=Handlebars.templates["tooltip-layout"]();d(pi).insertAdjacentHTML("beforeend",e)}function mo(){A(co).forEach(e=>{go(e)&&(e.addEventListener("mouseenter",t=>{yo(e)}),e.addEventListener("mouseleave",t=>{Eo(e)}))})}function go(e){return!(e.getAttribute("data-no-tooltip")!==null||vo(e.href)||!ai(e.href))}function vo(e){let t=e.replace(uo,"");return window.location.href.split("#")[0]===t}function yo(e){wo()&&(ce.currentLinkElement=e,ce.hoverDelayTimeout=setTimeout(()=>{ci(e.href).then(t=>{bo(t),So()}).catch(()=>{})},fo))}function wo(){let e=window.innerWidthe.firstElementChild&&e.firstElementChild.tagName==="CODE").forEach(e=>e.insertAdjacentHTML("beforeend",_o)),Array.from(A(".copy-button")).forEach(e=>{let t;e.addEventListener("click",()=>{let n=e.querySelector("[aria-live]");t&&clearTimeout(t);let i=Array.from(e.parentElement.querySelector("code").childNodes).filter(r=>!(r.tagName==="SPAN"&&r.classList.contains("unselectable"))).map(r=>r.textContent).join("");navigator.clipboard.writeText(i),e.classList.add("clicked"),n.innerHTML="Copied! ✓",t=setTimeout(()=>{e.classList.remove("clicked"),n.innerHTML=""},3e3)})})}function Si(){let e=se()?"apple-os":"non-apple-os";document.documentElement.classList.add(e)}function xi(){let e=Ee(ie(),!0);e&&Ro(e)}function Ro(e){Qo(e),No(),Ho(),Ei(),window.addEventListener("resize",t=>{Ei()})}function Ei(){let e=document.body.scrollHeight,t=document.getElementById("content").parentElement.offsetHeight,n={type:"preview",maxHeight:e,contentHeight:t};window.parent.postMessage(n,"*")}function No(){let e=document.getElementsByTagName("a");for(let t of e)t.getAttribute("target")!=="_blank"&&t.setAttribute("target","_parent")}function Ho(){window.scrollTo(0,0)}function Qo(e){document.body.classList.add("preview");let t=document.getElementById("content");t.innerHTML=e.innerHTML}var At=new WeakMap;function It(e,t,n,i){if(!e&&!At.has(t))return!1;let r=At.get(t)??new WeakMap;At.set(t,r);let s=r.get(n)??new Set;r.set(n,s);let o=s.has(i);return e?s.add(i):s.delete(i),o&&e}function Mo(e,t){let n=e.target;if(n instanceof Text&&(n=n.parentElement),n instanceof Element&&e.currentTarget instanceof Element){let i=n.closest(t);if(i&&e.currentTarget.contains(i))return i}}function Do(e,t,n,i={}){let{signal:r,base:s=document}=i;if(r?.aborted)return;let{once:o,...a}=i,c=s instanceof Document?s.documentElement:s,l=Boolean(typeof i=="object"?i.capture:i),u=y=>{let w=Mo(y,String(e));if(w){let b=Object.assign(y,{delegateTarget:w});n.call(c,b),o&&(c.removeEventListener(t,u,a),It(!1,c,n,h))}},h=JSON.stringify({selector:e,type:t,capture:l});It(!0,c,n,h)||c.addEventListener(t,u,a),r?.addEventListener("abort",()=>{It(!1,c,n,h)})}var Ue=Do;function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;tString(e).toLowerCase().replace(/[\s/_.]+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+|-+$/g,"")||t||"",ge=({hash:e}={})=>window.location.pathname+window.location.search+(e?window.location.hash:""),Fo=(e,t={})=>{let n=k({url:e=e||ge({hash:!0}),random:Math.random(),source:"swup"},t);window.history.pushState(n,"",e)},me=(e=null,t={})=>{e=e||ge({hash:!0});let n=k({},window.history.state||{},{url:e,random:Math.random(),source:"swup"},t);window.history.replaceState(n,"",e)},Bo=(e,t,n,i)=>{let r=new AbortController;return i=k({},i,{signal:r.signal}),Ue(e,t,n,i),{destroy:()=>r.abort()}},O=class extends URL{constructor(t,n=document.baseURI){super(t.toString(),n),Object.setPrototypeOf(this,O.prototype)}get url(){return this.pathname+this.search}static fromElement(t){let n=t.getAttribute("href")||t.getAttribute("xlink:href")||"";return new O(n)}static fromUrl(t){return new O(t)}};var le=class extends Error{constructor(t,n){super(t),this.url=void 0,this.status=void 0,this.aborted=void 0,this.timedOut=void 0,this.name="FetchError",this.url=n.url,this.status=n.status,this.aborted=n.aborted||!1,this.timedOut=n.timedOut||!1}};async function $o(e,t={}){var n;e=O.fromUrl(e).url;let{visit:i=this.visit}=t,r=k({},this.options.requestHeaders,t.headers),s=(n=t.timeout)!=null?n:this.options.timeout,o=new AbortController,{signal:a}=o;t=k({},t,{headers:r,signal:a});let c,l=!1,u=null;s&&s>0&&(u=setTimeout(()=>{l=!0,o.abort("timeout")},s));try{c=await this.hooks.call("fetch:request",i,{url:e,options:t},(g,{url:m,options:x})=>fetch(m,x)),u&&clearTimeout(u)}catch(g){throw l?(this.hooks.call("fetch:timeout",i,{url:e}),new le(`Request timed out: ${e}`,{url:e,timedOut:l})):g?.name==="AbortError"||a.aborted?new le(`Request aborted: ${e}`,{url:e,aborted:!0}):g}let{status:h,url:f}=c,y=await c.text();if(h===500)throw this.hooks.call("fetch:error",i,{status:h,response:c,url:f}),new le(`Server error: ${f}`,{status:h,url:f});if(!y)throw new le(`Empty response: ${f}`,{status:h,url:f});let{url:w}=O.fromUrl(f),b={url:w,html:y};return!i.cache.write||t.method&&t.method!=="GET"||e!==w||this.cache.set(b.url,b),b}var Pt=class{constructor(t){this.swup=void 0,this.pages=new Map,this.swup=t}get size(){return this.pages.size}get all(){let t=new Map;return this.pages.forEach((n,i)=>{t.set(i,k({},n))}),t}has(t){return this.pages.has(this.resolve(t))}get(t){let n=this.pages.get(this.resolve(t));return n&&k({},n)}set(t,n){n=k({},n,{url:t=this.resolve(t)}),this.pages.set(t,n),this.swup.hooks.callSync("cache:set",void 0,{page:n})}update(t,n){t=this.resolve(t);let i=k({},this.get(t),n,{url:t});this.pages.set(t,i)}delete(t){this.pages.delete(this.resolve(t))}clear(){this.pages.clear(),this.swup.hooks.callSync("cache:clear",void 0,void 0)}prune(t){this.pages.forEach((n,i)=>{t(i,n)&&this.delete(i)})}resolve(t){let{url:n}=O.fromUrl(t);return this.swup.resolveUrl(n)}},Rt=(e,t=document)=>t.querySelector(e),Qt=(e,t=document)=>Array.from(t.querySelectorAll(e)),Ci=()=>new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{e()})})});function Ai(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Uo(e,t=[]){return new Promise((n,i)=>{let r=e(...t);Ai(r)?r.then(n,i):n(r)})}function Li(e,t){let n=e?.closest(`[${t}]`);return n!=null&&n.hasAttribute(t)?n?.getAttribute(t)||!0:void 0}var Nt=class{constructor(t){this.swup=void 0,this.swupClasses=["to-","is-changing","is-rendering","is-popstate","is-animating","is-leaving"],this.swup=t}get selectors(){let{scope:t}=this.swup.visit.animation;return t==="containers"?this.swup.visit.containers:t==="html"?["html"]:Array.isArray(t)?t:[]}get selector(){return this.selectors.join(",")}get targets(){return this.selector.trim()?Qt(this.selector):[]}add(...t){this.targets.forEach(n=>n.classList.add(...t))}remove(...t){this.targets.forEach(n=>n.classList.remove(...t))}clear(){this.targets.forEach(t=>{let n=t.className.split(" ").filter(i=>this.isSwupClass(i));t.classList.remove(...n)})}isSwupClass(t){return this.swupClasses.some(n=>t.startsWith(n))}},je=class{constructor(t,n){this.id=void 0,this.state=void 0,this.from=void 0,this.to=void 0,this.containers=void 0,this.animation=void 0,this.trigger=void 0,this.cache=void 0,this.history=void 0,this.scroll=void 0,this.meta=void 0;let{to:i,from:r,hash:s,el:o,event:a}=n;this.id=Math.random(),this.state=1,this.from={url:r??t.location.url,hash:t.location.hash},this.to={url:i,hash:s},this.containers=t.options.containers,this.animation={animate:!0,wait:!1,name:void 0,native:t.options.native,scope:t.options.animationScope,selector:t.options.animationSelector},this.trigger={el:o,event:a},this.cache={read:t.options.cache,write:t.options.cache},this.history={action:"push",popstate:!1,direction:void 0},this.scroll={reset:!0,target:void 0},this.meta={}}advance(t){this.state=7}};function qo(e){return new je(this,e)}var Ht=class{constructor(t){this.swup=void 0,this.registry=new Map,this.hooks=["animation:out:start","animation:out:await","animation:out:end","animation:in:start","animation:in:await","animation:in:end","animation:skip","cache:clear","cache:set","content:replace","content:scroll","enable","disable","fetch:request","fetch:error","fetch:timeout","history:popstate","link:click","link:self","link:anchor","link:newtab","page:load","page:view","scroll:top","scroll:anchor","visit:start","visit:transition","visit:abort","visit:end"],this.swup=t,this.init()}init(){this.hooks.forEach(t=>this.create(t))}create(t){this.registry.has(t)||this.registry.set(t,new Map)}exists(t){return this.registry.has(t)}get(t){let n=this.registry.get(t);if(n)return n;console.error(`Unknown hook '${t}'`)}clear(){this.registry.forEach(t=>t.clear())}on(t,n,i={}){let r=this.get(t);if(!r)return console.warn(`Hook '${t}' not found.`),()=>{};let s=k({},i,{id:r.size+1,hook:t,handler:n});return r.set(n,s),()=>this.off(t,n)}before(t,n,i={}){return this.on(t,n,k({},i,{before:!0}))}replace(t,n,i={}){return this.on(t,n,k({},i,{replace:!0}))}once(t,n,i={}){return this.on(t,n,k({},i,{once:!0}))}off(t,n){let i=this.get(t);i&&n?i.delete(n)||console.warn(`Handler for hook '${t}' not found.`):i&&i.clear()}async call(t,n,i,r){let[s,o,a]=this.parseCallArgs(t,n,i,r),{before:c,handler:l,after:u}=this.getHandlers(t,a);await this.run(c,s,o);let[h]=await this.run(l,s,o,!0);return await this.run(u,s,o),this.dispatchDomEvent(t,s,o),h}callSync(t,n,i,r){let[s,o,a]=this.parseCallArgs(t,n,i,r),{before:c,handler:l,after:u}=this.getHandlers(t,a);this.runSync(c,s,o);let[h]=this.runSync(l,s,o,!0);return this.runSync(u,s,o),this.dispatchDomEvent(t,s,o),h}parseCallArgs(t,n,i,r){return n instanceof je||typeof n!="object"&&typeof i!="function"?[n,i,r]:[void 0,n,i]}async run(t,n=this.swup.visit,i,r=!1){let s=[];for(let{hook:o,handler:a,defaultHandler:c,once:l}of t)if(n==null||!n.done){l&&this.off(o,a);try{let u=await Uo(a,[n,i,c]);s.push(u)}catch(u){if(r)throw u;console.error(`Error in hook '${o}':`,u)}}return s}runSync(t,n=this.swup.visit,i,r=!1){let s=[];for(let{hook:o,handler:a,defaultHandler:c,once:l}of t)if(n==null||!n.done){l&&this.off(o,a);try{let u=a(n,i,c);s.push(u),Ai(u)&&console.warn(`Swup will not await Promises in handler for synchronous hook '${o}'.`)}catch(u){if(r)throw u;console.error(`Error in hook '${o}':`,u)}}return s}getHandlers(t,n){let i=this.get(t);if(!i)return{found:!1,before:[],handler:[],after:[],replaced:!1};let r=Array.from(i.values()),s=this.sortRegistrations,o=r.filter(({before:h,replace:f})=>h&&!f).sort(s),a=r.filter(({replace:h})=>h).filter(h=>!0).sort(s),c=r.filter(({before:h,replace:f})=>!h&&!f).sort(s),l=a.length>0,u=[];if(n&&(u=[{id:0,hook:t,handler:n}],l)){let h=a.length-1,{handler:f,once:y}=a[h],w=b=>{let g=a[b-1];return g?(m,x)=>g.handler(m,x,w(b-1)):n};u=[{id:0,hook:t,once:y,handler:f,defaultHandler:w(h)}]}return{found:!0,before:o,handler:u,after:c,replaced:l}}sortRegistrations(t,n){var i,r;return((i=t.priority)!=null?i:0)-((r=n.priority)!=null?r:0)||t.id-n.id||0}dispatchDomEvent(t,n,i){if(n!=null&&n.done)return;let r={hook:t,args:i,visit:n||this.swup.visit};document.dispatchEvent(new CustomEvent("swup:any",{detail:r,bubbles:!0})),document.dispatchEvent(new CustomEvent(`swup:${t}`,{detail:r,bubbles:!0}))}parseName(t){let[n,...i]=t.split(".");return[n,i.reduce((r,s)=>k({},r,{[s]:!0}),{})]}},Vo=e=>{if(e&&e.charAt(0)==="#"&&(e=e.substring(1)),!e)return null;let t=decodeURIComponent(e),n=document.getElementById(e)||document.getElementById(t)||Rt(`a[name='${CSS.escape(e)}']`)||Rt(`a[name='${CSS.escape(t)}']`);return n||e!=="top"||(n=document.body),n},qe="transition",_t="animation";async function jo({selector:e,elements:t}){if(e===!1&&!t)return;let n=[];if(t)n=Array.from(t);else if(e&&(n=Qt(e,document.body),!n.length))return void console.warn(`[swup] No elements found matching animationSelector \`${e}\``);let i=n.map(r=>function(s){let{type:o,timeout:a,propCount:c}=function(l){let u=window.getComputedStyle(l),h=Ve(u,`${qe}Delay`),f=Ve(u,`${qe}Duration`),y=Ti(h,f),w=Ve(u,`${_t}Delay`),b=Ve(u,`${_t}Duration`),g=Ti(w,b),m=Math.max(y,g),x=m>0?y>g?qe:_t:null;return{type:x,timeout:m,propCount:x?x===qe?f.length:b.length:0}}(s);return!(!o||!a)&&new Promise(l=>{let u=`${o}end`,h=performance.now(),f=0,y=()=>{s.removeEventListener(u,w),l()},w=b=>{b.target===s&&((performance.now()-h)/1e3=c&&y())};setTimeout(()=>{f0?await Promise.all(i):e&&console.warn(`[swup] No CSS animation duration defined on elements matching \`${e}\``)}function Ve(e,t){return(e[t]||"").split(", ")}function Ti(e,t){for(;e.lengthki(n)+ki(e[i])))}function ki(e){return 1e3*parseFloat(e)}function zo(e,t={},n={}){if(typeof e!="string")throw new Error("swup.navigate() requires a URL parameter");if(this.shouldIgnoreVisit(e,{el:n.el,event:n.event}))return void window.location.assign(e);let{url:i,hash:r}=O.fromUrl(e),s=this.createVisit(k({},n,{to:i,hash:r}));this.performNavigation(s,t)}async function Wo(e,t={}){if(this.navigating){if(this.visit.state>=6)return e.state=2,void(this.onVisitEnd=()=>this.performNavigation(e,t));await this.hooks.call("visit:abort",this.visit,void 0),delete this.visit.to.document,this.visit.state=8}this.navigating=!0,this.visit=e;let{el:n}=e.trigger;t.referrer=t.referrer||this.location.url,t.animate===!1&&(e.animation.animate=!1),e.animation.animate||this.classes.clear();let i=t.history||Li(n,"data-swup-history");typeof i=="string"&&["push","replace"].includes(i)&&(e.history.action=i);let r=t.animation||Li(n,"data-swup-animation");var s,o;typeof r=="string"&&(e.animation.name=r),e.meta=t.meta||{},typeof t.cache=="object"?(e.cache.read=(s=t.cache.read)!=null?s:e.cache.read,e.cache.write=(o=t.cache.write)!=null?o:e.cache.write):t.cache!==void 0&&(e.cache={read:!!t.cache,write:!!t.cache}),delete t.cache;try{await this.hooks.call("visit:start",e,void 0),e.state=3;let a=this.hooks.call("page:load",e,{options:t},async(l,u)=>{let h;return l.cache.read&&(h=this.cache.get(l.to.url)),u.page=h||await this.fetchPage(l.to.url,u.options),u.cache=!!h,u.page});a.then(({html:l})=>{e.advance(5),e.to.html=l,e.to.document=new DOMParser().parseFromString(l,"text/html")});let c=e.to.url+e.to.hash;if(e.history.popstate||(e.history.action==="replace"||e.to.url===this.location.url?me(c):(this.currentHistoryIndex++,Fo(c,{index:this.currentHistoryIndex}))),this.location=O.fromUrl(c),e.history.popstate&&this.classes.add("is-popstate"),e.animation.name&&this.classes.add(`to-${Oi(e.animation.name)}`),e.animation.wait&&await a,e.done||(await this.hooks.call("visit:transition",e,void 0,async()=>{if(!e.animation.animate)return await this.hooks.call("animation:skip",void 0),void await this.renderPage(e,await a);e.advance(4),await this.animatePageOut(e),e.animation.native&&document.startViewTransition?await document.startViewTransition(async()=>await this.renderPage(e,await a)).finished:await this.renderPage(e,await a),await this.animatePageIn(e)}),e.done))return;await this.hooks.call("visit:end",e,void 0,()=>this.classes.clear()),e.state=7,this.navigating=!1,this.onVisitEnd&&(this.onVisitEnd(),this.onVisitEnd=void 0)}catch(a){if(!a||a!=null&&a.aborted)return void(e.state=8);e.state=9,console.error(a),this.options.skipPopStateHandling=()=>(window.location.assign(e.to.url+e.to.hash),!0),window.history.back()}finally{delete e.to.document}}var Go=async function(e){await this.hooks.call("animation:out:start",e,void 0,()=>{this.classes.add("is-changing","is-animating","is-leaving")}),await this.hooks.call("animation:out:await",e,{skip:!1},(t,{skip:n})=>{if(!n)return this.awaitAnimations({selector:t.animation.selector})}),await this.hooks.call("animation:out:end",e,void 0)},Ko=function(e){var t;let n=e.to.document;if(!n)return!1;let i=((t=n.querySelector("title"))==null?void 0:t.innerText)||"";document.title=i;let r=Qt('[data-swup-persist]:not([data-swup-persist=""])'),s=e.containers.map(o=>{let a=document.querySelector(o),c=n.querySelector(o);return a&&c?(a.replaceWith(c.cloneNode(!0)),!0):(a||console.warn(`[swup] Container missing in current document: ${o}`),c||console.warn(`[swup] Container missing in incoming document: ${o}`),!1)}).filter(Boolean);return r.forEach(o=>{let a=o.getAttribute("data-swup-persist"),c=Rt(`[data-swup-persist="${a}"]`);c&&c!==o&&c.replaceWith(o)}),s.length===e.containers.length},Yo=function(e){let t={behavior:"auto"},{target:n,reset:i}=e.scroll,r=n??e.to.hash,s=!1;return r&&(s=this.hooks.callSync("scroll:anchor",e,{hash:r,options:t},(o,{hash:a,options:c})=>{let l=this.getAnchorElement(a);return l&&l.scrollIntoView(c),!!l})),i&&!s&&(s=this.hooks.callSync("scroll:top",e,{options:t},(o,{options:a})=>(window.scrollTo(k({top:0,left:0},a)),!0))),s},Jo=async function(e){if(e.done)return;let t=this.hooks.call("animation:in:await",e,{skip:!1},(n,{skip:i})=>{if(!i)return this.awaitAnimations({selector:n.animation.selector})});await Ci(),await this.hooks.call("animation:in:start",e,void 0,()=>{this.classes.remove("is-animating")}),await t,await this.hooks.call("animation:in:end",e,void 0)},Xo=async function(e,t){if(e.done)return;e.advance(6);let{url:n}=t;this.isSameResolvedUrl(ge(),n)||(me(n),this.location=O.fromUrl(n),e.to.url=this.location.url,e.to.hash=this.location.hash),await this.hooks.call("content:replace",e,{page:t},(i,{})=>{if(this.classes.remove("is-leaving"),i.animation.animate&&this.classes.add("is-rendering"),!this.replaceContent(i))throw new Error("[swup] Container mismatch, aborting");i.animation.animate&&(this.classes.add("is-changing","is-animating","is-rendering"),i.animation.name&&this.classes.add(`to-${Oi(i.animation.name)}`))}),await this.hooks.call("content:scroll",e,void 0,()=>this.scrollToContent(e)),await this.hooks.call("page:view",e,{url:this.location.url,title:document.title})},Zo=function(e){var t;if(t=e,Boolean(t?.isSwupPlugin)){if(e.swup=this,!e._checkRequirements||e._checkRequirements())return e._beforeMount&&e._beforeMount(),e.mount(),this.plugins.push(e),this.plugins}else console.error("Not a swup plugin instance",e)};function ea(e){let t=this.findPlugin(e);if(t)return t.unmount(),t._afterUnmount&&t._afterUnmount(),this.plugins=this.plugins.filter(n=>n!==t),this.plugins;console.error("No such plugin",t)}function ta(e){return this.plugins.find(t=>t===e||t.name===e||t.name===`Swup${String(e)}`)}function na(e){if(typeof this.options.resolveUrl!="function")return console.warn("[swup] options.resolveUrl expects a callback function."),e;let t=this.options.resolveUrl(e);return t&&typeof t=="string"?t.startsWith("//")||t.startsWith("http")?(console.warn("[swup] options.resolveUrl needs to return a relative url"),e):t:(console.warn("[swup] options.resolveUrl needs to return a url"),e)}function ia(e,t){return this.resolveUrl(e)===this.resolveUrl(t)}var ra={animateHistoryBrowsing:!1,animationSelector:'[class*="transition-"]',animationScope:"html",cache:!0,containers:["#swup"],hooks:{},ignoreVisit:(e,{el:t}={})=>!(t==null||!t.closest("[data-no-swup]")),linkSelector:"a[href]",linkToSelf:"scroll",native:!1,plugins:[],resolveUrl:e=>e,requestHeaders:{"X-Requested-With":"swup",Accept:"text/html, application/xhtml+xml"},skipPopStateHandling:e=>{var t;return((t=e.state)==null?void 0:t.source)!=="swup"},timeout:0},ze=class{get currentPageUrl(){return this.location.url}constructor(t={}){var n,i;this.version="4.8.1",this.options=void 0,this.defaults=ra,this.plugins=[],this.visit=void 0,this.cache=void 0,this.hooks=void 0,this.classes=void 0,this.location=O.fromUrl(window.location.href),this.currentHistoryIndex=void 0,this.clickDelegate=void 0,this.navigating=!1,this.onVisitEnd=void 0,this.use=Zo,this.unuse=ea,this.findPlugin=ta,this.log=()=>{},this.navigate=zo,this.performNavigation=Wo,this.createVisit=qo,this.delegateEvent=Bo,this.fetchPage=$o,this.awaitAnimations=jo,this.renderPage=Xo,this.replaceContent=Ko,this.animatePageIn=Jo,this.animatePageOut=Go,this.scrollToContent=Yo,this.getAnchorElement=Vo,this.getCurrentUrl=ge,this.resolveUrl=na,this.isSameResolvedUrl=ia,this.options=k({},this.defaults,t),this.handleLinkClick=this.handleLinkClick.bind(this),this.handlePopState=this.handlePopState.bind(this),this.cache=new Pt(this),this.classes=new Nt(this),this.hooks=new Ht(this),this.visit=this.createVisit({to:""}),this.currentHistoryIndex=(n=(i=window.history.state)==null?void 0:i.index)!=null?n:1,this.enable()}async enable(){var t;let{linkSelector:n}=this.options;this.clickDelegate=this.delegateEvent(n,"click",this.handleLinkClick),window.addEventListener("popstate",this.handlePopState),this.options.animateHistoryBrowsing&&(window.history.scrollRestoration="manual"),this.options.native=this.options.native&&!!document.startViewTransition,this.options.plugins.forEach(i=>this.use(i));for(let[i,r]of Object.entries(this.options.hooks)){let[s,o]=this.hooks.parseName(i);this.hooks.on(s,r,o)}((t=window.history.state)==null?void 0:t.source)!=="swup"&&me(null,{index:this.currentHistoryIndex}),await Ci(),await this.hooks.call("enable",void 0,void 0,()=>{let i=document.documentElement;i.classList.add("swup-enabled"),i.classList.toggle("swup-native",this.options.native)})}async destroy(){this.clickDelegate.destroy(),window.removeEventListener("popstate",this.handlePopState),this.cache.clear(),this.options.plugins.forEach(t=>this.unuse(t)),await this.hooks.call("disable",void 0,void 0,()=>{let t=document.documentElement;t.classList.remove("swup-enabled"),t.classList.remove("swup-native")}),this.hooks.clear()}shouldIgnoreVisit(t,{el:n,event:i}={}){let{origin:r,url:s,hash:o}=O.fromUrl(t);return r!==window.location.origin||!(!n||!this.triggerWillOpenNewWindow(n))||!!this.options.ignoreVisit(s+o,{el:n,event:i})}handleLinkClick(t){let n=t.delegateTarget,{href:i,url:r,hash:s}=O.fromElement(n);if(this.shouldIgnoreVisit(i,{el:n,event:t}))return;if(this.navigating&&r===this.visit.to.url)return void t.preventDefault();let o=this.createVisit({to:r,hash:s,el:n,event:t});t.metaKey||t.ctrlKey||t.shiftKey||t.altKey?this.hooks.callSync("link:newtab",o,{href:i}):t.button===0&&this.hooks.callSync("link:click",o,{el:n,event:t},()=>{var a;let c=(a=o.from.url)!=null?a:"";t.preventDefault(),r&&r!==c?this.isSameResolvedUrl(r,c)||this.performNavigation(o):s?this.hooks.callSync("link:anchor",o,{hash:s},()=>{me(r+s),this.scrollToContent(o)}):this.hooks.callSync("link:self",o,void 0,()=>{this.options.linkToSelf==="navigate"?this.performNavigation(o):(me(r),this.scrollToContent(o))})})}handlePopState(t){var n,i,r,s;let o=(n=(i=t.state)==null?void 0:i.url)!=null?n:window.location.href;if(this.options.skipPopStateHandling(t)||this.isSameResolvedUrl(ge(),this.location.url))return;let{url:a,hash:c}=O.fromUrl(o),l=this.createVisit({to:a,hash:c,event:t});l.history.popstate=!0;let u=(r=(s=t.state)==null?void 0:s.index)!=null?r:0;u&&u!==this.currentHistoryIndex&&(l.history.direction=u-this.currentHistoryIndex>0?"forwards":"backwards",this.currentHistoryIndex=u),l.animation.animate=!1,l.scroll.reset=!1,l.scroll.target=!1,this.options.animateHistoryBrowsing&&(l.animation.animate=!0,l.scroll.reset=!0),this.hooks.callSync("history:popstate",l,{event:t},()=>{this.performNavigation(l)})}triggerWillOpenNewWindow(t){return!!t.matches('[download], [target="_blank"]')}};function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;tString(e).split(".").map(t=>String(parseInt(t||"0",10))).concat(["0","0"]).slice(0,3).join("."),We=class{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t=>t()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return typeof this.requires!="object"||Object.entries(this.requires).forEach(([t,n])=>{if(!function(i,r,s){let o=function(a,c){var l;if(a==="swup")return(l=c.version)!=null?l:"";{var u;let h=c.findPlugin(a);return(u=h?.version)!=null?u:""}}(i,s);return!!o&&((a,c)=>c.every(l=>{let[,u,h]=l.match(/^([\D]+)?(.*)$/)||[];var f,y;return((w,b)=>{let g={"":m=>m===0,">":m=>m>0,">=":m=>m>=0,"<":m=>m<0,"<=":m=>m<=0};return(g[b]||g[""])(w)})((y=h,f=Ii(f=a),y=Ii(y),f.localeCompare(y,void 0,{numeric:!0})),u||">=")}))(o,r)}(t,n=Array.isArray(n)?n:[n],this.swup)){let i=`${t} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${i}`)}}),!0}on(t,n,i={}){var r;n=!(r=n).name.startsWith("bound ")||r.hasOwnProperty("prototype")?n.bind(this):n;let s=this.swup.hooks.on(t,n,i);return this.handlersToUnregister.push(s),s}once(t,n,i={}){return this.on(t,n,ve({},i,{once:!0}))}before(t,n,i={}){return this.on(t,n,ve({},i,{before:!0}))}replace(t,n,i={}){return this.on(t,n,ve({},i,{replace:!0}))}off(t,n){return this.swup.hooks.off(t,n)}};(function(){if(!(typeof window>"u"||typeof document>"u"||typeof HTMLElement>"u")){var e=!1;try{var t=document.createElement("div");t.addEventListener("focus",function(s){s.preventDefault(),s.stopPropagation()},!0),t.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&typeof navigator.userAgent<"u"&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return e=!1;e=!0}}))}catch{}if(HTMLElement.prototype.nativeFocus===void 0&&!e){HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus;var n=function(s){for(var o=s.parentNode,a=[],c=document.scrollingElement||document.documentElement;o&&o!==c;)(o.offsetHeightn.replace(`{${i}}`,t[i]||""),e||"")}var Dt=class{constructor(){var t;this.id="swup-announcer",this.style="position:absolute;top:0;left:0;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;white-space:nowrap;word-wrap:normal;width:1px;height:1px;",this.region=void 0,this.region=(t=this.getRegion())!=null?t:this.createRegion()}getRegion(){return document.getElementById(this.id)}createRegion(){let t=function(n){let i=document.createElement("template");return i.innerHTML=n,i.content.children[0]}(`

`);return document.body.appendChild(t),t}announce(t,n=0){return new Promise(i=>{setTimeout(()=>{this.region.textContent===t&&(t=`${t}.`),this.region.textContent="",this.region.textContent=t,i()},n)})}};function Pi(e){let t;if(t=typeof e=="string"?document.querySelector(e):e,!(t instanceof HTMLElement))return;let n=t.getAttribute("tabindex");t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0}),n!==null&&t.setAttribute("tabindex",n)}var Ge=class extends We{constructor(t={}){super(),this.name="SwupA11yPlugin",this.requires={swup:">=4"},this.defaults={headingSelector:"h1",respectReducedMotion:!0,autofocus:!1,announcements:{visit:"Navigated to: {title}",url:"New page at {url}"}},this.options=void 0,this.announcer=void 0,this.announcementDelay=100,this.rootSelector="body",this.handleAnchorScroll=(n,{hash:i})=>{let r=this.swup.getAnchorElement(i);r instanceof HTMLElement&&Pi(r)},this.options=Mt({},this.defaults,t),this.announcer=new Dt}mount(){this.swup.hooks.create("content:announce"),this.swup.hooks.create("content:focus"),this.before("visit:start",this.prepareVisit),this.on("visit:start",this.markAsBusy),this.on("visit:end",this.unmarkAsBusy),this.on("visit:end",this.focusContent),this.on("visit:end",this.announceContent),this.on("scroll:anchor",this.handleAnchorScroll),this.before("visit:start",this.disableAnimations),this.before("link:self",this.disableAnimations),this.before("link:anchor",this.disableAnimations),this.swup.announce=this.announce.bind(this)}unmount(){this.swup.announce=void 0}async announce(t){await this.announcer.announce(t)}markAsBusy(){document.documentElement.setAttribute("aria-busy","true")}unmarkAsBusy(){document.documentElement.removeAttribute("aria-busy")}prepareVisit(t){t.a11y={announce:void 0,focus:this.rootSelector}}announceContent(t){this.swup.hooks.callSync("content:announce",t,void 0,n=>{n.a11y.announce===void 0&&(n.a11y.announce=this.getPageAnnouncement()),n.a11y.announce&&this.announcer.announce(n.a11y.announce,this.announcementDelay)})}focusContent(t){this.swup.hooks.callSync("content:focus",t,void 0,n=>{n.a11y.focus&&(this.options.autofocus&&function(){let i=function(){let r=document.querySelector("body [autofocus]");if(r&&!r.closest('[inert], [aria-disabled], [aria-hidden="true"]'))return r}();return!!i&&(i!==document.activeElement&&i.focus(),!0)}()===!0||Pi(n.a11y.focus))})}getPageAnnouncement(){let{headingSelector:t,announcements:n}=this.options;return function({headingSelector:i="h1",announcements:r={}}){var s,o;let a=document.documentElement.lang||"*",{href:c,url:l,pathname:u}=O.fromUrl(window.location.href),h=(s=(o=r[a])!=null?o:r["*"])!=null?s:r;if(typeof h!="object")return;let f=document.querySelector(i);f||console.warn(`SwupA11yPlugin: No main heading (${i}) found on new page`);let y=f?.getAttribute("aria-label")||f?.textContent||document.title||_i(h.url,{href:c,url:l,path:u});return _i(h.visit,{title:y,href:c,url:l,path:u})}({headingSelector:t,announcements:n})}disableAnimations(t){this.options.respectReducedMotion&&window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(t.animation.animate=!1,t.scroll.animate=!1)}};zt(()=>{let e=new URLSearchParams(window.location.search),t=e.has("preview");Kt(),xn(e.get("theme")),Xt(t),zn(),gi(),wi(),bi(),Si(),t?xi():(window.location.protocol!=="file:"&&new ze({animationSelector:!1,containers:["#main"],ignoreVisit:n=>{let i=n.split("#")[0];return i===window.location.pathname||i===window.location.pathname+".html"},hooks:{"page:view":()=>{it(),yt()}},linkSelector:'a[href]:not([href^="/"]):not([href^="http"])',plugins:[new Ge]}),Mn(),an(),it(),Rn(),Gn(),oi(),ti(),Sn(),yt(),si())});})(); -/*! Bundled license information: - -lunr/lunr.js: - (** - * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 - * Copyright (C) 2020 Oliver Nightingale - * @license MIT - *) - (*! - * lunr.utils - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.Set - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.tokenizer - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.Pipeline - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.Vector - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.stemmer - * Copyright (C) 2020 Oliver Nightingale - * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt - *) - (*! - * lunr.stopWordFilter - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.trimmer - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.TokenSet - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.Index - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.Builder - * Copyright (C) 2020 Oliver Nightingale - *) -*/ diff --git a/lib/ex_doc/formatter/html/templates/head_template.eex b/lib/ex_doc/formatter/html/templates/head_template.eex index a62b7e688..48e8e9be0 100644 --- a/lib/ex_doc/formatter/html/templates/head_template.eex +++ b/lib/ex_doc/formatter/html/templates/head_template.eex @@ -24,7 +24,7 @@ <%= before_closing_head_tag(config, :html) %> - +