mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-27 11:21:28 +08:00
2 lines
9.0 KiB
JavaScript
2 lines
9.0 KiB
JavaScript
![]() |
(()=>{"use strict";var e,t,n,o,r={803:(e,t,n)=>{n.d(t,{Gu:()=>o,qu:()=>r});const o=e=>"string"==typeof e&&/^[v\d]/.test(e)&&a.test(e),r=(e,t,n)=>{h(n);const o=((e,t)=>{const n=c(e),o=c(t),r=n.pop(),a=o.pop(),i=l(n,o);return 0!==i?i:r&&a?l(r.split("."),a.split(".")):r||a?r?-1:1:0})(e,t);return u[n].includes(o)},a=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,c=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(a);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},i=e=>"*"===e||"x"===e||"X"===e,d=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},s=(e,t)=>{if(i(e)||i(t))return 0;const[n,o]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(d(e),d(t));return n>o?1:n<o?-1:0},l=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const o=s(e[n]||"0",t[n]||"0");if(0!==o)return o}return 0},u={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},m=Object.keys(u),h=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===m.indexOf(e))throw new Error(`Invalid operator, expected one of ${m.join("|")}`)}},375:(e,t,n)=>{function o(e){"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)}n.d(t,{A:()=>o})},937:(e,t,n)=>{n.a(e,(async(e,t)=>{try{var o=n(375),r=n(803),a=window.matchMedia("(prefers-color-scheme: dark)");function l(e){document.documentElement.dataset.theme=a.matches?"dark":"light"}function u(e){"light"!==e&&"dark"!==e&&"auto"!==e&&(console.error(`Got invalid theme mode: ${e}. Resetting to auto.`),e="auto");var t=a.matches?"dark":"light";document.documentElement.dataset.mode=e;var n="auto"==e?t:e;document.documentElement.dataset.theme=n,document.querySelectorAll(".dropdown-menu").forEach((e=>{"dark"===n?e.classList.add("dropdown-menu-dark"):e.classList.remove("dropdown-menu-dark")})),localStorage.setItem("mode",e),localStorage.setItem("theme",n),console.log(`[PST]: Changed to ${e} mode using the ${n} theme.`),a.onchange="auto"==e?l:""}function m(){const e=document.documentElement.dataset.defaultMode||"auto",t=localStorage.getItem("mode")||e;var n,o;u(((o=(n=a.matches?["auto","light","dark"]:["auto","dark","light"]).indexOf(t)+1)===n.length&&(o=0),n[o]))}function h(){u(document.documentElement.dataset.mode),document.querySelectorAll(".theme-switch-button").forEach((e=>{e.addEventListener("click",m)}))}function p(){window.addEventListener("activate.bs.scrollspy",(function(){document.querySelectorAll(".bd-toc-nav a").forEach((e=>{e.parentElement.classList.remove("active")})),document.querySelectorAll(".bd-toc-nav a.active").forEach((e=>{e.parentElement.classList.add("active")}))}))}function f(){if(!document.querySelector(".bd-docs-nav"))return;var e=document.querySelector("div.bd-sidebar");let t=parseInt(sessionStorage.getItem("sidebar-scroll-top"),10);if(isNaN(t)){var n=document.querySelector(".bd-docs-nav").querySelectorAll(".active");if(n.length>0){var o=n[n.length-1],r=o.getBoundingClientRect().y-e.getBoundingClientRect().y;if(o.getBoundingClientRect().y>.5*window.innerHeight){let t=.25;e.scrollTop=r-e.clientHeight*t,console.log("[PST]: Scrolled sidebar using last active link...")}}}else e.scrollTop=t,console.log("[PST]: Scrolled sidebar using stored browser position...");window.addEventListener("beforeunload",(()=>{sessionStorage.setItem("sidebar-scroll-top",e.scrollTop)}))}var c=()=>{let e=document.querySelectorAll("form.bd-search");return e.length?(1==e.length?e[0]:document.querySelector("div:not(.search-button__search-container) > form.bd-search")).querySelector("input"):void 0},i=()=>{let e=c(),t=document.querySelector(".search-button__wrapper");e===t.querySelector("input")&&t.classList.toggle("show"),document.activeElement===e?e.blur():(e.focus(),e.select(),e.scrollIntoView({block:"center"}))},d=0===navigator.platform.indexOf("Mac")||"iPhone"===navigator.platform;async function v(e){e.preventDefault();let t=`${DOCUMENTATION_OPTIONS.pagename}.html`,
|
||
|
//# sourceMappingURL=pydata-sphinx-theme.js.map
|