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8BgD,UAAY,KAEtE,EAOAuB,GAnCAnG,OAAOF,iBACL,WACC2C,IACC,IAAIX,EAAQL,KAEPgB,EAAM2D,SAAW3D,EAAM4D,UAA0B,QAAd5D,EAAM6D,MAC5C7D,EAAM8D,iBACN1E,KAGOjC,SAASsC,gBAAkBJ,GAAuB,UAAdW,EAAM6D,MACjDzE,GACF,IAEF,GAyBFjC,SAAS+B,iBAAiB,0BAA0BkC,SAASC,IAC3DA,EAAIW,QAAU5C,CAAiB,IAIjC,IAAI2E,EAAU5G,SAASgC,cAAc,2BACjC4E,IACFA,EAAQ/B,QAAU5C,EACpB,IAuIFnC,GA/BA,WAkBmB,IAAI+G,kBAjBG,CAACC,EAAcC,KACrCD,EAAa7C,SAAS+C,IAEe,IAA/BA,EAASC,WAAWrF,aAGYsF,IAAhCF,EAASC,WAAW,GAAGjD,OAGuC,GAA9DgD,EAASC,WAAW,GAAGjD,KAAKmD,OAAO,wBACrCH,EAASC,WAAWhD,SAASQ,IAC3BzE,SAASoH,eAAe,wBAAwBtC,OAAOL,EAAK,GAEhE,GACA,IAKK4C,QAAQrH,SAASsH,KADX,CAAEC,WAAW,GAE9B,G","sources":["webpack://pydata_sphinx_theme/./src/pydata_sphinx_theme/assets/scripts/mixin.js","webpack://pydata_sphinx_theme/./src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js"],"sourcesContent":["/* define several functions to replace jQuery methods\n * inspired by https://tobiasahlin.com/blog/move-from-jquery-to-vanilla-javascript/\n */\n\n/**\n * Execute a method if DOM has finished loading\n *\n * @param {function} callback the method to execute\n */\nexport function documentReady(callback) {\n if (document.readyState != \"loading\") callback();\n else document.addEventListener(\"DOMContentLoaded\", callback);\n}\n","// Define the custom behavior of the page\nimport { documentReady } from \"./mixin\";\n\nimport \"../styles/pydata-sphinx-theme.scss\";\n\n/*******************************************************************************\n * Theme interaction\n */\n\nvar prefersDark = window.matchMedia(\"(prefers-color-scheme: dark)\");\n\n/**\n * set the the body theme to the one specified by the user browser\n *\n * @param {event} e\n */\nfunction autoTheme(e) {\n document.documentElement.dataset.theme = prefersDark.matches\n ? \"dark\"\n : \"light\";\n}\n\n/**\n * Set the theme using the specified mode.\n * It can be one of [\"auto\", \"dark\", \"light\"]\n *\n * @param {str} mode\n */\nfunction setTheme(mode) {\n if (mode !== \"light\" && mode !== \"dark\" && mode !== \"auto\") {\n console.error(`Got invalid theme mode: ${mode}. Resetting to auto.`);\n mode = \"auto\";\n }\n\n // get the theme\n var colorScheme = prefersDark.matches ? \"dark\" : \"light\";\n document.documentElement.dataset.mode = mode;\n var theme = mode == \"auto\" ? colorScheme : mode;\n document.documentElement.dataset.theme = theme;\n\n // save mode and theme\n localStorage.setItem(\"mode\", mode);\n localStorage.setItem(\"theme\", theme);\n console.log(`[PST]: Changed to ${mode} mode using the ${theme} theme.`);\n\n // add a listener if set on auto\n prefersDark.onchange = mode == \"auto\" ? autoTheme : \"\";\n}\n\n/**\n * Change the theme option order so that clicking on the btn is always a change\n * from \"auto\"\n */\nfunction cycleMode() {\n const defaultMode = document.documentElement.dataset.defaultMode || \"auto\";\n const currentMode = localStorage.getItem(\"mode\") || defaultMode;\n\n var loopArray = (arr, current) => {\n var nextPosition = arr.indexOf(current) + 1;\n if (nextPosition === arr.length) {\n nextPosition = 0;\n }\n return arr[nextPosition];\n };\n\n // make sure the next theme after auto is always a change\n var modeList = prefersDark.matches\n ? [\"auto\", \"light\", \"dark\"]\n : [\"auto\", \"dark\", \"light\"];\n var newMode = loopArray(modeList, currentMode);\n setTheme(newMode);\n}\n\n/**\n * add the theme listener on the btns of the navbar\n */\nfunction addModeListener() {\n // the theme was set a first time using the initial mini-script\n // running setMode will ensure the use of the dark mode if auto is selected\n setTheme(document.documentElement.dataset.mode);\n\n // Attach event handlers for toggling themes colors\n document.querySelectorAll(\".theme-switch-button\").forEach((el) => {\n el.addEventListener(\"click\", cycleMode);\n });\n}\n\n/*******************************************************************************\n * TOC interactivity\n */\n\n/**\n * TOC sidebar - add \"active\" class to parent list\n *\n * Bootstrap's scrollspy adds the active class to the <a> link,\n * but for the automatic collapsing we need this on the parent list item.\n *\n * The event is triggered on \"window\" (and not the nav item as documented),\n * see https://github.com/twbs/bootstrap/issues/20086\n */\nfunction addTOCInteractivity() {\n window.addEventListener(\"activate.bs.scrollspy\", function () {\n const navLinks = document.querySelectorAll(\".bd-toc-nav a\");\n\n navLinks.forEach((navLink) => {\n navLink.parentElement.classList.remove(\"active\");\n });\n\n const activeNavLinks = document.querySelectorAll(\".bd-toc-nav a.active\");\n activeNavLinks.forEach((navLink) => {\n navLink.parentElement.classList.add(\"active\");\n });\n });\n}\n\n/*******************************************************************************\n * Scroll\n */\n\n/**\n * Navigation sidebar scrolling to active page\n */\nfunction scrollToActive() {\n // If the docs nav doesn't exist, do nothing (e.g., on search page)\n if (!document.querySelector(\".bd-docs-nav\")) {\n return;\n }\n\n var sidebar = document.querySelector(\"div.bd-sidebar\");\n\n // Remember the sidebar scroll position between page loads\n // Inspired on source of revealjs.com\n let storedScrollTop = parseInt(\n sessionStorage.getItem(\"sidebar-scroll-top\"),\n 10\n );\n\n if (!isNaN(storedScrollTop)) {\n // If we've got a saved scroll position, just use that\n sidebar.scrollTop = storedScrollTop;\n console.log(\"[PST]: Scrolled sidebar using stored browser position...\");\n } else {\n // Otherwise, calculate a position to scroll to based on the lowest `active` link\n var sidebarNav = document.querySelector(\".bd-docs-nav\");\n var active_pages = sidebarNav.querySelectorAll(\".active\");\n if (active_pages.length > 0) {\n // Use the last active page as the offset since it's the page we're on\n var latest_active = active_pages[active_pages.length - 1];\n var offset =\n latest_active.getBoundingClientRect().y -\n sidebar.getBoundingClientRect().y;\n // Only scroll the navbar if the active link is lower than 50% of the page\n if (latest_active.getBoundingClientRect().y > window.innerHeight * 0.5) {\n let buffer = 0.25; // Buffer so we have some space above the scrolled item\n sidebar.scrollTop = offset - sidebar.clientHeight * buffer;\n console.log(\"[PST]: Scrolled sidebar using last active link...\");\n }\n }\n }\n\n // Store the sidebar scroll position\n window.addEventListener(\"beforeunload\", () => {\n sessionStorage.setItem(\"sidebar-scroll-top\", sidebar.scrollTop);\n });\n}\n\n/*******************************************************************************\n * Search\n */\n\n/**\n * Find any search forms on the page and return their input element\n */\nvar findSearchInput = () => {\n let forms = document.querySelectorAll(\"form.bd-search\");\n if (!forms.length) {\n // no search form found\n return;\n } else {\n var form;\n if (forms.length == 1) {\n // there is exactly one search form (persistent or hidden)\n form = forms[0];\n } else {\n // must be at least one persistent form, use the first persistent one\n form = document.querySelector(\n \"div:not(.search-button__search-container) > form.bd-search\"\n );\n }\n return form.querySelector(\"input\");\n }\n};\n\n/**\n * Activate the search field on the page.\n * - If there is a search field already visible it will be activated.\n * - If not, then a search field will pop up.\n */\nvar toggleSearchField = () => {\n // Find the search input to highlight\n let input = findSearchInput();\n\n // if the input field is the hidden one (the one associated with the\n // search button) then toggle the button state (to show/hide the field)\n let searchPopupWrapper = document.querySelector(\".search-button__wrapper\");\n let hiddenInput = searchPopupWrapper.querySelector(\"input\");\n if (input === hiddenInput) {\n searchPopupWrapper.classList.toggle(\"show\");\n }\n // when toggling off the search field, remove its focus\n if (document.activeElement === input) {\n input.blur();\n } else {\n input.focus();\n input.select();\n input.scrollIntoView({ block: \"center\" });\n }\n};\n\n/**\n * Add an event listener for toggleSearchField() for Ctrl/Cmd + K\n */\nvar addEventListenerForSearchKeyboard = () => {\n window.addEventListener(\n \"keydown\",\n (event) => {\n let input = findSearchInput();\n // toggle on Ctrl+k or ⌘+k\n if ((event.ctrlKey || event.metaKey) && event.code == \"KeyK\") {\n event.preventDefault();\n toggleSearchField();\n }\n // also allow Escape key to hide (but not show) the dynamic search field\n else if (document.activeElement === input && event.code == \"Escape\") {\n toggleSearchField();\n }\n },\n true\n );\n};\n\n/**\n * Change the search hint to `meta key` if we are a Mac\n */\nvar changeSearchShortcutKey = () => {\n let forms = document.querySelectorAll(\"form.bd-search\");\n var isMac = window.navigator.platform.toUpperCase().indexOf(\"MAC\") >= 0;\n if (isMac) {\n forms.forEach(\n (f) => (f.querySelector(\"kbd.kbd-shortcut__modifier\").innerText = \"⌘\")\n );\n }\n};\n\n/**\n * Activate callbacks for search button popup\n */\nvar setupSearchButtons = () => {\n changeSearchShortcutKey();\n addEventListenerForSearchKeyboard();\n\n // Add the search button trigger event callback\n document.querySelectorAll(\".search-button__button\").forEach((btn) => {\n btn.onclick = toggleSearchField;\n });\n\n // Add the search button overlay event callback\n let overlay = document.querySelector(\".search-button__overlay\");\n if (overlay) {\n overlay.onclick = toggleSearchField;\n }\n};\n\n/*******************************************************************************\n * Version Switcher\n * Note that this depends on two variables existing that are defined in\n * and `html-page-context` hook:\n *\n * - DOCUMENTATION_OPTIONS.pagename\n * - DOCUMENTATION_OPTIONS.theme_switcher_url\n */\n\n/**\n * Check if corresponding page path exists in other version of docs\n * and, if so, go there instead of the homepage of the other docs version\n *\n * @param {event} event the event that trigger the check\n */\nfunction checkPageExistsAndRedirect(event) {\n const currentFilePath = `${DOCUMENTATION_OPTIONS.pagename}.html`,\n tryUrl = event.target.getAttribute(\"href\");\n let otherDocsHomepage = tryUrl.replace(currentFilePath, \"\");\n\n fetch(tryUrl, { method: \"HEAD\" })\n .then(() => {\n location.href = tryUrl;\n }) // if the page exists, go there\n .catch((error) => {\n location.href = otherDocsHomepage;\n });\n\n // this prevents the browser from following the href of the clicked node\n // (which is fine because this function takes care of redirecting)\n return false;\n}\n\n// Populate the version switcher from the JSON config file\nvar themeSwitchBtns = document.querySelectorAll(\".version-switcher__button\");\nif (themeSwitchBtns.length) {\n fetch(DOCUMENTATION_OPTIONS.theme_switcher_json_url)\n .then((res) => {\n return res.json();\n })\n .then((data) => {\n const currentFilePath = `${DOCUMENTATION_OPTIONS.pagename}.html`;\n themeSwitchBtns.forEach((btn) => {\n // Set empty strings by default so that these attributes exist and can be used in CSS selectors\n btn.dataset[\"activeVersionName\"] = \"\";\n btn.dataset[\"activeVersion\"] = \"\";\n });\n // create links to the corresponding page in the other docs versions\n data.forEach((entry) => {\n // if no custom name specified (e.g., \"latest\"), use version string\n if (!(\"name\" in entry)) {\n entry.name = entry.version;\n }\n // create the node\n const span = document.createElement(\"span\");\n span.textContent = `${entry.name}`;\n\n const node = document.createElement(\"a\");\n node.setAttribute(\n \"class\",\n \"list-group-item list-group-item-action py-1\"\n );\n node.setAttribute(\"href\", `${entry.url}${currentFilePath}`);\n node.appendChild(span);\n\n // on click, AJAX calls will check if the linked page exists before\n // trying to redirect, and if not, will redirect to the homepage\n // for that version of the docs.\n node.onclick = checkPageExistsAndRedirect;\n // Add dataset values for the version and name in case people want\n // to apply CSS styling based on this information.\n node.dataset[\"versionName\"] = entry.name;\n node.dataset[\"version\"] = entry.version;\n\n document.querySelector(\".version-switcher__menu\").append(node);\n // replace dropdown button text with the preferred display name of\n // this version, rather than using sphinx's {{ version }} variable.\n // also highlight the dropdown entry for the currently-viewed\n // version's entry\n if (\n entry.version ==\n \"DOCUMENTATION_OPTIONS.version_switcher_version_match\"\n ) {\n node.classList.add(\"active\");\n themeSwitchBtns.forEach((btn) => {\n btn.innerText = btn.dataset[\"activeVersionName\"] = entry.name;\n btn.dataset[\"activeVersion\"] = entry.version;\n });\n }\n });\n });\n}\n\n/*******************************************************************************\n * MutationObserver to move the ReadTheDocs button\n */\n\n/**\n * intercept the RTD flyout and place it in the rtd-footer-container if existing\n * if not it stays where on top of the page\n */\nfunction initRTDObserver() {\n const mutatedCallback = (mutationList, observer) => {\n mutationList.forEach((mutation) => {\n // Check whether the mutation is for RTD, which will have a specific structure\n if (mutation.addedNodes.length === 0) {\n return;\n }\n if (mutation.addedNodes[0].data === undefined) {\n return;\n }\n if (mutation.addedNodes[0].data.search(\"Inserted RTD Footer\") != -1) {\n mutation.addedNodes.forEach((node) => {\n document.getElementById(\"rtd-footer-container\").append(node);\n });\n }\n });\n };\n\n const observer = new MutationObserver(mutatedCallback);\n const config = { childList: true };\n observer.observe(document.body, config);\n}\n\n/*******************************************************************************\n * Call functions after document loading.\n */\n\ndocumentReady(addModeListener);\ndocumentReady(scrollToActive);\ndocumentReady(addTOCInteractivity);\ndocumentReady(setupSearchButtons);\ndocumentReady(initRTDObserver);\n"],"names":["documentReady","callback","document","readyState","addEventListener","prefersDark","window","matchMedia","autoTheme","e","documentElement","dataset","theme","matches","setTheme","mode","console","error","colorScheme","localStorage","setItem","log","onchange","cycleMode","defaultMode","currentMode","getItem","arr","nextPosition","indexOf","length","findSearchInput","forms","querySelectorAll","querySelector","toggleSearchField","input","searchPopupWrapper","classList","toggle","activeElement","blur","focus","select","scrollIntoView","block","checkPageExistsAndRedirect","event","currentFilePath","DOCUMENTATION_OPTIONS","pagename","tryUrl","target","getAttribute","otherDocsHomepage","replace","fetch","method","then","location","href","catch","themeSwitchBtns","theme_switcher_json_url","res","json","data","forEach","btn","entry","name","version","span","createElement","textContent","node","setAttribute","url","appendChild","onclick","append","add","innerText","el","sidebar","storedScrollTop","parseInt","sessionStorage","isNaN","active_pages","latest_active","offset","getBoundingClientRect","y","innerHeight","buffer","scrollTop","clientHeight","navLink","parentElement","remove","navigator","platform","toUpperCase","f","changeSearchShortcutKey","ctrlKey","metaKey","code","preventDefault","overlay","MutationObserver","mutationList","observer","mutation","addedNodes","undefined","search","getElementById","observe","body","childList"],"sourceRoot":""} |