From 238f179daab730f41b01efaef61ce8d236b31e3e Mon Sep 17 00:00:00 2001 From: paulo-valim Date: Mon, 18 Sep 2023 10:04:33 +0200 Subject: [PATCH] WIP --- assets/js/content.js | 18 ++++++++---------- .../{html-XGJZHHAY.js => html-GGSI4AXI.js} | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) rename formatters/html/dist/{html-XGJZHHAY.js => html-GGSI4AXI.js} (56%) diff --git a/assets/js/content.js b/assets/js/content.js index 17123cdc0..54ff6ac1d 100644 --- a/assets/js/content.js +++ b/assets/js/content.js @@ -83,23 +83,21 @@ function getLivebookImportUrl (livebookUrl, notebookUrl) { } // Check if the device width is below a certain threshold (e.g., 768px for mobile) -if (window.innerWidth <= 768) { - document.querySelectorAll('a[href^="#"]').forEach(anchor => { - anchor.addEventListener('click', function (e) { +document.addEventListener('click', function (e) { + if (window.innerWidth <= 768) { + const target = e.target.closest('a[href^="#"]') + if (target) { e.preventDefault() - - const targetId = this.getAttribute('href').substring(1) + const targetId = target.getAttribute('href').substring(1) const targetElement = document.getElementById(targetId) - if (targetElement) { const offset = 45 // Adjust this offset as needed const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - offset - window.scrollTo({ top: targetPosition, behavior: 'smooth' }) } - }) - }) -} + } + } +}) diff --git a/formatters/html/dist/html-XGJZHHAY.js b/formatters/html/dist/html-GGSI4AXI.js similarity index 56% rename from formatters/html/dist/html-XGJZHHAY.js rename to formatters/html/dist/html-GGSI4AXI.js index db6ef2d6a..1f801352c 100644 --- a/formatters/html/dist/html-XGJZHHAY.js +++ b/formatters/html/dist/html-GGSI4AXI.js @@ -1,5 +1,5 @@ (()=>{var Mn=Object.create;var st=Object.defineProperty;var Bn=Object.getOwnPropertyDescriptor;var qn=Object.getOwnPropertyNames;var zn=Object.getPrototypeOf,$n=Object.prototype.hasOwnProperty;var ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Vn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qn(t))!$n.call(e,i)&&i!==n&&st(e,i,{get:()=>t[i],enumerable:!(r=Bn(t,i))||r.enumerable});return e};var at=(e,t,n)=>(n=e!=null?Mn(zn(e)):{},Vn(t||!e||!e.__esModule?st(n,"default",{value:e,enumerable:!0}):n,e));var xt=ot((Bs,St)=>{var bt="Expected a function",yt=NaN,er="[object Symbol]",tr=/^\s+|\s+$/g,nr=/^[-+]0x[0-9a-f]+$/i,rr=/^0b[01]+$/i,ir=/^0o[0-7]+$/i,sr=parseInt,or=typeof global=="object"&&global&&global.Object===Object&&global,ar=typeof self=="object"&&self&&self.Object===Object&&self,cr=or||ar||Function("return this")(),lr=Object.prototype,ur=lr.toString,dr=Math.max,fr=Math.min,Ae=function(){return cr.Date.now()};function hr(e,t,n){var r,i,s,o,a,l,u=0,f=!1,y=!1,g=!0;if(typeof e!="function")throw new TypeError(bt);t=vt(t)||0,ge(n)&&(f=!!n.leading,y="maxWait"in n,s=y?dr(vt(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g);function L(S){var C=r,D=i;return r=i=void 0,u=S,o=e.apply(D,C),o}function b(S){return u=S,a=setTimeout(p,t),f?L(S):o}function T(S){var C=S-l,D=S-u,V=t-C;return y?fr(V,s-D):V}function m(S){var C=S-l,D=S-u;return l===void 0||C>=t||C<0||y&&D>=s}function p(){var S=Ae();if(m(S))return _(S);a=setTimeout(p,T(S))}function _(S){return a=void 0,g&&r?L(S):(r=i=void 0,o)}function w(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function N(){return a===void 0?o:_(Ae())}function H(){var S=Ae(),C=m(S);if(r=arguments,i=this,l=S,C){if(a===void 0)return b(l);if(y)return a=setTimeout(p,t),L(l)}return a===void 0&&(a=setTimeout(p,t)),o}return H.cancel=w,H.flush=N,H}function pr(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(bt);return ge(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),hr(e,t,{leading:r,maxWait:t,trailing:i})}function ge(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function mr(e){return!!e&&typeof e=="object"}function gr(e){return typeof e=="symbol"||mr(e)&&ur.call(e)==er}function vt(e){if(typeof e=="number")return e;if(gr(e))return yt;if(ge(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ge(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(tr,"");var n=rr.test(e);return n||ir.test(e)?sr(e.slice(2),n?2:8):nr.test(e)?yt:+e}St.exports=pr});var Ut=ot((Vt,jt)=>{(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),r=Object.keys(t),i=0;i0){var f=e.utils.clone(n)||{};f.position=[a,u],f.index=s.length,s.push(new e.Token(r.slice(a,o),f))}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(r){var i=e.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),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 r=this._stack.indexOf(t);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},e.Pipeline.prototype.before=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(t);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,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,r=0;r1&&(ot&&(r=s),o!=t);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==t||o>t)return s*2;if(ol?f+=2:a==l&&(n+=r[u+1]*i[f+1],u+=2,f+=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,r=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),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.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 u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var f=s.str.charAt(0),y=s.str.charAt(1),g;y in s.node.edges?g=s.node.edges[y]:(g=new e.TokenSet,s.node.edges[y]=g),s.str.length==1&&(g.final=!0),i.push({node:g,editsRemaining:s.editsRemaining-1,str:f+s.str.slice(2)})}}}return r},e.TokenSet.fromString=function(t){for(var n=new e.TokenSet,r=n,i=0,s=t.length;i=t;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.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 r=new e.QueryParser(t,n);r.parse()})},e.Index.prototype.query=function(t){for(var n=new e.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=t},e.Builder.prototype.k1=function(t){this._k1=t},e.Builder.prototype.add=function(t,n){var r=t[this._ref],i=Object.keys(this._fields);this._documents[r]=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 r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new e.QueryParseError(r,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 r="unrecognised presence operator'"+n.str+"'";throw new e.QueryParseError(r,n.start,n.end)}var i=t.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new e.QueryParseError(r,n.start,n.end)}switch(i.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new e.QueryParseError(r,i.start,i.end)}}},e.QueryParser.parseField=function(t){var n=t.consumeLexeme();if(n!=null){if(t.query.allFields.indexOf(n.str)==-1){var r=t.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.fields=[n.str];var s=t.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new e.QueryParseError(i,n.start,n.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new e.QueryParseError(i,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 r=t.peekLexeme();if(r==null){t.nextClause();return}switch(r.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 i="Unexpected lexeme type '"+r.type+"'";throw new e.QueryParseError(i,r.start,r.end)}}},e.QueryParser.parseEditDistance=function(t){var n=t.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.editDistance=r;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 i="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(i,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var n=t.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.boost=r;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 i="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(i,s.start,s.end)}}},function(t,n){typeof define=="function"&&define.amd?define(n):typeof Vt=="object"?jt.exports=n():t.lunr=n()}(this,function(){return e})})()});Handlebars.registerHelper("groupChanged",function(e,t,n){let r=t||"";if(e.group!==r)return delete e.nestedContext,e.group=r,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 e+".html"===n?t.fn(this):t.inverse(this)});var c=document.querySelector.bind(document),k=document.querySelectorAll.bind(document);function ct(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function he(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function z(){return document.body.dataset.type}function lt(e,t){if(e){for(let n of e){let r=n.nodeGroups&&n.nodeGroups.find(i=>i.nodes.some(s=>s.anchor===t));if(r)return r.key}return null}}function pe(){return window.location.hash.replace(/^#/,"")}function ut(e){return new URLSearchParams(window.location.search).get(e)}function dt(e){return fetch(e).then(t=>t.ok).catch(()=>!1)}function ft(e){document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)}function Z(e){return!e||e.trim()===""}function ht(e,t){let n;return function(...i){clearTimeout(n),n=setTimeout(()=>{n=null,e(...i)},t)}}function me(){return document.head.querySelector("meta[name=project][content]").content}var pt="ex_doc:settings",jn={tooltips:!0,theme:null,livebookUrl:null},Ce=class{constructor(){this._subscribers=[],this._settings=jn,this._loadSettings()}get(){return this._settings}update(t){let n=this._settings;this._settings={...this._settings,...t},this._subscribers.forEach(r=>r(this._settings,n)),this._storeSettings()}getAndSubscribe(t){this._subscribers.push(t),t(this._settings)}_loadSettings(){try{let t=localStorage.getItem(pt);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(pt,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 Ce;var Un=".content",mt=".content-inner",Wn=".livebook-badge";function gt(){Gn(),Yn(),Jn(),Kn()}function Gn(){c(Un).querySelectorAll("a").forEach(e=>{e.querySelector("code, img")&&e.classList.add("no-underline")})}function Kn(){["warning","info","error","neutral","tip"].forEach(t=>{k(`blockquote h3.${t}, blockquote h4.${t}`).forEach(n=>{n.closest("blockquote").classList.add(t)})})}function Yn(){c(mt).setAttribute("tabindex",-1),c(mt).focus()}function Jn(){let t=window.location.pathname.replace(/(\.html)?$/,".livemd"),n=new URL(t,window.location.href).toString();I.getAndSubscribe(r=>{let i=r.livebookUrl?Zn(r.livebookUrl,n):Xn(n);for(let s of k(Wn))s.href=i})}function Xn(e){return`https://livebook.dev/run?url=${encodeURIComponent(e)}`}function Zn(e,t){return`${e}/import?url=${encodeURIComponent(t)}`}window.innerWidth<=768&&document.querySelectorAll('a[href^="#"]').forEach(e=>{e.addEventListener("click",function(t){t.preventDefault();let n=this.getAttribute("href").substring(1),r=document.getElementById(n);if(r){let s=r.getBoundingClientRect().top+window.scrollY-45;window.scrollTo({top:s,behavior:"smooth"})}})});var Et=at(xt());var yr=768,Lt=300,se=".sidebar-toggle",vr=".content",F={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"},br=Object.values(Q),A={togglingTimeout:null,lastWindowWidth:window.innerWidth,sidebarPreference:F.NO_PREF};function Tt(){wt(),Sr()}function wt(){sessionStorage.getItem("sidebar_state")==="closed"||kt()?($(Q.closed),c(se).setAttribute("aria-expanded","false")):($(Q.opened),c(se).setAttribute("aria-expanded","true"))}function kt(){return window.matchMedia(`screen and (max-width: ${yr}px)`).matches}function $(...e){document.body.classList.remove(...br),document.body.classList.add(...e)}function Sr(){c(se).addEventListener("click",e=>{Pe(),Lr()}),c(vr).addEventListener("click",e=>{Er()}),window.addEventListener("resize",(0,Et.default)(e=>{xr()},100))}function Pe(){return Re()?_t():Ne()}function Re(){return document.body.classList.contains(Q.opened)||document.body.classList.contains(Q.opening)}function Ne(){It(),sessionStorage.setItem("sidebar_state","opened"),c(se).setAttribute("aria-expanded","true"),requestAnimationFrame(()=>{$(Q.openingStart),requestAnimationFrame(()=>($(Q.opening),new Promise((e,t)=>{A.togglingTimeout=setTimeout(()=>{$(Q.opened),e()},Lt)})))})}function _t(){It(),sessionStorage.setItem("sidebar_state","closed"),c(se).setAttribute("aria-expanded","false"),requestAnimationFrame(()=>{$(Q.closingStart),requestAnimationFrame(()=>($(Q.closing),new Promise((e,t)=>{A.togglingTimeout=setTimeout(()=>{$(Q.closed),e()},Lt)})))})}function It(){A.togglingTimeout&&(clearTimeout(A.togglingTimeout),A.togglingTimeout=null)}function xr(){A.lastWindowWidth!==window.innerWidth&&(A.lastWindowWidth=window.innerWidth,(A.sidebarPreference===F.OPEN||A.sidebarPreference===F.NO_PREF)&&wt())}function Er(){kt()&&Re()&&_t()}function Lr(){switch(A.sidebarPreference){case F.OPEN:A.sidebarPreference=F.CLOSED;break;case F.CLOSED:A.sidebarPreference=F.OPEN;break;case F.NO_PREF:Re()?A.sidebarPreference=F.OPEN:A.sidebarPreference=F.CLOSED}}function oe(){return window.sidebarNodes||{}}function Ot(){return window.versionNodes||[]}var Qe={search:"search",extras:"extras",modules:"modules",tasks:"tasks"},He=[Qe.extras,Qe.modules,Qe.tasks],ve=e=>`#${e}-full-list`;function Ct(){He.forEach(e=>{Tr(oe(),e)}),ye(z()),Pt(),At(),Ar()}function Tr(e,t){let n=e[t]||[],r=c(ve(t));if(!r)return;let i=Handlebars.templates["sidebar-items"]({nodes:n,group:""});r.innerHTML=i,r.querySelectorAll("ul").forEach(s=>{if(s.innerHTML.trim()===""){let o=s.previousElementSibling;o.classList.contains("expand")&&o.classList.remove("expand"),s.remove()}}),r.querySelectorAll("li a + button").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.closest("li");kr(l)})}),r.querySelectorAll("li a").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.closest("li"),u=r.querySelector(".current-section");u&&Ir(u),s.matches(".expand")&&s.pathname===window.location.pathname&&De(l)})})}function De(e){e.classList.add("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","true")}function wr(e){e.classList.remove("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","false")}function kr(e){e.classList.contains("open")?wr(e):De(e)}function _r(e){e.classList.add("current-section"),e.querySelector("a").setAttribute("aria-current","true")}function Ir(e){e.classList.remove("current-section"),e.querySelector("a").setAttribute("aria-current","false")}function Or(e){e.classList.add("current-hash"),e.querySelector("a").setAttribute("aria-current","true")}function Cr(e){e.classList.remove("current-hash"),e.querySelector("a").setAttribute("aria-current","false")}function ye(e){He.forEach(t=>{let n=c(`#${t}-list-tab-button`);if(n){let r=c(`#${n.getAttribute("aria-controls")}`);t===e?(n.parentElement.classList.add("selected"),n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0"),r.removeAttribute("hidden")):(n.parentElement.classList.remove("selected"),n.setAttribute("aria-selected","false"),n.setAttribute("tabindex","-1"),r.setAttribute("hidden","hidden"))}})}function At(){let e=c(ve(z())),t=e.querySelector("li.current-page");t&&(t.scrollIntoView(),e.scrollTop-=40)}function Pt(){let e=pe()||"content",n=oe()[z()]||[],r=lt(n,e),i=c(ve(z())),s=i.querySelector(`li.current-page a.expand[href$="#${r}"]`);s&&De(s.closest("li"));let o=i.querySelector(`li.current-page a[href$="#${e}"]`);if(o){let a=o.closest("ul");a.classList.contains("deflist")&&_r(a.closest("li")),Or(o.closest("li"))}}function Ar(){He.forEach(t=>{let n=c(`#${t}-list-tab-button`);n&&n.addEventListener("click",r=>{ye(t),At()})});let e=c("#sidebar-listNav");e.addEventListener("keydown",t=>{if(t.key!=="ArrowRight"&&t.key!=="ArrowLeft")return;let n=Array.from(e.querySelectorAll('[role="tab"]')).map(i=>i.dataset.type),r=e.querySelector('[role="tab"][aria-selected="true"]').dataset.type;if(t.key==="ArrowRight"){let i=n.indexOf(r)+1;i>=n.length&&(i=0);let s=n[i];ye(s),c(`#${s}-list-tab-button`).focus()}else if(t.key==="ArrowLeft"){let i=n.indexOf(r)-1;i<0&&(i=n.length-1);let s=n[i];ye(s),c(`#${s}-list-tab-button`).focus()}}),window.addEventListener("hashchange",t=>{let r=c(ve(z())).querySelector("li.current-page li.current-hash");r&&Cr(r),Pt()})}var M={module:"module",moduleChild:"module-child",mixTask:"mix-task",extra:"extra",section:"section"};function Nt(e,t=5){if(Z(e))return[];let n=oe(),r=[...Fe(n.modules,e,M.module),...Pr(n.modules,e,M.moduleChild),...Fe(n.tasks,e,M.mixTask),...Fe(n.extras,e,M.extra),...Me(n.modules,e,M.section),...Me(n.tasks,e,M.section),...Me(n.extras,e,M.section)].filter(i=>i!==null);return Mr(r).slice(0,t)}function Fe(e,t,n){return e.map(r=>Nr(r,t,n))}function Pr(e,t,n){return e.filter(r=>r.nodeGroups).flatMap(r=>r.nodeGroups.flatMap(({key:i,nodes:s})=>{let o=Fr(i);return s.map(a=>Qr(a,r.id,t,n,o)||Dr(a,r.id,t,n,o))}))}function Me(e,t,n){return e.flatMap(r=>Rr(r).map(i=>Hr(r,i,t,n)))}function Rr(e){return(e.sections||[]).concat(e.headers||[])}function Nr(e,t,n){return Be(e.title,t)?{link:`${e.id}.html`,title:Ee(e.title,t),label:null,description:null,matchQuality:Se(e.title,t),deprecated:e.deprecated,category:n}:null}function Qr(e,t,n,r,i){return Be(e.id,n)?{link:`${t}.html#${e.anchor}`,title:Ee(e.id,n),label:i,description:t,matchQuality:Se(e.id,n),deprecated:e.deprecated,category:r}:null}function Hr(e,t,n,r){return Qt(t.id,n)?{link:`${e.id}.html#${t.anchor}`,title:Ee(t.id,n),label:null,description:e.title,matchQuality:Se(t.id,n),category:r}:null}function Dr(e,t,n,r,i){let s=`${t}.${e.id}`;if(!Be(s,n))return null;let o=n.replace(/\./g," ");return Qt(e.id,o)?{link:`${t}.html#${e.anchor}`,title:Ee(e.id,o),label:i,description:t,matchQuality:Se(s,n),deprecated:e.deprecated,category:r}:null}function Fr(e){switch(e){case"callbacks":return"callback";case"types":return"type";default:return null}}function Mr(e){return e.slice().sort((t,n)=>t.matchQuality!==n.matchQuality?n.matchQuality-t.matchQuality:Rt(t.category)-Rt(n.category))}function Rt(e){switch(e){case M.module:return 1;case M.moduleChild:return 2;case M.mixTask:return 3;default:return 4}}function Qt(e,t){return xe(t).some(r=>Ht(e,r))}function Be(e,t){return xe(t).every(r=>Ht(e,r))}function Ht(e,t){return e.toLowerCase().includes(t.toLowerCase())}function Se(e,t){let n=xe(t),i=n.map(o=>o.length).reduce((o,a)=>o+a,0)/e.length,s=Br(e,n[0])?1:0;return i+s}function Br(e,t){return e.toLowerCase().startsWith(t.toLowerCase())}function xe(e){return e.trim().split(/\s+/)}function Ee(e,t){let n=xe(t).sort((r,i)=>i.length-r.length);return be(e,n)}function be(e,t){if(t.length===0)return e;let[n,...r]=t,i=e.match(new RegExp(`(.*)(${ct(n)})(.*)`,"i"));if(i){let[,s,o,a]=i;return be(s,t)+""+he(o)+""+be(a,t)}else return be(e,r)}var ee=".autocomplete",Le=".autocomplete-suggestion",B={autocompleteSuggestions:[],selectedIdx:-1};function qr(){c(ee).classList.add("shown")}function qe(){c(ee).classList.remove("shown")}function Dt(){return c(ee).classList.contains("shown")}function ze(e){B.autocompleteSuggestions=Nt(e),B.selectedIdx=-1,Z(e)?qe():(zr({term:e,suggestions:B.autocompleteSuggestions}),Te(0),qr())}function zr({term:e,suggestions:t}){let n=Handlebars.templates["autocomplete-suggestions"]({suggestions:t,term:e}),r=c(ee);r.innerHTML=n}function Ft(){return B.selectedIdx===-1?null:B.autocompleteSuggestions[B.selectedIdx]}function Te(e){B.selectedIdx=$r(e);let t=c(`${Le}.selected`),n=c(`${Le}[data-index="${B.selectedIdx}"]`);t&&t.classList.remove("selected"),n&&n.classList.add("selected")}function $r(e){let t=B.autocompleteSuggestions.length+1;return(B.selectedIdx+e+1+t)%t-1}var ae="form.sidebar-search input",Vr="form.sidebar-search .search-close-button";function Mt(){jr()}function Bt(e){let t=c(ae);t.value=e}function qt(){c(ae).focus()}function jr(){let e=c(ae);e.addEventListener("keydown",t=>{t.key==="Escape"?(we(),e.blur()):t.key==="Enter"?Ur(t):t.key==="ArrowUp"?(Te(-1),t.preventDefault()):t.key==="ArrowDown"&&(Te(1),t.preventDefault())}),e.addEventListener("input",t=>{ze(t.target.value)}),e.addEventListener("focus",t=>{document.body.classList.add("search-focused"),ze(t.target.value)}),e.addEventListener("blur",t=>{let n=t.relatedTarget;if(n){if(n.matches(Le))return setTimeout(()=>{Dt()&&e.focus()},1e3),null;n.matches(Vr)&&we()}$e()}),c(ee).addEventListener("click",t=>{t.shiftKey||t.ctrlKey?e.focus():(we(),$e())})}function Ur(e){let t=c(ae),n=e.shiftKey||e.ctrlKey,r=Ft();e.preventDefault();let i=n?"_blank":"_self",s=document.createElement("a");s.setAttribute("target",i),r?s.setAttribute("href",r.link):s.setAttribute("href",`search.html?q=${encodeURIComponent(t.value)}`),s.click(),n||(we(),$e())}function we(){let e=c(ae);e.value=""}function $e(){document.body.classList.remove("search-focused"),qe()}var zt=".sidebar-projectVersion",Wr=".sidebar-projectVersionsDropdown";function $t(){let e=Ot();if(e.length>0){let n=c(zt).textContent.trim(),r=Kr(e,n);Gr({nodes:r})}}function Gr({nodes:e}){let t=c(zt),n=Handlebars.templates["versions-dropdown"]({nodes:e});t.innerHTML=n,c(Wr).addEventListener("change",Jr)}function Kr(e,t){return Yr(e,t).map(r=>({...r,isCurrentVersion:r.version===t}))}function Yr(e,t){return e.some(r=>r.version===t)?e:[{version:t,url:"#"},...e]}function Jr(e){let t=e.target.value,n=window.location.pathname.split("/").pop()+window.location.hash,r=`${t}/${n}`;dt(r).then(i=>{i?window.location.href=r:window.location.href=t})}var O=at(Ut());var ke=80,Xr="#search";function Gt(){if(window.location.pathname.endsWith("/search.html")){let e=ut("q");Zr(e)}}async function Zr(e){if(Z(e))Ve({value:e});else{Bt(e);let t=await ei();try{let n=di(t.search(e));Ve({value:e,results:n})}catch(n){Ve({value:e,errorMessage:n.message})}}}function Ve({value:e,results:t,errorMessage:n}){let r=c(Xr),i=Handlebars.templates["search-results"]({value:e,results:t,errorMessage:n});r.innerHTML=i}async function ei(){O.default.QueryLexer.termSeparator=/\s+/,O.default.Pipeline.registerFunction(je,"elixirTokenSplitter"),O.default.Pipeline.registerFunction(Ue,"elixirTrimmer"),O.default.Pipeline.registerFunction(We,"hyphenSearch");let e=await ti();if(e)return e;let t=ai();return ni(t),t}async function ti(){try{let e=sessionStorage.getItem(Kt());if(e){let t=await ii(e);return O.default.Index.load(t)}else return null}catch(e){return console.error("Failed to load index: ",e),null}}async function ni(e){try{let t=await ri(e);sessionStorage.setItem(Kt(),t)}catch(t){console.error("Failed to save index: ",t)}}async function ri(e){let t=new Blob([JSON.stringify(e)],{type:"application/json"}).stream().pipeThrough(new window.CompressionStream("gzip")),r=await(await new Response(t).blob()).arrayBuffer();return si(r)}async function ii(e){let t=new Blob([oi(e)],{type:"application/json"}).stream().pipeThrough(new window.DecompressionStream("gzip")),n=await new Response(t).text();return JSON.parse(n)}function si(e){let t="",n=new Uint8Array(e),r=n.byteLength;for(let i=0;i{this.add(e)})})}function ci(e){e.pipeline.before(O.default.stemmer,je),e.searchPipeline.before(O.default.stemmer,je)}function je(e){let t=e.toString().split(/\.|\/|_/).map(n=>e.clone().update(()=>n));return t.length>1?[...t,e]:t}function li(e){e.pipeline.after(O.default.stemmer,Ue),e.searchPipeline.after(O.default.stemmer,Ue)}function Ue(e){return e.update(function(t){return t.replace(/^@?\W+/,"").replace(/\W+$/,"")})}function We(e){if(e.toString().indexOf("-")<0)return e;let n=[];return n.push(e.clone(function(r){return r.replace("-","")})),n.push(e),n}function ui(e){e.pipeline.before(O.default.stemmer,We),e.searchPipeline.before(O.default.stemmer,We)}function di(e){return e.filter(t=>Wt(t.ref)).map(t=>{let n=Wt(t.ref),r=t.matchData.metadata;return{...n,metadata:r,excerpts:fi(n,r)}})}function Wt(e){return searchData.items.find(t=>t.ref===e)||null}function fi(e,t){let{doc:n}=e,i=Object.keys(t).filter(s=>"doc"in t[s]).map(s=>t[s].doc.position.map(([o,a])=>hi(n,o,a))).reduce((s,o)=>s.concat(o),[]);return i.length===0?[n.slice(0,ke*2)+(ke*20?"...":"",e.slice(r,t),""+he(e.slice(t,t+n))+"",e.slice(t+n,i),i{clearTimeout(_e),e.target.classList.remove("show")})}function Ge(e){G&&(clearTimeout(_e),G.innerText=e,G.classList.add("show"),_e=setTimeout(()=>{G.classList.remove("show"),_e=setTimeout(function(){G.innerText=""},1e3)},5e3))}var Jt="dark",Ke=["system","dark","light"];function Xt(){I.getAndSubscribe(e=>{document.body.classList.toggle(Jt,en(e))}),mi()}function Zt(){let t=I.get().theme||"system",n=Ke[Ke.indexOf(t)+1]||Ke[0];I.update({theme:n}),Ge(`Set theme to "${n}"`)}function en(e){return e.theme==="dark"||pi()&&(e.theme==null||e.theme==="system")}function pi(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function mi(){window.matchMedia("(prefers-color-scheme: dark)").addListener(e=>{let t=I.get(),n=en(t);(t.theme==null||t.theme==="system")&&(document.body.classList.toggle(Jt,n),Ge(`Browser changed theme to "${n?"dark":"light"}"`))})}var gi="hll";function nn(){yi()}function yi(){k("[data-group-id]").forEach(t=>{let n=t.getAttribute("data-group-id");t.addEventListener("mouseenter",r=>{tn(n,!0)}),t.addEventListener("mouseleave",r=>{tn(n,!1)})})}function tn(e,t){k(`[data-group-id="${e}"]`).forEach(r=>{r.classList.toggle(gi,t)})}var te="#modal",vi="#modal .modal-close",bi="#modal .modal-title",Si="#modal .modal-body",rn='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 sn(){xi()}function xi(){let e=Handlebars.templates["modal-layout"]();document.body.insertAdjacentHTML("beforeend",e),c(te).addEventListener("keydown",t=>{t.key==="Escape"&&ce()}),c(vi).addEventListener("click",t=>{ce()})}function on(e){if(q.ignoreFocusChanges)return;let t=c(te);if(t.contains(e.target))q.lastFocus=e.target;else{q.ignoreFocusChanges=!0;let n=Ei(t);q.lastFocus===n?Li(t).focus():n.focus(),q.ignoreFocusChanges=!1,q.lastFocus=document.activeElement}}function Ei(e){return e.querySelector(rn)}function Li(e){let t=e.querySelectorAll(rn);return t[t.length-1]}function Ie({title:e,body:t}){q.prevFocus=document.activeElement,document.addEventListener("focus",on,!0),c(bi).innerHTML=e,c(Si).innerHTML=t,c(te).classList.add("shown"),c(te).focus()}function ce(){c(te).classList.remove("shown"),document.addEventListener("focus",on,!0),q.prevFocus&&q.prevFocus.focus(),q.prevFocus=null}function an(){return c(te).classList.contains("shown")}var Ti="https://hexdocs.pm/%%",wi="https://hex.pm/api/packages?search=name:%%*",ki=".display-quick-switch",Ye="#quick-switch-input",ln="#quick-switch-results",_i=".quick-switch-result",Ii=300,Oi=9,Ci=["elixir","eex","ex_unit","hex","iex","logger","mix"].map(e=>({name:e})),un=2,P={autocompleteResults:[],selectedIdx:null};function dn(){Ai()}function Ai(){k(ki).forEach(e=>{e.addEventListener("click",t=>{Xe()})})}function Pi(e){if(e.key==="Enter"){let t=e.target.value;Ni(t),e.preventDefault()}else e.key==="ArrowUp"?(cn(-1),e.preventDefault()):e.key==="ArrowDown"&&(cn(1),e.preventDefault())}function Ri(e){let t=e.target.value;if(t.lengthn.json()).then(n=>{Array.isArray(n)&&(P.autocompleteResults=Fi(e,n),P.selectedIdx=null,c(Ye).value.length>=un&&Di({results:P.autocompleteResults}))})}function Di({results:e}){let t=c(ln),n=Handlebars.templates["quick-switch-results"]({results:e});t.innerHTML=n,k(_i).forEach(r=>{r.addEventListener("click",i=>{let s=r.getAttribute("data-index"),o=P.autocompleteResults[s];Je(o.name)})})}function Fi(e,t){return Ci.concat(t).filter(n=>n.name.toLowerCase().includes(e.toLowerCase())).filter(n=>n.releases===void 0||n.releases[0].has_docs===!0).slice(0,Oi)}function cn(e){P.selectedIdx=Mi(e);let t=c(".quick-switch-result.selected"),n=c(`.quick-switch-result[data-index="${P.selectedIdx}"]`);t&&t.classList.remove("selected"),n&&n.classList.add("selected")}function Mi(e){let t=P.autocompleteResults.length;if(P.selectedIdx===null){if(e>=0)return 0;if(e<0)return t-1}return(P.selectedIdx+e+t)%t}var Bi=".display-settings",qi="#settings-modal-content",Ze="#modal-settings-tab",et="#modal-keyboard-shortcuts-tab",hn="#settings-content",pn="#keyboard-shortcuts-content",zi=[{title:"Settings",id:"modal-settings-tab"},{title:"Keyboard shortcuts",id:"modal-keyboard-shortcuts-tab"}];function mn(){$i()}function $i(){k(Bi).forEach(e=>{e.addEventListener("click",t=>{tt()})})}function fn(){c(et).classList.remove("active"),c(Ze).classList.add("active"),c(hn).classList.remove("hidden"),c(pn).classList.add("hidden")}function Vi(){c(et).classList.add("active"),c(Ze).classList.remove("active"),c(pn).classList.remove("hidden"),c(hn).classList.add("hidden")}function tt(){Ie({title:zi.map(({id:s,title:o})=>``).join(""),body:Handlebars.templates["settings-modal-body"]({shortcuts:nt})});let e=c(qi),t=e.querySelector('[name="theme"]'),n=e.querySelector('[name="tooltips"]'),r=e.querySelector('[name="direct_livebook_url"]'),i=e.querySelector('[name="livebook_url"]');I.getAndSubscribe(s=>{t.value=s.theme||"system",n.checked=s.tooltips,s.livebookUrl===null?(r.checked=!1,i.classList.add("hidden"),i.tabIndex=-1):(r.checked=!0,i.classList.remove("hidden"),i.tabIndex=0,i.value=s.livebookUrl)}),t.addEventListener("change",s=>{I.update({theme:s.target.value})}),n.addEventListener("change",s=>{I.update({tooltips:s.target.checked})}),r.addEventListener("change",s=>{let o=s.target.checked?i.value:null;I.update({livebookUrl:o})}),i.addEventListener("input",s=>{I.update({livebookUrl:s.target.value})}),c(Ze).addEventListener("click",s=>{fn()}),c(et).addEventListener("click",s=>{Vi()}),fn()}var ji="#settings-modal-content",nt=[{key:"c",description:"Toggle sidebar",action:Pe},{key:"n",description:"Cycle themes",action:Zt},{key:"s",description:"Focus search bar",displayAs:"/ or s",action:gn},{key:"/",action:gn},{key:"g",description:"Search HexDocs package",displayAs:"g",action:Xe},{key:"?",displayAs:"?",description:"Bring up this modal",action:Ki}],rt={shortcutBeingPressed:null};function yn(){Ui()}function Ui(){document.addEventListener("keydown",Wi),document.addEventListener("keyup",Gi)}function Wi(e){if(rt.shortcutBeingPressed||e.target.matches("input, textarea")||e.ctrlKey||e.metaKey||e.altKey)return;let t=nt.find(n=>n.key===e.key);t&&(rt.shortcutBeingPressed=t,e.preventDefault(),t.action(e))}function Gi(e){rt.shortcutBeingPressed=null}function gn(e){ce(),Ne(),qt()}function Ki(){Yi()?ce():tt()}function Yi(){return an()&&c(ji)}var K={plain:"plain",function:"function",module:"module"},Ji=[{href:"typespecs.html#basic-types",hint:{kind:K.plain,description:"Basic type"}},{href:"typespecs.html#literals",hint:{kind:K.plain,description:"Literal"}},{href:"typespecs.html#built-in-types",hint:{kind:K.plain,description:"Built-in type"}}],Oe={cancelHintFetching:null};function vn(e){if(Sn(e))return!0;let t=/#.*\//;return e.includes("#")&&!t.test(e)?!1:e.includes(".html")}function bn(e){let t=Sn(e);return t?Promise.resolve(t):Xi(e)}function Sn(e){let t=Ji.find(n=>e.includes(n.href));return t?t.hint:null}function Xi(e){let t=e.replace(".html",".html?hint=true");return new Promise((n,r)=>{let i=document.createElement("iframe");i.setAttribute("sandbox","allow-scripts allow-same-origin"),i.setAttribute("src",t),i.style.display="none";function s(a){let{href:l,hint:u}=a.data;t===l&&(o(),n(u))}Oe.cancelHintFetching=()=>{o(),r(new Error("cancelled"))};function o(){i.remove(),window.removeEventListener("message",s),Oe.cancelHintFetching=null}window.addEventListener("message",s),document.body.appendChild(i)})}function xn(){Oe.cancelHintFetching&&Oe.cancelHintFetching()}function En(e){let n=e.querySelector("h1").textContent,r=e.querySelector(".docstring > p"),i=r?r.innerHTML:"";return{kind:K.function,title:n.trim(),description:i.trim()}}function Ln(e){let n=e.querySelector("h1 > span").textContent,r=e.querySelector("#moduledoc p"),i=r?r.innerHTML:"";return{kind:K.module,title:n.trim(),description:i.trim()}}var Zi=".content a",it="#tooltip",es="#tooltip .tooltip-body",wn="body .content-inner",ts="#content",kn="tooltip-shown",le=10,ns=le*4,Tn={height:450,width:768},rs=100,ne={currentLinkElement:null,hoverDelayTimeout:null};function _n(){is(),ss()}function is(){let e=Handlebars.templates["tooltip-layout"]();c(wn).insertAdjacentHTML("beforeend",e)}function ss(){k(Zi).forEach(e=>{os(e)&&(e.addEventListener("mouseenter",t=>{cs(e)}),e.addEventListener("mouseleave",t=>{fs(e)}))})}function os(e){return!(e.classList.contains("detail-link")||as(e.href)||!vn(e.href))}function as(e){let t=e.replace(ts,"");return window.location.href.split("#")[0]===t}function cs(e){ls()&&(ne.currentLinkElement=e,ne.hoverDelayTimeout=setTimeout(()=>{bn(e.href).then(t=>{us(t),ds()}).catch(()=>{})},rs))}function ls(){let e=window.innerWidthe.firstElementChild&&e.firstElementChild.tagName==="CODE").forEach(e=>e.insertAdjacentHTML("beforeend",Es)),Array.from(k(".copy-button")).forEach(e=>{let t;e.addEventListener("click",()=>{let n=e.querySelector("[aria-live]");t&&clearTimeout(t);let r=Array.from(e.parentElement.querySelector("code").childNodes).filter(i=>!(i.tagName==="SPAN"&&i.classList.contains("unselectable"))).map(i=>i.textContent).join("");navigator.clipboard.writeText(r),e.classList.add("clicked"),n.innerHTML="Copied! ✓",t=setTimeout(()=>{e.classList.remove("clicked"),n.innerHTML=""},3e3)})})}function Pn(){let t=/(Macintosh|iPhone|iPad|iPod)/.test(window.navigator.userAgent)?"apple-os":"non-apple-os";document.documentElement.classList.add(t)}var Ts="content",ws="tabs-open",ks="tabs-close",_s="H3",Is="tabset";function Nn(){Os().map(Cs).forEach(n=>Rs(n))}function Os(){let e=document.createNodeIterator(document.getElementById(Ts),NodeFilter.SHOW_COMMENT,{acceptNode(r){return r.nodeValue.trim()===ws?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),t=[],n;for(;n=e.nextNode();)t.push(n);return t}function Cs(e,t,n){let r=[],i=[],s={label:"",content:[]};for(;e=e.nextSibling;){if(As(e)){Rn(s,i,t);break}r.push(e),e.nodeName===_s?(Rn(s,i,t),s.label=e.innerText,s.content=[]):s.content.push(e.outerHTML)}let o=document.createElement("div");return o.className=Is,Ps(r,o),o.innerHTML=Handlebars.templates.tabset({tabs:i}),o}function As(e){return e.nodeName==="#comment"&&e.nodeValue.trim()===ks}function Rn(e,t,n){if(e.label===""&&!e.content.length)return!1;let r=e.label,i=e.content;t.push({label:r,content:i,setIndex:n})}function Ps(e,t){if(!e||!e.length)return!1;e[0].parentNode.insertBefore(t,e[0]),e.forEach(n=>t.appendChild(n))}function Rs(e){let t={tabs:e.querySelectorAll(':scope [role="tab"]'),panels:e.querySelectorAll(':scope [role="tabpanel"]'),activeIndex:0};t.tabs.forEach((n,r)=>{n.addEventListener("click",i=>{Y(r,t)}),n.addEventListener("keydown",i=>{let s=t.tabs.length-1;i.code==="ArrowLeft"?(i.preventDefault(),t.activeIndex===0?Y(s,t):Y(t.activeIndex-1,t)):i.code==="ArrowRight"?(i.preventDefault(),t.activeIndex===s?Y(0,t):Y(t.activeIndex+1,t)):i.code==="Home"?(i.preventDefault(),Y(0,t)):i.code==="End"&&(i.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}ft(()=>{Xt(),Tt(),Ct(),Mt(),$t(),gt(),nn(),sn(),yn(),dn(),Yt(),_n(),Cn(),Gt(),An(),mn(),Pn(),Nn()});})(); +`,t)},e.Pipeline.load=function(t){var n=new e.Pipeline;return t.forEach(function(r){var i=e.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),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 r=this._stack.indexOf(t);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},e.Pipeline.prototype.before=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(t);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,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,r=0;r1&&(ot&&(r=s),o!=t);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==t||o>t)return s*2;if(ol?f+=2:a==l&&(n+=r[u+1]*i[f+1],u+=2,f+=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,r=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),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.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 u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var f=s.str.charAt(0),y=s.str.charAt(1),g;y in s.node.edges?g=s.node.edges[y]:(g=new e.TokenSet,s.node.edges[y]=g),s.str.length==1&&(g.final=!0),i.push({node:g,editsRemaining:s.editsRemaining-1,str:f+s.str.slice(2)})}}}return r},e.TokenSet.fromString=function(t){for(var n=new e.TokenSet,r=n,i=0,s=t.length;i=t;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.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 r=new e.QueryParser(t,n);r.parse()})},e.Index.prototype.query=function(t){for(var n=new e.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=t},e.Builder.prototype.k1=function(t){this._k1=t},e.Builder.prototype.add=function(t,n){var r=t[this._ref],i=Object.keys(this._fields);this._documents[r]=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 r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new e.QueryParseError(r,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 r="unrecognised presence operator'"+n.str+"'";throw new e.QueryParseError(r,n.start,n.end)}var i=t.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new e.QueryParseError(r,n.start,n.end)}switch(i.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new e.QueryParseError(r,i.start,i.end)}}},e.QueryParser.parseField=function(t){var n=t.consumeLexeme();if(n!=null){if(t.query.allFields.indexOf(n.str)==-1){var r=t.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.fields=[n.str];var s=t.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new e.QueryParseError(i,n.start,n.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new e.QueryParseError(i,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 r=t.peekLexeme();if(r==null){t.nextClause();return}switch(r.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 i="Unexpected lexeme type '"+r.type+"'";throw new e.QueryParseError(i,r.start,r.end)}}},e.QueryParser.parseEditDistance=function(t){var n=t.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.editDistance=r;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 i="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(i,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var n=t.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.boost=r;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 i="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(i,s.start,s.end)}}},function(t,n){typeof define=="function"&&define.amd?define(n):typeof Vt=="object"?jt.exports=n():t.lunr=n()}(this,function(){return e})})()});Handlebars.registerHelper("groupChanged",function(e,t,n){let r=t||"";if(e.group!==r)return delete e.nestedContext,e.group=r,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 e+".html"===n?t.fn(this):t.inverse(this)});var c=document.querySelector.bind(document),k=document.querySelectorAll.bind(document);function ct(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function he(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function z(){return document.body.dataset.type}function lt(e,t){if(e){for(let n of e){let r=n.nodeGroups&&n.nodeGroups.find(i=>i.nodes.some(s=>s.anchor===t));if(r)return r.key}return null}}function pe(){return window.location.hash.replace(/^#/,"")}function ut(e){return new URLSearchParams(window.location.search).get(e)}function dt(e){return fetch(e).then(t=>t.ok).catch(()=>!1)}function ft(e){document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)}function Z(e){return!e||e.trim()===""}function ht(e,t){let n;return function(...i){clearTimeout(n),n=setTimeout(()=>{n=null,e(...i)},t)}}function me(){return document.head.querySelector("meta[name=project][content]").content}var pt="ex_doc:settings",jn={tooltips:!0,theme:null,livebookUrl:null},Ce=class{constructor(){this._subscribers=[],this._settings=jn,this._loadSettings()}get(){return this._settings}update(t){let n=this._settings;this._settings={...this._settings,...t},this._subscribers.forEach(r=>r(this._settings,n)),this._storeSettings()}getAndSubscribe(t){this._subscribers.push(t),t(this._settings)}_loadSettings(){try{let t=localStorage.getItem(pt);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(pt,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 Ce;var Un=".content",mt=".content-inner",Wn=".livebook-badge";function gt(){Gn(),Yn(),Jn(),Kn()}function Gn(){c(Un).querySelectorAll("a").forEach(e=>{e.querySelector("code, img")&&e.classList.add("no-underline")})}function Kn(){["warning","info","error","neutral","tip"].forEach(t=>{k(`blockquote h3.${t}, blockquote h4.${t}`).forEach(n=>{n.closest("blockquote").classList.add(t)})})}function Yn(){c(mt).setAttribute("tabindex",-1),c(mt).focus()}function Jn(){let t=window.location.pathname.replace(/(\.html)?$/,".livemd"),n=new URL(t,window.location.href).toString();I.getAndSubscribe(r=>{let i=r.livebookUrl?Zn(r.livebookUrl,n):Xn(n);for(let s of k(Wn))s.href=i})}function Xn(e){return`https://livebook.dev/run?url=${encodeURIComponent(e)}`}function Zn(e,t){return`${e}/import?url=${encodeURIComponent(t)}`}document.addEventListener("click",function(e){if(window.innerWidth<=768){let t=e.target.closest('a[href^="#"]');if(t){e.preventDefault();let n=t.getAttribute("href").substring(1),r=document.getElementById(n);if(r){let s=r.getBoundingClientRect().top+window.scrollY-45;window.scrollTo({top:s,behavior:"smooth"})}}}});var Et=at(xt());var yr=768,Lt=300,se=".sidebar-toggle",vr=".content",F={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"},br=Object.values(Q),A={togglingTimeout:null,lastWindowWidth:window.innerWidth,sidebarPreference:F.NO_PREF};function Tt(){wt(),Sr()}function wt(){sessionStorage.getItem("sidebar_state")==="closed"||kt()?($(Q.closed),c(se).setAttribute("aria-expanded","false")):($(Q.opened),c(se).setAttribute("aria-expanded","true"))}function kt(){return window.matchMedia(`screen and (max-width: ${yr}px)`).matches}function $(...e){document.body.classList.remove(...br),document.body.classList.add(...e)}function Sr(){c(se).addEventListener("click",e=>{Pe(),Lr()}),c(vr).addEventListener("click",e=>{Er()}),window.addEventListener("resize",(0,Et.default)(e=>{xr()},100))}function Pe(){return Re()?_t():Ne()}function Re(){return document.body.classList.contains(Q.opened)||document.body.classList.contains(Q.opening)}function Ne(){It(),sessionStorage.setItem("sidebar_state","opened"),c(se).setAttribute("aria-expanded","true"),requestAnimationFrame(()=>{$(Q.openingStart),requestAnimationFrame(()=>($(Q.opening),new Promise((e,t)=>{A.togglingTimeout=setTimeout(()=>{$(Q.opened),e()},Lt)})))})}function _t(){It(),sessionStorage.setItem("sidebar_state","closed"),c(se).setAttribute("aria-expanded","false"),requestAnimationFrame(()=>{$(Q.closingStart),requestAnimationFrame(()=>($(Q.closing),new Promise((e,t)=>{A.togglingTimeout=setTimeout(()=>{$(Q.closed),e()},Lt)})))})}function It(){A.togglingTimeout&&(clearTimeout(A.togglingTimeout),A.togglingTimeout=null)}function xr(){A.lastWindowWidth!==window.innerWidth&&(A.lastWindowWidth=window.innerWidth,(A.sidebarPreference===F.OPEN||A.sidebarPreference===F.NO_PREF)&&wt())}function Er(){kt()&&Re()&&_t()}function Lr(){switch(A.sidebarPreference){case F.OPEN:A.sidebarPreference=F.CLOSED;break;case F.CLOSED:A.sidebarPreference=F.OPEN;break;case F.NO_PREF:Re()?A.sidebarPreference=F.OPEN:A.sidebarPreference=F.CLOSED}}function oe(){return window.sidebarNodes||{}}function Ot(){return window.versionNodes||[]}var Qe={search:"search",extras:"extras",modules:"modules",tasks:"tasks"},He=[Qe.extras,Qe.modules,Qe.tasks],ve=e=>`#${e}-full-list`;function Ct(){He.forEach(e=>{Tr(oe(),e)}),ye(z()),Pt(),At(),Ar()}function Tr(e,t){let n=e[t]||[],r=c(ve(t));if(!r)return;let i=Handlebars.templates["sidebar-items"]({nodes:n,group:""});r.innerHTML=i,r.querySelectorAll("ul").forEach(s=>{if(s.innerHTML.trim()===""){let o=s.previousElementSibling;o.classList.contains("expand")&&o.classList.remove("expand"),s.remove()}}),r.querySelectorAll("li a + button").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.closest("li");kr(l)})}),r.querySelectorAll("li a").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.closest("li"),u=r.querySelector(".current-section");u&&Ir(u),s.matches(".expand")&&s.pathname===window.location.pathname&&De(l)})})}function De(e){e.classList.add("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","true")}function wr(e){e.classList.remove("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","false")}function kr(e){e.classList.contains("open")?wr(e):De(e)}function _r(e){e.classList.add("current-section"),e.querySelector("a").setAttribute("aria-current","true")}function Ir(e){e.classList.remove("current-section"),e.querySelector("a").setAttribute("aria-current","false")}function Or(e){e.classList.add("current-hash"),e.querySelector("a").setAttribute("aria-current","true")}function Cr(e){e.classList.remove("current-hash"),e.querySelector("a").setAttribute("aria-current","false")}function ye(e){He.forEach(t=>{let n=c(`#${t}-list-tab-button`);if(n){let r=c(`#${n.getAttribute("aria-controls")}`);t===e?(n.parentElement.classList.add("selected"),n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0"),r.removeAttribute("hidden")):(n.parentElement.classList.remove("selected"),n.setAttribute("aria-selected","false"),n.setAttribute("tabindex","-1"),r.setAttribute("hidden","hidden"))}})}function At(){let e=c(ve(z())),t=e.querySelector("li.current-page");t&&(t.scrollIntoView(),e.scrollTop-=40)}function Pt(){let e=pe()||"content",n=oe()[z()]||[],r=lt(n,e),i=c(ve(z())),s=i.querySelector(`li.current-page a.expand[href$="#${r}"]`);s&&De(s.closest("li"));let o=i.querySelector(`li.current-page a[href$="#${e}"]`);if(o){let a=o.closest("ul");a.classList.contains("deflist")&&_r(a.closest("li")),Or(o.closest("li"))}}function Ar(){He.forEach(t=>{let n=c(`#${t}-list-tab-button`);n&&n.addEventListener("click",r=>{ye(t),At()})});let e=c("#sidebar-listNav");e.addEventListener("keydown",t=>{if(t.key!=="ArrowRight"&&t.key!=="ArrowLeft")return;let n=Array.from(e.querySelectorAll('[role="tab"]')).map(i=>i.dataset.type),r=e.querySelector('[role="tab"][aria-selected="true"]').dataset.type;if(t.key==="ArrowRight"){let i=n.indexOf(r)+1;i>=n.length&&(i=0);let s=n[i];ye(s),c(`#${s}-list-tab-button`).focus()}else if(t.key==="ArrowLeft"){let i=n.indexOf(r)-1;i<0&&(i=n.length-1);let s=n[i];ye(s),c(`#${s}-list-tab-button`).focus()}}),window.addEventListener("hashchange",t=>{let r=c(ve(z())).querySelector("li.current-page li.current-hash");r&&Cr(r),Pt()})}var M={module:"module",moduleChild:"module-child",mixTask:"mix-task",extra:"extra",section:"section"};function Nt(e,t=5){if(Z(e))return[];let n=oe(),r=[...Fe(n.modules,e,M.module),...Pr(n.modules,e,M.moduleChild),...Fe(n.tasks,e,M.mixTask),...Fe(n.extras,e,M.extra),...Me(n.modules,e,M.section),...Me(n.tasks,e,M.section),...Me(n.extras,e,M.section)].filter(i=>i!==null);return Mr(r).slice(0,t)}function Fe(e,t,n){return e.map(r=>Nr(r,t,n))}function Pr(e,t,n){return e.filter(r=>r.nodeGroups).flatMap(r=>r.nodeGroups.flatMap(({key:i,nodes:s})=>{let o=Fr(i);return s.map(a=>Qr(a,r.id,t,n,o)||Dr(a,r.id,t,n,o))}))}function Me(e,t,n){return e.flatMap(r=>Rr(r).map(i=>Hr(r,i,t,n)))}function Rr(e){return(e.sections||[]).concat(e.headers||[])}function Nr(e,t,n){return Be(e.title,t)?{link:`${e.id}.html`,title:Ee(e.title,t),label:null,description:null,matchQuality:Se(e.title,t),deprecated:e.deprecated,category:n}:null}function Qr(e,t,n,r,i){return Be(e.id,n)?{link:`${t}.html#${e.anchor}`,title:Ee(e.id,n),label:i,description:t,matchQuality:Se(e.id,n),deprecated:e.deprecated,category:r}:null}function Hr(e,t,n,r){return Qt(t.id,n)?{link:`${e.id}.html#${t.anchor}`,title:Ee(t.id,n),label:null,description:e.title,matchQuality:Se(t.id,n),category:r}:null}function Dr(e,t,n,r,i){let s=`${t}.${e.id}`;if(!Be(s,n))return null;let o=n.replace(/\./g," ");return Qt(e.id,o)?{link:`${t}.html#${e.anchor}`,title:Ee(e.id,o),label:i,description:t,matchQuality:Se(s,n),deprecated:e.deprecated,category:r}:null}function Fr(e){switch(e){case"callbacks":return"callback";case"types":return"type";default:return null}}function Mr(e){return e.slice().sort((t,n)=>t.matchQuality!==n.matchQuality?n.matchQuality-t.matchQuality:Rt(t.category)-Rt(n.category))}function Rt(e){switch(e){case M.module:return 1;case M.moduleChild:return 2;case M.mixTask:return 3;default:return 4}}function Qt(e,t){return xe(t).some(r=>Ht(e,r))}function Be(e,t){return xe(t).every(r=>Ht(e,r))}function Ht(e,t){return e.toLowerCase().includes(t.toLowerCase())}function Se(e,t){let n=xe(t),i=n.map(o=>o.length).reduce((o,a)=>o+a,0)/e.length,s=Br(e,n[0])?1:0;return i+s}function Br(e,t){return e.toLowerCase().startsWith(t.toLowerCase())}function xe(e){return e.trim().split(/\s+/)}function Ee(e,t){let n=xe(t).sort((r,i)=>i.length-r.length);return be(e,n)}function be(e,t){if(t.length===0)return e;let[n,...r]=t,i=e.match(new RegExp(`(.*)(${ct(n)})(.*)`,"i"));if(i){let[,s,o,a]=i;return be(s,t)+""+he(o)+""+be(a,t)}else return be(e,r)}var ee=".autocomplete",Le=".autocomplete-suggestion",B={autocompleteSuggestions:[],selectedIdx:-1};function qr(){c(ee).classList.add("shown")}function qe(){c(ee).classList.remove("shown")}function Dt(){return c(ee).classList.contains("shown")}function ze(e){B.autocompleteSuggestions=Nt(e),B.selectedIdx=-1,Z(e)?qe():(zr({term:e,suggestions:B.autocompleteSuggestions}),Te(0),qr())}function zr({term:e,suggestions:t}){let n=Handlebars.templates["autocomplete-suggestions"]({suggestions:t,term:e}),r=c(ee);r.innerHTML=n}function Ft(){return B.selectedIdx===-1?null:B.autocompleteSuggestions[B.selectedIdx]}function Te(e){B.selectedIdx=$r(e);let t=c(`${Le}.selected`),n=c(`${Le}[data-index="${B.selectedIdx}"]`);t&&t.classList.remove("selected"),n&&n.classList.add("selected")}function $r(e){let t=B.autocompleteSuggestions.length+1;return(B.selectedIdx+e+1+t)%t-1}var ae="form.sidebar-search input",Vr="form.sidebar-search .search-close-button";function Mt(){jr()}function Bt(e){let t=c(ae);t.value=e}function qt(){c(ae).focus()}function jr(){let e=c(ae);e.addEventListener("keydown",t=>{t.key==="Escape"?(we(),e.blur()):t.key==="Enter"?Ur(t):t.key==="ArrowUp"?(Te(-1),t.preventDefault()):t.key==="ArrowDown"&&(Te(1),t.preventDefault())}),e.addEventListener("input",t=>{ze(t.target.value)}),e.addEventListener("focus",t=>{document.body.classList.add("search-focused"),ze(t.target.value)}),e.addEventListener("blur",t=>{let n=t.relatedTarget;if(n){if(n.matches(Le))return setTimeout(()=>{Dt()&&e.focus()},1e3),null;n.matches(Vr)&&we()}$e()}),c(ee).addEventListener("click",t=>{t.shiftKey||t.ctrlKey?e.focus():(we(),$e())})}function Ur(e){let t=c(ae),n=e.shiftKey||e.ctrlKey,r=Ft();e.preventDefault();let i=n?"_blank":"_self",s=document.createElement("a");s.setAttribute("target",i),r?s.setAttribute("href",r.link):s.setAttribute("href",`search.html?q=${encodeURIComponent(t.value)}`),s.click(),n||(we(),$e())}function we(){let e=c(ae);e.value=""}function $e(){document.body.classList.remove("search-focused"),qe()}var zt=".sidebar-projectVersion",Wr=".sidebar-projectVersionsDropdown";function $t(){let e=Ot();if(e.length>0){let n=c(zt).textContent.trim(),r=Kr(e,n);Gr({nodes:r})}}function Gr({nodes:e}){let t=c(zt),n=Handlebars.templates["versions-dropdown"]({nodes:e});t.innerHTML=n,c(Wr).addEventListener("change",Jr)}function Kr(e,t){return Yr(e,t).map(r=>({...r,isCurrentVersion:r.version===t}))}function Yr(e,t){return e.some(r=>r.version===t)?e:[{version:t,url:"#"},...e]}function Jr(e){let t=e.target.value,n=window.location.pathname.split("/").pop()+window.location.hash,r=`${t}/${n}`;dt(r).then(i=>{i?window.location.href=r:window.location.href=t})}var O=at(Ut());var ke=80,Xr="#search";function Gt(){if(window.location.pathname.endsWith("/search.html")){let e=ut("q");Zr(e)}}async function Zr(e){if(Z(e))Ve({value:e});else{Bt(e);let t=await ei();try{let n=di(t.search(e));Ve({value:e,results:n})}catch(n){Ve({value:e,errorMessage:n.message})}}}function Ve({value:e,results:t,errorMessage:n}){let r=c(Xr),i=Handlebars.templates["search-results"]({value:e,results:t,errorMessage:n});r.innerHTML=i}async function ei(){O.default.QueryLexer.termSeparator=/\s+/,O.default.Pipeline.registerFunction(je,"elixirTokenSplitter"),O.default.Pipeline.registerFunction(Ue,"elixirTrimmer"),O.default.Pipeline.registerFunction(We,"hyphenSearch");let e=await ti();if(e)return e;let t=ai();return ni(t),t}async function ti(){try{let e=sessionStorage.getItem(Kt());if(e){let t=await ii(e);return O.default.Index.load(t)}else return null}catch(e){return console.error("Failed to load index: ",e),null}}async function ni(e){try{let t=await ri(e);sessionStorage.setItem(Kt(),t)}catch(t){console.error("Failed to save index: ",t)}}async function ri(e){let t=new Blob([JSON.stringify(e)],{type:"application/json"}).stream().pipeThrough(new window.CompressionStream("gzip")),r=await(await new Response(t).blob()).arrayBuffer();return si(r)}async function ii(e){let t=new Blob([oi(e)],{type:"application/json"}).stream().pipeThrough(new window.DecompressionStream("gzip")),n=await new Response(t).text();return JSON.parse(n)}function si(e){let t="",n=new Uint8Array(e),r=n.byteLength;for(let i=0;i{this.add(e)})})}function ci(e){e.pipeline.before(O.default.stemmer,je),e.searchPipeline.before(O.default.stemmer,je)}function je(e){let t=e.toString().split(/\.|\/|_/).map(n=>e.clone().update(()=>n));return t.length>1?[...t,e]:t}function li(e){e.pipeline.after(O.default.stemmer,Ue),e.searchPipeline.after(O.default.stemmer,Ue)}function Ue(e){return e.update(function(t){return t.replace(/^@?\W+/,"").replace(/\W+$/,"")})}function We(e){if(e.toString().indexOf("-")<0)return e;let n=[];return n.push(e.clone(function(r){return r.replace("-","")})),n.push(e),n}function ui(e){e.pipeline.before(O.default.stemmer,We),e.searchPipeline.before(O.default.stemmer,We)}function di(e){return e.filter(t=>Wt(t.ref)).map(t=>{let n=Wt(t.ref),r=t.matchData.metadata;return{...n,metadata:r,excerpts:fi(n,r)}})}function Wt(e){return searchData.items.find(t=>t.ref===e)||null}function fi(e,t){let{doc:n}=e,i=Object.keys(t).filter(s=>"doc"in t[s]).map(s=>t[s].doc.position.map(([o,a])=>hi(n,o,a))).reduce((s,o)=>s.concat(o),[]);return i.length===0?[n.slice(0,ke*2)+(ke*20?"...":"",e.slice(r,t),""+he(e.slice(t,t+n))+"",e.slice(t+n,i),i{clearTimeout(_e),e.target.classList.remove("show")})}function Ge(e){G&&(clearTimeout(_e),G.innerText=e,G.classList.add("show"),_e=setTimeout(()=>{G.classList.remove("show"),_e=setTimeout(function(){G.innerText=""},1e3)},5e3))}var Jt="dark",Ke=["system","dark","light"];function Xt(){I.getAndSubscribe(e=>{document.body.classList.toggle(Jt,en(e))}),mi()}function Zt(){let t=I.get().theme||"system",n=Ke[Ke.indexOf(t)+1]||Ke[0];I.update({theme:n}),Ge(`Set theme to "${n}"`)}function en(e){return e.theme==="dark"||pi()&&(e.theme==null||e.theme==="system")}function pi(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function mi(){window.matchMedia("(prefers-color-scheme: dark)").addListener(e=>{let t=I.get(),n=en(t);(t.theme==null||t.theme==="system")&&(document.body.classList.toggle(Jt,n),Ge(`Browser changed theme to "${n?"dark":"light"}"`))})}var gi="hll";function nn(){yi()}function yi(){k("[data-group-id]").forEach(t=>{let n=t.getAttribute("data-group-id");t.addEventListener("mouseenter",r=>{tn(n,!0)}),t.addEventListener("mouseleave",r=>{tn(n,!1)})})}function tn(e,t){k(`[data-group-id="${e}"]`).forEach(r=>{r.classList.toggle(gi,t)})}var te="#modal",vi="#modal .modal-close",bi="#modal .modal-title",Si="#modal .modal-body",rn='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 sn(){xi()}function xi(){let e=Handlebars.templates["modal-layout"]();document.body.insertAdjacentHTML("beforeend",e),c(te).addEventListener("keydown",t=>{t.key==="Escape"&&ce()}),c(vi).addEventListener("click",t=>{ce()})}function on(e){if(q.ignoreFocusChanges)return;let t=c(te);if(t.contains(e.target))q.lastFocus=e.target;else{q.ignoreFocusChanges=!0;let n=Ei(t);q.lastFocus===n?Li(t).focus():n.focus(),q.ignoreFocusChanges=!1,q.lastFocus=document.activeElement}}function Ei(e){return e.querySelector(rn)}function Li(e){let t=e.querySelectorAll(rn);return t[t.length-1]}function Ie({title:e,body:t}){q.prevFocus=document.activeElement,document.addEventListener("focus",on,!0),c(bi).innerHTML=e,c(Si).innerHTML=t,c(te).classList.add("shown"),c(te).focus()}function ce(){c(te).classList.remove("shown"),document.addEventListener("focus",on,!0),q.prevFocus&&q.prevFocus.focus(),q.prevFocus=null}function an(){return c(te).classList.contains("shown")}var Ti="https://hexdocs.pm/%%",wi="https://hex.pm/api/packages?search=name:%%*",ki=".display-quick-switch",Ye="#quick-switch-input",ln="#quick-switch-results",_i=".quick-switch-result",Ii=300,Oi=9,Ci=["elixir","eex","ex_unit","hex","iex","logger","mix"].map(e=>({name:e})),un=2,P={autocompleteResults:[],selectedIdx:null};function dn(){Ai()}function Ai(){k(ki).forEach(e=>{e.addEventListener("click",t=>{Xe()})})}function Pi(e){if(e.key==="Enter"){let t=e.target.value;Ni(t),e.preventDefault()}else e.key==="ArrowUp"?(cn(-1),e.preventDefault()):e.key==="ArrowDown"&&(cn(1),e.preventDefault())}function Ri(e){let t=e.target.value;if(t.lengthn.json()).then(n=>{Array.isArray(n)&&(P.autocompleteResults=Fi(e,n),P.selectedIdx=null,c(Ye).value.length>=un&&Di({results:P.autocompleteResults}))})}function Di({results:e}){let t=c(ln),n=Handlebars.templates["quick-switch-results"]({results:e});t.innerHTML=n,k(_i).forEach(r=>{r.addEventListener("click",i=>{let s=r.getAttribute("data-index"),o=P.autocompleteResults[s];Je(o.name)})})}function Fi(e,t){return Ci.concat(t).filter(n=>n.name.toLowerCase().includes(e.toLowerCase())).filter(n=>n.releases===void 0||n.releases[0].has_docs===!0).slice(0,Oi)}function cn(e){P.selectedIdx=Mi(e);let t=c(".quick-switch-result.selected"),n=c(`.quick-switch-result[data-index="${P.selectedIdx}"]`);t&&t.classList.remove("selected"),n&&n.classList.add("selected")}function Mi(e){let t=P.autocompleteResults.length;if(P.selectedIdx===null){if(e>=0)return 0;if(e<0)return t-1}return(P.selectedIdx+e+t)%t}var Bi=".display-settings",qi="#settings-modal-content",Ze="#modal-settings-tab",et="#modal-keyboard-shortcuts-tab",hn="#settings-content",pn="#keyboard-shortcuts-content",zi=[{title:"Settings",id:"modal-settings-tab"},{title:"Keyboard shortcuts",id:"modal-keyboard-shortcuts-tab"}];function mn(){$i()}function $i(){k(Bi).forEach(e=>{e.addEventListener("click",t=>{tt()})})}function fn(){c(et).classList.remove("active"),c(Ze).classList.add("active"),c(hn).classList.remove("hidden"),c(pn).classList.add("hidden")}function Vi(){c(et).classList.add("active"),c(Ze).classList.remove("active"),c(pn).classList.remove("hidden"),c(hn).classList.add("hidden")}function tt(){Ie({title:zi.map(({id:s,title:o})=>``).join(""),body:Handlebars.templates["settings-modal-body"]({shortcuts:nt})});let e=c(qi),t=e.querySelector('[name="theme"]'),n=e.querySelector('[name="tooltips"]'),r=e.querySelector('[name="direct_livebook_url"]'),i=e.querySelector('[name="livebook_url"]');I.getAndSubscribe(s=>{t.value=s.theme||"system",n.checked=s.tooltips,s.livebookUrl===null?(r.checked=!1,i.classList.add("hidden"),i.tabIndex=-1):(r.checked=!0,i.classList.remove("hidden"),i.tabIndex=0,i.value=s.livebookUrl)}),t.addEventListener("change",s=>{I.update({theme:s.target.value})}),n.addEventListener("change",s=>{I.update({tooltips:s.target.checked})}),r.addEventListener("change",s=>{let o=s.target.checked?i.value:null;I.update({livebookUrl:o})}),i.addEventListener("input",s=>{I.update({livebookUrl:s.target.value})}),c(Ze).addEventListener("click",s=>{fn()}),c(et).addEventListener("click",s=>{Vi()}),fn()}var ji="#settings-modal-content",nt=[{key:"c",description:"Toggle sidebar",action:Pe},{key:"n",description:"Cycle themes",action:Zt},{key:"s",description:"Focus search bar",displayAs:"/ or s",action:gn},{key:"/",action:gn},{key:"g",description:"Search HexDocs package",displayAs:"g",action:Xe},{key:"?",displayAs:"?",description:"Bring up this modal",action:Ki}],rt={shortcutBeingPressed:null};function yn(){Ui()}function Ui(){document.addEventListener("keydown",Wi),document.addEventListener("keyup",Gi)}function Wi(e){if(rt.shortcutBeingPressed||e.target.matches("input, textarea")||e.ctrlKey||e.metaKey||e.altKey)return;let t=nt.find(n=>n.key===e.key);t&&(rt.shortcutBeingPressed=t,e.preventDefault(),t.action(e))}function Gi(e){rt.shortcutBeingPressed=null}function gn(e){ce(),Ne(),qt()}function Ki(){Yi()?ce():tt()}function Yi(){return an()&&c(ji)}var K={plain:"plain",function:"function",module:"module"},Ji=[{href:"typespecs.html#basic-types",hint:{kind:K.plain,description:"Basic type"}},{href:"typespecs.html#literals",hint:{kind:K.plain,description:"Literal"}},{href:"typespecs.html#built-in-types",hint:{kind:K.plain,description:"Built-in type"}}],Oe={cancelHintFetching:null};function vn(e){if(Sn(e))return!0;let t=/#.*\//;return e.includes("#")&&!t.test(e)?!1:e.includes(".html")}function bn(e){let t=Sn(e);return t?Promise.resolve(t):Xi(e)}function Sn(e){let t=Ji.find(n=>e.includes(n.href));return t?t.hint:null}function Xi(e){let t=e.replace(".html",".html?hint=true");return new Promise((n,r)=>{let i=document.createElement("iframe");i.setAttribute("sandbox","allow-scripts allow-same-origin"),i.setAttribute("src",t),i.style.display="none";function s(a){let{href:l,hint:u}=a.data;t===l&&(o(),n(u))}Oe.cancelHintFetching=()=>{o(),r(new Error("cancelled"))};function o(){i.remove(),window.removeEventListener("message",s),Oe.cancelHintFetching=null}window.addEventListener("message",s),document.body.appendChild(i)})}function xn(){Oe.cancelHintFetching&&Oe.cancelHintFetching()}function En(e){let n=e.querySelector("h1").textContent,r=e.querySelector(".docstring > p"),i=r?r.innerHTML:"";return{kind:K.function,title:n.trim(),description:i.trim()}}function Ln(e){let n=e.querySelector("h1 > span").textContent,r=e.querySelector("#moduledoc p"),i=r?r.innerHTML:"";return{kind:K.module,title:n.trim(),description:i.trim()}}var Zi=".content a",it="#tooltip",es="#tooltip .tooltip-body",wn="body .content-inner",ts="#content",kn="tooltip-shown",le=10,ns=le*4,Tn={height:450,width:768},rs=100,ne={currentLinkElement:null,hoverDelayTimeout:null};function _n(){is(),ss()}function is(){let e=Handlebars.templates["tooltip-layout"]();c(wn).insertAdjacentHTML("beforeend",e)}function ss(){k(Zi).forEach(e=>{os(e)&&(e.addEventListener("mouseenter",t=>{cs(e)}),e.addEventListener("mouseleave",t=>{fs(e)}))})}function os(e){return!(e.classList.contains("detail-link")||as(e.href)||!vn(e.href))}function as(e){let t=e.replace(ts,"");return window.location.href.split("#")[0]===t}function cs(e){ls()&&(ne.currentLinkElement=e,ne.hoverDelayTimeout=setTimeout(()=>{bn(e.href).then(t=>{us(t),ds()}).catch(()=>{})},rs))}function ls(){let e=window.innerWidthe.firstElementChild&&e.firstElementChild.tagName==="CODE").forEach(e=>e.insertAdjacentHTML("beforeend",Es)),Array.from(k(".copy-button")).forEach(e=>{let t;e.addEventListener("click",()=>{let n=e.querySelector("[aria-live]");t&&clearTimeout(t);let r=Array.from(e.parentElement.querySelector("code").childNodes).filter(i=>!(i.tagName==="SPAN"&&i.classList.contains("unselectable"))).map(i=>i.textContent).join("");navigator.clipboard.writeText(r),e.classList.add("clicked"),n.innerHTML="Copied! ✓",t=setTimeout(()=>{e.classList.remove("clicked"),n.innerHTML=""},3e3)})})}function Pn(){let t=/(Macintosh|iPhone|iPad|iPod)/.test(window.navigator.userAgent)?"apple-os":"non-apple-os";document.documentElement.classList.add(t)}var Ts="content",ws="tabs-open",ks="tabs-close",_s="H3",Is="tabset";function Nn(){Os().map(Cs).forEach(n=>Rs(n))}function Os(){let e=document.createNodeIterator(document.getElementById(Ts),NodeFilter.SHOW_COMMENT,{acceptNode(r){return r.nodeValue.trim()===ws?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),t=[],n;for(;n=e.nextNode();)t.push(n);return t}function Cs(e,t,n){let r=[],i=[],s={label:"",content:[]};for(;e=e.nextSibling;){if(As(e)){Rn(s,i,t);break}r.push(e),e.nodeName===_s?(Rn(s,i,t),s.label=e.innerText,s.content=[]):s.content.push(e.outerHTML)}let o=document.createElement("div");return o.className=Is,Ps(r,o),o.innerHTML=Handlebars.templates.tabset({tabs:i}),o}function As(e){return e.nodeName==="#comment"&&e.nodeValue.trim()===ks}function Rn(e,t,n){if(e.label===""&&!e.content.length)return!1;let r=e.label,i=e.content;t.push({label:r,content:i,setIndex:n})}function Ps(e,t){if(!e||!e.length)return!1;e[0].parentNode.insertBefore(t,e[0]),e.forEach(n=>t.appendChild(n))}function Rs(e){let t={tabs:e.querySelectorAll(':scope [role="tab"]'),panels:e.querySelectorAll(':scope [role="tabpanel"]'),activeIndex:0};t.tabs.forEach((n,r)=>{n.addEventListener("click",i=>{Y(r,t)}),n.addEventListener("keydown",i=>{let s=t.tabs.length-1;i.code==="ArrowLeft"?(i.preventDefault(),t.activeIndex===0?Y(s,t):Y(t.activeIndex-1,t)):i.code==="ArrowRight"?(i.preventDefault(),t.activeIndex===s?Y(0,t):Y(t.activeIndex+1,t)):i.code==="Home"?(i.preventDefault(),Y(0,t)):i.code==="End"&&(i.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}ft(()=>{Xt(),Tt(),Ct(),Mt(),$t(),gt(),nn(),sn(),yn(),dn(),Yt(),_n(),Cn(),Gt(),An(),mn(),Pn(),Nn()});})(); /*! Bundled license information: lunr/lunr.js: