From 4dbd055161a3cee34f0288a2c18e0603a71f1c91 Mon Sep 17 00:00:00 2001 From: Kimi Code Date: Wed, 19 Aug 2026 21:03:54 +0800 Subject: [PATCH 1/2] fix(offline): exact-size quota eviction and budgeted manifest sync --- TECHNICAL.md | 25 ++- docs/docs/changelog/index.md | 35 ++++ docs/docs/changelog/index.zh.md | 30 +++ docsforge/build.py | 7 + .../assets/javascripts/bundle.min.js | 6 +- docsforge/templates/assets/javascripts/sw.js | 2 +- src/assets/javascripts/sw.js | 175 +++++++++++++++--- tests/e2e/conftest.py | 28 ++- tests/e2e/test_browser.py | 160 ++++++++++++++++ tests/integration/test_build_e2e.py | 11 ++ tests/regression/test_regressions.py | 34 ++++ 11 files changed, 475 insertions(+), 38 deletions(-) diff --git a/TECHNICAL.md b/TECHNICAL.md index 2d01e601a..11461a2bf 100644 --- a/TECHNICAL.md +++ b/TECHNICAL.md @@ -283,19 +283,23 @@ Lists every built file with its content hash: ```json { "version": "", - "files": { "assets/javascripts/bundle.min.js": "abc123...", "index.html": "def456..." } + "files": { "assets/javascripts/bundle.min.js": "abc123...", "index.html": "def456..." }, + "sizes": { "assets/javascripts/bundle.min.js": 116474, "index.html": 8212 } } ``` Used by the SW for hash-based invalidation: on sync, files whose hash changed -are re-fetched; files no longer in the manifest are evicted. +are re-fetched; files no longer in the manifest are evicted. The `sizes` map +records the exact byte count of every built file on disk, so quota eviction +accounts entries at their true size instead of guessing. ### Service worker (`src/assets/javascripts/sw.js`) - **Caches**: `docsforge-` (content), `docsforge-meta` (manifest + previous-files list). - **Constants**: `BUILD_HASH`, `BASE_URL` (with trailing-slash normalization), - `ORIGIN_BASE`, `SYNC_CONCURRENCY = 6`, quota margins. + `ORIGIN_BASE`, `SYNC_CONCURRENCY = 6`, `DOWNLOAD_COST_BYTES = 20 MiB` + (per-download budget reservation), `QUOTA_MARGIN_RATIO = 0.1`. - **IndexedDB**: `docsforge-i18n` (locale preference). - **Messages**: - `DOCSFORGE_RELOAD_DETECTED` (from the page, on Navigation Timing @@ -308,7 +312,12 @@ are re-fetched; files no longer in the manifest are evicted. - **Manifest sync**: fetch `cache-manifest.json` (`cache: 'no-cache'`), diff against the previous files list, fetch changed URLs (concurrency 6), evict orphaned entries (LRU by access time when quota exceeded, plus - manifest-driven eviction for files no longer tracked). + manifest-driven eviction for files no longer tracked). The sync is + budgeted against the free space reported by `storage.estimate()`: each + download reserves a flat `DOWNLOAD_COST_BYTES` (20 MiB — the usage + estimate lags behind in-flight writes) and the sync stops once the budget + is exhausted, so files that cannot possibly fit are never downloaded in + the first place. Unbudgeted files are cached on demand when visited. - **Fetch strategy**: pages served from cache with background revalidation; static assets cache-first; navigation requests matched against the manifest (`manifestHasFile`) so pages absent from the manifest never 404 as @@ -316,7 +325,13 @@ are re-fetched; files no longer in the manifest are evicted. (`nav.type === 'back_forward'`) are deliberately **not** treated as revalidation triggers (design decision). - **Quota handling**: on QuotaExceeded, evicts LRU entries (using - `docsforge-access-times`), with a configurable margin, and retries. + `docsforge-access-times`) and retries. Eviction accounts each entry at its + **measured** byte size (Content-Length, falling back to reading the body), + frees until `available + freed` covers the required bytes plus a + proportional 10%-of-quota margin, and drops evicted entries from the + persisted previous-files list (`docsforge-manifest-files`) so a later sync + re-fetches them instead of believing they are cached. A single resource + larger than the whole quota is never cached. --- diff --git a/docs/docs/changelog/index.md b/docs/docs/changelog/index.md index 3a441f661..a846ecc30 100644 --- a/docs/docs/changelog/index.md +++ b/docs/docs/changelog/index.md @@ -1,3 +1,38 @@ +## [12.5.5] — 2026-08-19 + +### Added + +- **File sizes in `cache-manifest.json`** — the manifest now ships a `sizes` + map with the exact byte count of every built file. The service worker uses + it (plus the response's `Content-Length`, measured from the body when + missing) to account quota evictions at their real size instead of the old + guessed 5 MiB per entry. + +### Changed + +- **Service worker quota eviction is exact** — when the browser cache is + full, the SW evicts least-recently-used entries until the actually-freed + bytes (measured, not estimated) cover the required space plus a + proportional 10%-of-quota margin, then retries. The old flat 20 MiB free + margin is gone. Evicted entries are removed from the persisted + previous-files list, so a file that was evicted is never falsely recorded + as cached — the next sync re-fetches it instead of skipping it. +- **Manifest sync is budget-aware** — the background sync now checks the + free space reported by `storage.estimate()` before downloading: every + changed file reserves a flat 20 MiB of budget (the usage estimate lags + behind in-flight writes), and the sync stops once the budget is exhausted + instead of downloading files that would only be evicted again. Files that + don't fit are cached on demand when actually visited. A single resource + larger than the whole quota is never cached. + +### Fixed + +- **Safari (and any small-quota browser) no longer thrashes** — previously + the sync downloaded the whole manifest, hit the quota wall, evicted the + just-cached files, and recorded them as cached anyway; offline coverage + silently degraded to a few tail files. Now the sync stops early and the + tracked-file list stays truthful. + ## [12.5.4] — 2026-08-18 ### Added diff --git a/docs/docs/changelog/index.zh.md b/docs/docs/changelog/index.zh.md index cbc5c1e18..6fe7ab5f7 100644 --- a/docs/docs/changelog/index.zh.md +++ b/docs/docs/changelog/index.zh.md @@ -1,3 +1,33 @@ +## [12.5.5] — 2026-08-19 + +### 新增 + +- **`cache-manifest.json` 附带文件大小** —— manifest 现在带有一个 + `sizes` 映射,记录每个构建文件的精确字节数。Service Worker 用它 + (以及响应的 `Content-Length`,缺失时直接测量响应体)按真实大小进行 + 配额逐出,取代旧的"每个条目按 5 MiB 估算"的做法。 + +### 变更 + +- **Service Worker 配额逐出精确化** —— 浏览器缓存满时,SW 按 + 最近最少使用(LRU)顺序逐出条目,直到实际释放的字节数(真实测量, + 不再估算)覆盖所需空间并留出配额 10% 的成比例余量,然后重试。旧的 + 固定 20 MiB 空闲余量已移除。被逐出的条目会从持久化的"上次同步文件 + 列表"中删除,被逐出的文件绝不会被错误记录为已缓存 —— 下次同步会 + 重新拉取,而不是跳过。 +- **manifest 同步带预算控制** —— 后台同步在下载前先查询 + `storage.estimate()` 报告的空闲空间:每个变更文件预占 20 MiB 预算 + (用量估算落后于在途写入),预算耗尽后同步即停止,不再下载那些注定 + 会被再次逐出的文件。放不下的文件在真正访问时才按需缓存。单个资源 + 大于整个配额时永远不会被缓存。 + +### 修复 + +- **Safari(以及任何小额配额的浏览器)不再抖动** —— 此前同步会下载 + 整个 manifest,撞上配额上限后把刚缓存的文件逐出,却仍把它们记录为 + 已缓存;离线覆盖范围静默退化为 manifest 末尾的少量文件。现在同步会 + 提前停止,已跟踪文件列表始终真实可信。 + ## [12.5.4] — 2026-08-18 ### 新增 diff --git a/docsforge/build.py b/docsforge/build.py index 0d18a7926..fe4047cf1 100644 --- a/docsforge/build.py +++ b/docsforge/build.py @@ -1185,8 +1185,13 @@ def _generate_cache_manifest(site_dir: str, page_urls: list[str], files: Files | index, sitemap, PWA manifest, fonts, etc.). Hashes are computed from the Markdown SOURCE file when one exists, otherwise from the built file on disk. The SW uses this manifest to cache everything directly, without parsing HTML. + + The ``sizes`` map records the byte size of every built file on disk (the + exact number of bytes the SW stores in the browser cache), so quota + eviction can free precisely the space it claims instead of guessing. """ manifest_files = {} + manifest_sizes = {} # Build a lookup from page URL to source Markdown path. Multiple URL forms # can map to the same source (e.g. 'second/', 'second', 'second/index.html'). @@ -1241,10 +1246,12 @@ def _generate_cache_manifest(site_dir: str, page_urls: list[str], files: Files | h = hashlib.sha256(f.read()).hexdigest()[:16] manifest_files[url] = h + manifest_sizes[url] = os.path.getsize(abs_path) manifest = { "version": hashlib.sha256(json.dumps(manifest_files, sort_keys=True).encode()).hexdigest()[:12], "files": manifest_files, + "sizes": manifest_sizes, } manifest_path = os.path.join(site_dir, 'cache-manifest.json') diff --git a/docsforge/templates/assets/javascripts/bundle.min.js b/docsforge/templates/assets/javascripts/bundle.min.js index aa6fefa1f..eb8483dfc 100644 --- a/docsforge/templates/assets/javascripts/bundle.min.js +++ b/docsforge/templates/assets/javascripts/bundle.min.js @@ -1,6 +1,6 @@ -"use strict";(()=>{var Ki=Object.create;var po=Object.defineProperty;var Qi=Object.getOwnPropertyDescriptor;var Yi=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,Gi=Object.prototype.hasOwnProperty;var Mr=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Ji=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Yi(t))!Gi.call(e,n)&&n!==r&&po(e,n,{get:()=>t[n],enumerable:!(o=Qi(t,n))||o.enumerable});return e};var Ht=(e,t,r)=>(r=e!=null?Ki(Bi(e)):{},Ji(t||!e||!e.__esModule?po(r,"default",{value:e,enumerable:!0}):r,e));var fo=Mr((_r,mo)=>{(function(e,t){typeof _r=="object"&&typeof mo<"u"?t():typeof define=="function"&&define.amd?define(t):t()})(_r,(function(){"use strict";function e(r){var o=!0,n=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(k){return!!(k&&k!==document&&k.nodeName!=="HTML"&&k.nodeName!=="BODY"&&"classList"in k&&"contains"in k.classList)}function c(k){var ft=k.type,Fe=k.tagName;return!!(Fe==="INPUT"&&a[ft]&&!k.readOnly||Fe==="TEXTAREA"&&!k.readOnly||k.isContentEditable)}function l(k){k.classList.contains("focus-visible")||(k.classList.add("focus-visible"),k.setAttribute("data-focus-visible-added",""))}function p(k){k.hasAttribute("data-focus-visible-added")&&(k.classList.remove("focus-visible"),k.removeAttribute("data-focus-visible-added"))}function f(k){k.metaKey||k.altKey||k.ctrlKey||(s(r.activeElement)&&l(r.activeElement),o=!0)}function u(k){o=!1}function d(k){s(k.target)&&(o||c(k.target))&&l(k.target)}function v(k){s(k.target)&&(k.target.classList.contains("focus-visible")||k.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(i),i=window.setTimeout(function(){n=!1},100),p(k.target))}function O(k){document.visibilityState==="hidden"&&(n&&(o=!0),J())}function J(){document.addEventListener("mousemove",Z),document.addEventListener("mousedown",Z),document.addEventListener("mouseup",Z),document.addEventListener("pointermove",Z),document.addEventListener("pointerdown",Z),document.addEventListener("pointerup",Z),document.addEventListener("touchmove",Z),document.addEventListener("touchstart",Z),document.addEventListener("touchend",Z)}function te(){document.removeEventListener("mousemove",Z),document.removeEventListener("mousedown",Z),document.removeEventListener("mouseup",Z),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerdown",Z),document.removeEventListener("pointerup",Z),document.removeEventListener("touchmove",Z),document.removeEventListener("touchstart",Z),document.removeEventListener("touchend",Z)}function Z(k){k.target.nodeName&&k.target.nodeName.toLowerCase()==="html"||(o=!1,te())}document.addEventListener("keydown",f,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",O,!0),J(),r.addEventListener("focus",d,!0),r.addEventListener("blur",v,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window<"u"&&typeof document<"u"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch{t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document<"u"&&e(document)}))});var Zr=Mr((Cy,_n)=>{"use strict";var Ua=/["'&<>]/;_n.exports=Wa;function Wa(e){var t=""+e,r=Ua.exec(t);if(!r)return t;var o,n="",i=0,a=0;for(i=r.index;i{(function(t,r){typeof Vt=="object"&&typeof ro=="object"?ro.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Vt=="object"?Vt.ClipboardJS=r():t.ClipboardJS=r()})(Vt,function(){return(function(){var e={686:(function(o,n,i){"use strict";i.d(n,{default:function(){return qi}});var a=i(279),s=i.n(a),c=i(370),l=i.n(c),p=i(817),f=i.n(p);function u(z){try{return document.execCommand(z)}catch{return!1}}var d=function(C){var _=f()(C);return u("cut"),_},v=d;function O(z){var C=document.documentElement.getAttribute("dir")==="rtl",_=document.createElement("textarea");_.style.fontSize="12pt",_.style.border="0",_.style.padding="0",_.style.margin="0",_.style.position="absolute",_.style[C?"right":"left"]="-9999px";var W=window.pageYOffset||document.documentElement.scrollTop;return _.style.top="".concat(W,"px"),_.setAttribute("readonly",""),_.value=z,_}var J=function(C,_){var W=O(C);_.container.appendChild(W);var V=f()(W);return u("copy"),W.remove(),V},te=function(C){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},W="";return typeof C=="string"?W=J(C,_):C instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(C?.type)?W=J(C.value,_):(W=f()(C),u("copy")),W},Z=te;function k(z){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?k=function(_){return typeof _}:k=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},k(z)}var ft=function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_=C.action,W=_===void 0?"copy":_,V=C.container,B=C.target,je=C.text;if(W!=="copy"&&W!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(B!==void 0)if(B&&k(B)==="object"&&B.nodeType===1){if(W==="copy"&&B.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(W==="cut"&&(B.hasAttribute("readonly")||B.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(je)return Z(je,{container:V});if(B)return W==="cut"?v(B):Z(B,{container:V})},Fe=ft;function P(z){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?P=function(_){return typeof _}:P=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},P(z)}function ae(z,C){if(!(z instanceof C))throw new TypeError("Cannot call a class as a function")}function se(z,C){for(var _=0;_"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Qt(z){return Qt=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},Qt(z)}function Lr(z,C){var _="data-clipboard-".concat(z);if(C.hasAttribute(_))return C.getAttribute(_)}var zi=(function(z){Le(_,z);var C=Wi(_);function _(W,V){var B;return ae(this,_),B=C.call(this),B.resolveOptions(V),B.listenClick(W),B}return de(_,[{key:"resolveOptions",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof V.action=="function"?V.action:this.defaultAction,this.target=typeof V.target=="function"?V.target:this.defaultTarget,this.text=typeof V.text=="function"?V.text:this.defaultText,this.container=P(V.container)==="object"?V.container:document.body}},{key:"listenClick",value:function(V){var B=this;this.listener=l()(V,"click",function(je){return B.onClick(je)})}},{key:"onClick",value:function(V){var B=V.delegateTarget||V.currentTarget,je=this.action(B)||"copy",Yt=Fe({action:je,container:this.container,target:this.target(B),text:this.text(B)});this.emit(Yt?"success":"error",{action:je,text:Yt,trigger:B,clearSelection:function(){B&&B.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(V){return Lr("action",V)}},{key:"defaultTarget",value:function(V){var B=Lr("target",V);if(B)return document.querySelector(B)}},{key:"defaultText",value:function(V){return Lr("text",V)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(V){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return Z(V,B)}},{key:"cut",value:function(V){return v(V)}},{key:"isSupported",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],B=typeof V=="string"?[V]:V,je=!!document.queryCommandSupported;return B.forEach(function(Yt){je=je&&!!document.queryCommandSupported(Yt)}),je}}]),_})(s()),qi=zi}),828:(function(o){var n=9;if(typeof Element<"u"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,c){for(;s&&s.nodeType!==n;){if(typeof s.matches=="function"&&s.matches(c))return s;s=s.parentNode}}o.exports=a}),438:(function(o,n,i){var a=i(828);function s(p,f,u,d,v){var O=l.apply(this,arguments);return p.addEventListener(u,O,v),{destroy:function(){p.removeEventListener(u,O,v)}}}function c(p,f,u,d,v){return typeof p.addEventListener=="function"?s.apply(null,arguments):typeof u=="function"?s.bind(null,document).apply(null,arguments):(typeof p=="string"&&(p=document.querySelectorAll(p)),Array.prototype.map.call(p,function(O){return s(O,f,u,d,v)}))}function l(p,f,u,d){return function(v){v.delegateTarget=a(v.target,f),v.delegateTarget&&d.call(p,v)}}o.exports=c}),879:(function(o,n){n.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},n.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||n.node(i[0]))},n.string=function(i){return typeof i=="string"||i instanceof String},n.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}}),370:(function(o,n,i){var a=i(879),s=i(438);function c(u,d,v){if(!u&&!d&&!v)throw new Error("Missing required arguments");if(!a.string(d))throw new TypeError("Second argument must be a String");if(!a.fn(v))throw new TypeError("Third argument must be a Function");if(a.node(u))return l(u,d,v);if(a.nodeList(u))return p(u,d,v);if(a.string(u))return f(u,d,v);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function l(u,d,v){return u.addEventListener(d,v),{destroy:function(){u.removeEventListener(d,v)}}}function p(u,d,v){return Array.prototype.forEach.call(u,function(O){O.addEventListener(d,v)}),{destroy:function(){Array.prototype.forEach.call(u,function(O){O.removeEventListener(d,v)})}}}function f(u,d,v){return s(document.body,u,d,v)}o.exports=c}),817:(function(o){function n(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var c=window.getSelection(),l=document.createRange();l.selectNodeContents(i),c.removeAllRanges(),c.addRange(l),a=c.toString()}return a}o.exports=n}),279:(function(o){function n(){}n.prototype={on:function(i,a,s){var c=this.e||(this.e={});return(c[i]||(c[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var c=this;function l(){c.off(i,l),a.apply(s,arguments)}return l._=a,this.on(i,l,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),c=0,l=s.length;for(c;c0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function q(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),n,i=[],a;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(s){a={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i}function Y(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,i;o1||c(d,O)})},v&&(n[d]=v(n[d])))}function c(d,v){try{l(o[d](v))}catch(O){u(i[0][3],O)}}function l(d){d.value instanceof ut?Promise.resolve(d.value.v).then(p,f):u(i[0][2],d)}function p(d){c("next",d)}function f(d){c("throw",d)}function u(d,v){d(v),i.shift(),i.length&&c(i[0][0],i[0][1])}}function bo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Se=="function"?Se(e):e[Symbol.iterator](),r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r);function o(i){r[i]=e[i]&&function(a){return new Promise(function(s,c){a=e[i](a),n(s,c,a.done,a.value)})}}function n(i,a,s,c){Promise.resolve(c).then(function(l){i({value:l,done:s})},a)}}function R(e){return typeof e=="function"}function gt(e){var t=function(o){Error.call(o),o.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Gt=gt(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: +"use strict";(()=>{var qi=Object.create;var po=Object.defineProperty;var Ki=Object.getOwnPropertyDescriptor;var Qi=Object.getOwnPropertyNames;var Yi=Object.getPrototypeOf,Bi=Object.prototype.hasOwnProperty;var Lr=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Gi=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Qi(t))!Bi.call(e,n)&&n!==r&&po(e,n,{get:()=>t[n],enumerable:!(o=Ki(t,n))||o.enumerable});return e};var Ht=(e,t,r)=>(r=e!=null?qi(Yi(e)):{},Gi(t||!e||!e.__esModule?po(r,"default",{value:e,enumerable:!0}):r,e));var fo=Lr((Mr,mo)=>{(function(e,t){typeof Mr=="object"&&typeof mo<"u"?t():typeof define=="function"&&define.amd?define(t):t()})(Mr,(function(){"use strict";function e(r){var o=!0,n=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(k){return!!(k&&k!==document&&k.nodeName!=="HTML"&&k.nodeName!=="BODY"&&"classList"in k&&"contains"in k.classList)}function c(k){var ft=k.type,Fe=k.tagName;return!!(Fe==="INPUT"&&a[ft]&&!k.readOnly||Fe==="TEXTAREA"&&!k.readOnly||k.isContentEditable)}function l(k){k.classList.contains("focus-visible")||(k.classList.add("focus-visible"),k.setAttribute("data-focus-visible-added",""))}function p(k){k.hasAttribute("data-focus-visible-added")&&(k.classList.remove("focus-visible"),k.removeAttribute("data-focus-visible-added"))}function f(k){k.metaKey||k.altKey||k.ctrlKey||(s(r.activeElement)&&l(r.activeElement),o=!0)}function u(k){o=!1}function d(k){s(k.target)&&(o||c(k.target))&&l(k.target)}function v(k){s(k.target)&&(k.target.classList.contains("focus-visible")||k.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(i),i=window.setTimeout(function(){n=!1},100),p(k.target))}function O(k){document.visibilityState==="hidden"&&(n&&(o=!0),J())}function J(){document.addEventListener("mousemove",Z),document.addEventListener("mousedown",Z),document.addEventListener("mouseup",Z),document.addEventListener("pointermove",Z),document.addEventListener("pointerdown",Z),document.addEventListener("pointerup",Z),document.addEventListener("touchmove",Z),document.addEventListener("touchstart",Z),document.addEventListener("touchend",Z)}function te(){document.removeEventListener("mousemove",Z),document.removeEventListener("mousedown",Z),document.removeEventListener("mouseup",Z),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerdown",Z),document.removeEventListener("pointerup",Z),document.removeEventListener("touchmove",Z),document.removeEventListener("touchstart",Z),document.removeEventListener("touchend",Z)}function Z(k){k.target.nodeName&&k.target.nodeName.toLowerCase()==="html"||(o=!1,te())}document.addEventListener("keydown",f,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",O,!0),J(),r.addEventListener("focus",d,!0),r.addEventListener("blur",v,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window<"u"&&typeof document<"u"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch{t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document<"u"&&e(document)}))});var Xr=Lr((Cy,_n)=>{"use strict";var ja=/["'&<>]/;_n.exports=Ua;function Ua(e){var t=""+e,r=ja.exec(t);if(!r)return t;var o,n="",i=0,a=0;for(i=r.index;i{(function(t,r){typeof Vt=="object"&&typeof to=="object"?to.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Vt=="object"?Vt.ClipboardJS=r():t.ClipboardJS=r()})(Vt,function(){return(function(){var e={686:(function(o,n,i){"use strict";i.d(n,{default:function(){return zi}});var a=i(279),s=i.n(a),c=i(370),l=i.n(c),p=i(817),f=i.n(p);function u(z){try{return document.execCommand(z)}catch{return!1}}var d=function(C){var _=f()(C);return u("cut"),_},v=d;function O(z){var C=document.documentElement.getAttribute("dir")==="rtl",_=document.createElement("textarea");_.style.fontSize="12pt",_.style.border="0",_.style.padding="0",_.style.margin="0",_.style.position="absolute",_.style[C?"right":"left"]="-9999px";var W=window.pageYOffset||document.documentElement.scrollTop;return _.style.top="".concat(W,"px"),_.setAttribute("readonly",""),_.value=z,_}var J=function(C,_){var W=O(C);_.container.appendChild(W);var V=f()(W);return u("copy"),W.remove(),V},te=function(C){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},W="";return typeof C=="string"?W=J(C,_):C instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(C?.type)?W=J(C.value,_):(W=f()(C),u("copy")),W},Z=te;function k(z){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?k=function(_){return typeof _}:k=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},k(z)}var ft=function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_=C.action,W=_===void 0?"copy":_,V=C.container,B=C.target,je=C.text;if(W!=="copy"&&W!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(B!==void 0)if(B&&k(B)==="object"&&B.nodeType===1){if(W==="copy"&&B.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(W==="cut"&&(B.hasAttribute("readonly")||B.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(je)return Z(je,{container:V});if(B)return W==="cut"?v(B):Z(B,{container:V})},Fe=ft;function P(z){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?P=function(_){return typeof _}:P=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},P(z)}function ae(z,C){if(!(z instanceof C))throw new TypeError("Cannot call a class as a function")}function se(z,C){for(var _=0;_"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Qt(z){return Qt=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},Qt(z)}function Or(z,C){var _="data-clipboard-".concat(z);if(C.hasAttribute(_))return C.getAttribute(_)}var Ni=(function(z){Le(_,z);var C=Ui(_);function _(W,V){var B;return ae(this,_),B=C.call(this),B.resolveOptions(V),B.listenClick(W),B}return de(_,[{key:"resolveOptions",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof V.action=="function"?V.action:this.defaultAction,this.target=typeof V.target=="function"?V.target:this.defaultTarget,this.text=typeof V.text=="function"?V.text:this.defaultText,this.container=P(V.container)==="object"?V.container:document.body}},{key:"listenClick",value:function(V){var B=this;this.listener=l()(V,"click",function(je){return B.onClick(je)})}},{key:"onClick",value:function(V){var B=V.delegateTarget||V.currentTarget,je=this.action(B)||"copy",Yt=Fe({action:je,container:this.container,target:this.target(B),text:this.text(B)});this.emit(Yt?"success":"error",{action:je,text:Yt,trigger:B,clearSelection:function(){B&&B.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(V){return Or("action",V)}},{key:"defaultTarget",value:function(V){var B=Or("target",V);if(B)return document.querySelector(B)}},{key:"defaultText",value:function(V){return Or("text",V)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(V){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return Z(V,B)}},{key:"cut",value:function(V){return v(V)}},{key:"isSupported",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],B=typeof V=="string"?[V]:V,je=!!document.queryCommandSupported;return B.forEach(function(Yt){je=je&&!!document.queryCommandSupported(Yt)}),je}}]),_})(s()),zi=Ni}),828:(function(o){var n=9;if(typeof Element<"u"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,c){for(;s&&s.nodeType!==n;){if(typeof s.matches=="function"&&s.matches(c))return s;s=s.parentNode}}o.exports=a}),438:(function(o,n,i){var a=i(828);function s(p,f,u,d,v){var O=l.apply(this,arguments);return p.addEventListener(u,O,v),{destroy:function(){p.removeEventListener(u,O,v)}}}function c(p,f,u,d,v){return typeof p.addEventListener=="function"?s.apply(null,arguments):typeof u=="function"?s.bind(null,document).apply(null,arguments):(typeof p=="string"&&(p=document.querySelectorAll(p)),Array.prototype.map.call(p,function(O){return s(O,f,u,d,v)}))}function l(p,f,u,d){return function(v){v.delegateTarget=a(v.target,f),v.delegateTarget&&d.call(p,v)}}o.exports=c}),879:(function(o,n){n.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},n.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||n.node(i[0]))},n.string=function(i){return typeof i=="string"||i instanceof String},n.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}}),370:(function(o,n,i){var a=i(879),s=i(438);function c(u,d,v){if(!u&&!d&&!v)throw new Error("Missing required arguments");if(!a.string(d))throw new TypeError("Second argument must be a String");if(!a.fn(v))throw new TypeError("Third argument must be a Function");if(a.node(u))return l(u,d,v);if(a.nodeList(u))return p(u,d,v);if(a.string(u))return f(u,d,v);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function l(u,d,v){return u.addEventListener(d,v),{destroy:function(){u.removeEventListener(d,v)}}}function p(u,d,v){return Array.prototype.forEach.call(u,function(O){O.addEventListener(d,v)}),{destroy:function(){Array.prototype.forEach.call(u,function(O){O.removeEventListener(d,v)})}}}function f(u,d,v){return s(document.body,u,d,v)}o.exports=c}),817:(function(o){function n(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var c=window.getSelection(),l=document.createRange();l.selectNodeContents(i),c.removeAllRanges(),c.addRange(l),a=c.toString()}return a}o.exports=n}),279:(function(o){function n(){}n.prototype={on:function(i,a,s){var c=this.e||(this.e={});return(c[i]||(c[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var c=this;function l(){c.off(i,l),a.apply(s,arguments)}return l._=a,this.on(i,l,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),c=0,l=s.length;for(c;c0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function q(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),n,i=[],a;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(s){a={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i}function Y(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,i;o1||c(d,O)})},v&&(n[d]=v(n[d])))}function c(d,v){try{l(o[d](v))}catch(O){u(i[0][3],O)}}function l(d){d.value instanceof ut?Promise.resolve(d.value.v).then(p,f):u(i[0][2],d)}function p(d){c("next",d)}function f(d){c("throw",d)}function u(d,v){d(v),i.shift(),i.length&&c(i[0][0],i[0][1])}}function bo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Se=="function"?Se(e):e[Symbol.iterator](),r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r);function o(i){r[i]=e[i]&&function(a){return new Promise(function(s,c){a=e[i](a),n(s,c,a.done,a.value)})}}function n(i,a,s,c){Promise.resolve(c).then(function(l){i({value:l,done:s})},a)}}function R(e){return typeof e=="function"}function gt(e){var t=function(o){Error.call(o),o.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Gt=gt(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: `+r.map(function(o,n){return n+1+") "+o.toString()}).join(` - `):"",this.name="UnsubscriptionError",this.errors=r}});function Xe(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ne=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,o,n,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Se(a),c=s.next();!c.done;c=s.next()){var l=c.value;l.remove(this)}}catch(O){t={error:O}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var p=this.initialTeardown;if(R(p))try{p()}catch(O){i=O instanceof Gt?O.errors:[O]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var u=Se(f),d=u.next();!d.done;d=u.next()){var v=d.value;try{vo(v)}catch(O){i=i??[],O instanceof Gt?i=Y(Y([],q(i)),q(O.errors)):i.push(O)}}}catch(O){o={error:O}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}}if(i)throw new Gt(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)vo(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Xe(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Xe(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})();var Cr=Ne.EMPTY;function Jt(e){return e instanceof Ne||e&&"closed"in e&&R(e.remove)&&R(e.add)&&R(e.unsubscribe)}function vo(e){R(e)?e():e.unsubscribe()}var Ue={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var yt={setTimeout:function(e,t){for(var r=[],o=2;o0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var o=this,n=this,i=n.hasError,a=n.isStopped,s=n.observers;return i||a?Cr:(this.currentObservers=null,s.push(r),new Ne(function(){o.currentObservers=null,Xe(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var o=this,n=o.hasError,i=o.thrownError,a=o.isStopped;n?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new I;return r.source=this,r},t.create=function(r,o){return new Oo(r,o)},t})(I);var Oo=(function(e){ne(t,e);function t(r,o){var n=e.call(this)||this;return n.destination=r,n.source=o,n}return t.prototype.next=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.next)===null||n===void 0||n.call(o,r)},t.prototype.error=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.error)===null||n===void 0||n.call(o,r)},t.prototype.complete=function(){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||o===void 0||o.call(r)},t.prototype._subscribe=function(r){var o,n;return(n=(o=this.source)===null||o===void 0?void 0:o.subscribe(r))!==null&&n!==void 0?n:Cr},t})(S);var Rr=(function(e){ne(t,e);function t(r){var o=e.call(this)||this;return o._value=r,o}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var o=e.prototype._subscribe.call(this,r);return!o.closed&&r.next(this._value),o},t.prototype.getValue=function(){var r=this,o=r.hasError,n=r.thrownError,i=r._value;if(o)throw n;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(S);var Pt={now:function(){return(Pt.delegate||Date).now()},delegate:void 0};var Rt=(function(e){ne(t,e);function t(r,o,n){r===void 0&&(r=1/0),o===void 0&&(o=1/0),n===void 0&&(n=Pt);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=o,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=o===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,o),i}return t.prototype.next=function(r){var o=this,n=o.isStopped,i=o._buffer,a=o._infiniteTimeWindow,s=o._timestampProvider,c=o._windowTime;n||(i.push(r),!a&&i.push(s.now()+c)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var o=this._innerSubscribe(r),n=this,i=n._infiniteTimeWindow,a=n._buffer,s=a.slice(),c=0;c0?e.prototype.schedule.call(this,r,o):(this.delay=o,this.state=r,this.scheduler.flush(this),this)},t.prototype.execute=function(r,o){return o>0||this.closed?e.prototype.execute.call(this,r,o):this._execute(r,o)},t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!=null&&n>0||n==null&&this.delay>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.flush(this),0)},t})(St);var _o=(function(e){ne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(Tt);var jr=new _o(Mo);var Ao=(function(e){ne(t,e);function t(r,o){var n=e.call(this,r,o)||this;return n.scheduler=r,n.work=o,n}return t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!==null&&n>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.actions.push(this),r._scheduled||(r._scheduled=wt.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,o,n){var i;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,o,n);var a=r.actions;o!=null&&o===r._scheduled&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==o&&(wt.cancelAnimationFrame(o),r._scheduled=void 0)},t})(St);var Co=(function(e){ne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var o;r?o=r.id:(o=this._scheduled,this._scheduled=void 0);var n=this.actions,i;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while((r=n[0])&&r.id===o&&n.shift());if(this._active=!1,i){for(;(r=n[0])&&r.id===o&&n.shift();)r.unsubscribe();throw i}},t})(Tt);var ge=new Co(Ao);var y=new I(function(e){return e.complete()});function er(e){return e&&R(e.schedule)}function Ur(e){return e[e.length-1]}function ct(e){return R(Ur(e))?e.pop():void 0}function Ie(e){return er(Ur(e))?e.pop():void 0}function tr(e,t){return typeof Ur(e)=="number"?e.pop():t}var Ot=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function rr(e){return R(e?.then)}function or(e){return R(e[Et])}function nr(e){return Symbol.asyncIterator&&R(e?.[Symbol.asyncIterator])}function ir(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function aa(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ar=aa();function sr(e){return R(e?.[ar])}function cr(e){return ho(this,arguments,function(){var r,o,n,i;return Bt(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,ut(r.read())];case 3:return o=a.sent(),n=o.value,i=o.done,i?[4,ut(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,ut(n)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function lr(e){return R(e?.getReader)}function j(e){if(e instanceof I)return e;if(e!=null){if(or(e))return sa(e);if(Ot(e))return ca(e);if(rr(e))return la(e);if(nr(e))return ko(e);if(sr(e))return pa(e);if(lr(e))return ma(e)}throw ir(e)}function sa(e){return new I(function(t){var r=e[Et]();if(R(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ca(e){return new I(function(t){for(var r=0;r=2;return function(o){return o.pipe(e?g(function(n,i){return e(n,i,o)}):he,xe(1),r?qe(t):Yo(function(){return new mr}))}}function qr(e){return e<=0?function(){return y}:E(function(t,r){var o=[];t.subscribe(w(r,function(n){o.push(n),e=2,!0))}function le(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new S}:t,o=e.resetOnError,n=o===void 0?!0:o,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(l){var p,f,u,d=0,v=!1,O=!1,J=function(){f?.unsubscribe(),f=void 0},te=function(){J(),p=u=void 0,v=O=!1},Z=function(){var k=p;te(),k?.unsubscribe()};return E(function(k,ft){d++,!O&&!v&&J();var Fe=u=u??r();ft.add(function(){d--,d===0&&!O&&!v&&(f=Kr(Z,c))}),Fe.subscribe(ft),!p&&d>0&&(p=new ht({next:function(P){return Fe.next(P)},error:function(P){O=!0,J(),f=Kr(te,n,P),Fe.error(P)},complete:function(){v=!0,J(),f=Kr(te,a),Fe.complete()}}),j(k).subscribe(p))})(l)}}function Kr(e,t){for(var r=[],o=2;oe.next(document)),e}function M(e,t=document){return Array.from(t.querySelectorAll(e))}function F(e,t=document){let r=fe(e,t);if(typeof r>"u")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function fe(e,t=document){return t.querySelector(e)||void 0}function De(){return document.activeElement?.shadowRoot?.activeElement??document.activeElement??void 0}var Aa=L(h(document.body,"focusin"),h(document.body,"focusout")).pipe(_e(1),K(void 0),m(()=>De()||document.body),X(1));function Ke(e){return Aa.pipe(m(t=>e.contains(t)),Q())}function nt(e,t){return H(()=>L(h(e,"mouseenter").pipe(m(()=>!0)),h(e,"mouseleave").pipe(m(()=>!1))).pipe(t?Ft(r=>ke(+!r*t)):he,K(e.matches(":hover"))))}function Zo(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)Zo(e,r)}function x(e,t,...r){let o=document.createElement(e);if(t)for(let n of Object.keys(t))typeof t[n]>"u"||(typeof t[n]!="boolean"?o.setAttribute(n,t[n]):o.setAttribute(n,""));for(let n of r)Zo(o,n);return o}function hr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function Mt(e){let t=x("script",{src:e});return H(()=>(document.head.appendChild(t),L(h(t,"load"),h(t,"error").pipe(b(()=>Wr(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(m(()=>{}),A(()=>document.head.removeChild(t)),xe(1))))}var en=new S,Ca=H(()=>typeof ResizeObserver>"u"?Mt("https://unpkg.com/resize-observer-polyfill"):$(void 0)).pipe(m(()=>new ResizeObserver(e=>e.forEach(t=>en.next(t)))),b(e=>L(et,$(e)).pipe(A(()=>e.disconnect()))),X(1));function ue(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Te(e){let t=e;for(;t.clientWidth===0&&t.parentElement;)t=t.parentElement;return Ca.pipe(T(r=>r.observe(t)),b(r=>en.pipe(g(o=>o.target===t),A(()=>r.unobserve(t)))),m(()=>ue(e)),K(ue(e)))}function _t(e){return{width:e.scrollWidth,height:e.scrollHeight}}function br(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}function tn(e){let t=[],r=e.parentElement;for(;r;)(e.clientWidth>r.clientWidth||e.clientHeight>r.clientHeight)&&t.push(r),r=(e=r).parentElement;return t.length===0&&t.push(document.documentElement),t}function Qe(e){return{x:e.offsetLeft,y:e.offsetTop}}function rn(e){let t=e.getBoundingClientRect();return{x:t.x+window.scrollX,y:t.y+window.scrollY}}function on(e){return L(h(window,"load"),h(window,"resize")).pipe(He(0,ge),m(()=>Qe(e)),K(Qe(e)))}function vr(e){return{x:e.scrollLeft,y:e.scrollTop}}function Ye(e){return L(h(e,"scroll"),h(window,"scroll"),h(window,"resize")).pipe(He(0,ge),m(()=>vr(e)),K(vr(e)))}var nn=new S,ka=H(()=>$(new IntersectionObserver(e=>{for(let t of e)nn.next(t)},{threshold:0}))).pipe(b(e=>L(et,$(e)).pipe(A(()=>e.disconnect()))),X(1));function pt(e){return ka.pipe(T(t=>t.observe(e)),b(t=>nn.pipe(g(({target:r})=>r===e),A(()=>t.unobserve(e)),m(({isIntersecting:r})=>r))))}function an(e,t=16){return Ye(e).pipe(m(({y:r})=>{let o=ue(e),n=_t(e);return r>=n.height-o.height-t}),Q())}var gr={drawer:F("[data-md-toggle=drawer]"),search:F("[data-md-toggle=search]")};function sn(e){return gr[e].checked}function it(e,t){gr[e].checked!==t&&gr[e].click()}function Be(e){let t=gr[e];return h(t,"change").pipe(m(()=>t.checked),K(t.checked))}function Ha(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function $a(){return L(h(window,"compositionstart").pipe(m(()=>!0)),h(window,"compositionend").pipe(m(()=>!1))).pipe(K(!1))}function cn(){let e=h(window,"keydown").pipe(g(t=>!(t.metaKey||t.ctrlKey)),m(t=>({mode:sn("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),g(({mode:t,type:r})=>{if(t==="global"){let o=De();if(typeof o<"u")return!Ha(o,r)}return!0}),le());return $a().pipe(b(t=>t?y:e))}function Ee(){return new URL(location.href)}function at(e,t=!1){if(D("navigation.instant")&&!t){let r=x("a",{href:e.href});document.body.appendChild(r),r.click(),r.remove()}else location.href=e.href}function ln(){return new S}function pn(){return location.hash.slice(1)}function mn(e){let t=x("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function Gr(e){return L(h(window,"hashchange"),e).pipe(m(pn),K(pn()),g(t=>t.length>0),X(1))}function fn(e){return Gr(e).pipe(m(t=>fe(`[id="${t}"]`)),g(t=>typeof t<"u"))}function Ut(e){let t=matchMedia(e);return fr(r=>t.addListener(()=>r(t.matches))).pipe(K(t.matches))}function un(){let e=matchMedia("print");return L(h(window,"beforeprint").pipe(m(()=>!0)),h(window,"afterprint").pipe(m(()=>!1))).pipe(K(e.matches))}function Jr(e,t){return e.pipe(b(r=>r?t():y))}function Xr(e,t){return new I(r=>{let o=new XMLHttpRequest;o.open("GET",`${e}`),o.responseType="blob";for(let[n,i]of Object.entries(t?.headers??{}))o.setRequestHeader(n,i);return o.addEventListener("load",()=>{o.status>=200&&o.status<300?(r.next(o.response),r.complete()):r.error(new Error(o.statusText))}),o.addEventListener("error",()=>{r.error(new Error("Network error"))}),o.addEventListener("abort",()=>{r.complete()}),typeof t?.progress$<"u"&&(o.addEventListener("progress",n=>{if(n.lengthComputable)t.progress$.next(n.loaded/n.total*100);else{let i=o.getResponseHeader("Content-Length")??0;t.progress$.next(n.loaded/+i*100)}}),t.progress$.next(5)),o.send(),()=>o.abort()})}function Ve(e,t){return Xr(e,t).pipe(b(r=>r.text()),m(r=>JSON.parse(r)),X(1))}function yr(e,t){let r=new DOMParser;return Xr(e,{...t,headers:{...t?.headers??{},"X-DocsForge-Instant-Nav":"1"}}).pipe(b(o=>o.text()),m(o=>r.parseFromString(o,"text/html")),X(1))}function dn(e,t){let r=new DOMParser;return Xr(e,t).pipe(b(o=>o.text()),m(o=>r.parseFromString(o,"text/xml")),X(1))}function hn(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function bn(){return L(h(window,"scroll",{passive:!0}),h(window,"resize",{passive:!0})).pipe(m(hn),K(hn()))}function vn(){return{width:innerWidth,height:innerHeight}}function gn(){return h(window,"resize",{passive:!0}).pipe(m(vn),K(vn()))}function yn(){return N([bn(),gn()]).pipe(m(([e,t])=>({offset:e,size:t})),X(1))}function xr(e,{viewport$:t,header$:r}){let o=t.pipe(oe("size")),n=N([o,r]).pipe(m(()=>Qe(e)));return N([r,t,n]).pipe(m(([{height:i},{offset:a,size:s},{x:c,y:l}])=>({offset:{x:a.x-c,y:a.y-l+i},size:s})))}function Pa(e){return h(e,"message",t=>t.data)}function Ra(e){let t=new S;return t.subscribe(r=>e.postMessage(r)),t}function xn(e,t=new Worker(e)){let r=Pa(t),o=Ra(t),n=new S;n.subscribe(o);let i=o.pipe(re(),ie(!0));return n.pipe(re(),We(r.pipe(U(i))),le())}var Ia=F("#__config"),At=JSON.parse(Ia.textContent);At.base=`${new URL(At.base,Ee())}`;function we(){return At}function D(e){return At.features.includes(e)}function Oe(e,t){return typeof t<"u"?At.translations[e].replace("#",t.toString()):At.translations[e]}function Ae(e,t=document){return F(`[data-md-component=${e}]`,t)}function pe(e,t=document){return M(`[data-md-component=${e}]`,t)}function Fa(e){let t=F(".md-typeset > :first-child",e);return h(t,"click",{once:!0}).pipe(m(()=>F(".md-typeset",e)),m(r=>({hash:__md_hash(r.innerHTML)})))}function En(e){if(!D("announce.dismiss")||!e.childElementCount)return y;if(!e.hidden){let t=F(".md-typeset",e);__md_hash(t.innerHTML)===__md_get("__announce")&&(e.hidden=!0)}return H(()=>{let t=new S;return t.subscribe(({hash:r})=>{e.hidden=!0,__md_set("__announce",r)}),Fa(e).pipe(T(r=>t.next(r)),A(()=>t.complete()),m(r=>({ref:e,...r})))})}function ja(e,{target$:t}){return t.pipe(m(r=>({hidden:r!==e})))}function wn(e,t){let r=new S;return r.subscribe(({hidden:o})=>{e.hidden=o}),ja(e,t).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))}function Wt(e,t){return t==="inline"?x("div",{class:"md-tooltip md-tooltip--inline",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"})):x("div",{class:"md-tooltip",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"}))}function Er(...e){return x("div",{class:"md-tooltip2",role:"dialog"},x("div",{class:"md-tooltip2__inner md-typeset"},e))}function Sn(...e){return x("div",{class:"md-tooltip2",role:"tooltip"},x("div",{class:"md-tooltip2__inner md-typeset"},e))}function Tn(e,t){if(t=t?`${t}_annotation_${e}`:void 0,t){let r=t?`#${t}`:void 0;return x("aside",{class:"md-annotation",tabIndex:0},Wt(t),x("a",{href:r,class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}else return x("aside",{class:"md-annotation",tabIndex:0},Wt(t),x("span",{class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}function On(e){return x("button",{class:"md-code__button",title:Oe("clipboard.copy"),"data-clipboard-target":`#${e} > code`,"data-md-type":"copy"})}function Ln(){return x("button",{class:"md-code__button",title:"Toggle line selection","data-md-type":"select"})}function Mn(){return x("nav",{class:"md-code__nav"})}var An=Ht(Zr());function eo(e,t){let r=t&2,o=t&1,n=Object.keys(e.terms).filter(c=>!e.terms[c]).reduce((c,l)=>[...c,x("del",null,(0,An.default)(l))," "],[]).slice(0,-1),i=we(),a=new URL(e.location,i.base);D("search.highlight")&&a.searchParams.set("h",Object.entries(e.terms).filter(([,c])=>c).reduce((c,[l])=>`${c} ${l}`.trim(),""));let{tags:s}=we();return x("a",{href:`${a}`,class:"md-search-result__link",tabIndex:-1},x("article",{class:"md-search-result__article md-typeset","data-md-score":e.score.toFixed(2)},r>0&&x("div",{class:"md-search-result__icon md-icon"}),r>0&&x("h1",null,e.title),r<=0&&x("h2",null,e.title),o>0&&e.text.length>0&&e.text,e.tags&&x("nav",{class:"md-tags"},e.tags.map(c=>{let l=s?c in s?`md-tag-icon md-tag--${s[c]}`:"md-tag-icon":"";return x("span",{class:`md-tag ${l}`},c)})),o>0&&n.length>0&&x("p",{class:"md-search-result__terms"},Oe("search.result.term.missing"),": ",...n)))}function Cn(e){let t=e[0].score,r=[...e],o=we(),n=r.findIndex(p=>!`${new URL(p.location,o.base)}`.includes("#")),[i]=r.splice(n,1),a=r.findIndex(p=>p.scoreeo(p,1)),...c.length?[x("details",{class:"md-search-result__more"},x("summary",{tabIndex:-1},x("div",null,c.length>0&&c.length===1?Oe("search.result.more.one"):Oe("search.result.more.other",c.length))),...c.map(p=>eo(p,1)))]:[]];return x("li",{class:"md-search-result__item"},l)}function kn(e){return x("ul",{class:"md-source__facts"},Object.entries(e).map(([t,r])=>x("li",{class:`md-source__fact md-source__fact--${t}`},typeof r=="number"?hr(r):r)))}function to(e){let t=`tabbed-control tabbed-control--${e}`;return x("div",{class:t,hidden:!0},x("button",{class:"tabbed-button",tabIndex:-1,"aria-hidden":"true"}))}function Hn(e){return x("div",{class:"md-typeset__scrollwrap"},x("div",{class:"md-typeset__table"},e))}function Da(e){let t=we(),r=new URL(`../${e.version}/`,t.base);return x("li",{class:"md-version__item"},x("a",{href:`${r}`,class:"md-version__link"},e.title,t.version?.alias&&e.aliases.length>0&&x("span",{class:"md-version__alias"},e.aliases[0])))}function $n(e,t){let r=we();return e=e.filter(o=>!o.properties?.hidden),x("div",{class:"md-version"},x("button",{class:"md-version__current","aria-label":Oe("select.version")},t.title,r.version?.alias&&t.aliases.length>0&&x("span",{class:"md-version__alias"},t.aliases[0])),x("ul",{class:"md-version__list"},e.map(Da)))}var Va=0;function Na(e,t=250){let r=N([Ke(e),nt(e,t)]).pipe(m(([n,i])=>n||i),Q()),o=H(()=>tn(e)).pipe(G(Ye),vt(1),$e(r),m(()=>rn(e)));return r.pipe(Pe(n=>n),b(()=>N([r,o])),m(([n,i])=>({active:n,offset:i})),le())}function Dt(e,t,r=250){let{content$:o,viewport$:n}=t,i=`__tooltip2_${Va++}`;return H(()=>{let a=new S,s=new Rr(!1);a.pipe(re(),ie(!1)).subscribe(s);let c=s.pipe(Ft(p=>ke(+!p*250,jr)),Q(),b(p=>p?o:y),T(p=>p.id=i),le());N([a.pipe(m(({active:p})=>p)),c.pipe(b(p=>nt(p,250)),K(!1))]).pipe(m(p=>p.some(f=>f))).subscribe(s);let l=s.pipe(g(p=>p),ee(c,n),m(([p,f,{size:u}])=>{let d=e.getBoundingClientRect(),v=d.width/2;if(f.role==="tooltip")return{x:v,y:8+d.height};if(d.y>=u.height/2){let{height:O}=ue(f);return{x:v,y:-16-O}}else return{x:v,y:16+d.height}}));return N([c,a,l]).subscribe(([p,{offset:f},u])=>{p.style.setProperty("--md-tooltip-host-x",`${f.x}px`),p.style.setProperty("--md-tooltip-host-y",`${f.y}px`),p.style.setProperty("--md-tooltip-x",`${u.x}px`),p.style.setProperty("--md-tooltip-y",`${u.y}px`),p.classList.toggle("md-tooltip2--top",u.y<0),p.classList.toggle("md-tooltip2--bottom",u.y>=0)}),s.pipe(g(p=>p),ee(c,(p,f)=>f),g(p=>p.role==="tooltip")).subscribe(p=>{let f=ue(F(":scope > *",p));p.style.setProperty("--md-tooltip-width",`${f.width}px`),p.style.setProperty("--md-tooltip-tail","0px")}),s.pipe(Q(),ye(ge),ee(c)).subscribe(([p,f])=>{f.classList.toggle("md-tooltip2--active",p)}),N([s.pipe(g(p=>p)),c]).subscribe(([p,f])=>{f.role==="dialog"?(e.setAttribute("aria-controls",i),e.setAttribute("aria-haspopup","dialog")):e.setAttribute("aria-describedby",i)}),s.pipe(g(p=>!p)).subscribe(()=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-haspopup")}),Na(e,r).pipe(T(p=>a.next(p)),A(()=>a.complete()),m(p=>({ref:e,...p})))})}function Ge(e,{viewport$:t},r=document.body){return Dt(e,{content$:new I(o=>{let n=e.title,i=Sn(n);return o.next(i),e.removeAttribute("title"),r.append(i),()=>{i.remove(),e.setAttribute("title",n)}}),viewport$:t},0)}function za(e,t){let r=H(()=>N([on(e),Ye(t)])).pipe(m(([{x:o,y:n},i])=>{let{width:a,height:s}=ue(e);return{x:o-i.x+a/2,y:n-i.y+s/2}}));return Ke(e).pipe(b(o=>r.pipe(m(n=>({active:o,offset:n})),xe(+!o||1/0))))}function Pn(e,t,{target$:r}){let[o,n]=Array.from(e.children);return H(()=>{let i=new S,a=i.pipe(re(),ie(!0));return i.subscribe({next({offset:s}){e.style.setProperty("--md-tooltip-x",`${s.x}px`),e.style.setProperty("--md-tooltip-y",`${s.y}px`)},complete(){e.style.removeProperty("--md-tooltip-x"),e.style.removeProperty("--md-tooltip-y")}}),pt(e).pipe(U(a)).subscribe(s=>{e.toggleAttribute("data-md-visible",s)}),L(i.pipe(g(({active:s})=>s)),i.pipe(_e(250),g(({active:s})=>!s))).subscribe({next({active:s}){s?e.prepend(o):o.remove()},complete(){e.prepend(o)}}),i.pipe(He(16,ge)).subscribe(({active:s})=>{o.classList.toggle("md-tooltip--active",s)}),i.pipe(vt(125,ge),g(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:s})=>s)).subscribe({next(s){s?e.style.setProperty("--md-tooltip-0",`${-s}px`):e.style.removeProperty("--md-tooltip-0")},complete(){e.style.removeProperty("--md-tooltip-0")}}),h(n,"click").pipe(U(a),g(s=>!(s.metaKey||s.ctrlKey))).subscribe(s=>{s.stopPropagation(),s.preventDefault()}),h(n,"mousedown").pipe(U(a),ee(i)).subscribe(([s,{active:c}])=>{if(s.button!==0||s.metaKey||s.ctrlKey)s.preventDefault();else if(c){s.preventDefault();let l=e.parentElement.closest(".md-annotation");l instanceof HTMLElement?l.focus():De()?.blur()}}),r.pipe(U(a),g(s=>s===o),ot(125)).subscribe(()=>e.focus()),za(e,t).pipe(T(s=>i.next(s)),A(()=>i.complete()),m(s=>({ref:e,...s})))})}function qa(e){let t=we();if(e.tagName!=="CODE")return[e];let r=[".c",".c1",".cm"];if(t.annotate&&typeof t.annotate=="object"){let o=e.closest("[class|=language]");if(o)for(let n of Array.from(o.classList)){if(!n.startsWith("language-"))continue;let[,i]=n.split("-");i in t.annotate&&r.push(...t.annotate[i])}}return M(r.join(", "),e)}function Ka(e){let t=[];for(let r of qa(e)){let o=[],n=document.createNodeIterator(r,NodeFilter.SHOW_TEXT);for(let i=n.nextNode();i;i=n.nextNode())o.push(i);for(let i of o){let a;for(;a=/(\(\d+\))(!)?/.exec(i.textContent);){let[,s,c]=a;if(typeof c>"u"){let l=i.splitText(a.index);i=l.splitText(s.length),t.push(l)}else{i.textContent=s,t.push(i);break}}}}return t}function Rn(e,t){t.append(...Array.from(e.childNodes))}function wr(e,t,{target$:r,print$:o}){let i=t.closest("[id]")?.id,a=new Map;for(let s of Ka(t)){let[,c]=s.textContent.match(/\((\d+)\)/);fe(`:scope > li:nth-child(${c})`,e)&&(a.set(c,Tn(c,i)),s.replaceWith(a.get(c)))}return a.size===0?y:H(()=>{let s=new S,c=s.pipe(re(),ie(!0)),l=[];for(let[p,f]of a)l.push([F(".md-typeset",f),F(`:scope > li:nth-child(${p})`,e)]);return o.pipe(U(c)).subscribe(p=>{e.hidden=!p,e.classList.toggle("md-annotation-list",p);for(let[f,u]of l)p?Rn(f,u):Rn(u,f)}),L(...[...a].map(([,p])=>Pn(p,t,{target$:r}))).pipe(A(()=>s.complete()),le())})}function In(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return In(t)}}function Fn(e,t){return H(()=>{let r=In(e);return typeof r<"u"?wr(r,e,t):y})}var Un=Ht(oo());var Qa=0,jn=L(h(window,"keydown").pipe(m(()=>!0)),L(h(window,"keyup"),h(window,"contextmenu")).pipe(m(()=>!1))).pipe(K(!1),X(1));function Wn(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return Wn(t)}}function Ya(e){return Te(e).pipe(m(({width:t})=>({scrollable:_t(e).width>t})),oe("scrollable"))}function Dn(e,t){let{matches:r}=matchMedia("(hover)"),o=H(()=>{let n=new S,i=n.pipe(qr(1));n.subscribe(({scrollable:d})=>{d&&r?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")});let a=[],s=e.closest("pre"),c=s.closest("[id]"),l=c?c.id:Qa++;s.id=`__code_${l}`;let p=[],f=e.closest(".highlight");if(f instanceof HTMLElement){let d=Wn(f);if(typeof d<"u"&&(f.classList.contains("annotate")||D("content.code.annotate"))){let v=wr(d,e,t);p.push(Te(f).pipe(U(i),m(({width:O,height:J})=>O&&J),Q(),b(O=>O?v:y)))}}let u=M(":scope > span[id]",e);if(u.length&&(e.classList.add("md-code__content"),e.closest(".select")||D("content.code.select")&&!e.closest(".no-select"))){let d=+u[0].id.split("-").pop(),v=Ln();a.push(v),D("content.tooltips")&&p.push(Ge(v,{viewport$}));let O=h(v,"click").pipe(jt(P=>!P,!1),T(()=>v.blur()),le());O.subscribe(P=>{v.classList.toggle("md-code__button--active",P)});let J=me(u).pipe(G(P=>nt(P).pipe(m(ae=>[P,ae]))));O.pipe(b(P=>P?J:y)).subscribe(([P,ae])=>{let se=fe(".hll.select",P);if(se&&!ae)se.replaceWith(...Array.from(se.childNodes));else if(!se&&ae){let de=document.createElement("span");de.className="hll select",de.append(...Array.from(P.childNodes).slice(1)),P.append(de)}});let te=me(u).pipe(G(P=>h(P,"mousedown").pipe(T(ae=>ae.preventDefault()),m(()=>P)))),Z=O.pipe(b(P=>P?te:y),ee(jn),m(([P,ae])=>{let se=u.indexOf(P)+d;if(ae===!1)return[se,se];{let de=M(".hll",e).map(Le=>u.indexOf(Le.parentElement)+d);return window.getSelection()?.removeAllRanges(),[Math.min(se,...de),Math.max(se,...de)]}})),k=Gr(y).pipe(g(P=>P.startsWith(`__codelineno-${l}-`)));k.subscribe(P=>{let[,,ae]=P.split("-"),se=ae.split(":").map(Le=>+Le-d+1);se.length===1&&se.push(se[0]);for(let Le of M(".hll:not(.select)",e))Le.replaceWith(...Array.from(Le.childNodes));let de=u.slice(se[0]-1,se[1]);for(let Le of de){let Je=document.createElement("span");Je.className="hll",Je.append(...Array.from(Le.childNodes).slice(1)),Le.append(Je)}}),k.pipe(xe(1),ye(ce)).subscribe(P=>{if(P.includes(":")){let ae=document.getElementById(P.split(":")[0]);ae&&setTimeout(()=>{let se=ae,de=-64;for(;se!==document.body;)de+=se.offsetTop,se=se.offsetParent;window.scrollTo({top:de})},1)}});let Fe=me(M('a[href^="#__codelineno"]',f)).pipe(G(P=>h(P,"click").pipe(T(ae=>ae.preventDefault()),m(()=>P)))).pipe(U(i),ee(jn),m(([P,ae])=>{let de=+F(`[id="${P.hash.slice(1)}"]`).parentElement.id.split("-").pop();if(ae===!1)return[de,de];{let Le=M(".hll",e).map(Je=>+Je.parentElement.id.split("-").pop());return[Math.min(de,...Le),Math.max(de,...Le)]}}));L(Z,Fe).subscribe(P=>{let ae=`#__codelineno-${l}-`;P[0]===P[1]?ae+=P[0]:ae+=`${P[0]}:${P[1]}`,history.replaceState({},"",ae),window.dispatchEvent(new HashChangeEvent("hashchange",{newURL:window.location.origin+window.location.pathname+ae,oldURL:window.location.href}))})}if(Un.default.isSupported()&&(e.closest(".copy")||D("content.code.copy")&&!e.closest(".no-copy"))){let d=On(s.id);a.push(d),D("content.tooltips")&&p.push(Ge(d,{viewport$}))}if(a.length){let d=Mn();d.append(...a),s.insertBefore(d,e)}return Ya(e).pipe(T(d=>n.next(d)),A(()=>n.complete()),m(d=>({ref:e,...d})),We(L(...p).pipe(U(i))))});return D("content.lazy")?pt(e).pipe(g(n=>n),xe(1),b(()=>o)):o}function Ba(e,{target$:t,print$:r}){let o=!0;return L(t.pipe(m(n=>n.closest("details:not([open])")),g(n=>e===n),m(()=>({action:"open",reveal:!0}))),r.pipe(g(n=>n||!o),T(()=>o=e.open),m(n=>({action:n?"open":"close"}))))}function Vn(e,t){return H(()=>{let r=new S;return r.subscribe(({action:o,reveal:n})=>{e.toggleAttribute("open",o==="open"),n&&e.scrollIntoView()}),Ba(e,t).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))})}var Nn=0;function Ga(e){let t=document.createElement("h3");t.innerHTML=e.innerHTML;let r=[t],o=e.nextElementSibling;for(;o&&!(o instanceof HTMLHeadingElement);)r.push(o),o=o.nextElementSibling;return r}function Ja(e,t){for(let r of M("[href], [src]",e))for(let o of["href","src"]){let n=r.getAttribute(o);if(n&&!/^(?:[a-z]+:)?\/\//i.test(n)){r[o]=new URL(r.getAttribute(o),t).toString();break}}for(let r of M("[name^=__], [for]",e))for(let o of["id","for","name"]){let n=r.getAttribute(o);n&&r.setAttribute(o,`${n}$preview_${Nn}`)}return Nn++,$(e)}function zn(e,t){let{sitemap$:r}=t;if(!(e instanceof HTMLAnchorElement))return y;if(!(D("navigation.instant.preview")||e.hasAttribute("data-preview")))return y;e.removeAttribute("title");let o=N([Ke(e),nt(e)]).pipe(m(([i,a])=>i||a),Q(),g(i=>i));return tt([r,o]).pipe(b(([i])=>{let a=new URL(e.href);return a.search=a.hash="",i.has(`${a}`)?$(a):y}),b(i=>yr(i).pipe(b(a=>Ja(a,i)))),b(i=>{let a=e.hash?`article [id="${e.hash.slice(1)}"]`:"article h1",s=fe(a,i);return typeof s>"u"?y:$(Ga(s))})).pipe(b(i=>{let a=new I(s=>{let c=Er(...i);return s.next(c),document.body.append(c),()=>c.remove()});return Dt(e,{content$:a,...t})}))}var qn=`/* ---------------------------------------------------------------------------- + `):"",this.name="UnsubscriptionError",this.errors=r}});function Xe(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ne=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,o,n,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Se(a),c=s.next();!c.done;c=s.next()){var l=c.value;l.remove(this)}}catch(O){t={error:O}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var p=this.initialTeardown;if(R(p))try{p()}catch(O){i=O instanceof Gt?O.errors:[O]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var u=Se(f),d=u.next();!d.done;d=u.next()){var v=d.value;try{vo(v)}catch(O){i=i??[],O instanceof Gt?i=Y(Y([],q(i)),q(O.errors)):i.push(O)}}}catch(O){o={error:O}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}}if(i)throw new Gt(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)vo(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Xe(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Xe(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})();var Ar=Ne.EMPTY;function Jt(e){return e instanceof Ne||e&&"closed"in e&&R(e.remove)&&R(e.add)&&R(e.unsubscribe)}function vo(e){R(e)?e():e.unsubscribe()}var Ue={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var yt={setTimeout:function(e,t){for(var r=[],o=2;o0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var o=this,n=this,i=n.hasError,a=n.isStopped,s=n.observers;return i||a?Ar:(this.currentObservers=null,s.push(r),new Ne(function(){o.currentObservers=null,Xe(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var o=this,n=o.hasError,i=o.thrownError,a=o.isStopped;n?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new I;return r.source=this,r},t.create=function(r,o){return new Oo(r,o)},t})(I);var Oo=(function(e){ne(t,e);function t(r,o){var n=e.call(this)||this;return n.destination=r,n.source=o,n}return t.prototype.next=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.next)===null||n===void 0||n.call(o,r)},t.prototype.error=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.error)===null||n===void 0||n.call(o,r)},t.prototype.complete=function(){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||o===void 0||o.call(r)},t.prototype._subscribe=function(r){var o,n;return(n=(o=this.source)===null||o===void 0?void 0:o.subscribe(r))!==null&&n!==void 0?n:Ar},t})(S);var Pr=(function(e){ne(t,e);function t(r){var o=e.call(this)||this;return o._value=r,o}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var o=e.prototype._subscribe.call(this,r);return!o.closed&&r.next(this._value),o},t.prototype.getValue=function(){var r=this,o=r.hasError,n=r.thrownError,i=r._value;if(o)throw n;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(S);var Pt={now:function(){return(Pt.delegate||Date).now()},delegate:void 0};var Rt=(function(e){ne(t,e);function t(r,o,n){r===void 0&&(r=1/0),o===void 0&&(o=1/0),n===void 0&&(n=Pt);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=o,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=o===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,o),i}return t.prototype.next=function(r){var o=this,n=o.isStopped,i=o._buffer,a=o._infiniteTimeWindow,s=o._timestampProvider,c=o._windowTime;n||(i.push(r),!a&&i.push(s.now()+c)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var o=this._innerSubscribe(r),n=this,i=n._infiniteTimeWindow,a=n._buffer,s=a.slice(),c=0;c0?e.prototype.schedule.call(this,r,o):(this.delay=o,this.state=r,this.scheduler.flush(this),this)},t.prototype.execute=function(r,o){return o>0||this.closed?e.prototype.execute.call(this,r,o):this._execute(r,o)},t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!=null&&n>0||n==null&&this.delay>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.flush(this),0)},t})(St);var _o=(function(e){ne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(Tt);var Fr=new _o(Mo);var Ao=(function(e){ne(t,e);function t(r,o){var n=e.call(this,r,o)||this;return n.scheduler=r,n.work=o,n}return t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!==null&&n>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.actions.push(this),r._scheduled||(r._scheduled=wt.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,o,n){var i;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,o,n);var a=r.actions;o!=null&&o===r._scheduled&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==o&&(wt.cancelAnimationFrame(o),r._scheduled=void 0)},t})(St);var Co=(function(e){ne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var o;r?o=r.id:(o=this._scheduled,this._scheduled=void 0);var n=this.actions,i;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while((r=n[0])&&r.id===o&&n.shift());if(this._active=!1,i){for(;(r=n[0])&&r.id===o&&n.shift();)r.unsubscribe();throw i}},t})(Tt);var ge=new Co(Ao);var y=new I(function(e){return e.complete()});function er(e){return e&&R(e.schedule)}function jr(e){return e[e.length-1]}function ct(e){return R(jr(e))?e.pop():void 0}function Ie(e){return er(jr(e))?e.pop():void 0}function tr(e,t){return typeof jr(e)=="number"?e.pop():t}var Ot=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function rr(e){return R(e?.then)}function or(e){return R(e[Et])}function nr(e){return Symbol.asyncIterator&&R(e?.[Symbol.asyncIterator])}function ir(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ia(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ar=ia();function sr(e){return R(e?.[ar])}function cr(e){return ho(this,arguments,function(){var r,o,n,i;return Bt(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,ut(r.read())];case 3:return o=a.sent(),n=o.value,i=o.done,i?[4,ut(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,ut(n)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function lr(e){return R(e?.getReader)}function j(e){if(e instanceof I)return e;if(e!=null){if(or(e))return aa(e);if(Ot(e))return sa(e);if(rr(e))return ca(e);if(nr(e))return ko(e);if(sr(e))return la(e);if(lr(e))return pa(e)}throw ir(e)}function aa(e){return new I(function(t){var r=e[Et]();if(R(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function sa(e){return new I(function(t){for(var r=0;r=2;return function(o){return o.pipe(e?g(function(n,i){return e(n,i,o)}):he,xe(1),r?qe(t):Yo(function(){return new mr}))}}function zr(e){return e<=0?function(){return y}:E(function(t,r){var o=[];t.subscribe(w(r,function(n){o.push(n),e=2,!0))}function le(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new S}:t,o=e.resetOnError,n=o===void 0?!0:o,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(l){var p,f,u,d=0,v=!1,O=!1,J=function(){f?.unsubscribe(),f=void 0},te=function(){J(),p=u=void 0,v=O=!1},Z=function(){var k=p;te(),k?.unsubscribe()};return E(function(k,ft){d++,!O&&!v&&J();var Fe=u=u??r();ft.add(function(){d--,d===0&&!O&&!v&&(f=qr(Z,c))}),Fe.subscribe(ft),!p&&d>0&&(p=new ht({next:function(P){return Fe.next(P)},error:function(P){O=!0,J(),f=qr(te,n,P),Fe.error(P)},complete:function(){v=!0,J(),f=qr(te,a),Fe.complete()}}),j(k).subscribe(p))})(l)}}function qr(e,t){for(var r=[],o=2;oe.next(document)),e}function M(e,t=document){return Array.from(t.querySelectorAll(e))}function F(e,t=document){let r=fe(e,t);if(typeof r>"u")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function fe(e,t=document){return t.querySelector(e)||void 0}function De(){return document.activeElement?.shadowRoot?.activeElement??document.activeElement??void 0}var _a=L(h(document.body,"focusin"),h(document.body,"focusout")).pipe(_e(1),K(void 0),m(()=>De()||document.body),X(1));function Ke(e){return _a.pipe(m(t=>e.contains(t)),Q())}function nt(e,t){return H(()=>L(h(e,"mouseenter").pipe(m(()=>!0)),h(e,"mouseleave").pipe(m(()=>!1))).pipe(t?Ft(r=>ke(+!r*t)):he,K(e.matches(":hover"))))}function Zo(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)Zo(e,r)}function x(e,t,...r){let o=document.createElement(e);if(t)for(let n of Object.keys(t))typeof t[n]>"u"||(typeof t[n]!="boolean"?o.setAttribute(n,t[n]):o.setAttribute(n,""));for(let n of r)Zo(o,n);return o}function hr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function Mt(e){let t=x("script",{src:e});return H(()=>(document.head.appendChild(t),L(h(t,"load"),h(t,"error").pipe(b(()=>Ur(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(m(()=>{}),A(()=>document.head.removeChild(t)),xe(1))))}var en=new S,Aa=H(()=>typeof ResizeObserver>"u"?Mt("https://unpkg.com/resize-observer-polyfill"):$(void 0)).pipe(m(()=>new ResizeObserver(e=>e.forEach(t=>en.next(t)))),b(e=>L(et,$(e)).pipe(A(()=>e.disconnect()))),X(1));function ue(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Te(e){let t=e;for(;t.clientWidth===0&&t.parentElement;)t=t.parentElement;return Aa.pipe(T(r=>r.observe(t)),b(r=>en.pipe(g(o=>o.target===t),A(()=>r.unobserve(t)))),m(()=>ue(e)),K(ue(e)))}function _t(e){return{width:e.scrollWidth,height:e.scrollHeight}}function br(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}function tn(e){let t=[],r=e.parentElement;for(;r;)(e.clientWidth>r.clientWidth||e.clientHeight>r.clientHeight)&&t.push(r),r=(e=r).parentElement;return t.length===0&&t.push(document.documentElement),t}function Qe(e){return{x:e.offsetLeft,y:e.offsetTop}}function rn(e){let t=e.getBoundingClientRect();return{x:t.x+window.scrollX,y:t.y+window.scrollY}}function on(e){return L(h(window,"load"),h(window,"resize")).pipe(He(0,ge),m(()=>Qe(e)),K(Qe(e)))}function vr(e){return{x:e.scrollLeft,y:e.scrollTop}}function Ye(e){return L(h(e,"scroll"),h(window,"scroll"),h(window,"resize")).pipe(He(0,ge),m(()=>vr(e)),K(vr(e)))}var nn=new S,Ca=H(()=>$(new IntersectionObserver(e=>{for(let t of e)nn.next(t)},{threshold:0}))).pipe(b(e=>L(et,$(e)).pipe(A(()=>e.disconnect()))),X(1));function pt(e){return Ca.pipe(T(t=>t.observe(e)),b(t=>nn.pipe(g(({target:r})=>r===e),A(()=>t.unobserve(e)),m(({isIntersecting:r})=>r))))}function an(e,t=16){return Ye(e).pipe(m(({y:r})=>{let o=ue(e),n=_t(e);return r>=n.height-o.height-t}),Q())}var gr={drawer:F("[data-md-toggle=drawer]"),search:F("[data-md-toggle=search]")};function sn(e){return gr[e].checked}function it(e,t){gr[e].checked!==t&&gr[e].click()}function Be(e){let t=gr[e];return h(t,"change").pipe(m(()=>t.checked),K(t.checked))}function ka(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function Ha(){return L(h(window,"compositionstart").pipe(m(()=>!0)),h(window,"compositionend").pipe(m(()=>!1))).pipe(K(!1))}function cn(){let e=h(window,"keydown").pipe(g(t=>!(t.metaKey||t.ctrlKey)),m(t=>({mode:sn("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),g(({mode:t,type:r})=>{if(t==="global"){let o=De();if(typeof o<"u")return!ka(o,r)}return!0}),le());return Ha().pipe(b(t=>t?y:e))}function Ee(){return new URL(location.href)}function at(e,t=!1){if(D("navigation.instant")&&!t){let r=x("a",{href:e.href});document.body.appendChild(r),r.click(),r.remove()}else location.href=e.href}function ln(){return new S}function pn(){return location.hash.slice(1)}function mn(e){let t=x("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function Br(e){return L(h(window,"hashchange"),e).pipe(m(pn),K(pn()),g(t=>t.length>0),X(1))}function fn(e){return Br(e).pipe(m(t=>fe(`[id="${t}"]`)),g(t=>typeof t<"u"))}function Ut(e){let t=matchMedia(e);return fr(r=>t.addListener(()=>r(t.matches))).pipe(K(t.matches))}function un(){let e=matchMedia("print");return L(h(window,"beforeprint").pipe(m(()=>!0)),h(window,"afterprint").pipe(m(()=>!1))).pipe(K(e.matches))}function Gr(e,t){return e.pipe(b(r=>r?t():y))}function Jr(e,t){return new I(r=>{let o=new XMLHttpRequest;o.open("GET",`${e}`),o.responseType="blob";for(let[n,i]of Object.entries(t?.headers??{}))o.setRequestHeader(n,i);return o.addEventListener("load",()=>{o.status>=200&&o.status<300?(r.next(o.response),r.complete()):r.error(new Error(o.statusText))}),o.addEventListener("error",()=>{r.error(new Error("Network error"))}),o.addEventListener("abort",()=>{r.complete()}),typeof t?.progress$<"u"&&(o.addEventListener("progress",n=>{if(n.lengthComputable)t.progress$.next(n.loaded/n.total*100);else{let i=o.getResponseHeader("Content-Length")??0;t.progress$.next(n.loaded/+i*100)}}),t.progress$.next(5)),o.send(),()=>o.abort()})}function Ve(e,t){return Jr(e,t).pipe(b(r=>r.text()),m(r=>JSON.parse(r)),X(1))}function yr(e,t){let r=new DOMParser;return Jr(e,{...t,headers:{...t?.headers??{},"X-DocsForge-Instant-Nav":"1"}}).pipe(b(o=>o.text()),m(o=>r.parseFromString(o,"text/html")),X(1))}function dn(e,t){let r=new DOMParser;return Jr(e,t).pipe(b(o=>o.text()),m(o=>r.parseFromString(o,"text/xml")),X(1))}function hn(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function bn(){return L(h(window,"scroll",{passive:!0}),h(window,"resize",{passive:!0})).pipe(m(hn),K(hn()))}function vn(){return{width:innerWidth,height:innerHeight}}function gn(){return h(window,"resize",{passive:!0}).pipe(m(vn),K(vn()))}function yn(){return N([bn(),gn()]).pipe(m(([e,t])=>({offset:e,size:t})),X(1))}function xr(e,{viewport$:t,header$:r}){let o=t.pipe(oe("size")),n=N([o,r]).pipe(m(()=>Qe(e)));return N([r,t,n]).pipe(m(([{height:i},{offset:a,size:s},{x:c,y:l}])=>({offset:{x:a.x-c,y:a.y-l+i},size:s})))}function $a(e){return h(e,"message",t=>t.data)}function Pa(e){let t=new S;return t.subscribe(r=>e.postMessage(r)),t}function xn(e,t=new Worker(e)){let r=$a(t),o=Pa(t),n=new S;n.subscribe(o);let i=o.pipe(re(),ie(!0));return n.pipe(re(),We(r.pipe(U(i))),le())}var Ra=F("#__config"),At=JSON.parse(Ra.textContent);At.base=`${new URL(At.base,Ee())}`;function we(){return At}function D(e){return At.features.includes(e)}function Oe(e,t){return typeof t<"u"?At.translations[e].replace("#",t.toString()):At.translations[e]}function Ae(e,t=document){return F(`[data-md-component=${e}]`,t)}function pe(e,t=document){return M(`[data-md-component=${e}]`,t)}function Ia(e){let t=F(".md-typeset > :first-child",e);return h(t,"click",{once:!0}).pipe(m(()=>F(".md-typeset",e)),m(r=>({hash:__md_hash(r.innerHTML)})))}function En(e){if(!D("announce.dismiss")||!e.childElementCount)return y;if(!e.hidden){let t=F(".md-typeset",e);__md_hash(t.innerHTML)===__md_get("__announce")&&(e.hidden=!0)}return H(()=>{let t=new S;return t.subscribe(({hash:r})=>{e.hidden=!0,__md_set("__announce",r)}),Ia(e).pipe(T(r=>t.next(r)),A(()=>t.complete()),m(r=>({ref:e,...r})))})}function Fa(e,{target$:t}){return t.pipe(m(r=>({hidden:r!==e})))}function wn(e,t){let r=new S;return r.subscribe(({hidden:o})=>{e.hidden=o}),Fa(e,t).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))}function Wt(e,t){return t==="inline"?x("div",{class:"md-tooltip md-tooltip--inline",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"})):x("div",{class:"md-tooltip",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"}))}function Er(...e){return x("div",{class:"md-tooltip2",role:"dialog"},x("div",{class:"md-tooltip2__inner md-typeset"},e))}function Sn(...e){return x("div",{class:"md-tooltip2",role:"tooltip"},x("div",{class:"md-tooltip2__inner md-typeset"},e))}function Tn(e,t){if(t=t?`${t}_annotation_${e}`:void 0,t){let r=t?`#${t}`:void 0;return x("aside",{class:"md-annotation",tabIndex:0},Wt(t),x("a",{href:r,class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}else return x("aside",{class:"md-annotation",tabIndex:0},Wt(t),x("span",{class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}function On(e){return x("button",{class:"md-code__button",title:Oe("clipboard.copy"),"data-clipboard-target":`#${e} > code`,"data-md-type":"copy"})}function Ln(){return x("button",{class:"md-code__button",title:"Toggle line selection","data-md-type":"select"})}function Mn(){return x("nav",{class:"md-code__nav"})}var An=Ht(Xr());function Zr(e,t){let r=t&2,o=t&1,n=Object.keys(e.terms).filter(c=>!e.terms[c]).reduce((c,l)=>[...c,x("del",null,(0,An.default)(l))," "],[]).slice(0,-1),i=we(),a=new URL(e.location,i.base);D("search.highlight")&&a.searchParams.set("h",Object.entries(e.terms).filter(([,c])=>c).reduce((c,[l])=>`${c} ${l}`.trim(),""));let{tags:s}=we();return x("a",{href:`${a}`,class:"md-search-result__link",tabIndex:-1},x("article",{class:"md-search-result__article md-typeset","data-md-score":e.score.toFixed(2)},r>0&&x("div",{class:"md-search-result__icon md-icon"}),r>0&&x("h1",null,e.title),r<=0&&x("h2",null,e.title),o>0&&e.text.length>0&&e.text,e.tags&&x("nav",{class:"md-tags"},e.tags.map(c=>{let l=s?c in s?`md-tag-icon md-tag--${s[c]}`:"md-tag-icon":"";return x("span",{class:`md-tag ${l}`},c)})),o>0&&n.length>0&&x("p",{class:"md-search-result__terms"},Oe("search.result.term.missing"),": ",...n)))}function Cn(e){let t=e[0].score,r=[...e],o=we(),n=r.findIndex(p=>!`${new URL(p.location,o.base)}`.includes("#")),[i]=r.splice(n,1),a=r.findIndex(p=>p.scoreZr(p,1)),...c.length?[x("details",{class:"md-search-result__more"},x("summary",{tabIndex:-1},x("div",null,c.length>0&&c.length===1?Oe("search.result.more.one"):Oe("search.result.more.other",c.length))),...c.map(p=>Zr(p,1)))]:[]];return x("li",{class:"md-search-result__item"},l)}function kn(e){return x("ul",{class:"md-source__facts"},Object.entries(e).map(([t,r])=>x("li",{class:`md-source__fact md-source__fact--${t}`},typeof r=="number"?hr(r):r)))}function eo(e){let t=`tabbed-control tabbed-control--${e}`;return x("div",{class:t,hidden:!0},x("button",{class:"tabbed-button",tabIndex:-1,"aria-hidden":"true"}))}function Hn(e){return x("div",{class:"md-typeset__scrollwrap"},x("div",{class:"md-typeset__table"},e))}function Wa(e){let t=we(),r=new URL(`../${e.version}/`,t.base);return x("li",{class:"md-version__item"},x("a",{href:`${r}`,class:"md-version__link"},e.title,t.version?.alias&&e.aliases.length>0&&x("span",{class:"md-version__alias"},e.aliases[0])))}function $n(e,t){let r=we();return e=e.filter(o=>!o.properties?.hidden),x("div",{class:"md-version"},x("button",{class:"md-version__current","aria-label":Oe("select.version")},t.title,r.version?.alias&&t.aliases.length>0&&x("span",{class:"md-version__alias"},t.aliases[0])),x("ul",{class:"md-version__list"},e.map(Wa)))}var Da=0;function Va(e,t=250){let r=N([Ke(e),nt(e,t)]).pipe(m(([n,i])=>n||i),Q()),o=H(()=>tn(e)).pipe(G(Ye),vt(1),$e(r),m(()=>rn(e)));return r.pipe(Pe(n=>n),b(()=>N([r,o])),m(([n,i])=>({active:n,offset:i})),le())}function Dt(e,t,r=250){let{content$:o,viewport$:n}=t,i=`__tooltip2_${Da++}`;return H(()=>{let a=new S,s=new Pr(!1);a.pipe(re(),ie(!1)).subscribe(s);let c=s.pipe(Ft(p=>ke(+!p*250,Fr)),Q(),b(p=>p?o:y),T(p=>p.id=i),le());N([a.pipe(m(({active:p})=>p)),c.pipe(b(p=>nt(p,250)),K(!1))]).pipe(m(p=>p.some(f=>f))).subscribe(s);let l=s.pipe(g(p=>p),ee(c,n),m(([p,f,{size:u}])=>{let d=e.getBoundingClientRect(),v=d.width/2;if(f.role==="tooltip")return{x:v,y:8+d.height};if(d.y>=u.height/2){let{height:O}=ue(f);return{x:v,y:-16-O}}else return{x:v,y:16+d.height}}));return N([c,a,l]).subscribe(([p,{offset:f},u])=>{p.style.setProperty("--md-tooltip-host-x",`${f.x}px`),p.style.setProperty("--md-tooltip-host-y",`${f.y}px`),p.style.setProperty("--md-tooltip-x",`${u.x}px`),p.style.setProperty("--md-tooltip-y",`${u.y}px`),p.classList.toggle("md-tooltip2--top",u.y<0),p.classList.toggle("md-tooltip2--bottom",u.y>=0)}),s.pipe(g(p=>p),ee(c,(p,f)=>f),g(p=>p.role==="tooltip")).subscribe(p=>{let f=ue(F(":scope > *",p));p.style.setProperty("--md-tooltip-width",`${f.width}px`),p.style.setProperty("--md-tooltip-tail","0px")}),s.pipe(Q(),ye(ge),ee(c)).subscribe(([p,f])=>{f.classList.toggle("md-tooltip2--active",p)}),N([s.pipe(g(p=>p)),c]).subscribe(([p,f])=>{f.role==="dialog"?(e.setAttribute("aria-controls",i),e.setAttribute("aria-haspopup","dialog")):e.setAttribute("aria-describedby",i)}),s.pipe(g(p=>!p)).subscribe(()=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-haspopup")}),Va(e,r).pipe(T(p=>a.next(p)),A(()=>a.complete()),m(p=>({ref:e,...p})))})}function Ge(e,{viewport$:t},r=document.body){return Dt(e,{content$:new I(o=>{let n=e.title,i=Sn(n);return o.next(i),e.removeAttribute("title"),r.append(i),()=>{i.remove(),e.setAttribute("title",n)}}),viewport$:t},0)}function Na(e,t){let r=H(()=>N([on(e),Ye(t)])).pipe(m(([{x:o,y:n},i])=>{let{width:a,height:s}=ue(e);return{x:o-i.x+a/2,y:n-i.y+s/2}}));return Ke(e).pipe(b(o=>r.pipe(m(n=>({active:o,offset:n})),xe(+!o||1/0))))}function Pn(e,t,{target$:r}){let[o,n]=Array.from(e.children);return H(()=>{let i=new S,a=i.pipe(re(),ie(!0));return i.subscribe({next({offset:s}){e.style.setProperty("--md-tooltip-x",`${s.x}px`),e.style.setProperty("--md-tooltip-y",`${s.y}px`)},complete(){e.style.removeProperty("--md-tooltip-x"),e.style.removeProperty("--md-tooltip-y")}}),pt(e).pipe(U(a)).subscribe(s=>{e.toggleAttribute("data-md-visible",s)}),L(i.pipe(g(({active:s})=>s)),i.pipe(_e(250),g(({active:s})=>!s))).subscribe({next({active:s}){s?e.prepend(o):o.remove()},complete(){e.prepend(o)}}),i.pipe(He(16,ge)).subscribe(({active:s})=>{o.classList.toggle("md-tooltip--active",s)}),i.pipe(vt(125,ge),g(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:s})=>s)).subscribe({next(s){s?e.style.setProperty("--md-tooltip-0",`${-s}px`):e.style.removeProperty("--md-tooltip-0")},complete(){e.style.removeProperty("--md-tooltip-0")}}),h(n,"click").pipe(U(a),g(s=>!(s.metaKey||s.ctrlKey))).subscribe(s=>{s.stopPropagation(),s.preventDefault()}),h(n,"mousedown").pipe(U(a),ee(i)).subscribe(([s,{active:c}])=>{if(s.button!==0||s.metaKey||s.ctrlKey)s.preventDefault();else if(c){s.preventDefault();let l=e.parentElement.closest(".md-annotation");l instanceof HTMLElement?l.focus():De()?.blur()}}),r.pipe(U(a),g(s=>s===o),ot(125)).subscribe(()=>e.focus()),Na(e,t).pipe(T(s=>i.next(s)),A(()=>i.complete()),m(s=>({ref:e,...s})))})}function za(e){let t=we();if(e.tagName!=="CODE")return[e];let r=[".c",".c1",".cm"];if(t.annotate&&typeof t.annotate=="object"){let o=e.closest("[class|=language]");if(o)for(let n of Array.from(o.classList)){if(!n.startsWith("language-"))continue;let[,i]=n.split("-");i in t.annotate&&r.push(...t.annotate[i])}}return M(r.join(", "),e)}function qa(e){let t=[];for(let r of za(e)){let o=[],n=document.createNodeIterator(r,NodeFilter.SHOW_TEXT);for(let i=n.nextNode();i;i=n.nextNode())o.push(i);for(let i of o){let a;for(;a=/(\(\d+\))(!)?/.exec(i.textContent);){let[,s,c]=a;if(typeof c>"u"){let l=i.splitText(a.index);i=l.splitText(s.length),t.push(l)}else{i.textContent=s,t.push(i);break}}}}return t}function Rn(e,t){t.append(...Array.from(e.childNodes))}function wr(e,t,{target$:r,print$:o}){let i=t.closest("[id]")?.id,a=new Map;for(let s of qa(t)){let[,c]=s.textContent.match(/\((\d+)\)/);fe(`:scope > li:nth-child(${c})`,e)&&(a.set(c,Tn(c,i)),s.replaceWith(a.get(c)))}return a.size===0?y:H(()=>{let s=new S,c=s.pipe(re(),ie(!0)),l=[];for(let[p,f]of a)l.push([F(".md-typeset",f),F(`:scope > li:nth-child(${p})`,e)]);return o.pipe(U(c)).subscribe(p=>{e.hidden=!p,e.classList.toggle("md-annotation-list",p);for(let[f,u]of l)p?Rn(f,u):Rn(u,f)}),L(...[...a].map(([,p])=>Pn(p,t,{target$:r}))).pipe(A(()=>s.complete()),le())})}function In(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return In(t)}}function Fn(e,t){return H(()=>{let r=In(e);return typeof r<"u"?wr(r,e,t):y})}var Un=Ht(ro());var Ka=0,jn=L(h(window,"keydown").pipe(m(()=>!0)),L(h(window,"keyup"),h(window,"contextmenu")).pipe(m(()=>!1))).pipe(K(!1),X(1));function Wn(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return Wn(t)}}function Qa(e){return Te(e).pipe(m(({width:t})=>({scrollable:_t(e).width>t})),oe("scrollable"))}function Dn(e,t){let{matches:r}=matchMedia("(hover)"),o=H(()=>{let n=new S,i=n.pipe(zr(1));n.subscribe(({scrollable:d})=>{d&&r?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")});let a=[],s=e.closest("pre"),c=s.closest("[id]"),l=c?c.id:Ka++;s.id=`__code_${l}`;let p=[],f=e.closest(".highlight");if(f instanceof HTMLElement){let d=Wn(f);if(typeof d<"u"&&(f.classList.contains("annotate")||D("content.code.annotate"))){let v=wr(d,e,t);p.push(Te(f).pipe(U(i),m(({width:O,height:J})=>O&&J),Q(),b(O=>O?v:y)))}}let u=M(":scope > span[id]",e);if(u.length&&(e.classList.add("md-code__content"),e.closest(".select")||D("content.code.select")&&!e.closest(".no-select"))){let d=+u[0].id.split("-").pop(),v=Ln();a.push(v),D("content.tooltips")&&p.push(Ge(v,{viewport$}));let O=h(v,"click").pipe(jt(P=>!P,!1),T(()=>v.blur()),le());O.subscribe(P=>{v.classList.toggle("md-code__button--active",P)});let J=me(u).pipe(G(P=>nt(P).pipe(m(ae=>[P,ae]))));O.pipe(b(P=>P?J:y)).subscribe(([P,ae])=>{let se=fe(".hll.select",P);if(se&&!ae)se.replaceWith(...Array.from(se.childNodes));else if(!se&&ae){let de=document.createElement("span");de.className="hll select",de.append(...Array.from(P.childNodes).slice(1)),P.append(de)}});let te=me(u).pipe(G(P=>h(P,"mousedown").pipe(T(ae=>ae.preventDefault()),m(()=>P)))),Z=O.pipe(b(P=>P?te:y),ee(jn),m(([P,ae])=>{let se=u.indexOf(P)+d;if(ae===!1)return[se,se];{let de=M(".hll",e).map(Le=>u.indexOf(Le.parentElement)+d);return window.getSelection()?.removeAllRanges(),[Math.min(se,...de),Math.max(se,...de)]}})),k=Br(y).pipe(g(P=>P.startsWith(`__codelineno-${l}-`)));k.subscribe(P=>{let[,,ae]=P.split("-"),se=ae.split(":").map(Le=>+Le-d+1);se.length===1&&se.push(se[0]);for(let Le of M(".hll:not(.select)",e))Le.replaceWith(...Array.from(Le.childNodes));let de=u.slice(se[0]-1,se[1]);for(let Le of de){let Je=document.createElement("span");Je.className="hll",Je.append(...Array.from(Le.childNodes).slice(1)),Le.append(Je)}}),k.pipe(xe(1),ye(ce)).subscribe(P=>{if(P.includes(":")){let ae=document.getElementById(P.split(":")[0]);ae&&setTimeout(()=>{let se=ae,de=-64;for(;se!==document.body;)de+=se.offsetTop,se=se.offsetParent;window.scrollTo({top:de})},1)}});let Fe=me(M('a[href^="#__codelineno"]',f)).pipe(G(P=>h(P,"click").pipe(T(ae=>ae.preventDefault()),m(()=>P)))).pipe(U(i),ee(jn),m(([P,ae])=>{let de=+F(`[id="${P.hash.slice(1)}"]`).parentElement.id.split("-").pop();if(ae===!1)return[de,de];{let Le=M(".hll",e).map(Je=>+Je.parentElement.id.split("-").pop());return[Math.min(de,...Le),Math.max(de,...Le)]}}));L(Z,Fe).subscribe(P=>{let ae=`#__codelineno-${l}-`;P[0]===P[1]?ae+=P[0]:ae+=`${P[0]}:${P[1]}`,history.replaceState({},"",ae),window.dispatchEvent(new HashChangeEvent("hashchange",{newURL:window.location.origin+window.location.pathname+ae,oldURL:window.location.href}))})}if(Un.default.isSupported()&&(e.closest(".copy")||D("content.code.copy")&&!e.closest(".no-copy"))){let d=On(s.id);a.push(d),D("content.tooltips")&&p.push(Ge(d,{viewport$}))}if(a.length){let d=Mn();d.append(...a),s.insertBefore(d,e)}return Qa(e).pipe(T(d=>n.next(d)),A(()=>n.complete()),m(d=>({ref:e,...d})),We(L(...p).pipe(U(i))))});return D("content.lazy")?pt(e).pipe(g(n=>n),xe(1),b(()=>o)):o}function Ya(e,{target$:t,print$:r}){let o=!0;return L(t.pipe(m(n=>n.closest("details:not([open])")),g(n=>e===n),m(()=>({action:"open",reveal:!0}))),r.pipe(g(n=>n||!o),T(()=>o=e.open),m(n=>({action:n?"open":"close"}))))}function Vn(e,t){return H(()=>{let r=new S;return r.subscribe(({action:o,reveal:n})=>{e.toggleAttribute("open",o==="open"),n&&e.scrollIntoView()}),Ya(e,t).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))})}var Nn=0;function Ba(e){let t=document.createElement("h3");t.innerHTML=e.innerHTML;let r=[t],o=e.nextElementSibling;for(;o&&!(o instanceof HTMLHeadingElement);)r.push(o),o=o.nextElementSibling;return r}function Ga(e,t){for(let r of M("[href], [src]",e))for(let o of["href","src"]){let n=r.getAttribute(o);if(n&&!/^(?:[a-z]+:)?\/\//i.test(n)){r[o]=new URL(r.getAttribute(o),t).toString();break}}for(let r of M("[name^=__], [for]",e))for(let o of["id","for","name"]){let n=r.getAttribute(o);n&&r.setAttribute(o,`${n}$preview_${Nn}`)}return Nn++,$(e)}function zn(e,t){let{sitemap$:r}=t;if(!(e instanceof HTMLAnchorElement))return y;if(!(D("navigation.instant.preview")||e.hasAttribute("data-preview")))return y;e.removeAttribute("title");let o=N([Ke(e),nt(e)]).pipe(m(([i,a])=>i||a),Q(),g(i=>i));return tt([r,o]).pipe(b(([i])=>{let a=new URL(e.href);return a.search=a.hash="",i.has(`${a}`)?$(a):y}),b(i=>yr(i).pipe(b(a=>Ga(a,i)))),b(i=>{let a=e.hash?`article [id="${e.hash.slice(1)}"]`:"article h1",s=fe(a,i);return typeof s>"u"?y:$(Ba(s))})).pipe(b(i=>{let a=new I(s=>{let c=Er(...i);return s.next(c),document.body.append(c),()=>c.remove()});return Dt(e,{content$:a,...t})}))}var qn=`/* ---------------------------------------------------------------------------- * Rules: general * ------------------------------------------------------------------------- */ @@ -393,7 +393,7 @@ rect.rect + text.text { defs #sequencenumber { fill: var(--md-mermaid-sequence-number-bg-color) !important; } -`;var Sr,Za=0;function es(){let e=window.docsforge?.mermaidUrl,t=typeof e=="string"&&e?e:"https://unpkg.com/mermaid@11/dist/mermaid.min.js";return typeof mermaid>"u"||mermaid instanceof Element?Mt(t):$(void 0)}function Kn(e){return e.classList.remove("mermaid"),Sr||(Sr=es().pipe(T(()=>mermaid.initialize({startOnLoad:!1,themeCSS:qn,sequence:{actorFontSize:"16px",messageFontSize:"16px",noteFontSize:"16px"}})),m(()=>{}),X(1))),Sr.subscribe(async()=>{e.classList.add("mermaid");let t=`__mermaid_${Za++}`,r=x("div",{class:"mermaid"}),o=e.textContent,{svg:n,fn:i}=await mermaid.render(t,o),a=r.attachShadow({mode:"closed"});a.innerHTML=n,e.replaceWith(r),i?.(a)}),Sr.pipe(m(()=>({ref:e})))}var Qn=x("table");function Yn(e){return e.replaceWith(Qn),Qn.replaceWith(Hn(e)),$({ref:e})}function ts(e){let t=e.find(r=>r.checked)||e[0];return L(...e.map(r=>h(r,"change").pipe(m(()=>F(`label[for="${r.id}"]`))))).pipe(K(F(`label[for="${t.id}"]`)),m(r=>({active:r})))}function Bn(e,{viewport$:t,target$:r}){let o=F(".tabbed-labels",e),n=M(":scope > input",e),i=to("prev");e.append(i);let a=to("next");return e.append(a),H(()=>{let s=new S,c=s.pipe(re(),ie(!0));N([s,Te(e),pt(e)]).pipe(U(c),He(1,ge)).subscribe({next([{active:l},p]){let f=Qe(l),{width:u}=ue(l);e.style.setProperty("--md-indicator-x",`${f.x}px`),e.style.setProperty("--md-indicator-width",`${u}px`);let d=vr(o);(f.xd.x+p.width)&&o.scrollTo({left:Math.max(0,f.x-16),behavior:"smooth"})},complete(){e.style.removeProperty("--md-indicator-x"),e.style.removeProperty("--md-indicator-width")}}),N([Ye(o),Te(o)]).pipe(U(c)).subscribe(([l,p])=>{let f=_t(o);i.hidden=l.x<16,a.hidden=l.x>f.width-p.width-16}),L(h(i,"click").pipe(m(()=>-1)),h(a,"click").pipe(m(()=>1))).pipe(U(c)).subscribe(l=>{let{width:p}=ue(o);o.scrollBy({left:p*l,behavior:"smooth"})}),r.pipe(U(c),g(l=>n.includes(l))).subscribe(l=>l.click()),o.classList.add("tabbed-labels--linked");for(let l of n){let p=F(`label[for="${l.id}"]`);p.replaceChildren(x("a",{href:`#${p.htmlFor}`,tabIndex:-1},...Array.from(p.childNodes))),h(p.firstElementChild,"click").pipe(U(c),g(f=>!(f.metaKey||f.ctrlKey)),T(f=>{f.preventDefault(),f.stopPropagation()})).subscribe(()=>{history.replaceState({},"",`#${p.htmlFor}`),p.click()})}return D("content.tabs.link")&&s.pipe(Re(1),ee(t)).subscribe(([{active:l},{offset:p}])=>{let f=l.innerText.trim();if(l.hasAttribute("data-md-switching"))l.removeAttribute("data-md-switching");else{let u=e.offsetTop-p.y;for(let v of M("[data-tabs]"))for(let O of M(":scope > input",v)){let J=F(`label[for="${O.id}"]`);if(J!==l&&J.innerText.trim()===f){J.setAttribute("data-md-switching",""),O.click();break}}window.scrollTo({top:e.offsetTop-u});let d=__md_get("__tabs")||[];__md_set("__tabs",[...new Set([f,...d])])}}),s.pipe(U(c)).subscribe(()=>{for(let l of M("audio, video",e))l.offsetWidth&&l.autoplay?l.play().catch(()=>{}):l.pause()}),ts(n).pipe(T(l=>s.next(l)),A(()=>s.complete()),m(l=>({ref:e,...l})))}).pipe(Ze(ce))}function Gn(e,t){let{viewport$:r,target$:o,print$:n}=t;return L(...M(".annotate:not(.highlight)",e).map(i=>Fn(i,{target$:o,print$:n})),...M("pre:not(.mermaid) > code",e).map(i=>Dn(i,{target$:o,print$:n})),...M("a",e).map(i=>zn(i,t)),...M("pre.mermaid",e).map(i=>Kn(i)),...M("table:not([class])",e).map(i=>Yn(i)),...M("details",e).map(i=>Vn(i,{target$:o,print$:n})),...M("[data-tabs]",e).map(i=>Bn(i,{viewport$:r,target$:o})),...M("[title]:not([data-preview])",e).filter(()=>D("content.tooltips")).map(i=>Ge(i,{viewport$:r})),...M(".footnote-ref",e).filter(()=>D("content.footnote.tooltips")).map(i=>Dt(i,{content$:new I(a=>{let s=new URL(i.href).hash.slice(1),c=Array.from(document.getElementById(s).cloneNode(!0).children),l=Er(...c);return a.next(l),document.body.append(l),()=>l.remove()}),viewport$:r})))}function rs(e,{alert$:t}){return t.pipe(b(r=>L($(!0),$(!1).pipe(ot(2e3))).pipe(m(o=>({message:r,active:o})))))}function Jn(e,t){let r=F(".md-typeset",e);return H(()=>{let o=new S;return o.subscribe(({message:n,active:i})=>{e.classList.toggle("md-dialog--active",i),r.textContent=n}),rs(e,t).pipe(T(n=>o.next(n)),A(()=>o.complete()),m(n=>({ref:e,...n})))})}var os=0;function ns(e,t){document.body.append(e);let{width:r}=ue(e);e.style.setProperty("--md-tooltip-width",`${r}px`),e.remove();let o=br(t),n=typeof o<"u"?Ye(o):$({x:0,y:0}),i=L(Ke(t),nt(t)).pipe(Q());return N([i,n]).pipe(m(([a,s])=>{let{x:c,y:l}=Qe(t),p=ue(t),f=t.closest("table");return f&&t.parentElement&&(c+=f.offsetLeft+t.parentElement.offsetLeft,l+=f.offsetTop+t.parentElement.offsetTop),{active:a,offset:{x:c-s.x+p.width/2-r/2,y:l-s.y+p.height+8}}}))}function Xn(e){let t=e.title;if(!t.length)return y;let r=`__tooltip_${os++}`,o=Wt(r,"inline"),n=F(".md-typeset",o);return n.innerHTML=t,H(()=>{let i=new S;return i.subscribe({next({offset:a}){o.style.setProperty("--md-tooltip-x",`${a.x}px`),o.style.setProperty("--md-tooltip-y",`${a.y}px`)},complete(){o.style.removeProperty("--md-tooltip-x"),o.style.removeProperty("--md-tooltip-y")}}),L(i.pipe(g(({active:a})=>a)),i.pipe(_e(250),g(({active:a})=>!a))).subscribe({next({active:a}){a?(e.insertAdjacentElement("afterend",o),e.setAttribute("aria-describedby",r),e.removeAttribute("title")):(o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t))},complete(){o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t)}}),i.pipe(He(16,ge)).subscribe(({active:a})=>{o.classList.toggle("md-tooltip--active",a)}),i.pipe(vt(125,ge),g(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:a})=>a)).subscribe({next(a){a?o.style.setProperty("--md-tooltip-0",`${-a}px`):o.style.removeProperty("--md-tooltip-0")},complete(){o.style.removeProperty("--md-tooltip-0")}}),ns(o,e).pipe(T(a=>i.next(a)),A(()=>i.complete()),m(a=>({ref:e,...a})))}).pipe(Ze(ce))}function is({viewport$:e}){if(!D("header.autohide"))return $(!1);let t=e.pipe(m(({offset:{y:n}})=>n),rt(2,1),m(([n,i])=>[nMath.abs(i-n.y)>100),m(([,[n]])=>n),Q()),o=Be("search");return N([e,o]).pipe(m(([{offset:n},i])=>n.y>400&&!i),Q(),b(n=>n?r:$(!1)),K(!1))}function Zn(e,t){return H(()=>N([Te(e),is(t)])).pipe(m(([{height:r},o])=>({height:r,hidden:o})),Q((r,o)=>r.height===o.height&&r.hidden===o.hidden),X(1))}function ei(e,{header$:t,main$:r}){return H(()=>{let o=new S,n=o.pipe(re(),ie(!0));o.pipe(oe("active"),$e(t)).subscribe(([{active:a},{hidden:s}])=>{e.classList.toggle("md-header--shadow",a&&!s),e.hidden=s});let i=me(M("[title]",e)).pipe(g(()=>D("content.tooltips")),G(a=>Xn(a)));return r.subscribe(o),t.pipe(U(n),m(a=>({ref:e,...a})),We(i.pipe(U(n))))})}function as(e,{viewport$:t,header$:r}){return xr(e,{viewport$:t,header$:r}).pipe(m(({offset:{y:o}})=>{let{height:n}=ue(e);return{active:n>0&&o>=n}}),oe("active"))}function ti(e,t){return H(()=>{let r=new S;r.subscribe({next({active:n}){e.classList.toggle("md-header__title--active",n)},complete(){e.classList.remove("md-header__title--active")}});let o=fe(".md-content h1");return typeof o>"u"?y:as(o,t).pipe(T(n=>r.next(n)),A(()=>r.complete()),m(n=>({ref:e,...n})))})}function ri(e,{viewport$:t,header$:r}){let o=r.pipe(m(({height:i})=>i),Q()),n=o.pipe(b(()=>Te(e).pipe(m(({height:i})=>({top:e.offsetTop,bottom:e.offsetTop+i})),oe("bottom"))));return N([o,n,t]).pipe(m(([i,{top:a,bottom:s},{offset:{y:c},size:{height:l}}])=>(l=Math.max(0,l-Math.max(0,a-c,i)-Math.max(0,l+c-s)),{offset:a-i,height:l,active:a-i<=c})),Q((i,a)=>i.offset===a.offset&&i.height===a.height&&i.active===a.active))}function ss(e){let t=__md_get("__palette")||{index:e.findIndex(n=>matchMedia(n.getAttribute("data-md-color-media")).matches)},r=Math.max(0,Math.min(t.index,e.length-1)),o=!0;return $(...e).pipe(G(n=>h(n,"change").pipe(m(()=>n))),K(e[r]),m(n=>({index:e.indexOf(n),color:{media:n.getAttribute("data-md-color-media"),scheme:n.getAttribute("data-md-color-scheme"),primary:n.getAttribute("data-md-color-primary"),accent:n.getAttribute("data-md-color-accent")}})),m(n=>(o&&(o=!1,t?.color&&(n.color={...n.color,...t.color})),n)),X(1))}function oi(e){let t=M("input",e),r=x("meta",{name:"theme-color"});document.head.appendChild(r);let o=x("meta",{name:"color-scheme"});document.head.appendChild(o);let n=Ut("(prefers-color-scheme: light)");return H(()=>{let i=new S;return i.subscribe(a=>{if(document.body.setAttribute("data-md-color-switching",""),a.color.media==="(prefers-color-scheme)"){let s=matchMedia("(prefers-color-scheme: light)"),c=document.querySelector(s.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");a.color.scheme=c.getAttribute("data-md-color-scheme"),a.color.primary=c.getAttribute("data-md-color-primary"),a.color.accent=c.getAttribute("data-md-color-accent")}for(let[s,c]of Object.entries(a.color))document.body.setAttribute(`data-md-color-${s}`,c);for(let s=0;sa.key==="Enter"),ee(i,(a,s)=>s)).subscribe(({index:a})=>{a=(a+1)%t.length,t[a].click(),t[a].focus()}),i.pipe(m(()=>{let a=Ae("header"),s=window.getComputedStyle(a);return o.content=s.colorScheme,s.backgroundColor.match(/\d+/g).map(c=>(+c).toString(16).padStart(2,"0")).join("")})).subscribe(a=>r.content=`#${a}`),i.pipe(ye(ce)).subscribe(()=>{document.body.removeAttribute("data-md-color-switching")}),ss(t).pipe(U(n.pipe(Re(1))),bt(),T(a=>i.next(a)),A(()=>i.complete()),m(a=>({ref:e,...a})))})}function ni(e,{progress$:t}){return H(()=>{let r=new S;return r.subscribe(({value:o})=>{e.style.setProperty("--md-progress-value",`${o}`)}),t.pipe(T(o=>r.next({value:o})),A(()=>r.complete()),m(o=>({ref:e,value:o})))})}function ii(e,t){return e.protocol=t.protocol,e.hostname=t.hostname,e}function cs(e,t){let r=new Map;for(let o of M("url",e)){let n=F("loc",o),i=[ii(new URL(n.textContent),t)];r.set(`${i[0]}`,i);for(let a of M("[rel=alternate]",o)){let s=a.getAttribute("href");s!=null&&i.push(ii(new URL(s),t))}}return r}function Ct(e){return dn(new URL("sitemap.xml",e)).pipe(m(t=>cs(t,new URL(e))),be(()=>$(new Map)),le())}function ai({document$:e}){let t=new Map;e.pipe(b(()=>M("link[rel=alternate]")),m(r=>new URL(r.href)),g(r=>!t.has(r.toString())),G(r=>Ct(r).pipe(m(o=>[r,o]),be(()=>y)))).subscribe(([r,o])=>{t.set(r.toString().replace(/\/$/,""),o)}),h(document.body,"click").pipe(g(r=>!r.metaKey&&!r.ctrlKey),b(r=>{if(r.target instanceof Element){let o=r.target.closest("a");if(o&&!o.target){let n=[...t].find(([f])=>o.href.startsWith(`${f}/`));if(typeof n>"u")return y;let[i,a]=n,s=Ee();if(s.href.startsWith(i))return y;let c=we(),l=s.href.replace(c.base,"");l=`${i}/${l}`;let p=a.has(l.split("#")[0])?new URL(l,c.base):new URL(i);return r.preventDefault(),$(p)}}return y})).subscribe(r=>at(r,!0))}var no=Ht(oo());function ls(e){e.setAttribute("data-md-copying","");let t=e.closest("[data-copy]"),r=t?t.getAttribute("data-copy"):e.innerText;return e.removeAttribute("data-md-copying"),r.trimEnd()}function si({alert$:e}){no.default.isSupported()&&new I(t=>{new no.default("[data-clipboard-target], [data-clipboard-text]",{text:r=>r.getAttribute("data-clipboard-text")||ls(F(r.getAttribute("data-clipboard-target")))}).on("success",r=>t.next(r))}).pipe(T(t=>{t.trigger.focus()}),m(()=>Oe("clipboard.copied"))).subscribe(e)}function ci(e,t){if(!(e.target instanceof Element))return y;let r=e.target.closest("a");if(r===null)return y;if(r.closest('[data-md-component="i18n"]'))return y;if(r.target||e.metaKey||e.ctrlKey)return y;let o=new URL(r.href);return o.search=o.hash="",t.has(`${o}`)?(e.preventDefault(),$(r)):y}function li(e){let t=new Map;for(let r of M(":scope > *",e.head))t.set(r.outerHTML,r);return t}function pi(e){for(let t of M("[href], [src]",e))for(let r of["href","src"]){let o=t.getAttribute(r);if(o&&!/^(?:[a-z]+:)?\/\//i.test(o)){t[r]=t[r];break}}return $(e)}function ps(){let e=document.documentElement.lang;e&&document.querySelectorAll('[data-md-component="i18n"] .md-select__link').forEach(t=>{t.classList.remove("md-select__link--active"),t.getAttribute("hreflang")===e&&t.classList.add("md-select__link--active")})}function ms(e){for(let o of["[data-md-component=announce]","[data-md-component=container]","[data-md-component=header-topic]","[data-md-component=outdated]","[data-md-component=logo]","[data-md-component=skip]",...D("navigation.tabs.sticky")?["[data-md-component=tabs]"]:[]]){let n=fe(o),i=fe(o,e);typeof n<"u"&&typeof i<"u"&&n.replaceWith(i)}let t=li(document);for(let[o,n]of li(e))t.has(o)?t.delete(o):document.head.appendChild(n);for(let o of t.values()){let n=o.getAttribute("name");n!=="theme-color"&&n!=="color-scheme"&&o.remove()}let r=Ae("container");return ze(M("script",r)).pipe(b(o=>{let n=e.createElement("script");if(o.src){for(let i of o.getAttributeNames())n.setAttribute(i,o.getAttribute(i));return o.replaceWith(n),new I(i=>{n.onload=()=>i.complete()})}else return n.textContent=o.textContent,o.replaceWith(n),y}),re(),ie(document),T(()=>ps()))}function mi({sitemap$:e,location$:t,viewport$:r,progress$:o}){if(location.protocol==="file:")return y;$(document).subscribe(pi);let n=h(document.body,"click").pipe($e(e),b(([s,c])=>ci(s,c)),m(({href:s})=>new URL(s)),le()),i=h(window,"popstate").pipe(m(Ee),le());n.pipe(ee(r)).subscribe(([s,{offset:c}])=>{history.replaceState(c,""),history.pushState(null,"",s)}),L(n,i).subscribe(t);let a=t.pipe(oe("pathname"),b(s=>yr(s,{progress$:o}).pipe(be(()=>(at(s,!0),y)))),b(pi),b(ms),le());return L(a.pipe(ee(t,(s,c)=>c)),a.pipe(b(()=>t),oe("hash")),t.pipe(Q((s,c)=>s.pathname===c.pathname&&s.hash===c.hash),b(()=>n),T(()=>history.back()))).subscribe(s=>{history.state!==null||!s.hash?window.scrollTo(0,history.state?.y??0):(history.scrollRestoration="auto",mn(s.hash),history.scrollRestoration="manual")}),t.subscribe(()=>{history.scrollRestoration="manual"}),h(window,"beforeunload").subscribe(()=>{history.scrollRestoration="auto"}),r.pipe(oe("offset"),_e(100)).subscribe(({offset:s})=>{history.replaceState(s,"")}),D("navigation.instant.prefetch")&&L(h(document.body,"mousemove"),h(document.body,"focusin")).pipe($e(e),b(([s,c])=>ci(s,c)),_e(25),zr(({href:s})=>s),dr(s=>{let c=document.createElement("link");return c.rel="prefetch",c.href=s.toString(),document.head.appendChild(c),h(c,"load").pipe(m(()=>c),xe(1))})).subscribe(s=>s.remove()),a}var fi=Ht(Zr());function ui(e){let t=e.separator.split("|").map(n=>n.replace(/(\(\?[!=<][^)]+\))/g,"").length===0?"\uFFFD":n).join("|"),r=new RegExp(t,"img"),o=(n,i,a)=>`${i}${a}`;return n=>{n=n.replace(/[\s*+\-:~^]+/g," ").replace(/&/g,"&").trim();let i=new RegExp(`(^|${e.separator}|)(${n.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return a=>(0,fi.default)(a).replace(i,o).replace(/<\/mark>(\s+)]*>/img,"$1")}}function Nt(e){return e.type===1}function Tr(e){return e.type===3}function di(e,t){let r=xn(e);return L($(location.protocol!=="file:"),Be("search")).pipe(Pe(o=>o),b(()=>t)).subscribe(({config:o,docs:n})=>r.next({type:0,data:{config:o,docs:n,options:{suggest:D("search.suggest")}}})),r}function hi(e){let{selectedVersionSitemap:t,selectedVersionBaseURL:r,currentLocation:o,currentBaseURL:n}=e,i=io(n)?.pathname;if(i===void 0)return;let a=ds(o.pathname,i);if(a===void 0)return;let s=bs(t.keys());if(!t.has(s))return;let c=io(a,s);if(!c||!t.has(c.href))return;let l=io(a,r);if(l)return l.hash=o.hash,l.search=o.search,l}function io(e,t){try{return new URL(e,t)}catch{return}}function ds(e,t){if(e.startsWith(t))return e.slice(t.length)}function hs(e,t){let r=Math.min(e.length,t.length),o;for(o=0;oy)),o=r.pipe(m(n=>{let[,i]=t.base.match(/([^/]+)\/?$/);return n.find(({version:a,aliases:s})=>a===i||s.includes(i))||n[0]}));r.pipe(m(n=>new Map(n.map(i=>[`${new URL(`../${i.version}/`,t.base)}`,i]))),b(n=>h(document.body,"click").pipe(g(i=>!i.metaKey&&!i.ctrlKey),ee(o),b(([i,a])=>{if(i.target instanceof Element){let s=i.target.closest("a");if(s&&!s.target&&n.has(s.href)){let c=s.href;return!i.target.closest(".md-version")&&n.get(c)===a?y:(i.preventDefault(),$(new URL(c)))}}return y}),b(i=>Ct(i).pipe(m(a=>hi({selectedVersionSitemap:a,selectedVersionBaseURL:i,currentLocation:Ee(),currentBaseURL:t.base})??i)))))).subscribe(n=>at(n,!0)),N([r,o]).subscribe(([n,i])=>{F(".md-header__topic").appendChild($n(n,i))}),e.pipe(b(()=>o)).subscribe(n=>{let i=new URL(t.base),a=__md_get("__outdated",sessionStorage,i);if(a===null){a=!0;let s=t.version?.default||"latest";Array.isArray(s)||(s=[s]);e:for(let c of s)for(let l of n.aliases.concat(n.version))if(new RegExp(c,"i").test(l)){a=!1;break e}__md_set("__outdated",a,sessionStorage,i)}if(a)for(let s of pe("outdated"))s.hidden=!1})}function vs(e,{worker$:t}){let{searchParams:r}=Ee();r.has("q")&&(it("search",!0),e.value=r.get("q"),e.focus(),Be("search").pipe(Pe(i=>!i)).subscribe(()=>{let i=Ee();i.searchParams.delete("q"),history.replaceState({},"",`${i}`)}));let o=Ke(e),n=L(t.pipe(Pe(Nt)),h(e,"keyup"),o).pipe(m(()=>e.value),Q());return N([n,o]).pipe(m(([i,a])=>({value:i,focus:a})),X(1))}function vi(e,{worker$:t}){let r=new S,o=r.pipe(re(),ie(!0));N([t.pipe(Pe(Nt)),r],(i,a)=>a).pipe(oe("value")).subscribe(({value:i})=>t.next({type:2,data:i})),r.pipe(oe("focus")).subscribe(({focus:i})=>{i&&it("search",i)}),h(e.form,"reset").pipe(U(o)).subscribe(()=>e.focus());let n=F("header [for=__search]");return h(n,"click").subscribe(()=>e.focus()),vs(e,{worker$:t}).pipe(T(i=>r.next(i)),A(()=>r.complete()),m(i=>({ref:e,...i})),X(1))}function gi(e,{worker$:t,query$:r}){let o=new S,n=an(e.parentElement).pipe(g(Boolean)),i=e.parentElement,a=F(":scope > :first-child",e),s=F(":scope > :last-child",e);Be("search").subscribe(p=>{s.setAttribute("role",p?"list":"presentation"),s.hidden=!p}),o.pipe(ee(r),Qr(t.pipe(Pe(Nt)))).subscribe(([{items:p},{value:f}])=>{switch(p.length){case 0:a.textContent=f.length?Oe("search.result.none"):Oe("search.result.placeholder");break;case 1:a.textContent=Oe("search.result.one");break;default:let u=hr(p.length);a.textContent=Oe("search.result.other",u)}});let c=o.pipe(T(()=>s.innerHTML=""),b(({items:p})=>L($(...p.slice(0,10)),$(...p.slice(10)).pipe(rt(4),Br(n),b(([f])=>f)))),m(Cn),le());return c.subscribe(p=>s.appendChild(p)),c.pipe(G(p=>{let f=fe("details",p);return typeof f>"u"?y:h(f,"toggle").pipe(U(o),m(()=>f))})).subscribe(p=>{p.open===!1&&p.offsetTop<=i.scrollTop&&i.scrollTo({top:p.offsetTop})}),t.pipe(g(Tr),m(({data:p})=>p)).pipe(T(p=>o.next(p)),A(()=>o.complete()),m(p=>({ref:e,...p})))}function gs(e,{query$:t}){return t.pipe(m(({value:r})=>{let o=Ee();return o.hash="",r=r.replace(/\s+/g,"+").replace(/&/g,"%26").replace(/=/g,"%3D"),o.search=`q=${r}`,{url:o}}))}function yi(e,t){let r=new S,o=r.pipe(re(),ie(!0));return r.subscribe(({url:n})=>{e.setAttribute("data-clipboard-text",e.href),e.href=`${n}`}),h(e,"click").pipe(U(o)).subscribe(n=>n.preventDefault()),gs(e,t).pipe(T(n=>r.next(n)),A(()=>r.complete()),m(n=>({ref:e,...n})))}function xi(e,{worker$:t,keyboard$:r}){let o=new S,n=Ae("search-query"),i=L(h(n,"keydown"),h(n,"focus")).pipe(ye(ce),m(()=>n.value),Q());return o.pipe($e(i),m(([{suggest:s},c])=>{let l=c.split(/([\s-]+)/);if(s?.length&&l[l.length-1]){let p=s[s.length-1];p.startsWith(l[l.length-1])&&(l[l.length-1]=p)}else l.length=0;return l})).subscribe(s=>e.textContent=s.join("")),r.pipe(g(({mode:s})=>s==="search")).subscribe(s=>{s.type==="ArrowRight"&&e.innerText.length&&n.selectionStart===n.value.length&&(n.value=e.innerText)}),t.pipe(g(Tr),m(({data:s})=>s)).pipe(T(s=>o.next(s)),A(()=>o.complete()),m(()=>({ref:e})))}function Ei(e,{index$:t,keyboard$:r}){let o=we();try{let n=di(o.search,t),i=Ae("search-query",e),a=Ae("search-result",e);h(e,"click").pipe(g(({target:c})=>c instanceof Element&&!!c.closest("a"))).subscribe(()=>it("search",!1)),r.pipe(g(({mode:c})=>c==="search")).subscribe(c=>{let l=De();switch(c.type){case"Enter":if(l===i){let p=new Map;for(let f of M(":first-child [href]",a)){let u=f.firstElementChild;p.set(f,parseFloat(u.getAttribute("data-md-score")))}if(p.size){let[[f]]=[...p].sort(([,u],[,d])=>d-u);f.click()}c.claim()}break;case"Escape":case"Tab":it("search",!1),i.blur();break;case"ArrowUp":case"ArrowDown":if(typeof l>"u")i.focus();else{let p=[i,...M(":not(details) > [href], summary, details[open] [href]",a)],f=Math.max(0,(Math.max(0,p.indexOf(l))+p.length+(c.type==="ArrowUp"?-1:1))%p.length);p[f].focus()}c.claim();break;default:i!==De()&&i.focus()}}),r.pipe(g(({mode:c})=>c==="global")).subscribe(c=>{switch(c.type){case"f":case"s":case"/":i.focus(),i.select(),c.claim();break}});let s=vi(i,{worker$:n});return L(s,gi(a,{worker$:n,query$:s})).pipe(We(...pe("search-share",e).map(c=>yi(c,{query$:s})),...pe("search-suggest",e).map(c=>xi(c,{worker$:n,keyboard$:r}))))}catch{return e.hidden=!0,et}}function wi(e,{index$:t,location$:r}){return N([t,r.pipe(K(Ee()),g(o=>!!o.searchParams.get("h")))]).pipe(m(([o,n])=>ui(o.config)(n.searchParams.get("h"))),m(o=>{let n=new Map,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(let a=i.nextNode();a;a=i.nextNode())if(a.parentElement?.offsetHeight){let s=a.textContent,c=o(s);c.length>s.length&&n.set(a,c)}for(let[a,s]of n){let{childNodes:c}=x("span",null,s);a.replaceWith(...Array.from(c))}return{ref:e,nodes:n}}))}function ys(e,{viewport$:t,main$:r}){let o=e.closest(".md-grid"),n=o.offsetTop-o.parentElement.offsetTop;return N([r,t]).pipe(m(([{offset:i,height:a},{offset:{y:s}}])=>(a=a+Math.min(n,Math.max(0,s-i))-n,{height:a,locked:s>=i+n})),Q((i,a)=>i.height===a.height&&i.locked===a.locked))}function ao(e,{header$:t,...r}){let o=F(".md-sidebar__scrollwrap",e),{y:n}=Qe(o);return H(()=>{let i=new S,a=i.pipe(re(),ie(!0)),s=i.pipe(He(0,ge));return s.pipe(ee(t)).subscribe({next([{height:c},{height:l}]){o.style.height=`${c-2*n}px`,e.style.top=`${l}px`},complete(){o.style.height="",e.style.top=""}}),s.pipe(Pe()).subscribe(()=>{for(let c of M(".md-nav__link--active[href]",e)){if(!c.clientHeight)continue;let l=c.closest(".md-sidebar__scrollwrap");if(typeof l<"u"){let p=c.offsetTop-l.offsetTop,{height:f}=ue(l);l.scrollTo({top:p-f/2})}}}),me(M("label[tabindex]",e)).pipe(G(c=>h(c,"click").pipe(ye(ce),m(()=>c),U(a)))).subscribe(c=>{let l=F(`[id="${c.htmlFor}"]`);F(`[aria-labelledby="${c.id}"]`).setAttribute("aria-expanded",`${l.checked}`)}),D("content.tooltips")&&me(M("abbr[title]",e)).pipe(G(c=>Ge(c,{viewport$})),U(a)).subscribe(),ys(e,r).pipe(T(c=>i.next(c)),A(()=>i.complete()),m(c=>({ref:e,...c})))})}function Si(e,t){if(typeof t<"u"){let r=`https://api.github.com/repos/${e}/${t}`;return tt(Ve(`${r}/releases/latest`).pipe(be(()=>y),m(o=>({version:o.tag_name})),qe({})),Ve(r).pipe(be(()=>y),m(o=>({stars:o.stargazers_count,forks:o.forks_count})),qe({}))).pipe(m(([o,n])=>({...o,...n})))}else{let r=`https://api.github.com/users/${e}`;return Ve(r).pipe(m(o=>({repositories:o.public_repos})),qe({}))}}function Ti(e,t){let r=`https://${e}/api/v4/projects/${encodeURIComponent(t)}`;return tt(Ve(`${r}/releases/permalink/latest`).pipe(be(()=>y),m(({tag_name:o})=>({version:o})),qe({})),Ve(r).pipe(be(()=>y),m(({star_count:o,forks_count:n})=>({stars:o,forks:n})),qe({}))).pipe(m(([o,n])=>({...o,...n})))}function Oi(e){let t=e.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i);if(t){let[,r,o]=t;return Si(r,o)}if(t=e.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i),t){let[,r,o]=t;return Ti(r,o)}return y}var Li;function xs(e){return Li||(Li=H(()=>{let t=__md_get("__source",sessionStorage);if(t)return $(t);if(pe("consent").length){let o=__md_get("__consent");if(!(o&&o.github))return y}return Oi(e.href).pipe(T(o=>__md_set("__source",o,sessionStorage)))}).pipe(be(()=>y),g(t=>Object.keys(t).length>0),m(t=>({facts:t})),X(1)))}function Mi(e){let t=F(":scope > :last-child",e);return H(()=>{let r=new S;return r.subscribe(({facts:o})=>{t.appendChild(kn(o)),t.classList.add("md-source__repository--active")}),xs(e).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))})}function Es(e,{viewport$:t,header$:r}){return Te(document.body).pipe(b(()=>xr(e,{header$:r,viewport$:t})),m(({offset:{y:o}})=>({hidden:o>=10})),oe("hidden"))}function _i(e,t){return H(()=>{let r=new S;return r.subscribe({next({hidden:o}){e.hidden=o},complete(){e.hidden=!1}}),(D("navigation.tabs.sticky")?$({hidden:!1}):Es(e,t)).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))})}function ws(e,{viewport$:t,header$:r}){let o=new Map,n=M(".md-nav__link",e);for(let s of n){let c=decodeURIComponent(s.hash.substring(1)),l=fe(`[id="${c}"]`);typeof l<"u"&&o.set(s,l)}let i=r.pipe(oe("height"),m(({height:s})=>{let c=Ae("main"),l=F(":scope > :first-child",c);return s+.8*(l.offsetTop-c.offsetTop)}),le());return Te(document.body).pipe(oe("height"),b(s=>H(()=>{let c=[];return $([...o].reduce((l,[p,f])=>{for(;c.length&&o.get(c[c.length-1]).tagName>=f.tagName;)c.pop();let u=f.offsetTop;for(;!u&&f.parentElement;)f=f.parentElement,u=f.offsetTop;let d=f.offsetParent;for(;d;d=d.offsetParent)u+=d.offsetTop;return l.set([...c=[...c,p]].reverse(),u)},new Map))}).pipe(m(c=>new Map([...c].sort(([,l],[,p])=>l-p))),$e(i),b(([c,l])=>t.pipe(jt(([p,f],{offset:{y:u},size:d})=>{let v=u+d.height>=Math.floor(s.height);for(;f.length;){let[,O]=f[0];if(O-l=u&&!v)f=[p.pop(),...f];else break}return[p,f]},[[],[...c]]),Q((p,f)=>p[0]===f[0]&&p[1]===f[1])))))).pipe(m(([s,c])=>({prev:s.map(([l])=>l),next:c.map(([l])=>l)})),K({prev:[],next:[]}),rt(2,1),m(([s,c])=>s.prev.length{let i=new S,a=i.pipe(re(),ie(!0));if(i.subscribe(({prev:s,next:c})=>{for(let[l]of c)l.classList.remove("md-nav__link--passed"),l.classList.remove("md-nav__link--active");for(let[l,[p]]of s.entries())p.classList.add("md-nav__link--passed"),p.classList.toggle("md-nav__link--active",l===s.length-1)}),D("toc.follow")){let s=L(t.pipe(_e(1),m(()=>{})),t.pipe(_e(250),m(()=>"smooth")));i.pipe(g(({prev:c})=>c.length>0),$e(o.pipe(ye(ce))),ee(s)).subscribe(([[{prev:c}],l])=>{let[p]=c[c.length-1];if(p.offsetHeight){let f=br(p);if(typeof f<"u"){let u=p.offsetTop-f.offsetTop,{height:d}=ue(f);f.scrollTo({top:u-d/2,behavior:l})}}})}return D("navigation.tracking")&&t.pipe(U(a),oe("offset"),_e(250),Re(1),U(n.pipe(Re(1))),bt({delay:250}),ee(i)).subscribe(([,{prev:s}])=>{let c=Ee(),l=s[s.length-1];if(l&&l.length){let[p]=l,{hash:f}=new URL(p.href);c.hash!==f&&(c.hash=f,history.replaceState({},"",`${c}`))}else c.hash="",history.replaceState({},"",`${c}`)}),ws(e,{viewport$:t,header$:r}).pipe(T(s=>i.next(s)),A(()=>i.complete()),m(s=>({ref:e,...s})))})}function Ss(e,{viewport$:t,main$:r,target$:o}){let n=t.pipe(m(({offset:{y:a}})=>a),rt(2,1),m(([a,s])=>a>s&&s>0),Q()),i=r.pipe(m(({active:a})=>a));return N([i,n]).pipe(m(([a,s])=>!(a&&s)),Q(),U(o.pipe(Re(1))),ie(!0),bt({delay:250}),m(a=>({hidden:a})))}function Ci(e,{viewport$:t,header$:r,main$:o,target$:n}){let i=new S,a=i.pipe(re(),ie(!0));return i.subscribe({next({hidden:s}){e.hidden=s,s?(e.setAttribute("tabindex","-1"),e.blur()):e.removeAttribute("tabindex")},complete(){e.style.top="",e.hidden=!0,e.removeAttribute("tabindex")}}),r.pipe(U(a),oe("height")).subscribe(({height:s})=>{e.style.top=`${s+16}px`}),h(e,"click").subscribe(s=>{s.preventDefault(),window.scrollTo({top:0})}),Ss(e,{viewport$:t,main$:o,target$:n}).pipe(T(s=>i.next(s)),A(()=>i.complete()),m(s=>({ref:e,...s})))}function ki({document$:e,viewport$:t}){e.pipe(b(()=>M(".md-ellipsis")),G(r=>pt(r).pipe(U(e.pipe(Re(1))),g(o=>o),m(()=>r),xe(1))),g(r=>r.offsetWidth{let o=r.innerText,n=r.closest("a")||r;return n.title=o,D("content.tooltips")?Ge(n,{viewport$:t}).pipe(U(e.pipe(Re(1))),A(()=>n.removeAttribute("title"))):y})).subscribe(),D("content.tooltips")&&e.pipe(b(()=>M(".md-status")),G(r=>Ge(r,{viewport$:t}))).subscribe()}function Hi({document$:e,tablet$:t}){e.pipe(b(()=>M(".md-toggle--indeterminate")),T(r=>{r.indeterminate=!0,r.checked=!1}),G(r=>h(r,"change").pipe(Yr(()=>r.classList.contains("md-toggle--indeterminate")),m(()=>r))),ee(t)).subscribe(([r,o])=>{r.classList.remove("md-toggle--indeterminate"),o&&(r.checked=!1)})}function Ts(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}function $i({document$:e}){e.pipe(b(()=>M("[data-md-scrollfix]")),T(t=>t.removeAttribute("data-md-scrollfix")),g(Ts),G(t=>h(t,"touchstart").pipe(m(()=>t)))).subscribe(t=>{let r=t.scrollTop;r===0?t.scrollTop=1:r+t.offsetHeight===t.scrollHeight&&(t.scrollTop=r-1)})}function Pi({viewport$:e,tablet$:t}){N([Be("search"),t]).pipe(m(([r,o])=>r&&!o),b(r=>$(r).pipe(ot(r?400:100))),ee(e)).subscribe(([r,{offset:{y:o}}])=>{if(r)document.body.setAttribute("data-md-scrolllock",""),document.body.style.top=`-${o}px`;else{let n=-1*parseInt(document.body.style.top,10);document.body.removeAttribute("data-md-scrolllock"),document.body.style.top="",n&&window.scrollTo(0,n)}})}Object.entries||(Object.entries=function(e){let t=[];for(let r of Object.keys(e))t.push([r,e[r]]);return t});Object.values||(Object.values=function(e){let t=[];for(let r of Object.keys(e))t.push(e[r]);return t});typeof Element<"u"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(e,t){typeof e=="object"?(this.scrollLeft=e.left,this.scrollTop=e.top):(this.scrollLeft=e,this.scrollTop=t)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...e){let t=this.parentNode;if(t){e.length===0&&t.removeChild(this);for(let r=e.length-1;r>=0;r--){let o=e[r];typeof o=="string"?o=document.createTextNode(o):o.parentNode&&o.parentNode.removeChild(o),r?t.insertBefore(this.previousSibling,o):t.replaceChild(o,this)}}}));function Os(){return location.protocol==="file:"?Mt(`${new URL("search/search_index.js",qt.base)}`).pipe(m(()=>__index),X(1)):Ve(new URL(qt.search_index||"search/search_index.json",qt.base))}document.documentElement.classList.remove("no-js");document.documentElement.classList.add("js");var st=Xo(),Kt=ln(),kt=fn(Kt),so=cn(),Ce=yn(),Or=Ut("(min-width: 60em)"),Ri=Ut("(min-width: 76.25em)"),Ii=un(),qt=we(),Fi=document.forms.namedItem("search")?Os():et,co=new S;si({alert$:co});ai({document$:st});var lo=new S,ji=Ct(qt.base);D("navigation.instant")&&mi({sitemap$:ji,location$:Kt,viewport$:Ce,progress$:lo}).subscribe(st);qt.version?.provider==="mike"&&bi({document$:st});L(Kt,kt).pipe(ot(125)).subscribe(()=>{it("drawer",!1),it("search",!1)});so.pipe(g(({mode:e})=>e==="global")).subscribe(e=>{switch(e.type){case"p":case",":let t=fe("link[rel=prev]");typeof t<"u"&&at(t);break;case"n":case".":let r=fe("link[rel=next]");typeof r<"u"&&at(r);break;case"Enter":let o=De();o instanceof HTMLLabelElement&&o.click()}});ki({viewport$:Ce,document$:st});Hi({document$:st,tablet$:Or});$i({document$:st});Pi({viewport$:Ce,tablet$:Or});var mt=Zn(Ae("header"),{viewport$:Ce}),zt=st.pipe(m(()=>Ae("main")),b(e=>ri(e,{viewport$:Ce,header$:mt})),X(1)),Ls=L(...pe("consent").map(e=>wn(e,{target$:kt})),...pe("dialog").map(e=>Jn(e,{alert$:co})),...pe("palette").map(e=>oi(e)),...pe("progress").map(e=>ni(e,{progress$:lo})),...pe("search").map(e=>Ei(e,{index$:Fi,keyboard$:so})),...pe("source").map(e=>Mi(e))),Ms=H(()=>L(...pe("announce").map(e=>En(e)),...pe("content").map(e=>Gn(e,{sitemap$:ji,viewport$:Ce,target$:kt,print$:Ii})),...pe("content").map(e=>D("search.highlight")?wi(e,{index$:Fi,location$:Kt}):y),...pe("header").map(e=>ei(e,{viewport$:Ce,header$:mt,main$:zt})),...pe("header-title").map(e=>ti(e,{viewport$:Ce,header$:mt})),...pe("sidebar").map(e=>e.getAttribute("data-md-type")==="navigation"?Jr(Ri,()=>ao(e,{viewport$:Ce,header$:mt,main$:zt})):Jr(Or,()=>ao(e,{viewport$:Ce,header$:mt,main$:zt}))),...pe("tabs").map(e=>_i(e,{viewport$:Ce,header$:mt})),...pe("toc").map(e=>Ai(e,{viewport$:Ce,header$:mt,main$:zt,target$:kt})),...pe("top").map(e=>Ci(e,{viewport$:Ce,header$:mt,main$:zt,target$:kt})))),Ui=st.pipe(b(()=>Ms),We(Ls),X(1));Ui.subscribe();window.document$=st;window.location$=Kt;window.target$=kt;window.keyboard$=so;window.viewport$=Ce;window.tablet$=Or;window.screen$=Ri;window.print$=Ii;window.alert$=co;window.progress$=lo;window.component$=Ui;})(); +`;var oo,Xa=0;function Za(){let e=window.docsforge?.mermaidUrl,t=typeof e=="string"&&e?e:"https://unpkg.com/mermaid@11/dist/mermaid.min.js";return typeof mermaid>"u"||mermaid instanceof Element?Mt(t):$(void 0)}function Kn(e){return e.classList.remove("mermaid"),oo||(oo=Za().pipe(T(()=>mermaid.initialize({startOnLoad:!1,themeCSS:qn,sequence:{actorFontSize:"16px",messageFontSize:"16px",noteFontSize:"16px"}})),m(()=>{}),X(1))),oo.subscribe(async()=>{e.classList.add("mermaid");let t=`__mermaid_${Xa++}`,r=x("div",{class:"mermaid"}),o=e.textContent,{svg:n,fn:i}=await mermaid.render(t,o),a=r.attachShadow({mode:"closed"});a.innerHTML=n,e.replaceWith(r),i?.(a)}),oo.pipe(m(()=>({ref:e})))}var Qn=x("table");function Yn(e){return e.replaceWith(Qn),Qn.replaceWith(Hn(e)),$({ref:e})}function es(e){let t=e.find(r=>r.checked)||e[0];return L(...e.map(r=>h(r,"change").pipe(m(()=>F(`label[for="${r.id}"]`))))).pipe(K(F(`label[for="${t.id}"]`)),m(r=>({active:r})))}function Bn(e,{viewport$:t,target$:r}){let o=F(".tabbed-labels",e),n=M(":scope > input",e),i=eo("prev");e.append(i);let a=eo("next");return e.append(a),H(()=>{let s=new S,c=s.pipe(re(),ie(!0));N([s,Te(e),pt(e)]).pipe(U(c),He(1,ge)).subscribe({next([{active:l},p]){let f=Qe(l),{width:u}=ue(l);e.style.setProperty("--md-indicator-x",`${f.x}px`),e.style.setProperty("--md-indicator-width",`${u}px`);let d=vr(o);(f.xd.x+p.width)&&o.scrollTo({left:Math.max(0,f.x-16),behavior:"smooth"})},complete(){e.style.removeProperty("--md-indicator-x"),e.style.removeProperty("--md-indicator-width")}}),N([Ye(o),Te(o)]).pipe(U(c)).subscribe(([l,p])=>{let f=_t(o);i.hidden=l.x<16,a.hidden=l.x>f.width-p.width-16}),L(h(i,"click").pipe(m(()=>-1)),h(a,"click").pipe(m(()=>1))).pipe(U(c)).subscribe(l=>{let{width:p}=ue(o);o.scrollBy({left:p*l,behavior:"smooth"})}),r.pipe(U(c),g(l=>n.includes(l))).subscribe(l=>l.click()),o.classList.add("tabbed-labels--linked");for(let l of n){let p=F(`label[for="${l.id}"]`);p.replaceChildren(x("a",{href:`#${p.htmlFor}`,tabIndex:-1},...Array.from(p.childNodes))),h(p.firstElementChild,"click").pipe(U(c),g(f=>!(f.metaKey||f.ctrlKey)),T(f=>{f.preventDefault(),f.stopPropagation()})).subscribe(()=>{history.replaceState({},"",`#${p.htmlFor}`),p.click()})}return D("content.tabs.link")&&s.pipe(Re(1),ee(t)).subscribe(([{active:l},{offset:p}])=>{let f=l.innerText.trim();if(l.hasAttribute("data-md-switching"))l.removeAttribute("data-md-switching");else{let u=e.offsetTop-p.y;for(let v of M("[data-tabs]"))for(let O of M(":scope > input",v)){let J=F(`label[for="${O.id}"]`);if(J!==l&&J.innerText.trim()===f){J.setAttribute("data-md-switching",""),O.click();break}}window.scrollTo({top:e.offsetTop-u});let d=__md_get("__tabs")||[];__md_set("__tabs",[...new Set([f,...d])])}}),s.pipe(U(c)).subscribe(()=>{for(let l of M("audio, video",e))l.offsetWidth&&l.autoplay?l.play().catch(()=>{}):l.pause()}),es(n).pipe(T(l=>s.next(l)),A(()=>s.complete()),m(l=>({ref:e,...l})))}).pipe(Ze(ce))}function Gn(e,t){let{viewport$:r,target$:o,print$:n}=t;return L(...M(".annotate:not(.highlight)",e).map(i=>Fn(i,{target$:o,print$:n})),...M("pre:not(.mermaid) > code",e).map(i=>Dn(i,{target$:o,print$:n})),...M("a",e).map(i=>zn(i,t)),...M("pre.mermaid",e).map(i=>Kn(i)),...M("table:not([class])",e).map(i=>Yn(i)),...M("details",e).map(i=>Vn(i,{target$:o,print$:n})),...M("[data-tabs]",e).map(i=>Bn(i,{viewport$:r,target$:o})),...M("[title]:not([data-preview])",e).filter(()=>D("content.tooltips")).map(i=>Ge(i,{viewport$:r})),...M(".footnote-ref",e).filter(()=>D("content.footnote.tooltips")).map(i=>Dt(i,{content$:new I(a=>{let s=new URL(i.href).hash.slice(1),c=Array.from(document.getElementById(s).cloneNode(!0).children),l=Er(...c);return a.next(l),document.body.append(l),()=>l.remove()}),viewport$:r})))}function ts(e,{alert$:t}){return t.pipe(b(r=>L($(!0),$(!1).pipe(ot(2e3))).pipe(m(o=>({message:r,active:o})))))}function Jn(e,t){let r=F(".md-typeset",e);return H(()=>{let o=new S;return o.subscribe(({message:n,active:i})=>{e.classList.toggle("md-dialog--active",i),r.textContent=n}),ts(e,t).pipe(T(n=>o.next(n)),A(()=>o.complete()),m(n=>({ref:e,...n})))})}var rs=0;function os(e,t){document.body.append(e);let{width:r}=ue(e);e.style.setProperty("--md-tooltip-width",`${r}px`),e.remove();let o=br(t),n=typeof o<"u"?Ye(o):$({x:0,y:0}),i=L(Ke(t),nt(t)).pipe(Q());return N([i,n]).pipe(m(([a,s])=>{let{x:c,y:l}=Qe(t),p=ue(t),f=t.closest("table");return f&&t.parentElement&&(c+=f.offsetLeft+t.parentElement.offsetLeft,l+=f.offsetTop+t.parentElement.offsetTop),{active:a,offset:{x:c-s.x+p.width/2-r/2,y:l-s.y+p.height+8}}}))}function Xn(e){let t=e.title;if(!t.length)return y;let r=`__tooltip_${rs++}`,o=Wt(r,"inline"),n=F(".md-typeset",o);return n.innerHTML=t,H(()=>{let i=new S;return i.subscribe({next({offset:a}){o.style.setProperty("--md-tooltip-x",`${a.x}px`),o.style.setProperty("--md-tooltip-y",`${a.y}px`)},complete(){o.style.removeProperty("--md-tooltip-x"),o.style.removeProperty("--md-tooltip-y")}}),L(i.pipe(g(({active:a})=>a)),i.pipe(_e(250),g(({active:a})=>!a))).subscribe({next({active:a}){a?(e.insertAdjacentElement("afterend",o),e.setAttribute("aria-describedby",r),e.removeAttribute("title")):(o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t))},complete(){o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t)}}),i.pipe(He(16,ge)).subscribe(({active:a})=>{o.classList.toggle("md-tooltip--active",a)}),i.pipe(vt(125,ge),g(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:a})=>a)).subscribe({next(a){a?o.style.setProperty("--md-tooltip-0",`${-a}px`):o.style.removeProperty("--md-tooltip-0")},complete(){o.style.removeProperty("--md-tooltip-0")}}),os(o,e).pipe(T(a=>i.next(a)),A(()=>i.complete()),m(a=>({ref:e,...a})))}).pipe(Ze(ce))}function ns({viewport$:e}){if(!D("header.autohide"))return $(!1);let t=e.pipe(m(({offset:{y:n}})=>n),rt(2,1),m(([n,i])=>[nMath.abs(i-n.y)>100),m(([,[n]])=>n),Q()),o=Be("search");return N([e,o]).pipe(m(([{offset:n},i])=>n.y>400&&!i),Q(),b(n=>n?r:$(!1)),K(!1))}function Zn(e,t){return H(()=>N([Te(e),ns(t)])).pipe(m(([{height:r},o])=>({height:r,hidden:o})),Q((r,o)=>r.height===o.height&&r.hidden===o.hidden),X(1))}function ei(e,{header$:t,main$:r}){return H(()=>{let o=new S,n=o.pipe(re(),ie(!0));o.pipe(oe("active"),$e(t)).subscribe(([{active:a},{hidden:s}])=>{e.classList.toggle("md-header--shadow",a&&!s),e.hidden=s});let i=me(M("[title]",e)).pipe(g(()=>D("content.tooltips")),G(a=>Xn(a)));return r.subscribe(o),t.pipe(U(n),m(a=>({ref:e,...a})),We(i.pipe(U(n))))})}function is(e,{viewport$:t,header$:r}){return xr(e,{viewport$:t,header$:r}).pipe(m(({offset:{y:o}})=>{let{height:n}=ue(e);return{active:n>0&&o>=n}}),oe("active"))}function ti(e,t){return H(()=>{let r=new S;r.subscribe({next({active:n}){e.classList.toggle("md-header__title--active",n)},complete(){e.classList.remove("md-header__title--active")}});let o=fe(".md-content h1");return typeof o>"u"?y:is(o,t).pipe(T(n=>r.next(n)),A(()=>r.complete()),m(n=>({ref:e,...n})))})}function ri(e,{viewport$:t,header$:r}){let o=r.pipe(m(({height:i})=>i),Q()),n=o.pipe(b(()=>Te(e).pipe(m(({height:i})=>({top:e.offsetTop,bottom:e.offsetTop+i})),oe("bottom"))));return N([o,n,t]).pipe(m(([i,{top:a,bottom:s},{offset:{y:c},size:{height:l}}])=>(l=Math.max(0,l-Math.max(0,a-c,i)-Math.max(0,l+c-s)),{offset:a-i,height:l,active:a-i<=c})),Q((i,a)=>i.offset===a.offset&&i.height===a.height&&i.active===a.active))}function as(e){let t=__md_get("__palette")||{index:e.findIndex(n=>matchMedia(n.getAttribute("data-md-color-media")).matches)},r=Math.max(0,Math.min(t.index,e.length-1)),o=!0;return $(...e).pipe(G(n=>h(n,"change").pipe(m(()=>n))),K(e[r]),m(n=>({index:e.indexOf(n),color:{media:n.getAttribute("data-md-color-media"),scheme:n.getAttribute("data-md-color-scheme"),primary:n.getAttribute("data-md-color-primary"),accent:n.getAttribute("data-md-color-accent")}})),m(n=>(o&&(o=!1,t?.color&&(n.color={...n.color,...t.color})),n)),X(1))}function oi(e){let t=M("input",e),r=x("meta",{name:"theme-color"});document.head.appendChild(r);let o=x("meta",{name:"color-scheme"});document.head.appendChild(o);let n=Ut("(prefers-color-scheme: light)");return H(()=>{let i=new S;return i.subscribe(a=>{if(document.body.setAttribute("data-md-color-switching",""),a.color.media==="(prefers-color-scheme)"){let s=matchMedia("(prefers-color-scheme: light)"),c=document.querySelector(s.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");a.color.scheme=c.getAttribute("data-md-color-scheme"),a.color.primary=c.getAttribute("data-md-color-primary"),a.color.accent=c.getAttribute("data-md-color-accent")}for(let[s,c]of Object.entries(a.color))document.body.setAttribute(`data-md-color-${s}`,c);for(let s=0;sa.key==="Enter"),ee(i,(a,s)=>s)).subscribe(({index:a})=>{a=(a+1)%t.length,t[a].click(),t[a].focus()}),i.pipe(m(()=>{let a=Ae("header"),s=window.getComputedStyle(a);return o.content=s.colorScheme,s.backgroundColor.match(/\d+/g).map(c=>(+c).toString(16).padStart(2,"0")).join("")})).subscribe(a=>r.content=`#${a}`),i.pipe(ye(ce)).subscribe(()=>{document.body.removeAttribute("data-md-color-switching")}),as(t).pipe(U(n.pipe(Re(1))),bt(),T(a=>i.next(a)),A(()=>i.complete()),m(a=>({ref:e,...a})))})}function ni(e,{progress$:t}){return H(()=>{let r=new S;return r.subscribe(({value:o})=>{e.style.setProperty("--md-progress-value",`${o}`)}),t.pipe(T(o=>r.next({value:o})),A(()=>r.complete()),m(o=>({ref:e,value:o})))})}function ii(e,t){return e.protocol=t.protocol,e.hostname=t.hostname,e}function ss(e,t){let r=new Map;for(let o of M("url",e)){let n=F("loc",o),i=[ii(new URL(n.textContent),t)];r.set(`${i[0]}`,i);for(let a of M("[rel=alternate]",o)){let s=a.getAttribute("href");s!=null&&i.push(ii(new URL(s),t))}}return r}function Ct(e){return dn(new URL("sitemap.xml",e)).pipe(m(t=>ss(t,new URL(e))),be(()=>$(new Map)),le())}function ai({document$:e}){let t=new Map;e.pipe(b(()=>M("link[rel=alternate]")),m(r=>new URL(r.href)),g(r=>!t.has(r.toString())),G(r=>Ct(r).pipe(m(o=>[r,o]),be(()=>y)))).subscribe(([r,o])=>{t.set(r.toString().replace(/\/$/,""),o)}),h(document.body,"click").pipe(g(r=>!r.metaKey&&!r.ctrlKey),b(r=>{if(r.target instanceof Element){let o=r.target.closest("a");if(o&&!o.target){let n=[...t].find(([f])=>o.href.startsWith(`${f}/`));if(typeof n>"u")return y;let[i,a]=n,s=Ee();if(s.href.startsWith(i))return y;let c=we(),l=s.href.replace(c.base,"");l=`${i}/${l}`;let p=a.has(l.split("#")[0])?new URL(l,c.base):new URL(i);return r.preventDefault(),$(p)}}return y})).subscribe(r=>at(r,!0))}var no=Ht(ro());function cs(e){e.setAttribute("data-md-copying","");let t=e.closest("[data-copy]"),r=t?t.getAttribute("data-copy"):e.innerText;return e.removeAttribute("data-md-copying"),r.trimEnd()}function si({alert$:e}){no.default.isSupported()&&new I(t=>{new no.default("[data-clipboard-target], [data-clipboard-text]",{text:r=>r.getAttribute("data-clipboard-text")||cs(F(r.getAttribute("data-clipboard-target")))}).on("success",r=>t.next(r))}).pipe(T(t=>{t.trigger.focus()}),m(()=>Oe("clipboard.copied"))).subscribe(e)}function ci(e,t){if(!(e.target instanceof Element))return y;let r=e.target.closest("a");if(r===null)return y;if(r.closest('[data-md-component="i18n"]'))return y;if(r.target||e.metaKey||e.ctrlKey)return y;let o=new URL(r.href);return o.search=o.hash="",t.has(`${o}`)?(e.preventDefault(),$(r)):y}function li(e){let t=new Map;for(let r of M(":scope > *",e.head))t.set(r.outerHTML,r);return t}function pi(e){for(let t of M("[href], [src]",e))for(let r of["href","src"]){let o=t.getAttribute(r);if(o&&!/^(?:[a-z]+:)?\/\//i.test(o)){t[r]=t[r];break}}return $(e)}function ls(){let e=document.documentElement.lang;e&&document.querySelectorAll('[data-md-component="i18n"] .md-select__link').forEach(t=>{t.classList.remove("md-select__link--active"),t.getAttribute("hreflang")===e&&t.classList.add("md-select__link--active")})}function ps(e){for(let o of["[data-md-component=announce]","[data-md-component=container]","[data-md-component=header-topic]","[data-md-component=outdated]","[data-md-component=logo]","[data-md-component=skip]",...D("navigation.tabs.sticky")?["[data-md-component=tabs]"]:[]]){let n=fe(o),i=fe(o,e);typeof n<"u"&&typeof i<"u"&&n.replaceWith(i)}let t=li(document);for(let[o,n]of li(e))t.has(o)?t.delete(o):document.head.appendChild(n);for(let o of t.values()){let n=o.getAttribute("name");n!=="theme-color"&&n!=="color-scheme"&&o.remove()}let r=Ae("container");return ze(M("script",r)).pipe(b(o=>{let n=e.createElement("script");if(o.src){for(let i of o.getAttributeNames())n.setAttribute(i,o.getAttribute(i));return o.replaceWith(n),new I(i=>{n.onload=()=>i.complete()})}else return n.textContent=o.textContent,o.replaceWith(n),y}),re(),ie(document),T(()=>ls()))}function mi({sitemap$:e,location$:t,viewport$:r,progress$:o}){if(location.protocol==="file:")return y;$(document).subscribe(pi);let n=h(document.body,"click").pipe($e(e),b(([s,c])=>ci(s,c)),m(({href:s})=>new URL(s)),le()),i=h(window,"popstate").pipe(m(Ee),le());n.pipe(ee(r)).subscribe(([s,{offset:c}])=>{history.replaceState(c,""),history.pushState(null,"",s)}),L(n,i).subscribe(t);let a=t.pipe(oe("pathname"),b(s=>yr(s,{progress$:o}).pipe(be(()=>(at(s,!0),y)))),b(pi),b(ps),le());return L(a.pipe(ee(t,(s,c)=>c)),a.pipe(b(()=>t),oe("hash")),t.pipe(Q((s,c)=>s.pathname===c.pathname&&s.hash===c.hash),b(()=>n),T(()=>history.back()))).subscribe(s=>{history.state!==null||!s.hash?window.scrollTo(0,history.state?.y??0):(history.scrollRestoration="auto",mn(s.hash),history.scrollRestoration="manual")}),t.subscribe(()=>{history.scrollRestoration="manual"}),h(window,"beforeunload").subscribe(()=>{history.scrollRestoration="auto"}),r.pipe(oe("offset"),_e(100)).subscribe(({offset:s})=>{history.replaceState(s,"")}),D("navigation.instant.prefetch")&&L(h(document.body,"mousemove"),h(document.body,"focusin")).pipe($e(e),b(([s,c])=>ci(s,c)),_e(25),Nr(({href:s})=>s),dr(s=>{let c=document.createElement("link");return c.rel="prefetch",c.href=s.toString(),document.head.appendChild(c),h(c,"load").pipe(m(()=>c),xe(1))})).subscribe(s=>s.remove()),a}var fi=Ht(Xr());function ui(e){let t=e.separator.split("|").map(n=>n.replace(/(\(\?[!=<][^)]+\))/g,"").length===0?"\uFFFD":n).join("|"),r=new RegExp(t,"img"),o=(n,i,a)=>`${i}${a}`;return n=>{n=n.replace(/[\s*+\-:~^]+/g," ").replace(/&/g,"&").trim();let i=new RegExp(`(^|${e.separator}|)(${n.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return a=>(0,fi.default)(a).replace(i,o).replace(/<\/mark>(\s+)]*>/img,"$1")}}function Nt(e){return e.type===1}function Sr(e){return e.type===3}function di(e,t){let r=xn(e);return L($(location.protocol!=="file:"),Be("search")).pipe(Pe(o=>o),b(()=>t)).subscribe(({config:o,docs:n})=>r.next({type:0,data:{config:o,docs:n,options:{suggest:D("search.suggest")}}})),r}function hi(e){let{selectedVersionSitemap:t,selectedVersionBaseURL:r,currentLocation:o,currentBaseURL:n}=e,i=io(n)?.pathname;if(i===void 0)return;let a=us(o.pathname,i);if(a===void 0)return;let s=hs(t.keys());if(!t.has(s))return;let c=io(a,s);if(!c||!t.has(c.href))return;let l=io(a,r);if(l)return l.hash=o.hash,l.search=o.search,l}function io(e,t){try{return new URL(e,t)}catch{return}}function us(e,t){if(e.startsWith(t))return e.slice(t.length)}function ds(e,t){let r=Math.min(e.length,t.length),o;for(o=0;oy)),o=r.pipe(m(n=>{let[,i]=t.base.match(/([^/]+)\/?$/);return n.find(({version:a,aliases:s})=>a===i||s.includes(i))||n[0]}));r.pipe(m(n=>new Map(n.map(i=>[`${new URL(`../${i.version}/`,t.base)}`,i]))),b(n=>h(document.body,"click").pipe(g(i=>!i.metaKey&&!i.ctrlKey),ee(o),b(([i,a])=>{if(i.target instanceof Element){let s=i.target.closest("a");if(s&&!s.target&&n.has(s.href)){let c=s.href;return!i.target.closest(".md-version")&&n.get(c)===a?y:(i.preventDefault(),$(new URL(c)))}}return y}),b(i=>Ct(i).pipe(m(a=>hi({selectedVersionSitemap:a,selectedVersionBaseURL:i,currentLocation:Ee(),currentBaseURL:t.base})??i)))))).subscribe(n=>at(n,!0)),N([r,o]).subscribe(([n,i])=>{F(".md-header__topic").appendChild($n(n,i))}),e.pipe(b(()=>o)).subscribe(n=>{let i=new URL(t.base),a=__md_get("__outdated",sessionStorage,i);if(a===null){a=!0;let s=t.version?.default||"latest";Array.isArray(s)||(s=[s]);e:for(let c of s)for(let l of n.aliases.concat(n.version))if(new RegExp(c,"i").test(l)){a=!1;break e}__md_set("__outdated",a,sessionStorage,i)}if(a)for(let s of pe("outdated"))s.hidden=!1})}function bs(e,{worker$:t}){let{searchParams:r}=Ee();r.has("q")&&(it("search",!0),e.value=r.get("q"),e.focus(),Be("search").pipe(Pe(i=>!i)).subscribe(()=>{let i=Ee();i.searchParams.delete("q"),history.replaceState({},"",`${i}`)}));let o=Ke(e),n=L(t.pipe(Pe(Nt)),h(e,"keyup"),o).pipe(m(()=>e.value),Q());return N([n,o]).pipe(m(([i,a])=>({value:i,focus:a})),X(1))}function vi(e,{worker$:t}){let r=new S,o=r.pipe(re(),ie(!0));N([t.pipe(Pe(Nt)),r],(i,a)=>a).pipe(oe("value")).subscribe(({value:i})=>t.next({type:2,data:i})),r.pipe(oe("focus")).subscribe(({focus:i})=>{i&&it("search",i)}),h(e.form,"reset").pipe(U(o)).subscribe(()=>e.focus());let n=F("header [for=__search]");return h(n,"click").subscribe(()=>e.focus()),bs(e,{worker$:t}).pipe(T(i=>r.next(i)),A(()=>r.complete()),m(i=>({ref:e,...i})),X(1))}function gi(e,{worker$:t,query$:r}){let o=new S,n=an(e.parentElement).pipe(g(Boolean)),i=e.parentElement,a=F(":scope > :first-child",e),s=F(":scope > :last-child",e);Be("search").subscribe(p=>{s.setAttribute("role",p?"list":"presentation"),s.hidden=!p}),o.pipe(ee(r),Kr(t.pipe(Pe(Nt)))).subscribe(([{items:p},{value:f}])=>{switch(p.length){case 0:a.textContent=f.length?Oe("search.result.none"):Oe("search.result.placeholder");break;case 1:a.textContent=Oe("search.result.one");break;default:let u=hr(p.length);a.textContent=Oe("search.result.other",u)}});let c=o.pipe(T(()=>s.innerHTML=""),b(({items:p})=>L($(...p.slice(0,10)),$(...p.slice(10)).pipe(rt(4),Yr(n),b(([f])=>f)))),m(Cn),le());return c.subscribe(p=>s.appendChild(p)),c.pipe(G(p=>{let f=fe("details",p);return typeof f>"u"?y:h(f,"toggle").pipe(U(o),m(()=>f))})).subscribe(p=>{p.open===!1&&p.offsetTop<=i.scrollTop&&i.scrollTo({top:p.offsetTop})}),t.pipe(g(Sr),m(({data:p})=>p)).pipe(T(p=>o.next(p)),A(()=>o.complete()),m(p=>({ref:e,...p})))}function vs(e,{query$:t}){return t.pipe(m(({value:r})=>{let o=Ee();return o.hash="",r=r.replace(/\s+/g,"+").replace(/&/g,"%26").replace(/=/g,"%3D"),o.search=`q=${r}`,{url:o}}))}function yi(e,t){let r=new S,o=r.pipe(re(),ie(!0));return r.subscribe(({url:n})=>{e.setAttribute("data-clipboard-text",e.href),e.href=`${n}`}),h(e,"click").pipe(U(o)).subscribe(n=>n.preventDefault()),vs(e,t).pipe(T(n=>r.next(n)),A(()=>r.complete()),m(n=>({ref:e,...n})))}function xi(e,{worker$:t,keyboard$:r}){let o=new S,n=Ae("search-query"),i=L(h(n,"keydown"),h(n,"focus")).pipe(ye(ce),m(()=>n.value),Q());return o.pipe($e(i),m(([{suggest:s},c])=>{let l=c.split(/([\s-]+)/);if(s?.length&&l[l.length-1]){let p=s[s.length-1];p.startsWith(l[l.length-1])&&(l[l.length-1]=p)}else l.length=0;return l})).subscribe(s=>e.textContent=s.join("")),r.pipe(g(({mode:s})=>s==="search")).subscribe(s=>{s.type==="ArrowRight"&&e.innerText.length&&n.selectionStart===n.value.length&&(n.value=e.innerText)}),t.pipe(g(Sr),m(({data:s})=>s)).pipe(T(s=>o.next(s)),A(()=>o.complete()),m(()=>({ref:e})))}function Ei(e,{index$:t,keyboard$:r}){let o=we();try{let n=di(o.search,t),i=Ae("search-query",e),a=Ae("search-result",e);h(e,"click").pipe(g(({target:c})=>c instanceof Element&&!!c.closest("a"))).subscribe(()=>it("search",!1)),r.pipe(g(({mode:c})=>c==="search")).subscribe(c=>{let l=De();switch(c.type){case"Enter":if(l===i){let p=new Map;for(let f of M(":first-child [href]",a)){let u=f.firstElementChild;p.set(f,parseFloat(u.getAttribute("data-md-score")))}if(p.size){let[[f]]=[...p].sort(([,u],[,d])=>d-u);f.click()}c.claim()}break;case"Escape":case"Tab":it("search",!1),i.blur();break;case"ArrowUp":case"ArrowDown":if(typeof l>"u")i.focus();else{let p=[i,...M(":not(details) > [href], summary, details[open] [href]",a)],f=Math.max(0,(Math.max(0,p.indexOf(l))+p.length+(c.type==="ArrowUp"?-1:1))%p.length);p[f].focus()}c.claim();break;default:i!==De()&&i.focus()}}),r.pipe(g(({mode:c})=>c==="global")).subscribe(c=>{switch(c.type){case"f":case"s":case"/":i.focus(),i.select(),c.claim();break}});let s=vi(i,{worker$:n});return L(s,gi(a,{worker$:n,query$:s})).pipe(We(...pe("search-share",e).map(c=>yi(c,{query$:s})),...pe("search-suggest",e).map(c=>xi(c,{worker$:n,keyboard$:r}))))}catch{return e.hidden=!0,et}}function wi(e,{index$:t,location$:r}){return N([t,r.pipe(K(Ee()),g(o=>!!o.searchParams.get("h")))]).pipe(m(([o,n])=>ui(o.config)(n.searchParams.get("h"))),m(o=>{let n=new Map,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(let a=i.nextNode();a;a=i.nextNode())if(a.parentElement?.offsetHeight){let s=a.textContent,c=o(s);c.length>s.length&&n.set(a,c)}for(let[a,s]of n){let{childNodes:c}=x("span",null,s);a.replaceWith(...Array.from(c))}return{ref:e,nodes:n}}))}function gs(e,{viewport$:t,main$:r}){let o=e.closest(".md-grid"),n=o.offsetTop-o.parentElement.offsetTop;return N([r,t]).pipe(m(([{offset:i,height:a},{offset:{y:s}}])=>(a=a+Math.min(n,Math.max(0,s-i))-n,{height:a,locked:s>=i+n})),Q((i,a)=>i.height===a.height&&i.locked===a.locked))}function ao(e,{header$:t,...r}){let o=F(".md-sidebar__scrollwrap",e),{y:n}=Qe(o);return H(()=>{let i=new S,a=i.pipe(re(),ie(!0)),s=i.pipe(He(0,ge));return s.pipe(ee(t)).subscribe({next([{height:c},{height:l}]){o.style.height=`${c-2*n}px`,e.style.top=`${l}px`},complete(){o.style.height="",e.style.top=""}}),s.pipe(Pe()).subscribe(()=>{for(let c of M(".md-nav__link--active[href]",e)){if(!c.clientHeight)continue;let l=c.closest(".md-sidebar__scrollwrap");if(typeof l<"u"){let p=c.offsetTop-l.offsetTop,{height:f}=ue(l);l.scrollTo({top:p-f/2})}}}),me(M("label[tabindex]",e)).pipe(G(c=>h(c,"click").pipe(ye(ce),m(()=>c),U(a)))).subscribe(c=>{let l=F(`[id="${c.htmlFor}"]`);F(`[aria-labelledby="${c.id}"]`).setAttribute("aria-expanded",`${l.checked}`)}),D("content.tooltips")&&me(M("abbr[title]",e)).pipe(G(c=>Ge(c,{viewport$})),U(a)).subscribe(),gs(e,r).pipe(T(c=>i.next(c)),A(()=>i.complete()),m(c=>({ref:e,...c})))})}function Si(e,t){if(typeof t<"u"){let r=`https://api.github.com/repos/${e}/${t}`;return tt(Ve(`${r}/releases/latest`).pipe(be(()=>y),m(o=>({version:o.tag_name})),qe({})),Ve(r).pipe(be(()=>y),m(o=>({stars:o.stargazers_count,forks:o.forks_count})),qe({}))).pipe(m(([o,n])=>({...o,...n})))}else{let r=`https://api.github.com/users/${e}`;return Ve(r).pipe(m(o=>({repositories:o.public_repos})),qe({}))}}function Ti(e,t){let r=`https://${e}/api/v4/projects/${encodeURIComponent(t)}`;return tt(Ve(`${r}/releases/permalink/latest`).pipe(be(()=>y),m(({tag_name:o})=>({version:o})),qe({})),Ve(r).pipe(be(()=>y),m(({star_count:o,forks_count:n})=>({stars:o,forks:n})),qe({}))).pipe(m(([o,n])=>({...o,...n})))}function Oi(e){let t=e.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i);if(t){let[,r,o]=t;return Si(r,o)}if(t=e.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i),t){let[,r,o]=t;return Ti(r,o)}return y}var ys;function xs(e){return ys||(ys=H(()=>{let t=__md_get("__source",sessionStorage);if(t)return $(t);if(pe("consent").length){let o=__md_get("__consent");if(!(o&&o.github))return y}return Oi(e.href).pipe(T(o=>__md_set("__source",o,sessionStorage)))}).pipe(be(()=>y),g(t=>Object.keys(t).length>0),m(t=>({facts:t})),X(1)))}function Li(e){let t=F(":scope > :last-child",e);return H(()=>{let r=new S;return r.subscribe(({facts:o})=>{t.appendChild(kn(o)),t.classList.add("md-source__repository--active")}),xs(e).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))})}function Es(e,{viewport$:t,header$:r}){return Te(document.body).pipe(b(()=>xr(e,{header$:r,viewport$:t})),m(({offset:{y:o}})=>({hidden:o>=10})),oe("hidden"))}function Mi(e,t){return H(()=>{let r=new S;return r.subscribe({next({hidden:o}){e.hidden=o},complete(){e.hidden=!1}}),(D("navigation.tabs.sticky")?$({hidden:!1}):Es(e,t)).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))})}function ws(e,{viewport$:t,header$:r}){let o=new Map,n=M(".md-nav__link",e);for(let s of n){let c=decodeURIComponent(s.hash.substring(1)),l=fe(`[id="${c}"]`);typeof l<"u"&&o.set(s,l)}let i=r.pipe(oe("height"),m(({height:s})=>{let c=Ae("main"),l=F(":scope > :first-child",c);return s+.8*(l.offsetTop-c.offsetTop)}),le());return Te(document.body).pipe(oe("height"),b(s=>H(()=>{let c=[];return $([...o].reduce((l,[p,f])=>{for(;c.length&&o.get(c[c.length-1]).tagName>=f.tagName;)c.pop();let u=f.offsetTop;for(;!u&&f.parentElement;)f=f.parentElement,u=f.offsetTop;let d=f.offsetParent;for(;d;d=d.offsetParent)u+=d.offsetTop;return l.set([...c=[...c,p]].reverse(),u)},new Map))}).pipe(m(c=>new Map([...c].sort(([,l],[,p])=>l-p))),$e(i),b(([c,l])=>t.pipe(jt(([p,f],{offset:{y:u},size:d})=>{let v=u+d.height>=Math.floor(s.height);for(;f.length;){let[,O]=f[0];if(O-l=u&&!v)f=[p.pop(),...f];else break}return[p,f]},[[],[...c]]),Q((p,f)=>p[0]===f[0]&&p[1]===f[1])))))).pipe(m(([s,c])=>({prev:s.map(([l])=>l),next:c.map(([l])=>l)})),K({prev:[],next:[]}),rt(2,1),m(([s,c])=>s.prev.length{let i=new S,a=i.pipe(re(),ie(!0));if(i.subscribe(({prev:s,next:c})=>{for(let[l]of c)l.classList.remove("md-nav__link--passed"),l.classList.remove("md-nav__link--active");for(let[l,[p]]of s.entries())p.classList.add("md-nav__link--passed"),p.classList.toggle("md-nav__link--active",l===s.length-1)}),D("toc.follow")){let s=L(t.pipe(_e(1),m(()=>{})),t.pipe(_e(250),m(()=>"smooth")));i.pipe(g(({prev:c})=>c.length>0),$e(o.pipe(ye(ce))),ee(s)).subscribe(([[{prev:c}],l])=>{let[p]=c[c.length-1];if(p.offsetHeight){let f=br(p);if(typeof f<"u"){let u=p.offsetTop-f.offsetTop,{height:d}=ue(f);f.scrollTo({top:u-d/2,behavior:l})}}})}return D("navigation.tracking")&&t.pipe(U(a),oe("offset"),_e(250),Re(1),U(n.pipe(Re(1))),bt({delay:250}),ee(i)).subscribe(([,{prev:s}])=>{let c=Ee(),l=s[s.length-1];if(l&&l.length){let[p]=l,{hash:f}=new URL(p.href);c.hash!==f&&(c.hash=f,history.replaceState({},"",`${c}`))}else c.hash="",history.replaceState({},"",`${c}`)}),ws(e,{viewport$:t,header$:r}).pipe(T(s=>i.next(s)),A(()=>i.complete()),m(s=>({ref:e,...s})))})}function Ss(e,{viewport$:t,main$:r,target$:o}){let n=t.pipe(m(({offset:{y:a}})=>a),rt(2,1),m(([a,s])=>a>s&&s>0),Q()),i=r.pipe(m(({active:a})=>a));return N([i,n]).pipe(m(([a,s])=>!(a&&s)),Q(),U(o.pipe(Re(1))),ie(!0),bt({delay:250}),m(a=>({hidden:a})))}function Ai(e,{viewport$:t,header$:r,main$:o,target$:n}){let i=new S,a=i.pipe(re(),ie(!0));return i.subscribe({next({hidden:s}){e.hidden=s,s?(e.setAttribute("tabindex","-1"),e.blur()):e.removeAttribute("tabindex")},complete(){e.style.top="",e.hidden=!0,e.removeAttribute("tabindex")}}),r.pipe(U(a),oe("height")).subscribe(({height:s})=>{e.style.top=`${s+16}px`}),h(e,"click").subscribe(s=>{s.preventDefault(),window.scrollTo({top:0})}),Ss(e,{viewport$:t,main$:o,target$:n}).pipe(T(s=>i.next(s)),A(()=>i.complete()),m(s=>({ref:e,...s})))}function Ci({document$:e,viewport$:t}){e.pipe(b(()=>M(".md-ellipsis")),G(r=>pt(r).pipe(U(e.pipe(Re(1))),g(o=>o),m(()=>r),xe(1))),g(r=>r.offsetWidth{let o=r.innerText,n=r.closest("a")||r;return n.title=o,D("content.tooltips")?Ge(n,{viewport$:t}).pipe(U(e.pipe(Re(1))),A(()=>n.removeAttribute("title"))):y})).subscribe(),D("content.tooltips")&&e.pipe(b(()=>M(".md-status")),G(r=>Ge(r,{viewport$:t}))).subscribe()}function ki({document$:e,tablet$:t}){e.pipe(b(()=>M(".md-toggle--indeterminate")),T(r=>{r.indeterminate=!0,r.checked=!1}),G(r=>h(r,"change").pipe(Qr(()=>r.classList.contains("md-toggle--indeterminate")),m(()=>r))),ee(t)).subscribe(([r,o])=>{r.classList.remove("md-toggle--indeterminate"),o&&(r.checked=!1)})}function Ts(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}function Hi({document$:e}){e.pipe(b(()=>M("[data-md-scrollfix]")),T(t=>t.removeAttribute("data-md-scrollfix")),g(Ts),G(t=>h(t,"touchstart").pipe(m(()=>t)))).subscribe(t=>{let r=t.scrollTop;r===0?t.scrollTop=1:r+t.offsetHeight===t.scrollHeight&&(t.scrollTop=r-1)})}function $i({viewport$:e,tablet$:t}){N([Be("search"),t]).pipe(m(([r,o])=>r&&!o),b(r=>$(r).pipe(ot(r?400:100))),ee(e)).subscribe(([r,{offset:{y:o}}])=>{if(r)document.body.setAttribute("data-md-scrolllock",""),document.body.style.top=`-${o}px`;else{let n=-1*parseInt(document.body.style.top,10);document.body.removeAttribute("data-md-scrolllock"),document.body.style.top="",n&&window.scrollTo(0,n)}})}Object.entries||(Object.entries=function(e){let t=[];for(let r of Object.keys(e))t.push([r,e[r]]);return t});Object.values||(Object.values=function(e){let t=[];for(let r of Object.keys(e))t.push(e[r]);return t});typeof Element<"u"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(e,t){typeof e=="object"?(this.scrollLeft=e.left,this.scrollTop=e.top):(this.scrollLeft=e,this.scrollTop=t)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...e){let t=this.parentNode;if(t){e.length===0&&t.removeChild(this);for(let r=e.length-1;r>=0;r--){let o=e[r];typeof o=="string"?o=document.createTextNode(o):o.parentNode&&o.parentNode.removeChild(o),r?t.insertBefore(this.previousSibling,o):t.replaceChild(o,this)}}}));function Os(){return location.protocol==="file:"?Mt(`${new URL("search/search_index.js",qt.base)}`).pipe(m(()=>__index),X(1)):Ve(new URL(qt.search_index||"search/search_index.json",qt.base))}document.documentElement.classList.remove("no-js");document.documentElement.classList.add("js");var st=Xo(),Kt=ln(),kt=fn(Kt),so=cn(),Ce=yn(),Tr=Ut("(min-width: 60em)"),Pi=Ut("(min-width: 76.25em)"),Ri=un(),qt=we(),Ii=document.forms.namedItem("search")?Os():et,co=new S;si({alert$:co});ai({document$:st});var lo=new S,Fi=Ct(qt.base);D("navigation.instant")&&mi({sitemap$:Fi,location$:Kt,viewport$:Ce,progress$:lo}).subscribe(st);qt.version?.provider==="mike"&&bi({document$:st});L(Kt,kt).pipe(ot(125)).subscribe(()=>{it("drawer",!1),it("search",!1)});so.pipe(g(({mode:e})=>e==="global")).subscribe(e=>{switch(e.type){case"p":case",":let t=fe("link[rel=prev]");typeof t<"u"&&at(t);break;case"n":case".":let r=fe("link[rel=next]");typeof r<"u"&&at(r);break;case"Enter":let o=De();o instanceof HTMLLabelElement&&o.click()}});Ci({viewport$:Ce,document$:st});ki({document$:st,tablet$:Tr});Hi({document$:st});$i({viewport$:Ce,tablet$:Tr});var mt=Zn(Ae("header"),{viewport$:Ce}),zt=st.pipe(m(()=>Ae("main")),b(e=>ri(e,{viewport$:Ce,header$:mt})),X(1)),Ls=L(...pe("consent").map(e=>wn(e,{target$:kt})),...pe("dialog").map(e=>Jn(e,{alert$:co})),...pe("palette").map(e=>oi(e)),...pe("progress").map(e=>ni(e,{progress$:lo})),...pe("search").map(e=>Ei(e,{index$:Ii,keyboard$:so})),...pe("source").map(e=>Li(e))),Ms=H(()=>L(...pe("announce").map(e=>En(e)),...pe("content").map(e=>Gn(e,{sitemap$:Fi,viewport$:Ce,target$:kt,print$:Ri})),...pe("content").map(e=>D("search.highlight")?wi(e,{index$:Ii,location$:Kt}):y),...pe("header").map(e=>ei(e,{viewport$:Ce,header$:mt,main$:zt})),...pe("header-title").map(e=>ti(e,{viewport$:Ce,header$:mt})),...pe("sidebar").map(e=>e.getAttribute("data-md-type")==="navigation"?Gr(Pi,()=>ao(e,{viewport$:Ce,header$:mt,main$:zt})):Gr(Tr,()=>ao(e,{viewport$:Ce,header$:mt,main$:zt}))),...pe("tabs").map(e=>Mi(e,{viewport$:Ce,header$:mt})),...pe("toc").map(e=>_i(e,{viewport$:Ce,header$:mt,main$:zt,target$:kt})),...pe("top").map(e=>Ai(e,{viewport$:Ce,header$:mt,main$:zt,target$:kt})))),ji=st.pipe(b(()=>Ms),We(Ls),X(1));ji.subscribe();window.document$=st;window.location$=Kt;window.target$=kt;window.keyboard$=so;window.viewport$=Ce;window.tablet$=Tr;window.screen$=Pi;window.print$=Ri;window.alert$=co;window.progress$=lo;window.component$=ji;})(); /*! Bundled license information: escape-html/index.js: diff --git a/docsforge/templates/assets/javascripts/sw.js b/docsforge/templates/assets/javascripts/sw.js index 24ca1b338..0392e6fa1 100644 --- a/docsforge/templates/assets/javascripts/sw.js +++ b/docsforge/templates/assets/javascripts/sw.js @@ -1 +1 @@ -"use strict";const BUILD_HASH="__DOCSFORGE_BUILD_HASH__",CACHE_NAME=`docsforge-${BUILD_HASH}`,META_CACHE="docsforge-meta",MANIFEST_URL="cache-manifest.json",FILES_KEY="docsforge-manifest-files",ACCESS_KEY="docsforge-access-times",BASE_URL="__DOCSFORGE_BASE_URL__".replace(/\/?$/,"/")||self.location.pathname.replace(/sw\.js$/,""),ORIGIN_BASE=self.location.origin+BASE_URL,I18N_DB_NAME="docsforge-i18n",I18N_DB_STORE="preferences",I18N_LOCALE_KEY="preferred_locale",SYNC_CONCURRENCY=6,QUOTA_MARGIN_BYTES=20*1024*1024,QUOTA_MARGIN_RATIO=.1;let _manifest=null,_manifestRefresh=null,_syncPromise=null,_preferredLocale=null;function log(...e){console.log("[SW]",...e)}function openI18nDB(){return new Promise((e,t)=>{const n=indexedDB.open(I18N_DB_NAME,1);n.onupgradeneeded=a=>{a.target.result.createObjectStore(I18N_DB_STORE)},n.onsuccess=a=>e(a.target.result),n.onerror=a=>t(a)})}async function readPreferredLocale(){try{const n=(await openI18nDB()).transaction(I18N_DB_STORE,"readonly").objectStore(I18N_DB_STORE);_preferredLocale=await new Promise((c,i)=>{const s=n.get(I18N_LOCALE_KEY);s.onsuccess=()=>c(s.result),s.onerror=()=>i(s.error)})||""}catch{_preferredLocale=""}return _preferredLocale}self.addEventListener("message",e=>{if(e.data&&e.data.type==="DOCSFORGE_RELOAD_DETECTED"&&(log("Reload detected by page; refreshing manifest in background"),refreshManifest().catch(()=>{})),e.data&&e.data.type==="DOCSFORGE_SET_LOCALE"){const t=e.data.locale||"";_preferredLocale=t,openI18nDB().then(n=>{const c=n.transaction(I18N_DB_STORE,"readwrite").objectStore(I18N_DB_STORE);t?c.put(t,I18N_LOCALE_KEY):c.delete(I18N_LOCALE_KEY)}).catch(()=>{})}});async function loadManifestFromCache(){if(_manifest)return _manifest;try{const t=await(await caches.open(META_CACHE)).match(MANIFEST_URL);if(t)return _manifest=await t.json(),log("Manifest loaded from meta cache:",_manifest.version),_manifest}catch{}return null}async function refreshManifest(){return _manifestRefresh||(_manifestRefresh=(async()=>{try{log("Fetching manifest...");const e=await fetch(MANIFEST_URL,{cache:"no-cache"});if(e.ok){const t=e.clone(),n=await e.json();await(await caches.open(META_CACHE)).put(MANIFEST_URL,t),_manifest=n,log("Manifest fetched:",n.version),await syncCacheFromManifest(n)}else log("Manifest fetch returned non-ok status:",e.status)}catch(e){log("Manifest refresh failed:",e.message)}return _manifest})().finally(()=>{_manifestRefresh=null}),_manifestRefresh)}async function getManifest(){return await loadManifestFromCache()}async function readPrevFiles(){const t=await(await caches.open(META_CACHE)).match(FILES_KEY);if(!t)return{};try{return await t.json()||{}}catch{return{}}}async function writePrevFiles(e){await(await caches.open(META_CACHE)).put(FILES_KEY,new Response(JSON.stringify(e)))}async function readAccessTimes(){const t=await(await caches.open(META_CACHE)).match(ACCESS_KEY);if(!t)return{};try{return await t.json()||{}}catch{return{}}}async function writeAccessTimes(e){await(await caches.open(META_CACHE)).put(ACCESS_KEY,new Response(JSON.stringify(e)))}async function touchAccessTime(e){try{const t=await readAccessTimes();t[e]=Date.now(),await writeAccessTimes(t)}catch{}}async function runWithConcurrency(e,t){const n=[],a=[];for(const[c,i]of e.entries()){const s=Promise.resolve().then(()=>i());n[c]=s;const o=s.then(()=>{});if(a.push(o),a.length>=t){await Promise.race(a);const r=a.findIndex(l=>l===o);r!==-1&&a.splice(r,1)}}return await Promise.all(a),Promise.all(n)}function keyToUrl(e){return new URL(e,ORIGIN_BASE).href}function urlToKey(e){const t=typeof e=="string"?e:e.href;return t.startsWith(ORIGIN_BASE)?t.slice(ORIGIN_BASE.length)||"./":null}function manifestHasFile(e,t){if(!e||!e.files)return!0;let n=urlToKey(t);return n===null?!0:(n.endsWith("/index.html")&&(n=n.slice(0,-10)||"./"),Object.prototype.hasOwnProperty.call(e.files,n))}async function makeSpaceIfNeeded(e=0){if(!navigator.storage||!navigator.storage.estimate)return;let t;try{t=await navigator.storage.estimate()}catch{return}if(!t||typeof t.usage!="number"||typeof t.quota!="number")return;const n=t.quota-t.usage,a=Math.max(e+QUOTA_MARGIN_BYTES,Math.floor(t.quota*QUOTA_MARGIN_RATIO));if(n>=a)return;const c=await caches.open(CACHE_NAME),i=await readAccessTimes(),s=[];for(const r of await c.keys()){const l=urlToKey(r.url);l&&(l===MANIFEST_URL||l==="sw.js"||s.push({url:r.url,key:l,time:i[r.url]||0}))}s.sort((r,l)=>r.time-l.time);let o=0;for(const r of s){if(n+o>=a)break;await c.delete(r.url)&&(delete i[r.url],o+=5*1024*1024)}await writeAccessTimes(i)}async function putWithQuotaHandling(e,t,n){try{await e.put(t,n.clone()),await touchAccessTime(t.url)}catch(a){if(a&&a.name==="QuotaExceededError"){log("Quota exceeded, evicting LRU entries...");const c=n.headers.get("content-length");await makeSpaceIfNeeded(c?parseInt(c,10):0);try{await e.put(t,n.clone()),await touchAccessTime(t.url)}catch(i){log("Still failed after eviction:",i.message)}}else throw a}}async function deleteOrphans(e,t){const n=await caches.open(CACHE_NAME),a=await n.keys();let c=0;for(const i of a){const s=urlToKey(i.url);s&&(s===MANIFEST_URL||s==="sw.js"||Object.prototype.hasOwnProperty.call(t,s)&&(Object.prototype.hasOwnProperty.call(e,s)||(await n.delete(i.url),c++)))}c>0&&log("Deleted",c,"orphaned cache entries")}async function syncCacheFromManifest(e){if(e)return _syncPromise||(_syncPromise=(async()=>{const t=await readPrevFiles(),n=e.files||{},a=await caches.open(CACHE_NAME);let c=0;const i=Object.keys(n);log("Syncing",i.length,"files from manifest...");const s=i.map(o=>async()=>{const r=n[o];if(t[o]!==r)try{const l=keyToUrl(o);log("Caching:",o);const f=await fetch(l,{cache:"no-cache"});f&&f.ok&&(await putWithQuotaHandling(a,l,f),t[o]=r,c++)}catch(l){log("Failed to cache:",o,l.message)}});await runWithConcurrency(s,SYNC_CONCURRENCY),await writePrevFiles(t),await deleteOrphans(n,t),log("Sync complete:",c,"files updated"),c>0&&self.clients.matchAll({includeUncontrolled:!0}).then(o=>o.forEach(r=>r.postMessage({type:"DOCSFORGE_UPDATE_READY",count:c}))).catch(()=>{})})().finally(()=>{_syncPromise=null}),_syncPromise)}async function respond404(){const e=await caches.open(CACHE_NAME),t=await readPreferredLocale(),n=[];t&&n.push(BASE_URL+"404."+t+".html"),n.push(BASE_URL+"404.html");for(const a of n){const c=await e.match(a).catch(()=>null);if(c){const i=await c.text();return new Response(i,{status:404,headers:{"Content-Type":"text/html"}})}}return new Response("

404 Not Found

",{status:404,headers:{"Content-Type":"text/html"}})}function buildPageCandidates(e,t){const n=[];return t&&(e.pathname.endsWith("/")?n.push(new URL(e.pathname+"index."+t+".html",e.origin).href):e.pathname.endsWith(".html")?n.push(new URL(e.pathname.slice(0,-5)+"."+t+".html",e.origin).href):n.push(new URL(e.pathname+"."+t+".html",e.origin).href)),n.push(e.href),e.pathname.endsWith("/")&&n.push(new URL(e.pathname+"index.html",e.origin).href),n}async function servePage(e){const t=await caches.open(CACHE_NAME),n=new URL(e.url),a=await readPreferredLocale(),c=await loadManifestFromCache(),i=buildPageCandidates(n,a);for(const s of i){const o=await t.match(s);if(o)return log("Serving page from cache:",s),await touchAccessTime(s),o}if(navigator.onLine===!1)return respond404();for(const s of i){if(!manifestHasFile(c,s)){log("Skipping page candidate not in manifest:",s);continue}log("Fetching page candidate:",s);try{const o=await fetch(s);if(o&&o.ok)return await putWithQuotaHandling(t,s,o),o}catch{}}return log("Page unavailable, returning 404:",e.url),respond404()}async function serveAsset(e){const t=await caches.open(CACHE_NAME),n=await t.match(e);if(n)return await touchAccessTime(e.url),n;try{const a=await fetch(e);if(a&&a.ok)return await putWithQuotaHandling(t,e,a),a}catch{}return new Response("Not found",{status:404})}function isPageRequest(e){return e.destination==="document"||e.mode==="navigate"?!0:e.method!=="GET"?!1:e.headers.get("X-DocsForge-Instant-Nav")==="1"?!0:(e.headers.get("accept")||"").includes("text/html")}self.addEventListener("install",e=>{log("Installing..."),e.waitUntil(self.skipWaiting())}),self.addEventListener("activate",e=>{log("Activating..."),e.waitUntil((async()=>{await readPreferredLocale();const t=await caches.open(CACHE_NAME);try{const a=await self.clients.matchAll({includeUncontrolled:!0,type:"window"}),c=a.find(i=>i.visibilityState==="visible")||a[0];if(c){log("Priming visible page:",c.url);const i=await servePage(new Request(c.url));i&&i.ok?log("Primed visible page:",c.url):log("Failed to prime visible page:",c.url,i.status)}}catch(a){log("Error priming visible page:",a.message)}await self.clients.claim(),log("Clients claimed"),await caches.keys().then(a=>Promise.all(a.filter(c=>c!==CACHE_NAME&&c!==META_CACHE).map(c=>caches.delete(c)))),log("Fetching manifest and syncing all files..."),await refreshManifest()||log("No manifest available after activation")})())}),self.addEventListener("fetch",e=>{const{request:t}=e;if(new URL(t.url).origin===self.location.origin){if(isPageRequest(t)){e.respondWith((async()=>(await getManifest(),servePage(t)))());return}e.respondWith(serveAsset(t))}}); +"use strict";const BUILD_HASH="__DOCSFORGE_BUILD_HASH__",CACHE_NAME=`docsforge-${BUILD_HASH}`,META_CACHE="docsforge-meta",MANIFEST_URL="cache-manifest.json",FILES_KEY="docsforge-manifest-files",ACCESS_KEY="docsforge-access-times",BASE_URL="__DOCSFORGE_BASE_URL__".replace(/\/?$/,"/")||self.location.pathname.replace(/sw\.js$/,""),ORIGIN_BASE=self.location.origin+BASE_URL,I18N_DB_NAME="docsforge-i18n",I18N_DB_STORE="preferences",I18N_LOCALE_KEY="preferred_locale",SYNC_CONCURRENCY=6,DOWNLOAD_COST_BYTES=20*1024*1024,QUOTA_MARGIN_RATIO=.1;let _manifest=null,_manifestRefresh=null,_syncPromise=null,_preferredLocale=null,_evicted=new Set;function log(...e){console.log("[SW]",...e)}function openI18nDB(){return new Promise((e,t)=>{const n=indexedDB.open(I18N_DB_NAME,1);n.onupgradeneeded=a=>{a.target.result.createObjectStore(I18N_DB_STORE)},n.onsuccess=a=>e(a.target.result),n.onerror=a=>t(a)})}async function readPreferredLocale(){try{const n=(await openI18nDB()).transaction(I18N_DB_STORE,"readonly").objectStore(I18N_DB_STORE);_preferredLocale=await new Promise((c,o)=>{const i=n.get(I18N_LOCALE_KEY);i.onsuccess=()=>c(i.result),i.onerror=()=>o(i.error)})||""}catch{_preferredLocale=""}return _preferredLocale}self.addEventListener("message",e=>{if(e.data&&e.data.type==="DOCSFORGE_RELOAD_DETECTED"&&(log("Reload detected by page; refreshing manifest in background"),refreshManifest().catch(()=>{})),e.data&&e.data.type==="DOCSFORGE_SET_LOCALE"){const t=e.data.locale||"";_preferredLocale=t,openI18nDB().then(n=>{const c=n.transaction(I18N_DB_STORE,"readwrite").objectStore(I18N_DB_STORE);t?c.put(t,I18N_LOCALE_KEY):c.delete(I18N_LOCALE_KEY)}).catch(()=>{})}});async function loadManifestFromCache(){if(_manifest)return _manifest;try{const t=await(await caches.open(META_CACHE)).match(MANIFEST_URL);if(t)return _manifest=await t.json(),log("Manifest loaded from meta cache:",_manifest.version),_manifest}catch{}return null}async function refreshManifest(){return _manifestRefresh||(_manifestRefresh=(async()=>{try{log("Fetching manifest...");const e=await fetch(MANIFEST_URL,{cache:"no-cache"});if(e.ok){const t=e.clone(),n=await e.json();await(await caches.open(META_CACHE)).put(MANIFEST_URL,t),_manifest=n,log("Manifest fetched:",n.version),await syncCacheFromManifest(n)}else log("Manifest fetch returned non-ok status:",e.status)}catch(e){log("Manifest refresh failed:",e.message)}return _manifest})().finally(()=>{_manifestRefresh=null}),_manifestRefresh)}async function getManifest(){return await loadManifestFromCache()}async function readPrevFiles(){const t=await(await caches.open(META_CACHE)).match(FILES_KEY);if(!t)return{};try{return await t.json()||{}}catch{return{}}}async function writePrevFiles(e){await(await caches.open(META_CACHE)).put(FILES_KEY,new Response(JSON.stringify(e)))}async function readAccessTimes(){const t=await(await caches.open(META_CACHE)).match(ACCESS_KEY);if(!t)return{};try{return await t.json()||{}}catch{return{}}}async function writeAccessTimes(e){await(await caches.open(META_CACHE)).put(ACCESS_KEY,new Response(JSON.stringify(e)))}async function touchAccessTime(e){try{const t=await readAccessTimes();t[e]=Date.now(),await writeAccessTimes(t)}catch{}}async function runWithConcurrency(e,t){const n=[],a=[];for(const[c,o]of e.entries()){const i=Promise.resolve().then(()=>o());n[c]=i;const l=i.then(()=>{});if(a.push(l),a.length>=t){await Promise.race(a);const f=a.findIndex(s=>s===l);f!==-1&&a.splice(f,1)}}return await Promise.all(a),Promise.all(n)}function keyToUrl(e){return new URL(e,ORIGIN_BASE).href}function urlToKey(e){const t=typeof e=="string"?e:e.href;return t.startsWith(ORIGIN_BASE)?t.slice(ORIGIN_BASE.length)||"./":null}function manifestHasFile(e,t){if(!e||!e.files)return!0;let n=urlToKey(t);return n===null?!0:(n.endsWith("/index.html")&&(n=n.slice(0,-10)||"./"),Object.prototype.hasOwnProperty.call(e.files,n))}async function measuredSize(e,t){try{const n=await e.match(t);if(!n)return 0;const a=parseInt(n.headers.get("content-length"),10);return Number.isFinite(a)&&a>0?a:(await n.clone().arrayBuffer()).byteLength}catch{return 0}}async function storageEstimate(){if(!navigator.storage||!navigator.storage.estimate)return null;try{const e=await navigator.storage.estimate();if(e&&typeof e.usage=="number"&&typeof e.quota=="number"&&e.quota>0)return e}catch{}return null}async function availableBytes(){const e=await storageEstimate();return e?Math.max(0,e.quota-e.usage):null}async function makeSpaceIfNeeded(e=0){const t=await storageEstimate();if(!t)return!1;const n=Math.max(0,t.quota-t.usage);if(e>0&&e>t.quota)return!1;const a=Math.max(e,Math.floor(t.quota*QUOTA_MARGIN_RATIO));if(n>=a)return!0;const c=await caches.open(CACHE_NAME),o=await readAccessTimes(),i=[];for(const s of await c.keys()){const r=urlToKey(s.url);r&&(r===MANIFEST_URL||r==="sw.js"||i.push({url:s.url,time:o[s.url]||0}))}i.sort((s,r)=>s.time-r.time);let l=0;for(const s of i){if(n+l>=a)break;const r=await measuredSize(c,s.url);await c.delete(s.url)&&(delete o[s.url],_evicted.add(s.url),l+=r)}await writeAccessTimes(o);const f=[];for(const s of _evicted){const r=manifestKeyOf(s);r&&f.push(r)}if(f.length>0){const s=await readPrevFiles();let r=!1;for(const u of f)Object.prototype.hasOwnProperty.call(s,u)&&(delete s[u],r=!0);r&&await writePrevFiles(s)}return n+l>=a}function manifestKeyOf(e){let t=urlToKey(e);return t===null||t===MANIFEST_URL||t==="sw.js"?null:(t.endsWith("/index.html")&&(t=t.slice(0,-10)||"./"),t)}async function putWithQuotaHandling(e,t,n){try{return await e.put(t,n.clone()),await touchAccessTime(t.url),!0}catch(a){if(a&&a.name==="QuotaExceededError"){log("Quota exceeded, evicting LRU entries (measured)...");const c=n.headers.get("content-length"),o=c?parseInt(c,10):0;if(await makeSpaceIfNeeded(o))try{return await e.put(t,n.clone()),await touchAccessTime(t.url),!0}catch(l){log("Still failed after eviction:",l.message)}else log("Could not free enough space for",t.url,"(required",o,"bytes)")}else throw a;return!1}}async function deleteOrphans(e,t){const n=await caches.open(CACHE_NAME),a=await n.keys();let c=0;for(const o of a){const i=urlToKey(o.url);i&&(i===MANIFEST_URL||i==="sw.js"||Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)||(await n.delete(o.url),c++)))}c>0&&log("Deleted",c,"orphaned cache entries")}async function syncCacheFromManifest(e){if(e)return _syncPromise||(_syncPromise=(async()=>{const t=await readPrevFiles(),n=e.files||{},a=await caches.open(CACHE_NAME);let c=0,o=await availableBytes();const i=Object.keys(n);log("Syncing",i.length,"files from manifest...");const l=[];for(const s of i){const r=n[s];if(t[s]!==r){if(o!==null){if(o{const r=n[s];try{const u=keyToUrl(s);log("Caching:",s);const h=await fetch(u,{cache:"no-cache"});h&&h.ok&&(await putWithQuotaHandling(a,u,h)?(t[s]=r,c++):log("Not cached (quota):",s))}catch(u){log("Failed to cache:",s,u.message)}};await runWithConcurrency(l.map(s=>()=>f(s)),SYNC_CONCURRENCY);for(const s of _evicted){const r=manifestKeyOf(s);r&&Object.prototype.hasOwnProperty.call(t,r)&&(delete t[r],log("Unmarked evicted file:",r))}_evicted.clear(),await writePrevFiles(t),await deleteOrphans(n,t),log("Sync complete:",c,"files updated"),c>0&&self.clients.matchAll({includeUncontrolled:!0}).then(s=>s.forEach(r=>r.postMessage({type:"DOCSFORGE_UPDATE_READY",count:c}))).catch(()=>{})})().finally(()=>{_syncPromise=null}),_syncPromise)}async function respond404(){const e=await caches.open(CACHE_NAME),t=await readPreferredLocale(),n=[];t&&n.push(BASE_URL+"404."+t+".html"),n.push(BASE_URL+"404.html");for(const a of n){const c=await e.match(a).catch(()=>null);if(c){const o=await c.text();return new Response(o,{status:404,headers:{"Content-Type":"text/html"}})}}return new Response("

404 Not Found

",{status:404,headers:{"Content-Type":"text/html"}})}function buildPageCandidates(e,t){const n=[];return t&&(e.pathname.endsWith("/")?n.push(new URL(e.pathname+"index."+t+".html",e.origin).href):e.pathname.endsWith(".html")?n.push(new URL(e.pathname.slice(0,-5)+"."+t+".html",e.origin).href):n.push(new URL(e.pathname+"."+t+".html",e.origin).href)),n.push(e.href),e.pathname.endsWith("/")&&n.push(new URL(e.pathname+"index.html",e.origin).href),n}async function servePage(e){const t=await caches.open(CACHE_NAME),n=new URL(e.url),a=await readPreferredLocale(),c=await loadManifestFromCache(),o=buildPageCandidates(n,a);for(const i of o){const l=await t.match(i);if(l)return log("Serving page from cache:",i),await touchAccessTime(i),l}if(navigator.onLine===!1)return respond404();for(const i of o){if(!manifestHasFile(c,i)){log("Skipping page candidate not in manifest:",i);continue}log("Fetching page candidate:",i);try{const l=await fetch(i);if(l&&l.ok)return await putWithQuotaHandling(t,i,l),l}catch{}}return log("Page unavailable, returning 404:",e.url),respond404()}async function serveAsset(e){const t=await caches.open(CACHE_NAME),n=await t.match(e);if(n)return await touchAccessTime(e.url),n;try{const a=await fetch(e);if(a&&a.ok)return await putWithQuotaHandling(t,e,a),a}catch{}return new Response("Not found",{status:404})}function isPageRequest(e){return e.destination==="document"||e.mode==="navigate"?!0:e.method!=="GET"?!1:e.headers.get("X-DocsForge-Instant-Nav")==="1"?!0:(e.headers.get("accept")||"").includes("text/html")}self.addEventListener("install",e=>{log("Installing..."),e.waitUntil(self.skipWaiting())}),self.addEventListener("activate",e=>{log("Activating..."),e.waitUntil((async()=>{await readPreferredLocale();const t=await caches.open(CACHE_NAME);try{const a=await self.clients.matchAll({includeUncontrolled:!0,type:"window"}),c=a.find(o=>o.visibilityState==="visible")||a[0];if(c){log("Priming visible page:",c.url);const o=await servePage(new Request(c.url));o&&o.ok?log("Primed visible page:",c.url):log("Failed to prime visible page:",c.url,o.status)}}catch(a){log("Error priming visible page:",a.message)}await self.clients.claim(),log("Clients claimed"),await caches.keys().then(a=>Promise.all(a.filter(c=>c!==CACHE_NAME&&c!==META_CACHE).map(c=>caches.delete(c)))),log("Fetching manifest and syncing all files..."),await refreshManifest()||log("No manifest available after activation")})())}),self.addEventListener("fetch",e=>{const{request:t}=e;if(new URL(t.url).origin===self.location.origin){if(isPageRequest(t)){e.respondWith((async()=>(await getManifest(),servePage(t)))());return}e.respondWith(serveAsset(t))}}); diff --git a/src/assets/javascripts/sw.js b/src/assets/javascripts/sw.js index 2f1423cb4..cda86244e 100644 --- a/src/assets/javascripts/sw.js +++ b/src/assets/javascripts/sw.js @@ -30,7 +30,12 @@ const I18N_DB_STORE = 'preferences'; const I18N_LOCALE_KEY = 'preferred_locale'; const SYNC_CONCURRENCY = 6; -const QUOTA_MARGIN_BYTES = 20 * 1024 * 1024; +// Conservative per-download cost when budgeting the manifest sync against +// free space: each changed file reserved at a flat 20 MiB regardless of its +// real size, because the browser's quota-usage estimate lags behind in-flight +// writes. The sync stops downloading once the budget is exhausted instead of +// fetching files that will only be evicted again. +const DOWNLOAD_COST_BYTES = 20 * 1024 * 1024; const QUOTA_MARGIN_RATIO = 0.1; // In-memory manifest + dedupe promises. @@ -38,6 +43,10 @@ let _manifest = null; let _manifestRefresh = null; let _syncPromise = null; let _preferredLocale = null; +// URLs evicted by makeSpaceIfNeeded() since the last reconciliation. The +// manifest sync removes them from the persisted previous-files list before +// writing, so evicted files are never falsely recorded as cached. +let _evicted = new Set(); function log(...args) { console.log('[SW]', ...args); @@ -227,16 +236,52 @@ function manifestHasFile(manifest, url) { return Object.prototype.hasOwnProperty.call(manifest.files, key); } -async function makeSpaceIfNeeded(requiredBytes = 0) { - if (!navigator.storage || !navigator.storage.estimate) return; - let estimate; +// Actual byte size of a cached entry. Content-Length is exact for network +// responses (the stored body is exactly what the server sent); synthesized +// responses (404 pages, etc.) have no header, so measure the body directly. +async function measuredSize(cache, url) { try { - estimate = await navigator.storage.estimate(); - } catch (e) { return; } - if (!estimate || typeof estimate.usage !== 'number' || typeof estimate.quota !== 'number') return; - const available = estimate.quota - estimate.usage; - const targetFree = Math.max(requiredBytes + QUOTA_MARGIN_BYTES, Math.floor(estimate.quota * QUOTA_MARGIN_RATIO)); - if (available >= targetFree) return; + const resp = await cache.match(url); + if (!resp) return 0; + const header = parseInt(resp.headers.get('content-length'), 10); + if (Number.isFinite(header) && header > 0) return header; + const body = await resp.clone().arrayBuffer(); + return body.byteLength; + } catch (e) { + return 0; + } +} + +// Storage estimate (usage + quota), or null when unavailable/unusable (the +// caller then relies on reactive quota handling). +async function storageEstimate() { + if (!navigator.storage || !navigator.storage.estimate) return null; + try { + const est = await navigator.storage.estimate(); + if (est && typeof est.usage === 'number' && typeof est.quota === 'number' && est.quota > 0) return est; + } catch (e) { /* ignore */ } + return null; +} + +// Free space per storage.estimate(), or null when unavailable. +async function availableBytes() { + const est = await storageEstimate(); + return est ? Math.max(0, est.quota - est.usage) : null; +} + +// Evict least-recently-used entries until `available + freed` covers +// requiredBytes, accounting each entry at its ACTUAL byte size (no guesses). +// Evicted entries are removed from the persisted previous-files list so a +// later manifest sync re-fetches them; returns true when enough space was +// freed for the caller to retry its cache.put(). +async function makeSpaceIfNeeded(requiredBytes = 0) { + const est = await storageEstimate(); + if (!est) return false; + const available = Math.max(0, est.quota - est.usage); + // A single resource larger than the whole quota can never be cached. + if (requiredBytes > 0 && requiredBytes > est.quota) return false; + const targetFree = Math.max(requiredBytes, Math.floor(est.quota * QUOTA_MARGIN_RATIO)); + if (available >= targetFree) return true; const cache = await caches.open(CACHE_NAME); const times = await readAccessTimes(); @@ -246,41 +291,81 @@ async function makeSpaceIfNeeded(requiredBytes = 0) { if (!key) continue; // Never evict the manifest itself or sw.js. if (key === MANIFEST_URL || key === 'sw.js') continue; - entries.push({ url: req.url, key, time: times[req.url] || 0 }); + entries.push({ url: req.url, time: times[req.url] || 0 }); } entries.sort((a, b) => a.time - b.time); let freed = 0; for (const entry of entries) { if (available + freed >= targetFree) break; + const size = await measuredSize(cache, entry.url); const deleted = await cache.delete(entry.url); if (deleted) { delete times[entry.url]; - // We don't know the real byte size; assume a modest chunk and keep evicting. - freed += 5 * 1024 * 1024; + _evicted.add(entry.url); + freed += size; } } await writeAccessTimes(times); + + // Drop evicted entries from the persisted previous-files list so the next + // manifest sync re-fetches them instead of believing they are cached. + const evictedKeys = []; + for (const url of _evicted) { + const key = manifestKeyOf(url); + if (key) evictedKeys.push(key); + } + if (evictedKeys.length > 0) { + const prev = await readPrevFiles(); + let changed = false; + for (const key of evictedKeys) { + if (Object.prototype.hasOwnProperty.call(prev, key)) { + delete prev[key]; + changed = true; + } + } + if (changed) await writePrevFiles(prev); + } + return available + freed >= targetFree; +} + +// Normalize a URL to its manifest key form ('./', 'second/', ...), matching +// how the build emits directory-index pages. Returns null for URLs outside +// the site or for the manifest/sw.js files themselves. +function manifestKeyOf(url) { + let key = urlToKey(url); + if (key === null) return null; + if (key === MANIFEST_URL || key === 'sw.js') return null; + if (key.endsWith('/index.html')) key = key.slice(0, -'index.html'.length) || './'; + return key; } async function putWithQuotaHandling(cache, request, response) { try { await cache.put(request, response.clone()); await touchAccessTime(request.url); + return true; } catch (e) { if (e && (e.name === 'QuotaExceededError')) { - log('Quota exceeded, evicting LRU entries...'); + log('Quota exceeded, evicting LRU entries (measured)...'); const sizeHint = response.headers.get('content-length'); - await makeSpaceIfNeeded(sizeHint ? parseInt(sizeHint, 10) : 0); - try { - await cache.put(request, response.clone()); - await touchAccessTime(request.url); - } catch (e2) { - log('Still failed after eviction:', e2.message); + const required = sizeHint ? parseInt(sizeHint, 10) : 0; + const freedEnough = await makeSpaceIfNeeded(required); + if (freedEnough) { + try { + await cache.put(request, response.clone()); + await touchAccessTime(request.url); + return true; + } catch (e2) { + log('Still failed after eviction:', e2.message); + } + } else { + log('Could not free enough space for', request.url, '(required', required, 'bytes)'); } } else { throw e; } + return false; } } @@ -313,28 +398,64 @@ async function syncCacheFromManifest(manifest) { const cache = await caches.open(CACHE_NAME); let updated = 0; + // Budget the sync against the free space available NOW: every download + // costs a flat DOWNLOAD_COST_BYTES (the estimate lags behind in-flight + // writes), and the sync stops once the budget is exhausted instead of + // fetching files that would only be evicted again. Files skipped here are + // cached on demand when actually visited. A null budget (no usable + // estimate) falls back to reactive quota handling. + let budget = await availableBytes(); const entries = Object.keys(newFiles); log('Syncing', entries.length, 'files from manifest...'); - const tasks = entries.map(key => async () => { + const tasks = []; + for (const key of entries) { const newHash = newFiles[key]; - if (prevFiles[key] === newHash) return; + if (prevFiles[key] === newHash) continue; + if (budget !== null) { + if (budget < DOWNLOAD_COST_BYTES) { + log('Quota budget exhausted, stopping sync at', key); + break; + } + budget -= DOWNLOAD_COST_BYTES; + } + tasks.push(key); + } + log('Syncing', tasks.length, 'changed files within quota budget...'); + const runTask = async (key) => { + const newHash = newFiles[key]; try { const fullUrl = keyToUrl(key); log('Caching:', key); const resp = await fetch(fullUrl, { cache: 'no-cache' }); if (resp && resp.ok) { - await putWithQuotaHandling(cache, fullUrl, resp); - prevFiles[key] = newHash; - updated++; + const ok = await putWithQuotaHandling(cache, fullUrl, resp); + if (ok) { + prevFiles[key] = newHash; + updated++; + } else { + log('Not cached (quota):', key); + } } } catch (e) { log('Failed to cache:', key, e.message); } - }); + }; + + await runWithConcurrency(tasks.map(k => () => runTask(k)), SYNC_CONCURRENCY); - await runWithConcurrency(tasks, SYNC_CONCURRENCY); + // Never record evicted files as cached: drop every URL evicted during + // this sync (or while it was running) from the previous-files list so the + // next sync re-fetches what actually got evicted. + for (const url of _evicted) { + const key = manifestKeyOf(url); + if (key && Object.prototype.hasOwnProperty.call(prevFiles, key)) { + delete prevFiles[key]; + log('Unmarked evicted file:', key); + } + } + _evicted.clear(); await writePrevFiles(prevFiles); await deleteOrphans(newFiles, prevFiles); log('Sync complete:', updated, 'files updated'); diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index 86b468b02..682130300 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -56,8 +56,13 @@ def has_browser() -> bool: return _HAS_BROWSER -def _build_fixture(tmp_path: Path, site_name: str = "E2E", with_nav: bool = True, language: str | None = None) -> tuple[Path, Path]: - """Build a small docsforge site and return (root, site_dir).""" +def _build_fixture(tmp_path: Path, site_name: str = "E2E", with_nav: bool = True, language: str | None = None, quota_assets: int = 0) -> tuple[Path, Path]: + """Build a small docsforge site and return (root, site_dir). + + quota_assets: number of 2 MiB static binaries to drop into docs/assets + (used by the quota/eviction tests to force the SW against the browser's + storage limit). + """ from docsforge.config_base import load_config from docsforge.build import build @@ -68,6 +73,10 @@ def _build_fixture(tmp_path: Path, site_name: str = "E2E", with_nav: bool = True (docs / "second.md").write_text("# Second\n\nAnother page with searchable content.\n\nUniqueTokenSecond\n") (docs / "guide").mkdir() (docs / "guide" / "intro.md").write_text("# Introduction\n\nIntro material.\n") + if quota_assets: + (docs / "assets").mkdir() + for i in range(quota_assets): + (docs / "assets" / f"big{i + 1}.bin").write_bytes(b"x" * (2 * 1024 * 1024)) nav_block = ( "nav:\n - Home: index.md\n - Second: second.md\n - Guide:\n - guide/intro.md\n" if with_nav else "" @@ -133,6 +142,21 @@ def served_site_i18n(tmp_path_factory): httpd.shutdown() +@pytest.fixture(scope="module") +def served_site_quota(tmp_path_factory): + """A fixture site with 2x 2 MiB static binaries for quota/eviction tests.""" + if not has_browser(): + pytest.skip("Playwright/Chromium unavailable — E2E tests skipped") + _, site_dir = _build_fixture(tmp_path_factory.mktemp("e2e-quota"), quota_assets=2) + httpd = socketserver.ThreadingTCPServer(("127.0.0.1", 0), lambda *a: _Handler(*a, directory=str(site_dir))) + httpd.daemon_threads = True + port = httpd.server_address[1] + t = threading.Thread(target=httpd.serve_forever, daemon=True) + t.start() + yield f"http://127.0.0.1:{port}/" + httpd.shutdown() + + @pytest.fixture def context_page(served_site): """A fresh Playwright context/page (isolated SW state per test).""" diff --git a/tests/e2e/test_browser.py b/tests/e2e/test_browser.py index 05ba5d7ce..b971aaaf6 100644 --- a/tests/e2e/test_browser.py +++ b/tests/e2e/test_browser.py @@ -134,6 +134,166 @@ def test_dev_server_matches_deployed(served_dev): p.stop() +# --- Quota / eviction tests ------------------------------------------------- +# +# These run Chromium with a tiny per-origin quota (--quota-override-size-mb) +# so the SW's quota handling actually fires. The service worker budgets the +# manifest sync at a flat 20 MiB per download, so with a 25 MiB quota exactly +# one file gets synced; and on-demand caching of a 2 MiB binary evicts the +# LRU entries with measured byte accounting. Tests skip when the override is +# not honoured (quota still huge), keeping the suite green on Chromium builds +# without the flag. + +_QUOTA_OVERRIDE_FLOOR = 100 * 1024 * 1024 + + +def _launch_quota(quota_mb: int): + from playwright.sync_api import sync_playwright + from _browser import launch_opts + + opts = launch_opts() + opts["args"] = [f"--quota-override-size-mb={quota_mb}"] + p = sync_playwright().start() + return p, p.chromium.launch(**opts) + + +def _quota_override_applied(page, quota_mb: int) -> bool: + """True when the quota override took effect (estimate reports ~quota_mb).""" + return page.evaluate( + "async (mb) => (await navigator.storage.estimate()).quota <= mb * 1024 * 1024", + quota_mb, + ) + + +def _content_cache_name(page): + """Name of the SW content cache (docsforge-), not the meta cache.""" + return page.evaluate( + """async () => { + const names = await caches.keys(); + return names.find(n => n.startsWith('docsforge-') && n !== 'docsforge-meta'); + }""" + ) + + +def _cached_urls(page, cache_name: str): + return page.evaluate( + "async (name) => (await (await caches.open(name)).keys()).map(r => r.url)", + cache_name, + ) + + +def _tracked_files(page): + """The SW's persisted previous-files list (docsforge-manifest-files).""" + return page.evaluate( + """async () => { + const cache = await caches.open('docsforge-meta'); + const resp = await cache.match('docsforge-manifest-files'); + return resp ? await resp.json() : {}; + }""" + ) + + +def test_manifest_sync_budget_stops_when_quota_small(served_site_quota): + """With a 25 MiB quota the flat 20 MiB-per-download budget must stop the + manifest sync after one file, and every tracked file must really be in + the cache (no 'marked cached but evicted' lies).""" + base_url = served_site_quota + p, browser = _launch_quota(25) + context = browser.new_context() + page = context.new_page() + try: + page.goto(base_url, wait_until="networkidle") + _sw_ready(page) + if not _quota_override_applied(page, 25): + pytest.skip("quota override not honoured by this Chromium") + page.wait_for_function( + """async () => { + const cache = await caches.open('docsforge-meta'); + const resp = await cache.match('docsforge-manifest-files'); + if (!resp) return false; + const files = await resp.json(); + return Object.keys(files).length === 1; + }""", + timeout=15000, + ) + tracked = _tracked_files(page) + assert len(tracked) == 1, f"expected exactly 1 tracked file, got {list(tracked)}" + cache_name = _content_cache_name(page) + cached = set(_cached_urls(page, cache_name)) + for key in tracked: + expected = base_url + ("" if key == "./" else key) + assert expected.rstrip("/") in {u.rstrip("/") for u in cached}, ( + f"tracked file {key!r} is not actually cached" + ) + # The site ships many more files than the budget allowed to download. + manifest = page.evaluate( + "async () => (await (await caches.open('docsforge-meta')).match('cache-manifest.json')).json()" + ) + assert len(manifest["files"]) > 1, "fixture site is too small for this test" + usage = page.evaluate("async () => (await navigator.storage.estimate()).usage") + assert usage <= 25 * 1024 * 1024 + finally: + context.close() + browser.close() + p.stop() + + +def test_eviction_uses_measured_sizes(served_site_quota): + """On-demand caching of a 2 MiB binary under a 3 MiB quota must evict the + LRU entries (with real byte accounting), keep the cache within quota, and + never leave a tracked file that is missing from the cache.""" + base_url = served_site_quota + p, browser = _launch_quota(3) + context = browser.new_context() + page = context.new_page() + try: + page.goto(base_url, wait_until="networkidle") + _sw_ready(page) + if not _quota_override_applied(page, 3): + pytest.skip("quota override not honoured by this Chromium") + + # Fetch both 2 MiB binaries through the SW. The first fits; the second + # exceeds the remaining space, forcing measured LRU eviction. + for asset in ("assets/big1.bin", "assets/big2.bin"): + page.evaluate( + "async (a) => { const r = await fetch(a); if (!r.ok) throw new Error(r.status); await r.arrayBuffer(); }", + asset, + ) + page.wait_for_function( + """async (url) => { + const names = await caches.keys(); + const name = names.find(n => n.startsWith('docsforge-') && n !== 'docsforge-meta'); + const cache = await caches.open(name); + return !!(await cache.match(url)); + }""", + base_url + "assets/big2.bin", + timeout=15000, + ) + + cache_name = _content_cache_name(page) + cached = {u.rstrip("/") for u in _cached_urls(page, cache_name)} + assert base_url.rstrip("/") + "/assets/big2.bin" in cached, "big2.bin must be cached" + assert base_url.rstrip("/") + "/assets/big1.bin" not in cached, ( + "big1.bin must have been evicted to make room for big2.bin" + ) + assert base_url.rstrip("/") not in cached, "home page must have been evicted first (LRU)" + + # Every tracked file must still be present in the content cache. + tracked = _tracked_files(page) + for key in tracked: + expected = base_url + ("" if key == "./" else key) + assert expected.rstrip("/") in cached, ( + f"tracked file {key!r} was evicted but still recorded as cached" + ) + + usage = page.evaluate("async () => (await navigator.storage.estimate()).usage") + assert usage <= 3 * 1024 * 1024, f"cache usage {usage} exceeds the 3 MiB quota" + finally: + context.close() + browser.close() + p.stop() + + def test_i18n_translates_ui(served_site_i18n): """A site built with theme.language='fr' must render and translated UI strings (not the English defaults).""" diff --git a/tests/integration/test_build_e2e.py b/tests/integration/test_build_e2e.py index ab7cd6fd1..99de788c2 100644 --- a/tests/integration/test_build_e2e.py +++ b/tests/integration/test_build_e2e.py @@ -84,6 +84,17 @@ def test_generates_cache_manifest(self, tmp_project, monkeypatch): "cache-manifest.json must not be in cache manifest" ) + # Sizes map: exact byte count of every built file, matching disk. + sizes = cm["sizes"] + assert set(sizes.keys()) == set(files.keys()), ( + "sizes must cover exactly the manifest files" + ) + for key, size in sizes.items(): + assert isinstance(size, int) and size > 0 + assert sizes["404.html"] == (tmp_project / "site" / "404.html").stat().st_size, ( + "size must be the exact built-file byte count" + ) + def test_second_build_is_incremental(self, tmp_project, monkeypatch): """The second build must not rewrite an unchanged page's output.""" _build_once(monkeypatch, tmp_project) diff --git a/tests/regression/test_regressions.py b/tests/regression/test_regressions.py index fb6718e06..37dc77a0a 100644 --- a/tests/regression/test_regressions.py +++ b/tests/regression/test_regressions.py @@ -171,6 +171,40 @@ def test_regression_manifest_key_is_files_not_Files(tmp_path: Path, monkeypatch) assert "Files" not in data +def test_regression_manifest_sizes_match_built_files(tmp_path: Path, monkeypatch): + """_generate_cache_manifest must ship a `sizes` map with the exact byte + size of every built file (the SW evicts by measured size, no guessing).""" + import json + + import docsforge.build as build_mod + + monkeypatch.chdir(tmp_path) + (tmp_path / "site").mkdir() + src = tmp_path / "docs" / "p.md" + src.parent.mkdir() + src.write_text("# P") + out = tmp_path / "site" / "p" / "index.html" + out.parent.mkdir() + out.write_text("" + ("x" * 4096) + "") + + from docsforge.files import Files + + files = Files([]) + build_mod._generate_cache_manifest(str(tmp_path / "site"), ["p/"], files) + data = json.loads((tmp_path / "site" / "cache-manifest.json").read_text()) + + assert "sizes" in data, "cache manifest must carry a sizes map" + assert set(data["sizes"].keys()) == set(data["files"].keys()), ( + "every manifest file must have a size" + ) + for key, size in data["sizes"].items(): + built = tmp_path / "site" / (key.replace("./", "").rstrip("/") + "/index.html" if key.endswith("/") else key) + assert built.is_file(), f"size key {key!r} must resolve to a built file" + assert size == built.stat().st_size, ( + f"size for {key!r} must be the exact built-file byte count" + ) + + # --------------------------------------------------------------------------- # v11.1.5 (found while writing tests) — find_orphaned_outputs vs dir URLs # --------------------------------------------------------------------------- From 5cfc9d7b7fec7ba7a29751654fec4d16622c3a69 Mon Sep 17 00:00:00 2001 From: Kimi Code Date: Wed, 19 Aug 2026 21:13:22 +0800 Subject: [PATCH 2/2] chore(frontend): revert bundle.min.js regeneration (local esbuild env mismatch) --- docsforge/templates/assets/javascripts/bundle.min.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docsforge/templates/assets/javascripts/bundle.min.js b/docsforge/templates/assets/javascripts/bundle.min.js index eb8483dfc..aa6fefa1f 100644 --- a/docsforge/templates/assets/javascripts/bundle.min.js +++ b/docsforge/templates/assets/javascripts/bundle.min.js @@ -1,6 +1,6 @@ -"use strict";(()=>{var qi=Object.create;var po=Object.defineProperty;var Ki=Object.getOwnPropertyDescriptor;var Qi=Object.getOwnPropertyNames;var Yi=Object.getPrototypeOf,Bi=Object.prototype.hasOwnProperty;var Lr=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Gi=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Qi(t))!Bi.call(e,n)&&n!==r&&po(e,n,{get:()=>t[n],enumerable:!(o=Ki(t,n))||o.enumerable});return e};var Ht=(e,t,r)=>(r=e!=null?qi(Yi(e)):{},Gi(t||!e||!e.__esModule?po(r,"default",{value:e,enumerable:!0}):r,e));var fo=Lr((Mr,mo)=>{(function(e,t){typeof Mr=="object"&&typeof mo<"u"?t():typeof define=="function"&&define.amd?define(t):t()})(Mr,(function(){"use strict";function e(r){var o=!0,n=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(k){return!!(k&&k!==document&&k.nodeName!=="HTML"&&k.nodeName!=="BODY"&&"classList"in k&&"contains"in k.classList)}function c(k){var ft=k.type,Fe=k.tagName;return!!(Fe==="INPUT"&&a[ft]&&!k.readOnly||Fe==="TEXTAREA"&&!k.readOnly||k.isContentEditable)}function l(k){k.classList.contains("focus-visible")||(k.classList.add("focus-visible"),k.setAttribute("data-focus-visible-added",""))}function p(k){k.hasAttribute("data-focus-visible-added")&&(k.classList.remove("focus-visible"),k.removeAttribute("data-focus-visible-added"))}function f(k){k.metaKey||k.altKey||k.ctrlKey||(s(r.activeElement)&&l(r.activeElement),o=!0)}function u(k){o=!1}function d(k){s(k.target)&&(o||c(k.target))&&l(k.target)}function v(k){s(k.target)&&(k.target.classList.contains("focus-visible")||k.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(i),i=window.setTimeout(function(){n=!1},100),p(k.target))}function O(k){document.visibilityState==="hidden"&&(n&&(o=!0),J())}function J(){document.addEventListener("mousemove",Z),document.addEventListener("mousedown",Z),document.addEventListener("mouseup",Z),document.addEventListener("pointermove",Z),document.addEventListener("pointerdown",Z),document.addEventListener("pointerup",Z),document.addEventListener("touchmove",Z),document.addEventListener("touchstart",Z),document.addEventListener("touchend",Z)}function te(){document.removeEventListener("mousemove",Z),document.removeEventListener("mousedown",Z),document.removeEventListener("mouseup",Z),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerdown",Z),document.removeEventListener("pointerup",Z),document.removeEventListener("touchmove",Z),document.removeEventListener("touchstart",Z),document.removeEventListener("touchend",Z)}function Z(k){k.target.nodeName&&k.target.nodeName.toLowerCase()==="html"||(o=!1,te())}document.addEventListener("keydown",f,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",O,!0),J(),r.addEventListener("focus",d,!0),r.addEventListener("blur",v,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window<"u"&&typeof document<"u"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch{t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document<"u"&&e(document)}))});var Xr=Lr((Cy,_n)=>{"use strict";var ja=/["'&<>]/;_n.exports=Ua;function Ua(e){var t=""+e,r=ja.exec(t);if(!r)return t;var o,n="",i=0,a=0;for(i=r.index;i{(function(t,r){typeof Vt=="object"&&typeof to=="object"?to.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Vt=="object"?Vt.ClipboardJS=r():t.ClipboardJS=r()})(Vt,function(){return(function(){var e={686:(function(o,n,i){"use strict";i.d(n,{default:function(){return zi}});var a=i(279),s=i.n(a),c=i(370),l=i.n(c),p=i(817),f=i.n(p);function u(z){try{return document.execCommand(z)}catch{return!1}}var d=function(C){var _=f()(C);return u("cut"),_},v=d;function O(z){var C=document.documentElement.getAttribute("dir")==="rtl",_=document.createElement("textarea");_.style.fontSize="12pt",_.style.border="0",_.style.padding="0",_.style.margin="0",_.style.position="absolute",_.style[C?"right":"left"]="-9999px";var W=window.pageYOffset||document.documentElement.scrollTop;return _.style.top="".concat(W,"px"),_.setAttribute("readonly",""),_.value=z,_}var J=function(C,_){var W=O(C);_.container.appendChild(W);var V=f()(W);return u("copy"),W.remove(),V},te=function(C){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},W="";return typeof C=="string"?W=J(C,_):C instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(C?.type)?W=J(C.value,_):(W=f()(C),u("copy")),W},Z=te;function k(z){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?k=function(_){return typeof _}:k=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},k(z)}var ft=function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_=C.action,W=_===void 0?"copy":_,V=C.container,B=C.target,je=C.text;if(W!=="copy"&&W!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(B!==void 0)if(B&&k(B)==="object"&&B.nodeType===1){if(W==="copy"&&B.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(W==="cut"&&(B.hasAttribute("readonly")||B.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(je)return Z(je,{container:V});if(B)return W==="cut"?v(B):Z(B,{container:V})},Fe=ft;function P(z){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?P=function(_){return typeof _}:P=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},P(z)}function ae(z,C){if(!(z instanceof C))throw new TypeError("Cannot call a class as a function")}function se(z,C){for(var _=0;_"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Qt(z){return Qt=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},Qt(z)}function Or(z,C){var _="data-clipboard-".concat(z);if(C.hasAttribute(_))return C.getAttribute(_)}var Ni=(function(z){Le(_,z);var C=Ui(_);function _(W,V){var B;return ae(this,_),B=C.call(this),B.resolveOptions(V),B.listenClick(W),B}return de(_,[{key:"resolveOptions",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof V.action=="function"?V.action:this.defaultAction,this.target=typeof V.target=="function"?V.target:this.defaultTarget,this.text=typeof V.text=="function"?V.text:this.defaultText,this.container=P(V.container)==="object"?V.container:document.body}},{key:"listenClick",value:function(V){var B=this;this.listener=l()(V,"click",function(je){return B.onClick(je)})}},{key:"onClick",value:function(V){var B=V.delegateTarget||V.currentTarget,je=this.action(B)||"copy",Yt=Fe({action:je,container:this.container,target:this.target(B),text:this.text(B)});this.emit(Yt?"success":"error",{action:je,text:Yt,trigger:B,clearSelection:function(){B&&B.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(V){return Or("action",V)}},{key:"defaultTarget",value:function(V){var B=Or("target",V);if(B)return document.querySelector(B)}},{key:"defaultText",value:function(V){return Or("text",V)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(V){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return Z(V,B)}},{key:"cut",value:function(V){return v(V)}},{key:"isSupported",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],B=typeof V=="string"?[V]:V,je=!!document.queryCommandSupported;return B.forEach(function(Yt){je=je&&!!document.queryCommandSupported(Yt)}),je}}]),_})(s()),zi=Ni}),828:(function(o){var n=9;if(typeof Element<"u"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,c){for(;s&&s.nodeType!==n;){if(typeof s.matches=="function"&&s.matches(c))return s;s=s.parentNode}}o.exports=a}),438:(function(o,n,i){var a=i(828);function s(p,f,u,d,v){var O=l.apply(this,arguments);return p.addEventListener(u,O,v),{destroy:function(){p.removeEventListener(u,O,v)}}}function c(p,f,u,d,v){return typeof p.addEventListener=="function"?s.apply(null,arguments):typeof u=="function"?s.bind(null,document).apply(null,arguments):(typeof p=="string"&&(p=document.querySelectorAll(p)),Array.prototype.map.call(p,function(O){return s(O,f,u,d,v)}))}function l(p,f,u,d){return function(v){v.delegateTarget=a(v.target,f),v.delegateTarget&&d.call(p,v)}}o.exports=c}),879:(function(o,n){n.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},n.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||n.node(i[0]))},n.string=function(i){return typeof i=="string"||i instanceof String},n.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}}),370:(function(o,n,i){var a=i(879),s=i(438);function c(u,d,v){if(!u&&!d&&!v)throw new Error("Missing required arguments");if(!a.string(d))throw new TypeError("Second argument must be a String");if(!a.fn(v))throw new TypeError("Third argument must be a Function");if(a.node(u))return l(u,d,v);if(a.nodeList(u))return p(u,d,v);if(a.string(u))return f(u,d,v);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function l(u,d,v){return u.addEventListener(d,v),{destroy:function(){u.removeEventListener(d,v)}}}function p(u,d,v){return Array.prototype.forEach.call(u,function(O){O.addEventListener(d,v)}),{destroy:function(){Array.prototype.forEach.call(u,function(O){O.removeEventListener(d,v)})}}}function f(u,d,v){return s(document.body,u,d,v)}o.exports=c}),817:(function(o){function n(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var c=window.getSelection(),l=document.createRange();l.selectNodeContents(i),c.removeAllRanges(),c.addRange(l),a=c.toString()}return a}o.exports=n}),279:(function(o){function n(){}n.prototype={on:function(i,a,s){var c=this.e||(this.e={});return(c[i]||(c[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var c=this;function l(){c.off(i,l),a.apply(s,arguments)}return l._=a,this.on(i,l,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),c=0,l=s.length;for(c;c0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function q(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),n,i=[],a;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(s){a={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i}function Y(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,i;o1||c(d,O)})},v&&(n[d]=v(n[d])))}function c(d,v){try{l(o[d](v))}catch(O){u(i[0][3],O)}}function l(d){d.value instanceof ut?Promise.resolve(d.value.v).then(p,f):u(i[0][2],d)}function p(d){c("next",d)}function f(d){c("throw",d)}function u(d,v){d(v),i.shift(),i.length&&c(i[0][0],i[0][1])}}function bo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Se=="function"?Se(e):e[Symbol.iterator](),r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r);function o(i){r[i]=e[i]&&function(a){return new Promise(function(s,c){a=e[i](a),n(s,c,a.done,a.value)})}}function n(i,a,s,c){Promise.resolve(c).then(function(l){i({value:l,done:s})},a)}}function R(e){return typeof e=="function"}function gt(e){var t=function(o){Error.call(o),o.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Gt=gt(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: +"use strict";(()=>{var Ki=Object.create;var po=Object.defineProperty;var Qi=Object.getOwnPropertyDescriptor;var Yi=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,Gi=Object.prototype.hasOwnProperty;var Mr=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Ji=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Yi(t))!Gi.call(e,n)&&n!==r&&po(e,n,{get:()=>t[n],enumerable:!(o=Qi(t,n))||o.enumerable});return e};var Ht=(e,t,r)=>(r=e!=null?Ki(Bi(e)):{},Ji(t||!e||!e.__esModule?po(r,"default",{value:e,enumerable:!0}):r,e));var fo=Mr((_r,mo)=>{(function(e,t){typeof _r=="object"&&typeof mo<"u"?t():typeof define=="function"&&define.amd?define(t):t()})(_r,(function(){"use strict";function e(r){var o=!0,n=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(k){return!!(k&&k!==document&&k.nodeName!=="HTML"&&k.nodeName!=="BODY"&&"classList"in k&&"contains"in k.classList)}function c(k){var ft=k.type,Fe=k.tagName;return!!(Fe==="INPUT"&&a[ft]&&!k.readOnly||Fe==="TEXTAREA"&&!k.readOnly||k.isContentEditable)}function l(k){k.classList.contains("focus-visible")||(k.classList.add("focus-visible"),k.setAttribute("data-focus-visible-added",""))}function p(k){k.hasAttribute("data-focus-visible-added")&&(k.classList.remove("focus-visible"),k.removeAttribute("data-focus-visible-added"))}function f(k){k.metaKey||k.altKey||k.ctrlKey||(s(r.activeElement)&&l(r.activeElement),o=!0)}function u(k){o=!1}function d(k){s(k.target)&&(o||c(k.target))&&l(k.target)}function v(k){s(k.target)&&(k.target.classList.contains("focus-visible")||k.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(i),i=window.setTimeout(function(){n=!1},100),p(k.target))}function O(k){document.visibilityState==="hidden"&&(n&&(o=!0),J())}function J(){document.addEventListener("mousemove",Z),document.addEventListener("mousedown",Z),document.addEventListener("mouseup",Z),document.addEventListener("pointermove",Z),document.addEventListener("pointerdown",Z),document.addEventListener("pointerup",Z),document.addEventListener("touchmove",Z),document.addEventListener("touchstart",Z),document.addEventListener("touchend",Z)}function te(){document.removeEventListener("mousemove",Z),document.removeEventListener("mousedown",Z),document.removeEventListener("mouseup",Z),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerdown",Z),document.removeEventListener("pointerup",Z),document.removeEventListener("touchmove",Z),document.removeEventListener("touchstart",Z),document.removeEventListener("touchend",Z)}function Z(k){k.target.nodeName&&k.target.nodeName.toLowerCase()==="html"||(o=!1,te())}document.addEventListener("keydown",f,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",O,!0),J(),r.addEventListener("focus",d,!0),r.addEventListener("blur",v,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window<"u"&&typeof document<"u"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch{t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document<"u"&&e(document)}))});var Zr=Mr((Cy,_n)=>{"use strict";var Ua=/["'&<>]/;_n.exports=Wa;function Wa(e){var t=""+e,r=Ua.exec(t);if(!r)return t;var o,n="",i=0,a=0;for(i=r.index;i{(function(t,r){typeof Vt=="object"&&typeof ro=="object"?ro.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Vt=="object"?Vt.ClipboardJS=r():t.ClipboardJS=r()})(Vt,function(){return(function(){var e={686:(function(o,n,i){"use strict";i.d(n,{default:function(){return qi}});var a=i(279),s=i.n(a),c=i(370),l=i.n(c),p=i(817),f=i.n(p);function u(z){try{return document.execCommand(z)}catch{return!1}}var d=function(C){var _=f()(C);return u("cut"),_},v=d;function O(z){var C=document.documentElement.getAttribute("dir")==="rtl",_=document.createElement("textarea");_.style.fontSize="12pt",_.style.border="0",_.style.padding="0",_.style.margin="0",_.style.position="absolute",_.style[C?"right":"left"]="-9999px";var W=window.pageYOffset||document.documentElement.scrollTop;return _.style.top="".concat(W,"px"),_.setAttribute("readonly",""),_.value=z,_}var J=function(C,_){var W=O(C);_.container.appendChild(W);var V=f()(W);return u("copy"),W.remove(),V},te=function(C){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},W="";return typeof C=="string"?W=J(C,_):C instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(C?.type)?W=J(C.value,_):(W=f()(C),u("copy")),W},Z=te;function k(z){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?k=function(_){return typeof _}:k=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},k(z)}var ft=function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_=C.action,W=_===void 0?"copy":_,V=C.container,B=C.target,je=C.text;if(W!=="copy"&&W!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(B!==void 0)if(B&&k(B)==="object"&&B.nodeType===1){if(W==="copy"&&B.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(W==="cut"&&(B.hasAttribute("readonly")||B.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(je)return Z(je,{container:V});if(B)return W==="cut"?v(B):Z(B,{container:V})},Fe=ft;function P(z){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?P=function(_){return typeof _}:P=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},P(z)}function ae(z,C){if(!(z instanceof C))throw new TypeError("Cannot call a class as a function")}function se(z,C){for(var _=0;_"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Qt(z){return Qt=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},Qt(z)}function Lr(z,C){var _="data-clipboard-".concat(z);if(C.hasAttribute(_))return C.getAttribute(_)}var zi=(function(z){Le(_,z);var C=Wi(_);function _(W,V){var B;return ae(this,_),B=C.call(this),B.resolveOptions(V),B.listenClick(W),B}return de(_,[{key:"resolveOptions",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof V.action=="function"?V.action:this.defaultAction,this.target=typeof V.target=="function"?V.target:this.defaultTarget,this.text=typeof V.text=="function"?V.text:this.defaultText,this.container=P(V.container)==="object"?V.container:document.body}},{key:"listenClick",value:function(V){var B=this;this.listener=l()(V,"click",function(je){return B.onClick(je)})}},{key:"onClick",value:function(V){var B=V.delegateTarget||V.currentTarget,je=this.action(B)||"copy",Yt=Fe({action:je,container:this.container,target:this.target(B),text:this.text(B)});this.emit(Yt?"success":"error",{action:je,text:Yt,trigger:B,clearSelection:function(){B&&B.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(V){return Lr("action",V)}},{key:"defaultTarget",value:function(V){var B=Lr("target",V);if(B)return document.querySelector(B)}},{key:"defaultText",value:function(V){return Lr("text",V)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(V){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return Z(V,B)}},{key:"cut",value:function(V){return v(V)}},{key:"isSupported",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],B=typeof V=="string"?[V]:V,je=!!document.queryCommandSupported;return B.forEach(function(Yt){je=je&&!!document.queryCommandSupported(Yt)}),je}}]),_})(s()),qi=zi}),828:(function(o){var n=9;if(typeof Element<"u"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,c){for(;s&&s.nodeType!==n;){if(typeof s.matches=="function"&&s.matches(c))return s;s=s.parentNode}}o.exports=a}),438:(function(o,n,i){var a=i(828);function s(p,f,u,d,v){var O=l.apply(this,arguments);return p.addEventListener(u,O,v),{destroy:function(){p.removeEventListener(u,O,v)}}}function c(p,f,u,d,v){return typeof p.addEventListener=="function"?s.apply(null,arguments):typeof u=="function"?s.bind(null,document).apply(null,arguments):(typeof p=="string"&&(p=document.querySelectorAll(p)),Array.prototype.map.call(p,function(O){return s(O,f,u,d,v)}))}function l(p,f,u,d){return function(v){v.delegateTarget=a(v.target,f),v.delegateTarget&&d.call(p,v)}}o.exports=c}),879:(function(o,n){n.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},n.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||n.node(i[0]))},n.string=function(i){return typeof i=="string"||i instanceof String},n.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}}),370:(function(o,n,i){var a=i(879),s=i(438);function c(u,d,v){if(!u&&!d&&!v)throw new Error("Missing required arguments");if(!a.string(d))throw new TypeError("Second argument must be a String");if(!a.fn(v))throw new TypeError("Third argument must be a Function");if(a.node(u))return l(u,d,v);if(a.nodeList(u))return p(u,d,v);if(a.string(u))return f(u,d,v);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function l(u,d,v){return u.addEventListener(d,v),{destroy:function(){u.removeEventListener(d,v)}}}function p(u,d,v){return Array.prototype.forEach.call(u,function(O){O.addEventListener(d,v)}),{destroy:function(){Array.prototype.forEach.call(u,function(O){O.removeEventListener(d,v)})}}}function f(u,d,v){return s(document.body,u,d,v)}o.exports=c}),817:(function(o){function n(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var c=window.getSelection(),l=document.createRange();l.selectNodeContents(i),c.removeAllRanges(),c.addRange(l),a=c.toString()}return a}o.exports=n}),279:(function(o){function n(){}n.prototype={on:function(i,a,s){var c=this.e||(this.e={});return(c[i]||(c[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var c=this;function l(){c.off(i,l),a.apply(s,arguments)}return l._=a,this.on(i,l,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),c=0,l=s.length;for(c;c0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function q(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),n,i=[],a;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(s){a={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i}function Y(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,i;o1||c(d,O)})},v&&(n[d]=v(n[d])))}function c(d,v){try{l(o[d](v))}catch(O){u(i[0][3],O)}}function l(d){d.value instanceof ut?Promise.resolve(d.value.v).then(p,f):u(i[0][2],d)}function p(d){c("next",d)}function f(d){c("throw",d)}function u(d,v){d(v),i.shift(),i.length&&c(i[0][0],i[0][1])}}function bo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Se=="function"?Se(e):e[Symbol.iterator](),r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r);function o(i){r[i]=e[i]&&function(a){return new Promise(function(s,c){a=e[i](a),n(s,c,a.done,a.value)})}}function n(i,a,s,c){Promise.resolve(c).then(function(l){i({value:l,done:s})},a)}}function R(e){return typeof e=="function"}function gt(e){var t=function(o){Error.call(o),o.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Gt=gt(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: `+r.map(function(o,n){return n+1+") "+o.toString()}).join(` - `):"",this.name="UnsubscriptionError",this.errors=r}});function Xe(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ne=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,o,n,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Se(a),c=s.next();!c.done;c=s.next()){var l=c.value;l.remove(this)}}catch(O){t={error:O}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var p=this.initialTeardown;if(R(p))try{p()}catch(O){i=O instanceof Gt?O.errors:[O]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var u=Se(f),d=u.next();!d.done;d=u.next()){var v=d.value;try{vo(v)}catch(O){i=i??[],O instanceof Gt?i=Y(Y([],q(i)),q(O.errors)):i.push(O)}}}catch(O){o={error:O}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}}if(i)throw new Gt(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)vo(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Xe(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Xe(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})();var Ar=Ne.EMPTY;function Jt(e){return e instanceof Ne||e&&"closed"in e&&R(e.remove)&&R(e.add)&&R(e.unsubscribe)}function vo(e){R(e)?e():e.unsubscribe()}var Ue={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var yt={setTimeout:function(e,t){for(var r=[],o=2;o0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var o=this,n=this,i=n.hasError,a=n.isStopped,s=n.observers;return i||a?Ar:(this.currentObservers=null,s.push(r),new Ne(function(){o.currentObservers=null,Xe(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var o=this,n=o.hasError,i=o.thrownError,a=o.isStopped;n?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new I;return r.source=this,r},t.create=function(r,o){return new Oo(r,o)},t})(I);var Oo=(function(e){ne(t,e);function t(r,o){var n=e.call(this)||this;return n.destination=r,n.source=o,n}return t.prototype.next=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.next)===null||n===void 0||n.call(o,r)},t.prototype.error=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.error)===null||n===void 0||n.call(o,r)},t.prototype.complete=function(){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||o===void 0||o.call(r)},t.prototype._subscribe=function(r){var o,n;return(n=(o=this.source)===null||o===void 0?void 0:o.subscribe(r))!==null&&n!==void 0?n:Ar},t})(S);var Pr=(function(e){ne(t,e);function t(r){var o=e.call(this)||this;return o._value=r,o}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var o=e.prototype._subscribe.call(this,r);return!o.closed&&r.next(this._value),o},t.prototype.getValue=function(){var r=this,o=r.hasError,n=r.thrownError,i=r._value;if(o)throw n;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(S);var Pt={now:function(){return(Pt.delegate||Date).now()},delegate:void 0};var Rt=(function(e){ne(t,e);function t(r,o,n){r===void 0&&(r=1/0),o===void 0&&(o=1/0),n===void 0&&(n=Pt);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=o,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=o===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,o),i}return t.prototype.next=function(r){var o=this,n=o.isStopped,i=o._buffer,a=o._infiniteTimeWindow,s=o._timestampProvider,c=o._windowTime;n||(i.push(r),!a&&i.push(s.now()+c)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var o=this._innerSubscribe(r),n=this,i=n._infiniteTimeWindow,a=n._buffer,s=a.slice(),c=0;c0?e.prototype.schedule.call(this,r,o):(this.delay=o,this.state=r,this.scheduler.flush(this),this)},t.prototype.execute=function(r,o){return o>0||this.closed?e.prototype.execute.call(this,r,o):this._execute(r,o)},t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!=null&&n>0||n==null&&this.delay>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.flush(this),0)},t})(St);var _o=(function(e){ne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(Tt);var Fr=new _o(Mo);var Ao=(function(e){ne(t,e);function t(r,o){var n=e.call(this,r,o)||this;return n.scheduler=r,n.work=o,n}return t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!==null&&n>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.actions.push(this),r._scheduled||(r._scheduled=wt.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,o,n){var i;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,o,n);var a=r.actions;o!=null&&o===r._scheduled&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==o&&(wt.cancelAnimationFrame(o),r._scheduled=void 0)},t})(St);var Co=(function(e){ne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var o;r?o=r.id:(o=this._scheduled,this._scheduled=void 0);var n=this.actions,i;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while((r=n[0])&&r.id===o&&n.shift());if(this._active=!1,i){for(;(r=n[0])&&r.id===o&&n.shift();)r.unsubscribe();throw i}},t})(Tt);var ge=new Co(Ao);var y=new I(function(e){return e.complete()});function er(e){return e&&R(e.schedule)}function jr(e){return e[e.length-1]}function ct(e){return R(jr(e))?e.pop():void 0}function Ie(e){return er(jr(e))?e.pop():void 0}function tr(e,t){return typeof jr(e)=="number"?e.pop():t}var Ot=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function rr(e){return R(e?.then)}function or(e){return R(e[Et])}function nr(e){return Symbol.asyncIterator&&R(e?.[Symbol.asyncIterator])}function ir(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ia(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ar=ia();function sr(e){return R(e?.[ar])}function cr(e){return ho(this,arguments,function(){var r,o,n,i;return Bt(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,ut(r.read())];case 3:return o=a.sent(),n=o.value,i=o.done,i?[4,ut(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,ut(n)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function lr(e){return R(e?.getReader)}function j(e){if(e instanceof I)return e;if(e!=null){if(or(e))return aa(e);if(Ot(e))return sa(e);if(rr(e))return ca(e);if(nr(e))return ko(e);if(sr(e))return la(e);if(lr(e))return pa(e)}throw ir(e)}function aa(e){return new I(function(t){var r=e[Et]();if(R(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function sa(e){return new I(function(t){for(var r=0;r=2;return function(o){return o.pipe(e?g(function(n,i){return e(n,i,o)}):he,xe(1),r?qe(t):Yo(function(){return new mr}))}}function zr(e){return e<=0?function(){return y}:E(function(t,r){var o=[];t.subscribe(w(r,function(n){o.push(n),e=2,!0))}function le(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new S}:t,o=e.resetOnError,n=o===void 0?!0:o,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(l){var p,f,u,d=0,v=!1,O=!1,J=function(){f?.unsubscribe(),f=void 0},te=function(){J(),p=u=void 0,v=O=!1},Z=function(){var k=p;te(),k?.unsubscribe()};return E(function(k,ft){d++,!O&&!v&&J();var Fe=u=u??r();ft.add(function(){d--,d===0&&!O&&!v&&(f=qr(Z,c))}),Fe.subscribe(ft),!p&&d>0&&(p=new ht({next:function(P){return Fe.next(P)},error:function(P){O=!0,J(),f=qr(te,n,P),Fe.error(P)},complete:function(){v=!0,J(),f=qr(te,a),Fe.complete()}}),j(k).subscribe(p))})(l)}}function qr(e,t){for(var r=[],o=2;oe.next(document)),e}function M(e,t=document){return Array.from(t.querySelectorAll(e))}function F(e,t=document){let r=fe(e,t);if(typeof r>"u")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function fe(e,t=document){return t.querySelector(e)||void 0}function De(){return document.activeElement?.shadowRoot?.activeElement??document.activeElement??void 0}var _a=L(h(document.body,"focusin"),h(document.body,"focusout")).pipe(_e(1),K(void 0),m(()=>De()||document.body),X(1));function Ke(e){return _a.pipe(m(t=>e.contains(t)),Q())}function nt(e,t){return H(()=>L(h(e,"mouseenter").pipe(m(()=>!0)),h(e,"mouseleave").pipe(m(()=>!1))).pipe(t?Ft(r=>ke(+!r*t)):he,K(e.matches(":hover"))))}function Zo(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)Zo(e,r)}function x(e,t,...r){let o=document.createElement(e);if(t)for(let n of Object.keys(t))typeof t[n]>"u"||(typeof t[n]!="boolean"?o.setAttribute(n,t[n]):o.setAttribute(n,""));for(let n of r)Zo(o,n);return o}function hr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function Mt(e){let t=x("script",{src:e});return H(()=>(document.head.appendChild(t),L(h(t,"load"),h(t,"error").pipe(b(()=>Ur(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(m(()=>{}),A(()=>document.head.removeChild(t)),xe(1))))}var en=new S,Aa=H(()=>typeof ResizeObserver>"u"?Mt("https://unpkg.com/resize-observer-polyfill"):$(void 0)).pipe(m(()=>new ResizeObserver(e=>e.forEach(t=>en.next(t)))),b(e=>L(et,$(e)).pipe(A(()=>e.disconnect()))),X(1));function ue(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Te(e){let t=e;for(;t.clientWidth===0&&t.parentElement;)t=t.parentElement;return Aa.pipe(T(r=>r.observe(t)),b(r=>en.pipe(g(o=>o.target===t),A(()=>r.unobserve(t)))),m(()=>ue(e)),K(ue(e)))}function _t(e){return{width:e.scrollWidth,height:e.scrollHeight}}function br(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}function tn(e){let t=[],r=e.parentElement;for(;r;)(e.clientWidth>r.clientWidth||e.clientHeight>r.clientHeight)&&t.push(r),r=(e=r).parentElement;return t.length===0&&t.push(document.documentElement),t}function Qe(e){return{x:e.offsetLeft,y:e.offsetTop}}function rn(e){let t=e.getBoundingClientRect();return{x:t.x+window.scrollX,y:t.y+window.scrollY}}function on(e){return L(h(window,"load"),h(window,"resize")).pipe(He(0,ge),m(()=>Qe(e)),K(Qe(e)))}function vr(e){return{x:e.scrollLeft,y:e.scrollTop}}function Ye(e){return L(h(e,"scroll"),h(window,"scroll"),h(window,"resize")).pipe(He(0,ge),m(()=>vr(e)),K(vr(e)))}var nn=new S,Ca=H(()=>$(new IntersectionObserver(e=>{for(let t of e)nn.next(t)},{threshold:0}))).pipe(b(e=>L(et,$(e)).pipe(A(()=>e.disconnect()))),X(1));function pt(e){return Ca.pipe(T(t=>t.observe(e)),b(t=>nn.pipe(g(({target:r})=>r===e),A(()=>t.unobserve(e)),m(({isIntersecting:r})=>r))))}function an(e,t=16){return Ye(e).pipe(m(({y:r})=>{let o=ue(e),n=_t(e);return r>=n.height-o.height-t}),Q())}var gr={drawer:F("[data-md-toggle=drawer]"),search:F("[data-md-toggle=search]")};function sn(e){return gr[e].checked}function it(e,t){gr[e].checked!==t&&gr[e].click()}function Be(e){let t=gr[e];return h(t,"change").pipe(m(()=>t.checked),K(t.checked))}function ka(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function Ha(){return L(h(window,"compositionstart").pipe(m(()=>!0)),h(window,"compositionend").pipe(m(()=>!1))).pipe(K(!1))}function cn(){let e=h(window,"keydown").pipe(g(t=>!(t.metaKey||t.ctrlKey)),m(t=>({mode:sn("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),g(({mode:t,type:r})=>{if(t==="global"){let o=De();if(typeof o<"u")return!ka(o,r)}return!0}),le());return Ha().pipe(b(t=>t?y:e))}function Ee(){return new URL(location.href)}function at(e,t=!1){if(D("navigation.instant")&&!t){let r=x("a",{href:e.href});document.body.appendChild(r),r.click(),r.remove()}else location.href=e.href}function ln(){return new S}function pn(){return location.hash.slice(1)}function mn(e){let t=x("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function Br(e){return L(h(window,"hashchange"),e).pipe(m(pn),K(pn()),g(t=>t.length>0),X(1))}function fn(e){return Br(e).pipe(m(t=>fe(`[id="${t}"]`)),g(t=>typeof t<"u"))}function Ut(e){let t=matchMedia(e);return fr(r=>t.addListener(()=>r(t.matches))).pipe(K(t.matches))}function un(){let e=matchMedia("print");return L(h(window,"beforeprint").pipe(m(()=>!0)),h(window,"afterprint").pipe(m(()=>!1))).pipe(K(e.matches))}function Gr(e,t){return e.pipe(b(r=>r?t():y))}function Jr(e,t){return new I(r=>{let o=new XMLHttpRequest;o.open("GET",`${e}`),o.responseType="blob";for(let[n,i]of Object.entries(t?.headers??{}))o.setRequestHeader(n,i);return o.addEventListener("load",()=>{o.status>=200&&o.status<300?(r.next(o.response),r.complete()):r.error(new Error(o.statusText))}),o.addEventListener("error",()=>{r.error(new Error("Network error"))}),o.addEventListener("abort",()=>{r.complete()}),typeof t?.progress$<"u"&&(o.addEventListener("progress",n=>{if(n.lengthComputable)t.progress$.next(n.loaded/n.total*100);else{let i=o.getResponseHeader("Content-Length")??0;t.progress$.next(n.loaded/+i*100)}}),t.progress$.next(5)),o.send(),()=>o.abort()})}function Ve(e,t){return Jr(e,t).pipe(b(r=>r.text()),m(r=>JSON.parse(r)),X(1))}function yr(e,t){let r=new DOMParser;return Jr(e,{...t,headers:{...t?.headers??{},"X-DocsForge-Instant-Nav":"1"}}).pipe(b(o=>o.text()),m(o=>r.parseFromString(o,"text/html")),X(1))}function dn(e,t){let r=new DOMParser;return Jr(e,t).pipe(b(o=>o.text()),m(o=>r.parseFromString(o,"text/xml")),X(1))}function hn(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function bn(){return L(h(window,"scroll",{passive:!0}),h(window,"resize",{passive:!0})).pipe(m(hn),K(hn()))}function vn(){return{width:innerWidth,height:innerHeight}}function gn(){return h(window,"resize",{passive:!0}).pipe(m(vn),K(vn()))}function yn(){return N([bn(),gn()]).pipe(m(([e,t])=>({offset:e,size:t})),X(1))}function xr(e,{viewport$:t,header$:r}){let o=t.pipe(oe("size")),n=N([o,r]).pipe(m(()=>Qe(e)));return N([r,t,n]).pipe(m(([{height:i},{offset:a,size:s},{x:c,y:l}])=>({offset:{x:a.x-c,y:a.y-l+i},size:s})))}function $a(e){return h(e,"message",t=>t.data)}function Pa(e){let t=new S;return t.subscribe(r=>e.postMessage(r)),t}function xn(e,t=new Worker(e)){let r=$a(t),o=Pa(t),n=new S;n.subscribe(o);let i=o.pipe(re(),ie(!0));return n.pipe(re(),We(r.pipe(U(i))),le())}var Ra=F("#__config"),At=JSON.parse(Ra.textContent);At.base=`${new URL(At.base,Ee())}`;function we(){return At}function D(e){return At.features.includes(e)}function Oe(e,t){return typeof t<"u"?At.translations[e].replace("#",t.toString()):At.translations[e]}function Ae(e,t=document){return F(`[data-md-component=${e}]`,t)}function pe(e,t=document){return M(`[data-md-component=${e}]`,t)}function Ia(e){let t=F(".md-typeset > :first-child",e);return h(t,"click",{once:!0}).pipe(m(()=>F(".md-typeset",e)),m(r=>({hash:__md_hash(r.innerHTML)})))}function En(e){if(!D("announce.dismiss")||!e.childElementCount)return y;if(!e.hidden){let t=F(".md-typeset",e);__md_hash(t.innerHTML)===__md_get("__announce")&&(e.hidden=!0)}return H(()=>{let t=new S;return t.subscribe(({hash:r})=>{e.hidden=!0,__md_set("__announce",r)}),Ia(e).pipe(T(r=>t.next(r)),A(()=>t.complete()),m(r=>({ref:e,...r})))})}function Fa(e,{target$:t}){return t.pipe(m(r=>({hidden:r!==e})))}function wn(e,t){let r=new S;return r.subscribe(({hidden:o})=>{e.hidden=o}),Fa(e,t).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))}function Wt(e,t){return t==="inline"?x("div",{class:"md-tooltip md-tooltip--inline",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"})):x("div",{class:"md-tooltip",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"}))}function Er(...e){return x("div",{class:"md-tooltip2",role:"dialog"},x("div",{class:"md-tooltip2__inner md-typeset"},e))}function Sn(...e){return x("div",{class:"md-tooltip2",role:"tooltip"},x("div",{class:"md-tooltip2__inner md-typeset"},e))}function Tn(e,t){if(t=t?`${t}_annotation_${e}`:void 0,t){let r=t?`#${t}`:void 0;return x("aside",{class:"md-annotation",tabIndex:0},Wt(t),x("a",{href:r,class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}else return x("aside",{class:"md-annotation",tabIndex:0},Wt(t),x("span",{class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}function On(e){return x("button",{class:"md-code__button",title:Oe("clipboard.copy"),"data-clipboard-target":`#${e} > code`,"data-md-type":"copy"})}function Ln(){return x("button",{class:"md-code__button",title:"Toggle line selection","data-md-type":"select"})}function Mn(){return x("nav",{class:"md-code__nav"})}var An=Ht(Xr());function Zr(e,t){let r=t&2,o=t&1,n=Object.keys(e.terms).filter(c=>!e.terms[c]).reduce((c,l)=>[...c,x("del",null,(0,An.default)(l))," "],[]).slice(0,-1),i=we(),a=new URL(e.location,i.base);D("search.highlight")&&a.searchParams.set("h",Object.entries(e.terms).filter(([,c])=>c).reduce((c,[l])=>`${c} ${l}`.trim(),""));let{tags:s}=we();return x("a",{href:`${a}`,class:"md-search-result__link",tabIndex:-1},x("article",{class:"md-search-result__article md-typeset","data-md-score":e.score.toFixed(2)},r>0&&x("div",{class:"md-search-result__icon md-icon"}),r>0&&x("h1",null,e.title),r<=0&&x("h2",null,e.title),o>0&&e.text.length>0&&e.text,e.tags&&x("nav",{class:"md-tags"},e.tags.map(c=>{let l=s?c in s?`md-tag-icon md-tag--${s[c]}`:"md-tag-icon":"";return x("span",{class:`md-tag ${l}`},c)})),o>0&&n.length>0&&x("p",{class:"md-search-result__terms"},Oe("search.result.term.missing"),": ",...n)))}function Cn(e){let t=e[0].score,r=[...e],o=we(),n=r.findIndex(p=>!`${new URL(p.location,o.base)}`.includes("#")),[i]=r.splice(n,1),a=r.findIndex(p=>p.scoreZr(p,1)),...c.length?[x("details",{class:"md-search-result__more"},x("summary",{tabIndex:-1},x("div",null,c.length>0&&c.length===1?Oe("search.result.more.one"):Oe("search.result.more.other",c.length))),...c.map(p=>Zr(p,1)))]:[]];return x("li",{class:"md-search-result__item"},l)}function kn(e){return x("ul",{class:"md-source__facts"},Object.entries(e).map(([t,r])=>x("li",{class:`md-source__fact md-source__fact--${t}`},typeof r=="number"?hr(r):r)))}function eo(e){let t=`tabbed-control tabbed-control--${e}`;return x("div",{class:t,hidden:!0},x("button",{class:"tabbed-button",tabIndex:-1,"aria-hidden":"true"}))}function Hn(e){return x("div",{class:"md-typeset__scrollwrap"},x("div",{class:"md-typeset__table"},e))}function Wa(e){let t=we(),r=new URL(`../${e.version}/`,t.base);return x("li",{class:"md-version__item"},x("a",{href:`${r}`,class:"md-version__link"},e.title,t.version?.alias&&e.aliases.length>0&&x("span",{class:"md-version__alias"},e.aliases[0])))}function $n(e,t){let r=we();return e=e.filter(o=>!o.properties?.hidden),x("div",{class:"md-version"},x("button",{class:"md-version__current","aria-label":Oe("select.version")},t.title,r.version?.alias&&t.aliases.length>0&&x("span",{class:"md-version__alias"},t.aliases[0])),x("ul",{class:"md-version__list"},e.map(Wa)))}var Da=0;function Va(e,t=250){let r=N([Ke(e),nt(e,t)]).pipe(m(([n,i])=>n||i),Q()),o=H(()=>tn(e)).pipe(G(Ye),vt(1),$e(r),m(()=>rn(e)));return r.pipe(Pe(n=>n),b(()=>N([r,o])),m(([n,i])=>({active:n,offset:i})),le())}function Dt(e,t,r=250){let{content$:o,viewport$:n}=t,i=`__tooltip2_${Da++}`;return H(()=>{let a=new S,s=new Pr(!1);a.pipe(re(),ie(!1)).subscribe(s);let c=s.pipe(Ft(p=>ke(+!p*250,Fr)),Q(),b(p=>p?o:y),T(p=>p.id=i),le());N([a.pipe(m(({active:p})=>p)),c.pipe(b(p=>nt(p,250)),K(!1))]).pipe(m(p=>p.some(f=>f))).subscribe(s);let l=s.pipe(g(p=>p),ee(c,n),m(([p,f,{size:u}])=>{let d=e.getBoundingClientRect(),v=d.width/2;if(f.role==="tooltip")return{x:v,y:8+d.height};if(d.y>=u.height/2){let{height:O}=ue(f);return{x:v,y:-16-O}}else return{x:v,y:16+d.height}}));return N([c,a,l]).subscribe(([p,{offset:f},u])=>{p.style.setProperty("--md-tooltip-host-x",`${f.x}px`),p.style.setProperty("--md-tooltip-host-y",`${f.y}px`),p.style.setProperty("--md-tooltip-x",`${u.x}px`),p.style.setProperty("--md-tooltip-y",`${u.y}px`),p.classList.toggle("md-tooltip2--top",u.y<0),p.classList.toggle("md-tooltip2--bottom",u.y>=0)}),s.pipe(g(p=>p),ee(c,(p,f)=>f),g(p=>p.role==="tooltip")).subscribe(p=>{let f=ue(F(":scope > *",p));p.style.setProperty("--md-tooltip-width",`${f.width}px`),p.style.setProperty("--md-tooltip-tail","0px")}),s.pipe(Q(),ye(ge),ee(c)).subscribe(([p,f])=>{f.classList.toggle("md-tooltip2--active",p)}),N([s.pipe(g(p=>p)),c]).subscribe(([p,f])=>{f.role==="dialog"?(e.setAttribute("aria-controls",i),e.setAttribute("aria-haspopup","dialog")):e.setAttribute("aria-describedby",i)}),s.pipe(g(p=>!p)).subscribe(()=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-haspopup")}),Va(e,r).pipe(T(p=>a.next(p)),A(()=>a.complete()),m(p=>({ref:e,...p})))})}function Ge(e,{viewport$:t},r=document.body){return Dt(e,{content$:new I(o=>{let n=e.title,i=Sn(n);return o.next(i),e.removeAttribute("title"),r.append(i),()=>{i.remove(),e.setAttribute("title",n)}}),viewport$:t},0)}function Na(e,t){let r=H(()=>N([on(e),Ye(t)])).pipe(m(([{x:o,y:n},i])=>{let{width:a,height:s}=ue(e);return{x:o-i.x+a/2,y:n-i.y+s/2}}));return Ke(e).pipe(b(o=>r.pipe(m(n=>({active:o,offset:n})),xe(+!o||1/0))))}function Pn(e,t,{target$:r}){let[o,n]=Array.from(e.children);return H(()=>{let i=new S,a=i.pipe(re(),ie(!0));return i.subscribe({next({offset:s}){e.style.setProperty("--md-tooltip-x",`${s.x}px`),e.style.setProperty("--md-tooltip-y",`${s.y}px`)},complete(){e.style.removeProperty("--md-tooltip-x"),e.style.removeProperty("--md-tooltip-y")}}),pt(e).pipe(U(a)).subscribe(s=>{e.toggleAttribute("data-md-visible",s)}),L(i.pipe(g(({active:s})=>s)),i.pipe(_e(250),g(({active:s})=>!s))).subscribe({next({active:s}){s?e.prepend(o):o.remove()},complete(){e.prepend(o)}}),i.pipe(He(16,ge)).subscribe(({active:s})=>{o.classList.toggle("md-tooltip--active",s)}),i.pipe(vt(125,ge),g(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:s})=>s)).subscribe({next(s){s?e.style.setProperty("--md-tooltip-0",`${-s}px`):e.style.removeProperty("--md-tooltip-0")},complete(){e.style.removeProperty("--md-tooltip-0")}}),h(n,"click").pipe(U(a),g(s=>!(s.metaKey||s.ctrlKey))).subscribe(s=>{s.stopPropagation(),s.preventDefault()}),h(n,"mousedown").pipe(U(a),ee(i)).subscribe(([s,{active:c}])=>{if(s.button!==0||s.metaKey||s.ctrlKey)s.preventDefault();else if(c){s.preventDefault();let l=e.parentElement.closest(".md-annotation");l instanceof HTMLElement?l.focus():De()?.blur()}}),r.pipe(U(a),g(s=>s===o),ot(125)).subscribe(()=>e.focus()),Na(e,t).pipe(T(s=>i.next(s)),A(()=>i.complete()),m(s=>({ref:e,...s})))})}function za(e){let t=we();if(e.tagName!=="CODE")return[e];let r=[".c",".c1",".cm"];if(t.annotate&&typeof t.annotate=="object"){let o=e.closest("[class|=language]");if(o)for(let n of Array.from(o.classList)){if(!n.startsWith("language-"))continue;let[,i]=n.split("-");i in t.annotate&&r.push(...t.annotate[i])}}return M(r.join(", "),e)}function qa(e){let t=[];for(let r of za(e)){let o=[],n=document.createNodeIterator(r,NodeFilter.SHOW_TEXT);for(let i=n.nextNode();i;i=n.nextNode())o.push(i);for(let i of o){let a;for(;a=/(\(\d+\))(!)?/.exec(i.textContent);){let[,s,c]=a;if(typeof c>"u"){let l=i.splitText(a.index);i=l.splitText(s.length),t.push(l)}else{i.textContent=s,t.push(i);break}}}}return t}function Rn(e,t){t.append(...Array.from(e.childNodes))}function wr(e,t,{target$:r,print$:o}){let i=t.closest("[id]")?.id,a=new Map;for(let s of qa(t)){let[,c]=s.textContent.match(/\((\d+)\)/);fe(`:scope > li:nth-child(${c})`,e)&&(a.set(c,Tn(c,i)),s.replaceWith(a.get(c)))}return a.size===0?y:H(()=>{let s=new S,c=s.pipe(re(),ie(!0)),l=[];for(let[p,f]of a)l.push([F(".md-typeset",f),F(`:scope > li:nth-child(${p})`,e)]);return o.pipe(U(c)).subscribe(p=>{e.hidden=!p,e.classList.toggle("md-annotation-list",p);for(let[f,u]of l)p?Rn(f,u):Rn(u,f)}),L(...[...a].map(([,p])=>Pn(p,t,{target$:r}))).pipe(A(()=>s.complete()),le())})}function In(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return In(t)}}function Fn(e,t){return H(()=>{let r=In(e);return typeof r<"u"?wr(r,e,t):y})}var Un=Ht(ro());var Ka=0,jn=L(h(window,"keydown").pipe(m(()=>!0)),L(h(window,"keyup"),h(window,"contextmenu")).pipe(m(()=>!1))).pipe(K(!1),X(1));function Wn(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return Wn(t)}}function Qa(e){return Te(e).pipe(m(({width:t})=>({scrollable:_t(e).width>t})),oe("scrollable"))}function Dn(e,t){let{matches:r}=matchMedia("(hover)"),o=H(()=>{let n=new S,i=n.pipe(zr(1));n.subscribe(({scrollable:d})=>{d&&r?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")});let a=[],s=e.closest("pre"),c=s.closest("[id]"),l=c?c.id:Ka++;s.id=`__code_${l}`;let p=[],f=e.closest(".highlight");if(f instanceof HTMLElement){let d=Wn(f);if(typeof d<"u"&&(f.classList.contains("annotate")||D("content.code.annotate"))){let v=wr(d,e,t);p.push(Te(f).pipe(U(i),m(({width:O,height:J})=>O&&J),Q(),b(O=>O?v:y)))}}let u=M(":scope > span[id]",e);if(u.length&&(e.classList.add("md-code__content"),e.closest(".select")||D("content.code.select")&&!e.closest(".no-select"))){let d=+u[0].id.split("-").pop(),v=Ln();a.push(v),D("content.tooltips")&&p.push(Ge(v,{viewport$}));let O=h(v,"click").pipe(jt(P=>!P,!1),T(()=>v.blur()),le());O.subscribe(P=>{v.classList.toggle("md-code__button--active",P)});let J=me(u).pipe(G(P=>nt(P).pipe(m(ae=>[P,ae]))));O.pipe(b(P=>P?J:y)).subscribe(([P,ae])=>{let se=fe(".hll.select",P);if(se&&!ae)se.replaceWith(...Array.from(se.childNodes));else if(!se&&ae){let de=document.createElement("span");de.className="hll select",de.append(...Array.from(P.childNodes).slice(1)),P.append(de)}});let te=me(u).pipe(G(P=>h(P,"mousedown").pipe(T(ae=>ae.preventDefault()),m(()=>P)))),Z=O.pipe(b(P=>P?te:y),ee(jn),m(([P,ae])=>{let se=u.indexOf(P)+d;if(ae===!1)return[se,se];{let de=M(".hll",e).map(Le=>u.indexOf(Le.parentElement)+d);return window.getSelection()?.removeAllRanges(),[Math.min(se,...de),Math.max(se,...de)]}})),k=Br(y).pipe(g(P=>P.startsWith(`__codelineno-${l}-`)));k.subscribe(P=>{let[,,ae]=P.split("-"),se=ae.split(":").map(Le=>+Le-d+1);se.length===1&&se.push(se[0]);for(let Le of M(".hll:not(.select)",e))Le.replaceWith(...Array.from(Le.childNodes));let de=u.slice(se[0]-1,se[1]);for(let Le of de){let Je=document.createElement("span");Je.className="hll",Je.append(...Array.from(Le.childNodes).slice(1)),Le.append(Je)}}),k.pipe(xe(1),ye(ce)).subscribe(P=>{if(P.includes(":")){let ae=document.getElementById(P.split(":")[0]);ae&&setTimeout(()=>{let se=ae,de=-64;for(;se!==document.body;)de+=se.offsetTop,se=se.offsetParent;window.scrollTo({top:de})},1)}});let Fe=me(M('a[href^="#__codelineno"]',f)).pipe(G(P=>h(P,"click").pipe(T(ae=>ae.preventDefault()),m(()=>P)))).pipe(U(i),ee(jn),m(([P,ae])=>{let de=+F(`[id="${P.hash.slice(1)}"]`).parentElement.id.split("-").pop();if(ae===!1)return[de,de];{let Le=M(".hll",e).map(Je=>+Je.parentElement.id.split("-").pop());return[Math.min(de,...Le),Math.max(de,...Le)]}}));L(Z,Fe).subscribe(P=>{let ae=`#__codelineno-${l}-`;P[0]===P[1]?ae+=P[0]:ae+=`${P[0]}:${P[1]}`,history.replaceState({},"",ae),window.dispatchEvent(new HashChangeEvent("hashchange",{newURL:window.location.origin+window.location.pathname+ae,oldURL:window.location.href}))})}if(Un.default.isSupported()&&(e.closest(".copy")||D("content.code.copy")&&!e.closest(".no-copy"))){let d=On(s.id);a.push(d),D("content.tooltips")&&p.push(Ge(d,{viewport$}))}if(a.length){let d=Mn();d.append(...a),s.insertBefore(d,e)}return Qa(e).pipe(T(d=>n.next(d)),A(()=>n.complete()),m(d=>({ref:e,...d})),We(L(...p).pipe(U(i))))});return D("content.lazy")?pt(e).pipe(g(n=>n),xe(1),b(()=>o)):o}function Ya(e,{target$:t,print$:r}){let o=!0;return L(t.pipe(m(n=>n.closest("details:not([open])")),g(n=>e===n),m(()=>({action:"open",reveal:!0}))),r.pipe(g(n=>n||!o),T(()=>o=e.open),m(n=>({action:n?"open":"close"}))))}function Vn(e,t){return H(()=>{let r=new S;return r.subscribe(({action:o,reveal:n})=>{e.toggleAttribute("open",o==="open"),n&&e.scrollIntoView()}),Ya(e,t).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))})}var Nn=0;function Ba(e){let t=document.createElement("h3");t.innerHTML=e.innerHTML;let r=[t],o=e.nextElementSibling;for(;o&&!(o instanceof HTMLHeadingElement);)r.push(o),o=o.nextElementSibling;return r}function Ga(e,t){for(let r of M("[href], [src]",e))for(let o of["href","src"]){let n=r.getAttribute(o);if(n&&!/^(?:[a-z]+:)?\/\//i.test(n)){r[o]=new URL(r.getAttribute(o),t).toString();break}}for(let r of M("[name^=__], [for]",e))for(let o of["id","for","name"]){let n=r.getAttribute(o);n&&r.setAttribute(o,`${n}$preview_${Nn}`)}return Nn++,$(e)}function zn(e,t){let{sitemap$:r}=t;if(!(e instanceof HTMLAnchorElement))return y;if(!(D("navigation.instant.preview")||e.hasAttribute("data-preview")))return y;e.removeAttribute("title");let o=N([Ke(e),nt(e)]).pipe(m(([i,a])=>i||a),Q(),g(i=>i));return tt([r,o]).pipe(b(([i])=>{let a=new URL(e.href);return a.search=a.hash="",i.has(`${a}`)?$(a):y}),b(i=>yr(i).pipe(b(a=>Ga(a,i)))),b(i=>{let a=e.hash?`article [id="${e.hash.slice(1)}"]`:"article h1",s=fe(a,i);return typeof s>"u"?y:$(Ba(s))})).pipe(b(i=>{let a=new I(s=>{let c=Er(...i);return s.next(c),document.body.append(c),()=>c.remove()});return Dt(e,{content$:a,...t})}))}var qn=`/* ---------------------------------------------------------------------------- + `):"",this.name="UnsubscriptionError",this.errors=r}});function Xe(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ne=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,o,n,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Se(a),c=s.next();!c.done;c=s.next()){var l=c.value;l.remove(this)}}catch(O){t={error:O}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var p=this.initialTeardown;if(R(p))try{p()}catch(O){i=O instanceof Gt?O.errors:[O]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var u=Se(f),d=u.next();!d.done;d=u.next()){var v=d.value;try{vo(v)}catch(O){i=i??[],O instanceof Gt?i=Y(Y([],q(i)),q(O.errors)):i.push(O)}}}catch(O){o={error:O}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}}if(i)throw new Gt(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)vo(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Xe(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Xe(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})();var Cr=Ne.EMPTY;function Jt(e){return e instanceof Ne||e&&"closed"in e&&R(e.remove)&&R(e.add)&&R(e.unsubscribe)}function vo(e){R(e)?e():e.unsubscribe()}var Ue={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var yt={setTimeout:function(e,t){for(var r=[],o=2;o0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var o=this,n=this,i=n.hasError,a=n.isStopped,s=n.observers;return i||a?Cr:(this.currentObservers=null,s.push(r),new Ne(function(){o.currentObservers=null,Xe(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var o=this,n=o.hasError,i=o.thrownError,a=o.isStopped;n?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new I;return r.source=this,r},t.create=function(r,o){return new Oo(r,o)},t})(I);var Oo=(function(e){ne(t,e);function t(r,o){var n=e.call(this)||this;return n.destination=r,n.source=o,n}return t.prototype.next=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.next)===null||n===void 0||n.call(o,r)},t.prototype.error=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.error)===null||n===void 0||n.call(o,r)},t.prototype.complete=function(){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||o===void 0||o.call(r)},t.prototype._subscribe=function(r){var o,n;return(n=(o=this.source)===null||o===void 0?void 0:o.subscribe(r))!==null&&n!==void 0?n:Cr},t})(S);var Rr=(function(e){ne(t,e);function t(r){var o=e.call(this)||this;return o._value=r,o}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var o=e.prototype._subscribe.call(this,r);return!o.closed&&r.next(this._value),o},t.prototype.getValue=function(){var r=this,o=r.hasError,n=r.thrownError,i=r._value;if(o)throw n;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(S);var Pt={now:function(){return(Pt.delegate||Date).now()},delegate:void 0};var Rt=(function(e){ne(t,e);function t(r,o,n){r===void 0&&(r=1/0),o===void 0&&(o=1/0),n===void 0&&(n=Pt);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=o,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=o===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,o),i}return t.prototype.next=function(r){var o=this,n=o.isStopped,i=o._buffer,a=o._infiniteTimeWindow,s=o._timestampProvider,c=o._windowTime;n||(i.push(r),!a&&i.push(s.now()+c)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var o=this._innerSubscribe(r),n=this,i=n._infiniteTimeWindow,a=n._buffer,s=a.slice(),c=0;c0?e.prototype.schedule.call(this,r,o):(this.delay=o,this.state=r,this.scheduler.flush(this),this)},t.prototype.execute=function(r,o){return o>0||this.closed?e.prototype.execute.call(this,r,o):this._execute(r,o)},t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!=null&&n>0||n==null&&this.delay>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.flush(this),0)},t})(St);var _o=(function(e){ne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(Tt);var jr=new _o(Mo);var Ao=(function(e){ne(t,e);function t(r,o){var n=e.call(this,r,o)||this;return n.scheduler=r,n.work=o,n}return t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!==null&&n>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.actions.push(this),r._scheduled||(r._scheduled=wt.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,o,n){var i;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,o,n);var a=r.actions;o!=null&&o===r._scheduled&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==o&&(wt.cancelAnimationFrame(o),r._scheduled=void 0)},t})(St);var Co=(function(e){ne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var o;r?o=r.id:(o=this._scheduled,this._scheduled=void 0);var n=this.actions,i;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while((r=n[0])&&r.id===o&&n.shift());if(this._active=!1,i){for(;(r=n[0])&&r.id===o&&n.shift();)r.unsubscribe();throw i}},t})(Tt);var ge=new Co(Ao);var y=new I(function(e){return e.complete()});function er(e){return e&&R(e.schedule)}function Ur(e){return e[e.length-1]}function ct(e){return R(Ur(e))?e.pop():void 0}function Ie(e){return er(Ur(e))?e.pop():void 0}function tr(e,t){return typeof Ur(e)=="number"?e.pop():t}var Ot=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function rr(e){return R(e?.then)}function or(e){return R(e[Et])}function nr(e){return Symbol.asyncIterator&&R(e?.[Symbol.asyncIterator])}function ir(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function aa(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ar=aa();function sr(e){return R(e?.[ar])}function cr(e){return ho(this,arguments,function(){var r,o,n,i;return Bt(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,ut(r.read())];case 3:return o=a.sent(),n=o.value,i=o.done,i?[4,ut(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,ut(n)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function lr(e){return R(e?.getReader)}function j(e){if(e instanceof I)return e;if(e!=null){if(or(e))return sa(e);if(Ot(e))return ca(e);if(rr(e))return la(e);if(nr(e))return ko(e);if(sr(e))return pa(e);if(lr(e))return ma(e)}throw ir(e)}function sa(e){return new I(function(t){var r=e[Et]();if(R(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ca(e){return new I(function(t){for(var r=0;r=2;return function(o){return o.pipe(e?g(function(n,i){return e(n,i,o)}):he,xe(1),r?qe(t):Yo(function(){return new mr}))}}function qr(e){return e<=0?function(){return y}:E(function(t,r){var o=[];t.subscribe(w(r,function(n){o.push(n),e=2,!0))}function le(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new S}:t,o=e.resetOnError,n=o===void 0?!0:o,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(l){var p,f,u,d=0,v=!1,O=!1,J=function(){f?.unsubscribe(),f=void 0},te=function(){J(),p=u=void 0,v=O=!1},Z=function(){var k=p;te(),k?.unsubscribe()};return E(function(k,ft){d++,!O&&!v&&J();var Fe=u=u??r();ft.add(function(){d--,d===0&&!O&&!v&&(f=Kr(Z,c))}),Fe.subscribe(ft),!p&&d>0&&(p=new ht({next:function(P){return Fe.next(P)},error:function(P){O=!0,J(),f=Kr(te,n,P),Fe.error(P)},complete:function(){v=!0,J(),f=Kr(te,a),Fe.complete()}}),j(k).subscribe(p))})(l)}}function Kr(e,t){for(var r=[],o=2;oe.next(document)),e}function M(e,t=document){return Array.from(t.querySelectorAll(e))}function F(e,t=document){let r=fe(e,t);if(typeof r>"u")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function fe(e,t=document){return t.querySelector(e)||void 0}function De(){return document.activeElement?.shadowRoot?.activeElement??document.activeElement??void 0}var Aa=L(h(document.body,"focusin"),h(document.body,"focusout")).pipe(_e(1),K(void 0),m(()=>De()||document.body),X(1));function Ke(e){return Aa.pipe(m(t=>e.contains(t)),Q())}function nt(e,t){return H(()=>L(h(e,"mouseenter").pipe(m(()=>!0)),h(e,"mouseleave").pipe(m(()=>!1))).pipe(t?Ft(r=>ke(+!r*t)):he,K(e.matches(":hover"))))}function Zo(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)Zo(e,r)}function x(e,t,...r){let o=document.createElement(e);if(t)for(let n of Object.keys(t))typeof t[n]>"u"||(typeof t[n]!="boolean"?o.setAttribute(n,t[n]):o.setAttribute(n,""));for(let n of r)Zo(o,n);return o}function hr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function Mt(e){let t=x("script",{src:e});return H(()=>(document.head.appendChild(t),L(h(t,"load"),h(t,"error").pipe(b(()=>Wr(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(m(()=>{}),A(()=>document.head.removeChild(t)),xe(1))))}var en=new S,Ca=H(()=>typeof ResizeObserver>"u"?Mt("https://unpkg.com/resize-observer-polyfill"):$(void 0)).pipe(m(()=>new ResizeObserver(e=>e.forEach(t=>en.next(t)))),b(e=>L(et,$(e)).pipe(A(()=>e.disconnect()))),X(1));function ue(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Te(e){let t=e;for(;t.clientWidth===0&&t.parentElement;)t=t.parentElement;return Ca.pipe(T(r=>r.observe(t)),b(r=>en.pipe(g(o=>o.target===t),A(()=>r.unobserve(t)))),m(()=>ue(e)),K(ue(e)))}function _t(e){return{width:e.scrollWidth,height:e.scrollHeight}}function br(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}function tn(e){let t=[],r=e.parentElement;for(;r;)(e.clientWidth>r.clientWidth||e.clientHeight>r.clientHeight)&&t.push(r),r=(e=r).parentElement;return t.length===0&&t.push(document.documentElement),t}function Qe(e){return{x:e.offsetLeft,y:e.offsetTop}}function rn(e){let t=e.getBoundingClientRect();return{x:t.x+window.scrollX,y:t.y+window.scrollY}}function on(e){return L(h(window,"load"),h(window,"resize")).pipe(He(0,ge),m(()=>Qe(e)),K(Qe(e)))}function vr(e){return{x:e.scrollLeft,y:e.scrollTop}}function Ye(e){return L(h(e,"scroll"),h(window,"scroll"),h(window,"resize")).pipe(He(0,ge),m(()=>vr(e)),K(vr(e)))}var nn=new S,ka=H(()=>$(new IntersectionObserver(e=>{for(let t of e)nn.next(t)},{threshold:0}))).pipe(b(e=>L(et,$(e)).pipe(A(()=>e.disconnect()))),X(1));function pt(e){return ka.pipe(T(t=>t.observe(e)),b(t=>nn.pipe(g(({target:r})=>r===e),A(()=>t.unobserve(e)),m(({isIntersecting:r})=>r))))}function an(e,t=16){return Ye(e).pipe(m(({y:r})=>{let o=ue(e),n=_t(e);return r>=n.height-o.height-t}),Q())}var gr={drawer:F("[data-md-toggle=drawer]"),search:F("[data-md-toggle=search]")};function sn(e){return gr[e].checked}function it(e,t){gr[e].checked!==t&&gr[e].click()}function Be(e){let t=gr[e];return h(t,"change").pipe(m(()=>t.checked),K(t.checked))}function Ha(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function $a(){return L(h(window,"compositionstart").pipe(m(()=>!0)),h(window,"compositionend").pipe(m(()=>!1))).pipe(K(!1))}function cn(){let e=h(window,"keydown").pipe(g(t=>!(t.metaKey||t.ctrlKey)),m(t=>({mode:sn("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),g(({mode:t,type:r})=>{if(t==="global"){let o=De();if(typeof o<"u")return!Ha(o,r)}return!0}),le());return $a().pipe(b(t=>t?y:e))}function Ee(){return new URL(location.href)}function at(e,t=!1){if(D("navigation.instant")&&!t){let r=x("a",{href:e.href});document.body.appendChild(r),r.click(),r.remove()}else location.href=e.href}function ln(){return new S}function pn(){return location.hash.slice(1)}function mn(e){let t=x("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function Gr(e){return L(h(window,"hashchange"),e).pipe(m(pn),K(pn()),g(t=>t.length>0),X(1))}function fn(e){return Gr(e).pipe(m(t=>fe(`[id="${t}"]`)),g(t=>typeof t<"u"))}function Ut(e){let t=matchMedia(e);return fr(r=>t.addListener(()=>r(t.matches))).pipe(K(t.matches))}function un(){let e=matchMedia("print");return L(h(window,"beforeprint").pipe(m(()=>!0)),h(window,"afterprint").pipe(m(()=>!1))).pipe(K(e.matches))}function Jr(e,t){return e.pipe(b(r=>r?t():y))}function Xr(e,t){return new I(r=>{let o=new XMLHttpRequest;o.open("GET",`${e}`),o.responseType="blob";for(let[n,i]of Object.entries(t?.headers??{}))o.setRequestHeader(n,i);return o.addEventListener("load",()=>{o.status>=200&&o.status<300?(r.next(o.response),r.complete()):r.error(new Error(o.statusText))}),o.addEventListener("error",()=>{r.error(new Error("Network error"))}),o.addEventListener("abort",()=>{r.complete()}),typeof t?.progress$<"u"&&(o.addEventListener("progress",n=>{if(n.lengthComputable)t.progress$.next(n.loaded/n.total*100);else{let i=o.getResponseHeader("Content-Length")??0;t.progress$.next(n.loaded/+i*100)}}),t.progress$.next(5)),o.send(),()=>o.abort()})}function Ve(e,t){return Xr(e,t).pipe(b(r=>r.text()),m(r=>JSON.parse(r)),X(1))}function yr(e,t){let r=new DOMParser;return Xr(e,{...t,headers:{...t?.headers??{},"X-DocsForge-Instant-Nav":"1"}}).pipe(b(o=>o.text()),m(o=>r.parseFromString(o,"text/html")),X(1))}function dn(e,t){let r=new DOMParser;return Xr(e,t).pipe(b(o=>o.text()),m(o=>r.parseFromString(o,"text/xml")),X(1))}function hn(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function bn(){return L(h(window,"scroll",{passive:!0}),h(window,"resize",{passive:!0})).pipe(m(hn),K(hn()))}function vn(){return{width:innerWidth,height:innerHeight}}function gn(){return h(window,"resize",{passive:!0}).pipe(m(vn),K(vn()))}function yn(){return N([bn(),gn()]).pipe(m(([e,t])=>({offset:e,size:t})),X(1))}function xr(e,{viewport$:t,header$:r}){let o=t.pipe(oe("size")),n=N([o,r]).pipe(m(()=>Qe(e)));return N([r,t,n]).pipe(m(([{height:i},{offset:a,size:s},{x:c,y:l}])=>({offset:{x:a.x-c,y:a.y-l+i},size:s})))}function Pa(e){return h(e,"message",t=>t.data)}function Ra(e){let t=new S;return t.subscribe(r=>e.postMessage(r)),t}function xn(e,t=new Worker(e)){let r=Pa(t),o=Ra(t),n=new S;n.subscribe(o);let i=o.pipe(re(),ie(!0));return n.pipe(re(),We(r.pipe(U(i))),le())}var Ia=F("#__config"),At=JSON.parse(Ia.textContent);At.base=`${new URL(At.base,Ee())}`;function we(){return At}function D(e){return At.features.includes(e)}function Oe(e,t){return typeof t<"u"?At.translations[e].replace("#",t.toString()):At.translations[e]}function Ae(e,t=document){return F(`[data-md-component=${e}]`,t)}function pe(e,t=document){return M(`[data-md-component=${e}]`,t)}function Fa(e){let t=F(".md-typeset > :first-child",e);return h(t,"click",{once:!0}).pipe(m(()=>F(".md-typeset",e)),m(r=>({hash:__md_hash(r.innerHTML)})))}function En(e){if(!D("announce.dismiss")||!e.childElementCount)return y;if(!e.hidden){let t=F(".md-typeset",e);__md_hash(t.innerHTML)===__md_get("__announce")&&(e.hidden=!0)}return H(()=>{let t=new S;return t.subscribe(({hash:r})=>{e.hidden=!0,__md_set("__announce",r)}),Fa(e).pipe(T(r=>t.next(r)),A(()=>t.complete()),m(r=>({ref:e,...r})))})}function ja(e,{target$:t}){return t.pipe(m(r=>({hidden:r!==e})))}function wn(e,t){let r=new S;return r.subscribe(({hidden:o})=>{e.hidden=o}),ja(e,t).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))}function Wt(e,t){return t==="inline"?x("div",{class:"md-tooltip md-tooltip--inline",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"})):x("div",{class:"md-tooltip",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"}))}function Er(...e){return x("div",{class:"md-tooltip2",role:"dialog"},x("div",{class:"md-tooltip2__inner md-typeset"},e))}function Sn(...e){return x("div",{class:"md-tooltip2",role:"tooltip"},x("div",{class:"md-tooltip2__inner md-typeset"},e))}function Tn(e,t){if(t=t?`${t}_annotation_${e}`:void 0,t){let r=t?`#${t}`:void 0;return x("aside",{class:"md-annotation",tabIndex:0},Wt(t),x("a",{href:r,class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}else return x("aside",{class:"md-annotation",tabIndex:0},Wt(t),x("span",{class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}function On(e){return x("button",{class:"md-code__button",title:Oe("clipboard.copy"),"data-clipboard-target":`#${e} > code`,"data-md-type":"copy"})}function Ln(){return x("button",{class:"md-code__button",title:"Toggle line selection","data-md-type":"select"})}function Mn(){return x("nav",{class:"md-code__nav"})}var An=Ht(Zr());function eo(e,t){let r=t&2,o=t&1,n=Object.keys(e.terms).filter(c=>!e.terms[c]).reduce((c,l)=>[...c,x("del",null,(0,An.default)(l))," "],[]).slice(0,-1),i=we(),a=new URL(e.location,i.base);D("search.highlight")&&a.searchParams.set("h",Object.entries(e.terms).filter(([,c])=>c).reduce((c,[l])=>`${c} ${l}`.trim(),""));let{tags:s}=we();return x("a",{href:`${a}`,class:"md-search-result__link",tabIndex:-1},x("article",{class:"md-search-result__article md-typeset","data-md-score":e.score.toFixed(2)},r>0&&x("div",{class:"md-search-result__icon md-icon"}),r>0&&x("h1",null,e.title),r<=0&&x("h2",null,e.title),o>0&&e.text.length>0&&e.text,e.tags&&x("nav",{class:"md-tags"},e.tags.map(c=>{let l=s?c in s?`md-tag-icon md-tag--${s[c]}`:"md-tag-icon":"";return x("span",{class:`md-tag ${l}`},c)})),o>0&&n.length>0&&x("p",{class:"md-search-result__terms"},Oe("search.result.term.missing"),": ",...n)))}function Cn(e){let t=e[0].score,r=[...e],o=we(),n=r.findIndex(p=>!`${new URL(p.location,o.base)}`.includes("#")),[i]=r.splice(n,1),a=r.findIndex(p=>p.scoreeo(p,1)),...c.length?[x("details",{class:"md-search-result__more"},x("summary",{tabIndex:-1},x("div",null,c.length>0&&c.length===1?Oe("search.result.more.one"):Oe("search.result.more.other",c.length))),...c.map(p=>eo(p,1)))]:[]];return x("li",{class:"md-search-result__item"},l)}function kn(e){return x("ul",{class:"md-source__facts"},Object.entries(e).map(([t,r])=>x("li",{class:`md-source__fact md-source__fact--${t}`},typeof r=="number"?hr(r):r)))}function to(e){let t=`tabbed-control tabbed-control--${e}`;return x("div",{class:t,hidden:!0},x("button",{class:"tabbed-button",tabIndex:-1,"aria-hidden":"true"}))}function Hn(e){return x("div",{class:"md-typeset__scrollwrap"},x("div",{class:"md-typeset__table"},e))}function Da(e){let t=we(),r=new URL(`../${e.version}/`,t.base);return x("li",{class:"md-version__item"},x("a",{href:`${r}`,class:"md-version__link"},e.title,t.version?.alias&&e.aliases.length>0&&x("span",{class:"md-version__alias"},e.aliases[0])))}function $n(e,t){let r=we();return e=e.filter(o=>!o.properties?.hidden),x("div",{class:"md-version"},x("button",{class:"md-version__current","aria-label":Oe("select.version")},t.title,r.version?.alias&&t.aliases.length>0&&x("span",{class:"md-version__alias"},t.aliases[0])),x("ul",{class:"md-version__list"},e.map(Da)))}var Va=0;function Na(e,t=250){let r=N([Ke(e),nt(e,t)]).pipe(m(([n,i])=>n||i),Q()),o=H(()=>tn(e)).pipe(G(Ye),vt(1),$e(r),m(()=>rn(e)));return r.pipe(Pe(n=>n),b(()=>N([r,o])),m(([n,i])=>({active:n,offset:i})),le())}function Dt(e,t,r=250){let{content$:o,viewport$:n}=t,i=`__tooltip2_${Va++}`;return H(()=>{let a=new S,s=new Rr(!1);a.pipe(re(),ie(!1)).subscribe(s);let c=s.pipe(Ft(p=>ke(+!p*250,jr)),Q(),b(p=>p?o:y),T(p=>p.id=i),le());N([a.pipe(m(({active:p})=>p)),c.pipe(b(p=>nt(p,250)),K(!1))]).pipe(m(p=>p.some(f=>f))).subscribe(s);let l=s.pipe(g(p=>p),ee(c,n),m(([p,f,{size:u}])=>{let d=e.getBoundingClientRect(),v=d.width/2;if(f.role==="tooltip")return{x:v,y:8+d.height};if(d.y>=u.height/2){let{height:O}=ue(f);return{x:v,y:-16-O}}else return{x:v,y:16+d.height}}));return N([c,a,l]).subscribe(([p,{offset:f},u])=>{p.style.setProperty("--md-tooltip-host-x",`${f.x}px`),p.style.setProperty("--md-tooltip-host-y",`${f.y}px`),p.style.setProperty("--md-tooltip-x",`${u.x}px`),p.style.setProperty("--md-tooltip-y",`${u.y}px`),p.classList.toggle("md-tooltip2--top",u.y<0),p.classList.toggle("md-tooltip2--bottom",u.y>=0)}),s.pipe(g(p=>p),ee(c,(p,f)=>f),g(p=>p.role==="tooltip")).subscribe(p=>{let f=ue(F(":scope > *",p));p.style.setProperty("--md-tooltip-width",`${f.width}px`),p.style.setProperty("--md-tooltip-tail","0px")}),s.pipe(Q(),ye(ge),ee(c)).subscribe(([p,f])=>{f.classList.toggle("md-tooltip2--active",p)}),N([s.pipe(g(p=>p)),c]).subscribe(([p,f])=>{f.role==="dialog"?(e.setAttribute("aria-controls",i),e.setAttribute("aria-haspopup","dialog")):e.setAttribute("aria-describedby",i)}),s.pipe(g(p=>!p)).subscribe(()=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-haspopup")}),Na(e,r).pipe(T(p=>a.next(p)),A(()=>a.complete()),m(p=>({ref:e,...p})))})}function Ge(e,{viewport$:t},r=document.body){return Dt(e,{content$:new I(o=>{let n=e.title,i=Sn(n);return o.next(i),e.removeAttribute("title"),r.append(i),()=>{i.remove(),e.setAttribute("title",n)}}),viewport$:t},0)}function za(e,t){let r=H(()=>N([on(e),Ye(t)])).pipe(m(([{x:o,y:n},i])=>{let{width:a,height:s}=ue(e);return{x:o-i.x+a/2,y:n-i.y+s/2}}));return Ke(e).pipe(b(o=>r.pipe(m(n=>({active:o,offset:n})),xe(+!o||1/0))))}function Pn(e,t,{target$:r}){let[o,n]=Array.from(e.children);return H(()=>{let i=new S,a=i.pipe(re(),ie(!0));return i.subscribe({next({offset:s}){e.style.setProperty("--md-tooltip-x",`${s.x}px`),e.style.setProperty("--md-tooltip-y",`${s.y}px`)},complete(){e.style.removeProperty("--md-tooltip-x"),e.style.removeProperty("--md-tooltip-y")}}),pt(e).pipe(U(a)).subscribe(s=>{e.toggleAttribute("data-md-visible",s)}),L(i.pipe(g(({active:s})=>s)),i.pipe(_e(250),g(({active:s})=>!s))).subscribe({next({active:s}){s?e.prepend(o):o.remove()},complete(){e.prepend(o)}}),i.pipe(He(16,ge)).subscribe(({active:s})=>{o.classList.toggle("md-tooltip--active",s)}),i.pipe(vt(125,ge),g(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:s})=>s)).subscribe({next(s){s?e.style.setProperty("--md-tooltip-0",`${-s}px`):e.style.removeProperty("--md-tooltip-0")},complete(){e.style.removeProperty("--md-tooltip-0")}}),h(n,"click").pipe(U(a),g(s=>!(s.metaKey||s.ctrlKey))).subscribe(s=>{s.stopPropagation(),s.preventDefault()}),h(n,"mousedown").pipe(U(a),ee(i)).subscribe(([s,{active:c}])=>{if(s.button!==0||s.metaKey||s.ctrlKey)s.preventDefault();else if(c){s.preventDefault();let l=e.parentElement.closest(".md-annotation");l instanceof HTMLElement?l.focus():De()?.blur()}}),r.pipe(U(a),g(s=>s===o),ot(125)).subscribe(()=>e.focus()),za(e,t).pipe(T(s=>i.next(s)),A(()=>i.complete()),m(s=>({ref:e,...s})))})}function qa(e){let t=we();if(e.tagName!=="CODE")return[e];let r=[".c",".c1",".cm"];if(t.annotate&&typeof t.annotate=="object"){let o=e.closest("[class|=language]");if(o)for(let n of Array.from(o.classList)){if(!n.startsWith("language-"))continue;let[,i]=n.split("-");i in t.annotate&&r.push(...t.annotate[i])}}return M(r.join(", "),e)}function Ka(e){let t=[];for(let r of qa(e)){let o=[],n=document.createNodeIterator(r,NodeFilter.SHOW_TEXT);for(let i=n.nextNode();i;i=n.nextNode())o.push(i);for(let i of o){let a;for(;a=/(\(\d+\))(!)?/.exec(i.textContent);){let[,s,c]=a;if(typeof c>"u"){let l=i.splitText(a.index);i=l.splitText(s.length),t.push(l)}else{i.textContent=s,t.push(i);break}}}}return t}function Rn(e,t){t.append(...Array.from(e.childNodes))}function wr(e,t,{target$:r,print$:o}){let i=t.closest("[id]")?.id,a=new Map;for(let s of Ka(t)){let[,c]=s.textContent.match(/\((\d+)\)/);fe(`:scope > li:nth-child(${c})`,e)&&(a.set(c,Tn(c,i)),s.replaceWith(a.get(c)))}return a.size===0?y:H(()=>{let s=new S,c=s.pipe(re(),ie(!0)),l=[];for(let[p,f]of a)l.push([F(".md-typeset",f),F(`:scope > li:nth-child(${p})`,e)]);return o.pipe(U(c)).subscribe(p=>{e.hidden=!p,e.classList.toggle("md-annotation-list",p);for(let[f,u]of l)p?Rn(f,u):Rn(u,f)}),L(...[...a].map(([,p])=>Pn(p,t,{target$:r}))).pipe(A(()=>s.complete()),le())})}function In(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return In(t)}}function Fn(e,t){return H(()=>{let r=In(e);return typeof r<"u"?wr(r,e,t):y})}var Un=Ht(oo());var Qa=0,jn=L(h(window,"keydown").pipe(m(()=>!0)),L(h(window,"keyup"),h(window,"contextmenu")).pipe(m(()=>!1))).pipe(K(!1),X(1));function Wn(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return Wn(t)}}function Ya(e){return Te(e).pipe(m(({width:t})=>({scrollable:_t(e).width>t})),oe("scrollable"))}function Dn(e,t){let{matches:r}=matchMedia("(hover)"),o=H(()=>{let n=new S,i=n.pipe(qr(1));n.subscribe(({scrollable:d})=>{d&&r?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")});let a=[],s=e.closest("pre"),c=s.closest("[id]"),l=c?c.id:Qa++;s.id=`__code_${l}`;let p=[],f=e.closest(".highlight");if(f instanceof HTMLElement){let d=Wn(f);if(typeof d<"u"&&(f.classList.contains("annotate")||D("content.code.annotate"))){let v=wr(d,e,t);p.push(Te(f).pipe(U(i),m(({width:O,height:J})=>O&&J),Q(),b(O=>O?v:y)))}}let u=M(":scope > span[id]",e);if(u.length&&(e.classList.add("md-code__content"),e.closest(".select")||D("content.code.select")&&!e.closest(".no-select"))){let d=+u[0].id.split("-").pop(),v=Ln();a.push(v),D("content.tooltips")&&p.push(Ge(v,{viewport$}));let O=h(v,"click").pipe(jt(P=>!P,!1),T(()=>v.blur()),le());O.subscribe(P=>{v.classList.toggle("md-code__button--active",P)});let J=me(u).pipe(G(P=>nt(P).pipe(m(ae=>[P,ae]))));O.pipe(b(P=>P?J:y)).subscribe(([P,ae])=>{let se=fe(".hll.select",P);if(se&&!ae)se.replaceWith(...Array.from(se.childNodes));else if(!se&&ae){let de=document.createElement("span");de.className="hll select",de.append(...Array.from(P.childNodes).slice(1)),P.append(de)}});let te=me(u).pipe(G(P=>h(P,"mousedown").pipe(T(ae=>ae.preventDefault()),m(()=>P)))),Z=O.pipe(b(P=>P?te:y),ee(jn),m(([P,ae])=>{let se=u.indexOf(P)+d;if(ae===!1)return[se,se];{let de=M(".hll",e).map(Le=>u.indexOf(Le.parentElement)+d);return window.getSelection()?.removeAllRanges(),[Math.min(se,...de),Math.max(se,...de)]}})),k=Gr(y).pipe(g(P=>P.startsWith(`__codelineno-${l}-`)));k.subscribe(P=>{let[,,ae]=P.split("-"),se=ae.split(":").map(Le=>+Le-d+1);se.length===1&&se.push(se[0]);for(let Le of M(".hll:not(.select)",e))Le.replaceWith(...Array.from(Le.childNodes));let de=u.slice(se[0]-1,se[1]);for(let Le of de){let Je=document.createElement("span");Je.className="hll",Je.append(...Array.from(Le.childNodes).slice(1)),Le.append(Je)}}),k.pipe(xe(1),ye(ce)).subscribe(P=>{if(P.includes(":")){let ae=document.getElementById(P.split(":")[0]);ae&&setTimeout(()=>{let se=ae,de=-64;for(;se!==document.body;)de+=se.offsetTop,se=se.offsetParent;window.scrollTo({top:de})},1)}});let Fe=me(M('a[href^="#__codelineno"]',f)).pipe(G(P=>h(P,"click").pipe(T(ae=>ae.preventDefault()),m(()=>P)))).pipe(U(i),ee(jn),m(([P,ae])=>{let de=+F(`[id="${P.hash.slice(1)}"]`).parentElement.id.split("-").pop();if(ae===!1)return[de,de];{let Le=M(".hll",e).map(Je=>+Je.parentElement.id.split("-").pop());return[Math.min(de,...Le),Math.max(de,...Le)]}}));L(Z,Fe).subscribe(P=>{let ae=`#__codelineno-${l}-`;P[0]===P[1]?ae+=P[0]:ae+=`${P[0]}:${P[1]}`,history.replaceState({},"",ae),window.dispatchEvent(new HashChangeEvent("hashchange",{newURL:window.location.origin+window.location.pathname+ae,oldURL:window.location.href}))})}if(Un.default.isSupported()&&(e.closest(".copy")||D("content.code.copy")&&!e.closest(".no-copy"))){let d=On(s.id);a.push(d),D("content.tooltips")&&p.push(Ge(d,{viewport$}))}if(a.length){let d=Mn();d.append(...a),s.insertBefore(d,e)}return Ya(e).pipe(T(d=>n.next(d)),A(()=>n.complete()),m(d=>({ref:e,...d})),We(L(...p).pipe(U(i))))});return D("content.lazy")?pt(e).pipe(g(n=>n),xe(1),b(()=>o)):o}function Ba(e,{target$:t,print$:r}){let o=!0;return L(t.pipe(m(n=>n.closest("details:not([open])")),g(n=>e===n),m(()=>({action:"open",reveal:!0}))),r.pipe(g(n=>n||!o),T(()=>o=e.open),m(n=>({action:n?"open":"close"}))))}function Vn(e,t){return H(()=>{let r=new S;return r.subscribe(({action:o,reveal:n})=>{e.toggleAttribute("open",o==="open"),n&&e.scrollIntoView()}),Ba(e,t).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))})}var Nn=0;function Ga(e){let t=document.createElement("h3");t.innerHTML=e.innerHTML;let r=[t],o=e.nextElementSibling;for(;o&&!(o instanceof HTMLHeadingElement);)r.push(o),o=o.nextElementSibling;return r}function Ja(e,t){for(let r of M("[href], [src]",e))for(let o of["href","src"]){let n=r.getAttribute(o);if(n&&!/^(?:[a-z]+:)?\/\//i.test(n)){r[o]=new URL(r.getAttribute(o),t).toString();break}}for(let r of M("[name^=__], [for]",e))for(let o of["id","for","name"]){let n=r.getAttribute(o);n&&r.setAttribute(o,`${n}$preview_${Nn}`)}return Nn++,$(e)}function zn(e,t){let{sitemap$:r}=t;if(!(e instanceof HTMLAnchorElement))return y;if(!(D("navigation.instant.preview")||e.hasAttribute("data-preview")))return y;e.removeAttribute("title");let o=N([Ke(e),nt(e)]).pipe(m(([i,a])=>i||a),Q(),g(i=>i));return tt([r,o]).pipe(b(([i])=>{let a=new URL(e.href);return a.search=a.hash="",i.has(`${a}`)?$(a):y}),b(i=>yr(i).pipe(b(a=>Ja(a,i)))),b(i=>{let a=e.hash?`article [id="${e.hash.slice(1)}"]`:"article h1",s=fe(a,i);return typeof s>"u"?y:$(Ga(s))})).pipe(b(i=>{let a=new I(s=>{let c=Er(...i);return s.next(c),document.body.append(c),()=>c.remove()});return Dt(e,{content$:a,...t})}))}var qn=`/* ---------------------------------------------------------------------------- * Rules: general * ------------------------------------------------------------------------- */ @@ -393,7 +393,7 @@ rect.rect + text.text { defs #sequencenumber { fill: var(--md-mermaid-sequence-number-bg-color) !important; } -`;var oo,Xa=0;function Za(){let e=window.docsforge?.mermaidUrl,t=typeof e=="string"&&e?e:"https://unpkg.com/mermaid@11/dist/mermaid.min.js";return typeof mermaid>"u"||mermaid instanceof Element?Mt(t):$(void 0)}function Kn(e){return e.classList.remove("mermaid"),oo||(oo=Za().pipe(T(()=>mermaid.initialize({startOnLoad:!1,themeCSS:qn,sequence:{actorFontSize:"16px",messageFontSize:"16px",noteFontSize:"16px"}})),m(()=>{}),X(1))),oo.subscribe(async()=>{e.classList.add("mermaid");let t=`__mermaid_${Xa++}`,r=x("div",{class:"mermaid"}),o=e.textContent,{svg:n,fn:i}=await mermaid.render(t,o),a=r.attachShadow({mode:"closed"});a.innerHTML=n,e.replaceWith(r),i?.(a)}),oo.pipe(m(()=>({ref:e})))}var Qn=x("table");function Yn(e){return e.replaceWith(Qn),Qn.replaceWith(Hn(e)),$({ref:e})}function es(e){let t=e.find(r=>r.checked)||e[0];return L(...e.map(r=>h(r,"change").pipe(m(()=>F(`label[for="${r.id}"]`))))).pipe(K(F(`label[for="${t.id}"]`)),m(r=>({active:r})))}function Bn(e,{viewport$:t,target$:r}){let o=F(".tabbed-labels",e),n=M(":scope > input",e),i=eo("prev");e.append(i);let a=eo("next");return e.append(a),H(()=>{let s=new S,c=s.pipe(re(),ie(!0));N([s,Te(e),pt(e)]).pipe(U(c),He(1,ge)).subscribe({next([{active:l},p]){let f=Qe(l),{width:u}=ue(l);e.style.setProperty("--md-indicator-x",`${f.x}px`),e.style.setProperty("--md-indicator-width",`${u}px`);let d=vr(o);(f.xd.x+p.width)&&o.scrollTo({left:Math.max(0,f.x-16),behavior:"smooth"})},complete(){e.style.removeProperty("--md-indicator-x"),e.style.removeProperty("--md-indicator-width")}}),N([Ye(o),Te(o)]).pipe(U(c)).subscribe(([l,p])=>{let f=_t(o);i.hidden=l.x<16,a.hidden=l.x>f.width-p.width-16}),L(h(i,"click").pipe(m(()=>-1)),h(a,"click").pipe(m(()=>1))).pipe(U(c)).subscribe(l=>{let{width:p}=ue(o);o.scrollBy({left:p*l,behavior:"smooth"})}),r.pipe(U(c),g(l=>n.includes(l))).subscribe(l=>l.click()),o.classList.add("tabbed-labels--linked");for(let l of n){let p=F(`label[for="${l.id}"]`);p.replaceChildren(x("a",{href:`#${p.htmlFor}`,tabIndex:-1},...Array.from(p.childNodes))),h(p.firstElementChild,"click").pipe(U(c),g(f=>!(f.metaKey||f.ctrlKey)),T(f=>{f.preventDefault(),f.stopPropagation()})).subscribe(()=>{history.replaceState({},"",`#${p.htmlFor}`),p.click()})}return D("content.tabs.link")&&s.pipe(Re(1),ee(t)).subscribe(([{active:l},{offset:p}])=>{let f=l.innerText.trim();if(l.hasAttribute("data-md-switching"))l.removeAttribute("data-md-switching");else{let u=e.offsetTop-p.y;for(let v of M("[data-tabs]"))for(let O of M(":scope > input",v)){let J=F(`label[for="${O.id}"]`);if(J!==l&&J.innerText.trim()===f){J.setAttribute("data-md-switching",""),O.click();break}}window.scrollTo({top:e.offsetTop-u});let d=__md_get("__tabs")||[];__md_set("__tabs",[...new Set([f,...d])])}}),s.pipe(U(c)).subscribe(()=>{for(let l of M("audio, video",e))l.offsetWidth&&l.autoplay?l.play().catch(()=>{}):l.pause()}),es(n).pipe(T(l=>s.next(l)),A(()=>s.complete()),m(l=>({ref:e,...l})))}).pipe(Ze(ce))}function Gn(e,t){let{viewport$:r,target$:o,print$:n}=t;return L(...M(".annotate:not(.highlight)",e).map(i=>Fn(i,{target$:o,print$:n})),...M("pre:not(.mermaid) > code",e).map(i=>Dn(i,{target$:o,print$:n})),...M("a",e).map(i=>zn(i,t)),...M("pre.mermaid",e).map(i=>Kn(i)),...M("table:not([class])",e).map(i=>Yn(i)),...M("details",e).map(i=>Vn(i,{target$:o,print$:n})),...M("[data-tabs]",e).map(i=>Bn(i,{viewport$:r,target$:o})),...M("[title]:not([data-preview])",e).filter(()=>D("content.tooltips")).map(i=>Ge(i,{viewport$:r})),...M(".footnote-ref",e).filter(()=>D("content.footnote.tooltips")).map(i=>Dt(i,{content$:new I(a=>{let s=new URL(i.href).hash.slice(1),c=Array.from(document.getElementById(s).cloneNode(!0).children),l=Er(...c);return a.next(l),document.body.append(l),()=>l.remove()}),viewport$:r})))}function ts(e,{alert$:t}){return t.pipe(b(r=>L($(!0),$(!1).pipe(ot(2e3))).pipe(m(o=>({message:r,active:o})))))}function Jn(e,t){let r=F(".md-typeset",e);return H(()=>{let o=new S;return o.subscribe(({message:n,active:i})=>{e.classList.toggle("md-dialog--active",i),r.textContent=n}),ts(e,t).pipe(T(n=>o.next(n)),A(()=>o.complete()),m(n=>({ref:e,...n})))})}var rs=0;function os(e,t){document.body.append(e);let{width:r}=ue(e);e.style.setProperty("--md-tooltip-width",`${r}px`),e.remove();let o=br(t),n=typeof o<"u"?Ye(o):$({x:0,y:0}),i=L(Ke(t),nt(t)).pipe(Q());return N([i,n]).pipe(m(([a,s])=>{let{x:c,y:l}=Qe(t),p=ue(t),f=t.closest("table");return f&&t.parentElement&&(c+=f.offsetLeft+t.parentElement.offsetLeft,l+=f.offsetTop+t.parentElement.offsetTop),{active:a,offset:{x:c-s.x+p.width/2-r/2,y:l-s.y+p.height+8}}}))}function Xn(e){let t=e.title;if(!t.length)return y;let r=`__tooltip_${rs++}`,o=Wt(r,"inline"),n=F(".md-typeset",o);return n.innerHTML=t,H(()=>{let i=new S;return i.subscribe({next({offset:a}){o.style.setProperty("--md-tooltip-x",`${a.x}px`),o.style.setProperty("--md-tooltip-y",`${a.y}px`)},complete(){o.style.removeProperty("--md-tooltip-x"),o.style.removeProperty("--md-tooltip-y")}}),L(i.pipe(g(({active:a})=>a)),i.pipe(_e(250),g(({active:a})=>!a))).subscribe({next({active:a}){a?(e.insertAdjacentElement("afterend",o),e.setAttribute("aria-describedby",r),e.removeAttribute("title")):(o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t))},complete(){o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t)}}),i.pipe(He(16,ge)).subscribe(({active:a})=>{o.classList.toggle("md-tooltip--active",a)}),i.pipe(vt(125,ge),g(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:a})=>a)).subscribe({next(a){a?o.style.setProperty("--md-tooltip-0",`${-a}px`):o.style.removeProperty("--md-tooltip-0")},complete(){o.style.removeProperty("--md-tooltip-0")}}),os(o,e).pipe(T(a=>i.next(a)),A(()=>i.complete()),m(a=>({ref:e,...a})))}).pipe(Ze(ce))}function ns({viewport$:e}){if(!D("header.autohide"))return $(!1);let t=e.pipe(m(({offset:{y:n}})=>n),rt(2,1),m(([n,i])=>[nMath.abs(i-n.y)>100),m(([,[n]])=>n),Q()),o=Be("search");return N([e,o]).pipe(m(([{offset:n},i])=>n.y>400&&!i),Q(),b(n=>n?r:$(!1)),K(!1))}function Zn(e,t){return H(()=>N([Te(e),ns(t)])).pipe(m(([{height:r},o])=>({height:r,hidden:o})),Q((r,o)=>r.height===o.height&&r.hidden===o.hidden),X(1))}function ei(e,{header$:t,main$:r}){return H(()=>{let o=new S,n=o.pipe(re(),ie(!0));o.pipe(oe("active"),$e(t)).subscribe(([{active:a},{hidden:s}])=>{e.classList.toggle("md-header--shadow",a&&!s),e.hidden=s});let i=me(M("[title]",e)).pipe(g(()=>D("content.tooltips")),G(a=>Xn(a)));return r.subscribe(o),t.pipe(U(n),m(a=>({ref:e,...a})),We(i.pipe(U(n))))})}function is(e,{viewport$:t,header$:r}){return xr(e,{viewport$:t,header$:r}).pipe(m(({offset:{y:o}})=>{let{height:n}=ue(e);return{active:n>0&&o>=n}}),oe("active"))}function ti(e,t){return H(()=>{let r=new S;r.subscribe({next({active:n}){e.classList.toggle("md-header__title--active",n)},complete(){e.classList.remove("md-header__title--active")}});let o=fe(".md-content h1");return typeof o>"u"?y:is(o,t).pipe(T(n=>r.next(n)),A(()=>r.complete()),m(n=>({ref:e,...n})))})}function ri(e,{viewport$:t,header$:r}){let o=r.pipe(m(({height:i})=>i),Q()),n=o.pipe(b(()=>Te(e).pipe(m(({height:i})=>({top:e.offsetTop,bottom:e.offsetTop+i})),oe("bottom"))));return N([o,n,t]).pipe(m(([i,{top:a,bottom:s},{offset:{y:c},size:{height:l}}])=>(l=Math.max(0,l-Math.max(0,a-c,i)-Math.max(0,l+c-s)),{offset:a-i,height:l,active:a-i<=c})),Q((i,a)=>i.offset===a.offset&&i.height===a.height&&i.active===a.active))}function as(e){let t=__md_get("__palette")||{index:e.findIndex(n=>matchMedia(n.getAttribute("data-md-color-media")).matches)},r=Math.max(0,Math.min(t.index,e.length-1)),o=!0;return $(...e).pipe(G(n=>h(n,"change").pipe(m(()=>n))),K(e[r]),m(n=>({index:e.indexOf(n),color:{media:n.getAttribute("data-md-color-media"),scheme:n.getAttribute("data-md-color-scheme"),primary:n.getAttribute("data-md-color-primary"),accent:n.getAttribute("data-md-color-accent")}})),m(n=>(o&&(o=!1,t?.color&&(n.color={...n.color,...t.color})),n)),X(1))}function oi(e){let t=M("input",e),r=x("meta",{name:"theme-color"});document.head.appendChild(r);let o=x("meta",{name:"color-scheme"});document.head.appendChild(o);let n=Ut("(prefers-color-scheme: light)");return H(()=>{let i=new S;return i.subscribe(a=>{if(document.body.setAttribute("data-md-color-switching",""),a.color.media==="(prefers-color-scheme)"){let s=matchMedia("(prefers-color-scheme: light)"),c=document.querySelector(s.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");a.color.scheme=c.getAttribute("data-md-color-scheme"),a.color.primary=c.getAttribute("data-md-color-primary"),a.color.accent=c.getAttribute("data-md-color-accent")}for(let[s,c]of Object.entries(a.color))document.body.setAttribute(`data-md-color-${s}`,c);for(let s=0;sa.key==="Enter"),ee(i,(a,s)=>s)).subscribe(({index:a})=>{a=(a+1)%t.length,t[a].click(),t[a].focus()}),i.pipe(m(()=>{let a=Ae("header"),s=window.getComputedStyle(a);return o.content=s.colorScheme,s.backgroundColor.match(/\d+/g).map(c=>(+c).toString(16).padStart(2,"0")).join("")})).subscribe(a=>r.content=`#${a}`),i.pipe(ye(ce)).subscribe(()=>{document.body.removeAttribute("data-md-color-switching")}),as(t).pipe(U(n.pipe(Re(1))),bt(),T(a=>i.next(a)),A(()=>i.complete()),m(a=>({ref:e,...a})))})}function ni(e,{progress$:t}){return H(()=>{let r=new S;return r.subscribe(({value:o})=>{e.style.setProperty("--md-progress-value",`${o}`)}),t.pipe(T(o=>r.next({value:o})),A(()=>r.complete()),m(o=>({ref:e,value:o})))})}function ii(e,t){return e.protocol=t.protocol,e.hostname=t.hostname,e}function ss(e,t){let r=new Map;for(let o of M("url",e)){let n=F("loc",o),i=[ii(new URL(n.textContent),t)];r.set(`${i[0]}`,i);for(let a of M("[rel=alternate]",o)){let s=a.getAttribute("href");s!=null&&i.push(ii(new URL(s),t))}}return r}function Ct(e){return dn(new URL("sitemap.xml",e)).pipe(m(t=>ss(t,new URL(e))),be(()=>$(new Map)),le())}function ai({document$:e}){let t=new Map;e.pipe(b(()=>M("link[rel=alternate]")),m(r=>new URL(r.href)),g(r=>!t.has(r.toString())),G(r=>Ct(r).pipe(m(o=>[r,o]),be(()=>y)))).subscribe(([r,o])=>{t.set(r.toString().replace(/\/$/,""),o)}),h(document.body,"click").pipe(g(r=>!r.metaKey&&!r.ctrlKey),b(r=>{if(r.target instanceof Element){let o=r.target.closest("a");if(o&&!o.target){let n=[...t].find(([f])=>o.href.startsWith(`${f}/`));if(typeof n>"u")return y;let[i,a]=n,s=Ee();if(s.href.startsWith(i))return y;let c=we(),l=s.href.replace(c.base,"");l=`${i}/${l}`;let p=a.has(l.split("#")[0])?new URL(l,c.base):new URL(i);return r.preventDefault(),$(p)}}return y})).subscribe(r=>at(r,!0))}var no=Ht(ro());function cs(e){e.setAttribute("data-md-copying","");let t=e.closest("[data-copy]"),r=t?t.getAttribute("data-copy"):e.innerText;return e.removeAttribute("data-md-copying"),r.trimEnd()}function si({alert$:e}){no.default.isSupported()&&new I(t=>{new no.default("[data-clipboard-target], [data-clipboard-text]",{text:r=>r.getAttribute("data-clipboard-text")||cs(F(r.getAttribute("data-clipboard-target")))}).on("success",r=>t.next(r))}).pipe(T(t=>{t.trigger.focus()}),m(()=>Oe("clipboard.copied"))).subscribe(e)}function ci(e,t){if(!(e.target instanceof Element))return y;let r=e.target.closest("a");if(r===null)return y;if(r.closest('[data-md-component="i18n"]'))return y;if(r.target||e.metaKey||e.ctrlKey)return y;let o=new URL(r.href);return o.search=o.hash="",t.has(`${o}`)?(e.preventDefault(),$(r)):y}function li(e){let t=new Map;for(let r of M(":scope > *",e.head))t.set(r.outerHTML,r);return t}function pi(e){for(let t of M("[href], [src]",e))for(let r of["href","src"]){let o=t.getAttribute(r);if(o&&!/^(?:[a-z]+:)?\/\//i.test(o)){t[r]=t[r];break}}return $(e)}function ls(){let e=document.documentElement.lang;e&&document.querySelectorAll('[data-md-component="i18n"] .md-select__link').forEach(t=>{t.classList.remove("md-select__link--active"),t.getAttribute("hreflang")===e&&t.classList.add("md-select__link--active")})}function ps(e){for(let o of["[data-md-component=announce]","[data-md-component=container]","[data-md-component=header-topic]","[data-md-component=outdated]","[data-md-component=logo]","[data-md-component=skip]",...D("navigation.tabs.sticky")?["[data-md-component=tabs]"]:[]]){let n=fe(o),i=fe(o,e);typeof n<"u"&&typeof i<"u"&&n.replaceWith(i)}let t=li(document);for(let[o,n]of li(e))t.has(o)?t.delete(o):document.head.appendChild(n);for(let o of t.values()){let n=o.getAttribute("name");n!=="theme-color"&&n!=="color-scheme"&&o.remove()}let r=Ae("container");return ze(M("script",r)).pipe(b(o=>{let n=e.createElement("script");if(o.src){for(let i of o.getAttributeNames())n.setAttribute(i,o.getAttribute(i));return o.replaceWith(n),new I(i=>{n.onload=()=>i.complete()})}else return n.textContent=o.textContent,o.replaceWith(n),y}),re(),ie(document),T(()=>ls()))}function mi({sitemap$:e,location$:t,viewport$:r,progress$:o}){if(location.protocol==="file:")return y;$(document).subscribe(pi);let n=h(document.body,"click").pipe($e(e),b(([s,c])=>ci(s,c)),m(({href:s})=>new URL(s)),le()),i=h(window,"popstate").pipe(m(Ee),le());n.pipe(ee(r)).subscribe(([s,{offset:c}])=>{history.replaceState(c,""),history.pushState(null,"",s)}),L(n,i).subscribe(t);let a=t.pipe(oe("pathname"),b(s=>yr(s,{progress$:o}).pipe(be(()=>(at(s,!0),y)))),b(pi),b(ps),le());return L(a.pipe(ee(t,(s,c)=>c)),a.pipe(b(()=>t),oe("hash")),t.pipe(Q((s,c)=>s.pathname===c.pathname&&s.hash===c.hash),b(()=>n),T(()=>history.back()))).subscribe(s=>{history.state!==null||!s.hash?window.scrollTo(0,history.state?.y??0):(history.scrollRestoration="auto",mn(s.hash),history.scrollRestoration="manual")}),t.subscribe(()=>{history.scrollRestoration="manual"}),h(window,"beforeunload").subscribe(()=>{history.scrollRestoration="auto"}),r.pipe(oe("offset"),_e(100)).subscribe(({offset:s})=>{history.replaceState(s,"")}),D("navigation.instant.prefetch")&&L(h(document.body,"mousemove"),h(document.body,"focusin")).pipe($e(e),b(([s,c])=>ci(s,c)),_e(25),Nr(({href:s})=>s),dr(s=>{let c=document.createElement("link");return c.rel="prefetch",c.href=s.toString(),document.head.appendChild(c),h(c,"load").pipe(m(()=>c),xe(1))})).subscribe(s=>s.remove()),a}var fi=Ht(Xr());function ui(e){let t=e.separator.split("|").map(n=>n.replace(/(\(\?[!=<][^)]+\))/g,"").length===0?"\uFFFD":n).join("|"),r=new RegExp(t,"img"),o=(n,i,a)=>`${i}${a}`;return n=>{n=n.replace(/[\s*+\-:~^]+/g," ").replace(/&/g,"&").trim();let i=new RegExp(`(^|${e.separator}|)(${n.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return a=>(0,fi.default)(a).replace(i,o).replace(/<\/mark>(\s+)]*>/img,"$1")}}function Nt(e){return e.type===1}function Sr(e){return e.type===3}function di(e,t){let r=xn(e);return L($(location.protocol!=="file:"),Be("search")).pipe(Pe(o=>o),b(()=>t)).subscribe(({config:o,docs:n})=>r.next({type:0,data:{config:o,docs:n,options:{suggest:D("search.suggest")}}})),r}function hi(e){let{selectedVersionSitemap:t,selectedVersionBaseURL:r,currentLocation:o,currentBaseURL:n}=e,i=io(n)?.pathname;if(i===void 0)return;let a=us(o.pathname,i);if(a===void 0)return;let s=hs(t.keys());if(!t.has(s))return;let c=io(a,s);if(!c||!t.has(c.href))return;let l=io(a,r);if(l)return l.hash=o.hash,l.search=o.search,l}function io(e,t){try{return new URL(e,t)}catch{return}}function us(e,t){if(e.startsWith(t))return e.slice(t.length)}function ds(e,t){let r=Math.min(e.length,t.length),o;for(o=0;oy)),o=r.pipe(m(n=>{let[,i]=t.base.match(/([^/]+)\/?$/);return n.find(({version:a,aliases:s})=>a===i||s.includes(i))||n[0]}));r.pipe(m(n=>new Map(n.map(i=>[`${new URL(`../${i.version}/`,t.base)}`,i]))),b(n=>h(document.body,"click").pipe(g(i=>!i.metaKey&&!i.ctrlKey),ee(o),b(([i,a])=>{if(i.target instanceof Element){let s=i.target.closest("a");if(s&&!s.target&&n.has(s.href)){let c=s.href;return!i.target.closest(".md-version")&&n.get(c)===a?y:(i.preventDefault(),$(new URL(c)))}}return y}),b(i=>Ct(i).pipe(m(a=>hi({selectedVersionSitemap:a,selectedVersionBaseURL:i,currentLocation:Ee(),currentBaseURL:t.base})??i)))))).subscribe(n=>at(n,!0)),N([r,o]).subscribe(([n,i])=>{F(".md-header__topic").appendChild($n(n,i))}),e.pipe(b(()=>o)).subscribe(n=>{let i=new URL(t.base),a=__md_get("__outdated",sessionStorage,i);if(a===null){a=!0;let s=t.version?.default||"latest";Array.isArray(s)||(s=[s]);e:for(let c of s)for(let l of n.aliases.concat(n.version))if(new RegExp(c,"i").test(l)){a=!1;break e}__md_set("__outdated",a,sessionStorage,i)}if(a)for(let s of pe("outdated"))s.hidden=!1})}function bs(e,{worker$:t}){let{searchParams:r}=Ee();r.has("q")&&(it("search",!0),e.value=r.get("q"),e.focus(),Be("search").pipe(Pe(i=>!i)).subscribe(()=>{let i=Ee();i.searchParams.delete("q"),history.replaceState({},"",`${i}`)}));let o=Ke(e),n=L(t.pipe(Pe(Nt)),h(e,"keyup"),o).pipe(m(()=>e.value),Q());return N([n,o]).pipe(m(([i,a])=>({value:i,focus:a})),X(1))}function vi(e,{worker$:t}){let r=new S,o=r.pipe(re(),ie(!0));N([t.pipe(Pe(Nt)),r],(i,a)=>a).pipe(oe("value")).subscribe(({value:i})=>t.next({type:2,data:i})),r.pipe(oe("focus")).subscribe(({focus:i})=>{i&&it("search",i)}),h(e.form,"reset").pipe(U(o)).subscribe(()=>e.focus());let n=F("header [for=__search]");return h(n,"click").subscribe(()=>e.focus()),bs(e,{worker$:t}).pipe(T(i=>r.next(i)),A(()=>r.complete()),m(i=>({ref:e,...i})),X(1))}function gi(e,{worker$:t,query$:r}){let o=new S,n=an(e.parentElement).pipe(g(Boolean)),i=e.parentElement,a=F(":scope > :first-child",e),s=F(":scope > :last-child",e);Be("search").subscribe(p=>{s.setAttribute("role",p?"list":"presentation"),s.hidden=!p}),o.pipe(ee(r),Kr(t.pipe(Pe(Nt)))).subscribe(([{items:p},{value:f}])=>{switch(p.length){case 0:a.textContent=f.length?Oe("search.result.none"):Oe("search.result.placeholder");break;case 1:a.textContent=Oe("search.result.one");break;default:let u=hr(p.length);a.textContent=Oe("search.result.other",u)}});let c=o.pipe(T(()=>s.innerHTML=""),b(({items:p})=>L($(...p.slice(0,10)),$(...p.slice(10)).pipe(rt(4),Yr(n),b(([f])=>f)))),m(Cn),le());return c.subscribe(p=>s.appendChild(p)),c.pipe(G(p=>{let f=fe("details",p);return typeof f>"u"?y:h(f,"toggle").pipe(U(o),m(()=>f))})).subscribe(p=>{p.open===!1&&p.offsetTop<=i.scrollTop&&i.scrollTo({top:p.offsetTop})}),t.pipe(g(Sr),m(({data:p})=>p)).pipe(T(p=>o.next(p)),A(()=>o.complete()),m(p=>({ref:e,...p})))}function vs(e,{query$:t}){return t.pipe(m(({value:r})=>{let o=Ee();return o.hash="",r=r.replace(/\s+/g,"+").replace(/&/g,"%26").replace(/=/g,"%3D"),o.search=`q=${r}`,{url:o}}))}function yi(e,t){let r=new S,o=r.pipe(re(),ie(!0));return r.subscribe(({url:n})=>{e.setAttribute("data-clipboard-text",e.href),e.href=`${n}`}),h(e,"click").pipe(U(o)).subscribe(n=>n.preventDefault()),vs(e,t).pipe(T(n=>r.next(n)),A(()=>r.complete()),m(n=>({ref:e,...n})))}function xi(e,{worker$:t,keyboard$:r}){let o=new S,n=Ae("search-query"),i=L(h(n,"keydown"),h(n,"focus")).pipe(ye(ce),m(()=>n.value),Q());return o.pipe($e(i),m(([{suggest:s},c])=>{let l=c.split(/([\s-]+)/);if(s?.length&&l[l.length-1]){let p=s[s.length-1];p.startsWith(l[l.length-1])&&(l[l.length-1]=p)}else l.length=0;return l})).subscribe(s=>e.textContent=s.join("")),r.pipe(g(({mode:s})=>s==="search")).subscribe(s=>{s.type==="ArrowRight"&&e.innerText.length&&n.selectionStart===n.value.length&&(n.value=e.innerText)}),t.pipe(g(Sr),m(({data:s})=>s)).pipe(T(s=>o.next(s)),A(()=>o.complete()),m(()=>({ref:e})))}function Ei(e,{index$:t,keyboard$:r}){let o=we();try{let n=di(o.search,t),i=Ae("search-query",e),a=Ae("search-result",e);h(e,"click").pipe(g(({target:c})=>c instanceof Element&&!!c.closest("a"))).subscribe(()=>it("search",!1)),r.pipe(g(({mode:c})=>c==="search")).subscribe(c=>{let l=De();switch(c.type){case"Enter":if(l===i){let p=new Map;for(let f of M(":first-child [href]",a)){let u=f.firstElementChild;p.set(f,parseFloat(u.getAttribute("data-md-score")))}if(p.size){let[[f]]=[...p].sort(([,u],[,d])=>d-u);f.click()}c.claim()}break;case"Escape":case"Tab":it("search",!1),i.blur();break;case"ArrowUp":case"ArrowDown":if(typeof l>"u")i.focus();else{let p=[i,...M(":not(details) > [href], summary, details[open] [href]",a)],f=Math.max(0,(Math.max(0,p.indexOf(l))+p.length+(c.type==="ArrowUp"?-1:1))%p.length);p[f].focus()}c.claim();break;default:i!==De()&&i.focus()}}),r.pipe(g(({mode:c})=>c==="global")).subscribe(c=>{switch(c.type){case"f":case"s":case"/":i.focus(),i.select(),c.claim();break}});let s=vi(i,{worker$:n});return L(s,gi(a,{worker$:n,query$:s})).pipe(We(...pe("search-share",e).map(c=>yi(c,{query$:s})),...pe("search-suggest",e).map(c=>xi(c,{worker$:n,keyboard$:r}))))}catch{return e.hidden=!0,et}}function wi(e,{index$:t,location$:r}){return N([t,r.pipe(K(Ee()),g(o=>!!o.searchParams.get("h")))]).pipe(m(([o,n])=>ui(o.config)(n.searchParams.get("h"))),m(o=>{let n=new Map,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(let a=i.nextNode();a;a=i.nextNode())if(a.parentElement?.offsetHeight){let s=a.textContent,c=o(s);c.length>s.length&&n.set(a,c)}for(let[a,s]of n){let{childNodes:c}=x("span",null,s);a.replaceWith(...Array.from(c))}return{ref:e,nodes:n}}))}function gs(e,{viewport$:t,main$:r}){let o=e.closest(".md-grid"),n=o.offsetTop-o.parentElement.offsetTop;return N([r,t]).pipe(m(([{offset:i,height:a},{offset:{y:s}}])=>(a=a+Math.min(n,Math.max(0,s-i))-n,{height:a,locked:s>=i+n})),Q((i,a)=>i.height===a.height&&i.locked===a.locked))}function ao(e,{header$:t,...r}){let o=F(".md-sidebar__scrollwrap",e),{y:n}=Qe(o);return H(()=>{let i=new S,a=i.pipe(re(),ie(!0)),s=i.pipe(He(0,ge));return s.pipe(ee(t)).subscribe({next([{height:c},{height:l}]){o.style.height=`${c-2*n}px`,e.style.top=`${l}px`},complete(){o.style.height="",e.style.top=""}}),s.pipe(Pe()).subscribe(()=>{for(let c of M(".md-nav__link--active[href]",e)){if(!c.clientHeight)continue;let l=c.closest(".md-sidebar__scrollwrap");if(typeof l<"u"){let p=c.offsetTop-l.offsetTop,{height:f}=ue(l);l.scrollTo({top:p-f/2})}}}),me(M("label[tabindex]",e)).pipe(G(c=>h(c,"click").pipe(ye(ce),m(()=>c),U(a)))).subscribe(c=>{let l=F(`[id="${c.htmlFor}"]`);F(`[aria-labelledby="${c.id}"]`).setAttribute("aria-expanded",`${l.checked}`)}),D("content.tooltips")&&me(M("abbr[title]",e)).pipe(G(c=>Ge(c,{viewport$})),U(a)).subscribe(),gs(e,r).pipe(T(c=>i.next(c)),A(()=>i.complete()),m(c=>({ref:e,...c})))})}function Si(e,t){if(typeof t<"u"){let r=`https://api.github.com/repos/${e}/${t}`;return tt(Ve(`${r}/releases/latest`).pipe(be(()=>y),m(o=>({version:o.tag_name})),qe({})),Ve(r).pipe(be(()=>y),m(o=>({stars:o.stargazers_count,forks:o.forks_count})),qe({}))).pipe(m(([o,n])=>({...o,...n})))}else{let r=`https://api.github.com/users/${e}`;return Ve(r).pipe(m(o=>({repositories:o.public_repos})),qe({}))}}function Ti(e,t){let r=`https://${e}/api/v4/projects/${encodeURIComponent(t)}`;return tt(Ve(`${r}/releases/permalink/latest`).pipe(be(()=>y),m(({tag_name:o})=>({version:o})),qe({})),Ve(r).pipe(be(()=>y),m(({star_count:o,forks_count:n})=>({stars:o,forks:n})),qe({}))).pipe(m(([o,n])=>({...o,...n})))}function Oi(e){let t=e.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i);if(t){let[,r,o]=t;return Si(r,o)}if(t=e.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i),t){let[,r,o]=t;return Ti(r,o)}return y}var ys;function xs(e){return ys||(ys=H(()=>{let t=__md_get("__source",sessionStorage);if(t)return $(t);if(pe("consent").length){let o=__md_get("__consent");if(!(o&&o.github))return y}return Oi(e.href).pipe(T(o=>__md_set("__source",o,sessionStorage)))}).pipe(be(()=>y),g(t=>Object.keys(t).length>0),m(t=>({facts:t})),X(1)))}function Li(e){let t=F(":scope > :last-child",e);return H(()=>{let r=new S;return r.subscribe(({facts:o})=>{t.appendChild(kn(o)),t.classList.add("md-source__repository--active")}),xs(e).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))})}function Es(e,{viewport$:t,header$:r}){return Te(document.body).pipe(b(()=>xr(e,{header$:r,viewport$:t})),m(({offset:{y:o}})=>({hidden:o>=10})),oe("hidden"))}function Mi(e,t){return H(()=>{let r=new S;return r.subscribe({next({hidden:o}){e.hidden=o},complete(){e.hidden=!1}}),(D("navigation.tabs.sticky")?$({hidden:!1}):Es(e,t)).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))})}function ws(e,{viewport$:t,header$:r}){let o=new Map,n=M(".md-nav__link",e);for(let s of n){let c=decodeURIComponent(s.hash.substring(1)),l=fe(`[id="${c}"]`);typeof l<"u"&&o.set(s,l)}let i=r.pipe(oe("height"),m(({height:s})=>{let c=Ae("main"),l=F(":scope > :first-child",c);return s+.8*(l.offsetTop-c.offsetTop)}),le());return Te(document.body).pipe(oe("height"),b(s=>H(()=>{let c=[];return $([...o].reduce((l,[p,f])=>{for(;c.length&&o.get(c[c.length-1]).tagName>=f.tagName;)c.pop();let u=f.offsetTop;for(;!u&&f.parentElement;)f=f.parentElement,u=f.offsetTop;let d=f.offsetParent;for(;d;d=d.offsetParent)u+=d.offsetTop;return l.set([...c=[...c,p]].reverse(),u)},new Map))}).pipe(m(c=>new Map([...c].sort(([,l],[,p])=>l-p))),$e(i),b(([c,l])=>t.pipe(jt(([p,f],{offset:{y:u},size:d})=>{let v=u+d.height>=Math.floor(s.height);for(;f.length;){let[,O]=f[0];if(O-l=u&&!v)f=[p.pop(),...f];else break}return[p,f]},[[],[...c]]),Q((p,f)=>p[0]===f[0]&&p[1]===f[1])))))).pipe(m(([s,c])=>({prev:s.map(([l])=>l),next:c.map(([l])=>l)})),K({prev:[],next:[]}),rt(2,1),m(([s,c])=>s.prev.length{let i=new S,a=i.pipe(re(),ie(!0));if(i.subscribe(({prev:s,next:c})=>{for(let[l]of c)l.classList.remove("md-nav__link--passed"),l.classList.remove("md-nav__link--active");for(let[l,[p]]of s.entries())p.classList.add("md-nav__link--passed"),p.classList.toggle("md-nav__link--active",l===s.length-1)}),D("toc.follow")){let s=L(t.pipe(_e(1),m(()=>{})),t.pipe(_e(250),m(()=>"smooth")));i.pipe(g(({prev:c})=>c.length>0),$e(o.pipe(ye(ce))),ee(s)).subscribe(([[{prev:c}],l])=>{let[p]=c[c.length-1];if(p.offsetHeight){let f=br(p);if(typeof f<"u"){let u=p.offsetTop-f.offsetTop,{height:d}=ue(f);f.scrollTo({top:u-d/2,behavior:l})}}})}return D("navigation.tracking")&&t.pipe(U(a),oe("offset"),_e(250),Re(1),U(n.pipe(Re(1))),bt({delay:250}),ee(i)).subscribe(([,{prev:s}])=>{let c=Ee(),l=s[s.length-1];if(l&&l.length){let[p]=l,{hash:f}=new URL(p.href);c.hash!==f&&(c.hash=f,history.replaceState({},"",`${c}`))}else c.hash="",history.replaceState({},"",`${c}`)}),ws(e,{viewport$:t,header$:r}).pipe(T(s=>i.next(s)),A(()=>i.complete()),m(s=>({ref:e,...s})))})}function Ss(e,{viewport$:t,main$:r,target$:o}){let n=t.pipe(m(({offset:{y:a}})=>a),rt(2,1),m(([a,s])=>a>s&&s>0),Q()),i=r.pipe(m(({active:a})=>a));return N([i,n]).pipe(m(([a,s])=>!(a&&s)),Q(),U(o.pipe(Re(1))),ie(!0),bt({delay:250}),m(a=>({hidden:a})))}function Ai(e,{viewport$:t,header$:r,main$:o,target$:n}){let i=new S,a=i.pipe(re(),ie(!0));return i.subscribe({next({hidden:s}){e.hidden=s,s?(e.setAttribute("tabindex","-1"),e.blur()):e.removeAttribute("tabindex")},complete(){e.style.top="",e.hidden=!0,e.removeAttribute("tabindex")}}),r.pipe(U(a),oe("height")).subscribe(({height:s})=>{e.style.top=`${s+16}px`}),h(e,"click").subscribe(s=>{s.preventDefault(),window.scrollTo({top:0})}),Ss(e,{viewport$:t,main$:o,target$:n}).pipe(T(s=>i.next(s)),A(()=>i.complete()),m(s=>({ref:e,...s})))}function Ci({document$:e,viewport$:t}){e.pipe(b(()=>M(".md-ellipsis")),G(r=>pt(r).pipe(U(e.pipe(Re(1))),g(o=>o),m(()=>r),xe(1))),g(r=>r.offsetWidth{let o=r.innerText,n=r.closest("a")||r;return n.title=o,D("content.tooltips")?Ge(n,{viewport$:t}).pipe(U(e.pipe(Re(1))),A(()=>n.removeAttribute("title"))):y})).subscribe(),D("content.tooltips")&&e.pipe(b(()=>M(".md-status")),G(r=>Ge(r,{viewport$:t}))).subscribe()}function ki({document$:e,tablet$:t}){e.pipe(b(()=>M(".md-toggle--indeterminate")),T(r=>{r.indeterminate=!0,r.checked=!1}),G(r=>h(r,"change").pipe(Qr(()=>r.classList.contains("md-toggle--indeterminate")),m(()=>r))),ee(t)).subscribe(([r,o])=>{r.classList.remove("md-toggle--indeterminate"),o&&(r.checked=!1)})}function Ts(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}function Hi({document$:e}){e.pipe(b(()=>M("[data-md-scrollfix]")),T(t=>t.removeAttribute("data-md-scrollfix")),g(Ts),G(t=>h(t,"touchstart").pipe(m(()=>t)))).subscribe(t=>{let r=t.scrollTop;r===0?t.scrollTop=1:r+t.offsetHeight===t.scrollHeight&&(t.scrollTop=r-1)})}function $i({viewport$:e,tablet$:t}){N([Be("search"),t]).pipe(m(([r,o])=>r&&!o),b(r=>$(r).pipe(ot(r?400:100))),ee(e)).subscribe(([r,{offset:{y:o}}])=>{if(r)document.body.setAttribute("data-md-scrolllock",""),document.body.style.top=`-${o}px`;else{let n=-1*parseInt(document.body.style.top,10);document.body.removeAttribute("data-md-scrolllock"),document.body.style.top="",n&&window.scrollTo(0,n)}})}Object.entries||(Object.entries=function(e){let t=[];for(let r of Object.keys(e))t.push([r,e[r]]);return t});Object.values||(Object.values=function(e){let t=[];for(let r of Object.keys(e))t.push(e[r]);return t});typeof Element<"u"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(e,t){typeof e=="object"?(this.scrollLeft=e.left,this.scrollTop=e.top):(this.scrollLeft=e,this.scrollTop=t)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...e){let t=this.parentNode;if(t){e.length===0&&t.removeChild(this);for(let r=e.length-1;r>=0;r--){let o=e[r];typeof o=="string"?o=document.createTextNode(o):o.parentNode&&o.parentNode.removeChild(o),r?t.insertBefore(this.previousSibling,o):t.replaceChild(o,this)}}}));function Os(){return location.protocol==="file:"?Mt(`${new URL("search/search_index.js",qt.base)}`).pipe(m(()=>__index),X(1)):Ve(new URL(qt.search_index||"search/search_index.json",qt.base))}document.documentElement.classList.remove("no-js");document.documentElement.classList.add("js");var st=Xo(),Kt=ln(),kt=fn(Kt),so=cn(),Ce=yn(),Tr=Ut("(min-width: 60em)"),Pi=Ut("(min-width: 76.25em)"),Ri=un(),qt=we(),Ii=document.forms.namedItem("search")?Os():et,co=new S;si({alert$:co});ai({document$:st});var lo=new S,Fi=Ct(qt.base);D("navigation.instant")&&mi({sitemap$:Fi,location$:Kt,viewport$:Ce,progress$:lo}).subscribe(st);qt.version?.provider==="mike"&&bi({document$:st});L(Kt,kt).pipe(ot(125)).subscribe(()=>{it("drawer",!1),it("search",!1)});so.pipe(g(({mode:e})=>e==="global")).subscribe(e=>{switch(e.type){case"p":case",":let t=fe("link[rel=prev]");typeof t<"u"&&at(t);break;case"n":case".":let r=fe("link[rel=next]");typeof r<"u"&&at(r);break;case"Enter":let o=De();o instanceof HTMLLabelElement&&o.click()}});Ci({viewport$:Ce,document$:st});ki({document$:st,tablet$:Tr});Hi({document$:st});$i({viewport$:Ce,tablet$:Tr});var mt=Zn(Ae("header"),{viewport$:Ce}),zt=st.pipe(m(()=>Ae("main")),b(e=>ri(e,{viewport$:Ce,header$:mt})),X(1)),Ls=L(...pe("consent").map(e=>wn(e,{target$:kt})),...pe("dialog").map(e=>Jn(e,{alert$:co})),...pe("palette").map(e=>oi(e)),...pe("progress").map(e=>ni(e,{progress$:lo})),...pe("search").map(e=>Ei(e,{index$:Ii,keyboard$:so})),...pe("source").map(e=>Li(e))),Ms=H(()=>L(...pe("announce").map(e=>En(e)),...pe("content").map(e=>Gn(e,{sitemap$:Fi,viewport$:Ce,target$:kt,print$:Ri})),...pe("content").map(e=>D("search.highlight")?wi(e,{index$:Ii,location$:Kt}):y),...pe("header").map(e=>ei(e,{viewport$:Ce,header$:mt,main$:zt})),...pe("header-title").map(e=>ti(e,{viewport$:Ce,header$:mt})),...pe("sidebar").map(e=>e.getAttribute("data-md-type")==="navigation"?Gr(Pi,()=>ao(e,{viewport$:Ce,header$:mt,main$:zt})):Gr(Tr,()=>ao(e,{viewport$:Ce,header$:mt,main$:zt}))),...pe("tabs").map(e=>Mi(e,{viewport$:Ce,header$:mt})),...pe("toc").map(e=>_i(e,{viewport$:Ce,header$:mt,main$:zt,target$:kt})),...pe("top").map(e=>Ai(e,{viewport$:Ce,header$:mt,main$:zt,target$:kt})))),ji=st.pipe(b(()=>Ms),We(Ls),X(1));ji.subscribe();window.document$=st;window.location$=Kt;window.target$=kt;window.keyboard$=so;window.viewport$=Ce;window.tablet$=Tr;window.screen$=Pi;window.print$=Ri;window.alert$=co;window.progress$=lo;window.component$=ji;})(); +`;var Sr,Za=0;function es(){let e=window.docsforge?.mermaidUrl,t=typeof e=="string"&&e?e:"https://unpkg.com/mermaid@11/dist/mermaid.min.js";return typeof mermaid>"u"||mermaid instanceof Element?Mt(t):$(void 0)}function Kn(e){return e.classList.remove("mermaid"),Sr||(Sr=es().pipe(T(()=>mermaid.initialize({startOnLoad:!1,themeCSS:qn,sequence:{actorFontSize:"16px",messageFontSize:"16px",noteFontSize:"16px"}})),m(()=>{}),X(1))),Sr.subscribe(async()=>{e.classList.add("mermaid");let t=`__mermaid_${Za++}`,r=x("div",{class:"mermaid"}),o=e.textContent,{svg:n,fn:i}=await mermaid.render(t,o),a=r.attachShadow({mode:"closed"});a.innerHTML=n,e.replaceWith(r),i?.(a)}),Sr.pipe(m(()=>({ref:e})))}var Qn=x("table");function Yn(e){return e.replaceWith(Qn),Qn.replaceWith(Hn(e)),$({ref:e})}function ts(e){let t=e.find(r=>r.checked)||e[0];return L(...e.map(r=>h(r,"change").pipe(m(()=>F(`label[for="${r.id}"]`))))).pipe(K(F(`label[for="${t.id}"]`)),m(r=>({active:r})))}function Bn(e,{viewport$:t,target$:r}){let o=F(".tabbed-labels",e),n=M(":scope > input",e),i=to("prev");e.append(i);let a=to("next");return e.append(a),H(()=>{let s=new S,c=s.pipe(re(),ie(!0));N([s,Te(e),pt(e)]).pipe(U(c),He(1,ge)).subscribe({next([{active:l},p]){let f=Qe(l),{width:u}=ue(l);e.style.setProperty("--md-indicator-x",`${f.x}px`),e.style.setProperty("--md-indicator-width",`${u}px`);let d=vr(o);(f.xd.x+p.width)&&o.scrollTo({left:Math.max(0,f.x-16),behavior:"smooth"})},complete(){e.style.removeProperty("--md-indicator-x"),e.style.removeProperty("--md-indicator-width")}}),N([Ye(o),Te(o)]).pipe(U(c)).subscribe(([l,p])=>{let f=_t(o);i.hidden=l.x<16,a.hidden=l.x>f.width-p.width-16}),L(h(i,"click").pipe(m(()=>-1)),h(a,"click").pipe(m(()=>1))).pipe(U(c)).subscribe(l=>{let{width:p}=ue(o);o.scrollBy({left:p*l,behavior:"smooth"})}),r.pipe(U(c),g(l=>n.includes(l))).subscribe(l=>l.click()),o.classList.add("tabbed-labels--linked");for(let l of n){let p=F(`label[for="${l.id}"]`);p.replaceChildren(x("a",{href:`#${p.htmlFor}`,tabIndex:-1},...Array.from(p.childNodes))),h(p.firstElementChild,"click").pipe(U(c),g(f=>!(f.metaKey||f.ctrlKey)),T(f=>{f.preventDefault(),f.stopPropagation()})).subscribe(()=>{history.replaceState({},"",`#${p.htmlFor}`),p.click()})}return D("content.tabs.link")&&s.pipe(Re(1),ee(t)).subscribe(([{active:l},{offset:p}])=>{let f=l.innerText.trim();if(l.hasAttribute("data-md-switching"))l.removeAttribute("data-md-switching");else{let u=e.offsetTop-p.y;for(let v of M("[data-tabs]"))for(let O of M(":scope > input",v)){let J=F(`label[for="${O.id}"]`);if(J!==l&&J.innerText.trim()===f){J.setAttribute("data-md-switching",""),O.click();break}}window.scrollTo({top:e.offsetTop-u});let d=__md_get("__tabs")||[];__md_set("__tabs",[...new Set([f,...d])])}}),s.pipe(U(c)).subscribe(()=>{for(let l of M("audio, video",e))l.offsetWidth&&l.autoplay?l.play().catch(()=>{}):l.pause()}),ts(n).pipe(T(l=>s.next(l)),A(()=>s.complete()),m(l=>({ref:e,...l})))}).pipe(Ze(ce))}function Gn(e,t){let{viewport$:r,target$:o,print$:n}=t;return L(...M(".annotate:not(.highlight)",e).map(i=>Fn(i,{target$:o,print$:n})),...M("pre:not(.mermaid) > code",e).map(i=>Dn(i,{target$:o,print$:n})),...M("a",e).map(i=>zn(i,t)),...M("pre.mermaid",e).map(i=>Kn(i)),...M("table:not([class])",e).map(i=>Yn(i)),...M("details",e).map(i=>Vn(i,{target$:o,print$:n})),...M("[data-tabs]",e).map(i=>Bn(i,{viewport$:r,target$:o})),...M("[title]:not([data-preview])",e).filter(()=>D("content.tooltips")).map(i=>Ge(i,{viewport$:r})),...M(".footnote-ref",e).filter(()=>D("content.footnote.tooltips")).map(i=>Dt(i,{content$:new I(a=>{let s=new URL(i.href).hash.slice(1),c=Array.from(document.getElementById(s).cloneNode(!0).children),l=Er(...c);return a.next(l),document.body.append(l),()=>l.remove()}),viewport$:r})))}function rs(e,{alert$:t}){return t.pipe(b(r=>L($(!0),$(!1).pipe(ot(2e3))).pipe(m(o=>({message:r,active:o})))))}function Jn(e,t){let r=F(".md-typeset",e);return H(()=>{let o=new S;return o.subscribe(({message:n,active:i})=>{e.classList.toggle("md-dialog--active",i),r.textContent=n}),rs(e,t).pipe(T(n=>o.next(n)),A(()=>o.complete()),m(n=>({ref:e,...n})))})}var os=0;function ns(e,t){document.body.append(e);let{width:r}=ue(e);e.style.setProperty("--md-tooltip-width",`${r}px`),e.remove();let o=br(t),n=typeof o<"u"?Ye(o):$({x:0,y:0}),i=L(Ke(t),nt(t)).pipe(Q());return N([i,n]).pipe(m(([a,s])=>{let{x:c,y:l}=Qe(t),p=ue(t),f=t.closest("table");return f&&t.parentElement&&(c+=f.offsetLeft+t.parentElement.offsetLeft,l+=f.offsetTop+t.parentElement.offsetTop),{active:a,offset:{x:c-s.x+p.width/2-r/2,y:l-s.y+p.height+8}}}))}function Xn(e){let t=e.title;if(!t.length)return y;let r=`__tooltip_${os++}`,o=Wt(r,"inline"),n=F(".md-typeset",o);return n.innerHTML=t,H(()=>{let i=new S;return i.subscribe({next({offset:a}){o.style.setProperty("--md-tooltip-x",`${a.x}px`),o.style.setProperty("--md-tooltip-y",`${a.y}px`)},complete(){o.style.removeProperty("--md-tooltip-x"),o.style.removeProperty("--md-tooltip-y")}}),L(i.pipe(g(({active:a})=>a)),i.pipe(_e(250),g(({active:a})=>!a))).subscribe({next({active:a}){a?(e.insertAdjacentElement("afterend",o),e.setAttribute("aria-describedby",r),e.removeAttribute("title")):(o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t))},complete(){o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t)}}),i.pipe(He(16,ge)).subscribe(({active:a})=>{o.classList.toggle("md-tooltip--active",a)}),i.pipe(vt(125,ge),g(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:a})=>a)).subscribe({next(a){a?o.style.setProperty("--md-tooltip-0",`${-a}px`):o.style.removeProperty("--md-tooltip-0")},complete(){o.style.removeProperty("--md-tooltip-0")}}),ns(o,e).pipe(T(a=>i.next(a)),A(()=>i.complete()),m(a=>({ref:e,...a})))}).pipe(Ze(ce))}function is({viewport$:e}){if(!D("header.autohide"))return $(!1);let t=e.pipe(m(({offset:{y:n}})=>n),rt(2,1),m(([n,i])=>[nMath.abs(i-n.y)>100),m(([,[n]])=>n),Q()),o=Be("search");return N([e,o]).pipe(m(([{offset:n},i])=>n.y>400&&!i),Q(),b(n=>n?r:$(!1)),K(!1))}function Zn(e,t){return H(()=>N([Te(e),is(t)])).pipe(m(([{height:r},o])=>({height:r,hidden:o})),Q((r,o)=>r.height===o.height&&r.hidden===o.hidden),X(1))}function ei(e,{header$:t,main$:r}){return H(()=>{let o=new S,n=o.pipe(re(),ie(!0));o.pipe(oe("active"),$e(t)).subscribe(([{active:a},{hidden:s}])=>{e.classList.toggle("md-header--shadow",a&&!s),e.hidden=s});let i=me(M("[title]",e)).pipe(g(()=>D("content.tooltips")),G(a=>Xn(a)));return r.subscribe(o),t.pipe(U(n),m(a=>({ref:e,...a})),We(i.pipe(U(n))))})}function as(e,{viewport$:t,header$:r}){return xr(e,{viewport$:t,header$:r}).pipe(m(({offset:{y:o}})=>{let{height:n}=ue(e);return{active:n>0&&o>=n}}),oe("active"))}function ti(e,t){return H(()=>{let r=new S;r.subscribe({next({active:n}){e.classList.toggle("md-header__title--active",n)},complete(){e.classList.remove("md-header__title--active")}});let o=fe(".md-content h1");return typeof o>"u"?y:as(o,t).pipe(T(n=>r.next(n)),A(()=>r.complete()),m(n=>({ref:e,...n})))})}function ri(e,{viewport$:t,header$:r}){let o=r.pipe(m(({height:i})=>i),Q()),n=o.pipe(b(()=>Te(e).pipe(m(({height:i})=>({top:e.offsetTop,bottom:e.offsetTop+i})),oe("bottom"))));return N([o,n,t]).pipe(m(([i,{top:a,bottom:s},{offset:{y:c},size:{height:l}}])=>(l=Math.max(0,l-Math.max(0,a-c,i)-Math.max(0,l+c-s)),{offset:a-i,height:l,active:a-i<=c})),Q((i,a)=>i.offset===a.offset&&i.height===a.height&&i.active===a.active))}function ss(e){let t=__md_get("__palette")||{index:e.findIndex(n=>matchMedia(n.getAttribute("data-md-color-media")).matches)},r=Math.max(0,Math.min(t.index,e.length-1)),o=!0;return $(...e).pipe(G(n=>h(n,"change").pipe(m(()=>n))),K(e[r]),m(n=>({index:e.indexOf(n),color:{media:n.getAttribute("data-md-color-media"),scheme:n.getAttribute("data-md-color-scheme"),primary:n.getAttribute("data-md-color-primary"),accent:n.getAttribute("data-md-color-accent")}})),m(n=>(o&&(o=!1,t?.color&&(n.color={...n.color,...t.color})),n)),X(1))}function oi(e){let t=M("input",e),r=x("meta",{name:"theme-color"});document.head.appendChild(r);let o=x("meta",{name:"color-scheme"});document.head.appendChild(o);let n=Ut("(prefers-color-scheme: light)");return H(()=>{let i=new S;return i.subscribe(a=>{if(document.body.setAttribute("data-md-color-switching",""),a.color.media==="(prefers-color-scheme)"){let s=matchMedia("(prefers-color-scheme: light)"),c=document.querySelector(s.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");a.color.scheme=c.getAttribute("data-md-color-scheme"),a.color.primary=c.getAttribute("data-md-color-primary"),a.color.accent=c.getAttribute("data-md-color-accent")}for(let[s,c]of Object.entries(a.color))document.body.setAttribute(`data-md-color-${s}`,c);for(let s=0;sa.key==="Enter"),ee(i,(a,s)=>s)).subscribe(({index:a})=>{a=(a+1)%t.length,t[a].click(),t[a].focus()}),i.pipe(m(()=>{let a=Ae("header"),s=window.getComputedStyle(a);return o.content=s.colorScheme,s.backgroundColor.match(/\d+/g).map(c=>(+c).toString(16).padStart(2,"0")).join("")})).subscribe(a=>r.content=`#${a}`),i.pipe(ye(ce)).subscribe(()=>{document.body.removeAttribute("data-md-color-switching")}),ss(t).pipe(U(n.pipe(Re(1))),bt(),T(a=>i.next(a)),A(()=>i.complete()),m(a=>({ref:e,...a})))})}function ni(e,{progress$:t}){return H(()=>{let r=new S;return r.subscribe(({value:o})=>{e.style.setProperty("--md-progress-value",`${o}`)}),t.pipe(T(o=>r.next({value:o})),A(()=>r.complete()),m(o=>({ref:e,value:o})))})}function ii(e,t){return e.protocol=t.protocol,e.hostname=t.hostname,e}function cs(e,t){let r=new Map;for(let o of M("url",e)){let n=F("loc",o),i=[ii(new URL(n.textContent),t)];r.set(`${i[0]}`,i);for(let a of M("[rel=alternate]",o)){let s=a.getAttribute("href");s!=null&&i.push(ii(new URL(s),t))}}return r}function Ct(e){return dn(new URL("sitemap.xml",e)).pipe(m(t=>cs(t,new URL(e))),be(()=>$(new Map)),le())}function ai({document$:e}){let t=new Map;e.pipe(b(()=>M("link[rel=alternate]")),m(r=>new URL(r.href)),g(r=>!t.has(r.toString())),G(r=>Ct(r).pipe(m(o=>[r,o]),be(()=>y)))).subscribe(([r,o])=>{t.set(r.toString().replace(/\/$/,""),o)}),h(document.body,"click").pipe(g(r=>!r.metaKey&&!r.ctrlKey),b(r=>{if(r.target instanceof Element){let o=r.target.closest("a");if(o&&!o.target){let n=[...t].find(([f])=>o.href.startsWith(`${f}/`));if(typeof n>"u")return y;let[i,a]=n,s=Ee();if(s.href.startsWith(i))return y;let c=we(),l=s.href.replace(c.base,"");l=`${i}/${l}`;let p=a.has(l.split("#")[0])?new URL(l,c.base):new URL(i);return r.preventDefault(),$(p)}}return y})).subscribe(r=>at(r,!0))}var no=Ht(oo());function ls(e){e.setAttribute("data-md-copying","");let t=e.closest("[data-copy]"),r=t?t.getAttribute("data-copy"):e.innerText;return e.removeAttribute("data-md-copying"),r.trimEnd()}function si({alert$:e}){no.default.isSupported()&&new I(t=>{new no.default("[data-clipboard-target], [data-clipboard-text]",{text:r=>r.getAttribute("data-clipboard-text")||ls(F(r.getAttribute("data-clipboard-target")))}).on("success",r=>t.next(r))}).pipe(T(t=>{t.trigger.focus()}),m(()=>Oe("clipboard.copied"))).subscribe(e)}function ci(e,t){if(!(e.target instanceof Element))return y;let r=e.target.closest("a");if(r===null)return y;if(r.closest('[data-md-component="i18n"]'))return y;if(r.target||e.metaKey||e.ctrlKey)return y;let o=new URL(r.href);return o.search=o.hash="",t.has(`${o}`)?(e.preventDefault(),$(r)):y}function li(e){let t=new Map;for(let r of M(":scope > *",e.head))t.set(r.outerHTML,r);return t}function pi(e){for(let t of M("[href], [src]",e))for(let r of["href","src"]){let o=t.getAttribute(r);if(o&&!/^(?:[a-z]+:)?\/\//i.test(o)){t[r]=t[r];break}}return $(e)}function ps(){let e=document.documentElement.lang;e&&document.querySelectorAll('[data-md-component="i18n"] .md-select__link').forEach(t=>{t.classList.remove("md-select__link--active"),t.getAttribute("hreflang")===e&&t.classList.add("md-select__link--active")})}function ms(e){for(let o of["[data-md-component=announce]","[data-md-component=container]","[data-md-component=header-topic]","[data-md-component=outdated]","[data-md-component=logo]","[data-md-component=skip]",...D("navigation.tabs.sticky")?["[data-md-component=tabs]"]:[]]){let n=fe(o),i=fe(o,e);typeof n<"u"&&typeof i<"u"&&n.replaceWith(i)}let t=li(document);for(let[o,n]of li(e))t.has(o)?t.delete(o):document.head.appendChild(n);for(let o of t.values()){let n=o.getAttribute("name");n!=="theme-color"&&n!=="color-scheme"&&o.remove()}let r=Ae("container");return ze(M("script",r)).pipe(b(o=>{let n=e.createElement("script");if(o.src){for(let i of o.getAttributeNames())n.setAttribute(i,o.getAttribute(i));return o.replaceWith(n),new I(i=>{n.onload=()=>i.complete()})}else return n.textContent=o.textContent,o.replaceWith(n),y}),re(),ie(document),T(()=>ps()))}function mi({sitemap$:e,location$:t,viewport$:r,progress$:o}){if(location.protocol==="file:")return y;$(document).subscribe(pi);let n=h(document.body,"click").pipe($e(e),b(([s,c])=>ci(s,c)),m(({href:s})=>new URL(s)),le()),i=h(window,"popstate").pipe(m(Ee),le());n.pipe(ee(r)).subscribe(([s,{offset:c}])=>{history.replaceState(c,""),history.pushState(null,"",s)}),L(n,i).subscribe(t);let a=t.pipe(oe("pathname"),b(s=>yr(s,{progress$:o}).pipe(be(()=>(at(s,!0),y)))),b(pi),b(ms),le());return L(a.pipe(ee(t,(s,c)=>c)),a.pipe(b(()=>t),oe("hash")),t.pipe(Q((s,c)=>s.pathname===c.pathname&&s.hash===c.hash),b(()=>n),T(()=>history.back()))).subscribe(s=>{history.state!==null||!s.hash?window.scrollTo(0,history.state?.y??0):(history.scrollRestoration="auto",mn(s.hash),history.scrollRestoration="manual")}),t.subscribe(()=>{history.scrollRestoration="manual"}),h(window,"beforeunload").subscribe(()=>{history.scrollRestoration="auto"}),r.pipe(oe("offset"),_e(100)).subscribe(({offset:s})=>{history.replaceState(s,"")}),D("navigation.instant.prefetch")&&L(h(document.body,"mousemove"),h(document.body,"focusin")).pipe($e(e),b(([s,c])=>ci(s,c)),_e(25),zr(({href:s})=>s),dr(s=>{let c=document.createElement("link");return c.rel="prefetch",c.href=s.toString(),document.head.appendChild(c),h(c,"load").pipe(m(()=>c),xe(1))})).subscribe(s=>s.remove()),a}var fi=Ht(Zr());function ui(e){let t=e.separator.split("|").map(n=>n.replace(/(\(\?[!=<][^)]+\))/g,"").length===0?"\uFFFD":n).join("|"),r=new RegExp(t,"img"),o=(n,i,a)=>`${i}${a}`;return n=>{n=n.replace(/[\s*+\-:~^]+/g," ").replace(/&/g,"&").trim();let i=new RegExp(`(^|${e.separator}|)(${n.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return a=>(0,fi.default)(a).replace(i,o).replace(/<\/mark>(\s+)]*>/img,"$1")}}function Nt(e){return e.type===1}function Tr(e){return e.type===3}function di(e,t){let r=xn(e);return L($(location.protocol!=="file:"),Be("search")).pipe(Pe(o=>o),b(()=>t)).subscribe(({config:o,docs:n})=>r.next({type:0,data:{config:o,docs:n,options:{suggest:D("search.suggest")}}})),r}function hi(e){let{selectedVersionSitemap:t,selectedVersionBaseURL:r,currentLocation:o,currentBaseURL:n}=e,i=io(n)?.pathname;if(i===void 0)return;let a=ds(o.pathname,i);if(a===void 0)return;let s=bs(t.keys());if(!t.has(s))return;let c=io(a,s);if(!c||!t.has(c.href))return;let l=io(a,r);if(l)return l.hash=o.hash,l.search=o.search,l}function io(e,t){try{return new URL(e,t)}catch{return}}function ds(e,t){if(e.startsWith(t))return e.slice(t.length)}function hs(e,t){let r=Math.min(e.length,t.length),o;for(o=0;oy)),o=r.pipe(m(n=>{let[,i]=t.base.match(/([^/]+)\/?$/);return n.find(({version:a,aliases:s})=>a===i||s.includes(i))||n[0]}));r.pipe(m(n=>new Map(n.map(i=>[`${new URL(`../${i.version}/`,t.base)}`,i]))),b(n=>h(document.body,"click").pipe(g(i=>!i.metaKey&&!i.ctrlKey),ee(o),b(([i,a])=>{if(i.target instanceof Element){let s=i.target.closest("a");if(s&&!s.target&&n.has(s.href)){let c=s.href;return!i.target.closest(".md-version")&&n.get(c)===a?y:(i.preventDefault(),$(new URL(c)))}}return y}),b(i=>Ct(i).pipe(m(a=>hi({selectedVersionSitemap:a,selectedVersionBaseURL:i,currentLocation:Ee(),currentBaseURL:t.base})??i)))))).subscribe(n=>at(n,!0)),N([r,o]).subscribe(([n,i])=>{F(".md-header__topic").appendChild($n(n,i))}),e.pipe(b(()=>o)).subscribe(n=>{let i=new URL(t.base),a=__md_get("__outdated",sessionStorage,i);if(a===null){a=!0;let s=t.version?.default||"latest";Array.isArray(s)||(s=[s]);e:for(let c of s)for(let l of n.aliases.concat(n.version))if(new RegExp(c,"i").test(l)){a=!1;break e}__md_set("__outdated",a,sessionStorage,i)}if(a)for(let s of pe("outdated"))s.hidden=!1})}function vs(e,{worker$:t}){let{searchParams:r}=Ee();r.has("q")&&(it("search",!0),e.value=r.get("q"),e.focus(),Be("search").pipe(Pe(i=>!i)).subscribe(()=>{let i=Ee();i.searchParams.delete("q"),history.replaceState({},"",`${i}`)}));let o=Ke(e),n=L(t.pipe(Pe(Nt)),h(e,"keyup"),o).pipe(m(()=>e.value),Q());return N([n,o]).pipe(m(([i,a])=>({value:i,focus:a})),X(1))}function vi(e,{worker$:t}){let r=new S,o=r.pipe(re(),ie(!0));N([t.pipe(Pe(Nt)),r],(i,a)=>a).pipe(oe("value")).subscribe(({value:i})=>t.next({type:2,data:i})),r.pipe(oe("focus")).subscribe(({focus:i})=>{i&&it("search",i)}),h(e.form,"reset").pipe(U(o)).subscribe(()=>e.focus());let n=F("header [for=__search]");return h(n,"click").subscribe(()=>e.focus()),vs(e,{worker$:t}).pipe(T(i=>r.next(i)),A(()=>r.complete()),m(i=>({ref:e,...i})),X(1))}function gi(e,{worker$:t,query$:r}){let o=new S,n=an(e.parentElement).pipe(g(Boolean)),i=e.parentElement,a=F(":scope > :first-child",e),s=F(":scope > :last-child",e);Be("search").subscribe(p=>{s.setAttribute("role",p?"list":"presentation"),s.hidden=!p}),o.pipe(ee(r),Qr(t.pipe(Pe(Nt)))).subscribe(([{items:p},{value:f}])=>{switch(p.length){case 0:a.textContent=f.length?Oe("search.result.none"):Oe("search.result.placeholder");break;case 1:a.textContent=Oe("search.result.one");break;default:let u=hr(p.length);a.textContent=Oe("search.result.other",u)}});let c=o.pipe(T(()=>s.innerHTML=""),b(({items:p})=>L($(...p.slice(0,10)),$(...p.slice(10)).pipe(rt(4),Br(n),b(([f])=>f)))),m(Cn),le());return c.subscribe(p=>s.appendChild(p)),c.pipe(G(p=>{let f=fe("details",p);return typeof f>"u"?y:h(f,"toggle").pipe(U(o),m(()=>f))})).subscribe(p=>{p.open===!1&&p.offsetTop<=i.scrollTop&&i.scrollTo({top:p.offsetTop})}),t.pipe(g(Tr),m(({data:p})=>p)).pipe(T(p=>o.next(p)),A(()=>o.complete()),m(p=>({ref:e,...p})))}function gs(e,{query$:t}){return t.pipe(m(({value:r})=>{let o=Ee();return o.hash="",r=r.replace(/\s+/g,"+").replace(/&/g,"%26").replace(/=/g,"%3D"),o.search=`q=${r}`,{url:o}}))}function yi(e,t){let r=new S,o=r.pipe(re(),ie(!0));return r.subscribe(({url:n})=>{e.setAttribute("data-clipboard-text",e.href),e.href=`${n}`}),h(e,"click").pipe(U(o)).subscribe(n=>n.preventDefault()),gs(e,t).pipe(T(n=>r.next(n)),A(()=>r.complete()),m(n=>({ref:e,...n})))}function xi(e,{worker$:t,keyboard$:r}){let o=new S,n=Ae("search-query"),i=L(h(n,"keydown"),h(n,"focus")).pipe(ye(ce),m(()=>n.value),Q());return o.pipe($e(i),m(([{suggest:s},c])=>{let l=c.split(/([\s-]+)/);if(s?.length&&l[l.length-1]){let p=s[s.length-1];p.startsWith(l[l.length-1])&&(l[l.length-1]=p)}else l.length=0;return l})).subscribe(s=>e.textContent=s.join("")),r.pipe(g(({mode:s})=>s==="search")).subscribe(s=>{s.type==="ArrowRight"&&e.innerText.length&&n.selectionStart===n.value.length&&(n.value=e.innerText)}),t.pipe(g(Tr),m(({data:s})=>s)).pipe(T(s=>o.next(s)),A(()=>o.complete()),m(()=>({ref:e})))}function Ei(e,{index$:t,keyboard$:r}){let o=we();try{let n=di(o.search,t),i=Ae("search-query",e),a=Ae("search-result",e);h(e,"click").pipe(g(({target:c})=>c instanceof Element&&!!c.closest("a"))).subscribe(()=>it("search",!1)),r.pipe(g(({mode:c})=>c==="search")).subscribe(c=>{let l=De();switch(c.type){case"Enter":if(l===i){let p=new Map;for(let f of M(":first-child [href]",a)){let u=f.firstElementChild;p.set(f,parseFloat(u.getAttribute("data-md-score")))}if(p.size){let[[f]]=[...p].sort(([,u],[,d])=>d-u);f.click()}c.claim()}break;case"Escape":case"Tab":it("search",!1),i.blur();break;case"ArrowUp":case"ArrowDown":if(typeof l>"u")i.focus();else{let p=[i,...M(":not(details) > [href], summary, details[open] [href]",a)],f=Math.max(0,(Math.max(0,p.indexOf(l))+p.length+(c.type==="ArrowUp"?-1:1))%p.length);p[f].focus()}c.claim();break;default:i!==De()&&i.focus()}}),r.pipe(g(({mode:c})=>c==="global")).subscribe(c=>{switch(c.type){case"f":case"s":case"/":i.focus(),i.select(),c.claim();break}});let s=vi(i,{worker$:n});return L(s,gi(a,{worker$:n,query$:s})).pipe(We(...pe("search-share",e).map(c=>yi(c,{query$:s})),...pe("search-suggest",e).map(c=>xi(c,{worker$:n,keyboard$:r}))))}catch{return e.hidden=!0,et}}function wi(e,{index$:t,location$:r}){return N([t,r.pipe(K(Ee()),g(o=>!!o.searchParams.get("h")))]).pipe(m(([o,n])=>ui(o.config)(n.searchParams.get("h"))),m(o=>{let n=new Map,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(let a=i.nextNode();a;a=i.nextNode())if(a.parentElement?.offsetHeight){let s=a.textContent,c=o(s);c.length>s.length&&n.set(a,c)}for(let[a,s]of n){let{childNodes:c}=x("span",null,s);a.replaceWith(...Array.from(c))}return{ref:e,nodes:n}}))}function ys(e,{viewport$:t,main$:r}){let o=e.closest(".md-grid"),n=o.offsetTop-o.parentElement.offsetTop;return N([r,t]).pipe(m(([{offset:i,height:a},{offset:{y:s}}])=>(a=a+Math.min(n,Math.max(0,s-i))-n,{height:a,locked:s>=i+n})),Q((i,a)=>i.height===a.height&&i.locked===a.locked))}function ao(e,{header$:t,...r}){let o=F(".md-sidebar__scrollwrap",e),{y:n}=Qe(o);return H(()=>{let i=new S,a=i.pipe(re(),ie(!0)),s=i.pipe(He(0,ge));return s.pipe(ee(t)).subscribe({next([{height:c},{height:l}]){o.style.height=`${c-2*n}px`,e.style.top=`${l}px`},complete(){o.style.height="",e.style.top=""}}),s.pipe(Pe()).subscribe(()=>{for(let c of M(".md-nav__link--active[href]",e)){if(!c.clientHeight)continue;let l=c.closest(".md-sidebar__scrollwrap");if(typeof l<"u"){let p=c.offsetTop-l.offsetTop,{height:f}=ue(l);l.scrollTo({top:p-f/2})}}}),me(M("label[tabindex]",e)).pipe(G(c=>h(c,"click").pipe(ye(ce),m(()=>c),U(a)))).subscribe(c=>{let l=F(`[id="${c.htmlFor}"]`);F(`[aria-labelledby="${c.id}"]`).setAttribute("aria-expanded",`${l.checked}`)}),D("content.tooltips")&&me(M("abbr[title]",e)).pipe(G(c=>Ge(c,{viewport$})),U(a)).subscribe(),ys(e,r).pipe(T(c=>i.next(c)),A(()=>i.complete()),m(c=>({ref:e,...c})))})}function Si(e,t){if(typeof t<"u"){let r=`https://api.github.com/repos/${e}/${t}`;return tt(Ve(`${r}/releases/latest`).pipe(be(()=>y),m(o=>({version:o.tag_name})),qe({})),Ve(r).pipe(be(()=>y),m(o=>({stars:o.stargazers_count,forks:o.forks_count})),qe({}))).pipe(m(([o,n])=>({...o,...n})))}else{let r=`https://api.github.com/users/${e}`;return Ve(r).pipe(m(o=>({repositories:o.public_repos})),qe({}))}}function Ti(e,t){let r=`https://${e}/api/v4/projects/${encodeURIComponent(t)}`;return tt(Ve(`${r}/releases/permalink/latest`).pipe(be(()=>y),m(({tag_name:o})=>({version:o})),qe({})),Ve(r).pipe(be(()=>y),m(({star_count:o,forks_count:n})=>({stars:o,forks:n})),qe({}))).pipe(m(([o,n])=>({...o,...n})))}function Oi(e){let t=e.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i);if(t){let[,r,o]=t;return Si(r,o)}if(t=e.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i),t){let[,r,o]=t;return Ti(r,o)}return y}var Li;function xs(e){return Li||(Li=H(()=>{let t=__md_get("__source",sessionStorage);if(t)return $(t);if(pe("consent").length){let o=__md_get("__consent");if(!(o&&o.github))return y}return Oi(e.href).pipe(T(o=>__md_set("__source",o,sessionStorage)))}).pipe(be(()=>y),g(t=>Object.keys(t).length>0),m(t=>({facts:t})),X(1)))}function Mi(e){let t=F(":scope > :last-child",e);return H(()=>{let r=new S;return r.subscribe(({facts:o})=>{t.appendChild(kn(o)),t.classList.add("md-source__repository--active")}),xs(e).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))})}function Es(e,{viewport$:t,header$:r}){return Te(document.body).pipe(b(()=>xr(e,{header$:r,viewport$:t})),m(({offset:{y:o}})=>({hidden:o>=10})),oe("hidden"))}function _i(e,t){return H(()=>{let r=new S;return r.subscribe({next({hidden:o}){e.hidden=o},complete(){e.hidden=!1}}),(D("navigation.tabs.sticky")?$({hidden:!1}):Es(e,t)).pipe(T(o=>r.next(o)),A(()=>r.complete()),m(o=>({ref:e,...o})))})}function ws(e,{viewport$:t,header$:r}){let o=new Map,n=M(".md-nav__link",e);for(let s of n){let c=decodeURIComponent(s.hash.substring(1)),l=fe(`[id="${c}"]`);typeof l<"u"&&o.set(s,l)}let i=r.pipe(oe("height"),m(({height:s})=>{let c=Ae("main"),l=F(":scope > :first-child",c);return s+.8*(l.offsetTop-c.offsetTop)}),le());return Te(document.body).pipe(oe("height"),b(s=>H(()=>{let c=[];return $([...o].reduce((l,[p,f])=>{for(;c.length&&o.get(c[c.length-1]).tagName>=f.tagName;)c.pop();let u=f.offsetTop;for(;!u&&f.parentElement;)f=f.parentElement,u=f.offsetTop;let d=f.offsetParent;for(;d;d=d.offsetParent)u+=d.offsetTop;return l.set([...c=[...c,p]].reverse(),u)},new Map))}).pipe(m(c=>new Map([...c].sort(([,l],[,p])=>l-p))),$e(i),b(([c,l])=>t.pipe(jt(([p,f],{offset:{y:u},size:d})=>{let v=u+d.height>=Math.floor(s.height);for(;f.length;){let[,O]=f[0];if(O-l=u&&!v)f=[p.pop(),...f];else break}return[p,f]},[[],[...c]]),Q((p,f)=>p[0]===f[0]&&p[1]===f[1])))))).pipe(m(([s,c])=>({prev:s.map(([l])=>l),next:c.map(([l])=>l)})),K({prev:[],next:[]}),rt(2,1),m(([s,c])=>s.prev.length{let i=new S,a=i.pipe(re(),ie(!0));if(i.subscribe(({prev:s,next:c})=>{for(let[l]of c)l.classList.remove("md-nav__link--passed"),l.classList.remove("md-nav__link--active");for(let[l,[p]]of s.entries())p.classList.add("md-nav__link--passed"),p.classList.toggle("md-nav__link--active",l===s.length-1)}),D("toc.follow")){let s=L(t.pipe(_e(1),m(()=>{})),t.pipe(_e(250),m(()=>"smooth")));i.pipe(g(({prev:c})=>c.length>0),$e(o.pipe(ye(ce))),ee(s)).subscribe(([[{prev:c}],l])=>{let[p]=c[c.length-1];if(p.offsetHeight){let f=br(p);if(typeof f<"u"){let u=p.offsetTop-f.offsetTop,{height:d}=ue(f);f.scrollTo({top:u-d/2,behavior:l})}}})}return D("navigation.tracking")&&t.pipe(U(a),oe("offset"),_e(250),Re(1),U(n.pipe(Re(1))),bt({delay:250}),ee(i)).subscribe(([,{prev:s}])=>{let c=Ee(),l=s[s.length-1];if(l&&l.length){let[p]=l,{hash:f}=new URL(p.href);c.hash!==f&&(c.hash=f,history.replaceState({},"",`${c}`))}else c.hash="",history.replaceState({},"",`${c}`)}),ws(e,{viewport$:t,header$:r}).pipe(T(s=>i.next(s)),A(()=>i.complete()),m(s=>({ref:e,...s})))})}function Ss(e,{viewport$:t,main$:r,target$:o}){let n=t.pipe(m(({offset:{y:a}})=>a),rt(2,1),m(([a,s])=>a>s&&s>0),Q()),i=r.pipe(m(({active:a})=>a));return N([i,n]).pipe(m(([a,s])=>!(a&&s)),Q(),U(o.pipe(Re(1))),ie(!0),bt({delay:250}),m(a=>({hidden:a})))}function Ci(e,{viewport$:t,header$:r,main$:o,target$:n}){let i=new S,a=i.pipe(re(),ie(!0));return i.subscribe({next({hidden:s}){e.hidden=s,s?(e.setAttribute("tabindex","-1"),e.blur()):e.removeAttribute("tabindex")},complete(){e.style.top="",e.hidden=!0,e.removeAttribute("tabindex")}}),r.pipe(U(a),oe("height")).subscribe(({height:s})=>{e.style.top=`${s+16}px`}),h(e,"click").subscribe(s=>{s.preventDefault(),window.scrollTo({top:0})}),Ss(e,{viewport$:t,main$:o,target$:n}).pipe(T(s=>i.next(s)),A(()=>i.complete()),m(s=>({ref:e,...s})))}function ki({document$:e,viewport$:t}){e.pipe(b(()=>M(".md-ellipsis")),G(r=>pt(r).pipe(U(e.pipe(Re(1))),g(o=>o),m(()=>r),xe(1))),g(r=>r.offsetWidth{let o=r.innerText,n=r.closest("a")||r;return n.title=o,D("content.tooltips")?Ge(n,{viewport$:t}).pipe(U(e.pipe(Re(1))),A(()=>n.removeAttribute("title"))):y})).subscribe(),D("content.tooltips")&&e.pipe(b(()=>M(".md-status")),G(r=>Ge(r,{viewport$:t}))).subscribe()}function Hi({document$:e,tablet$:t}){e.pipe(b(()=>M(".md-toggle--indeterminate")),T(r=>{r.indeterminate=!0,r.checked=!1}),G(r=>h(r,"change").pipe(Yr(()=>r.classList.contains("md-toggle--indeterminate")),m(()=>r))),ee(t)).subscribe(([r,o])=>{r.classList.remove("md-toggle--indeterminate"),o&&(r.checked=!1)})}function Ts(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}function $i({document$:e}){e.pipe(b(()=>M("[data-md-scrollfix]")),T(t=>t.removeAttribute("data-md-scrollfix")),g(Ts),G(t=>h(t,"touchstart").pipe(m(()=>t)))).subscribe(t=>{let r=t.scrollTop;r===0?t.scrollTop=1:r+t.offsetHeight===t.scrollHeight&&(t.scrollTop=r-1)})}function Pi({viewport$:e,tablet$:t}){N([Be("search"),t]).pipe(m(([r,o])=>r&&!o),b(r=>$(r).pipe(ot(r?400:100))),ee(e)).subscribe(([r,{offset:{y:o}}])=>{if(r)document.body.setAttribute("data-md-scrolllock",""),document.body.style.top=`-${o}px`;else{let n=-1*parseInt(document.body.style.top,10);document.body.removeAttribute("data-md-scrolllock"),document.body.style.top="",n&&window.scrollTo(0,n)}})}Object.entries||(Object.entries=function(e){let t=[];for(let r of Object.keys(e))t.push([r,e[r]]);return t});Object.values||(Object.values=function(e){let t=[];for(let r of Object.keys(e))t.push(e[r]);return t});typeof Element<"u"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(e,t){typeof e=="object"?(this.scrollLeft=e.left,this.scrollTop=e.top):(this.scrollLeft=e,this.scrollTop=t)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...e){let t=this.parentNode;if(t){e.length===0&&t.removeChild(this);for(let r=e.length-1;r>=0;r--){let o=e[r];typeof o=="string"?o=document.createTextNode(o):o.parentNode&&o.parentNode.removeChild(o),r?t.insertBefore(this.previousSibling,o):t.replaceChild(o,this)}}}));function Os(){return location.protocol==="file:"?Mt(`${new URL("search/search_index.js",qt.base)}`).pipe(m(()=>__index),X(1)):Ve(new URL(qt.search_index||"search/search_index.json",qt.base))}document.documentElement.classList.remove("no-js");document.documentElement.classList.add("js");var st=Xo(),Kt=ln(),kt=fn(Kt),so=cn(),Ce=yn(),Or=Ut("(min-width: 60em)"),Ri=Ut("(min-width: 76.25em)"),Ii=un(),qt=we(),Fi=document.forms.namedItem("search")?Os():et,co=new S;si({alert$:co});ai({document$:st});var lo=new S,ji=Ct(qt.base);D("navigation.instant")&&mi({sitemap$:ji,location$:Kt,viewport$:Ce,progress$:lo}).subscribe(st);qt.version?.provider==="mike"&&bi({document$:st});L(Kt,kt).pipe(ot(125)).subscribe(()=>{it("drawer",!1),it("search",!1)});so.pipe(g(({mode:e})=>e==="global")).subscribe(e=>{switch(e.type){case"p":case",":let t=fe("link[rel=prev]");typeof t<"u"&&at(t);break;case"n":case".":let r=fe("link[rel=next]");typeof r<"u"&&at(r);break;case"Enter":let o=De();o instanceof HTMLLabelElement&&o.click()}});ki({viewport$:Ce,document$:st});Hi({document$:st,tablet$:Or});$i({document$:st});Pi({viewport$:Ce,tablet$:Or});var mt=Zn(Ae("header"),{viewport$:Ce}),zt=st.pipe(m(()=>Ae("main")),b(e=>ri(e,{viewport$:Ce,header$:mt})),X(1)),Ls=L(...pe("consent").map(e=>wn(e,{target$:kt})),...pe("dialog").map(e=>Jn(e,{alert$:co})),...pe("palette").map(e=>oi(e)),...pe("progress").map(e=>ni(e,{progress$:lo})),...pe("search").map(e=>Ei(e,{index$:Fi,keyboard$:so})),...pe("source").map(e=>Mi(e))),Ms=H(()=>L(...pe("announce").map(e=>En(e)),...pe("content").map(e=>Gn(e,{sitemap$:ji,viewport$:Ce,target$:kt,print$:Ii})),...pe("content").map(e=>D("search.highlight")?wi(e,{index$:Fi,location$:Kt}):y),...pe("header").map(e=>ei(e,{viewport$:Ce,header$:mt,main$:zt})),...pe("header-title").map(e=>ti(e,{viewport$:Ce,header$:mt})),...pe("sidebar").map(e=>e.getAttribute("data-md-type")==="navigation"?Jr(Ri,()=>ao(e,{viewport$:Ce,header$:mt,main$:zt})):Jr(Or,()=>ao(e,{viewport$:Ce,header$:mt,main$:zt}))),...pe("tabs").map(e=>_i(e,{viewport$:Ce,header$:mt})),...pe("toc").map(e=>Ai(e,{viewport$:Ce,header$:mt,main$:zt,target$:kt})),...pe("top").map(e=>Ci(e,{viewport$:Ce,header$:mt,main$:zt,target$:kt})))),Ui=st.pipe(b(()=>Ms),We(Ls),X(1));Ui.subscribe();window.document$=st;window.location$=Kt;window.target$=kt;window.keyboard$=so;window.viewport$=Ce;window.tablet$=Or;window.screen$=Ri;window.print$=Ii;window.alert$=co;window.progress$=lo;window.component$=Ui;})(); /*! Bundled license information: escape-html/index.js: