diff --git a/cv/index.html b/cv/index.html
new file mode 100644
index 0000000..ea2515e
--- /dev/null
+++ b/cv/index.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html> <html><head>
+		<title>Curriculum Vitae</title>
+		<base href="../">
+		<meta id="root-path" root-path="../">
+		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=1.0, maximum-scale=5.0">
+		<meta charset="UTF-8">
+		<meta name="description" content="notes - Curriculum Vitae">
+		<meta property="og:title" content="Curriculum Vitae">
+		<meta property="og:description" content="notes - Curriculum Vitae">
+		<meta property="og:type" content="website">
+		<meta property="og:url" content="cv/curriculum-vitae.html">
+		<meta property="og:image" content="undefined">
+		<meta property="og:site_name" content="notes">
+		<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="lib/rss.xml"><script async="" id="webpage-script" src="lib/scripts/webpage.js" onload="this.onload=null;this.setAttribute(&quot;loaded&quot;, &quot;true&quot;)"></script><script type="module" async="" id="graph-view-script" src="lib/scripts/graph-view.js"></script><script async="" id="graph-wasm-script" src="lib/scripts/graph-wasm.js" onload="this.onload=null;this.setAttribute(&quot;loaded&quot;, &quot;true&quot;)"></script><script async="" id="graph-render-worker-script" src="lib/scripts/graph-render-worker.js" onload="this.onload=null;this.setAttribute(&quot;loaded&quot;, &quot;true&quot;)"></script><script async="" id="tinycolor-script" src="lib/scripts/tinycolor.js" onload="this.onload=null;this.setAttribute(&quot;loaded&quot;, &quot;true&quot;)"></script><script async="" id="pixi-script" src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/7.4.0/pixi.min.js" onload="this.onload=null;this.setAttribute(&quot;loaded&quot;, &quot;true&quot;)"></script><script async="" id="minisearch-script" src="https://cdn.jsdelivr.net/npm/minisearch@6.3.0/dist/umd/index.min.js" onload="this.onload=null;this.setAttribute(&quot;loaded&quot;, &quot;true&quot;)"></script><link rel="icon" href="lib/media/favicon.png"><script async="" id="graph-data-script" src="lib/scripts/graph-data.js" onload="this.onload=null;this.setAttribute(&quot;loaded&quot;, &quot;true&quot;)"></script><style>body{--line-width:40em;--line-width-adaptive:40em;--file-line-width:40em;--sidebar-width:min(20em, 80vw);--collapse-arrow-size:11px;--tree-horizontal-spacing:0.6em;--tree-vertical-spacing:0.6em;--sidebar-margin:12px}.sidebar{height:100%;min-width:calc(var(--sidebar-width) + var(--divider-width-hover));max-width:calc(var(--sidebar-width) + var(--divider-width-hover));font-size:14px;z-index:10;position:relative;overflow:hidden;transition:min-width ease-in-out,max-width ease-in-out;transition-duration:.2s;contain:size}.sidebar-left{left:0}.sidebar-right{right:0}.sidebar.is-collapsed{min-width:0;max-width:0}body.floating-sidebars .sidebar{position:absolute}.sidebar-content{height:100%;min-width:calc(var(--sidebar-width) - var(--divider-width-hover));top:0;padding:var(--sidebar-margin);padding-top:4em;line-height:var(--line-height-tight);background-color:var(--background-secondary);transition:background-color,border-right,border-left,box-shadow;transition-duration:var(--color-fade-speed);transition-timing-function:ease-in-out;position:absolute;display:flex;flex-direction:column}.sidebar:not(.is-collapsed) .sidebar-content{min-width:calc(max(100%,var(--sidebar-width)) - 3px);max-width:calc(max(100%,var(--sidebar-width)) - 3px)}.sidebar-left .sidebar-content{left:0;border-top-right-radius:var(--radius-l);border-bottom-right-radius:var(--radius-l)}.sidebar-right .sidebar-content{right:0;border-top-left-radius:var(--radius-l);border-bottom-left-radius:var(--radius-l)}.sidebar:has(.sidebar-content:empty):has(.topbar-content:empty){display:none}.sidebar-topbar{height:2em;width:var(--sidebar-width);top:var(--sidebar-margin);padding-inline:var(--sidebar-margin);z-index:1;position:fixed;display:flex;align-items:center;transition:width ease-in-out;transition-duration:inherit}.sidebar.is-collapsed .sidebar-topbar{width:calc(2.3em + var(--sidebar-margin) * 2)}.sidebar .sidebar-topbar.is-collapsed{width:0}.sidebar-left .sidebar-topbar{left:0}.sidebar-right .sidebar-topbar{right:0}.topbar-content{overflow:hidden;overflow:clip;width:100%;height:100%;display:flex;align-items:center;transition:inherit}.sidebar.is-collapsed .topbar-content{width:0;transition:inherit}.clickable-icon.sidebar-collapse-icon{background-color:transparent;color:var(--icon-color-focused);padding:0!important;margin:0!important;height:100%!important;width:2.3em!important;margin-inline:0.14em!important;position:absolute}.sidebar-left .clickable-icon.sidebar-collapse-icon{transform:rotateY(180deg);right:var(--sidebar-margin)}.sidebar-right .clickable-icon.sidebar-collapse-icon{transform:rotateY(180deg);left:var(--sidebar-margin)}.clickable-icon.sidebar-collapse-icon svg.svg-icon{width:100%;height:100%}.sidebar-section-header{margin:0 0 1em 0;text-transform:uppercase;letter-spacing:.06em;font-weight:600}body{transition:background-color var(--color-fade-speed) ease-in-out}.webpage-container{display:flex;flex-direction:row;height:100%;width:100%;align-items:stretch;justify-content:center}.document-container{opacity:1;flex-basis:100%;max-width:100%;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;transition:opacity .2s ease-in-out;contain:inline-size}.hide{opacity:0;transition:opacity .2s ease-in-out}.document-container>.markdown-preview-view{margin:var(--sidebar-margin);margin-bottom:0;width:100%;width:-webkit-fill-available;width:-moz-available;width:fill-available;background-color:var(--background-primary);transition:background-color var(--color-fade-speed) ease-in-out;border-top-right-radius:var(--window-radius,var(--radius-m));border-top-left-radius:var(--window-radius,var(--radius-m));overflow-x:hidden!important;overflow-y:auto!important;display:flex!important;flex-direction:column!important;align-items:center!important;contain:inline-size}.document-container>.markdown-preview-view>.markdown-preview-sizer{padding-bottom:80vh!important;width:100%!important;max-width:var(--line-width)!important;flex-basis:var(--line-width)!important;transition:background-color var(--color-fade-speed) ease-in-out;contain:inline-size}.markdown-rendered img:not([width]),.view-content img:not([width]){max-width:100%;outline:0}.document-container>.view-content.embed{display:flex;padding:1em;height:100%;width:100%;align-items:center;justify-content:center}.document-container>.view-content.embed>*{max-width:100%;max-height:100%;object-fit:contain}:has(> :is(.math,table)){overflow-x:auto!important}.document-container>.view-content{overflow-x:auto;contain:content;padding:0;margin:0;height:100%}.scroll-highlight{position:absolute;width:100%;height:100%;pointer-events:none;z-index:1000;background-color:hsla(var(--color-accent-hsl),.25);opacity:0;padding:1em;inset:50%;translate:-50% -50%;border-radius:var(--radius-s)}</style><script defer="">async function loadIncludes(){if("file:"!=location.protocol){let e=document.querySelectorAll("include");for(let t=0;t<e.length;t++){let o=e[t],l=o.getAttribute("src");try{const e=await fetch(l);if(!e.ok){console.log("Could not include file: "+l),o?.remove();continue}let t=await e.text(),n=document.createRange().createContextualFragment(t),i=Array.from(n.children);for(let e of i)e.classList.add("hide"),e.style.transition="opacity 0.5s ease-in-out",setTimeout((()=>{e.classList.remove("hide")}),10);o.before(n),o.remove(),console.log("Included file: "+l)}catch(e){o?.remove(),console.log("Could not include file: "+l,e);continue}}}else{if(document.querySelectorAll("include").length>0){var e=document.createElement("div");e.id="error",e.textContent="Web server exports must be hosted on an http / web server to be viewed correctly.",e.style.position="fixed",e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)",e.style.fontSize="1.5em",e.style.fontWeight="bold",e.style.textAlign="center",document.body.appendChild(e),document.querySelector(".document-container")?.classList.remove("hide")}}}document.addEventListener("DOMContentLoaded",(()=>{loadIncludes()}));let isFileProtocol="file:"==location.protocol;function waitLoadScripts(e,t){let o=e.map((e=>document.getElementById(e+"-script"))),l=0;!function e(){let n=o[l];l++,n&&"true"!=n.getAttribute("loaded")||l<o.length&&e(),l<o.length?n.addEventListener("load",e):t()}()}</script><link rel="stylesheet" href="lib/styles/obsidian.css"><link rel="preload" href="lib/styles/global-variable-styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link rel="stylesheet" href="lib/styles/global-variable-styles.css"></noscript><link rel="preload" href="lib/styles/main-styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link rel="stylesheet" href="lib/styles/main-styles.css"></noscript></head><body class="publish css-settings-manager theme-dark show-inline-title"><script defer="">let theme=localStorage.getItem("theme")||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");"dark"==theme?(document.body.classList.add("theme-dark"),document.body.classList.remove("theme-light")):(document.body.classList.add("theme-light"),document.body.classList.remove("theme-dark")),window.innerWidth<480?document.body.classList.add("is-phone"):window.innerWidth<768?document.body.classList.add("is-tablet"):window.innerWidth<1024?document.body.classList.add("is-small-screen"):document.body.classList.add("is-large-screen")</script><div class="webpage-container workspace"><div class="sidebar-left sidebar"><div class="sidebar-handle"></div><div class="sidebar-topbar"><div class="topbar-content"><label class="theme-toggle-container" for="theme_toggle"><input class="theme-toggle-input" type="checkbox" id="theme_toggle"><div class="toggle-background"></div></label></div><div class="clickable-icon sidebar-collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="svg-icon"><path d="M21 3H3C1.89543 3 1 3.89543 1 5V19C1 20.1046 1.89543 21 3 21H21C22.1046 21 23 20.1046 23 19V5C23 3.89543 22.1046 3 21 3Z"></path><path d="M10 4V20"></path><path d="M4 7H7"></path><path d="M4 10H7"></path><path d="M4 13H7"></path></svg></div></div><div class="sidebar-content"><div class="search-input-container"><input enterkeyhint="search" type="search" spellcheck="false" placeholder="Search..."><div class="search-input-clear-button" aria-label="Clear search"></div></div><include src="lib/html/file-tree.html"></include></div><script defer="">let ls = document.querySelector(".sidebar-left"); ls.classList.add("is-collapsed"); if (window.innerWidth > 768) ls.classList.remove("is-collapsed"); ls.style.setProperty("--sidebar-width", localStorage.getItem("sidebar-left-width"));</script></div><div class="document-container markdown-reading-view hide"><div class="view-content"><style id="MJX-CHTML-styles"></style><div class="canvas-wrapper node-insert-event" tabindex="-1" style="--zoom-multiplier: 1;"><svg class="canvas-background"><pattern id="4396fdc308e0f57f" patternUnits="userSpaceOnUse" x="450" y="0" width="20" height="20"><circle cx="0.7" cy="0.7" r="0.7"></circle></pattern><rect x="0" y="0" width="100%" height="100%" fill="url(#4396fdc308e0f57f)"></rect></svg><div class="canvas-card-menu" style="z-index: 20;"><div class="canvas-card-menu-button mod-draggable" aria-label="Drag to add card" data-tooltip-position="top"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-sticky-note"><path d="M15.5 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V8.5L15.5 3Z"></path><path d="M15 3v6h6"></path></svg></div><div class="canvas-card-menu-button mod-draggable" aria-label="Drag to add note from vault" data-tooltip-position="top"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-file-text"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><line x1="10" y1="9" x2="8" y2="9"></line></svg></div><div class="canvas-card-menu-button mod-draggable" aria-label="Drag to add media from vault" data-tooltip-position="top"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-file-image"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"></path><polyline points="14 2 14 8 20 8"></polyline><circle cx="10" cy="13" r="2"></circle><path d="m20 17-1.09-1.09a2 2 0 0 0-2.82 0L10 22"></path></svg></div></div><div class="canvas-controls" style="z-index: 20;"><div class="canvas-control-group"><div class="canvas-control-item" aria-label="Canvas settings" data-tooltip-position="left"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg></div></div><div class="canvas-control-group"><div class="canvas-control-item" aria-label="Zoom in" data-tooltip-position="left"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-plus"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg></div><div class="canvas-control-item" aria-label="Reset zoom" data-tooltip-position="left"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-rotate-cw"><path d="M21 2v6h-6"></path><path d="M21 13a9 9 0 1 1-3-7.7L21 8"></path></svg></div><div class="canvas-control-item" aria-label="Zoom to fit
+(Shift + 1)" data-tooltip-position="left"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-maximize"><path d="M8 3H5a2 2 0 0 0-2 2v3"></path><path d="M21 8V5a2 2 0 0 0-2-2h-3"></path><path d="M3 16v3a2 2 0 0 0 2 2h3"></path><path d="M16 21h3a2 2 0 0 0 2-2v-3"></path></svg></div><div class="canvas-control-item" aria-label="Zoom out" data-tooltip-position="left"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-minus"><line x1="5" y1="12" x2="19" y2="12"></line></svg></div></div><div class="canvas-control-group"><div class="canvas-control-item is-disabled" aria-label="Undo" data-tooltip-position="left"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-undo-2"><path d="M9 14 4 9l5-5"></path><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5v0a5.5 5.5 0 0 1-5.5 5.5H11"></path></svg></div><div class="canvas-control-item is-disabled" aria-label="Redo" data-tooltip-position="left"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-redo-2"><path d="m15 14 5-5-5-5"></path><path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5v0A5.5 5.5 0 0 0 9.5 20H13"></path></svg></div></div><div class="canvas-control-group"><div class="canvas-control-item" aria-label="Canvas help" data-tooltip-position="left"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-help-circle"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12.01" y2="17"></line></svg></div></div></div><div class="canvas" style="transform: translate(450px, 0px) scale(1) translate(0px, 0px);"><svg class="canvas-edges"></svg><svg class="canvas-edges"></svg><div class="canvas-node canvas-node-group is-themed mod-canvas-color-3" style="z-index: -1081600; transform: translate(-220px, -1540px); width: 320px; height: 3380px; --canvas-node-width: 320px; --canvas-node-height: 3380px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label mod-foreground-dark" spellcheck="false">Work Experience</div></div><div class="canvas-node canvas-node-group is-themed mod-canvas-color-5" style="z-index: -1054560; transform: translate(160px, -1540px); width: 312px; height: 3380px; --canvas-node-width: 312px; --canvas-node-height: 3380px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label mod-foreground-dark" spellcheck="false">Academics</div></div><div class="canvas-node canvas-node-group" style="z-index: -308000; transform: translate(-520px, 210px); width: 1100px; height: 280px; --canvas-node-width: 1100px; --canvas-node-height: 280px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label" spellcheck="false">2019</div></div><div class="canvas-node canvas-node-group" style="z-index: -308000; transform: translate(-520px, 550px); width: 1100px; height: 280px; --canvas-node-width: 1100px; --canvas-node-height: 280px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label" spellcheck="false">2018</div></div><div class="canvas-node canvas-node-group" style="z-index: -308000; transform: translate(-520px, 890px); width: 1100px; height: 280px; --canvas-node-width: 1100px; --canvas-node-height: 280px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label" spellcheck="false">2017</div></div><div class="canvas-node canvas-node-group" style="z-index: -308000; transform: translate(-520px, 1230px); width: 1100px; height: 280px; --canvas-node-width: 1100px; --canvas-node-height: 280px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label" spellcheck="false">2016</div></div><div class="canvas-node canvas-node-group" style="z-index: -308000; transform: translate(-520px, -1150px); width: 1100px; height: 280px; --canvas-node-width: 1100px; --canvas-node-height: 280px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label" spellcheck="false">2023</div></div><div class="canvas-node canvas-node-group" style="z-index: -308000; transform: translate(-520px, -810px); width: 1100px; height: 280px; --canvas-node-width: 1100px; --canvas-node-height: 280px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label" spellcheck="false">2022</div></div><div class="canvas-node canvas-node-group" style="z-index: -308000; transform: translate(-520px, -470px); width: 1100px; height: 280px; --canvas-node-width: 1100px; --canvas-node-height: 280px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label" spellcheck="false">2021</div></div><div class="canvas-node canvas-node-group" style="z-index: -308000; transform: translate(-520px, -130px); width: 1100px; height: 280px; --canvas-node-width: 1100px; --canvas-node-height: 280px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label" spellcheck="false">2020</div></div><div class="canvas-node canvas-node-group" style="z-index: -308000; transform: translate(-520px, -1490px); width: 1100px; height: 280px; --canvas-node-width: 1100px; --canvas-node-height: 280px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label" spellcheck="false">2024 - Present</div></div><div class="canvas-node canvas-node-group" style="z-index: -308000; transform: translate(-520px, 1570px); width: 1100px; height: 280px; --canvas-node-width: 1100px; --canvas-node-height: 280px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label" spellcheck="false">Birth - 2016</div></div><div class="canvas-node canvas-node-group" style="z-index: -264320; transform: translate(640px, -1540px); width: 448px; height: 590px; --canvas-node-width: 448px; --canvas-node-height: 590px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label" spellcheck="false">Accomplishments</div></div><div class="canvas-node canvas-node-group" style="z-index: -220416; transform: translate(640px, -880px); width: 448px; height: 492px; --canvas-node-width: 448px; --canvas-node-height: 492px;"><div class="canvas-node-container"><div class="canvas-node-content"></div></div><div class="canvas-group-label" spellcheck="false">Skills</div></div><div class="canvas-node" style="z-index: 2; transform: translate(380px, -1833px); width: 708px; height: 213px; --canvas-node-width: 708px; --canvas-node-height: 213px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h1 data-heading="Public Profiles" class="heading" id="Public_Profiles">Public Profiles</h1><div class="heading-children"></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 3; transform: translate(660px, -1520px); width: 408px; height: 120px; --canvas-node-width: 408px; --canvas-node-height: 120px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h1 data-heading="CVEs" class="heading" id="CVEs">CVEs</h1><div class="heading-children"></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 4; transform: translate(660px, -1090px); width: 408px; height: 120px; --canvas-node-width: 408px; --canvas-node-height: 120px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h1 data-heading="Certifications" class="heading" id="Certifications">Certifications</h1><div class="heading-children"></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 5; transform: translate(660px, -1353px); width: 408px; height: 216px; --canvas-node-width: 408px; --canvas-node-height: 216px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h1 data-heading="Associations" class="heading" id="Associations">Associations</h1><div class="heading-children"></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 6; transform: translate(660px, -860px); width: 408px; height: 116px; --canvas-node-width: 408px; --canvas-node-height: 116px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h1 data-heading="Development" class="heading" id="Development">Development</h1><div class="heading-children"></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 7; transform: translate(660px, -694px); width: 408px; height: 116px; --canvas-node-width: 408px; --canvas-node-height: 116px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h1 data-heading="Security Skills" class="heading" id="Security_Skills">Security Skills</h1><div class="heading-children"></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 8; transform: translate(660px, -524px); width: 408px; height: 116px; --canvas-node-width: 408px; --canvas-node-height: 116px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h1 data-heading="Essential Skills" class="heading" id="Essential_Skills">Essential Skills</h1><div class="heading-children"></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 9; transform: translate(-500px, -1833px); width: 833px; height: 213px; --canvas-node-width: 833px; --canvas-node-height: 213px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h1 data-heading="Vikrant Singh Chauhan" class="heading" id="Vikrant_Singh_Chauhan">Vikrant Singh Chauhan</h1><div class="heading-children"></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 10; transform: translate(-200px, 350px); width: 279px; height: 400px; --canvas-node-width: 279px; --canvas-node-height: 400px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h2 data-heading="Data Entry Operator" class="heading" id="Data_Entry_Operator"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div>Data Entry Operator</h2><div class="heading-children"><div><p>Oscar Fire and Security Service<br>
+(Deployed at HSAM Board, Government of Haryana)</p></div></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 11; transform: translate(-199px, 750px); width: 279px; height: 480px; --canvas-node-width: 279px; --canvas-node-height: 480px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h2 data-heading="Cofounder" class="heading" id="Cofounder"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div>Cofounder</h2><div class="heading-children"><div><p>xPress Web Solutions, Delhi, India</p></div></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 12; transform: translate(-199px, 90px); width: 280px; height: 227px; --canvas-node-width: 280px; --canvas-node-height: 227px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h2 data-heading="Backend Developer" class="heading" id="Backend_Developer"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div>Backend Developer</h2><div class="heading-children"><div><p>Zap Infolabs Pvt. Ltd, Delhi, India</p></div></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 13; transform: translate(-199px, -1210px); width: 280px; height: 1300px; --canvas-node-width: 280px; --canvas-node-height: 1300px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h2 data-heading="Independent Security Researcher" class="heading" id="Independent_Security_Researcher"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div>Independent Security Researcher</h2><div class="heading-children"><div><p>Self Employed</p></div></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 14; transform: translate(-200px, 1230px); width: 279px; height: 220px; --canvas-node-width: 279px; --canvas-node-height: 220px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h2 data-heading="[[Web Developer]]" class="heading" id="[[Web_Developer]]"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div><a data-href="Web Developer" href="Web Developer" class="internal-link" target="_self" rel="noopener">Web Developer</a></h2><div class="heading-children"><div><p>Stardum Polls, Delhi, India</p></div></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 15; transform: translate(-157px, -1490px); width: 238px; height: 280px; --canvas-node-width: 238px; --canvas-node-height: 280px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h2 data-heading="Security Software Developer / Researcher" class="heading" id="Security_Software_Developer_/_Researcher"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div>Security Software Developer / Researcher</h2><div class="heading-children"><div><p>MobileHackingLab, Netherlands</p></div></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 16; transform: translate(-159px, -1030px); width: 240px; height: 500px; --canvas-node-width: 240px; --canvas-node-height: 500px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h2 data-heading="Freelance Web Developer (Backend)" class="heading" id="Freelance_Web_Developer_(Backend)"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div>Freelance Web Developer (Backend)</h2><div class="heading-children"><div><p>Moirae Creative Ltd, Doncaster, UK</p></div></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 17; transform: translate(177px, 1450px); width: 279px; height: 330px; --canvas-node-width: 279px; --canvas-node-height: 330px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h2 data-heading="School Education" class="heading" id="School_Education"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div>School Education</h2><div class="heading-children"></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 18; transform: translate(177px, 690px); width: 279px; height: 740px; --canvas-node-width: 279px; --canvas-node-height: 740px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h2 data-heading="Bachelor of Computer Application (Dropped)" class="heading" id="Bachelor_of_Computer_Application_(Dropped)"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div>Bachelor of Computer Application (Dropped)</h2><div class="heading-children"><div><p>Indira Gandhi National Open University</p></div></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div><div class="canvas-node" style="z-index: 19; transform: translate(177px, -1480px); width: 279px; height: 1160px; --canvas-node-width: 279px; --canvas-node-height: 1160px;"><div class="canvas-node-container"><div class="canvas-node-content markdown-embed"><div class="markdown-embed-content node-insert-event"><div class="markdown-preview-view markdown-rendered"><div class="markdown-preview-sizer markdown-preview-section"><div class="heading-wrapper"><h2 data-heading="Bachelor of Computer Application" class="heading" id="Bachelor_of_Computer_Application"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div>Bachelor of Computer Application</h2><div class="heading-children"><div><p>Manipal University, Jaipur</p></div></div></div></div></div></div><div class="markdown-embed-content node-insert-event" style="display: none;"></div></div><div class="canvas-node-content-blocker"></div></div></div></div></div></div></div><div class="sidebar-right sidebar"><div class="sidebar-handle"></div><div class="sidebar-topbar"><div class="topbar-content"></div><div class="clickable-icon sidebar-collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="svg-icon"><path d="M21 3H3C1.89543 3 1 3.89543 1 5V19C1 20.1046 1.89543 21 3 21H21C22.1046 21 23 20.1046 23 19V5C23 3.89543 22.1046 3 21 3Z"></path><path d="M10 4V20"></path><path d="M4 7H7"></path><path d="M4 10H7"></path><path d="M4 13H7"></path></svg></div></div><div class="sidebar-content"><div class="graph-view-wrapper"><div class="sidebar-section-header">Interactive Graph</div><div class="graph-view-placeholder">
+		<div class="graph-view-container">
+			<div class="graph-icon graph-expand" role="button" aria-label="Expand" data-tooltip-position="top"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon"><line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"></polyline></svg></div>
+			<canvas id="graph-canvas" class="hide" width="512px" height="512px"></canvas>
+		</div>
+		</div></div><div class="tree-container mod-root nav-folder tree-item outline-tree" data-depth="0"><div class="tree-header"><span class="sidebar-section-header">Table Of Contents</span><button class="clickable-icon collapse-tree-button" aria-label="Collapse All"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></svg></button></div><div class="tree-scroll-area tree-item-children nav-folder-children"><div class="tree-item mod-tree-folder nav-folder mod-collapsible is-collapsed" style="display: none;"></div><div class="tree-item" data-depth="1"><a class="tree-link" href="cv\curriculum-vitae.html#Public_Profiles"><div class="tree-item-contents heading-link" heading-name="Public Profiles"><span class="tree-item-title">Public Profiles</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="1"><a class="tree-link" href="cv\curriculum-vitae.html#CVEs"><div class="tree-item-contents heading-link" heading-name="CVEs"><span class="tree-item-title">CVEs</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="1"><a class="tree-link" href="cv\curriculum-vitae.html#Certifications"><div class="tree-item-contents heading-link" heading-name="Certifications"><span class="tree-item-title">Certifications</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="1"><a class="tree-link" href="cv\curriculum-vitae.html#Associations"><div class="tree-item-contents heading-link" heading-name="Associations"><span class="tree-item-title">Associations</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="1"><a class="tree-link" href="cv\curriculum-vitae.html#Development"><div class="tree-item-contents heading-link" heading-name="Development"><span class="tree-item-title">Development</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="1"><a class="tree-link" href="cv\curriculum-vitae.html#Security_Skills"><div class="tree-item-contents heading-link" heading-name="Security Skills"><span class="tree-item-title">Security Skills</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="1"><a class="tree-link" href="cv\curriculum-vitae.html#Essential_Skills"><div class="tree-item-contents heading-link" heading-name="Essential Skills"><span class="tree-item-title">Essential Skills</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="1"><a class="tree-link" href="cv\curriculum-vitae.html#Vikrant_Singh_Chauhan"><div class="tree-item-contents heading-link" heading-name="Vikrant Singh Chauhan"><span class="tree-item-title">Vikrant Singh Chauhan</span></div></a><div class="tree-item-children nav-folder-children"><div class="tree-item" data-depth="2"><a class="tree-link" href="cv\curriculum-vitae.html#Data_Entry_Operator"><div class="tree-item-contents heading-link" heading-name="Data Entry Operator"><span class="tree-item-title">Data Entry Operator</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="2"><a class="tree-link" href="cv\curriculum-vitae.html#Cofounder"><div class="tree-item-contents heading-link" heading-name="Cofounder"><span class="tree-item-title">Cofounder</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="2"><a class="tree-link" href="cv\curriculum-vitae.html#Backend_Developer"><div class="tree-item-contents heading-link" heading-name="Backend Developer"><span class="tree-item-title">Backend Developer</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="2"><a class="tree-link" href="cv\curriculum-vitae.html#Independent_Security_Researcher"><div class="tree-item-contents heading-link" heading-name="Independent Security Researcher"><span class="tree-item-title">Independent Security Researcher</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="2"><a class="tree-link" href="cv\curriculum-vitae.html#[[Web_Developer]]"><div class="tree-item-contents heading-link" heading-name="[[Web Developer]]"><span class="tree-item-title"><a data-href="Web Developer" href="Web Developer" class="internal-link" target="_blank" rel="noopener">Web Developer</a></span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="2"><a class="tree-link" href="cv\curriculum-vitae.html#Security_Software_Developer_/_Researcher"><div class="tree-item-contents heading-link" heading-name="Security Software Developer / Researcher"><span class="tree-item-title">Security Software Developer / Researcher</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="2"><a class="tree-link" href="cv\curriculum-vitae.html#Freelance_Web_Developer_(Backend)"><div class="tree-item-contents heading-link" heading-name="Freelance Web Developer (Backend)"><span class="tree-item-title">Freelance Web Developer (Backend)</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="2"><a class="tree-link" href="cv\curriculum-vitae.html#School_Education"><div class="tree-item-contents heading-link" heading-name="School Education"><span class="tree-item-title">School Education</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="2"><a class="tree-link" href="cv\curriculum-vitae.html#Bachelor_of_Computer_Application_(Dropped)"><div class="tree-item-contents heading-link" heading-name="Bachelor of Computer Application (Dropped)"><span class="tree-item-title">Bachelor of Computer Application (Dropped)</span></div></a><div class="tree-item-children nav-folder-children"></div></div><div class="tree-item" data-depth="2"><a class="tree-link" href="cv\curriculum-vitae.html#Bachelor_of_Computer_Application"><div class="tree-item-contents heading-link" heading-name="Bachelor of Computer Application"><span class="tree-item-title">Bachelor of Computer Application</span></div></a><div class="tree-item-children nav-folder-children"></div></div></div></div></div></div></div><script defer="">let rs = document.querySelector(".sidebar-right"); rs.classList.add("is-collapsed"); if (window.innerWidth > 768) rs.classList.remove("is-collapsed"); rs.style.setProperty("--sidebar-width", localStorage.getItem("sidebar-right-width"));</script></div></div></body></html>
\ No newline at end of file
diff --git a/lib/fonts/05b618077343fbbd92b7.ttf b/lib/fonts/05b618077343fbbd92b7.ttf
new file mode 100644
index 0000000..0878199
Binary files /dev/null and b/lib/fonts/05b618077343fbbd92b7.ttf differ
diff --git a/lib/fonts/2d5198822ab091ce4305.woff2 b/lib/fonts/2d5198822ab091ce4305.woff2
new file mode 100644
index 0000000..bc4be66
Binary files /dev/null and b/lib/fonts/2d5198822ab091ce4305.woff2 differ
diff --git a/lib/fonts/454577c22304619db035.ttf b/lib/fonts/454577c22304619db035.ttf
new file mode 100644
index 0000000..91a2a44
Binary files /dev/null and b/lib/fonts/454577c22304619db035.ttf differ
diff --git a/lib/fonts/4bb6ac751d1c5478ff3a.woff2 b/lib/fonts/4bb6ac751d1c5478ff3a.woff2
new file mode 100644
index 0000000..a89cf4c
Binary files /dev/null and b/lib/fonts/4bb6ac751d1c5478ff3a.woff2 differ
diff --git a/lib/fonts/52ac8f3034507f1d9e53.ttf b/lib/fonts/52ac8f3034507f1d9e53.ttf
new file mode 100644
index 0000000..c790e04
Binary files /dev/null and b/lib/fonts/52ac8f3034507f1d9e53.ttf differ
diff --git a/lib/fonts/535a6cf662596b3bd6a6.woff2 b/lib/fonts/535a6cf662596b3bd6a6.woff2
new file mode 100644
index 0000000..4a81dc7
Binary files /dev/null and b/lib/fonts/535a6cf662596b3bd6a6.woff2 differ
diff --git a/lib/fonts/70cc7ff27245e82ad414.ttf b/lib/fonts/70cc7ff27245e82ad414.ttf
new file mode 100644
index 0000000..3563e73
Binary files /dev/null and b/lib/fonts/70cc7ff27245e82ad414.ttf differ
diff --git a/lib/fonts/72505e6a122c6acd5471.woff2 b/lib/fonts/72505e6a122c6acd5471.woff2
new file mode 100644
index 0000000..f2ea706
Binary files /dev/null and b/lib/fonts/72505e6a122c6acd5471.woff2 differ
diff --git a/lib/fonts/94f2f163d4b698242fef.otf b/lib/fonts/94f2f163d4b698242fef.otf
new file mode 100644
index 0000000..263ae4c
Binary files /dev/null and b/lib/fonts/94f2f163d4b698242fef.otf differ
diff --git a/lib/fonts/b5f0f109bc88052d4000.woff2 b/lib/fonts/b5f0f109bc88052d4000.woff2
new file mode 100644
index 0000000..611e90c
Binary files /dev/null and b/lib/fonts/b5f0f109bc88052d4000.woff2 differ
diff --git a/lib/fonts/c8ba52b05a9ef10f4758.woff2 b/lib/fonts/c8ba52b05a9ef10f4758.woff2
new file mode 100644
index 0000000..6c2b689
Binary files /dev/null and b/lib/fonts/c8ba52b05a9ef10f4758.woff2 differ
diff --git a/lib/fonts/cb10ffd7684cd9836a05.woff2 b/lib/fonts/cb10ffd7684cd9836a05.woff2
new file mode 100644
index 0000000..a619fc5
Binary files /dev/null and b/lib/fonts/cb10ffd7684cd9836a05.woff2 differ
diff --git a/lib/fonts/cbe0ae49c52c920fd563.woff2 b/lib/fonts/cbe0ae49c52c920fd563.woff2
new file mode 100644
index 0000000..c24c2bd
Binary files /dev/null and b/lib/fonts/cbe0ae49c52c920fd563.woff2 differ
diff --git a/lib/html/file-tree.html b/lib/html/file-tree.html
new file mode 100644
index 0000000..f832c22
--- /dev/null
+++ b/lib/html/file-tree.html
@@ -0,0 +1 @@
+<div class="tree-container mod-root nav-folder tree-item file-tree mod-nav-indicator" data-depth="0"><div class="tree-header"><span class="sidebar-section-header">notes</span><button class="clickable-icon collapse-tree-button is-collapsed" aria-label="Collapse All"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></svg></button></div><div class="tree-scroll-area tree-item-children nav-folder-children"><div class="tree-item mod-tree-folder nav-folder mod-collapsible is-collapsed" style="display: none;"></div><div class="tree-item mod-tree-folder nav-folder mod-collapsible is-collapsed" data-depth="1"><div class="tree-link"><div class="tree-item-contents nav-folder-title"><div class="collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div><span class="tree-item-title nav-folder-title-content tree-item-inner">CV</span></div></div><div class="tree-item-children nav-folder-children" style="display: none;"><div class="tree-item mod-tree-file nav-file" data-depth="2"><a class="tree-link" href="cv/curriculum-vitae.html"><div class="tree-item-contents nav-file-title"><span class="tree-item-title nav-file-title-content tree-item-inner">Curriculum Vitae</span><div class="nav-file-tag">CANVAS</div></div></a><div class="tree-item-children nav-folder-children"></div></div></div></div></div></div>
\ No newline at end of file
diff --git a/lib/media/874d8b8e340f75575caa.svg b/lib/media/874d8b8e340f75575caa.svg
new file mode 100644
index 0000000..db5d5a6
--- /dev/null
+++ b/lib/media/874d8b8e340f75575caa.svg
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns='http://www.w3.org/2000/svg' class='i-external' viewBox='0 0 32 32' width='14' height='14' fill='none' stroke='#888888' stroke-linecap='round' stroke-linejoin='round' stroke-width='9.38%'><path d='M14 9 L3 9 3 29 23 29 23 18 M18 4 L28 4 28 14 M28 4 L14 18'/></svg>
diff --git a/lib/media/favicon.png b/lib/media/favicon.png
new file mode 100644
index 0000000..6f99489
Binary files /dev/null and b/lib/media/favicon.png differ
diff --git a/lib/metadata.json b/lib/metadata.json
new file mode 100644
index 0000000..10d39bc
--- /dev/null
+++ b/lib/metadata.json
@@ -0,0 +1,245 @@
+{
+  "vaultName": "notes",
+  "lastExport": 1711874329247,
+  "pluginVersion": "1.8.01",
+  "validBodyClasses": "publish css-settings-manager theme-dark show-inline-title",
+  "useCustomHeadContent": false,
+  "useCustomFavicon": false,
+  "files": [
+    "CV/Curriculum Vitae.canvas",
+    "lib/scripts/graph-wasm.wasm",
+    "lib/fonts/94f2f163d4b698242fef.otf",
+    "lib/fonts/72505e6a122c6acd5471.woff2",
+    "lib/fonts/2d5198822ab091ce4305.woff2",
+    "lib/fonts/c8ba52b05a9ef10f4758.woff2",
+    "lib/fonts/cb10ffd7684cd9836a05.woff2",
+    "lib/fonts/b5f0f109bc88052d4000.woff2",
+    "lib/fonts/cbe0ae49c52c920fd563.woff2",
+    "lib/fonts/535a6cf662596b3bd6a6.woff2",
+    "lib/fonts/70cc7ff27245e82ad414.ttf",
+    "lib/fonts/454577c22304619db035.ttf",
+    "lib/fonts/52ac8f3034507f1d9e53.ttf",
+    "lib/fonts/05b618077343fbbd92b7.ttf",
+    "lib/fonts/4bb6ac751d1c5478ff3a.woff2",
+    "lib/media/874d8b8e340f75575caa.svg",
+    "lib/html/file-tree.html",
+    "lib/scripts/webpage.js",
+    "lib/scripts/graph-view.js",
+    "lib/scripts/graph-wasm.js",
+    "lib/scripts/graph-render-worker.js",
+    "lib/scripts/tinycolor.js",
+    "lib/scripts/pixi.js",
+    "lib/scripts/minisearch.js",
+    "lib/media/favicon.png",
+    "lib/scripts/graph-data.js",
+    "lib/styles/obsidian.css",
+    "lib/styles/global-variable-styles.css",
+    "lib/styles/main-styles.css"
+  ],
+  "mainDependencies": [
+    "lib/scripts/graph-wasm.wasm",
+    "lib/fonts/94f2f163d4b698242fef.otf",
+    "lib/fonts/72505e6a122c6acd5471.woff2",
+    "lib/fonts/2d5198822ab091ce4305.woff2",
+    "lib/fonts/c8ba52b05a9ef10f4758.woff2",
+    "lib/fonts/cb10ffd7684cd9836a05.woff2",
+    "lib/fonts/b5f0f109bc88052d4000.woff2",
+    "lib/fonts/cbe0ae49c52c920fd563.woff2",
+    "lib/fonts/535a6cf662596b3bd6a6.woff2",
+    "lib/fonts/70cc7ff27245e82ad414.ttf",
+    "lib/fonts/454577c22304619db035.ttf",
+    "lib/fonts/52ac8f3034507f1d9e53.ttf",
+    "lib/fonts/05b618077343fbbd92b7.ttf",
+    "lib/fonts/4bb6ac751d1c5478ff3a.woff2",
+    "lib/media/874d8b8e340f75575caa.svg",
+    "lib/html/file-tree.html",
+    "lib/scripts/webpage.js",
+    "lib/scripts/graph-view.js",
+    "lib/scripts/graph-wasm.js",
+    "lib/scripts/graph-render-worker.js",
+    "lib/scripts/tinycolor.js",
+    "lib/scripts/pixi.js",
+    "lib/scripts/minisearch.js",
+    "lib/media/favicon.png",
+    "lib/scripts/graph-data.js",
+    "lib/styles/obsidian.css",
+    "lib/styles/global-variable-styles.css",
+    "lib/styles/main-styles.css"
+  ],
+  "fileInfo": {
+    "CV/Curriculum Vitae.canvas": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 4010,
+      "exportedPath": "cv/curriculum-vitae.html",
+      "dependencies": []
+    },
+    "lib/scripts/graph-wasm.wasm": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 23377,
+      "exportedPath": "lib/scripts/graph-wasm.wasm",
+      "dependencies": []
+    },
+    "lib/fonts/94f2f163d4b698242fef.otf": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 66800,
+      "exportedPath": "lib/fonts/94f2f163d4b698242fef.otf",
+      "dependencies": []
+    },
+    "lib/fonts/72505e6a122c6acd5471.woff2": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 104232,
+      "exportedPath": "lib/fonts/72505e6a122c6acd5471.woff2",
+      "dependencies": []
+    },
+    "lib/fonts/2d5198822ab091ce4305.woff2": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 104332,
+      "exportedPath": "lib/fonts/2d5198822ab091ce4305.woff2",
+      "dependencies": []
+    },
+    "lib/fonts/c8ba52b05a9ef10f4758.woff2": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 98868,
+      "exportedPath": "lib/fonts/c8ba52b05a9ef10f4758.woff2",
+      "dependencies": []
+    },
+    "lib/fonts/cb10ffd7684cd9836a05.woff2": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 106876,
+      "exportedPath": "lib/fonts/cb10ffd7684cd9836a05.woff2",
+      "dependencies": []
+    },
+    "lib/fonts/b5f0f109bc88052d4000.woff2": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 105804,
+      "exportedPath": "lib/fonts/b5f0f109bc88052d4000.woff2",
+      "dependencies": []
+    },
+    "lib/fonts/cbe0ae49c52c920fd563.woff2": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 106108,
+      "exportedPath": "lib/fonts/cbe0ae49c52c920fd563.woff2",
+      "dependencies": []
+    },
+    "lib/fonts/535a6cf662596b3bd6a6.woff2": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 111708,
+      "exportedPath": "lib/fonts/535a6cf662596b3bd6a6.woff2",
+      "dependencies": []
+    },
+    "lib/fonts/70cc7ff27245e82ad414.ttf": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 192740,
+      "exportedPath": "lib/fonts/70cc7ff27245e82ad414.ttf",
+      "dependencies": []
+    },
+    "lib/fonts/454577c22304619db035.ttf": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 161376,
+      "exportedPath": "lib/fonts/454577c22304619db035.ttf",
+      "dependencies": []
+    },
+    "lib/fonts/52ac8f3034507f1d9e53.ttf": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 191568,
+      "exportedPath": "lib/fonts/52ac8f3034507f1d9e53.ttf",
+      "dependencies": []
+    },
+    "lib/fonts/05b618077343fbbd92b7.ttf": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 155288,
+      "exportedPath": "lib/fonts/05b618077343fbbd92b7.ttf",
+      "dependencies": []
+    },
+    "lib/fonts/4bb6ac751d1c5478ff3a.woff2": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 7876,
+      "exportedPath": "lib/fonts/4bb6ac751d1c5478ff3a.woff2",
+      "dependencies": []
+    },
+    "lib/media/874d8b8e340f75575caa.svg": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 317,
+      "exportedPath": "lib/media/874d8b8e340f75575caa.svg",
+      "dependencies": []
+    },
+    "lib/html/file-tree.html": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 1652,
+      "exportedPath": "lib/html/file-tree.html",
+      "dependencies": []
+    },
+    "lib/scripts/webpage.js": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 47290,
+      "exportedPath": "lib/scripts/webpage.js",
+      "dependencies": []
+    },
+    "lib/scripts/graph-view.js": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 15519,
+      "exportedPath": "lib/scripts/graph-view.js",
+      "dependencies": []
+    },
+    "lib/scripts/graph-wasm.js": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 14021,
+      "exportedPath": "lib/scripts/graph-wasm.js",
+      "dependencies": []
+    },
+    "lib/scripts/graph-render-worker.js": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 5179,
+      "exportedPath": "lib/scripts/graph-render-worker.js",
+      "dependencies": []
+    },
+    "lib/scripts/tinycolor.js": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 29832,
+      "exportedPath": "lib/scripts/tinycolor.js",
+      "dependencies": []
+    },
+    "lib/scripts/pixi.js": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 449509,
+      "exportedPath": "lib/scripts/pixi.js",
+      "dependencies": []
+    },
+    "lib/scripts/minisearch.js": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 29422,
+      "exportedPath": "lib/scripts/minisearch.js",
+      "dependencies": []
+    },
+    "lib/media/favicon.png": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 1105,
+      "exportedPath": "lib/media/favicon.png",
+      "dependencies": []
+    },
+    "lib/scripts/graph-data.js": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 291,
+      "exportedPath": "lib/scripts/graph-data.js",
+      "dependencies": []
+    },
+    "lib/styles/obsidian.css": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 144405,
+      "exportedPath": "lib/styles/obsidian.css",
+      "dependencies": []
+    },
+    "lib/styles/global-variable-styles.css": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 236,
+      "exportedPath": "lib/styles/global-variable-styles.css",
+      "dependencies": []
+    },
+    "lib/styles/main-styles.css": {
+      "modifiedTime": 1711874329247,
+      "sourceSize": 23130,
+      "exportedPath": "lib/styles/main-styles.css",
+      "dependencies": []
+    }
+  }
+}
\ No newline at end of file
diff --git a/lib/rss.xml b/lib/rss.xml
new file mode 100644
index 0000000..4553c8a
--- /dev/null
+++ b/lib/rss.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[notes]]></title><description><![CDATA[Obsidian digital garden]]></description><link>http://github.com/dylang/node-rss</link><image><url>lib\media\favicon.png</url><title>notes</title><link></link></image><generator>Webpage HTML Export plugin for Obsidian</generator><lastBuildDate>Sun, 31 Mar 2024 08:38:50 GMT</lastBuildDate><atom:link href="lib\rss.xml" rel="self" type="application/rss+xml"/><pubDate>Sun, 31 Mar 2024 08:38:49 GMT</pubDate><ttl>60</ttl><dc:creator></dc:creator></channel></rss>
\ No newline at end of file
diff --git a/lib/scripts/graph-data.js b/lib/scripts/graph-data.js
new file mode 100644
index 0000000..1415b43
--- /dev/null
+++ b/lib/scripts/graph-data.js
@@ -0,0 +1 @@
+let graphData={graphOptions:{attractionForce:1,linkLength:10,repulsionForce:150,centralForce:3,edgePruning:100,minNodeRadius:3,maxNodeRadius:7},isInitialized:!0,paths:["cv/curriculum-vitae.html"],nodeCount:1,linkSources:[],linkTargets:[],labels:["Curriculum Vitae"],radii:[null],linkCount:0}
\ No newline at end of file
diff --git a/lib/scripts/graph-render-worker.js b/lib/scripts/graph-render-worker.js
new file mode 100644
index 0000000..01a4c7e
--- /dev/null
+++ b/lib/scripts/graph-render-worker.js
@@ -0,0 +1 @@
+if("function"==typeof importScripts){let e,t,o;importScripts("https://d157l7jdn8e5sf.cloudfront.net/v7.2.0/webworker.js","./tinycolor.js"),addEventListener("message",onMessage),isDrawing=!1;let n=0,a=[],r=[],i=0,l=[],c=[],d=[],s=[],u=[],g={x:0,y:0},p=new Float32Array(0),h=0,f=0,y={background:2302755,link:11184810,node:13421772,outline:11184810,text:16777215,accent:4203434},S=-1,x=-1,v=-1,m=!1,w=[],b=-1,C=1,k=1;function toScreenSpace(e,t,o=!0){return o?{x:Math.floor(e*C+g.x),y:Math.floor(t*C+g.y)}:{x:e*C+g.x,y:t*C+g.y}}function vecToScreenSpace({x:e,y:t},o=!0){return toScreenSpace(e,t,o)}function toWorldspace(e,t){return{x:(e-g.x)/C,y:(t-g.y)/C}}function vecToWorldspace({x:e,y:t}){return toWorldspace(e,t)}function setCameraCenterWorldspace({x:e,y:t}){g.x=canvas.width/2-e*C,g.y=canvas.height/2-t*C}function getCameraCenterWorldspace(){return toWorldspace(canvas.width/2,canvas.height/2)}function getNodeScreenRadius(e){return e*k}function getNodeWorldspaceRadius(e){return e/k}function getPosition(e){return{x:p[2*e],y:p[2*e+1]}}function mixColors(e,t,o){return tinycolor.mix(tinycolor(e.toString(16)),tinycolor(t.toString(16)),o).toHexNumber()}function darkenColor(e,t){return tinycolor(e.toString(16)).darken(t).toHexNumber()}function lightenColor(e,t){return tinycolor(e.toString(16)).lighten(t).toHexNumber()}function invertColor(e,t){for(e=e.toString(16);e.length<6;)e="0"+e;if(0===e.indexOf("#")&&(e=e.slice(1)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),6!==e.length)throw new Error("Invalid HEX color:"+e);var o=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),a=parseInt(e.slice(4,6),16);return t?.299*o+.587*n+.114*a>186?"#000000":"#FFFFFF":(o=(255-o).toString(16),n=(255-n).toString(16),a=(255-a).toString(16),"#"+padZero(o)+padZero(n)+padZero(a))}function clamp(e,t,o){return Math.min(Math.max(e,t),o)}function lerp(e,t,o){return e+(t-e)*o}let N=0,T=.2,F=15,M=12,P=F/M;function showLabel(e,t,o=!1){let n=u[e];if(!n)return;if(d[e]=t,!(t>.01))return void hideLabel(e);n.visible=!0,n.style.fontSize=o?F:M;let a=vecToScreenSpace(getPosition(e)),r=s[e]*(o?P:1)/2;n.x=a.x-r,n.y=a.y+getNodeScreenRadius(l[e])+9,n.alpha=t}function hideLabel(e){u[e].visible=!1}function draw(){o.clear();let e=[];m&&(w=[]),N=-1!=S||-1!=v?Math.min(1,N+T):Math.max(0,N-T),o.lineStyle(1,mixColors(y.link,y.background,50*N),.7);for(let t=0;t<n;t++){let n=r[t],i=a[t];S!=i&&S!=n&&(x!=i&&x!=n||0==N)||(m&&S==i?w.push(n):m&&S==n&&w.push(i),e.push(t));let c=getPosition(i),d=getPosition(n),s=vecToScreenSpace(c),u=vecToScreenSpace(d);Math.sqrt(Math.pow(c.x-d.x,2)+Math.pow(c.y-d.y,2))<(l[i]+l[n])*f&&(o.moveTo(s.x,s.y),o.lineTo(u.x,u.y))}let t=1-.5*N;o.beginFill(mixColors(y.node,y.background,50*N),t),o.lineStyle(0,16777215);for(let e=0;e<i;e++){let t=getNodeScreenRadius(l[e]);if(S!=e)if(t>2){showLabel(e,lerp(0,(t-4)/8-1/k/6*.9,Math.max(1-N,.2)))}else hideLabel(e);if(S==e||x==e&&0!=N||-1!=S&&w.includes(e))continue;let n=vecToScreenSpace(getPosition(e));o.drawCircle(n.x,n.y,t)}o.endFill(),t=.7*N,o.lineStyle(1,mixColors(mixColors(y.link,y.accent,100*N),y.background,20),t);for(let t=0;t<e.length;t++){let n=r[e[t]],i=vecToScreenSpace(getPosition(a[e[t]])),l=vecToScreenSpace(getPosition(n));o.moveTo(i.x,i.y),o.lineTo(l.x,l.y)}if(-1!=S||-1!=x&&0!=N){o.beginFill(mixColors(y.node,y.accent,20*N),.9),o.lineStyle(0,16777215);for(let e=0;e<w.length;e++){let t=w[e],n=vecToScreenSpace(getPosition(t));o.drawCircle(n.x,n.y,getNodeScreenRadius(l[t])),showLabel(t,Math.max(.6*N,d[t]))}o.endFill();let e=-1!=S?S:x,t=vecToScreenSpace(getPosition(e));o.beginFill(mixColors(y.node,y.accent,100*N),1),o.lineStyle(N,mixColors(invertColor(y.background,!0),y.accent,50)),o.drawCircle(t.x,t.y,getNodeScreenRadius(l[e])),o.endFill(),showLabel(e,Math.max(N,d[e]),!0)}if(m=!1,o.lineStyle(2,y.accent),-1!=b){let e=vecToScreenSpace(getPosition(b));o.drawCircle(e.x,e.y,getNodeScreenRadius(l[b])+4)}}function onMessage(w){if("draw"==w.data.type)p=new Float32Array(w.data.positions),draw();else if("update_camera"==w.data.type)g=w.data.cameraOffset,C=w.data.cameraScale,k=Math.sqrt(C);else if("update_interaction"==w.data.type)S!=w.data.hoveredNode&&-1!=w.data.hoveredNode&&(m=!0),v!=w.data.grabbedNode&&-1!=w.data.hoveredNode&&(m=!0),x=-1==w.data.hoveredNode?S:-1,S=w.data.hoveredNode,v=w.data.grabbedNode;else if("resize"==w.data.type)e.renderer.resize(w.data.width,w.data.height);else if("set_active"==w.data.type)b=w.data.active;else if("update_colors"==w.data.type){y=w.data.colors;for(let e of u)e.style.fill=invertColor(y.background,!0)}else if("init"==w.data.type){n=w.data.linkCount,a=w.data.linkSources,r=w.data.linkTargets,i=w.data.nodeCount,l=w.data.radii,c=w.data.labels,h=w.data.linkLength,f=w.data.edgePruning,e=new PIXI.Application({...w.data.options,antialias:!0,resolution:2,backgroundAlpha:0,transparent:!0}),t=new PIXI.Container,o=new PIXI.Graphics,e.stage.addChild(t),t.addChild(o),u=[];for(let t=0;t<i;t++){let o=new PIXI.Text(c[t],{fontFamily:"Arial",fontSize:12,fontWeight:"normal",fill:invertColor(y.background,!0),align:"center",anchor:.5});u.push(o),s.push(o.width),d.push(0),e.stage.addChild(o)}}else console.log("Unknown message type sent to graph worker: "+w.data.type)}}
\ No newline at end of file
diff --git a/lib/scripts/graph-view.js b/lib/scripts/graph-view.js
new file mode 100644
index 0000000..eaf4ea0
--- /dev/null
+++ b/lib/scripts/graph-view.js
@@ -0,0 +1 @@
+var running=!1;let pixiApp,graphRenderer,batchFraction=1,minBatchFraction=.3,dt=1,targetFPS=40,startingCameraRect={minX:-1,minY:-1,maxX:1,maxY:1},mouseWorldPos={x:void 0,y:void 0},scrollVelocity=0,averageFPS=2*targetFPS;class GraphAssembly{static nodeCount=0;static linkCount=0;static hoveredNode=-1;static#e=0;static#r=0;static#t=0;static#a=0;static#s=0;static linkSources=new Int32Array(0);static linkTargets=new Int32Array(0);static radii=new Float32Array(0);static maxRadius=0;static averageRadius=0;static minRadius=0;static init(e){GraphAssembly.nodeCount=e.nodeCount,GraphAssembly.linkCount=e.linkCount;let r=new Float32Array(2*GraphAssembly.nodeCount);GraphAssembly.radii=new Float32Array(e.radii),GraphAssembly.linkSources=new Int32Array(e.linkSources),GraphAssembly.linkTargets=new Int32Array(e.linkTargets),GraphAssembly.#e=Module._malloc(r.byteLength),GraphAssembly.#r=r.byteLength,GraphAssembly.#t=Module._malloc(GraphAssembly.radii.byteLength),GraphAssembly.#a=Module._malloc(GraphAssembly.linkSources.byteLength),GraphAssembly.#s=Module._malloc(GraphAssembly.linkTargets.byteLength),GraphAssembly.maxRadius=GraphAssembly.radii.reduce(((e,r)=>Math.max(e,r))),GraphAssembly.averageRadius=GraphAssembly.radii.reduce(((e,r)=>e+r))/GraphAssembly.radii.length,GraphAssembly.minRadius=GraphAssembly.radii.reduce(((e,r)=>Math.min(e,r))),r=this.loadState(),Module.HEAP32.set(new Int32Array(r.buffer),GraphAssembly.#e/r.BYTES_PER_ELEMENT),Module.HEAP32.set(new Int32Array(GraphAssembly.radii.buffer),GraphAssembly.#t/GraphAssembly.radii.BYTES_PER_ELEMENT),Module.HEAP32.set(new Int32Array(GraphAssembly.linkSources.buffer),GraphAssembly.#a/GraphAssembly.linkSources.BYTES_PER_ELEMENT),Module.HEAP32.set(new Int32Array(GraphAssembly.linkTargets.buffer),GraphAssembly.#s/GraphAssembly.linkTargets.BYTES_PER_ELEMENT),Module._Init(GraphAssembly.#e,GraphAssembly.#t,GraphAssembly.#a,GraphAssembly.#s,GraphAssembly.nodeCount,GraphAssembly.linkCount,batchFraction,dt,e.graphOptions.attractionForce,e.graphOptions.linkLength,e.graphOptions.repulsionForce,e.graphOptions.centralForce)}static get positions(){return Module.HEAP32.buffer.slice(GraphAssembly.#e,GraphAssembly.#e+GraphAssembly.#r)}static saveState(e){localStorage.setItem("positions",JSON.stringify(new Float32Array(GraphAssembly.positions).map((e=>Math.round(e)))))}static loadState(){let e=localStorage.getItem("positions"),r=null;if(e&&(r=new Float32Array(Object.values(JSON.parse(e)))),!r||!e||r.length!=2*GraphAssembly.nodeCount){r=new Float32Array(2*GraphAssembly.nodeCount);let e=GraphAssembly.averageRadius*Math.sqrt(GraphAssembly.nodeCount)*2;for(let t=0;t<GraphAssembly.nodeCount;t++){let a=(1-GraphAssembly.radii[t]/GraphAssembly.maxRadius)*e;r[2*t]=Math.cos(t/GraphAssembly.nodeCount*7.41*2*Math.PI)*a,r[2*t+1]=Math.sin(t/GraphAssembly.nodeCount*7.41*2*Math.PI)*a}}let t=1/0,a=-1/0,s=1/0,i=-1/0;for(let e=0;e<GraphAssembly.nodeCount-1;e+=2){let o={x:r[e],y:r[e+1]};t=Math.min(t,o.x),a=Math.max(a,o.x),s=Math.min(s,o.y),i=Math.max(i,o.y)}return startingCameraRect={minX:t-50,minY:s-50,maxX:a+50,maxY:i+50},r}static update(e,r,t){GraphAssembly.hoveredNode=Module._Update(e.x,e.y,r,t)}static free(){Module._free(GraphAssembly.#e),Module._free(GraphAssembly.#t),Module._free(GraphAssembly.#a),Module._free(GraphAssembly.#s),Module._FreeMemory()}static set batchFraction(e){Module._SetBatchFractionSize(e)}static set attractionForce(e){Module._SetAttractionForce(e)}static set repulsionForce(e){Module._SetRepulsionForce(e)}static set centralForce(e){Module._SetCentralForce(e)}static set linkLength(e){Module._SetLinkLength(e)}static set dt(e){Module._SetDt(e)}}class GraphRenderWorker{#i;#o;#n;#h;#d;#l;#c;constructor(){this.canvas=document.querySelector("#graph-canvas"),this.canvasSidebar=void 0;try{this.canvasSidebar=document.querySelector(".sidebar:has(#graph-canvas)")}catch(e){console.log("Error: "+e+"\n\n Using fallback.");let r=document.querySelector(".sidebar-right"),t=document.querySelector(".sidebar-left");this.canvasSidebar=r.querySelector("#graph-canvas")?r:t}this.view=this.canvas.transferControlToOffscreen(),this.worker=new Worker(new URL("./graph-render-worker.js",import.meta.url)),this.#i={x:0,y:0},this.#o=1,this.#n=-1,this.#h=-1,this.#d={background:0,link:0,node:0,outline:0,text:0,accent:0},this.#l=0,this.#c=0,this.cameraOffset={x:this.canvas.width/2,y:this.canvas.height/2},this.cameraScale=1,this.hoveredNode=-1,this.grabbedNode=-1,this.resampleColors(),this.#p(),this.width=this.canvas.width,this.height=this.canvas.height,this.autoResizeCanvas(),this.fitToRect(startingCameraRect)}#p(){let{width:e,height:r}=this.view;this.worker.postMessage({type:"init",linkCount:GraphAssembly.linkCount,linkSources:GraphAssembly.linkSources,linkTargets:GraphAssembly.linkTargets,nodeCount:GraphAssembly.nodeCount,radii:GraphAssembly.radii,labels:graphData.labels,linkLength:graphData.graphOptions.linkLength,edgePruning:graphData.graphOptions.edgePruning,options:{width:e,height:r,view:this.view}},[this.view])}fitToRect(e){let r=e.minX,t=e.minY,a=e.maxX-r,s=e.maxY-t,i=1/Math.min(a/this.width,s/this.height);this.cameraScale=i,this.cameraOffset={x:this.width/2-(e.minX+a/2)*i,y:this.height/2-(e.minY+s/2)*i}}fitToNodes(){this.fitToRect(startingCameraRect)}sampleColor(e){let r=document.createElement("div");document.body.appendChild(r),r.style.setProperty("display","none"),r.style.setProperty("color","var("+e+")");let t=getComputedStyle(r).color,a=getComputedStyle(r).opacity;r.remove();let s=(i=t.match(/rgb?\((\d+),\s*(\d+),\s*(\d+)\)/))?{red:parseInt(i[1]),green:parseInt(i[2]),blue:parseInt(i[3]),alpha:1}:null;var i;return{a:parseFloat(a)*s?.alpha??1??1,rgb:s?.red<<16|s?.green<<8|s?.blue??8947848}}resampleColors(){this.colors={background:this.sampleColor("--background-secondary").rgb,link:this.sampleColor("--graph-line").rgb,node:this.sampleColor("--graph-node").rgb,outline:this.sampleColor("--graph-line").rgb,text:this.sampleColor("--graph-text").rgb,accent:this.sampleColor("--interactive-accent").rgb}}draw(e){this.worker.postMessage({type:"draw",positions:e},[e])}resizeCanvas(e,r){this.worker.postMessage({type:"resize",width:e,height:r}),this.#l=e,this.#c=r}autoResizeCanvas(){this.width==this.canvas.offsetWidth&&this.height==this.canvas.offsetHeight||(this.centerCamera(),this.resizeCanvas(this.canvas.offsetWidth,this.canvas.offsetHeight))}centerCamera(){this.cameraOffset={x:this.width/2,y:this.height/2}}#m(e,r){let t={type:"update_interaction",hoveredNode:e,grabbedNode:r};this.worker.postMessage(t)}#g(e,r){this.worker.postMessage({type:"update_camera",cameraOffset:e,cameraScale:r})}#u(e){this.worker.postMessage({type:"update_colors",colors:e})}set cameraOffset(e){this.#i=e,this.#g(e,this.cameraScale)}set cameraScale(e){this.#o=e,this.#g(this.cameraOffset,e)}get cameraOffset(){return this.#i}get cameraScale(){return this.#o}set hoveredNode(e){this.#n=e,this.#m(e,this.#h)}set grabbedNode(e){this.#h=e,this.#m(this.#n,e)}set activeNode(e){this.worker.postMessage({type:"set_active",active:e})}get hoveredNode(){return this.#n}get grabbedNode(){return this.#h}set colors(e){this.#d=e,this.#u(e)}get colors(){return this.#d}set width(e){this.#l=e,this.resizeCanvas(e,this.#c)}set height(e){this.#c=e,this.resizeCanvas(this.#l,e)}get height(){return this.#c}get width(){return this.#l}toScreenSpace(e,r,t=!0){return t?{x:Math.floor(e*this.cameraScale+this.cameraOffset.x),y:Math.floor(r*this.cameraScale+this.cameraOffset.y)}:{x:e*this.cameraScale+this.cameraOffset.x,y:r*this.cameraScale+this.cameraOffset.y}}vecToScreenSpace(e,r=!0){return this.toScreenSpace(e.x,e.y,r)}toWorldspace(e,r){return{x:(e-this.cameraOffset.x)/this.cameraScale,y:(r-this.cameraOffset.y)/this.cameraScale}}vecToWorldspace(e){return this.toWorldspace(e.x,e.y)}setCameraCenterWorldspace({x:e,y:r}){this.cameraOffset={x:this.width/2-e*this.cameraScale,y:this.height/2-r*this.cameraScale}}getCameraCenterWorldspace(){return this.toWorldspace(this.width/2,this.height/2)}}async function initializeGraphView(){running||(running=!0,graphData.graphOptions.repulsionForce/=batchFraction,pixiApp=new PIXI.Application,console.log("Module Ready"),GraphAssembly.init(graphData),graphRenderer=new GraphRenderWorker,window.graphRenderer=graphRenderer,initializeGraphEvents(),pixiApp.ticker.maxFPS=targetFPS,pixiApp.ticker.add(updateGraph),setActiveDocument(new URL(window.location.href),!1,!1),setInterval((()=>{try{var e=graphRenderer.canvasSidebar.classList.contains("is-collapsed")}catch(e){return}running&&e?running=!1:running||e||(running=!0,graphRenderer.autoResizeCanvas(),graphRenderer.centerCamera())}),1e3))}let firstUpdate=!0;function updateGraph(){if(running&&!graphRenderer.canvasSidebar.classList.contains("is-collapsed")&&(firstUpdate&&(setTimeout((()=>graphRenderer?.canvas?.classList.remove("hide")),500),firstUpdate=!1),GraphAssembly.update(mouseWorldPos,graphRenderer.grabbedNode,graphRenderer.cameraScale),GraphAssembly.hoveredNode!=graphRenderer.hoveredNode&&(graphRenderer.hoveredNode=GraphAssembly.hoveredNode,graphRenderer.canvas.style.cursor=-1==GraphAssembly.hoveredNode?"default":"pointer"),graphRenderer.autoResizeCanvas(),graphRenderer.draw(GraphAssembly.positions),averageFPS=.95*averageFPS+.05*pixiApp.ticker.FPS,averageFPS<.8*targetFPS&&batchFraction>minBatchFraction&&(batchFraction=Math.max(batchFraction-.5/targetFPS,minBatchFraction),GraphAssembly.batchFraction=batchFraction,GraphAssembly.repulsionForce=graphData.graphOptions.repulsionForce/batchFraction),averageFPS>1.2*targetFPS&&batchFraction<1&&(batchFraction=Math.min(batchFraction+.5/targetFPS,1),GraphAssembly.batchFraction=batchFraction,GraphAssembly.repulsionForce=graphData.graphOptions.repulsionForce/batchFraction),0!=scrollVelocity)){graphRenderer.getCameraCenterWorldspace();Math.abs(scrollVelocity)<.001&&(scrollVelocity=0),zoomGraphViewAroundPoint(mouseWorldPos,scrollVelocity),scrollVelocity*=.65}}function zoomGraphViewAroundPoint(e,r,t=.15,a=15){let s=graphRenderer.getCameraCenterWorldspace();if(graphRenderer.cameraScale=Math.max(Math.min(graphRenderer.cameraScale+r*graphRenderer.cameraScale,a),t),graphRenderer.cameraScale!=t&&graphRenderer.cameraScale!=a&&scrollVelocity>0&&null!=mouseWorldPos.x&&null!=mouseWorldPos.y){let t={x:e.x-s.x,y:e.y-s.y},a={x:s.x+t.x*r,y:s.y+t.y*r};graphRenderer.setCameraCenterWorldspace(a)}else graphRenderer.setCameraCenterWorldspace(s)}function scaleGraphViewAroundPoint(e,r,t=.15,a=15){let s=graphRenderer.getCameraCenterWorldspace(),i=graphRenderer.cameraScale;graphRenderer.cameraScale=Math.max(Math.min(r*graphRenderer.cameraScale,a),t);let o=(i-graphRenderer.cameraScale)/i;if(graphRenderer.cameraScale!=t&&graphRenderer.cameraScale!=a&&0!=r){let r={x:e.x-s.x,y:e.y-s.y},t={x:s.x-r.x*o,y:s.y-r.y*o};graphRenderer.setCameraCenterWorldspace(t)}else graphRenderer.setCameraCenterWorldspace(s)}function initializeGraphEvents(){window.addEventListener("beforeunload",(()=>{running=!1,GraphAssembly.free()}));let e=!1,r=graphRenderer.canvas.width;window.addEventListener("resize",(()=>{(e||graphRenderer.canvas.width!=r)&&(graphRenderer.autoResizeCanvas(),graphRenderer.centerCamera())}));let t=document.querySelector(".graph-view-container");function a(e){e.composedPath().includes(t)||s()}function s(){let r=t.clientWidth,s=t.clientHeight;t.classList.add("scale-down"),t.animate({opacity:0},{duration:100,easing:"ease-in",fill:"forwards"}).addEventListener("finish",(function(){t.classList.toggle("expanded"),graphRenderer.autoResizeCanvas(),graphRenderer.centerCamera();let e=t.clientWidth,a=t.clientHeight;graphRenderer.cameraScale*=(e/r+a/s)/2,t.classList.remove("scale-down"),t.classList.add("scale-up"),updateGraph(),t.animate({opacity:1},{duration:200,easing:"ease-out",fill:"forwards"}).addEventListener("finish",(function(){t.classList.remove("scale-up")}))})),e=!e,e?document.addEventListener("pointerdown",a):document.removeEventListener("pointerdown",a)}function i(e){var r=graphRenderer.canvas.getBoundingClientRect();let t=getPointerPosition(e);return{x:t.x-r.left,y:t.y-r.top}}let o={x:0,y:0},n={x:0,y:0},h={x:0,y:0},d={x:0,y:0},l={x:0,y:0},c=0,p=!1,m=!1,g=!1,u=document.querySelector(".graph-view-container"),y=-1;u.addEventListener("pointerenter",(function(r){let t=0,a=!1;function b(e){n=i(e),mouseWorldPos=graphRenderer.vecToWorldspace(n),d={x:n.x-h.x,y:n.y-h.y},h=n,-1!=graphRenderer.grabbedNode&&(l={x:n.x-o.x,y:n.y-o.y}),p&&-1!=graphRenderer.hoveredNode&&-1==graphRenderer.grabbedNode&&graphRenderer.hoveredNode!=graphRenderer.grabbedNode&&(graphRenderer.grabbedNode=graphRenderer.hoveredNode),p&&-1==graphRenderer.hoveredNode&&-1==graphRenderer.grabbedNode||m?graphRenderer.cameraOffset={x:graphRenderer.cameraOffset.x+d.x,y:graphRenderer.cameraOffset.y+d.y}:-1!=graphRenderer.hoveredNode?graphRenderer.canvas.style.cursor="pointer":graphRenderer.canvas.style.cursor="default"}function v(e){if(1==e.touches?.length)return a&&(h=i(e),a=!1),void b(e);if(2==e.touches?.length){let r=getTouchPosition(e.touches[0]),s=getTouchPosition(e.touches[1]);n=i(e),d={x:n.x-h.x,y:n.y-h.y},h=n;let o=Math.sqrt(Math.pow(r.x-s.x,2)+Math.pow(r.y-s.y,2));a||(a=!0,t=o,d={x:0,y:0},mouseWorldPos={x:void 0,y:void 0},graphRenderer.grabbedNode=-1,graphRenderer.hoveredNode=-1);let l=(o-t)/t;scaleGraphViewAroundPoint(graphRenderer.vecToWorldspace(n),1+l,.15,15),graphRenderer.cameraOffset={x:graphRenderer.cameraOffset.x+d.x,y:graphRenderer.cameraOffset.y+d.y},t=o}}function f(r){document.removeEventListener("pointerup",f);let t=Date.now();setTimeout((()=>{p&&-1!=graphRenderer.hoveredNode&&Math.abs(l.x)<=4&&Math.abs(l.y)<=4&&t-c<300&&async function(r){e?s():GraphAssembly.saveState(graphRenderer);let t=graphData.paths[r];window.location.pathname.endsWith(graphData.paths[r])||await loadDocument(t,!0,!0)}(graphRenderer.hoveredNode),p&&-1!=graphRenderer.grabbedNode&&(graphRenderer.grabbedNode=-1),0==r.button&&(p=!1),"touch"==r.pointerType&&y==r.pointerId&&(y=-1,p=!1),1==r.button&&(m=!1),g||(document.removeEventListener("mousemove",b),document.removeEventListener("touchmove",v))}),0)}function R(e){document.addEventListener("pointerup",f),mouseWorldPos=graphRenderer.vecToWorldspace(n),l={x:0,y:0},0==e.button&&(p=!0),"touch"==e.pointerType&&-1==y&&(y=e.pointerId,p=!0),1==e.button&&(m=!0),o=n,c=Date.now(),p&&-1!=graphRenderer.hoveredNode&&(graphRenderer.grabbedNode=graphRenderer.hoveredNode)}n=i(r),mouseWorldPos=graphRenderer.vecToWorldspace(n),h=i(r),g=!0,document.addEventListener("mousemove",b),document.addEventListener("touchmove",v),u.addEventListener("pointerdown",R),u.addEventListener("pointerleave",(function e(r){setTimeout((()=>{g=!1,p||(document.removeEventListener("mousemove",b),document.removeEventListener("touchmove",v),mouseWorldPos={x:void 0,y:void 0}),u.removeEventListener("pointerdown",R),u.removeEventListener("pointerleave",e)}),1)}))})),document.querySelector(".graph-expand.graph-icon")?.addEventListener("click",(e=>{e.stopPropagation(),s()})),u.addEventListener("wheel",(function(e){let r=.09;e.deltaY>0?(scrollVelocity>=-.09&&(scrollVelocity=-.09),scrollVelocity*=1.4):(scrollVelocity<=r&&(scrollVelocity=r),scrollVelocity*=1.4)})),u.addEventListener("dblclick",(function(e){graphRenderer.fitToNodes()})),document.querySelector(".theme-toggle-input")?.addEventListener("change",(e=>{setTimeout((()=>graphRenderer.resampleColors()),0)}))}window.addEventListener("load",(()=>{waitLoadScripts(["pixi","graph-data","graph-render-worker","graph-wasm"],(()=>{Module.onRuntimeInitialized=initializeGraphView,setTimeout((()=>Module.onRuntimeInitialized()),300)}))}))
\ No newline at end of file
diff --git a/lib/scripts/graph-wasm.js b/lib/scripts/graph-wasm.js
new file mode 100644
index 0000000..6c0bc7f
--- /dev/null
+++ b/lib/scripts/graph-wasm.js
@@ -0,0 +1 @@
+var read_,readAsync,readBinary,setWindowTitle,Module=void 0!==Module?Module:{},moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,n)=>{throw n},ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");scriptDirectory=ENVIRONMENT_IS_WORKER?nodePath.dirname(scriptDirectory)+"/":__dirname+"/",read_=(e,n)=>(e=isFileURI(e)?new URL(e):nodePath.normalize(e),fs.readFileSync(e,n?void 0:"utf8")),readBinary=e=>{var n=read_(e,!0);return n.buffer||(n=new Uint8Array(n)),n},readAsync=(e,n,t)=>{e=isFileURI(e)?new URL(e):nodePath.normalize(e),fs.readFile(e,(function(e,r){e?t(e):n(r.buffer)}))},!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",(function(e){if(!("unwind"===e||e instanceof ExitStatus||e.context instanceof ExitStatus))throw e}));var nodeMajor=process.versions.node.split(".")[0];nodeMajor<15&&process.on("unhandledRejection",(function(e){throw e})),quit_=(e,n)=>{throw process.exitCode=e,n},Module.inspect=function(){return"[Emscripten Module object]"}}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:"undefined"!=typeof document&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=0!==scriptDirectory.indexOf("blob:")?scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1):"",read_=e=>{var n=new XMLHttpRequest;return n.open("GET",e,!1),n.send(null),n.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var n=new XMLHttpRequest;return n.open("GET",e,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}),readAsync=(e,n,t)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?n(r.response):t()},r.onerror=t,r.send(null)},setWindowTitle=e=>document.title=e);var wasmBinary,out=Module.print||console.log.bind(console),err=Module.printErr||console.warn.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit),Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var wasmMemory,noExitRuntime=Module.noExitRuntime||!0;"object"!=typeof WebAssembly&&abort("no native wasm support detected");var EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,wasmTable,ABORT=!1;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}var __ATPRERUN__=[],__ATINIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var n=dependenciesFulfilled;dependenciesFulfilled=null,n()}}function abort(e){throw Module.onAbort&&Module.onAbort(e),err(e="Aborted("+e+")"),ABORT=!0,EXITSTATUS=1,e+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(e)}var wasmBinaryFile,tempDouble,tempI64,dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(e){return e.startsWith(dataURIPrefix)}function isFileURI(e){return e.startsWith("file://")}function getBinary(e){try{if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}catch(e){abort(e)}}function getBinaryPromise(e){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if("function"==typeof fetch&&!isFileURI(e))return fetch(e,{credentials:"same-origin"}).then((function(n){if(!n.ok)throw"failed to load wasm binary file at '"+e+"'";return n.arrayBuffer()})).catch((function(){return getBinary(e)}));if(readAsync)return new Promise((function(n,t){readAsync(e,(function(e){n(new Uint8Array(e))}),t)}))}return Promise.resolve().then((function(){return getBinary(e)}))}function instantiateArrayBuffer(e,n,t){return getBinaryPromise(e).then((function(e){return WebAssembly.instantiate(e,n)})).then((function(e){return e})).then(t,(function(e){err("failed to asynchronously prepare wasm: "+e),abort(e)}))}function instantiateAsync(e,n,t,r){return e||"function"!=typeof WebAssembly.instantiateStreaming||isDataURI(n)||isFileURI(n)||ENVIRONMENT_IS_NODE||"function"!=typeof fetch?instantiateArrayBuffer(n,t,r):fetch(n,{credentials:"same-origin"}).then((function(e){let o=new Response(e.body,{headers:new Headers({"Content-Type":"application/wasm"})});return WebAssembly.instantiateStreaming(o,t).then(r,(function(e){return err("wasm streaming compile failed: "+e),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(n,t,r)}))}))}function createWasm(){var e={a:wasmImports};function n(e,n){var t=e.exports;return Module.asm=t,wasmMemory=Module.asm.f,updateMemoryViews(),wasmTable=Module.asm.r,addOnInit(Module.asm.g),removeRunDependency("wasm-instantiate"),t}if(addRunDependency("wasm-instantiate"),Module.instantiateWasm)try{return Module.instantiateWasm(e,n)}catch(e){return err("Module.instantiateWasm callback failed with error: "+e),!1}return instantiateAsync(wasmBinary,wasmBinaryFile,e,(function(e){n(e.instance)})),{}}isDataURI(wasmBinaryFile="graph-wasm.wasm")||(wasmBinaryFile=locateFile(wasmBinaryFile));var ASM_CONSTS={2304:e=>{console.log(UTF8ToString(e))}};function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function callRuntimeCallbacks(e){for(;e.length>0;)e.shift()(Module)}function getValue(e,n="i8"){switch(n.endsWith("*")&&(n="*"),n){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];case"*":return HEAPU32[e>>2];default:abort("invalid type for getValue: "+n)}}function setValue(e,n,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":HEAP8[e>>0]=n;break;case"i16":HEAP16[e>>1]=n;break;case"i32":HEAP32[e>>2]=n;break;case"i64":tempI64=[n>>>0,(tempDouble=n,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=n;break;case"double":HEAPF64[e>>3]=n;break;case"*":HEAPU32[e>>2]=n;break;default:abort("invalid type for setValue: "+t)}}function _abort(){abort("")}var readEmAsmArgsArray=[];function readEmAsmArgs(e,n){var t;for(readEmAsmArgsArray.length=0,n>>=2;t=HEAPU8[e++];)n+=105!=t&n,readEmAsmArgsArray.push(105==t?HEAP32[n]:HEAPF64[n++>>1]),++n;return readEmAsmArgsArray}function runEmAsmFunction(e,n,t){var r=readEmAsmArgs(n,t);return ASM_CONSTS[e].apply(null,r)}function _emscripten_asm_const_int(e,n,t){return runEmAsmFunction(e,n,t)}function _emscripten_date_now(){return Date.now()}function _emscripten_memcpy_big(e,n,t){HEAPU8.copyWithin(e,n,n+t)}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(e){var n=wasmMemory.buffer;try{return wasmMemory.grow(e-n.byteLength+65535>>>16),updateMemoryViews(),1}catch(e){}}function _emscripten_resize_heap(e){var n=HEAPU8.length;e>>>=0;var t=getHeapMax();if(e>t)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),emscripten_realloc_buffer(Math.min(t,(a=Math.max(e,o))+((i=65536)-a%i)%i)))return!0}var a,i;return!1}function getCFunc(e){return Module["_"+e]}function writeArrayToMemory(e,n){HEAP8.set(e,n)}function lengthBytesUTF8(e){for(var n=0,t=0;t<e.length;++t){var r=e.charCodeAt(t);r<=127?n++:r<=2047?n+=2:r>=55296&&r<=57343?(n+=4,++t):n+=3}return n}function stringToUTF8Array(e,n,t,r){if(!(r>0))return 0;for(var o=t,a=t+r-1,i=0;i<e.length;++i){var u=e.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((1023&u)<<10)|1023&e.charCodeAt(++i);if(u<=127){if(t>=a)break;n[t++]=u}else if(u<=2047){if(t+1>=a)break;n[t++]=192|u>>6,n[t++]=128|63&u}else if(u<=65535){if(t+2>=a)break;n[t++]=224|u>>12,n[t++]=128|u>>6&63,n[t++]=128|63&u}else{if(t+3>=a)break;n[t++]=240|u>>18,n[t++]=128|u>>12&63,n[t++]=128|u>>6&63,n[t++]=128|63&u}}return n[t]=0,t-o}function stringToUTF8(e,n,t){return stringToUTF8Array(e,HEAPU8,n,t)}function stringToUTF8OnStack(e){var n=lengthBytesUTF8(e)+1,t=stackAlloc(n);return stringToUTF8(e,t,n),t}var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,n,t){for(var r=n+t,o=n;e[o]&&!(o>=r);)++o;if(o-n>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(n,o));for(var a="";n<o;){var i=e[n++];if(128&i){var u=63&e[n++];if(192!=(224&i)){var l=63&e[n++];if((i=224==(240&i)?(15&i)<<12|u<<6|l:(7&i)<<18|u<<12|l<<6|63&e[n++])<65536)a+=String.fromCharCode(i);else{var s=i-65536;a+=String.fromCharCode(55296|s>>10,56320|1023&s)}}else a+=String.fromCharCode((31&i)<<6|u)}else a+=String.fromCharCode(i)}return a}function UTF8ToString(e,n){return e?UTF8ArrayToString(HEAPU8,e,n):""}function ccall(e,n,t,r,o){var a={string:e=>{var n=0;return null!=e&&0!==e&&(n=stringToUTF8OnStack(e)),n},array:e=>{var n=stackAlloc(e.length);return writeArrayToMemory(e,n),n}};var i=getCFunc(e),u=[],l=0;if(r)for(var s=0;s<r.length;s++){var c=a[t[s]];c?(0===l&&(l=stackSave()),u[s]=c(r[s])):u[s]=r[s]}var d=i.apply(null,u);return d=function(e){return 0!==l&&stackRestore(l),function(e){return"string"===n?UTF8ToString(e):"boolean"===n?Boolean(e):e}(e)}(d)}function cwrap(e,n,t,r){var o=!t||t.every((e=>"number"===e||"boolean"===e));return"string"!==n&&o&&!r?getCFunc(e):function(){return ccall(e,n,t,arguments,r)}}var calledRun,wasmImports={b:_abort,e:_emscripten_asm_const_int,d:_emscripten_date_now,c:_emscripten_memcpy_big,a:_emscripten_resize_heap},asm=createWasm(),___wasm_call_ctors=function(){return(___wasm_call_ctors=Module.asm.g).apply(null,arguments)},_SetBatchFractionSize=Module._SetBatchFractionSize=function(){return(_SetBatchFractionSize=Module._SetBatchFractionSize=Module.asm.h).apply(null,arguments)},_SetAttractionForce=Module._SetAttractionForce=function(){return(_SetAttractionForce=Module._SetAttractionForce=Module.asm.i).apply(null,arguments)},_SetLinkLength=Module._SetLinkLength=function(){return(_SetLinkLength=Module._SetLinkLength=Module.asm.j).apply(null,arguments)},_SetRepulsionForce=Module._SetRepulsionForce=function(){return(_SetRepulsionForce=Module._SetRepulsionForce=Module.asm.k).apply(null,arguments)},_SetCentralForce=Module._SetCentralForce=function(){return(_SetCentralForce=Module._SetCentralForce=Module.asm.l).apply(null,arguments)},_SetDt=Module._SetDt=function(){return(_SetDt=Module._SetDt=Module.asm.m).apply(null,arguments)},_Init=Module._Init=function(){return(_Init=Module._Init=Module.asm.n).apply(null,arguments)},_Update=Module._Update=function(){return(_Update=Module._Update=Module.asm.o).apply(null,arguments)},_SetPosition=Module._SetPosition=function(){return(_SetPosition=Module._SetPosition=Module.asm.p).apply(null,arguments)},_FreeMemory=Module._FreeMemory=function(){return(_FreeMemory=Module._FreeMemory=Module.asm.q).apply(null,arguments)},___errno_location=function(){return(___errno_location=Module.asm.__errno_location).apply(null,arguments)},_malloc=Module._malloc=function(){return(_malloc=Module._malloc=Module.asm.s).apply(null,arguments)},_free=Module._free=function(){return(_free=Module._free=Module.asm.t).apply(null,arguments)},stackSave=function(){return(stackSave=Module.asm.u).apply(null,arguments)},stackRestore=function(){return(stackRestore=Module.asm.v).apply(null,arguments)},stackAlloc=function(){return(stackAlloc=Module.asm.w).apply(null,arguments)},___cxa_is_pointer_type=function(){return(___cxa_is_pointer_type=Module.asm.__cxa_is_pointer_type).apply(null,arguments)};function run(){function e(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),postRun()))}runDependencies>0||(preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout((function(){setTimeout((function(){Module.setStatus("")}),1),e()}),1)):e()))}if(Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue,dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)},Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();try{run()}catch(e){console.error(e)}
\ No newline at end of file
diff --git a/lib/scripts/graph-wasm.wasm b/lib/scripts/graph-wasm.wasm
new file mode 100644
index 0000000..e94bee2
Binary files /dev/null and b/lib/scripts/graph-wasm.wasm differ
diff --git a/lib/scripts/minisearch.js b/lib/scripts/minisearch.js
new file mode 100644
index 0000000..59455a6
--- /dev/null
+++ b/lib/scripts/minisearch.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).MiniSearch=e()}(this,(function(){"use strict";var t=function(){return t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var n,i="KEYS",o="VALUES",u="",a=function(){function t(t,e){var r=t._tree,n=Array.from(r.keys());this.set=t,this._type=e,this._path=n.length>0?[{node:r,keys:n}]:[]}return t.prototype.next=function(){var t=this.dive();return this.backtrack(),t},t.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var t=s(this._path),e=t.node,r=t.keys;if(s(r)===u)return{done:!1,value:this.result()};var n=e.get(s(r));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()},t.prototype.backtrack=function(){if(0!==this._path.length){var t=s(this._path).keys;t.pop(),t.length>0||(this._path.pop(),this.backtrack())}},t.prototype.key=function(){return this.set._prefix+this._path.map((function(t){var e=t.keys;return s(e)})).filter((function(t){return t!==u})).join("")},t.prototype.value=function(){return s(this._path).node.get(u)},t.prototype.result=function(){switch(this._type){case o:return this.value();case i:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),s=function(t){return t[t.length-1]},l=function(t,r,n,i,o,a,s,c){var h,d,f=a*s;try{t:for(var y=e(t.keys()),v=y.next();!v.done;v=y.next()){var p=v.value;if(p===u){var m=o[f-1];m<=n&&i.set(c,[t.get(p),m])}else{for(var _=a,g=0;g<p.length;++g,++_){for(var F=p[g],x=s*_,w=x-s,b=o[x],A=Math.max(0,_-n-1),C=Math.min(s-1,_+n),E=A;E<C;++E){var z=F!==r[E],S=o[w+E]+ +z,D=o[w+E+1]+1,I=o[x+E]+1,k=o[x+E+1]=Math.min(S,D,I);k<b&&(b=k)}if(b>n)continue t}l(t.get(p),r,n,i,o,_,s,c+p)}}}catch(t){h={error:t}}finally{try{v&&!v.done&&(d=y.return)&&d.call(y)}finally{if(h)throw h.error}}},c=function(){function t(t,e){void 0===t&&(t=new Map),void 0===e&&(e=""),this._size=void 0,this._tree=t,this._prefix=e}return t.prototype.atPrefix=function(n){var i,o;if(!n.startsWith(this._prefix))throw new Error("Mismatched prefix");var a=r(h(this._tree,n.slice(this._prefix.length)),2),s=a[0],l=a[1];if(void 0===s){var c=r(m(l),2),d=c[0],f=c[1];try{for(var y=e(d.keys()),v=y.next();!v.done;v=y.next()){var p=v.value;if(p!==u&&p.startsWith(f)){var _=new Map;return _.set(p.slice(f.length),d.get(p)),new t(_,n)}}}catch(t){i={error:t}}finally{try{v&&!v.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}}return new t(s,n)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,y(this._tree,t)},t.prototype.entries=function(){return new a(this,"ENTRIES")},t.prototype.forEach=function(t){var n,i;try{for(var o=e(this),u=o.next();!u.done;u=o.next()){var a=r(u.value,2);t(a[0],a[1],this)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},t.prototype.fuzzyGet=function(t,e){return function(t,e,r){var n=new Map;if(void 0===e)return n;for(var i=e.length+1,o=i+r,u=new Uint8Array(o*i).fill(r+1),a=0;a<i;++a)u[a]=a;for(var s=1;s<o;++s)u[s*i]=s;return l(t,e,r,n,u,1,i,""),n}(this._tree,t,e)},t.prototype.get=function(t){var e=d(this._tree,t);return void 0!==e?e.get(u):void 0},t.prototype.has=function(t){var e=d(this._tree,t);return void 0!==e&&e.has(u)},t.prototype.keys=function(){return new a(this,i)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,f(this._tree,t).set(u,e),this},Object.defineProperty(t.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var t=this.entries();!t.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),t.prototype.update=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var r=f(this._tree,t);return r.set(u,e(r.get(u))),this},t.prototype.fetch=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var r=f(this._tree,t),n=r.get(u);return void 0===n&&r.set(u,n=e()),n},t.prototype.values=function(){return new a(this,o)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(n){var i,o,u=new t;try{for(var a=e(n),s=a.next();!s.done;s=a.next()){var l=r(s.value,2),c=l[0],h=l[1];u.set(c,h)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}return u},t.fromObject=function(e){return t.from(Object.entries(e))},t}(),h=function(t,r,n){var i,o;if(void 0===n&&(n=[]),0===r.length||null==t)return[t,n];try{for(var a=e(t.keys()),s=a.next();!s.done;s=a.next()){var l=s.value;if(l!==u&&r.startsWith(l))return n.push([t,l]),h(t.get(l),r.slice(l.length),n)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}return n.push([t,r]),h(void 0,"",n)},d=function(t,r){var n,i;if(0===r.length||null==t)return t;try{for(var o=e(t.keys()),a=o.next();!a.done;a=o.next()){var s=a.value;if(s!==u&&r.startsWith(s))return d(t.get(s),r.slice(s.length))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},f=function(t,r){var n,i,o=r.length;t:for(var a=0;t&&a<o;){try{for(var s=(n=void 0,e(t.keys())),l=s.next();!l.done;l=s.next()){var c=l.value;if(c!==u&&r[a]===c[0]){for(var h=Math.min(o-a,c.length),d=1;d<h&&r[a+d]===c[d];)++d;var f=t.get(c);if(d===c.length)t=f;else{var y=new Map;y.set(c.slice(d),f),t.set(r.slice(a,a+d),y),t.delete(c),t=y}a+=d;continue t}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}var v=new Map;return t.set(r.slice(a),v),v}return t},y=function(t,e){var n=r(h(t,e),2),i=n[0],o=n[1];if(void 0!==i)if(i.delete(u),0===i.size)v(o);else if(1===i.size){var a=r(i.entries().next().value,2),s=a[0],l=a[1];p(o,s,l)}},v=function(t){if(0!==t.length){var e=r(m(t),2),n=e[0],i=e[1];if(n.delete(i),0===n.size)v(t.slice(0,-1));else if(1===n.size){var o=r(n.entries().next().value,2),a=o[0],s=o[1];a!==u&&p(t.slice(0,-1),a,s)}}},p=function(t,e,n){if(0!==t.length){var i=r(m(t),2),o=i[0],u=i[1];o.set(u+e,n),o.delete(u)}},m=function(t){return t[t.length-1]},_="or",g=function(){function n(e){if(null==(null==e?void 0:e.fields))throw new Error('MiniSearch: option "fields" must be provided');var r=null==e.autoVacuum||!0===e.autoVacuum?D:e.autoVacuum;this._options=t(t(t({},A),e),{autoVacuum:r,searchOptions:t(t({},C),e.searchOptions||{}),autoSuggestOptions:t(t({},E),e.autoSuggestOptions||{})}),this._index=new c,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=S,this.addFields(this._options.fields)}return n.prototype.add=function(t){var r,n,i,o,u,a,s=this._options,l=s.extractField,c=s.tokenize,h=s.processTerm,d=s.fields,f=s.idField,y=l(t,f);if(null==y)throw new Error('MiniSearch: document does not have ID field "'.concat(f,'"'));if(this._idToShortId.has(y))throw new Error("MiniSearch: duplicate ID ".concat(y));var v=this.addDocumentId(y);this.saveStoredFields(v,t);try{for(var p=e(d),m=p.next();!m.done;m=p.next()){var _=m.value,g=l(t,_);if(null!=g){var F=c(g.toString(),_),x=this._fieldIds[_],w=new Set(F).size;this.addFieldLength(v,x,this._documentCount-1,w);try{for(var b=(i=void 0,e(F)),A=b.next();!A.done;A=b.next()){var C=h(A.value,_);if(Array.isArray(C))try{for(var E=(u=void 0,e(C)),z=E.next();!z.done;z=E.next()){var S=z.value;this.addTerm(x,v,S)}}catch(t){u={error:t}}finally{try{z&&!z.done&&(a=E.return)&&a.call(E)}finally{if(u)throw u.error}}else C&&this.addTerm(x,v,C)}}catch(t){i={error:t}}finally{try{A&&!A.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}}}}catch(t){r={error:t}}finally{try{m&&!m.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}},n.prototype.addAll=function(t){var r,n;try{for(var i=e(t),o=i.next();!o.done;o=i.next()){var u=o.value;this.add(u)}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},n.prototype.addAllAsync=function(t,e){var r=this;void 0===e&&(e={});var n=e.chunkSize,i=void 0===n?10:n,o={chunk:[],promise:Promise.resolve()},u=t.reduce((function(t,e,n){var o=t.chunk,u=t.promise;return o.push(e),(n+1)%i==0?{chunk:[],promise:u.then((function(){return new Promise((function(t){return setTimeout(t,0)}))})).then((function(){return r.addAll(o)}))}:{chunk:o,promise:u}}),o),a=u.chunk;return u.promise.then((function(){return r.addAll(a)}))},n.prototype.remove=function(t){var r,n,i,o,u,a,s=this._options,l=s.tokenize,c=s.processTerm,h=s.extractField,d=s.fields,f=s.idField,y=h(t,f);if(null==y)throw new Error('MiniSearch: document does not have ID field "'.concat(f,'"'));var v=this._idToShortId.get(y);if(null==v)throw new Error("MiniSearch: cannot remove document with ID ".concat(y,": it is not in the index"));try{for(var p=e(d),m=p.next();!m.done;m=p.next()){var _=m.value,g=h(t,_);if(null!=g){var F=l(g.toString(),_),x=this._fieldIds[_],w=new Set(F).size;this.removeFieldLength(v,x,this._documentCount,w);try{for(var b=(i=void 0,e(F)),A=b.next();!A.done;A=b.next()){var C=c(A.value,_);if(Array.isArray(C))try{for(var E=(u=void 0,e(C)),z=E.next();!z.done;z=E.next()){var S=z.value;this.removeTerm(x,v,S)}}catch(t){u={error:t}}finally{try{z&&!z.done&&(a=E.return)&&a.call(E)}finally{if(u)throw u.error}}else C&&this.removeTerm(x,v,C)}}catch(t){i={error:t}}finally{try{A&&!A.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}}}}catch(t){r={error:t}}finally{try{m&&!m.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}this._storedFields.delete(v),this._documentIds.delete(v),this._idToShortId.delete(y),this._fieldLength.delete(v),this._documentCount-=1},n.prototype.removeAll=function(t){var r,n;if(t)try{for(var i=e(t),o=i.next();!o.done;o=i.next()){var u=o.value;this.remove(u)}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new c,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.discard=function(t){var e=this,r=this._idToShortId.get(t);if(null==r)throw new Error("MiniSearch: cannot discard document with ID ".concat(t,": it is not in the index"));this._idToShortId.delete(t),this._documentIds.delete(r),this._storedFields.delete(r),(this._fieldLength.get(r)||[]).forEach((function(t,n){e.removeFieldLength(r,n,e._documentCount,t)})),this._fieldLength.delete(r),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},n.prototype.maybeAutoVacuum=function(){if(!1!==this._options.autoVacuum){var t=this._options.autoVacuum,e=t.minDirtFactor,r=t.minDirtCount,n=t.batchSize,i=t.batchWait;this.conditionalVacuum({batchSize:n,batchWait:i},{minDirtCount:r,minDirtFactor:e})}},n.prototype.discardAll=function(t){var r,n,i=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var o=e(t),u=o.next();!u.done;u=o.next()){var a=u.value;this.discard(a)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}finally{this._options.autoVacuum=i}this.maybeAutoVacuum()},n.prototype.replace=function(t){var e=this._options,r=e.idField,n=(0,e.extractField)(t,r);this.discard(n),this.add(t)},n.prototype.vacuum=function(t){return void 0===t&&(t={}),this.conditionalVacuum(t)},n.prototype.conditionalVacuum=function(t,e){var r=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&e,null!=this._enqueuedVacuum||(this._enqueuedVacuum=this._currentVacuum.then((function(){var e=r._enqueuedVacuumConditions;return r._enqueuedVacuumConditions=S,r.performVacuuming(t,e)}))),this._enqueuedVacuum):!1===this.vacuumConditionsMet(e)?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)},n.prototype.performVacuuming=function(t,n){return function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function u(t){try{s(n.next(t))}catch(t){o(t)}}function a(t){try{s(n.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(this,void 0,void 0,(function(){var i,o,u,a,s,l,c,h,d,f,y,v,p,m,_,g,F,x,w,b,A,C,E,S,D;return function(t,e){var r,n,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,n=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=e.call(t,u)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}(this,(function(I){switch(I.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(n))return[3,10];o=t.batchSize||z.batchSize,u=t.batchWait||z.batchWait,a=1,I.label=1;case 1:I.trys.push([1,7,8,9]),s=e(this._index),l=s.next(),I.label=2;case 2:if(l.done)return[3,6];c=r(l.value,2),h=c[0],d=c[1];try{for(C=void 0,f=e(d),y=f.next();!y.done;y=f.next()){v=r(y.value,2),p=v[0],m=v[1];try{for(S=void 0,_=e(m),g=_.next();!g.done;g=_.next())F=r(g.value,1),x=F[0],this._documentIds.has(x)||(m.size<=1?d.delete(p):m.delete(x))}catch(t){S={error:t}}finally{try{g&&!g.done&&(D=_.return)&&D.call(_)}finally{if(S)throw S.error}}}}catch(t){C={error:t}}finally{try{y&&!y.done&&(E=f.return)&&E.call(f)}finally{if(C)throw C.error}}return 0===this._index.get(h).size&&this._index.delete(h),a%o!=0?[3,4]:[4,new Promise((function(t){return setTimeout(t,u)}))];case 3:I.sent(),I.label=4;case 4:a+=1,I.label=5;case 5:return l=s.next(),[3,2];case 6:return[3,9];case 7:return w=I.sent(),b={error:w},[3,9];case 8:try{l&&!l.done&&(A=s.return)&&A.call(s)}finally{if(b)throw b.error}return[7];case 9:this._dirtCount-=i,I.label=10;case 10:return[4,null];case 11:return I.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}}))}))},n.prototype.vacuumConditionsMet=function(t){if(null==t)return!0;var e=t.minDirtCount,r=t.minDirtFactor;return e=e||D.minDirtCount,r=r||D.minDirtFactor,this.dirtCount>=e&&this.dirtFactor>=r},Object.defineProperty(n.prototype,"isVacuuming",{get:function(){return null!=this._currentVacuum},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),n.prototype.has=function(t){return this._idToShortId.has(t)},n.prototype.getStoredFields=function(t){var e=this._idToShortId.get(t);if(null!=e)return this._storedFields.get(e)},n.prototype.search=function(t,i){var o,u;void 0===i&&(i={});var a=this.executeQuery(t,i),s=[];try{for(var l=e(a),c=l.next();!c.done;c=l.next()){var h=r(c.value,2),d=h[0],f=h[1],y=f.score,v=f.terms,p=f.match,m=v.length||1,_={id:this._documentIds.get(d),score:y*m,terms:Object.keys(p),queryTerms:v,match:p};Object.assign(_,this._storedFields.get(d)),(null==i.filter||i.filter(_))&&s.push(_)}}catch(t){o={error:t}}finally{try{c&&!c.done&&(u=l.return)&&u.call(l)}finally{if(o)throw o.error}}return t===n.wildcard&&null==i.boostDocument&&null==this._options.searchOptions.boostDocument||s.sort(M),s},n.prototype.autoSuggest=function(n,i){var o,u,a,s;void 0===i&&(i={}),i=t(t({},this._options.autoSuggestOptions),i);var l=new Map;try{for(var c=e(this.search(n,i)),h=c.next();!h.done;h=c.next()){var d=h.value,f=d.score,y=(x=d.terms).join(" ");null!=(g=l.get(y))?(g.score+=f,g.count+=1):l.set(y,{score:f,terms:x,count:1})}}catch(t){o={error:t}}finally{try{h&&!h.done&&(u=c.return)&&u.call(c)}finally{if(o)throw o.error}}var v=[];try{for(var p=e(l),m=p.next();!m.done;m=p.next()){var _=r(m.value,2),g=_[0],F=_[1],x=(f=F.score,F.terms),w=F.count;v.push({suggestion:g,terms:x,score:f/w})}}catch(t){a={error:t}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}return v.sort(M),v},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),n.loadJSON=function(t,e){if(null==e)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),e)},n.getDefault=function(t){if(A.hasOwnProperty(t))return F(A,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},n.loadJS=function(t,i){var o,u,a,s,l,h,d=t.index,f=t.documentCount,y=t.nextId,v=t.documentIds,p=t.fieldIds,m=t.fieldLength,_=t.averageFieldLength,g=t.storedFields,F=t.dirtCount,x=t.serializationVersion;if(1!==x&&2!==x)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new n(i);w._documentCount=f,w._nextId=y,w._documentIds=V(v),w._idToShortId=new Map,w._fieldIds=p,w._fieldLength=V(m),w._avgFieldLength=_,w._storedFields=V(g),w._dirtCount=F||0,w._index=new c;try{for(var b=e(w._documentIds),A=b.next();!A.done;A=b.next()){var C=r(A.value,2),E=C[0],z=C[1];w._idToShortId.set(z,E)}}catch(t){o={error:t}}finally{try{A&&!A.done&&(u=b.return)&&u.call(b)}finally{if(o)throw o.error}}try{for(var S=e(d),D=S.next();!D.done;D=S.next()){var I=r(D.value,2),k=I[0],M=I[1],O=new Map;try{for(var T=(l=void 0,e(Object.keys(M))),L=T.next();!L.done;L=T.next()){var j=L.value,B=M[j];1===x&&(B=B.ds),O.set(parseInt(j,10),V(B))}}catch(t){l={error:t}}finally{try{L&&!L.done&&(h=T.return)&&h.call(T)}finally{if(l)throw l.error}}w._index.set(k,O)}}catch(t){a={error:t}}finally{try{D&&!D.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}return w},n.prototype.executeQuery=function(e,r){var i=this;if(void 0===r&&(r={}),e===n.wildcard)return this.executeWildcardQuery(r);if("string"!=typeof e){var o=t(t(t({},r),e),{queries:void 0}),u=e.queries.map((function(t){return i.executeQuery(t,o)}));return this.combineResults(u,o.combineWith)}var a=this._options,s=a.tokenize,l=a.processTerm,c=a.searchOptions,h=t(t({tokenize:s,processTerm:l},c),r),d=h.tokenize,f=h.processTerm,y=d(e).flatMap((function(t){return f(t)})).filter((function(t){return!!t})).map(b(h)).map((function(t){return i.executeQuerySpec(t,h)}));return this.combineResults(y,h.combineWith)},n.prototype.executeQuerySpec=function(n,i){var o,u,a,s,l,c,h=t(t({},this._options.searchOptions),i),d=(h.fields||this._options.fields).reduce((function(e,r){var n;return t(t({},e),((n={})[r]=F(h.boost,r)||1,n))}),{}),f=h.boostDocument,y=h.weights,v=h.maxFuzzy,p=h.bm25,m=t(t({},C.weights),y),_=m.fuzzy,g=m.prefix,x=this._index.get(n.term),w=this.termResults(n.term,n.term,1,x,d,f,p);if(n.prefix&&(l=this._index.atPrefix(n.term)),n.fuzzy){var b=!0===n.fuzzy?.2:n.fuzzy,A=b<1?Math.min(v,Math.round(n.term.length*b)):b;A&&(c=this._index.fuzzyGet(n.term,A))}if(l)try{for(var E=e(l),z=E.next();!z.done;z=E.next()){var S=r(z.value,2),D=S[0],I=S[1];if(V=D.length-n.term.length){null==c||c.delete(D);var k=g*D.length/(D.length+.3*V);this.termResults(n.term,D,k,I,d,f,p,w)}}}catch(t){o={error:t}}finally{try{z&&!z.done&&(u=E.return)&&u.call(E)}finally{if(o)throw o.error}}if(c)try{for(var M=e(c.keys()),O=M.next();!O.done;O=M.next()){D=O.value;var V,T=r(c.get(D),2),L=T[0];(V=T[1])&&(k=_*D.length/(D.length+V),this.termResults(n.term,D,k,L,d,f,p,w))}}catch(t){a={error:t}}finally{try{O&&!O.done&&(s=M.return)&&s.call(M)}finally{if(a)throw a.error}}return w},n.prototype.executeWildcardQuery=function(n){var i,o,u=new Map,a=t(t({},this._options.searchOptions),n);try{for(var s=e(this._documentIds),l=s.next();!l.done;l=s.next()){var c=r(l.value,2),h=c[0],d=c[1],f=a.boostDocument?a.boostDocument(d,"",this._storedFields.get(h)):1;u.set(h,{score:f,terms:[],match:{}})}}catch(t){i={error:t}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return u},n.prototype.combineResults=function(t,e){if(void 0===e&&(e=_),0===t.length)return new Map;var r=e.toLowerCase();return t.reduce(x[r])||new Map},n.prototype.toJSON=function(){var t,n,i,o,u=[];try{for(var a=e(this._index),s=a.next();!s.done;s=a.next()){var l=r(s.value,2),c=l[0],h=l[1],d={};try{for(var f=(i=void 0,e(h)),y=f.next();!y.done;y=f.next()){var v=r(y.value,2),p=v[0],m=v[1];d[p]=Object.fromEntries(m)}}catch(t){i={error:t}}finally{try{y&&!y.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}u.push([c,d])}}catch(n){t={error:n}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:u,serializationVersion:2}},n.prototype.termResults=function(t,r,n,i,o,u,a,s){var l,c,h,d,f;if(void 0===s&&(s=new Map),null==i)return s;try{for(var y=e(Object.keys(o)),v=y.next();!v.done;v=y.next()){var p=v.value,m=o[p],_=this._fieldIds[p],g=i.get(_);if(null!=g){var x=g.size,b=this._avgFieldLength[_];try{for(var A=(h=void 0,e(g.keys())),C=A.next();!C.done;C=A.next()){var E=C.value;if(this._documentIds.has(E)){var z=u?u(this._documentIds.get(E),r,this._storedFields.get(E)):1;if(z){var S=g.get(E),D=this._fieldLength.get(E)[_],k=n*m*z*w(S,x,this._documentCount,D,b,a),M=s.get(E);if(M){M.score+=k,I(M.terms,t);var O=F(M.match,r);O?O.push(p):M.match[r]=[p]}else s.set(E,{score:k,terms:[t],match:(f={},f[r]=[p],f)})}}else this.removeTerm(_,E,r),x-=1}}catch(t){h={error:t}}finally{try{C&&!C.done&&(d=A.return)&&d.call(A)}finally{if(h)throw h.error}}}}}catch(t){l={error:t}}finally{try{v&&!v.done&&(c=y.return)&&c.call(y)}finally{if(l)throw l.error}}return s},n.prototype.addTerm=function(t,e,r){var n=this._index.fetch(r,O),i=n.get(t);if(null==i)(i=new Map).set(e,1),n.set(t,i);else{var o=i.get(e);i.set(e,(o||0)+1)}},n.prototype.removeTerm=function(t,e,r){if(this._index.has(r)){var n=this._index.fetch(r,O),i=n.get(t);null==i||null==i.get(e)?this.warnDocumentChanged(e,t,r):i.get(e)<=1?i.size<=1?n.delete(t):i.delete(e):i.set(e,i.get(e)-1),0===this._index.get(r).size&&this._index.delete(r)}else this.warnDocumentChanged(e,t,r)},n.prototype.warnDocumentChanged=function(t,r,n){var i,o;try{for(var u=e(Object.keys(this._fieldIds)),a=u.next();!a.done;a=u.next()){var s=a.value;if(this._fieldIds[s]===r)return void this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(n,'" was not present in field "').concat(s,'". Removing a document after it has changed can corrupt the index!'),"version_conflict")}}catch(t){i={error:t}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}},n.prototype.addDocumentId=function(t){var e=this._nextId;return this._idToShortId.set(t,e),this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},n.prototype.addFields=function(t){for(var e=0;e<t.length;e++)this._fieldIds[t[e]]=e},n.prototype.addFieldLength=function(t,e,r,n){var i=this._fieldLength.get(t);null==i&&this._fieldLength.set(t,i=[]),i[e]=n;var o=(this._avgFieldLength[e]||0)*r+n;this._avgFieldLength[e]=o/(r+1)},n.prototype.removeFieldLength=function(t,e,r,n){if(1!==r){var i=this._avgFieldLength[e]*r-n;this._avgFieldLength[e]=i/(r-1)}else this._avgFieldLength[e]=0},n.prototype.saveStoredFields=function(t,r){var n,i,o=this._options,u=o.storeFields,a=o.extractField;if(null!=u&&0!==u.length){var s=this._storedFields.get(t);null==s&&this._storedFields.set(t,s={});try{for(var l=e(u),c=l.next();!c.done;c=l.next()){var h=c.value,d=a(r,h);void 0!==d&&(s[h]=d)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}},n.wildcard=Symbol("*"),n}(),F=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0},x=((n={})[_]=function(t,r){var n,i;try{for(var o=e(r.keys()),u=o.next();!u.done;u=o.next()){var a=u.value,s=t.get(a);if(null==s)t.set(a,r.get(a));else{var l=r.get(a),c=l.score,h=l.terms,d=l.match;s.score=s.score+c,s.match=Object.assign(s.match,d),k(s.terms,h)}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return t},n.and=function(t,r){var n,i,o=new Map;try{for(var u=e(r.keys()),a=u.next();!a.done;a=u.next()){var s=a.value,l=t.get(s);if(null!=l){var c=r.get(s),h=c.score,d=c.terms,f=c.match;k(l.terms,d),o.set(s,{score:l.score+h,terms:l.terms,match:Object.assign(l.match,f)})}}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return o},n.and_not=function(t,r){var n,i;try{for(var o=e(r.keys()),u=o.next();!u.done;u=o.next()){var a=u.value;t.delete(a)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return t},n),w=function(t,e,r,n,i,o){var u=o.k,a=o.b,s=o.d;return Math.log(1+(r-e+.5)/(e+.5))*(s+t*(u+1)/(t+u*(1-a+a*n/i)))},b=function(t){return function(e,r,n){return{term:e,fuzzy:"function"==typeof t.fuzzy?t.fuzzy(e,r,n):t.fuzzy||!1,prefix:"function"==typeof t.prefix?t.prefix(e,r,n):!0===t.prefix}}},A={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t){return t.split(T)},processTerm:function(t){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(t,e){"function"==typeof(null===console||void 0===console?void 0:console[t])&&console[t](e)},autoVacuum:!0},C={combineWith:_,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:{k:1.2,b:.7,d:.5}},E={combineWith:"and",prefix:function(t,e,r){return e===r.length-1}},z={batchSize:1e3,batchWait:10},S={minDirtFactor:.1,minDirtCount:20},D=t(t({},z),S),I=function(t,e){t.includes(e)||t.push(e)},k=function(t,r){var n,i;try{for(var o=e(r),u=o.next();!u.done;u=o.next()){var a=u.value;t.includes(a)||t.push(a)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},M=function(t,e){var r=t.score;return e.score-r},O=function(){return new Map},V=function(t){var r,n,i=new Map;try{for(var o=e(Object.keys(t)),u=o.next();!u.done;u=o.next()){var a=u.value;i.set(parseInt(a,10),t[a])}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},T=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;return g}))
\ No newline at end of file
diff --git a/lib/scripts/pixi.js b/lib/scripts/pixi.js
new file mode 100644
index 0000000..9af85a4
--- /dev/null
+++ b/lib/scripts/pixi.js
@@ -0,0 +1 @@
+var qd=Object.defineProperty,Kd=Object.defineProperties,Zd=Object.getOwnPropertyDescriptors,ir=Object.getOwnPropertySymbols,$h=Object.prototype.hasOwnProperty,jh=Object.prototype.propertyIsEnumerable,Wh=(t,e,s)=>e in t?qd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,bt=(t,e)=>{for(var s in e||(e={}))$h.call(e,s)&&Wh(t,s,e[s]);if(ir)for(var s of ir(e))jh.call(e,s)&&Wh(t,s,e[s]);return t},Qi=(t,e)=>Kd(t,Zd(e)),zn=(t,e)=>{var s={};for(var i in t)$h.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&ir)for(var i of ir(t))e.indexOf(i)<0&&jh.call(t,i)&&(s[i]=t[i]);return s},PIXI=function(t){var e,s,i=((s=i||{})[s.WEBGL_LEGACY=0]="WEBGL_LEGACY",s[s.WEBGL=1]="WEBGL",s[s.WEBGL2=2]="WEBGL2",s),r=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(r||{}),n=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(n||{}),a=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR",t))(a||{}),o=(t=>(t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t))(o||{}),h=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(h||{}),l=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(l||{}),u=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(u||{}),d=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(d||{}),c=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(c||{}),p=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(p||{}),f=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(f||{}),m=(t=>(t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(m||{}),_=(t=>(t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT",t))(_||{}),g=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(g||{}),x=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(x||{}),v=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(v||{}),y=(t=>(t[t.RED=1]="RED",t[t.GREEN=2]="GREEN",t[t.BLUE=4]="BLUE",t[t.ALPHA=8]="ALPHA",t))(y||{}),T=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))(T||{}),b=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(b||{});const E={createCanvas:(t,e)=>{const s=document.createElement("canvas");return s.width=t,s.height=e,s},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>{var t;return null!=(t=document.baseURI)?t:window.location.href},getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>(new DOMParser).parseFromString(t,"text/xml")},A={ADAPTER:E,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var R=/iPhone/i,S=/iPod/i,w=/iPad/i,I=/\biOS-universal(?:.+)Mac\b/i,M=/\bAndroid(?:.+)Mobile\b/i,C=/Android/i,D=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,P=/Silk/i,O=/Windows Phone/i,F=/\bWindows(?:.+)ARM\b/i,B=/BlackBerry/i,N=/BB10/i,L=/Opera Mini/i,G=/\b(CriOS|Chrome)(?:.+)Mobile/i,U=/Mobile(?:.+)Firefox\b/i,k=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function X(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var s=e.userAgent,i=s.split("[FBAN");void 0!==i[1]&&(s=i[0]),void 0!==(i=s.split("Twitter"))[1]&&(s=i[0]);var r=function(t){return function(e){return e.test(t)}}(s),n={apple:{phone:r(R)&&!r(O),ipod:r(S),tablet:!r(R)&&(r(w)||k(e))&&!r(O),universal:r(I),device:(r(R)||r(S)||r(w)||r(I)||k(e))&&!r(O)},amazon:{phone:r(D),tablet:!r(D)&&r(P),device:r(D)||r(P)},android:{phone:!r(O)&&r(D)||!r(O)&&r(M),tablet:!r(O)&&!r(D)&&!r(M)&&(r(P)||r(C)),device:!r(O)&&(r(D)||r(P)||r(M)||r(C))||r(/\bokhttp\b/i)},windows:{phone:r(O),tablet:r(F),device:r(O)||r(F)},other:{blackberry:r(B),blackberry10:r(N),opera:r(L),firefox:r(U),chrome:r(G),device:r(B)||r(N)||r(L)||r(U)||r(G)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}const H=(null!=(e=X.default)?e:X)(globalThis.navigator);A.RETINA_PREFIX=/@([0-9\.]+)x/,A.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function z(t,e,s){return t(s={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&s.path)}},s.exports),s.exports}var W=z((function(t){"use strict";var e=Object.prototype.hasOwnProperty,s="~";function i(){}function r(t,e,s){this.fn=t,this.context=e,this.once=s||!1}function n(t,e,i,n,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,n||t,a),h=s?s+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(s=!1)),o.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(s?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=s?s+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,n=i.length,a=new Array(n);r<n;r++)a[r]=i[r].fn;return a},o.prototype.listenerCount=function(t){var e=s?s+t:t,i=this._events[e];return i?i.fn?1:i.length:0},o.prototype.emit=function(t,e,i,r,n,a){var o=s?s+t:t;if(!this._events[o])return!1;var h,l,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,r),!0;case 5:return u.fn.call(u.context,e,i,r,n),!0;case 6:return u.fn.call(u.context,e,i,r,n,a),!0}for(l=1,h=new Array(d-1);l<d;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var c,p=u.length;for(l=0;l<p;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),d){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,i);break;case 4:u[l].fn.call(u[l].context,e,i,r);break;default:if(!h)for(c=1,h=new Array(d-1);c<d;c++)h[c-1]=arguments[c];u[l].fn.apply(u[l].context,h)}}return!0},o.prototype.on=function(t,e,s){return n(this,t,e,s,!1)},o.prototype.once=function(t,e,s){return n(this,t,e,s,!0)},o.prototype.removeListener=function(t,e,i,r){var n=s?s+t:t;if(!this._events[n])return this;if(!e)return a(this,n),this;var o=this._events[n];if(o.fn)o.fn===e&&(!r||o.once)&&(!i||o.context===i)&&a(this,n);else{for(var h=0,l=[],u=o.length;h<u;h++)(o[h].fn!==e||r&&!o[h].once||i&&o[h].context!==i)&&l.push(o[h]);l.length?this._events[n]=1===l.length?l[0]:l:a(this,n)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=s?s+t:t,this._events[e]&&a(this,e)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=s,o.EventEmitter=o,t.exports=o})),Y=$,j=$;function $(t,e,s){s=s||2;var i,r,n,a,o,h,l,u=e&&e.length,d=u?e[0]*s:t.length,c=q(t,0,d,s,!0),p=[];if(!c||c.next===c.prev)return p;if(u&&(c=function(t,e,s,i){var r,n,a,o,h,l=[];for(r=0,n=e.length;r<n;r++)a=e[r]*i,o=r<n-1?e[r+1]*i:t.length,(h=q(t,a,o,i,!1))===h.next&&(h.steiner=!0),l.push(at(h));for(l.sort(st),r=0;r<l.length;r++)s=it(l[r],s);return s}(t,e,c,s)),t.length>80*s){i=n=t[0],r=a=t[1];for(var f=s;f<d;f+=s)(o=t[f])<i&&(i=o),(h=t[f+1])<r&&(r=h),o>n&&(n=o),h>a&&(a=h);l=0!==(l=Math.max(n-i,a-r))?32767/l:0}return Z(c,p,s,i,r,l,0),p}function q(t,e,s,i,r){var n,a;if(r===vt(t,e,s,i)>0)for(n=e;n<s;n+=i)a=_t(n,t[n],t[n+1],a);else for(n=s-i;n>=e;n-=i)a=_t(n,t[n],t[n+1],a);return a&&ut(a,a.next)&&(gt(a),a=a.next),a}function K(t,e){if(!t)return t;e||(e=t);var s,i=t;do{if(s=!1,i.steiner||!ut(i,i.next)&&0!==lt(i.prev,i,i.next))i=i.next;else{if(gt(i),(i=e=i.prev)===i.next)break;s=!0}}while(s||i!==e);return e}function Z(t,e,s,i,r,n,a){if(t){!a&&n&&function(t,e,s,i){var r=t;do{0===r.z&&(r.z=nt(r.x,r.y,e,s,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,s,i,r,n,a,o,h,l=1;do{for(s=t,t=null,n=null,a=0;s;){for(a++,i=s,o=0,e=0;e<l&&(o++,i=i.nextZ);e++);for(h=l;o>0||h>0&&i;)0!==o&&(0===h||!i||s.z<=i.z)?(r=s,s=s.nextZ,o--):(r=i,i=i.nextZ,h--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;s=i}n.nextZ=null,l*=2}while(a>1)}(r)}(t,i,r,n);for(var o,h,l=t;t.prev!==t.next;)if(o=t.prev,h=t.next,n?J(t,i,r,n):Q(t))e.push(o.i/s|0),e.push(t.i/s|0),e.push(h.i/s|0),gt(t),t=h.next,l=h.next;else if((t=h)===l){a?1===a?Z(t=tt(K(t),e,s),e,s,i,r,n,2):2===a&&et(t,e,s,i,r,n):Z(K(t),e,s,i,r,n,1);break}}}function Q(t){var e=t.prev,s=t,i=t.next;if(lt(e,s,i)>=0)return!1;for(var r=e.x,n=s.x,a=i.x,o=e.y,h=s.y,l=i.y,u=r<n?r<a?r:a:n<a?n:a,d=o<h?o<l?o:l:h<l?h:l,c=r>n?r>a?r:a:n>a?n:a,p=o>h?o>l?o:l:h>l?h:l,f=i.next;f!==e;){if(f.x>=u&&f.x<=c&&f.y>=d&&f.y<=p&&ot(r,o,n,h,a,l,f.x,f.y)&&lt(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function J(t,e,s,i){var r=t.prev,n=t,a=t.next;if(lt(r,n,a)>=0)return!1;for(var o=r.x,h=n.x,l=a.x,u=r.y,d=n.y,c=a.y,p=o<h?o<l?o:l:h<l?h:l,f=u<d?u<c?u:c:d<c?d:c,m=o>h?o>l?o:l:h>l?h:l,_=u>d?u>c?u:c:d>c?d:c,g=nt(p,f,e,s,i),x=nt(m,_,e,s,i),v=t.prevZ,y=t.nextZ;v&&v.z>=g&&y&&y.z<=x;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=_&&v!==r&&v!==a&&ot(o,u,h,d,l,c,v.x,v.y)&&lt(v.prev,v,v.next)>=0||(v=v.prevZ,y.x>=p&&y.x<=m&&y.y>=f&&y.y<=_&&y!==r&&y!==a&&ot(o,u,h,d,l,c,y.x,y.y)&&lt(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;v&&v.z>=g;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=_&&v!==r&&v!==a&&ot(o,u,h,d,l,c,v.x,v.y)&&lt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;y&&y.z<=x;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=_&&y!==r&&y!==a&&ot(o,u,h,d,l,c,y.x,y.y)&&lt(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function tt(t,e,s){var i=t;do{var r=i.prev,n=i.next.next;!ut(r,n)&&dt(r,i,i.next,n)&&ft(r,n)&&ft(n,r)&&(e.push(r.i/s|0),e.push(i.i/s|0),e.push(n.i/s|0),gt(i),gt(i.next),i=t=n),i=i.next}while(i!==t);return K(i)}function et(t,e,s,i,r,n){var a=t;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&ht(a,o)){var h=mt(a,o);return a=K(a,a.next),h=K(h,h.next),Z(a,e,s,i,r,n,0),void Z(h,e,s,i,r,n,0)}o=o.next}a=a.next}while(a!==t)}function st(t,e){return t.x-e.x}function it(t,e){var s=function(t,e){var s,i=e,r=t.x,n=t.y,a=-1/0;do{if(n<=i.y&&n>=i.next.y&&i.next.y!==i.y){var o=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(o<=r&&o>a&&(a=o,s=i.x<i.next.x?i:i.next,o===r))return s}i=i.next}while(i!==e);if(!s)return null;var h,l=s,u=s.x,d=s.y,c=1/0;i=s;do{r>=i.x&&i.x>=u&&r!==i.x&&ot(n<d?r:a,n,u,d,n<d?a:r,n,i.x,i.y)&&(h=Math.abs(n-i.y)/(r-i.x),ft(i,t)&&(h<c||h===c&&(i.x>s.x||i.x===s.x&&rt(s,i)))&&(s=i,c=h)),i=i.next}while(i!==l);return s}(t,e);if(!s)return e;var i=mt(s,t);return K(i,i.next),K(s,s.next)}function rt(t,e){return lt(t.prev,t,e.prev)<0&&lt(e.next,t,t.next)<0}function nt(t,e,s,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-s)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function at(t){var e=t,s=t;do{(e.x<s.x||e.x===s.x&&e.y<s.y)&&(s=e),e=e.next}while(e!==t);return s}function ot(t,e,s,i,r,n,a,o){return(r-a)*(e-o)>=(t-a)*(n-o)&&(t-a)*(i-o)>=(s-a)*(e-o)&&(s-a)*(n-o)>=(r-a)*(i-o)}function ht(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var s=t;do{if(s.i!==t.i&&s.next.i!==t.i&&s.i!==e.i&&s.next.i!==e.i&&dt(s,s.next,t,e))return!0;s=s.next}while(s!==t);return!1}(t,e)&&(ft(t,e)&&ft(e,t)&&function(t,e){var s=t,i=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{s.y>n!=s.next.y>n&&s.next.y!==s.y&&r<(s.next.x-s.x)*(n-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next}while(s!==t);return i}(t,e)&&(lt(t.prev,t,e.prev)||lt(t,e.prev,e))||ut(t,e)&&lt(t.prev,t,t.next)>0&&lt(e.prev,e,e.next)>0)}function lt(t,e,s){return(e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y)}function ut(t,e){return t.x===e.x&&t.y===e.y}function dt(t,e,s,i){var r=pt(lt(t,e,s)),n=pt(lt(t,e,i)),a=pt(lt(s,i,t)),o=pt(lt(s,i,e));return!!(r!==n&&a!==o||0===r&&ct(t,s,e)||0===n&&ct(t,i,e)||0===a&&ct(s,t,i)||0===o&&ct(s,e,i))}function ct(t,e,s){return e.x<=Math.max(t.x,s.x)&&e.x>=Math.min(t.x,s.x)&&e.y<=Math.max(t.y,s.y)&&e.y>=Math.min(t.y,s.y)}function pt(t){return t>0?1:t<0?-1:0}function ft(t,e){return lt(t.prev,t,t.next)<0?lt(t,e,t.next)>=0&&lt(t,t.prev,e)>=0:lt(t,e,t.prev)<0||lt(t,t.next,e)<0}function mt(t,e){var s=new xt(t.i,t.x,t.y),i=new xt(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,s.next=r,r.prev=s,i.next=s,s.prev=i,n.next=i,i.prev=n,i}function _t(t,e,s,i){var r=new xt(t,e,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function gt(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function xt(t,e,s){this.i=t,this.x=e,this.y=s,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function vt(t,e,s,i){for(var r=0,n=e,a=s-i;n<s;n+=i)r+=(t[a]-t[n])*(t[n+1]+t[a+1]),a=n;return r}$.deviation=function(t,e,s,i){var r=e&&e.length,n=r?e[0]*s:t.length,a=Math.abs(vt(t,0,n,s));if(r)for(var o=0,h=e.length;o<h;o++){var l=e[o]*s,u=o<h-1?e[o+1]*s:t.length;a-=Math.abs(vt(t,l,u,s))}var d=0;for(o=0;o<i.length;o+=3){var c=i[o]*s,p=i[o+1]*s,f=i[o+2]*s;d+=Math.abs((t[c]-t[f])*(t[p+1]-t[c+1])-(t[c]-t[p])*(t[f+1]-t[c+1]))}return 0===a&&0===d?0:Math.abs((d-a)/a)},$.flatten=function(t){for(var e=t[0][0].length,s={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var n=0;n<t[r].length;n++)for(var a=0;a<e;a++)s.vertices.push(t[r][n][a]);r>0&&(i+=t[r-1].length,s.holes.push(i))}return s},Y.default=j;var yt=z((function(t,e){/*! https://mths.be/punycode v1.3.2 by @mathias */!function(s){var i=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,n="object"==typeof V&&V;(n.global===n||n.window===n||n.self===n)&&(s=n);var a,o,h=2147483647,l=36,u=1,d=26,c=38,p=700,f=72,m=128,_="-",g=/^xn--/,x=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-u,b=Math.floor,E=String.fromCharCode;function A(t){throw RangeError(y[t])}function R(t,e){for(var s=t.length,i=[];s--;)i[s]=e(t[s]);return i}function S(t,e){var s=t.split("@"),i="";return s.length>1&&(i=s[0]+"@",t=s[1]),i+R((t=t.replace(v,".")).split("."),e).join(".")}function w(t){for(var e,s,i=[],r=0,n=t.length;r<n;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<n?56320==(64512&(s=t.charCodeAt(r++)))?i.push(((1023&e)<<10)+(1023&s)+65536):(i.push(e),r--):i.push(e);return i}function I(t){return R(t,(function(t){var e="";return t>65535&&(e+=E((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=E(t)})).join("")}function M(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:l}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function D(t,e,s){var i=0;for(t=s?b(t/p):t>>1,t+=b(t/e);t>T*d>>1;i+=l)t=b(t/T);return b(i+(T+1)*t/(t+c))}function P(t){var e,s,i,r,n,a,o,c,p,g,x=[],v=t.length,y=0,T=m,E=f;for((s=t.lastIndexOf(_))<0&&(s=0),i=0;i<s;++i)t.charCodeAt(i)>=128&&A("not-basic"),x.push(t.charCodeAt(i));for(r=s>0?s+1:0;r<v;){for(n=y,a=1,o=l;r>=v&&A("invalid-input"),((c=M(t.charCodeAt(r++)))>=l||c>b((h-y)/a))&&A("overflow"),y+=c*a,!(c<(p=o<=E?u:o>=E+d?d:o-E));o+=l)a>b(h/(g=l-p))&&A("overflow"),a*=g;E=D(y-n,e=x.length+1,0==n),b(y/e)>h-T&&A("overflow"),T+=b(y/e),y%=e,x.splice(y++,0,T)}return I(x)}function O(t){var e,s,i,r,n,a,o,c,p,g,x,v,y,T,R,S=[];for(v=(t=w(t)).length,e=m,s=0,n=f,a=0;a<v;++a)(x=t[a])<128&&S.push(E(x));for(i=r=S.length,r&&S.push(_);i<v;){for(o=h,a=0;a<v;++a)(x=t[a])>=e&&x<o&&(o=x);for(o-e>b((h-s)/(y=i+1))&&A("overflow"),s+=(o-e)*y,e=o,a=0;a<v;++a)if((x=t[a])<e&&++s>h&&A("overflow"),x==e){for(c=s,p=l;!(c<(g=p<=n?u:p>=n+d?d:p-n));p+=l)R=c-g,T=l-g,S.push(E(C(g+R%T,0))),c=b(R/T);S.push(E(C(c,0))),n=D(s,y,i==r),s=0,++i}++s,++e}return S.join("")}if(a={version:"1.3.2",ucs2:{decode:w,encode:I},decode:P,encode:O,toASCII:function(t){return S(t,(function(t){return x.test(t)?"xn--"+O(t):t}))},toUnicode:function(t){return S(t,(function(t){return g.test(t)?P(t.slice(4).toLowerCase()):t}))}},i&&r)if(t.exports==i)r.exports=a;else for(o in a)a.hasOwnProperty(o)&&(i[o]=a[o]);else s.punycode=a}(V)})),Tt={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};function Et(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var At=function(t,e,s,i){e=e||"&",s=s||"=";var r={};if("string"!=typeof t||0===t.length)return r;var n=/\+/g;t=t.split(e);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var o=t.length;a>0&&o>a&&(o=a);for(var h=0;h<o;++h){var l,u,d,c,p=t[h].replace(n,"%20"),f=p.indexOf(s);f>=0?(l=p.substr(0,f),u=p.substr(f+1)):(l=p,u=""),d=decodeURIComponent(l),c=decodeURIComponent(u),Et(r,d)?Array.isArray(r[d])?r[d].push(c):r[d]=[r[d],c]:r[d]=c}return r},Rt=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},St=function(t,e,s,i){return e=e||"&",s=s||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var r=encodeURIComponent(Rt(i))+s;return Array.isArray(t[i])?t[i].map((function(t){return r+encodeURIComponent(Rt(t))})).join(e):r+encodeURIComponent(Rt(t[i]))})).join(e):i?encodeURIComponent(Rt(i))+s+encodeURIComponent(Rt(t)):""},wt=z((function(t,e){"use strict";e.decode=e.parse=At,e.encode=e.stringify=St})),It=zt,Mt=function(t,e){return zt(t,!1,!0).resolve(e)},Ct=function(t){return Tt.isString(t)&&(t=zt(t)),t instanceof Dt?t.format():Dt.prototype.format.call(t)};function Dt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Pt=/^([a-z0-9.+-]+:)/i,Ot=/:[0-9]*$/,Ft=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Bt=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Nt=["'"].concat(Bt),Lt=["%","/","?",";","#"].concat(Nt),Gt=["/","?","#"],Ut=/^[+a-z0-9A-Z_-]{0,63}$/,kt=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Xt={javascript:!0,"javascript:":!0},Ht={javascript:!0,"javascript:":!0},Vt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function zt(t,e,s){if(t&&Tt.isObject(t)&&t instanceof Dt)return t;var i=new Dt;return i.parse(t,e,s),i}Dt.prototype.parse=function(t,e,s){if(!Tt.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),r=-1!==i&&i<t.indexOf("#")?"?":"#",n=t.split(r);n[0]=n[0].replace(/\\/g,"/");var a=t=n.join(r);if(a=a.trim(),!s&&1===t.split("#").length){var o=Ft.exec(a);if(o)return this.path=a,this.href=a,this.pathname=o[1],o[2]?(this.search=o[2],this.query=e?wt.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var h=Pt.exec(a);if(h){var l=(h=h[0]).toLowerCase();this.protocol=l,a=a.substr(h.length)}if(s||h||a.match(/^\/\/[^@\/]+@[^@\/]+/)){var u="//"===a.substr(0,2);u&&(!h||!Ht[h])&&(a=a.substr(2),this.slashes=!0)}if(!Ht[h]&&(u||h&&!Vt[h])){for(var d=-1,c=0;c<Gt.length;c++){-1!==(m=a.indexOf(Gt[c]))&&(-1===d||m<d)&&(d=m)}var p,f;-1!==(f=-1===d?a.lastIndexOf("@"):a.lastIndexOf("@",d))&&(p=a.slice(0,f),a=a.slice(f+1),this.auth=decodeURIComponent(p)),d=-1;for(c=0;c<Lt.length;c++){var m;-1!==(m=a.indexOf(Lt[c]))&&(-1===d||m<d)&&(d=m)}-1===d&&(d=a.length),this.host=a.slice(0,d),a=a.slice(d),this.parseHost(),this.hostname=this.hostname||"";var _="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!_)for(var g=this.hostname.split(/\./),x=(c=0,g.length);c<x;c++){var v=g[c];if(v&&!v.match(Ut)){for(var y="",T=0,b=v.length;T<b;T++)v.charCodeAt(T)>127?y+="x":y+=v[T];if(!y.match(Ut)){var E=g.slice(0,c),A=g.slice(c+1),R=v.match(kt);R&&(E.push(R[1]),A.unshift(R[2])),A.length&&(a="/"+A.join(".")+a),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),_||(this.hostname=yt.toASCII(this.hostname));var S=this.port?":"+this.port:"",w=this.hostname||"";this.host=w+S,this.href+=this.host,_&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!Xt[l])for(c=0,x=Nt.length;c<x;c++){var I=Nt[c];if(-1!==a.indexOf(I)){var M=encodeURIComponent(I);M===I&&(M=escape(I)),a=a.split(I).join(M)}}var C=a.indexOf("#");-1!==C&&(this.hash=a.substr(C),a=a.slice(0,C));var D=a.indexOf("?");if(-1!==D?(this.search=a.substr(D),this.query=a.substr(D+1),e&&(this.query=wt.parse(this.query)),a=a.slice(0,D)):e&&(this.search="",this.query={}),a&&(this.pathname=a),Vt[l]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){S=this.pathname||"";var P=this.search||"";this.path=S+P}return this.href=this.format(),this},Dt.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",s=this.pathname||"",i=this.hash||"",r=!1,n="";this.host?r=t+this.host:this.hostname&&(r=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(r+=":"+this.port)),this.query&&Tt.isObject(this.query)&&Object.keys(this.query).length&&(n=wt.stringify(this.query));var a=this.search||n&&"?"+n||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||Vt[e])&&!1!==r?(r="//"+(r||""),s&&"/"!==s.charAt(0)&&(s="/"+s)):r||(r=""),i&&"#"!==i.charAt(0)&&(i="#"+i),a&&"?"!==a.charAt(0)&&(a="?"+a),e+r+(s=s.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(a=a.replace("#","%23"))+i},Dt.prototype.resolve=function(t){return this.resolveObject(zt(t,!1,!0)).format()},Dt.prototype.resolveObject=function(t){if(Tt.isString(t)){var e=new Dt;e.parse(t,!1,!0),t=e}for(var s=new Dt,i=Object.keys(this),r=0;r<i.length;r++){var n=i[r];s[n]=this[n]}if(s.hash=t.hash,""===t.href)return s.href=s.format(),s;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),o=0;o<a.length;o++){var h=a[o];"protocol"!==h&&(s[h]=t[h])}return Vt[s.protocol]&&s.hostname&&!s.pathname&&(s.path=s.pathname="/"),s.href=s.format(),s}if(t.protocol&&t.protocol!==s.protocol){if(!Vt[t.protocol]){for(var l=Object.keys(t),u=0;u<l.length;u++){var d=l[u];s[d]=t[d]}return s.href=s.format(),s}if(s.protocol=t.protocol,t.host||Ht[t.protocol])s.pathname=t.pathname;else{for(var c=(t.pathname||"").split("/");c.length&&!(t.host=c.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==c[0]&&c.unshift(""),c.length<2&&c.unshift(""),s.pathname=c.join("/")}if(s.search=t.search,s.query=t.query,s.host=t.host||"",s.auth=t.auth,s.hostname=t.hostname||t.host,s.port=t.port,s.pathname||s.search){var p=s.pathname||"",f=s.search||"";s.path=p+f}return s.slashes=s.slashes||t.slashes,s.href=s.format(),s}var m=s.pathname&&"/"===s.pathname.charAt(0),_=t.host||t.pathname&&"/"===t.pathname.charAt(0),g=_||m||s.host&&t.pathname,x=g,v=s.pathname&&s.pathname.split("/")||[],y=(c=t.pathname&&t.pathname.split("/")||[],s.protocol&&!Vt[s.protocol]);if(y&&(s.hostname="",s.port=null,s.host&&(""===v[0]?v[0]=s.host:v.unshift(s.host)),s.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===c[0]?c[0]=t.host:c.unshift(t.host)),t.host=null),g=g&&(""===c[0]||""===v[0])),_)s.host=t.host||""===t.host?t.host:s.host,s.hostname=t.hostname||""===t.hostname?t.hostname:s.hostname,s.search=t.search,s.query=t.query,v=c;else if(c.length)v||(v=[]),v.pop(),v=v.concat(c),s.search=t.search,s.query=t.query;else if(!Tt.isNullOrUndefined(t.search)){if(y)s.hostname=s.host=v.shift(),(R=!!(s.host&&s.host.indexOf("@")>0)&&s.host.split("@"))&&(s.auth=R.shift(),s.host=s.hostname=R.shift());return s.search=t.search,s.query=t.query,(!Tt.isNull(s.pathname)||!Tt.isNull(s.search))&&(s.path=(s.pathname?s.pathname:"")+(s.search?s.search:"")),s.href=s.format(),s}if(!v.length)return s.pathname=null,s.search?s.path="/"+s.search:s.path=null,s.href=s.format(),s;for(var T=v.slice(-1)[0],b=(s.host||t.host||v.length>1)&&("."===T||".."===T)||""===T,E=0,A=v.length;A>=0;A--)"."===(T=v[A])?v.splice(A,1):".."===T?(v.splice(A,1),E++):E&&(v.splice(A,1),E--);if(!g&&!x)for(;E--;E)v.unshift("..");g&&""!==v[0]&&(!v[0]||"/"!==v[0].charAt(0))&&v.unshift(""),b&&"/"!==v.join("/").substr(-1)&&v.push("");var R,S=""===v[0]||v[0]&&"/"===v[0].charAt(0);y&&(s.hostname=s.host=S?"":v.length?v.shift():"",(R=!!(s.host&&s.host.indexOf("@")>0)&&s.host.split("@"))&&(s.auth=R.shift(),s.host=s.hostname=R.shift()));return(g=g||s.host&&v.length)&&!S&&v.unshift(""),v.length?s.pathname=v.join("/"):(s.pathname=null,s.path=null),(!Tt.isNull(s.pathname)||!Tt.isNull(s.search))&&(s.path=(s.pathname?s.pathname:"")+(s.search?s.search:"")),s.auth=t.auth||s.auth,s.slashes=s.slashes||t.slashes,s.href=s.format(),s},Dt.prototype.parseHost=function(){var t=this.host,e=Ot.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const Wt={parse:It,format:Ct,resolve:Mt};function Yt(t){if("string"!=typeof t)throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function jt(t){return t.split("?")[0].split("#")[0]}const $t={toPosix:t=>function(t,e,s){return t.replace(new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"g"),s)}(t,"\\","/"),isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:t=>/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t),hasProtocol(t){return/^[^/:]+:\//.test(this.toPosix(t))},getProtocol(t){Yt(t),t=this.toPosix(t);let e="";const s=/^file:\/\/\//.exec(t),i=/^[^/:]+:\/\//.exec(t),r=/^[^/:]+:\//.exec(t);if(s||i||r){const n=(null==s?void 0:s[0])||(null==i?void 0:i[0])||(null==r?void 0:r[0]);e=n,t=t.slice(n.length)}return e},toAbsolute(t,e,s){if(this.isDataUrl(t))return t;const i=jt(this.toPosix(null!=e?e:A.ADAPTER.getBaseUrl())),r=jt(this.toPosix(null!=s?s:this.rootname(i)));return Yt(t),(t=this.toPosix(t)).startsWith("/")?$t.join(r,t.slice(1)):this.isAbsolute(t)?t:this.join(i,t)},normalize(t){if(Yt(t=this.toPosix(t)),0===t.length)return".";let e="";const s=t.startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const i=t.endsWith("/");return t=function(t,e){let s="",i=0,r=-1,n=0,a=-1;for(let o=0;o<=t.length;++o){if(o<t.length)a=t.charCodeAt(o);else{if(47===a)break;a=47}if(47===a){if(r!==o-1&&1!==n)if(r!==o-1&&2===n){if(s.length<2||2!==i||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2))if(s.length>2){const t=s.lastIndexOf("/");if(t!==s.length-1){-1===t?(s="",i=0):(s=s.slice(0,t),i=s.length-1-s.lastIndexOf("/")),r=o,n=0;continue}}else if(2===s.length||1===s.length){s="",i=0,r=o,n=0;continue}e&&(s.length>0?s+="/..":s="..",i=2)}else s.length>0?s+=`/${t.slice(r+1,o)}`:s=t.slice(r+1,o),i=o-r-1;r=o,n=0}else 46===a&&-1!==n?++n:n=-1}return s}(t,!1),t.length>0&&i&&(t+="/"),s?`/${t}`:e+t},isAbsolute(t){return Yt(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join(...t){var e;if(0===t.length)return".";let s;for(let i=0;i<t.length;++i){const r=t[i];if(Yt(r),r.length>0)if(void 0===s)s=r;else{const n=null!=(e=t[i-1])?e:"";this.extname(n)?s+=`/../${r}`:s+=`/${r}`}}return void 0===s?".":this.normalize(s)},dirname(t){if(Yt(t),0===t.length)return".";let e=(t=this.toPosix(t)).charCodeAt(0);const s=47===e;let i=-1,r=!0;const n=this.getProtocol(t),a=t;for(let s=(t=t.slice(n.length)).length-1;s>=1;--s)if(e=t.charCodeAt(s),47===e){if(!r){i=s;break}}else r=!1;return-1===i?s?"/":this.isUrl(a)?n+t:n:s&&1===i?"//":n+t.slice(0,i)},rootname(t){Yt(t);let e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){const s=t.indexOf("/",e.length);e=-1!==s?t.slice(0,s):t,e.endsWith("/")||(e+="/")}return e},basename(t,e){Yt(t),e&&Yt(e),t=jt(this.toPosix(t));let s,i=0,r=-1,n=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let a=e.length-1,o=-1;for(s=t.length-1;s>=0;--s){const h=t.charCodeAt(s);if(47===h){if(!n){i=s+1;break}}else-1===o&&(n=!1,o=s+1),a>=0&&(h===e.charCodeAt(a)?-1==--a&&(r=s):(a=-1,r=o))}return i===r?r=o:-1===r&&(r=t.length),t.slice(i,r)}for(s=t.length-1;s>=0;--s)if(47===t.charCodeAt(s)){if(!n){i=s+1;break}}else-1===r&&(n=!1,r=s+1);return-1===r?"":t.slice(i,r)},extname(t){Yt(t);let e=-1,s=0,i=-1,r=!0,n=0;for(let a=(t=jt(this.toPosix(t))).length-1;a>=0;--a){const o=t.charCodeAt(a);if(47!==o)-1===i&&(r=!1,i=a+1),46===o?-1===e?e=a:1!==n&&(n=1):-1!==e&&(n=-1);else if(!r){s=a+1;break}}return-1===e||-1===i||0===n||1===n&&e===i-1&&e===s+1?"":t.slice(e,i)},parse(t){Yt(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;let s=(t=jt(this.toPosix(t))).charCodeAt(0);const i=this.isAbsolute(t);let r;e.root=this.rootname(t),r=i||this.hasProtocol(t)?1:0;let n=-1,a=0,o=-1,h=!0,l=t.length-1,u=0;for(;l>=r;--l)if(s=t.charCodeAt(l),47!==s)-1===o&&(h=!1,o=l+1),46===s?-1===n?n=l:1!==u&&(u=1):-1!==n&&(u=-1);else if(!h){a=l+1;break}return-1===n||-1===o||0===u||1===u&&n===o-1&&n===a+1?-1!==o&&(e.base=e.name=0===a&&i?t.slice(1,o):t.slice(a,o)):(0===a&&i?(e.name=t.slice(1,n),e.base=t.slice(1,o)):(e.name=t.slice(a,n),e.base=t.slice(a,o)),e.ext=t.slice(n,o)),e.dir=this.dirname(t),e},sep:"/",delimiter:":"},qt={};function Kt(t,e,s=3){if(qt[e])return;let i=(new Error).stack;void 0===i?console.warn("PixiJS Deprecation Warning: ",`${e}\nDeprecated since v${t}`):(i=i.split("\n").splice(s).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e}\nDeprecated since v${t}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}\nDeprecated since v${t}`),console.warn(i))),qt[e]=!0}let Zt;function Qt(){return void 0===Zt&&(Zt=function(){var t;const e={stencil:!0,failIfMajorPerformanceCaveat:A.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!A.ADAPTER.getWebGLRenderingContext())return!1;const s=A.ADAPTER.createCanvas();let i=s.getContext("webgl",e)||s.getContext("experimental-webgl",e);const r=!(null==(t=null==i?void 0:i.getContextAttributes())||!t.stencil);if(i){const t=i.getExtension("WEBGL_lose_context");t&&t.loseContext()}return i=null,r}catch(t){return!1}}()),Zt}var Jt={grad:.9,turn:360,rad:360/(2*Math.PI)},te=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},ee=function(t,e,s){return void 0===e&&(e=0),void 0===s&&(s=Math.pow(10,e)),Math.round(s*t)/s+0},se=function(t,e,s){return void 0===e&&(e=0),void 0===s&&(s=1),t>s?s:t>e?t:e},ie=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},re=function(t){return{r:se(t.r,0,255),g:se(t.g,0,255),b:se(t.b,0,255),a:se(t.a)}},ne=function(t){return{r:ee(t.r),g:ee(t.g),b:ee(t.b),a:ee(t.a,3)}},ae=/^#([0-9a-f]{3,8})$/i,oe=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},he=function(t){var e=t.r,s=t.g,i=t.b,r=t.a,n=Math.max(e,s,i),a=n-Math.min(e,s,i),o=a?n===e?(s-i)/a:n===s?2+(i-e)/a:4+(e-s)/a:0;return{h:60*(o<0?o+6:o),s:n?a/n*100:0,v:n/255*100,a:r}},le=function(t){var e=t.h,s=t.s,i=t.v,r=t.a;e=e/360*6,s/=100,i/=100;var n=Math.floor(e),a=i*(1-s),o=i*(1-(e-n)*s),h=i*(1-(1-e+n)*s),l=n%6;return{r:255*[i,o,a,a,h,i][l],g:255*[h,i,i,o,a,a][l],b:255*[a,a,h,i,i,o][l],a:r}},ue=function(t){return{h:ie(t.h),s:se(t.s,0,100),l:se(t.l,0,100),a:se(t.a)}},de=function(t){return{h:ee(t.h),s:ee(t.s),l:ee(t.l),a:ee(t.a,3)}},ce=function(t){return le((s=(e=t).s,{h:e.h,s:(s*=((i=e.l)<50?i:100-i)/100)>0?2*s/(i+s)*100:0,v:i+s,a:e.a}));var e,s,i},pe=function(t){return{h:(e=he(t)).h,s:(r=(200-(s=e.s))*(i=e.v)/100)>0&&r<200?s*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:e.a};var e,s,i,r},fe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,me=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_e=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ge=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xe={string:[[function(t){var e=ae.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?ee(parseInt(t[3]+t[3],16)/255,2):1}:6===t.length||8===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?ee(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=_e.exec(t)||ge.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:re({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:void 0===e[7]?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=fe.exec(t)||me.exec(t);if(!e)return null;var s,i,r=ue({h:(s=e[1],i=e[2],void 0===i&&(i="deg"),Number(s)*(Jt[i]||1)),s:Number(e[3]),l:Number(e[4]),a:void 0===e[5]?1:Number(e[5])/(e[6]?100:1)});return ce(r)},"hsl"]],object:[[function(t){var e=t.r,s=t.g,i=t.b,r=t.a,n=void 0===r?1:r;return te(e)&&te(s)&&te(i)?re({r:Number(e),g:Number(s),b:Number(i),a:Number(n)}):null},"rgb"],[function(t){var e=t.h,s=t.s,i=t.l,r=t.a,n=void 0===r?1:r;if(!te(e)||!te(s)||!te(i))return null;var a=ue({h:Number(e),s:Number(s),l:Number(i),a:Number(n)});return ce(a)},"hsl"],[function(t){var e=t.h,s=t.s,i=t.v,r=t.a,n=void 0===r?1:r;if(!te(e)||!te(s)||!te(i))return null;var a,o=(a={h:Number(e),s:Number(s),v:Number(i),a:Number(n)},{h:ie(a.h),s:se(a.s,0,100),v:se(a.v,0,100),a:se(a.a)});return le(o)},"hsv"]]},ve=function(t,e){for(var s=0;s<e.length;s++){var i=e[s][0](t);if(i)return[i,e[s][1]]}return[null,void 0]},ye=function(t){return"string"==typeof t?ve(t.trim(),xe.string):"object"==typeof t&&null!==t?ve(t,xe.object):[null,void 0]},Te=function(t,e){var s=pe(t);return{h:s.h,s:se(s.s+100*e,0,100),l:s.l,a:s.a}},be=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},Ee=function(t,e){var s=pe(t);return{h:s.h,s:s.s,l:se(s.l+100*e,0,100),a:s.a}},Ae=function(){function t(t){this.parsed=ye(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return null!==this.parsed},t.prototype.brightness=function(){return ee(be(this.rgba),2)},t.prototype.isDark=function(){return be(this.rgba)<.5},t.prototype.isLight=function(){return be(this.rgba)>=.5},t.prototype.toHex=function(){return e=(t=ne(this.rgba)).r,s=t.g,i=t.b,n=(r=t.a)<1?oe(ee(255*r)):"","#"+oe(e)+oe(s)+oe(i)+n;var t,e,s,i,r,n},t.prototype.toRgb=function(){return ne(this.rgba)},t.prototype.toRgbString=function(){return e=(t=ne(this.rgba)).r,s=t.g,i=t.b,(r=t.a)<1?"rgba("+e+", "+s+", "+i+", "+r+")":"rgb("+e+", "+s+", "+i+")";var t,e,s,i,r},t.prototype.toHsl=function(){return de(pe(this.rgba))},t.prototype.toHslString=function(){return e=(t=de(pe(this.rgba))).h,s=t.s,i=t.l,(r=t.a)<1?"hsla("+e+", "+s+"%, "+i+"%, "+r+")":"hsl("+e+", "+s+"%, "+i+"%)";var t,e,s,i,r},t.prototype.toHsv=function(){return t=he(this.rgba),{h:ee(t.h),s:ee(t.s),v:ee(t.v),a:ee(t.a,3)};var t},t.prototype.invert=function(){return Re({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},t.prototype.saturate=function(t){return void 0===t&&(t=.1),Re(Te(this.rgba,t))},t.prototype.desaturate=function(t){return void 0===t&&(t=.1),Re(Te(this.rgba,-t))},t.prototype.grayscale=function(){return Re(Te(this.rgba,-1))},t.prototype.lighten=function(t){return void 0===t&&(t=.1),Re(Ee(this.rgba,t))},t.prototype.darken=function(t){return void 0===t&&(t=.1),Re(Ee(this.rgba,-t))},t.prototype.rotate=function(t){return void 0===t&&(t=15),this.hue(this.hue()+t)},t.prototype.alpha=function(t){return"number"==typeof t?Re({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):ee(this.rgba.a,3);var e},t.prototype.hue=function(t){var e=pe(this.rgba);return"number"==typeof t?Re({h:t,s:e.s,l:e.l,a:e.a}):ee(e.h)},t.prototype.isEqual=function(t){return this.toHex()===Re(t).toHex()},t}(),Re=function(t){return t instanceof Ae?t:new Ae(t)},Se=[];!function(t){t.forEach((function(t){Se.indexOf(t)<0&&(t(Ae,xe),Se.push(t))}))}([function(t,e){var s={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var r in s)i[s[r]]=r;var n={};t.prototype.toName=function(e){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,a,o=i[this.toHex()];if(o)return o;if(null!=e&&e.closest){var h=this.toRgb(),l=1/0,u="black";if(!n.length)for(var d in s)n[d]=new t(s[d]).toRgb();for(var c in s){var p=(r=h,a=n[c],Math.pow(r.r-a.r,2)+Math.pow(r.g-a.g,2)+Math.pow(r.b-a.b,2));p<l&&(l=p,u=c)}return u}},e.string.push([function(e){var i=e.toLowerCase(),r="transparent"===i?"#0000":s[i];return r?new t(r).toRgb():null},"name"])}]);const we=class{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof we)this._value=this.cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(null===t)throw new Error("Cannot set PIXI.Color#value to null");(null===this._value||!this.isSourceEqual(this._value,t))&&(this.normalize(t),this._value=this.cloneSource(t))}}get value(){return this._value}cloneSource(t){return"string"==typeof t||"number"==typeof t||t instanceof Number||null===t?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):"object"==typeof t&&null!==t?bt({},t):t}isSourceEqual(t,e){const s=typeof t;if(s!==typeof e)return!1;if("number"===s||"string"===s||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length===e.length&&t.every(((t,s)=>t===e[s]));if(null!==t&&null!==e){const s=Object.keys(t),i=Object.keys(e);return s.length===i.length&&s.every((s=>t[s]===e[s]))}return t===e}toRgba(){const[t,e,s,i]=this._components;return{r:t,g:e,b:s,a:i}}toRgb(){const[t,e,s]=this._components;return{r:t,g:e,b:s}}toRgbaString(){const[t,e,s]=this.toUint8RgbArray();return`rgba(${t},${e},${s},${this.alpha})`}toUint8RgbArray(t){const[e,s,i]=this._components;return(t=null!=t?t:[])[0]=Math.round(255*e),t[1]=Math.round(255*s),t[2]=Math.round(255*i),t}toRgbArray(t){t=null!=t?t:[];const[e,s,i]=this._components;return t[0]=e,t[1]=s,t[2]=i,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}multiply(t){const[e,s,i,r]=we.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=s,this._components[2]*=i,this._components[3]*=r,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(1===t)return(255<<24)+this._int;if(0===t)return e?0:this._int;let s=this._int>>16&255,i=this._int>>8&255,r=255&this._int;return e&&(s=s*t+.5|0,i=i*t+.5|0,r=r*t+.5|0),(255*t<<24)+(s<<16)+(i<<8)+r}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,s,i]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(s*t)/t,this._components[2]=Math.round(i*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=null!=t?t:[];const[e,s,i,r]=this._components;return t[0]=e,t[1]=s,t[2]=i,t[3]=r,t}normalize(t){let e,s,i,r;if(("number"==typeof t||t instanceof Number)&&t>=0&&t<=16777215){e=(t>>16&255)/255,s=(t>>8&255)/255,i=(255&t)/255,r=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,s,i,r=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,s,i,r=255]=t,e/=255,s/=255,i/=255,r/=255;else if("string"==typeof t||"object"==typeof t){if("string"==typeof t){const e=we.HEX_PATTERN.exec(t);e&&(t=`#${e[2]}`)}const n=Re(t);n.isValid()&&(({r:e,g:s,b:i,a:r}=n.rgba),e/=255,s/=255,i/=255)}if(void 0===e)throw new Error(`Unable to convert color ${t}`);this._components[0]=e,this._components[1]=s,this._components[2]=i,this._components[3]=r,this.refreshInt()}refreshInt(){this._clamp(this._components);const[t,e,s]=this._components;this._int=(255*t<<16)+(255*e<<8)+(255*s|0)}_clamp(t,e=0,s=1){return"number"==typeof t?Math.min(Math.max(t,e),s):(t.forEach(((i,r)=>{t[r]=Math.min(Math.max(i,e),s)})),t)}};let Ie=we;function Me(t){return Kt("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),Ie.shared.setValue(t).toHex()}function Ce(t){return Kt("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Ie.shared.setValue(t).toNumber()}Ie.shared=new we,Ie.temp=new we,Ie.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;const De=function(){const t=[],e=[];for(let s=0;s<32;s++)t[s]=s,e[s]=s;t[a.NORMAL_NPM]=a.NORMAL,t[a.ADD_NPM]=a.ADD,t[a.SCREEN_NPM]=a.SCREEN,e[a.NORMAL]=a.NORMAL_NPM,e[a.ADD]=a.ADD_NPM,e[a.SCREEN]=a.SCREEN_NPM;const s=[];return s.push(e),s.push(t),s}();function Pe(t,e){return De[e?1:0][t]}const Oe=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function Fe(t,e=null){const s=6*t;if((e=e||new Uint16Array(s)).length!==s)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${s}`);for(let t=0,i=0;t<s;t+=6,i+=4)e[t+0]=i+0,e[t+1]=i+1,e[t+2]=i+2,e[t+3]=i+0,e[t+4]=i+2,e[t+5]=i+3;return e}function Be(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}const Ne={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};function Le(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Ge(t){return!(t&t-1||!t)}function Ue(t){let e=(t>65535?1:0)<<4,s=((t>>>=e)>255?1:0)<<3;return e|=s,s=((t>>>=s)>15?1:0)<<2,e|=s,s=((t>>>=s)>3?1:0)<<1,e|=s,e|(t>>>=s)>>1}function ke(t,e,s){const i=t.length;let r;if(e>=i||0===s)return;const n=i-(s=e+s>i?i-e:s);for(r=e;r<n;++r)t[r]=t[r+s];t.length=n}function Xe(t){return 0===t?0:t<0?-1:1}let He=0;function Ve(){return++He}const ze=class{constructor(t,e,s,i){this.left=t,this.top=e,this.right=s,this.bottom=i}get width(){return this.right-this.left}get height(){return this.bottom-this.top}isEmpty(){return this.left===this.right||this.top===this.bottom}};let We=ze;We.EMPTY=new ze(0,0,0,0);const Ye={},je=Object.create(null),$e=Object.create(null);class qe{constructor(t,e,s){this._canvas=A.ADAPTER.createCanvas(),this._context=this._canvas.getContext("2d"),this.resolution=s||A.RESOLUTION,this.resize(t,e)}clear(){this._checkDestroyed(),this._context.setTransform(1,0,0,1,0,0),this._context.clearRect(0,0,this._canvas.width,this._canvas.height)}resize(t,e){this._checkDestroyed(),this._canvas.width=Math.round(t*this.resolution),this._canvas.height=Math.round(e*this.resolution)}destroy(){this._context=null,this._canvas=null}get width(){return this._checkDestroyed(),this._canvas.width}set width(t){this._checkDestroyed(),this._canvas.width=Math.round(t)}get height(){return this._checkDestroyed(),this._canvas.height}set height(t){this._checkDestroyed(),this._canvas.height=Math.round(t)}get canvas(){return this._checkDestroyed(),this._canvas}get context(){return this._checkDestroyed(),this._context}_checkDestroyed(){if(null===this._canvas)throw new TypeError("The CanvasRenderTarget has already been destroyed")}}function Ke(t,e,s){for(let i=0,r=4*s*e;i<e;++i,r+=4)if(0!==t[r+3])return!1;return!0}function Ze(t,e,s,i,r){const n=4*e;for(let e=i,a=i*n+4*s;e<=r;++e,a+=n)if(0!==t[a+3])return!1;return!0}function Qe(t){const{width:e,height:s}=t,i=t.getContext("2d",{willReadFrequently:!0});if(null===i)throw new TypeError("Failed to get canvas 2D context");const r=i.getImageData(0,0,e,s).data;let n=0,a=0,o=e-1,h=s-1;for(;a<s&&Ke(r,e,a);)++a;if(a===s)return We.EMPTY;for(;Ke(r,e,h);)--h;for(;Ze(r,e,n,a,h);)++n;for(;Ze(r,e,o,a,h);)--o;return++o,++h,new We(n,a,o,h)}function Je(t){const e=Qe(t),{width:s,height:i}=e;let r=null;if(!e.isEmpty()){const n=t.getContext("2d");if(null===n)throw new TypeError("Failed to get canvas 2D context");r=n.getImageData(e.left,e.top,s,i)}return{width:s,height:i,data:r}}let ts;function es(t,e=globalThis.location){if(t.startsWith("data:"))return"";e=e||globalThis.location,ts||(ts=document.createElement("a")),ts.href=t;const s=Wt.parse(ts.href),i=!s.port&&""===e.port||s.port===e.port;return s.hostname===e.hostname&&i&&s.protocol===e.protocol?"":"anonymous"}function ss(t,e=1){var s;const i=null==(s=A.RETINA_PREFIX)?void 0:s.exec(t);return i?parseFloat(i[1]):e}var is={__proto__:null,isMobile:H,EventEmitter:W,earcut:Y,url:Wt,path:$t,sayHello:function(){Kt("7.0.0",'sayHello is deprecated, please use Renderer\'s "hello" option')},skipHello:function(){Kt("7.0.0","skipHello is deprecated, please use settings.RENDER_OPTIONS.hello")},isWebGLSupported:Qt,hex2rgb:function(t,e=[]){return Kt("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),Ie.shared.setValue(t).toRgbArray(e)},hex2string:Me,rgb2hex:Ce,string2hex:function(t){return Kt("7.2.0","utils.string2hex is deprecated, use Color#toNumber instead"),Ie.shared.setValue(t).toNumber()},correctBlendMode:Pe,premultiplyBlendMode:De,premultiplyRgba:function(t,e,s,i=!0){return Kt("7.2.0","utils.premultiplyRgba has moved to Color.premultiply"),Ie.shared.setValue(t).premultiply(e,i).toArray(null!=s?s:new Float32Array(4))},premultiplyTint:function(t,e){return Kt("7.2.0","utils.premultiplyTint has moved to Color.toPremultiplied"),Ie.shared.setValue(t).toPremultiplied(e)},premultiplyTintToRgba:function(t,e,s,i=!0){return Kt("7.2.0","utils.premultiplyTintToRgba has moved to Color.premultiply"),Ie.shared.setValue(t).premultiply(e,i).toArray(null!=s?s:new Float32Array(4))},DATA_URI:Oe,createIndicesForQuads:Fe,getBufferType:Be,interleaveTypedArrays:function(t,e){let s=0,i=0;const r={};for(let r=0;r<t.length;r++)i+=e[r],s+=t[r].length;const n=new ArrayBuffer(4*s);let a=null,o=0;for(let s=0;s<t.length;s++){const h=e[s],l=t[s],u=Be(l);r[u]||(r[u]=new Ne[u](n)),a=r[u];for(let t=0;t<l.length;t++){a[(t/h|0)*i+o+t%h]=l[t]}o+=h}return new Float32Array(n)},isPow2:Ge,log2:Ue,nextPow2:Le,removeItems:ke,sign:Xe,uid:Ve,deprecation:Kt,BoundingBox:We,BaseTextureCache:$e,ProgramCache:Ye,TextureCache:je,clearTextureCache:function(){let t;for(t in je)delete je[t];for(t in $e)delete $e[t]},destroyTextureCache:function(){let t;for(t in je)je[t].destroy();for(t in $e)$e[t].destroy()},CanvasRenderTarget:qe,getCanvasBoundingBox:Qe,trimCanvas:Je,decomposeDataUri:function(t){const e=Oe.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]}},determineCrossOrigin:es,getResolutionOfUrl:ss},rs=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(rs||{});const ns=t=>{if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");const e="object"!=typeof t.extension?{type:t.extension}:t.extension;t=Qi(bt({},e),{ref:t})}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t=bt({},t)).type&&(t.type=[t.type]),t},as=(t,e)=>{var s;return null!=(s=ns(t).priority)?s:e},os={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(ns).forEach((t=>{t.type.forEach((e=>{var s,i;return null==(i=(s=this._removeHandlers)[e])?void 0:i.call(s,t)}))})),this},add(...t){return t.map(ns).forEach((t=>{t.type.forEach((e=>{const s=this._addHandlers,i=this._queue;s[e]?s[e](t):(i[e]=i[e]||[],i[e].push(t))}))})),this},handle(t,e,s){const i=this._addHandlers,r=this._removeHandlers;if(i[t]||r[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,r[t]=s;const n=this._queue;return n[t]&&(n[t].forEach((t=>e(t))),delete n[t]),this},handleByMap(t,e){return this.handle(t,(t=>{e[t.name]=t.ref}),(t=>{delete e[t.name]}))},handleByList(t,e,s=-1){return this.handle(t,(t=>{e.includes(t.ref)||(e.push(t.ref),e.sort(((t,e)=>as(e,s)-as(t,s))))}),(t=>{const s=e.indexOf(t.ref);-1!==s&&e.splice(s,1)}))}};class hs{constructor(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}const ls=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function us(t){let e="";for(let s=0;s<t;++s)s>0&&(e+="\nelse "),s<t-1&&(e+=`if(test == ${s}.0){}`);return e}function ds(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const s=e.createShader(e.FRAGMENT_SHADER);for(;;){const i=ls.replace(/%forloop%/gi,us(t));if(e.shaderSource(s,i),e.compileShader(s),e.getShaderParameter(s,e.COMPILE_STATUS))break;t=t/2|0}return t}class cs{constructor(){this.data=0,this.blendMode=a.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(1&this.data)}set blend(t){!!(1&this.data)!==t&&(this.data^=1)}get offsets(){return!!(2&this.data)}set offsets(t){!!(2&this.data)!==t&&(this.data^=2)}get culling(){return!!(4&this.data)}set culling(t){!!(4&this.data)!==t&&(this.data^=4)}get depthTest(){return!!(8&this.data)}set depthTest(t){!!(8&this.data)!==t&&(this.data^=8)}get depthMask(){return!!(32&this.data)}set depthMask(t){!!(32&this.data)!==t&&(this.data^=32)}get clockwiseFrontFace(){return!!(16&this.data)}set clockwiseFrontFace(t){!!(16&this.data)!==t&&(this.data^=16)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==a.NONE,this._blendMode=t}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new cs;return t.depthTest=!1,t.blend=!0,t}}const ps=[];function fs(t,e){if(!t)return null;let s="";if("string"==typeof t){const e=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);e&&(s=e[1].toLowerCase())}for(let i=ps.length-1;i>=0;--i){const r=ps[i];if(r.test&&r.test(t,s))return new r(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class ms{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,s,i,r,n,a,o){if(arguments.length>8)throw new Error("max arguments reached");const{name:h,items:l}=this;this._aliasCount++;for(let u=0,d=l.length;u<d;u++)l[u][h](t,e,s,i,r,n,a,o);return l===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return 0===this.items.length}get name(){return this._name}}Object.defineProperties(ms.prototype,{dispatch:{value:ms.prototype.emit},run:{value:ms.prototype.emit}});class _s{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new ms("setRealSize"),this.onUpdate=new ms("update"),this.onError=new ms("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,e,s){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,e){return!1}}class gs extends _s{constructor(t,e){const{width:s,height:i}=e||{};if(!s||!i)throw new Error("BufferResource width or height invalid");super(s,i),this.data=t}upload(t,e,s){const i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===m.UNPACK);const r=e.realWidth,n=e.realHeight;return s.width===r&&s.height===n?i.texSubImage2D(e.target,0,0,0,r,n,e.format,s.type,this.data):(s.width=r,s.height=n,i.texImage2D(e.target,0,s.internalFormat,r,n,0,e.format,s.type,this.data)),!0}dispose(){this.data=null}static test(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array}}const xs={scaleMode:c.NEAREST,format:h.RGBA,alphaMode:m.NPM},vs=class extends W{constructor(t=null,e=null){super(),e=Object.assign({},vs.defaultOptions,e);const{alphaMode:s,mipmap:i,anisotropicLevel:r,scaleMode:n,width:a,height:o,wrapMode:h,format:l,type:u,target:d,resolution:c,resourceOptions:p}=e;t&&!(t instanceof _s)&&((t=fs(t,p)).internal=!0),this.resolution=c||A.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((o||0)*this.resolution)/this.resolution,this._mipmap=i,this.anisotropicLevel=r,this._wrapMode=h,this._scaleMode=n,this.format=l,this.type=u,this.target=d,this.alphaMode=s,this.uid=Ve(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&o>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(t)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let s;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,s=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,s=!0),s&&this.dirtyStyleId++,this}setSize(t,e,s){return s=s||this.resolution,this.setRealSize(t*s,e*s,s)}setRealSize(t,e,s){return this.resolution=s||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=Ge(this.realWidth)&&Ge(this.realHeight)}setResolution(t){const e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT()),this}setResource(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $e[this.cacheId],delete je[this.cacheId],this.cacheId=null),this.dispose(),vs.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(t,e,s=A.STRICT_TEXTURE_CACHE){const i="string"==typeof t;let r=null;if(i)r=t;else{if(!t._pixiId){const s=(null==e?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${s}_${Ve()}`}r=t._pixiId}let n=$e[r];if(i&&s&&!n)throw new Error(`The cacheId "${r}" does not exist in BaseTextureCache.`);return n||(n=new vs(t,e),n.cacheId=r,vs.addToCache(n,r)),n}static fromBuffer(t,e,s,i){t=t||new Float32Array(e*s*4);const r=new gs(t,{width:e,height:s}),n=t instanceof Float32Array?u.FLOAT:u.UNSIGNED_BYTE;return new vs(r,Object.assign({},xs,{type:n},i))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),$e[e]&&$e[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),$e[e]=t)}static removeFromCache(t){if("string"==typeof t){const e=$e[t];if(e){const s=e.textureCacheIds.indexOf(t);return s>-1&&e.textureCacheIds.splice(s,1),delete $e[t],e}}else if(null!=t&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete $e[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};let ys=vs;ys.defaultOptions={mipmap:f.POW2,anisotropicLevel:0,scaleMode:c.LINEAR,wrapMode:p.CLAMP,alphaMode:m.UNPACK,target:l.TEXTURE_2D,format:h.RGBA,type:u.UNSIGNED_BYTE},ys._globalBatch=0;class Ts{constructor(){this.texArray=null,this.blend=0,this.type=o.TRIANGLES,this.start=0,this.size=0,this.data=null}}let bs=0;class Es{constructor(t,e=!0,s=!1){this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=s,this.static=e,this.id=bs++,this.disposeRunner=new ms("disposeBuffer")}update(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(t){this.type=t?b.ELEMENT_ARRAY_BUFFER:b.ARRAY_BUFFER}get index(){return this.type===b.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new Es(t)}}class As{constructor(t,e=0,s=!1,i=u.FLOAT,r,n,a,o=1){this.buffer=t,this.size=e,this.normalized=s,this.type=i,this.stride=r,this.start=n,this.instance=a,this.divisor=o}destroy(){this.buffer=null}static from(t,e,s,i,r){return new As(t,e,s,i,r)}}const Rs={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};const Ss={5126:4,5123:2,5121:1};let ws=0;const Is={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array};class Ms{constructor(t=[],e={}){this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=ws++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new ms("disposeGeometry"),this.refCount=0}addAttribute(t,e,s=0,i=!1,r,n,a,o=!1){if(!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof Es||(e instanceof Array&&(e=new Float32Array(e)),e=new Es(e));const h=t.split("|");if(h.length>1){for(let t=0;t<h.length;t++)this.addAttribute(h[t],e,s,i,r);return this}let l=this.buffers.indexOf(e);return-1===l&&(this.buffers.push(e),l=this.buffers.length-1),this.attributes[t]=new As(l,s,i,r,n,a,o),this.instanced=this.instanced||o,this}getAttribute(t){return this.attributes[t]}getBuffer(t){return this.buffers[this.getAttribute(t).buffer]}addIndex(t){return t instanceof Es||(t instanceof Array&&(t=new Uint16Array(t)),t=new Es(t)),t.type=b.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,this.buffers.includes(t)||this.buffers.push(t),this}getIndex(){return this.indexBuffer}interleave(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;const t=[],e=[],s=new Es;let i;for(i in this.attributes){const s=this.attributes[i],r=this.buffers[s.buffer];t.push(r.data),e.push(s.size*Ss[s.type]/4),s.buffer=0}for(s.data=function(t,e){let s=0,i=0;const r={};for(let r=0;r<t.length;r++)i+=e[r],s+=t[r].length;const n=new ArrayBuffer(4*s);let a=null,o=0;for(let s=0;s<t.length;s++){const h=e[s],l=t[s],u=Be(l);r[u]||(r[u]=new Rs[u](n)),a=r[u];for(let t=0;t<l.length;t++)a[(t/h|0)*i+o+t%h]=l[t];o+=h}return new Float32Array(n)}(t,e),i=0;i<this.buffers.length;i++)this.buffers[i]!==this.indexBuffer&&this.buffers[i].destroy();return this.buffers=[s],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const t in this.attributes){const e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const t=new Ms;for(let e=0;e<this.buffers.length;e++)t.buffers[e]=new Es(this.buffers[e].data.slice(0));for(const e in this.attributes){const s=this.attributes[e];t.attributes[e]=new As(s.buffer,s.size,s.normalized,s.type,s.stride,s.start,s.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=b.ELEMENT_ARRAY_BUFFER),t}static merge(t){const e=new Ms,s=[],i=[],r=[];let n;for(let e=0;e<t.length;e++){n=t[e];for(let t=0;t<n.buffers.length;t++)i[t]=i[t]||0,i[t]+=n.buffers[t].data.length,r[t]=0}for(let t=0;t<n.buffers.length;t++)s[t]=new(Is[Be(n.buffers[t].data)])(i[t]),e.buffers[t]=new Es(s[t]);for(let e=0;e<t.length;e++){n=t[e];for(let t=0;t<n.buffers.length;t++)s[t].set(n.buffers[t].data,r[t]),r[t]+=n.buffers[t].data.length}if(e.attributes=n.attributes,n.indexBuffer){e.indexBuffer=e.buffers[n.buffers.indexOf(n.indexBuffer)],e.indexBuffer.type=b.ELEMENT_ARRAY_BUFFER;let s=0,i=0,r=0,a=0;for(let t=0;t<n.buffers.length;t++)if(n.buffers[t]!==n.indexBuffer){a=t;break}for(const t in n.attributes){const e=n.attributes[t];(0|e.buffer)===a&&(i+=e.size*Ss[e.type]/4)}for(let n=0;n<t.length;n++){const o=t[n].indexBuffer.data;for(let t=0;t<o.length;t++)e.indexBuffer.data[t+r]+=s;s+=t[n].buffers[a].data.length/i,r+=o.length}}return e}}class Cs extends Ms{constructor(t=!1){super(),this._buffer=new Es(null,t,!1),this._indexBuffer=new Es(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,u.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,u.FLOAT).addAttribute("aColor",this._buffer,4,!0,u.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,u.FLOAT).addIndex(this._indexBuffer)}}const Ds=2*Math.PI,Ps=180/Math.PI,Os=Math.PI/180;var Fs=(t=>(t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC",t))(Fs||{});class Bs{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new Bs(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}toString(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`}}const Ns=[new Bs,new Bs,new Bs,new Bs];class Ls{constructor(t=0,e=0,s=0,i=0){this.x=Number(t),this.y=Number(e),this.width=Number(s),this.height=Number(i),this.type=Fs.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new Ls(0,0,0,0)}clone(){return new Ls(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)}intersects(t,e){if(!e){const e=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=e)return!1;const s=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>s}const s=this.left,i=this.right,r=this.top,n=this.bottom;if(i<=s||n<=r)return!1;const a=Ns[0].set(t.left,t.top),o=Ns[1].set(t.left,t.bottom),h=Ns[2].set(t.right,t.top),l=Ns[3].set(t.right,t.bottom);if(h.x<=a.x||o.y<=a.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(0===u||(e.apply(a,a),e.apply(o,o),e.apply(h,h),e.apply(l,l),Math.max(a.x,o.x,h.x,l.x)<=s||Math.min(a.x,o.x,h.x,l.x)>=i||Math.max(a.y,o.y,h.y,l.y)<=r||Math.min(a.y,o.y,h.y,l.y)>=n))return!1;const d=u*(o.y-a.y),c=u*(a.x-o.x),p=d*s+c*r,f=d*i+c*r,m=d*s+c*n,_=d*i+c*n;if(Math.max(p,f,m,_)<=d*a.x+c*a.y||Math.min(p,f,m,_)>=d*l.x+c*l.y)return!1;const g=u*(a.y-h.y),x=u*(h.x-a.x),v=g*s+x*r,y=g*i+x*r,T=g*s+x*n,b=g*i+x*n;return!(Math.max(v,y,T,b)<=g*a.x+x*a.y||Math.min(v,y,T,b)>=g*l.x+x*l.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}fit(t){const e=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),r=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(s-e,0),this.y=i,this.height=Math.max(r-i,0),this}ceil(t=1,e=.001){const s=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=s-this.x,this.height=i-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),r=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=s-e,this.y=i,this.height=r-i,this}toString(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class Gs{constructor(t=0,e=0,s=0){this.x=t,this.y=e,this.radius=s,this.type=Fs.CIRC}clone(){return new Gs(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const s=this.radius*this.radius;let i=this.x-t,r=this.y-e;return i*=i,r*=r,i+r<=s}getBounds(){return new Ls(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}toString(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Us{constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i,this.type=Fs.ELIP}clone(){return new Us(this.x,this.y,this.width,this.height)}contains(t,e){if(this.width<=0||this.height<=0)return!1;let s=(t-this.x)/this.width,i=(e-this.y)/this.height;return s*=s,i*=i,s+i<=1}getBounds(){return new Ls(this.x-this.width,this.y-this.height,this.width,this.height)}toString(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class ks{constructor(...t){let e=Array.isArray(t[0])?t[0]:t;if("number"!=typeof e[0]){const t=[];for(let s=0,i=e.length;s<i;s++)t.push(e[s].x,e[s].y);e=t}this.points=e,this.type=Fs.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),e=new ks(t);return e.closeStroke=this.closeStroke,e}contains(t,e){let s=!1;const i=this.points.length/2;for(let r=0,n=i-1;r<i;n=r++){const i=this.points[2*r],a=this.points[2*r+1],o=this.points[2*n],h=this.points[2*n+1];a>e!=h>e&&t<(e-a)/(h-a)*(o-i)+i&&(s=!s)}return s}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce(((t,e)=>`${t}, ${e}`),"")}]`}}class Xs{constructor(t=0,e=0,s=0,i=0,r=20){this.x=t,this.y=e,this.width=s,this.height=i,this.radius=r,this.type=Fs.RREC}clone(){return new Xs(this.x,this.y,this.width,this.height,this.radius)}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+s&&e<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let i=t-(this.x+s),r=e-(this.y+s);const n=s*s;if(i*i+r*r<=n||(i=t-(this.x+this.width-s),i*i+r*r<=n)||(r=e-(this.y+this.height-s),i*i+r*r<=n)||(i=t-(this.x+s),i*i+r*r<=n))return!0}return!1}toString(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}class Hs{constructor(t=1,e=0,s=0,i=1,r=0,n=0){this.array=null,this.a=t,this.b=e,this.c=s,this.d=i,this.tx=r,this.ty=n}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,s,i,r,n){return this.a=t,this.b=e,this.c=s,this.d=i,this.tx=r,this.ty=n,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const s=e||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,e){e=e||new Bs;const s=t.x,i=t.y;return e.x=this.a*s+this.c*i+this.tx,e.y=this.b*s+this.d*i+this.ty,e}applyInverse(t,e){e=e||new Bs;const s=1/(this.a*this.d+this.c*-this.b),i=t.x,r=t.y;return e.x=this.d*s*i+-this.c*s*r+(this.ty*this.c-this.tx*this.d)*s,e.y=this.a*s*r+-this.b*s*i+(-this.ty*this.a+this.tx*this.b)*s,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),s=Math.sin(t),i=this.a,r=this.c,n=this.tx;return this.a=i*e-this.b*s,this.b=i*s+this.b*e,this.c=r*e-this.d*s,this.d=r*s+this.d*e,this.tx=n*e-this.ty*s,this.ty=n*s+this.ty*e,this}append(t){const e=this.a,s=this.b,i=this.c,r=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*s+t.b*r,this.c=t.c*e+t.d*i,this.d=t.c*s+t.d*r,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*s+t.ty*r+this.ty,this}setTransform(t,e,s,i,r,n,a,o,h){return this.a=Math.cos(a+h)*r,this.b=Math.sin(a+h)*r,this.c=-Math.sin(a-o)*n,this.d=Math.cos(a-o)*n,this.tx=t-(s*this.a+i*this.c),this.ty=e-(s*this.b+i*this.d),this}prepend(t){const e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){const e=this.a,s=this.c;this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,s=this.b,i=this.c,r=this.d,n=t.pivot,a=-Math.atan2(-i,r),o=Math.atan2(s,e),h=Math.abs(a+o);return h<1e-5||Math.abs(Ds-h)<1e-5?(t.rotation=o,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=o),t.scale.x=Math.sqrt(e*e+s*s),t.scale.y=Math.sqrt(i*i+r*r),t.position.x=this.tx+(n.x*e+n.y*i),t.position.y=this.ty+(n.x*s+n.y*r),t}invert(){const t=this.a,e=this.b,s=this.c,i=this.d,r=this.tx,n=t*i-e*s;return this.a=i/n,this.b=-e/n,this.c=-s/n,this.d=t/n,this.tx=(s*this.ty-i*r)/n,this.ty=-(t*this.ty-e*r)/n,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new Hs;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}toString(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return new Hs}static get TEMP_MATRIX(){return new Hs}}const Vs=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],zs=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Ws=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Ys=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],js=[],$s=[],qs=Math.sign;!function(){for(let t=0;t<16;t++){const e=[];js.push(e);for(let s=0;s<16;s++){const i=qs(Vs[t]*Vs[s]+Ws[t]*zs[s]),r=qs(zs[t]*Vs[s]+Ys[t]*zs[s]),n=qs(Vs[t]*Ws[s]+Ws[t]*Ys[s]),a=qs(zs[t]*Ws[s]+Ys[t]*Ys[s]);for(let t=0;t<16;t++)if(Vs[t]===i&&zs[t]===r&&Ws[t]===n&&Ys[t]===a){e.push(t);break}}}for(let t=0;t<16;t++){const e=new Hs;e.set(Vs[t],zs[t],Ws[t],Ys[t],0,0),$s.push(e)}}();const Ks={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>Vs[t],uY:t=>zs[t],vX:t=>Ws[t],vY:t=>Ys[t],inv:t=>8&t?15&t:7&-t,add:(t,e)=>js[t][e],sub:(t,e)=>js[t][Ks.inv(e)],rotate180:t=>4^t,isVertical:t=>2==(3&t),byDirection:(t,e)=>2*Math.abs(t)<=Math.abs(e)?e>=0?Ks.S:Ks.N:2*Math.abs(e)<=Math.abs(t)?t>0?Ks.E:Ks.W:e>0?t>0?Ks.SE:Ks.SW:t>0?Ks.NE:Ks.NW,matrixAppendRotationInv:(t,e,s=0,i=0)=>{const r=$s[Ks.inv(e)];r.tx=s,r.ty=i,t.append(r)}};class Zs{constructor(t,e,s=0,i=0){this._x=s,this._y=i,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new Zs(t,e,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=${this.scope}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}const Qs=class{constructor(){this.worldTransform=new Hs,this.localTransform=new Hs,this.position=new Zs(this.onChange,this,0,0),this.scale=new Zs(this.onChange,this,1,1),this.pivot=new Zs(this.onChange,this,0,0),this.skew=new Zs(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}toString(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}updateLocalTransform(){const t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(t){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){const s=t.worldTransform,i=this.worldTransform;i.a=e.a*s.a+e.b*s.c,i.b=e.a*s.b+e.b*s.d,i.c=e.c*s.a+e.d*s.c,i.d=e.c*s.b+e.d*s.d,i.tx=e.tx*s.a+e.ty*s.c+s.tx,i.ty=e.tx*s.b+e.ty*s.d+s.ty,this._parentID=t._worldID,this._worldID++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};let Js=Qs;Js.IDENTITY=new Qs;function ti(t,e,s){const i=t.createShader(e);return t.shaderSource(i,s),t.compileShader(i),i}function ei(t){const e=new Array(t);for(let t=0;t<e.length;t++)e[t]=!1;return e}function si(t,e){switch(t){case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return ei(2*e);case"bvec3":return ei(3*e);case"bvec4":return ei(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const ii=[{test:t=>"float"===t.type&&1===t.size&&!t.isArray,code:t=>`\n            if(uv["${t}"] !== ud["${t}"].value)\n            {\n                ud["${t}"].value = uv["${t}"]\n                gl.uniform1f(ud["${t}"].location, uv["${t}"])\n            }\n            `},{test:(t,e)=>!("sampler2D"!==t.type&&"samplerCube"!==t.type&&"sampler2DArray"!==t.type||1!==t.size||t.isArray||null!=e&&void 0===e.castToBaseTexture),code:t=>`t = syncData.textureCount++;\n\n            renderer.texture.bind(uv["${t}"], t);\n\n            if(ud["${t}"].value !== t)\n            {\n                ud["${t}"].value = t;\n                gl.uniform1i(ud["${t}"].location, t);\n; // eslint-disable-line max-len\n            }`},{test:(t,e)=>"mat3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.a,code:t=>`\n            gl.uniformMatrix3fv(ud["${t}"].location, false, uv["${t}"].toArray(true));\n            `,codeUbo:t=>`\n                var ${t}_matrix = uv.${t}.toArray(true);\n\n                data[offset] = ${t}_matrix[0];\n                data[offset+1] = ${t}_matrix[1];\n                data[offset+2] = ${t}_matrix[2];\n        \n                data[offset + 4] = ${t}_matrix[3];\n                data[offset + 5] = ${t}_matrix[4];\n                data[offset + 6] = ${t}_matrix[5];\n        \n                data[offset + 8] = ${t}_matrix[6];\n                data[offset + 9] = ${t}_matrix[7];\n                data[offset + 10] = ${t}_matrix[8];\n            `},{test:(t,e)=>"vec2"===t.type&&1===t.size&&!t.isArray&&void 0!==e.x,code:t=>`\n                cv = ud["${t}"].value;\n                v = uv["${t}"];\n\n                if(cv[0] !== v.x || cv[1] !== v.y)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    gl.uniform2f(ud["${t}"].location, v.x, v.y);\n                }`,codeUbo:t=>`\n                v = uv.${t};\n\n                data[offset] = v.x;\n                data[offset+1] = v.y;\n            `},{test:t=>"vec2"===t.type&&1===t.size&&!t.isArray,code:t=>`\n                cv = ud["${t}"].value;\n                v = uv["${t}"];\n\n                if(cv[0] !== v[0] || cv[1] !== v[1])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    gl.uniform2f(ud["${t}"].location, v[0], v[1]);\n                }\n            `},{test:(t,e)=>"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.width,code:t=>`\n                cv = ud["${t}"].value;\n                v = uv["${t}"];\n\n                if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    cv[2] = v.width;\n                    cv[3] = v.height;\n                    gl.uniform4f(ud["${t}"].location, v.x, v.y, v.width, v.height)\n                }`,codeUbo:t=>`\n                    v = uv.${t};\n\n                    data[offset] = v.x;\n                    data[offset+1] = v.y;\n                    data[offset+2] = v.width;\n                    data[offset+3] = v.height;\n                `},{test:(t,e)=>"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red,code:t=>`\n                cv = ud["${t}"].value;\n                v = uv["${t}"];\n\n                if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)\n                {\n                    cv[0] = v.red;\n                    cv[1] = v.green;\n                    cv[2] = v.blue;\n                    cv[3] = v.alpha;\n                    gl.uniform4f(ud["${t}"].location, v.red, v.green, v.blue, v.alpha)\n                }`,codeUbo:t=>`\n                    v = uv.${t};\n\n                    data[offset] = v.red;\n                    data[offset+1] = v.green;\n                    data[offset+2] = v.blue;\n                    data[offset+3] = v.alpha;\n                `},{test:(t,e)=>"vec3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red,code:t=>`\n                cv = ud["${t}"].value;\n                v = uv["${t}"];\n\n                if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)\n                {\n                    cv[0] = v.red;\n                    cv[1] = v.green;\n                    cv[2] = v.blue;\n    \n                    gl.uniform3f(ud["${t}"].location, v.red, v.green, v.blue)\n                }`,codeUbo:t=>`\n                    v = uv.${t};\n\n                    data[offset] = v.red;\n                    data[offset+1] = v.green;\n                    data[offset+2] = v.blue;\n                `},{test:t=>"vec4"===t.type&&1===t.size&&!t.isArray,code:t=>`\n                cv = ud["${t}"].value;\n                v = uv["${t}"];\n\n                if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    cv[2] = v[2];\n                    cv[3] = v[3];\n\n                    gl.uniform4f(ud["${t}"].location, v[0], v[1], v[2], v[3])\n                }`}],ri={float:"\n    if (cv !== v)\n    {\n        cu.value = v;\n        gl.uniform1f(location, v);\n    }",vec2:"\n    if (cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2f(location, v[0], v[1])\n    }",vec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3f(location, v[0], v[1], v[2])\n    }",vec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n    }",int:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }",ivec2:"\n    if (cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2i(location, v[0], v[1]);\n    }",ivec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3i(location, v[0], v[1], v[2]);\n    }",ivec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n    }",uint:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1ui(location, v);\n    }",uvec2:"\n    if (cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2ui(location, v[0], v[1]);\n    }",uvec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3ui(location, v[0], v[1], v[2]);\n    }",uvec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n    }",bool:"\n    if (cv !== v)\n    {\n        cu.value = v;\n        gl.uniform1i(location, v);\n    }",bvec2:"\n    if (cv[0] != v[0] || cv[1] != v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2i(location, v[0], v[1]);\n    }",bvec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3i(location, v[0], v[1], v[2]);\n    }",bvec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n    }",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }",samplerCube:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }",sampler2DArray:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }"},ni={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};const ai={};let oi,hi=ai;function li(){if(hi===ai||(null==hi?void 0:hi.isContextLost())){const t=A.ADAPTER.createCanvas();let e;A.PREFER_ENV>=i.WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),hi=e}return hi}function ui(t,e){const s=t.getShaderSource(e).split("\n").map(((t,e)=>`${e}: ${t}`)),i=t.getShaderInfoLog(e),r=i.split("\n"),n={},a=r.map((t=>parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1")))).filter((t=>!(!t||n[t])&&(n[t]=!0,!0))),o=[""];a.forEach((t=>{s[t-1]=`%c${s[t-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")}));const h=s.join("\n");o[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}const di={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ci(t){return di[t]}let pi=null;const fi={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function mi(t,e){if(!pi){const e=Object.keys(fi);pi={};for(let s=0;s<e.length;++s){const i=e[s];pi[t[i]]=fi[i]}}return pi[e]}function _i(t,e,s){if("precision"!==t.substring(0,9)){let i=e;return e===x.HIGH&&s!==x.HIGH&&(i=x.MEDIUM),`precision ${i} float;\n${t}`}return s!==x.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}let gi;function xi(){if("boolean"==typeof gi)return gi;try{gi=!0===new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")}catch(t){gi=!1}return gi}let vi=0;const yi={},Ti=class{constructor(t,e,s="pixi-shader",i={}){this.extra={},this.id=vi++,this.vertexSrc=t||Ti.defaultVertexSrc,this.fragmentSrc=e||Ti.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=i,"#version"!==this.vertexSrc.substring(0,8)&&(s=s.replace(/\s+/g,"-"),yi[s]?(yi[s]++,s+=`-${yi[s]}`):yi[s]=1,this.vertexSrc=`#define SHADER_NAME ${s}\n${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${s}\n${this.fragmentSrc}`,this.vertexSrc=_i(this.vertexSrc,Ti.defaultVertexPrecision,x.HIGH),this.fragmentSrc=_i(this.fragmentSrc,Ti.defaultFragmentPrecision,function(){if(!oi){oi=x.MEDIUM;const t=li();t&&t.getShaderPrecisionFormat&&(oi=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?x.HIGH:x.MEDIUM)}return oi}())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n   vTextureCoord = aTextureCoord;\n}\n"}static get defaultFragmentSrc(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"}static from(t,e,s){const i=t+e;let r=Ye[i];return r||(Ye[i]=r=new Ti(t,e,s)),r}};let bi=Ti;bi.defaultVertexPrecision=x.HIGH,bi.defaultFragmentPrecision=H.apple.device?x.HIGH:x.MEDIUM;let Ei=0;class Ai{constructor(t,e,s){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Ei++,this.static=!!e,this.ubo=!!s,t instanceof Es?(this.buffer=t,this.buffer.type=b.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new Es(new Float32Array(1)),this.buffer.type=b.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(t,e,s){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[t]=new Ai(e,s)}static from(t,e,s){return new Ai(t,e,s)}static uboFrom(t,e){return new Ai(t,null==e||e,!0)}}class Ri{constructor(t,e){this.uniformBindCount=0,this.program=t,this.uniformGroup=e?e instanceof Ai?e:new Ai(e):new Ai({}),this.disposeRunner=new ms("disposeShader")}checkUniformExists(t,e){if(e.uniforms[t])return!0;for(const s in e.uniforms){const i=e.uniforms[s];if(i.group&&this.checkUniformExists(t,i))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(t,e,s){const i=bi.from(t,e);return new Ri(i,s)}}class Si{constructor(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},!e.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!e.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(t){if(!this.programCache[t]){const e=new Int32Array(t);for(let s=0;s<t;s++)e[s]=s;this.defaultGroupCache[t]=Ai.from({uSamplers:e},!0);let s=this.fragTemplate;s=s.replace(/%count%/gi,`${t}`),s=s.replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new bi(this.vertexSrc,s)}const e={tint:new Float32Array([1,1,1,1]),translationMatrix:new Hs,default:this.defaultGroupCache[t]};return new Ri(this.programCache[t],e)}generateSampleSrc(t){let e="";e+="\n",e+="\n";for(let s=0;s<t;s++)s>0&&(e+="\nelse "),s<t-1&&(e+=`if(vTextureId < ${s}.5)`),e+="\n{",e+=`\n\tcolor = texture2D(uSamplers[${s}], vTextureCoord);`,e+="\n}";return e+="\n",e+="\n",e}}class wi{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let t=0;t<this.count;t++)this.elements[t]=null;this.count=0}}class Ii{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}const Mi=class extends Ii{constructor(t){super(t),this.setShaderGenerator(),this.geometryClass=Cs,this.vertexSize=6,this.state=cs.for2d(),this.size=4*Mi.defaultBatchSize,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),t.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){var t;return this._defaultMaxTextures=null!=(t=this._defaultMaxTextures)?t:function(t){let e=!0;const s=A.ADAPTER.getNavigator();if(H.tablet||H.phone){if(H.apple.device){const t=s.userAgent.match(/OS (\d+)_(\d+)?/);t&&parseInt(t[1],10)<11&&(e=!1)}if(H.android.device){const t=s.userAgent.match(/Android\s([0-9.]*)/);t&&parseInt(t[1],10)<7&&(e=!1)}}return e?t:4}(32),this._defaultMaxTextures}static set defaultMaxTextures(t){this._defaultMaxTextures=t}static get canUploadSameBuffer(){var t;return this._canUploadSameBuffer=null!=(t=this._canUploadSameBuffer)?t:!H.apple.device,this._canUploadSameBuffer}static set canUploadSameBuffer(t){this._canUploadSameBuffer=t}get MAX_TEXTURES(){return Kt("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return"precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vTextureId = aTextureId;\n    vColor = aColor * tint;\n}\n"}static get defaultFragmentTemplate(){return"varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n    vec4 color;\n    %forloop%\n    gl_FragColor = color * vColor;\n}\n"}setShaderGenerator({vertex:t=Mi.defaultVertexSrc,fragment:e=Mi.defaultFragmentTemplate}={}){this.shaderGenerator=new Si(t,e)}contextChange(){const t=this.renderer.gl;A.PREFER_ENV===i.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),Mi.defaultMaxTextures),this.maxTextures=ds(this.maxTextures,t)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:t,_textureArrayPool:e}=Mi,s=this.size/4,i=Math.floor(s/this.maxTextures)+1;for(;t.length<s;)t.push(new Ts);for(;e.length<i;)e.push(new wi);for(let t=0;t<this.maxTextures;t++)this._tempBoundTextures[t]=null}onPrerender(){this._flushId=0}render(t){!t._texture.valid||(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)}buildTexturesAndDrawCalls(){const{_bufferedTextures:t,maxTextures:e}=this,s=Mi._textureArrayPool,i=this.renderer.batch,r=this._tempBoundTextures,n=this.renderer.textureGC.count;let a=++ys._globalBatch,o=0,h=s[0],l=0;i.copyBoundTextures(r,e);for(let u=0;u<this._bufferSize;++u){const d=t[u];t[u]=null,d._batchEnabled!==a&&(h.count>=e&&(i.boundArray(h,r,a,e),this.buildDrawCalls(h,l,u),l=u,h=s[++o],++a),d._batchEnabled=a,d.touched=n,h.elements[h.count++]=d)}h.count>0&&(i.boundArray(h,r,a,e),this.buildDrawCalls(h,l,this._bufferSize),++o,++a);for(let t=0;t<r.length;t++)r[t]=null;ys._globalBatch=a}buildDrawCalls(t,e,s){const{_bufferedElements:i,_attributeBuffer:r,_indexBuffer:n,vertexSize:a}=this,o=Mi._drawCallPool;let h=this._dcIndex,l=this._aIndex,u=this._iIndex,d=o[h];d.start=this._iIndex,d.texArray=t;for(let c=e;c<s;++c){const s=i[c],p=s._texture.baseTexture,f=De[p.alphaMode?1:0][s.blendMode];i[c]=null,e<c&&d.blend!==f&&(d.size=u-d.start,e=c,d=o[++h],d.texArray=t,d.start=u),this.packInterleavedGeometry(s,r,n,l,u),l+=s.vertexData.length/2*a,u+=s.indices.length,d.blend=f}e<s&&(d.size=u-d.start,++h),this._dcIndex=h,this._aIndex=l,this._iIndex=u}bindAndClearTexArray(t){const e=this.renderer.texture;for(let s=0;s<t.count;s++)e.bind(t.elements[s],t.ids[s]),t.elements[s]=null;t.count=0}updateGeometry(){const{_packedGeometries:t,_attributeBuffer:e,_indexBuffer:s}=this;Mi.canUploadSameBuffer?(t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(s),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,t[this._flushId]=new this.geometryClass),t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(s),this.renderer.geometry.bind(t[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const t=this._dcIndex,{gl:e,state:s}=this.renderer,i=Mi._drawCallPool;let r=null;for(let n=0;n<t;n++){const{texArray:t,type:a,size:o,start:h,blend:l}=i[n];r!==t&&(r=t,this.bindAndClearTexArray(t)),this.state.blendMode=l,s.set(this.state),e.drawElements(a,o,e.UNSIGNED_SHORT,2*h)}}flush(){0!==this._vertexCount&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),Mi.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(t){const e=Le(Math.ceil(t/8)),s=Ue(e),i=8*e;this._aBuffers.length<=s&&(this._iBuffers.length=s+1);let r=this._aBuffers[i];return r||(this._aBuffers[i]=r=new hs(i*this.vertexSize*4)),r}getIndexBuffer(t){const e=Le(Math.ceil(t/12)),s=Ue(e),i=12*e;this._iBuffers.length<=s&&(this._iBuffers.length=s+1);let r=this._iBuffers[s];return r||(this._iBuffers[s]=r=new Uint16Array(i)),r}packInterleavedGeometry(t,e,s,i,r){const{uint32View:n,float32View:a}=e,o=i/this.vertexSize,h=t.uvs,l=t.indices,u=t.vertexData,d=t._texture.baseTexture._batchLocation,c=Math.min(t.worldAlpha,1),p=Ie.shared.setValue(t._tintRGB).toPremultiplied(c,t._texture.baseTexture.alphaMode>0);for(let t=0;t<u.length;t+=2)a[i++]=u[t],a[i++]=u[t+1],a[i++]=h[t],a[i++]=h[t+1],n[i++]=p,a[i++]=d;for(let t=0;t<l.length;t++)s[r++]=o+l[t]}};let Ci=Mi;Ci.defaultBatchSize=4096,Ci.extension={name:"batch",type:rs.RendererPlugin},Ci._drawCallPool=[],Ci._textureArrayPool=[],os.add(Ci);const Di=class extends Ri{constructor(t,e,s){super(bi.from(t||Di.defaultVertexSrc,e||Di.defaultFragmentSrc),s),this.padding=0,this.resolution=Di.defaultResolution,this.multisample=Di.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new cs}apply(t,e,s,i,r){t.applyFilter(this,e,s,i)}get blendMode(){return this.state.blendMode}set blendMode(t){this.state.blendMode=t}get resolution(){return this._resolution}set resolution(t){this._resolution=t}static get defaultVertexSrc(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n    gl_Position = filterVertexPosition();\n    vTextureCoord = filterTextureCoord();\n}\n"}static get defaultFragmentSrc(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"}};let Pi=Di;Pi.defaultResolution=1,Pi.defaultMultisample=T.NONE;class Oi{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Ie(0),this.alpha=1}init(t){this.clearBeforeRender=t.clearBeforeRender;const{backgroundColor:e,background:s,backgroundAlpha:i}=t,r=null!=s?s:e;void 0!==r&&(this.color=r),this.alpha=i}get color(){return this._backgroundColor.value}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get backgroundColor(){return this._backgroundColor}destroy(){}}Oi.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},Oi.extension={type:[rs.RendererSystem,rs.CanvasRendererSystem],name:"background"},os.add(Oi);class Fi{constructor(t){this.renderer=t,this.emptyRenderer=new Ii(t),this.currentRenderer=this.emptyRenderer}setObjectRenderer(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(t,e){const{boundTextures:s}=this.renderer.texture;for(let i=e-1;i>=0;--i)t[i]=s[i]||null,t[i]&&(t[i]._batchLocation=i)}boundArray(t,e,s,i){const{elements:r,ids:n,count:a}=t;let o=0;for(let t=0;t<a;t++){const a=r[t],h=a._batchLocation;if(h>=0&&h<i&&e[h]===a)n[t]=h;else for(;o<i;){const i=e[o];if(!i||i._batchEnabled!==s||i._batchLocation!==o){n[t]=o,a._batchLocation=o,e[o]=a;break}o++}}}destroy(){this.renderer=null}}Fi.extension={type:rs.RendererSystem,name:"batch"},os.add(Fi);let Bi=0;class Ni{constructor(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=Bi++}init(t){if(t.context)this.initFromContext(t.context);else{const e=this.renderer.background.alpha<1,s=t.premultipliedAlpha;this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.useContextAlpha=t.useContextAlpha,this.powerPreference=t.powerPreference,this.initFromOptions({alpha:e,premultipliedAlpha:s,antialias:t.antialias,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference})}}initFromContext(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=Bi++,this.renderer.runners.contextChange.emit(t);const e=this.renderer.view;void 0!==e.addEventListener&&(e.addEventListener("webglcontextlost",this.handleContextLost,!1),e.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(t){const e=this.createContext(this.renderer.view,t);this.initFromContext(e)}createContext(t,e){let s;if(A.PREFER_ENV>=i.WEBGL2&&(s=t.getContext("webgl2",e)),s)this.webGLVersion=2;else if(this.webGLVersion=1,s=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!s)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=s,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout((()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()}),0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,void 0!==t.removeEventListener&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const e=t.getContextAttributes(),s="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;s&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const i=s||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}Ni.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},Ni.extension={type:rs.RendererSystem,name:"context"},os.add(Ni);class Li extends gs{upload(t,e,s){const i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===m.UNPACK);const r=e.realWidth,n=e.realHeight;return s.width===r&&s.height===n?i.texSubImage2D(e.target,0,0,0,r,n,e.format,s.type,this.data):(s.width=r,s.height=n,i.texImage2D(e.target,0,s.internalFormat,r,n,0,e.format,s.type,this.data)),!0}}class Gi{constructor(t,e){this.width=Math.round(t||100),this.height=Math.round(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new ms("disposeFramebuffer"),this.multisample=T.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new ys(null,{scaleMode:c.NEAREST,resolution:1,mipmap:f.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new ys(new Li(null,{width:this.width,height:this.height}),{scaleMode:c.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:f.OFF,format:h.DEPTH_COMPONENT,type:u.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,e){if(t=Math.round(t),e=Math.round(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(let s=0;s<this.colorTextures.length;s++){const i=this.colorTextures[s],r=i.resolution;i.setSize(t/r,e/r)}if(this.depthTexture){const s=this.depthTexture.resolution;this.depthTexture.setSize(t/s,e/s)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class Ui extends ys{constructor(t={}){if("number"==typeof t){t={width:arguments[0],height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}}t.width=t.width||100,t.height=t.height||100,null!=t.multisample||(t.multisample=T.NONE),super(null,t),this.mipmap=f.OFF,this.valid=!0,this._clear=new Ie([0,0,0,0]),this.framebuffer=new Gi(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=t.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(t){this._clear.setValue(t)}get clearColor(){return this._clear.value}get clear(){return this._clear}resize(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class ki extends _s{constructor(t){const e=t;super(e.naturalWidth||e.videoWidth||e.width,e.naturalHeight||e.videoHeight||e.height),this.source=t,this.noSubImage=!1}static crossOrigin(t,e,s){void 0!==s||e.startsWith("data:")?!1!==s&&(t.crossOrigin="string"==typeof s?s:"anonymous"):t.crossOrigin=es(e)}upload(t,e,s,i){const r=t.gl,n=e.realWidth,a=e.realHeight;if(i=i||this.source,"undefined"!=typeof HTMLImageElement&&i instanceof HTMLImageElement){if(!i.complete||0===i.naturalWidth)return!1}else if("undefined"!=typeof HTMLVideoElement&&i instanceof HTMLVideoElement&&i.readyState<=1&&0===i.buffered.length)return!1;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===m.UNPACK),this.noSubImage||e.target!==r.TEXTURE_2D||s.width!==n||s.height!==a?(s.width=n,s.height=a,r.texImage2D(e.target,0,s.internalFormat,e.format,s.type,i)):r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.format,s.type,i),!0}update(){if(this.destroyed)return;const t=this.source,e=t.naturalWidth||t.videoWidth||t.width,s=t.naturalHeight||t.videoHeight||t.height;this.resize(e,s),super.update()}dispose(){this.source=null}}class Xi extends ki{constructor(t,e){var s;if(e=e||{},"string"==typeof t){const s=new Image;ki.crossOrigin(s,t,e.crossorigin),s.src=t,t=s}super(t),!t.complete&&!!this._width&&!!this._height&&(this._width=0,this._height=0),this.url=t.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(null!=(s=e.createBitmap)?s:A.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode="number"==typeof e.alphaMode?e.alphaMode:null,this.bitmap=null,this._load=null,!1!==e.autoLoad&&this.load()}load(t){return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise(((t,e)=>{const s=this.source;this.url=s.src;const i=()=>{this.destroyed||(s.onload=null,s.onerror=null,this.resize(s.width,s.height),this._load=null,this.createBitmap?t(this.process()):t(this))};s.complete&&s.src?i():(s.onload=i,s.onerror=t=>{e(t),this.onError.emit(t)})}))),this._load}process(){const t=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!globalThis.createImageBitmap)return Promise.resolve(this);const e=globalThis.createImageBitmap,s=!t.crossOrigin||"anonymous"===t.crossOrigin;return this._process=fetch(t.src,{mode:s?"cors":"no-cors"}).then((t=>t.blob())).then((s=>e(s,0,0,t.width,t.height,{premultiplyAlpha:null===this.alphaMode||this.alphaMode===m.UNPACK?"premultiply":"none"}))).then((t=>this.destroyed?Promise.reject():(this.bitmap=t,this.update(),this._process=null,Promise.resolve(this)))),this._process}upload(t,e,s){if("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,s);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,s,this.bitmap),!this.preserveBitmap){let t=!0;const i=e._glTextures;for(const r in i){const n=i[r];if(n!==s&&n.dirtyId!==e.dirtyId){t=!1;break}}t&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return"undefined"!=typeof HTMLImageElement&&("string"==typeof t||t instanceof HTMLImageElement)}}class Hi{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,e,s){const i=e.width,r=e.height;if(s){const e=t.width/2/i,n=t.height/2/r,a=t.x/i+e,o=t.y/r+n;s=Ks.add(s,Ks.NW),this.x0=a+e*Ks.uX(s),this.y0=o+n*Ks.uY(s),s=Ks.add(s,2),this.x1=a+e*Ks.uX(s),this.y1=o+n*Ks.uY(s),s=Ks.add(s,2),this.x2=a+e*Ks.uX(s),this.y2=o+n*Ks.uY(s),s=Ks.add(s,2),this.x3=a+e*Ks.uX(s),this.y3=o+n*Ks.uY(s)}else this.x0=t.x/i,this.y0=t.y/r,this.x1=(t.x+t.width)/i,this.y1=t.y/r,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/r,this.x3=t.x/i,this.y3=(t.y+t.height)/r;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}toString(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}}const Vi=new Hi;function zi(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class Wi extends W{constructor(t,e,s,i,r,n,a){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new Ls(0,0,1,1)),t instanceof Wi&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=i,this.valid=!1,this._uvs=Vi,this.uvMatrix=null,this.orig=s||e,this._rotate=Number(r||0),!0===r)this._rotate=2;else if(this._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=n?new Bs(n.x,n.y):new Bs(0,0),this.defaultBorders=a,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=e:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:t}=this.baseTexture;(null==t?void 0:t.url)&&je[t.url]&&Wi.removeFromCache(t.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,Wi.removeFromCache(this),this.textureCacheIds=null}clone(){var t;const e=this._frame.clone(),s=this._frame===this.orig?e:this.orig.clone(),i=new Wi(this.baseTexture,!this.noFrame&&e,s,null==(t=this.trim)?void 0:t.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=e),i}updateUvs(){this._uvs===Vi&&(this._uvs=new Hi),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},s=A.STRICT_TEXTURE_CACHE){const i="string"==typeof t;let r=null;if(i)r=t;else if(t instanceof ys){if(!t.cacheId){const s=(null==e?void 0:e.pixiIdPrefix)||"pixiid";t.cacheId=`${s}-${Ve()}`,ys.addToCache(t,t.cacheId)}r=t.cacheId}else{if(!t._pixiId){const s=(null==e?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${s}_${Ve()}`}r=t._pixiId}let n=je[r];if(i&&s&&!n)throw new Error(`The cacheId "${r}" does not exist in TextureCache.`);return n||t instanceof ys?!n&&t instanceof ys&&(n=new Wi(t),Wi.addToCache(n,r)):(e.resolution||(e.resolution=ss(t)),n=new Wi(new ys(t,e)),n.baseTexture.cacheId=r,ys.addToCache(n.baseTexture,r),Wi.addToCache(n,r)),n}static fromURL(t,e){const s=Object.assign({autoLoad:!1},null==e?void 0:e.resourceOptions),i=Wi.from(t,Object.assign({resourceOptions:s},e),!1),r=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):r.load().then((()=>Promise.resolve(i)))}static fromBuffer(t,e,s,i){return new Wi(ys.fromBuffer(t,e,s,i))}static fromLoader(t,e,s,i){const r=new ys(t,Object.assign({scaleMode:ys.defaultOptions.scaleMode,resolution:ss(e)},i)),{resource:n}=r;n instanceof Xi&&(n.url=e);const a=new Wi(r);return s||(s=e),ys.addToCache(a.baseTexture,s),Wi.addToCache(a,s),s!==e&&(ys.addToCache(a.baseTexture,e),Wi.addToCache(a,e)),a.baseTexture.valid?Promise.resolve(a):new Promise((t=>{a.baseTexture.once("loaded",(()=>t(a)))}))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),je[e]&&je[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),je[e]=t)}static removeFromCache(t){if("string"==typeof t){const e=je[t];if(e){const s=e.textureCacheIds.indexOf(t);return s>-1&&e.textureCacheIds.splice(s,1),delete je[t],e}}else if(null!=t&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)je[t.textureCacheIds[e]]===t&&delete je[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(t){this._frame=t,this.noFrame=!1;const{x:e,y:s,width:i,height:r}=t,n=e+i>this.baseTexture.width,a=s+r>this.baseTexture.height;if(n||a){const t=n&&a?"and":"or",o=`X: ${e} + ${i} = ${e+i} > ${this.baseTexture.width}`,h=`Y: ${s} + ${r} = ${s+r} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${o} ${t} ${h}`)}this.valid=i&&r&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return Wi._EMPTY||(Wi._EMPTY=new Wi(new ys),zi(Wi._EMPTY),zi(Wi._EMPTY.baseTexture)),Wi._EMPTY}static get WHITE(){if(!Wi._WHITE){const t=A.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),Wi._WHITE=new Wi(ys.from(t)),zi(Wi._WHITE),zi(Wi._WHITE.baseTexture)}return Wi._WHITE}}class Yi extends Wi{constructor(t,e){super(t,e),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e,s=!0){const i=this.baseTexture.resolution,r=Math.round(t*i)/i,n=Math.round(e*i)/i;this.valid=r>0&&n>0,this._frame.width=this.orig.width=r,this._frame.height=this.orig.height=n,s&&this.baseTexture.resize(r,n),this.updateUvs()}setResolution(t){const{baseTexture:e}=this;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))}static create(t){return new Yi(new Ui(t))}}class ji{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,s=T.NONE){const i=new Ui(Object.assign({width:t,height:e,resolution:1,multisample:s},this.textureOptions));return new Yi(i)}getOptimalTexture(t,e,s=1,i=T.NONE){let r;t=Math.ceil(t*s-1e-6),e=Math.ceil(e*s-1e-6),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?r=i>1?-i:-1:(r=((65535&(t=Le(t)))<<16|65535&(e=Le(e)))>>>0,i>1&&(r+=4294967296*i)),this.texturePool[r]||(this.texturePool[r]=[]);let n=this.texturePool[r].pop();return n||(n=this.createTexture(t,e,i)),n.filterPoolKey=r,n.setResolution(s),n}getFilterTexture(t,e,s){const i=this.getOptimalTexture(t.width,t.height,e||t.resolution,s||T.NONE);return i.filterFrame=t.filterFrame,i}returnTexture(t){const e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=!1!==t)for(const t in this.texturePool){const e=this.texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0)}this.texturePool={}}setScreenSize(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){this.enableFullScreen=t.width>0&&t.height>0;for(const t in this.texturePool){if(!(Number(t)<0))continue;const e=this.texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0);this.texturePool[t]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}}}ji.SCREEN_KEY=-1;class $i extends Ms{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class qi extends Ms{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new Es(this.vertices),this.uvBuffer=new Es(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(t,e){let s=0,i=0;return this.uvs[0]=s,this.uvs[1]=i,this.uvs[2]=s+e.width/t.width,this.uvs[3]=i,this.uvs[4]=s+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=s,this.uvs[7]=i+e.height/t.height,s=e.x,i=e.y,this.vertices[0]=s,this.vertices[1]=i,this.vertices[2]=s+e.width,this.vertices[3]=i,this.vertices[4]=s+e.width,this.vertices[5]=i+e.height,this.vertices[6]=s,this.vertices[7]=i+e.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class Ki{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=T.NONE,this.sourceFrame=new Ls,this.destinationFrame=new Ls,this.bindingSourceFrame=new Ls,this.bindingDestinationFrame=new Ls,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const Zi=[new Bs,new Bs,new Bs,new Bs],Ji=new Hs;class tr{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new ji,this.statePool=[],this.quad=new $i,this.quadUv=new qi,this.tempRect=new Ls,this.activeState={},this.globalUniforms=new Ai({outputFrame:new Ls,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}init(){this.texturePool.setScreenSize(this.renderer.view)}push(t,e){var s,i;const r=this.renderer,n=this.defaultFilterStack,a=this.statePool.pop()||new Ki,o=this.renderer.renderTexture;let h=e[0].resolution,l=e[0].multisample,u=e[0].padding,d=e[0].autoFit,c=null==(s=e[0].legacy)||s;for(let t=1;t<e.length;t++){const s=e[t];h=Math.min(h,s.resolution),l=Math.min(l,s.multisample),u=this.useMaxPadding?Math.max(u,s.padding):u+s.padding,d=d&&s.autoFit,c=c||null==(i=s.legacy)||i}1===n.length&&(this.defaultFilterStack[0].renderTexture=o.current),n.push(a),a.resolution=h,a.multisample=l,a.legacy=c,a.target=t,a.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),a.sourceFrame.pad(u);const p=this.tempRect.copyFrom(o.sourceFrame);r.projection.transform&&this.transformAABB(Ji.copyFrom(r.projection.transform).invert(),p),d?(a.sourceFrame.fit(p),(a.sourceFrame.width<=0||a.sourceFrame.height<=0)&&(a.sourceFrame.width=0,a.sourceFrame.height=0)):a.sourceFrame.intersects(p)||(a.sourceFrame.width=0,a.sourceFrame.height=0),this.roundFrame(a.sourceFrame,o.current?o.current.resolution:r.resolution,o.sourceFrame,o.destinationFrame,r.projection.transform),a.renderTexture=this.getOptimalFilterTexture(a.sourceFrame.width,a.sourceFrame.height,h,l),a.filters=e,a.destinationFrame.width=a.renderTexture.width,a.destinationFrame.height=a.renderTexture.height;const f=this.tempRect;f.x=0,f.y=0,f.width=a.sourceFrame.width,f.height=a.sourceFrame.height,a.renderTexture.filterFrame=a.sourceFrame,a.bindingSourceFrame.copyFrom(o.sourceFrame),a.bindingDestinationFrame.copyFrom(o.destinationFrame),a.transform=r.projection.transform,r.projection.transform=null,o.bind(a.renderTexture,a.sourceFrame,f),r.framebuffer.clear(0,0,0,0)}pop(){const t=this.defaultFilterStack,e=t.pop(),s=e.filters;this.activeState=e;const i=this.globalUniforms.uniforms;i.outputFrame=e.sourceFrame,i.resolution=e.resolution;const r=i.inputSize,n=i.inputPixel,a=i.inputClamp;if(r[0]=e.destinationFrame.width,r[1]=e.destinationFrame.height,r[2]=1/r[0],r[3]=1/r[1],n[0]=Math.round(r[0]*e.resolution),n[1]=Math.round(r[1]*e.resolution),n[2]=1/n[0],n[3]=1/n[1],a[0]=.5*n[2],a[1]=.5*n[3],a[2]=e.sourceFrame.width*r[2]-.5*n[2],a[3]=e.sourceFrame.height*r[3]-.5*n[3],e.legacy){const t=i.filterArea;t[0]=e.destinationFrame.width,t[1]=e.destinationFrame.height,t[2]=e.sourceFrame.x,t[3]=e.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();const o=t[t.length-1];if(this.renderer.framebuffer.blit(),1===s.length)s[0].apply(this,e.renderTexture,o.renderTexture,_.BLEND,e),this.returnFilterTexture(e.renderTexture);else{let t=e.renderTexture,i=this.getOptimalFilterTexture(t.width,t.height,e.resolution);i.filterFrame=t.filterFrame;let r=0;for(r=0;r<s.length-1;++r){1===r&&e.multisample>1&&(i=this.getOptimalFilterTexture(t.width,t.height,e.resolution),i.filterFrame=t.filterFrame),s[r].apply(this,t,i,_.CLEAR,e);const n=t;t=i,i=n}s[r].apply(this,t,o.renderTexture,_.BLEND,e),r>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(t),this.returnFilterTexture(i)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=_.CLEAR){const{renderTexture:s,state:i}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,null!=t&&t.filterFrame){const e=this.tempRect;e.x=0,e.y=0,e.width=t.filterFrame.width,e.height=t.filterFrame.height,s.bind(t,t.filterFrame,e)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?s.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const r=1&i.stateId||this.forceClear;(e===_.CLEAR||e===_.BLIT&&r)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,s,i){const r=this.renderer;r.state.set(t.state),this.bindAndClear(s,i),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,r.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),r.geometry.bind(this.quadUv),r.geometry.draw(o.TRIANGLES)):(r.geometry.bind(this.quad),r.geometry.draw(o.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:s,destinationFrame:i}=this.activeState,{orig:r}=e._texture,n=t.set(i.width,0,0,i.height,s.x,s.y),a=e.worldTransform.copyTo(Hs.TEMP_MATRIX);return a.invert(),n.prepend(a),n.scale(1/r.width,1/r.height),n.translate(e.anchor.x,e.anchor.y),n}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,e,s=1,i=T.NONE){return this.texturePool.getOptimalTexture(t,e,s,i)}getFilterTexture(t,e,s){if("number"==typeof t){const s=t;t=e,e=s}t=t||this.activeState.renderTexture;const i=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,s||T.NONE);return i.filterFrame=t.filterFrame,i}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,e){const s=Zi[0],i=Zi[1],r=Zi[2],n=Zi[3];s.set(e.left,e.top),i.set(e.left,e.bottom),r.set(e.right,e.top),n.set(e.right,e.bottom),t.apply(s,s),t.apply(i,i),t.apply(r,r),t.apply(n,n);const a=Math.min(s.x,i.x,r.x,n.x),o=Math.min(s.y,i.y,r.y,n.y),h=Math.max(s.x,i.x,r.x,n.x),l=Math.max(s.y,i.y,r.y,n.y);e.x=a,e.y=o,e.width=h-a,e.height=l-o}roundFrame(t,e,s,i,r){if(!(t.width<=0||t.height<=0||s.width<=0||s.height<=0)){if(r){const{a:t,b:e,c:s,d:i}=r;if((Math.abs(e)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4))return}(r=r?Ji.copyFrom(r):Ji.identity()).translate(-s.x,-s.y).scale(i.width/s.width,i.height/s.height).translate(i.x,i.y),this.transformAABB(r,t),t.ceil(e),this.transformAABB(r.invert(),t)}}}tr.extension={type:rs.RendererSystem,name:"filter"},os.add(tr);class er{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=T.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const sr=new Ls;class ir{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Gi(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ls,this.hasMRT=!0,this.writeDepthTexture=!0,1===this.renderer.context.webGLVersion){let e=this.renderer.context.extensions.drawBuffers,s=this.renderer.context.extensions.depthTexture;A.PREFER_ENV===i.WEBGL_LEGACY&&(e=null,s=null),e?t.drawBuffers=t=>e.drawBuffersWEBGL(t):(this.hasMRT=!1,t.drawBuffers=()=>{}),s||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,s=0){const{gl:i}=this;if(t){const r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,r.framebuffer)),r.mipLevel!==s&&(t.dirtyId++,t.dirtyFormat++,r.mipLevel=s),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,r.dirtySize=t.dirtySize,this.updateFramebuffer(t,s)):r.dirtySize!==t.dirtySize&&(r.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let e=0;e<t.colorTextures.length;e++){const s=t.colorTextures[e];this.renderer.texture.unbind(s.parentTextureArray||s)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){const t=e.width>>s,i=e.height>>s,r=t/e.width;this.setViewport(e.x*r,e.y*r,t,i)}else{const e=t.width>>s,i=t.height>>s;this.setViewport(0,0,e,i)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,e,s,i){const r=this.viewport;t=Math.round(t),e=Math.round(e),s=Math.round(s),i=Math.round(i),(r.width!==s||r.height!==i||r.x!==t||r.y!==e)&&(r.x=t,r.y=e,r.width=s,r.height=i,this.gl.viewport(t,e,s,i))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,e,s,i,r=n.COLOR|n.DEPTH){const{gl:a}=this;a.clearColor(t,e,s,i),a.clear(r)}initFramebuffer(t){const{gl:e}=this,s=new er(e.createFramebuffer());return s.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=s,this.managedFramebuffers.push(t),t.disposeRunner.add(this),s}resizeFramebuffer(t){const{gl:e}=this,s=t.glFramebuffers[this.CONTEXT_UID];s.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,s.stencil),s.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,s.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));const i=t.colorTextures;let r=i.length;e.drawBuffers||(r=Math.min(r,1));for(let n=0;n<r;n++){const r=i[n],a=r.parentTextureArray||r;this.renderer.texture.bind(a,0),0===n&&s.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,s.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,s.multisample,a._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height))}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)}updateFramebuffer(t,e){const{gl:s}=this,i=t.glFramebuffers[this.CONTEXT_UID],r=t.colorTextures;let n=r.length;s.drawBuffers||(n=Math.min(n,1)),i.multisample>1&&this.canMultisampleFramebuffer(t)?i.msaaBuffer=i.msaaBuffer||s.createRenderbuffer():i.msaaBuffer&&(s.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));const a=[];for(let o=0;o<n;o++){const n=r[o],h=n.parentTextureArray||n;this.renderer.texture.bind(h,0),0===o&&i.msaaBuffer?(s.bindRenderbuffer(s.RENDERBUFFER,i.msaaBuffer),s.renderbufferStorageMultisample(s.RENDERBUFFER,i.multisample,h._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,i.msaaBuffer)):(s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+o,n.target,h._glTextures[this.CONTEXT_UID].texture,e),a.push(s.COLOR_ATTACHMENT0+o))}if(a.length>1&&s.drawBuffers(a),t.depthTexture&&this.writeDepthTexture){const i=t.depthTexture;this.renderer.texture.bind(i,0),s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,i._glTextures[this.CONTEXT_UID].texture,e)}!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture?i.stencil&&(s.deleteRenderbuffer(i.stencil),i.stencil=null):(i.stencil=i.stencil||s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,i.stencil),i.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,i.multisample,s.DEPTH24_STENCIL8,t.width,t.height):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,t.width,t.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,i.stencil))}canMultisampleFramebuffer(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:e}=this;let s=T.NONE;if(t<=1||null===e)return s;for(let i=0;i<e.length;i++)if(e[i]<=t){s=e[i];break}return 1===s&&(s=T.NONE),s}blit(t,e,s){const{current:i,renderer:r,gl:n,CONTEXT_UID:a}=this;if(2!==r.context.webGLVersion||!i)return;const o=i.glFramebuffers[a];if(!o)return;if(!t){if(!o.msaaBuffer)return;const e=i.colorTextures[0];if(!e)return;o.blitFramebuffer||(o.blitFramebuffer=new Gi(i.width,i.height),o.blitFramebuffer.addColorTexture(0,e)),(t=o.blitFramebuffer).colorTextures[0]!==e&&(t.colorTextures[0]=e,t.dirtyId++,t.dirtyFormat++),(t.width!==i.width||t.height!==i.height)&&(t.width=i.width,t.height=i.height,t.dirtyId++,t.dirtySize++)}e||((e=sr).width=i.width,e.height=i.height),s||(s=e);const h=e.width===s.width&&e.height===s.height;this.bind(t),n.bindFramebuffer(n.READ_FRAMEBUFFER,o.framebuffer),n.blitFramebuffer(e.left,e.top,e.right,e.bottom,s.left,s.top,s.right,s.bottom,n.COLOR_BUFFER_BIT,h?n.NEAREST:n.LINEAR),n.bindFramebuffer(n.READ_FRAMEBUFFER,t.glFramebuffers[this.CONTEXT_UID].framebuffer)}disposeFramebuffer(t,e){const s=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(!s)return;delete t.glFramebuffers[this.CONTEXT_UID];const r=this.managedFramebuffers.indexOf(t);r>=0&&this.managedFramebuffers.splice(r,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(s.framebuffer),s.msaaBuffer&&i.deleteRenderbuffer(s.msaaBuffer),s.stencil&&i.deleteRenderbuffer(s.stencil)),s.blitFramebuffer&&this.disposeFramebuffer(s.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let s=0;s<e.length;s++)this.disposeFramebuffer(e[s],t)}forceStencil(){const t=this.current;if(!t)return;const e=t.glFramebuffers[this.CONTEXT_UID];if(!e||e.stencil)return;t.stencil=!0;const s=t.width,i=t.height,r=this.gl,n=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,n),e.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,e.multisample,r.DEPTH24_STENCIL8,s,i):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,s,i),e.stencil=n,r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,n)}reset(){this.current=this.unknownFramebuffer,this.viewport=new Ls}destroy(){this.renderer=null}}ir.extension={type:rs.RendererSystem,name:"framebuffer"},os.add(ir);const rr={5126:4,5123:2,5121:1};class nr{constructor(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,2!==e.webGLVersion){let e=this.renderer.context.extensions.vertexArrayObject;A.PREFER_ENV===i.WEBGL_LEGACY&&(e=null),e?(t.createVertexArray=()=>e.createVertexArrayOES(),t.bindVertexArray=t=>e.bindVertexArrayOES(t),t.deleteVertexArray=t=>e.deleteVertexArrayOES(t)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(2!==e.webGLVersion){const e=t.getExtension("ANGLE_instanced_arrays");e?(t.vertexAttribDivisor=(t,s)=>e.vertexAttribDivisorANGLE(t,s),t.drawElementsInstanced=(t,s,i,r,n)=>e.drawElementsInstancedANGLE(t,s,i,r,n),t.drawArraysInstanced=(t,s,i,r)=>e.drawArraysInstancedANGLE(t,s,i,r)):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex}bind(t,e){e=e||this.renderer.shader.shader;const{gl:s}=this;let i=t.glVertexArrayObjects[this.CONTEXT_UID],r=!1;i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={},r=!0);const n=i[e.program.id]||this.initGeometryVao(t,e,r);this._activeGeometry=t,this._activeVao!==n&&(this._activeVao=n,this.hasVao?s.bindVertexArray(n):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let s=0;s<t.buffers.length;s++){const i=t.buffers[s];e.update(i)}}checkCompatibility(t,e){const s=t.attributes,i=e.attributeData;for(const t in i)if(!s[t])throw new Error(`shader and geometry incompatible, geometry missing the "${t}" attribute`)}getSignature(t,e){const s=t.attributes,i=e.attributeData,r=["g",t.id];for(const t in s)i[t]&&r.push(t,i[t].location);return r.join("-")}initGeometryVao(t,e,s=!0){const i=this.gl,r=this.CONTEXT_UID,n=this.renderer.buffer,a=e.program;a.glPrograms[r]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,a);const o=this.getSignature(t,a),h=t.glVertexArrayObjects[this.CONTEXT_UID];let l=h[o];if(l)return h[a.id]=l,l;const u=t.buffers,d=t.attributes,c={},p={};for(const t in u)c[t]=0,p[t]=0;for(const t in d)!d[t].size&&a.attributeData[t]?d[t].size=a.attributeData[t].size:d[t].size||console.warn(`PIXI Geometry attribute '${t}' size cannot be determined (likely the bound shader does not have the attribute)`),c[d[t].buffer]+=d[t].size*rr[d[t].type];for(const t in d){const e=d[t],s=e.size;void 0===e.stride&&(c[e.buffer]===s*rr[e.type]?e.stride=0:e.stride=c[e.buffer]),void 0===e.start&&(e.start=p[e.buffer],p[e.buffer]+=s*rr[e.type])}l=i.createVertexArray(),i.bindVertexArray(l);for(let t=0;t<u.length;t++){const e=u[t];n.bind(e),s&&e._glBuffers[r].refCount++}return this.activateVao(t,a),h[a.id]=l,h[o]=l,i.bindVertexArray(null),n.unbind(b.ARRAY_BUFFER),l}disposeGeometry(t,e){var s;if(!this.managedGeometries[t.id])return;delete this.managedGeometries[t.id];const i=t.glVertexArrayObjects[this.CONTEXT_UID],r=this.gl,n=t.buffers,a=null==(s=this.renderer)?void 0:s.buffer;if(t.disposeRunner.remove(this),i){if(a)for(let t=0;t<n.length;t++){const s=n[t]._glBuffers[this.CONTEXT_UID];s&&(s.refCount--,0===s.refCount&&!e&&a.dispose(n[t],e))}if(!e)for(const t in i)if("g"===t[0]){const e=i[t];this._activeVao===e&&this.unbind(),r.deleteVertexArray(e)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(t){const e=Object.keys(this.managedGeometries);for(let s=0;s<e.length;s++)this.disposeGeometry(this.managedGeometries[e[s]],t)}activateVao(t,e){const s=this.gl,i=this.CONTEXT_UID,r=this.renderer.buffer,n=t.buffers,a=t.attributes;t.indexBuffer&&r.bind(t.indexBuffer);let o=null;for(const t in a){const h=a[t],l=n[h.buffer],u=l._glBuffers[i];if(e.attributeData[t]){o!==u&&(r.bind(l),o=u);const i=e.attributeData[t].location;if(s.enableVertexAttribArray(i),s.vertexAttribPointer(i,h.size,h.type||s.FLOAT,h.normalized,h.stride,h.start),h.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");s.vertexAttribDivisor(i,h.divisor)}}}}draw(t,e,s,i){const{gl:r}=this,n=this._activeGeometry;if(n.indexBuffer){const a=n.indexBuffer.data.BYTES_PER_ELEMENT,o=2===a?r.UNSIGNED_SHORT:r.UNSIGNED_INT;2===a||4===a&&this.canUseUInt32ElementIndex?n.instanced?r.drawElementsInstanced(t,e||n.indexBuffer.data.length,o,(s||0)*a,i||1):r.drawElements(t,e||n.indexBuffer.data.length,o,(s||0)*a):console.warn("unsupported index buffer type: uint32")}else n.instanced?r.drawArraysInstanced(t,s,e||n.getSize(),i||1):r.drawArrays(t,s,e||n.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}nr.extension={type:rs.RendererSystem,name:"geometry"},os.add(nr);const ar=new Hs;class or{constructor(t,e){this._texture=t,this.mapCoord=new Hs,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?.5:e,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,e){void 0===e&&(e=t);const s=this.mapCoord;for(let i=0;i<t.length;i+=2){const r=t[i],n=t[i+1];e[i]=r*s.a+n*s.c+s.tx,e[i+1]=r*s.b+n*s.d+s.ty}return e}update(t){const e=this._texture;if(!e||!e.valid||!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;const s=e._uvs;this.mapCoord.set(s.x1-s.x0,s.y1-s.y0,s.x3-s.x0,s.y3-s.y0,s.x0,s.y0);const i=e.orig,r=e.trim;r&&(ar.set(i.width/r.width,0,0,i.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(ar));const n=e.baseTexture,a=this.uClampFrame,o=this.clampMargin/n.resolution,h=this.clampOffset;return a[0]=(e._frame.x+o+h)/n.width,a[1]=(e._frame.y+o+h)/n.height,a[2]=(e._frame.x+e._frame.width-o+h)/n.width,a[3]=(e._frame.y+e._frame.height-o+h)/n.height,this.uClampOffset[0]=h/n.realWidth,this.uClampOffset[1]=h/n.realHeight,this.isSimple=e._frame.width===n.width&&e._frame.height===n.height&&0===e.rotate,!0}}class hr extends Pi{constructor(t,e,s){let i=null;"string"!=typeof t&&void 0===e&&void 0===s&&(i=t,t=void 0,e=void 0,s=void 0),super(t||"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0)  ).xy;\n}\n",e||"varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n    float clip = step(3.5,\n        step(maskClamp.x, vMaskCoord.x) +\n        step(maskClamp.y, vMaskCoord.y) +\n        step(vMaskCoord.x, maskClamp.z) +\n        step(vMaskCoord.y, maskClamp.w));\n\n    vec4 original = texture2D(uSampler, vTextureCoord);\n    vec4 masky = texture2D(mask, vMaskCoord);\n    float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n    original *= (alphaMul * masky.r * alpha * clip);\n\n    gl_FragColor = original;\n}\n",s),this.maskSprite=i,this.maskMatrix=new Hs}get maskSprite(){return this._maskSprite}set maskSprite(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(t,e,s,i){const r=this._maskSprite,n=r._texture;!n.valid||(n.uvMatrix||(n.uvMatrix=new or(n,0)),n.uvMatrix.update(),this.uniforms.npmAlpha=n.baseTexture.alphaMode?0:1,this.uniforms.mask=n,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,r).prepend(n.uvMatrix.mapCoord),this.uniforms.alpha=r.worldAlpha,this.uniforms.maskClamp=n.uvMatrix.uClampFrame,t.applyFilter(this,e,s,i))}}class lr{constructor(t=null){this.type=v.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Pi.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=v.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class ur{constructor(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)}push(t,e){let s=e;if(!s.isMaskData){const t=this.maskDataPool.pop()||new lr;t.pooled=!0,t.maskObject=e,s=t}const i=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null;if(s.copyCountersOrReset(i),s._colorMask=i?i._colorMask:15,s.autoDetect&&this.detect(s),s._target=t,s.type!==v.SPRITE&&this.maskStack.push(s),s.enabled)switch(s.type){case v.SCISSOR:this.renderer.scissor.push(s);break;case v.STENCIL:this.renderer.stencil.push(s);break;case v.SPRITE:s.copyCountersOrReset(null),this.pushSpriteMask(s);break;case v.COLOR:this.pushColorMask(s)}s.type===v.SPRITE&&this.maskStack.push(s)}pop(t){const e=this.maskStack.pop();if(e&&e._target===t){if(e.enabled)switch(e.type){case v.SCISSOR:this.renderer.scissor.pop(e);break;case v.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case v.SPRITE:this.popSpriteMask(e);break;case v.COLOR:this.popColorMask(e)}if(e.reset(),e.pooled&&this.maskDataPool.push(e),0!==this.maskStack.length){const t=this.maskStack[this.maskStack.length-1];t.type===v.SPRITE&&t._filters&&(t._filters[0].maskSprite=t.maskObject)}}}detect(t){const e=t.maskObject;e?e.isSprite?t.type=v.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=v.SCISSOR:t.type=v.STENCIL:t.type=v.COLOR}pushSpriteMask(t){var e,s;const{maskObject:i}=t,r=t._target;let n=t._filters;n||(n=this.alphaMaskPool[this.alphaMaskIndex],n||(n=this.alphaMaskPool[this.alphaMaskIndex]=[new hr]));const a=this.renderer,o=a.renderTexture;let h,l;if(o.current){const s=o.current;h=t.resolution||s.resolution,l=null!=(e=t.multisample)?e:s.multisample}else h=t.resolution||a.resolution,l=null!=(s=t.multisample)?s:a.multisample;n[0].resolution=h,n[0].multisample=l,n[0].maskSprite=i;const u=r.filterArea;r.filterArea=i.getBounds(!0),a.filter.push(r,n),r.filterArea=u,t._filters||this.alphaMaskIndex++}popSpriteMask(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(t){const e=t._colorMask,s=t._colorMask=e&t.colorMask;s!==e&&this.renderer.gl.colorMask(0!=(1&s),0!=(2&s),0!=(4&s),0!=(8&s))}popColorMask(t){const e=t._colorMask,s=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;s!==e&&this.renderer.gl.colorMask(0!=(1&s),0!=(2&s),0!=(4&s),0!=(8&s))}destroy(){this.renderer=null}}ur.extension={type:rs.RendererSystem,name:"mask"},os.add(ur);class dr{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,s=this.getStackLength();this.maskStack=t;const i=this.getStackLength();i!==s&&(0===i?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const cr=new Hs,pr=[],fr=class extends dr{constructor(t){super(t),this.glConst=A.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){var e;if(t._scissorRectLocal)return;const s=t._scissorRect,{maskObject:i}=t,{renderer:r}=this,n=r.renderTexture,a=i.getBounds(!0,null!=(e=pr.pop())?e:new Ls);this.roundFrameToPixels(a,n.current?n.current.resolution:r.resolution,n.sourceFrame,n.destinationFrame,r.projection.transform),s&&a.fit(s),t._scissorRectLocal=a}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:s,c:i,d:r}=t;return(Math.abs(s)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(r)>1e-4)}testScissor(t){const{maskObject:e}=t;if(!e.isFastRect||!e.isFastRect()||fr.isMatrixRotated(e.worldTransform)||fr.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const s=t._scissorRectLocal;return s.width>0&&s.height>0}roundFrameToPixels(t,e,s,i,r){fr.isMatrixRotated(r)||((r=r?cr.copyFrom(r):cr.identity()).translate(-s.x,-s.y).scale(i.width/s.width,i.height/s.height).translate(i.x,i.y),this.renderer.filter.transformAABB(r,t),t.fit(i),t.x=Math.round(t.x*e),t.y=Math.round(t.y*e),t.width=Math.round(t.width*e),t.height=Math.round(t.height*e))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&pr.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};let mr=fr;mr.extension={type:rs.RendererSystem,name:"scissor"},os.add(mr);class _r extends dr{constructor(t){super(t),this.glConst=A.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const e=t.maskObject,{gl:s}=this.renderer,i=t._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),s.clearStencil(0),s.clear(s.STENCIL_BUFFER_BIT),s.enable(s.STENCIL_TEST)),t._stencilCounter++;const r=t._colorMask;0!==r&&(t._colorMask=0,s.colorMask(!1,!1,!1,!1)),s.stencilFunc(s.EQUAL,i,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,0!==r&&(t._colorMask=r,s.colorMask(0!=(1&r),0!=(2&r),0!=(4&r),0!=(8&r))),this._useCurrent()}pop(t){const e=this.renderer.gl;if(0===this.getStackLength())e.disable(e.STENCIL_TEST);else{const s=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,i=s?s._colorMask:15;0!==i&&(s._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,0!==i&&(s._colorMask=i,e.colorMask(0!=(1&i),0!=(2&i),0!=(4&i),0!=(8&i))),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}_r.extension={type:rs.RendererSystem,name:"stencil"},os.add(_r);class gr{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get:()=>(Kt("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract)},prepare:{enumerable:!1,get:()=>(Kt("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare)},interaction:{enumerable:!1,get:()=>(Kt("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events)}})}init(){const t=this.rendererPlugins;for(const e in t)this.plugins[e]=new t[e](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}gr.extension={type:[rs.RendererSystem,rs.CanvasRendererSystem],name:"_plugin"},os.add(gr);class xr{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Hs,this.transform=null}update(t,e,s,i){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,s,i),this.transform&&this.projectionMatrix.append(this.transform);const r=this.renderer;r.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,r.globalUniforms.update(),r.shader.shader&&r.shader.syncUniformGroup(r.shader.shader.uniforms.globals)}calculateProjection(t,e,s,i){const r=this.projectionMatrix,n=i?-1:1;r.identity(),r.a=1/e.width*2,r.d=n*(1/e.height*2),r.tx=-1-e.x*r.a,r.ty=-n-e.y*r.d}setTransform(t){}destroy(){this.renderer=null}}xr.extension={type:rs.RendererSystem,name:"projection"},os.add(xr);const vr=new Js;class yr{constructor(t){this.renderer=t,this._tempMatrix=new Hs}generateTexture(t,e){const s=e||{},{region:i}=s,r=zn(s,["region"]),n=i||t.getLocalBounds(null,!0);0===n.width&&(n.width=1),0===n.height&&(n.height=1);const a=Yi.create(bt({width:n.width,height:n.height},r));this._tempMatrix.tx=-n.x,this._tempMatrix.ty=-n.y;const o=t.transform;return t.transform=vr,this.renderer.render(t,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=o,a}destroy(){}}yr.extension={type:[rs.RendererSystem,rs.CanvasRendererSystem],name:"textureGenerator"},os.add(yr);const Tr=new Ls,br=new Ls;class Er{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Ls,this.destinationFrame=new Ls,this.viewportFrame=new Ls}contextChange(){var t;const e=null==(t=this.renderer)?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}bind(t=null,e,s){const i=this.renderer;let r,n,a;this.current=t,t?(r=t.baseTexture,a=r.resolution,e||(Tr.width=t.frame.width,Tr.height=t.frame.height,e=Tr),s||(br.x=t.frame.x,br.y=t.frame.y,br.width=e.width,br.height=e.height,s=br),n=r.framebuffer):(a=i.resolution,e||(Tr.width=i._view.screen.width,Tr.height=i._view.screen.height,e=Tr),s||((s=Tr).width=e.width,s.height=e.height));const o=this.viewportFrame;o.x=s.x*a,o.y=s.y*a,o.width=s.width*a,o.height=s.height*a,t||(o.y=i.view.height-(o.y+o.height)),o.ceil(),this.renderer.framebuffer.bind(n,o),this.renderer.projection.update(s,e,a,!n),t?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(s)}clear(t,e){const s=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,i=Ie.shared.setValue(t||s);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&i.premultiply(i.alpha);const r=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer._view.screen,a=r.width!==n.width||r.height!==n.height;if(a){let{x:t,y:e,width:s,height:i}=this.viewportFrame;t=Math.round(t),e=Math.round(e),s=Math.round(s),i=Math.round(i),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(t,e,s,i)}this.renderer.framebuffer.clear(i.red,i.green,i.blue,i.alpha,e),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}Er.extension={type:rs.RendererSystem,name:"renderTexture"},os.add(Er);class Ar{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function Rr(t,e){var s;const i=ti(t,t.VERTEX_SHADER,e.vertexSrc),r=ti(t,t.FRAGMENT_SHADER,e.fragmentSrc),n=t.createProgram();t.attachShader(n,i),t.attachShader(n,r);const a=null==(s=e.extra)?void 0:s.transformFeedbackVaryings;if(a&&("function"!=typeof t.transformFeedbackVaryings?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(n,a.names,"separate"===a.bufferMode?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||function(t,e,s,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(s,t.COMPILE_STATUS)||ui(t,s),t.getShaderParameter(i,t.COMPILE_STATUS)||ui(t,i),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,n,i,r),e.attributeData=function(t,e){const s={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const i=e.getActiveAttrib(t,r);if(i.name.startsWith("gl_"))continue;const n=mi(e,i.type),a={type:n,name:i.name,size:ci(n),location:e.getAttribLocation(t,i.name)};s[i.name]=a}return s}(n,t),e.uniformData=function(t,e){const s={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<i;r++){const i=e.getActiveUniform(t,r),n=i.name.replace(/\[.*?\]$/,""),a=!!i.name.match(/\[.*?\]$/),o=mi(e,i.type);s[n]={name:n,index:r,type:o,size:i.size,isArray:a,value:si(o,i.size)}}return s}(n,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){const s=Object.keys(e.attributeData);s.sort(((t,e)=>t>e?1:-1));for(let i=0;i<s.length;i++)e.attributeData[s[i]].location=i,t.bindAttribLocation(n,i,s[i]);t.linkProgram(n)}t.deleteShader(i),t.deleteShader(r);const o={};for(const s in e.uniformData){const i=e.uniformData[s];o[s]={location:t.getUniformLocation(n,s),value:si(i.type,i.size)}}return new Ar(n,o)}function Sr(t,e,s,i,r){s.buffer.update(r)}const wr={float:"\n        data[offset] = v;\n    ",vec2:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n    ",vec3:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n        data[offset+2] = v[2];\n\n    ",vec4:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n        data[offset+2] = v[2];\n        data[offset+3] = v[3];\n    ",mat2:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n\n        data[offset+4] = v[2];\n        data[offset+5] = v[3];\n    ",mat3:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n        data[offset+2] = v[2];\n\n        data[offset + 4] = v[3];\n        data[offset + 5] = v[4];\n        data[offset + 6] = v[5];\n\n        data[offset + 8] = v[6];\n        data[offset + 9] = v[7];\n        data[offset + 10] = v[8];\n    ",mat4:"\n        for(var i = 0; i < 16; i++)\n        {\n            data[offset + i] = v[i];\n        }\n    "},Ir={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function Mr(t){const e=t.map((t=>({data:t,offset:0,dataLen:0,dirty:0})));let s=0,i=0,r=0;for(let t=0;t<e.length;t++){const n=e[t];if(s=Ir[n.data.type],n.data.size>1&&(s=Math.max(s,16)*n.data.size),n.dataLen=s,i%s!=0&&i<16){const t=i%s%16;i+=t,r+=t}i+s>16?(r=16*Math.ceil(r/16),n.offset=r,r+=s,i=s):(n.offset=r,i+=s,r+=s)}return r=16*Math.ceil(r/16),{uboElements:e,size:r}}function Cr(t,e){const s=[];for(const i in t)e[i]&&s.push(e[i]);return s.sort(((t,e)=>t.index-e.index)),s}function Dr(t,e){if(!t.autoManage)return{size:0,syncFunc:Sr};const s=Cr(t.uniforms,e),{uboElements:i,size:r}=Mr(s),n=["\n    var v = null;\n    var v2 = null;\n    var cv = null;\n    var t = 0;\n    var gl = renderer.gl\n    var index = 0;\n    var data = buffer.data;\n    "];for(let e=0;e<i.length;e++){const s=i[e],r=t.uniforms[s.data.name],a=s.data.name;let o=!1;for(let t=0;t<ii.length;t++){const e=ii[t];if(e.codeUbo&&e.test(s.data,r)){n.push(`offset = ${s.offset/4};`,ii[t].codeUbo(s.data.name,r)),o=!0;break}}if(!o)if(s.data.size>1){const t=ci(s.data.type),e=Math.max(Ir[s.data.type]/16,1),i=t/e,r=(4-i%4)%4;n.push(`\n                cv = ud.${a}.value;\n                v = uv.${a};\n                offset = ${s.offset/4};\n\n                t = 0;\n\n                for(var i=0; i < ${s.data.size*e}; i++)\n                {\n                    for(var j = 0; j < ${i}; j++)\n                    {\n                        data[offset++] = v[t++];\n                    }\n                    offset += ${r};\n                }\n\n                `)}else{const t=wr[s.data.type];n.push(`\n                cv = ud.${a}.value;\n                v = uv.${a};\n                offset = ${s.offset/4};\n                ${t};\n                `)}}return n.push("\n       renderer.buffer.update(buffer);\n    "),{size:r,syncFunc:new Function("ud","uv","renderer","syncData","buffer",n.join("\n"))}}let Pr=0;const Or={textureCount:0,uboCount:0};class Fr{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Pr++}systemCheck(){if(!xi())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const s=t.program,i=s.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==s&&(this.program=s,this.gl.useProgram(i.program)),e||(Or.textureCount=0,Or.uboCount=0,this.syncUniformGroup(t.uniformGroup,Or)),i}setUniforms(t){const e=this.shader.program,s=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(s.uniformData,t,this.renderer)}syncUniformGroup(t,e){const s=this.getGlProgram();(!t.static||t.dirtyId!==s.uniformDirtyGroups[t.id])&&(s.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,s,e))}syncUniforms(t,e,s){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,s)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=function(t,e){var s;const i=["\n        var v = null;\n        var cv = null;\n        var cu = null;\n        var t = 0;\n        var gl = renderer.gl;\n    "];for(const r in t.uniforms){const n=e[r];if(!n){null!=(s=t.uniforms[r])&&s.group&&(t.uniforms[r].ubo?i.push(`\n                        renderer.shader.syncUniformBufferGroup(uv.${r}, '${r}');\n                    `):i.push(`\n                        renderer.shader.syncUniformGroup(uv.${r}, syncData);\n                    `));continue}const a=t.uniforms[r];let o=!1;for(let t=0;t<ii.length;t++)if(ii[t].test(n,a)){i.push(ii[t].code(r,a)),o=!0;break}if(!o){const t=(1!==n.size||n.isArray?ni:ri)[n.type].replace("location",`ud["${r}"].location`);i.push(`\n            cu = ud["${r}"];\n            cv = cu.value;\n            v = uv["${r}"];\n            ${t};`)}}return new Function("ud","uv","renderer","syncData",i.join("\n"))}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,e){const s=this.getGlProgram();if(!t.static||0!==t.dirtyId||!s.uniformGroups[t.id]){t.dirtyId=0;const i=s.uniformGroups[t.id]||this.createSyncBufferGroup(t,s,e);t.buffer.update(),i(s.uniformData,t.uniforms,this.renderer,Or,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,s.uniformBufferBindings[e])}createSyncBufferGroup(t,e,s){const{gl:i}=this.renderer;this.renderer.buffer.bind(t.buffer);const r=this.gl.getUniformBlockIndex(e.program,s);e.uniformBufferBindings[s]=this.shader.uniformBindCount,i.uniformBlockBinding(e.program,r,this.shader.uniformBindCount),this.shader.uniformBindCount++;const n=this.getSignature(t,this.shader.program.uniformData,"ubo");let a=this._uboCache[n];if(a||(a=this._uboCache[n]=Dr(t,this.shader.program.uniformData)),t.autoManage){const e=new Float32Array(a.size/4);t.buffer.update(e)}return e.uniformGroups[t.id]=a.syncFunc,e.uniformGroups[t.id]}getSignature(t,e,s){const i=t.uniforms,r=[`${s}-`];for(const t in i)r.push(t),e[t]&&r.push(e[t].type);return r.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const e=this.gl,s=t.program,i=Rr(e,s);return s.glPrograms[this.renderer.CONTEXT_UID]=i,i}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}Fr.extension={type:rs.RendererSystem,name:"shader"},os.add(Fr);class Br{constructor(t){this.renderer=t}run(t){const{renderer:e}=this;e.runners.init.emit(e.options),t.hello&&console.log(`PixiJS 7.2.4 - ${e.rendererLogId} - https://pixijs.com`),e.resize(e.screen.width,e.screen.height)}destroy(){}}Br.defaultOptions={hello:!1},Br.extension={type:[rs.RendererSystem,rs.CanvasRendererSystem],name:"startup"},os.add(Br);const Nr=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=a.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new cs,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=function(t,e=[]){return e[a.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.ADD]=[t.ONE,t.ONE],e[a.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.NONE]=[0,0],e[a.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[a.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[a.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[a.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[a.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[a.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[a.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[a.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[a.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[a.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,s=0;for(;e;)1&e&&this.map[s].call(this,!!(t.data&1<<s)),e>>=1,s++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this.updateCheck(Nr.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this.updateCheck(Nr.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(t===this.blendMode)return;this.blendMode=t;const e=this.blendModes[t],s=this.gl;2===e.length?s.blendFunc(e[0],e[1]):s.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,s.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(t,e){const s=this.checks.indexOf(t);e&&-1===s?this.checks.push(t):!e&&-1!==s&&this.checks.splice(s,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};let Lr=Nr;Lr.extension={type:rs.RendererSystem,name:"state"},os.add(Lr);class Gr extends W{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(t){var e;this.addRunners(...t.runners);const s=(null!=(e=t.priority)?e:[]).filter((e=>t.systems[e])),i=[...s,...Object.keys(t.systems).filter((t=>!s.includes(t)))];for(const e of i)this.addSystem(t.systems[e],e)}addRunners(...t){t.forEach((t=>{this.runners[t]=new ms(t)}))}addSystem(t,e){const s=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=s,this._systemsHash[e]=s;for(const t in this.runners)this.runners[t].add(s);return this}emitWithCustomOptions(t,e){const s=Object.keys(this._systemsHash);t.items.forEach((i=>{const r=s.find((t=>this._systemsHash[t]===i));i[t.name](e[r])}))}destroy(){Object.values(this.runners).forEach((t=>{t.destroy()})),this._systemsHash={}}}const Ur=class{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=Ur.defaultMaxIdle,this.checkCountMax=Ur.defaultCheckCountMax,this.mode=Ur.defaultMode}postrender(){!this.renderer.objectRenderer.renderingToScreen||(this.count++,this.mode!==g.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let s=!1;for(let i=0;i<e.length;i++){const r=e[i];!r.framebuffer&&this.count-r.touched>this.maxIdle&&(t.destroyTexture(r,!0),e[i]=null,s=!0)}if(s){let t=0;for(let s=0;s<e.length;s++)null!==e[s]&&(e[t++]=e[s]);e.length=t}}unload(t){const e=this.renderer.texture,s=t._texture;s&&!s.framebuffer&&e.destroyTexture(s);for(let e=t.children.length-1;e>=0;e--)this.unload(t.children[e])}destroy(){this.renderer=null}};let kr=Ur;kr.defaultMode=g.AUTO,kr.defaultMaxIdle=3600,kr.defaultCheckCountMax=600,kr.extension={type:rs.RendererSystem,name:"textureGC"},os.add(kr);class Xr{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=u.UNSIGNED_BYTE,this.internalFormat=h.RGBA,this.samplerType=0}}class Hr{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ys,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(t){let e;return e="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?{[u.UNSIGNED_BYTE]:{[h.RGBA]:t.RGBA8,[h.RGB]:t.RGB8,[h.RG]:t.RG8,[h.RED]:t.R8,[h.RGBA_INTEGER]:t.RGBA8UI,[h.RGB_INTEGER]:t.RGB8UI,[h.RG_INTEGER]:t.RG8UI,[h.RED_INTEGER]:t.R8UI,[h.ALPHA]:t.ALPHA,[h.LUMINANCE]:t.LUMINANCE,[h.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[u.BYTE]:{[h.RGBA]:t.RGBA8_SNORM,[h.RGB]:t.RGB8_SNORM,[h.RG]:t.RG8_SNORM,[h.RED]:t.R8_SNORM,[h.RGBA_INTEGER]:t.RGBA8I,[h.RGB_INTEGER]:t.RGB8I,[h.RG_INTEGER]:t.RG8I,[h.RED_INTEGER]:t.R8I},[u.UNSIGNED_SHORT]:{[h.RGBA_INTEGER]:t.RGBA16UI,[h.RGB_INTEGER]:t.RGB16UI,[h.RG_INTEGER]:t.RG16UI,[h.RED_INTEGER]:t.R16UI,[h.DEPTH_COMPONENT]:t.DEPTH_COMPONENT16},[u.SHORT]:{[h.RGBA_INTEGER]:t.RGBA16I,[h.RGB_INTEGER]:t.RGB16I,[h.RG_INTEGER]:t.RG16I,[h.RED_INTEGER]:t.R16I},[u.UNSIGNED_INT]:{[h.RGBA_INTEGER]:t.RGBA32UI,[h.RGB_INTEGER]:t.RGB32UI,[h.RG_INTEGER]:t.RG32UI,[h.RED_INTEGER]:t.R32UI,[h.DEPTH_COMPONENT]:t.DEPTH_COMPONENT24},[u.INT]:{[h.RGBA_INTEGER]:t.RGBA32I,[h.RGB_INTEGER]:t.RGB32I,[h.RG_INTEGER]:t.RG32I,[h.RED_INTEGER]:t.R32I},[u.FLOAT]:{[h.RGBA]:t.RGBA32F,[h.RGB]:t.RGB32F,[h.RG]:t.RG32F,[h.RED]:t.R32F,[h.DEPTH_COMPONENT]:t.DEPTH_COMPONENT32F},[u.HALF_FLOAT]:{[h.RGBA]:t.RGBA16F,[h.RGB]:t.RGB16F,[h.RG]:t.RG16F,[h.RED]:t.R16F},[u.UNSIGNED_SHORT_5_6_5]:{[h.RGB]:t.RGB565},[u.UNSIGNED_SHORT_4_4_4_4]:{[h.RGBA]:t.RGBA4},[u.UNSIGNED_SHORT_5_5_5_1]:{[h.RGBA]:t.RGB5_A1},[u.UNSIGNED_INT_2_10_10_10_REV]:{[h.RGBA]:t.RGB10_A2,[h.RGBA_INTEGER]:t.RGB10_A2UI},[u.UNSIGNED_INT_10F_11F_11F_REV]:{[h.RGB]:t.R11F_G11F_B10F},[u.UNSIGNED_INT_5_9_9_9_REV]:{[h.RGB]:t.RGB9_E5},[u.UNSIGNED_INT_24_8]:{[h.DEPTH_STENCIL]:t.DEPTH24_STENCIL8},[u.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[h.DEPTH_STENCIL]:t.DEPTH32F_STENCIL8}}:{[u.UNSIGNED_BYTE]:{[h.RGBA]:t.RGBA,[h.RGB]:t.RGB,[h.ALPHA]:t.ALPHA,[h.LUMINANCE]:t.LUMINANCE,[h.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[u.UNSIGNED_SHORT_5_6_5]:{[h.RGB]:t.RGB},[u.UNSIGNED_SHORT_4_4_4_4]:{[h.RGBA]:t.RGBA},[u.UNSIGNED_SHORT_5_5_5_1]:{[h.RGBA]:t.RGBA}},e}(t);const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(let t=0;t<e;t++)this.boundTextures[t]=null;this.emptyTextures={};const s=new Xr(t.createTexture());t.bindTexture(t.TEXTURE_2D,s.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=s,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new Xr(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(let e=0;e<6;e++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(let t=0;t<this.boundTextures.length;t++)this.bind(null,t)}bind(t,e=0){const{gl:s}=this;if((null==(t=null==t?void 0:t.castToBaseTexture())?void 0:t.valid)&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;const i=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,s.activeTexture(s.TEXTURE0+e)),s.bindTexture(t.target,i.texture)),i.dirtyId!==t.dirtyId?(this.currentLocation!==e&&(this.currentLocation=e,s.activeTexture(s.TEXTURE0+e)),this.updateTexture(t)):i.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,s.activeTexture(s.TEXTURE0+e)),s.bindTexture(s.TEXTURE_2D,this.emptyTextures[s.TEXTURE_2D].texture),this.boundTextures[e]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture}unbind(t){const{gl:e,boundTextures:s}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let t=0;t<s.length;t++)s[t]===this.unknownTexture&&this.bind(null,t)}for(let i=0;i<s.length;i++)s[i]===t&&(this.currentLocation!==i&&(e.activeTexture(e.TEXTURE0+i),this.currentLocation=i),e.bindTexture(t.target,this.emptyTextures[t.target].texture),s[i]=null)}ensureSamplerType(t){const{boundTextures:e,hasIntegerTextures:s,CONTEXT_UID:i}=this;if(s)for(let s=t-1;s>=0;--s){const t=e[s];t&&t._glTextures[i].samplerType!==d.FLOAT&&this.renderer.texture.unbind(t)}}initTexture(t){const e=new Xr(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e}initTextureType(t,e){var s,i;e.internalFormat=null!=(i=null==(s=this.internalFormats[t.type])?void 0:s[t.format])?i:t.format,2===this.webGLVersion&&t.type===u.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type}updateTexture(t){var e;const s=t._glTextures[this.CONTEXT_UID];if(!s)return;const i=this.renderer;if(this.initTextureType(t,s),null!=(e=t.resource)&&e.upload(i,t,s))s.samplerType!==d.FLOAT&&(this.hasIntegerTextures=!0);else{const e=t.realWidth,r=t.realHeight,n=i.gl;(s.width!==e||s.height!==r||s.dirtyId<0)&&(s.width=e,s.height=r,n.texImage2D(t.target,0,s.internalFormat,e,r,0,t.format,s.type,null))}t.dirtyStyleId!==s.dirtyStyleId&&this.updateTextureStyle(t),s.dirtyId=t.dirtyId}destroyTexture(t,e){const{gl:s}=this;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),s.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){const e=this.managedTextures.indexOf(t);-1!==e&&ke(this.managedTextures,e,1)}}updateTextureStyle(t){var e;const s=t._glTextures[this.CONTEXT_UID];!s||(t.mipmap!==f.POW2&&2===this.webGLVersion||t.isPowerOfTwo?s.mipmap=t.mipmap>=1:s.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?s.wrapMode=t.wrapMode:s.wrapMode=p.CLAMP,null!=(e=t.resource)&&e.style(this.renderer,t,s)||this.setStyle(t,s),s.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const s=this.gl;if(e.mipmap&&t.mipmap!==f.ON_MANUAL&&s.generateMipmap(t.target),s.texParameteri(t.target,s.TEXTURE_WRAP_S,e.wrapMode),s.texParameteri(t.target,s.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){s.texParameteri(t.target,s.TEXTURE_MIN_FILTER,t.scaleMode===c.LINEAR?s.LINEAR_MIPMAP_LINEAR:s.NEAREST_MIPMAP_NEAREST);const e=this.renderer.context.extensions.anisotropicFiltering;if(e&&t.anisotropicLevel>0&&t.scaleMode===c.LINEAR){const i=Math.min(t.anisotropicLevel,s.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT));s.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY_EXT,i)}}else s.texParameteri(t.target,s.TEXTURE_MIN_FILTER,t.scaleMode===c.LINEAR?s.LINEAR:s.NEAREST);s.texParameteri(t.target,s.TEXTURE_MAG_FILTER,t.scaleMode===c.LINEAR?s.LINEAR:s.NEAREST)}destroy(){this.renderer=null}}Hr.extension={type:rs.RendererSystem,name:"texture"},os.add(Hr);class Vr{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:s}=this,i=t._glTransformFeedbacks[s]||this.createGLTransformFeedback(t);e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,i)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,e){const{gl:s,renderer:i}=this;e&&i.shader.bind(e),s.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:s,CONTEXT_UID:i}=this,r=e.createTransformFeedback();t._glTransformFeedbacks[i]=r,e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,r);for(let r=0;r<t.buffers.length;r++){const n=t.buffers[r];!n||(s.buffer.update(n),n._glBuffers[i].refCount++,e.bindBufferBase(e.TRANSFORM_FEEDBACK_BUFFER,r,n._glBuffers[i].buffer||null))}return e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null),t.disposeRunner.add(this),r}disposeTransformFeedback(t,e){const s=t._glTransformFeedbacks[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this);const r=this.renderer.buffer;if(r)for(let s=0;s<t.buffers.length;s++){const i=t.buffers[s];if(!i)continue;const n=i._glBuffers[this.CONTEXT_UID];n&&(n.refCount--,0===n.refCount&&!e&&r.dispose(i,e))}!s||(e||i.deleteTransformFeedback(s),delete t._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}Vr.extension={type:rs.RendererSystem,name:"transformFeedback"},os.add(Vr);class zr{constructor(t){this.renderer=t}init(t){this.screen=new Ls(0,0,t.width,t.height),this.element=t.view||A.ADAPTER.createCanvas(),this.resolution=t.resolution||A.RESOLUTION,this.autoDensity=!!t.autoDensity}resizeView(t,e){this.element.width=Math.round(t*this.resolution),this.element.height=Math.round(e*this.resolution);const s=this.element.width/this.resolution,i=this.element.height/this.resolution;this.screen.width=s,this.screen.height=i,this.autoDensity&&(this.element.style.width=`${s}px`,this.element.style.height=`${i}px`),this.renderer.emit("resize",s,i),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(t){var e;t&&(null==(e=this.element.parentNode)||e.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}zr.defaultOptions={width:800,height:600,resolution:A.RESOLUTION,autoDensity:!1},zr.extension={type:[rs.RendererSystem,rs.CanvasRendererSystem],name:"_view"},os.add(zr),A.PREFER_ENV=i.WEBGL2,A.STRICT_TEXTURE_CACHE=!1,A.RENDER_OPTIONS=bt(bt(bt(bt({},Ni.defaultOptions),Oi.defaultOptions),zr.defaultOptions),Br.defaultOptions),Object.defineProperties(A,{WRAP_MODE:{get:()=>ys.defaultOptions.wrapMode,set(t){Kt("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),ys.defaultOptions.wrapMode=t}},SCALE_MODE:{get:()=>ys.defaultOptions.scaleMode,set(t){Kt("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),ys.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get:()=>ys.defaultOptions.mipmap,set(t){Kt("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),ys.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get:()=>ys.defaultOptions.anisotropicLevel,set(t){Kt("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),ys.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get:()=>(Kt("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Pi.defaultResolution),set(t){Pi.defaultResolution=t}},FILTER_MULTISAMPLE:{get:()=>(Kt("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Pi.defaultMultisample),set(t){Pi.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get:()=>Ci.defaultMaxTextures,set(t){Kt("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),Ci.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get:()=>Ci.defaultBatchSize,set(t){Kt("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),Ci.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get:()=>Ci.canUploadSameBuffer,set(t){Kt("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),Ci.canUploadSameBuffer=t}},GC_MODE:{get:()=>kr.defaultMode,set(t){Kt("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),kr.defaultMode=t}},GC_MAX_IDLE:{get:()=>kr.defaultMaxIdle,set(t){Kt("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),kr.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get:()=>kr.defaultCheckCountMax,set(t){Kt("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),kr.defaultCheckCountMax=t}},PRECISION_VERTEX:{get:()=>bi.defaultVertexPrecision,set(t){Kt("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),bi.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get:()=>bi.defaultFragmentPrecision,set(t){Kt("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),bi.defaultFragmentPrecision=t}}});var Wr=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(Wr||{});class Yr{constructor(t,e=null,s=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=s,this.once=i}match(t,e=null){return this.fn===t&&this.context===e}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const jr=class{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Yr(null,null,1/0),this.deltaMS=1/jr.targetFPMS,this.elapsedMS=1/jr.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,s=Wr.NORMAL){return this._addListener(new Yr(t,e,s))}addOnce(t,e,s=Wr.NORMAL){return this._addListener(new Yr(t,e,s,!0))}_addListener(t){let e=this._head.next,s=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(s);break}s=e,e=e.next}t.previous||t.connect(s)}else t.connect(s);return this._startIfPossible(),this}remove(t,e){let s=this._head.next;for(;s;)s=s.match(t,e)?s.destroy():s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const e=t-this._lastFrame|0;if(e<this._minElapsedMS)return;this._lastFrame=t-e%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*jr.targetFPMS;const s=this._head;let i=s.next;for(;i;)i=i.emit(this.deltaTime);s.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const e=Math.min(this.maxFPS,t),s=Math.min(Math.max(0,e)/1e3,jr.targetFPMS);this._maxElapsedMS=1/s}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(0===t)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!jr._shared){const t=jr._shared=new jr;t.autoStart=!0,t._protected=!0}return jr._shared}static get system(){if(!jr._system){const t=jr._system=new jr;t.autoStart=!0,t._protected=!0}return jr._system}};let $r=jr;$r.targetFPMS=.06,Object.defineProperties(A,{TARGET_FPMS:{get:()=>$r.targetFPMS,set(t){Kt("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),$r.targetFPMS=t}}});class qr{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Wr.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?$r.shared:new $r,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}qr.extension=rs.Application,os.add(qr);const Kr=[];function Zr(t){for(const e of Kr)if(e.test(t))return new e(t);throw new Error("Unable to auto-detect a suitable renderer.")}os.handleByList(rs.Renderer,Kr);const Qr="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}",Jr="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n    gl_Position = filterVertexPosition();\n    vTextureCoord = filterTextureCoord();\n}\n";class tn{constructor(t){this.renderer=t}contextChange(t){let e;if(1===this.renderer.context.webGLVersion){const s=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,s)}else{const s=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,s)}e>=T.HIGH?this.multisample=T.HIGH:e>=T.MEDIUM?this.multisample=T.MEDIUM:e>=T.LOW?this.multisample=T.LOW:this.multisample=T.NONE}destroy(){}}tn.extension={type:rs.RendererSystem,name:"_multisample"},os.add(tn);class en{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class sn{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:s}=this,i=t._glBuffers[s]||this.createGLBuffer(t);e.bindBuffer(t.type,i.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:s,CONTEXT_UID:i}=this;if(this.boundBufferBases[e]!==t){const r=t._glBuffers[i]||this.createGLBuffer(t);this.boundBufferBases[e]=t,s.bindBufferBase(s.UNIFORM_BUFFER,e,r.buffer)}}bindBufferRange(t,e,s){const{gl:i,CONTEXT_UID:r}=this;s=s||0;const n=t._glBuffers[r]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,e||0,n.buffer,256*s,256)}update(t){const{gl:e,CONTEXT_UID:s}=this,i=t._glBuffers[s]||this.createGLBuffer(t);if(t._updateID!==i.updateID)if(i.updateID=t._updateID,e.bindBuffer(t.type,i.buffer),i.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{const s=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,s)}}dispose(t,e){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const s=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),s&&(e||i.deleteBuffer(s.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let s=0;s<e.length;s++)this.dispose(this.managedBuffers[e[s]],t)}createGLBuffer(t){const{CONTEXT_UID:e,gl:s}=this;return t._glBuffers[e]=new en(s.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]}}sn.extension={type:rs.RendererSystem,name:"buffer"},os.add(sn);class rn{constructor(t){this.renderer=t}render(t,e){const s=this.renderer;let i,r,n,a;if(e&&(i=e.renderTexture,r=e.clear,n=e.transform,a=e.skipUpdateTransform),this.renderingToScreen=!i,s.runners.prerender.emit(),s.emit("prerender"),s.projection.transform=n,!s.context.isLost){if(i||(this.lastObjectRendered=t),!a){const e=t.enableTempParent();t.updateTransform(),t.disableTempParent(e)}s.renderTexture.bind(i),s.batch.currentRenderer.start(),(null!=r?r:s.background.clearBeforeRender)&&s.renderTexture.clear(),t.render(s),s.batch.currentRenderer.flush(),i&&(e.blit&&s.framebuffer.blit(),i.baseTexture.update()),s.runners.postrender.emit(),s.projection.transform=null,s.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}rn.extension={type:rs.RendererSystem,name:"objectRenderer"},os.add(rn);const nn=class extends Gr{constructor(t){super(),this.type=r.WEBGL,t=Object.assign({},A.RENDER_OPTIONS,t),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new Ai({projectionMatrix:new Hs},!0);const e={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:nn.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(e),"useContextAlpha"in t&&(Kt("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),t.premultipliedAlpha=t.useContextAlpha&&"notMultiplied"!==t.useContextAlpha,t.backgroundAlpha=!1===t.useContextAlpha?1:t.backgroundAlpha),this._plugin.rendererPlugins=nn.__plugins,this.options=t,this.startup.run(this.options)}static test(t){return(null==t||!t.forceCanvas)&&Qt()}render(t,e){this.objectRenderer.render(t,e)}resize(t,e){this._view.resizeView(t,e)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(t=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:t}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(t){this._view.resolution=t,this.runners.resolutionChange.emit(t)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return Kt("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return Kt("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return Kt("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return Kt("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){Kt("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return Kt("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){Kt("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return Kt("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(t,e){return this.textureGenerator.generateTexture(t,e)}};let an=nn;an.extension={type:rs.Renderer,priority:1},an.__plugins={},an.__systems={},os.handleByMap(rs.RendererPlugin,an.__plugins),os.handleByMap(rs.RendererSystem,an.__systems),os.add(an);class on extends _s{constructor(t,e){const{width:s,height:i}=e||{};super(s,i),this.items=[],this.itemDirtyIds=[];for(let e=0;e<t;e++){const t=new ys;this.items.push(t),this.itemDirtyIds.push(-2)}this.length=t,this._load=null,this.baseTexture=null}initFromArray(t,e){for(let s=0;s<this.length;s++)!t[s]||(t[s].castToBaseTexture?this.addBaseTextureAt(t[s].castToBaseTexture(),s):t[s]instanceof _s?this.addResourceAt(t[s],s):this.addResourceAt(fs(t[s],e),s))}dispose(){for(let t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(t,e){if(!this.items[e])throw new Error(`Index ${e} is out of bounds`);return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this}bind(t){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");super.bind(t);for(let e=0;e<this.length;e++)this.items[e].parentTextureArray=t,this.items[e].on("update",t.update,t)}unbind(t){super.unbind(t);for(let e=0;e<this.length;e++)this.items[e].parentTextureArray=null,this.items[e].off("update",t.update,t)}load(){if(this._load)return this._load;const t=this.items.map((t=>t.resource)).filter((t=>t)).map((t=>t.load()));return this._load=Promise.all(t).then((()=>{const{realWidth:t,realHeight:e}=this.items[0];return this.resize(t,e),Promise.resolve(this)})),this._load}}class hn extends on{constructor(t,e){const{width:s,height:i}=e||{};let r,n;Array.isArray(t)?(r=t,n=t.length):n=t,super(n,{width:s,height:i}),r&&this.initFromArray(r,e)}addBaseTextureAt(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this}bind(t){super.bind(t),t.target=l.TEXTURE_2D_ARRAY}upload(t,e,s){const{length:i,itemDirtyIds:r,items:n}=this,{gl:a}=t;s.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,s.internalFormat,this._width,this._height,i,0,e.format,s.type,null);for(let t=0;t<i;t++){const i=n[t];r[t]<i.dirtyId&&(r[t]=i.dirtyId,i.valid&&a.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,t,i.resource.width,i.resource.height,1,e.format,s.type,i.resource.source))}return!0}}class ln extends ki{constructor(t){super(t)}static test(t){const{OffscreenCanvas:e}=globalThis;return!!(e&&t instanceof e)||globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}}const un=class extends on{constructor(t,e){const{width:s,height:i,autoLoad:r,linkBaseTexture:n}=e||{};if(t&&t.length!==un.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:s,height:i});for(let t=0;t<un.SIDES;t++)this.items[t].target=l.TEXTURE_CUBE_MAP_POSITIVE_X+t;this.linkBaseTexture=!1!==n,t&&this.initFromArray(t,e),!1!==r&&this.load()}bind(t){super.bind(t),t.target=l.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,s){if(void 0===s&&(s=this.linkBaseTexture),!this.items[e])throw new Error(`Index ${e} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=l.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this}upload(t,e,s){const i=this.itemDirtyIds;for(let r=0;r<un.SIDES;r++){const n=this.items[r];(i[r]<n.dirtyId||s.dirtyId<e.dirtyId)&&(n.valid&&n.resource?(n.resource.upload(t,n,s),i[r]=n.dirtyId):i[r]<-1&&(t.gl.texImage2D(n.target,0,s.internalFormat,e.realWidth,e.realHeight,0,e.format,s.type,null),i[r]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===un.SIDES}};let dn=un;dn.SIDES=6;class cn extends ki{constructor(t,e){var s;let i,r;e=e||{},"string"==typeof t?(i=cn.EMPTY,r=t):(i=t,r=null),super(i),this.url=r,this.crossOrigin=null==(s=e.crossOrigin)||s,this.alphaMode="number"==typeof e.alphaMode?e.alphaMode:null,this._load=null,!1!==e.autoLoad&&this.load()}load(){return this._load||(this._load=new Promise((async(t,e)=>{if(null!==this.url)try{const e=await A.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const s=await e.blob();if(this.destroyed)return;const i=await createImageBitmap(s,{premultiplyAlpha:null===this.alphaMode||this.alphaMode===m.UNPACK?"premultiply":"none"});if(this.destroyed)return;this.source=i,this.update(),t(this)}catch(t){if(this.destroyed)return;e(t),this.onError.emit(t)}else t(this)}))),this._load}upload(t,e,s){return this.source instanceof ImageBitmap?("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),super.upload(t,e,s)):(this.load(),!1)}dispose(){this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&"undefined"!=typeof ImageBitmap&&("string"==typeof t||t instanceof ImageBitmap)}static get EMPTY(){var t;return cn._EMPTY=null!=(t=cn._EMPTY)?t:A.ADAPTER.createCanvas(0,0),cn._EMPTY}}const pn=class extends ki{constructor(t,e){e=e||{},super(A.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,!1!==e.autoLoad&&this.load()}load(){return this._load||(this._load=new Promise((t=>{if(this._resolve=()=>{this.resize(this.source.width,this.source.height),t(this)},pn.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}))),this._load}_loadSvg(){const t=new Image;ki.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{!this._resolve||(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,s=t.height;if(!e||!s)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let i=e*this.scale,r=s*this.scale;(this._overrideWidth||this._overrideHeight)&&(i=this._overrideWidth||this._overrideHeight/s*e,r=this._overrideHeight||this._overrideWidth/e*s),i=Math.round(i),r=Math.round(r);const n=this.source;n.width=i,n.height=r,n._pixiId=`canvas_${Ve()}`,n.getContext("2d").drawImage(t,0,0,e,s,0,0,i,r),this._resolve(),this._resolve=null}}static getSize(t){const e=pn.SVG_SIZE.exec(t),s={};return e&&(s[e[1]]=Math.round(parseFloat(e[3])),s[e[5]]=Math.round(parseFloat(e[7]))),s}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(t,e){return"svg"===e||"string"==typeof t&&t.startsWith("data:image/svg+xml")||"string"==typeof t&&pn.SVG_XML.test(t)}};let fn=pn;fn.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,fn.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const mn=class extends ki{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const s=document.createElement("video");s.setAttribute("preload","auto"),s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline",""),"string"==typeof t&&(t=[t]);const i=t[0].src||t[0];ki.crossOrigin(s,i,e.crossorigin);for(let e=0;e<t.length;++e){const i=document.createElement("source");let{src:r,mime:n}=t[e];r=r||t[e];const a=r.split("?").shift().toLowerCase(),o=a.slice(a.lastIndexOf(".")+1);n=n||mn.MIME_TYPES[o]||`video/${o}`,i.src=r,i.type=n,s.appendChild(i)}t=s}super(t),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==e.autoPlay,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),!1!==e.autoLoad&&this.load()}update(t=0){if(!this.destroyed){const t=$r.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t),(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}load(){if(this._load)return this._load;const t=this.source;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._load=new Promise((e=>{this.valid?e(this):(this._resolve=e,t.load())})),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&($r.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&($r.shared.remove(this.update,this),this._isConnectedToTicker=!1)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._isConnectedToTicker&&($r.shared.remove(this.update,this),this._isConnectedToTicker=!1);const t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?($r.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&($r.shared.add(this.update,this),this._isConnectedToTicker=!0))}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t)}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||mn.TYPES.includes(e)}};let _n=mn;_n.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],_n.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},ps.push(cn,Xi,ln,_n,fn,gs,dn,hn);class gn{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?Ls.EMPTY:((t=t||new Ls(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,e){const{a:s,b:i,c:r,d:n,tx:a,ty:o}=t,h=s*e.x+r*e.y+a,l=i*e.x+n*e.y+o;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)}addQuad(t){let e=this.minX,s=this.minY,i=this.maxX,r=this.maxY,n=t[0],a=t[1];e=n<e?n:e,s=a<s?a:s,i=n>i?n:i,r=a>r?a:r,n=t[2],a=t[3],e=n<e?n:e,s=a<s?a:s,i=n>i?n:i,r=a>r?a:r,n=t[4],a=t[5],e=n<e?n:e,s=a<s?a:s,i=n>i?n:i,r=a>r?a:r,n=t[6],a=t[7],e=n<e?n:e,s=a<s?a:s,i=n>i?n:i,r=a>r?a:r,this.minX=e,this.minY=s,this.maxX=i,this.maxY=r}addFrame(t,e,s,i,r){this.addFrameMatrix(t.worldTransform,e,s,i,r)}addFrameMatrix(t,e,s,i,r){const n=t.a,a=t.b,o=t.c,h=t.d,l=t.tx,u=t.ty;let d=this.minX,c=this.minY,p=this.maxX,f=this.maxY,m=n*e+o*s+l,_=a*e+h*s+u;d=m<d?m:d,c=_<c?_:c,p=m>p?m:p,f=_>f?_:f,m=n*i+o*s+l,_=a*i+h*s+u,d=m<d?m:d,c=_<c?_:c,p=m>p?m:p,f=_>f?_:f,m=n*e+o*r+l,_=a*e+h*r+u,d=m<d?m:d,c=_<c?_:c,p=m>p?m:p,f=_>f?_:f,m=n*i+o*r+l,_=a*i+h*r+u,d=m<d?m:d,c=_<c?_:c,p=m>p?m:p,f=_>f?_:f,this.minX=d,this.minY=c,this.maxX=p,this.maxY=f}addVertexData(t,e,s){let i=this.minX,r=this.minY,n=this.maxX,a=this.maxY;for(let o=e;o<s;o+=2){const e=t[o],s=t[o+1];i=e<i?e:i,r=s<r?s:r,n=e>n?e:n,a=s>a?s:a}this.minX=i,this.minY=r,this.maxX=n,this.maxY=a}addVertices(t,e,s,i){this.addVerticesMatrix(t.worldTransform,e,s,i)}addVerticesMatrix(t,e,s,i,r=0,n=r){const a=t.a,o=t.b,h=t.c,l=t.d,u=t.tx,d=t.ty;let c=this.minX,p=this.minY,f=this.maxX,m=this.maxY;for(let t=s;t<i;t+=2){const s=e[t],i=e[t+1],_=a*s+h*i+u,g=l*i+o*s+d;c=Math.min(c,_-r),f=Math.max(f,_+r),p=Math.min(p,g-n),m=Math.max(m,g+n)}this.minX=c,this.minY=p,this.maxX=f,this.maxY=m}addBounds(t){const e=this.minX,s=this.minY,i=this.maxX,r=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<s?t.minY:s,this.maxX=t.maxX>i?t.maxX:i,this.maxY=t.maxY>r?t.maxY:r}addBoundsMask(t,e){const s=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,r=t.maxX<e.maxX?t.maxX:e.maxX,n=t.maxY<e.maxY?t.maxY:e.maxY;if(s<=r&&i<=n){const t=this.minX,e=this.minY,a=this.maxX,o=this.maxY;this.minX=s<t?s:t,this.minY=i<e?i:e,this.maxX=r>a?r:a,this.maxY=n>o?n:o}}addBoundsMatrix(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,e){const s=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,r=t.maxX<e.x+e.width?t.maxX:e.x+e.width,n=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(s<=r&&i<=n){const t=this.minX,e=this.minY,a=this.maxX,o=this.maxY;this.minX=s<t?s:t,this.minY=i<e?i:e,this.maxX=r>a?r:a,this.maxY=n>o?n:o}}pad(t=0,e=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)}addFramePad(t,e,s,i,r,n){t-=r,e-=n,s+=r,i+=n,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>s?this.maxX:s,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>i?this.maxY:i}}class xn extends W{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Js,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new gn,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const e=Object.keys(t);for(let s=0;s<e.length;++s){const i=e[s];Object.defineProperty(xn.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new Ls),e=this._boundsRect),this._bounds.getRectangle(e)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new Ls),t=this._localBoundsRect),this._localBounds||(this._localBounds=new gn);const e=this.transform,s=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;const i=this._bounds,r=this._boundsID;this._bounds=this._localBounds;const n=this.getBounds(!1,t);return this.parent=s,this.transform=e,this._bounds=i,this._bounds.updateID+=this._boundsID-r,n}toGlobal(t,e,s=!1){return s||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)}toLocal(t,e,s,i){return e&&(t=e.toGlobal(t,s,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,s)}setParent(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t}removeFromParent(){var t;null==(t=this.parent)||t.removeChild(this)}setTransform(t=0,e=0,s=1,i=1,r=0,n=0,a=0,o=0,h=0){return this.position.x=t,this.position.y=e,this.scale.x=s||1,this.scale.y=i||1,this.rotation=r,this.skew.x=n,this.skew.y=a,this.pivot.x=o,this.pivot.y=h,this}destroy(t){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new vn),this.tempDisplayObjectParent}enableTempParent(){const t=this.parent;return this.parent=this._tempDisplayObjectParent,t}disableTempParent(t){this.parent=t}get x(){return this.position.x}set x(t){this.transform.position.x=t}get y(){return this.position.y}set y(t){this.transform.position.y=t}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(t){this.transform.position.copyFrom(t)}get scale(){return this.transform.scale}set scale(t){this.transform.scale.copyFrom(t)}get pivot(){return this.transform.pivot}set pivot(t){this.transform.pivot.copyFrom(t)}get skew(){return this.transform.skew}set skew(t){this.transform.skew.copyFrom(t)}get rotation(){return this.transform.rotation}set rotation(t){this.transform.rotation=t}get angle(){return this.transform.rotation*Ps}set angle(t){this.transform.rotation=t*Os}get zIndex(){return this._zIndex}set zIndex(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)}get worldVisible(){let t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}get mask(){return this._mask}set mask(t){if(this._mask!==t){if(this._mask){const t=this._mask.isMaskData?this._mask.maskObject:this._mask;t&&(t._maskRefCount--,0===t._maskRefCount&&(t.renderable=!0,t.isMask=!1))}if(this._mask=t,this._mask){const t=this._mask.isMaskData?this._mask.maskObject:this._mask;t&&(0===t._maskRefCount&&(t.renderable=!1,t.isMask=!0),t._maskRefCount++)}}}}class vn extends xn{constructor(){super(...arguments),this.sortDirty=null}}xn.prototype.displayObjectUpdateTransform=xn.prototype.updateTransform;const yn=new Hs;function Tn(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}const bn=class extends xn{constructor(){super(),this.children=[],this.sortableChildren=bn.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(t){}addChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.addChild(t[e]);else{const e=t[0];e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this)}return t[0]}addChildAt(t,e){if(e<0||e>this.children.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${this.children.length}`);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t}swapChildren(t,e){if(t===e)return;const s=this.getChildIndex(t),i=this.getChildIndex(e);this.children[s]=e,this.children[i]=t,this.onChildrenChange(s<i?s:i)}getChildIndex(t){const e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e}setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const s=this.getChildIndex(t);ke(this.children,s,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.removeChild(t[e]);else{const e=t[0],s=this.children.indexOf(e);if(-1===s)return null;e.parent=null,e.transform._parentID=-1,ke(this.children,s,1),this._boundsID++,this.onChildrenChange(s),e.emit("removed",this),this.emit("childRemoved",e,this,s)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,ke(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e}removeChildren(t=0,e=this.children.length){const s=t,i=e-s;let r;if(i>0&&i<=e){r=this.children.splice(s,i);for(let t=0;t<r.length;++t)r[t].parent=null,r[t].transform&&(r[t].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(let t=0;t<r.length;++t)r[t].emit("removed",this),this.emit("childRemoved",r[t],this,t);return r}if(0===i&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let t=!1;for(let e=0,s=this.children.length;e<s;++e){const s=this.children[e];s._lastSortedIndex=e,!t&&0!==s.zIndex&&(t=!0)}t&&this.children.length>1&&this.children.sort(Tn),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t<e;++t){const e=this.children[t];e.visible&&e.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let t=0;t<this.children.length;t++){const e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){const t=e._mask.isMaskData?e._mask.maskObject:e._mask;t?(t.calculateBounds(),this._bounds.addBoundsMask(e._bounds,t._bounds)):this._bounds.addBounds(e._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(t,e=!1){const s=super.getLocalBounds(t);if(!e)for(let t=0,e=this.children.length;t<e;++t){const e=this.children[t];e.visible&&e.updateTransform()}return s}_calculateBounds(){}_renderWithCulling(t){const e=t.renderTexture.sourceFrame;if(!(e.width>0&&e.height>0))return;let s,i;this.cullArea?(s=this.cullArea,i=this.worldTransform):this._render!==bn.prototype._render&&(s=this.getBounds(!0));const r=t.projection.transform;if(r&&(i?(i=yn.copyFrom(i),i.prepend(r)):i=r),s&&e.intersects(s,i))this._render(t);else if(this.cullArea)return;for(let e=0,s=this.children.length;e<s;++e){const s=this.children[e],i=s.cullable;s.cullable=i||!this.cullArea,s.render(t),s.cullable=i}}render(t){var e;if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||(null==(e=this.filters)?void 0:e.length))this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(let e=0,s=this.children.length;e<s;++e)this.children[e].render(t)}}renderAdvanced(t){var e,s,i;const r=this.filters,n=this._mask;if(r){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let t=0;t<r.length;t++)r[t].enabled&&this._enabledFilters.push(r[t])}const a=r&&(null==(e=this._enabledFilters)?void 0:e.length)||n&&(!n.isMaskData||n.enabled&&(n.autoDetect||n.type!==v.NONE));if(a&&t.batch.flush(),r&&(null==(s=this._enabledFilters)?void 0:s.length)&&t.filter.push(this,this._enabledFilters),n&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);for(let e=0,s=this.children.length;e<s;++e)this.children[e].render(t)}a&&t.batch.flush(),n&&t.mask.pop(this),r&&(null==(i=this._enabledFilters)?void 0:i.length)&&t.filter.pop()}_render(t){}destroy(t){super.destroy(),this.sortDirty=!1;const e="boolean"==typeof t?t:null==t?void 0:t.children,s=this.removeChildren(0,this.children.length);if(e)for(let e=0;e<s.length;++e)s[e].destroy(t)}get width(){return this.scale.x*this.getLocalBounds().width}set width(t){const e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}get height(){return this.scale.y*this.getLocalBounds().height}set height(t){const e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}};let En=bn;En.defaultSortableChildren=!1,En.prototype.containerUpdateTransform=En.prototype.updateTransform,Object.defineProperties(A,{SORTABLE_CHILDREN:{get:()=>En.defaultSortableChildren,set(t){Kt("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),En.defaultSortableChildren=t}}});const An=new Bs,Rn=new Uint16Array([0,1,2,0,2,3]);class Sn extends En{constructor(t){super(),this._anchor=new Zs(this._onAnchorUpdate,this,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new Ie(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=a.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=t||Wi.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=Rn,this.pluginName="batch",this.isSprite=!0,this._roundPixels=A.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Xe(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Xe(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const t=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===t._updateID)return;this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;const e=this.transform.worldTransform,s=e.a,i=e.b,r=e.c,n=e.d,a=e.tx,o=e.ty,h=this.vertexData,l=t.trim,u=t.orig,d=this._anchor;let c=0,p=0,f=0,m=0;if(l?(p=l.x-d._x*u.width,c=p+l.width,m=l.y-d._y*u.height,f=m+l.height):(p=-d._x*u.width,c=p+u.width,m=-d._y*u.height,f=m+u.height),h[0]=s*p+r*m+a,h[1]=n*m+i*p+o,h[2]=s*c+r*m+a,h[3]=n*m+i*c+o,h[4]=s*c+r*f+a,h[5]=n*f+i*c+o,h[6]=s*p+r*f+a,h[7]=n*f+i*p+o,this._roundPixels){const t=A.RESOLUTION;for(let e=0;e<h.length;++e)h[e]=Math.round(h[e]*t)/t}}calculateTrimmedVertices(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;const t=this._texture,e=this.vertexTrimmedData,s=t.orig,i=this._anchor,r=this.transform.worldTransform,n=r.a,a=r.b,o=r.c,h=r.d,l=r.tx,u=r.ty,d=-i._x*s.width,c=d+s.width,p=-i._y*s.height,f=p+s.height;e[0]=n*d+o*p+l,e[1]=h*p+a*d+u,e[2]=n*c+o*p+l,e[3]=h*p+a*c+u,e[4]=n*c+o*f+l,e[5]=h*f+a*c+u,e[6]=n*d+o*f+l,e[7]=h*f+a*d+u}_render(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)}_calculateBounds(){const t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))}getLocalBounds(t){return 0===this.children.length?(this._localBounds||(this._localBounds=new gn),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new Ls),t=this._localBoundsRect),this._localBounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,An);const e=this._texture.orig.width,s=this._texture.orig.height,i=-e*this.anchor.x;let r=0;return An.x>=i&&An.x<i+e&&(r=-s*this.anchor.y,An.y>=r&&An.y<r+s)}destroy(t){if(super.destroy(t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof t?t:null==t?void 0:t.texture){const e="boolean"==typeof t?t:null==t?void 0:t.baseTexture;this._texture.destroy(!!e)}this._texture=null}static from(t,e){const s=t instanceof Wi?t:Wi.from(t,e);return new Sn(s)}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){const e=Xe(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){const e=Xe(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}get anchor(){return this._anchor}set anchor(t){this._anchor.copyFrom(t)}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||Wi.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}const wn=new Hs;xn.prototype._cacheAsBitmap=!1,xn.prototype._cacheData=null,xn.prototype._cacheAsBitmapResolution=null,xn.prototype._cacheAsBitmapMultisample=null;class In{constructor(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}}Object.defineProperties(xn.prototype,{cacheAsBitmapResolution:{get(){return this._cacheAsBitmapResolution},set(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get(){return this._cacheAsBitmapMultisample},set(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get(){return this._cacheAsBitmap},set(t){if(this._cacheAsBitmap===t)return;let e;this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new In),e=this._cacheData,e.originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(e=this._cacheData,e.sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea)}}}),xn.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},xn.prototype._initCachedDisplayObject=function(t){var e,s,i;if(null!=(e=this._cacheData)&&e.sprite)return;const r=this.alpha;this.alpha=1,t.batch.flush();const n=this.getLocalBounds(null,!0).clone();if(null!=(s=this.filters)&&s.length){const t=this.filters[0].padding;n.pad(t)}n.ceil(A.RESOLUTION);const a=t.renderTexture.current,o=t.renderTexture.sourceFrame.clone(),h=t.renderTexture.destinationFrame.clone(),l=t.projection.transform,u=Yi.create({width:n.width,height:n.height,resolution:this.cacheAsBitmapResolution||t.resolution,multisample:null!=(i=this.cacheAsBitmapMultisample)?i:t.multisample}),d=`cacheAsBitmap_${Ve()}`;this._cacheData.textureCacheId=d,ys.addToCache(u.baseTexture,d),Wi.addToCache(u,d);const c=this.transform.localTransform.copyTo(wn).invert().translate(-n.x,-n.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:u,clear:!0,transform:c,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=l,t.renderTexture.bind(a,o,h),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;const p=new Sn(u);p.transform.worldTransform=this.transform.worldTransform,p.anchor.x=-n.x/n.width,p.anchor.y=-n.y/n.height,p.alpha=r,p._bounds=this._bounds,this._cacheData.sprite=p,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=p.containsPoint.bind(p)},xn.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},xn.prototype._initCachedDisplayObjectCanvas=function(t){var e;if(null!=(e=this._cacheData)&&e.sprite)return;const s=this.getLocalBounds(null,!0),i=this.alpha;this.alpha=1;const r=t.canvasContext.activeContext,n=t._projTransform;s.ceil(A.RESOLUTION);const a=Yi.create({width:s.width,height:s.height}),o=`cacheAsBitmap_${Ve()}`;this._cacheData.textureCacheId=o,ys.addToCache(a.baseTexture,o),Wi.addToCache(a,o);const h=wn;this.transform.localTransform.copyTo(h),h.invert(),h.tx-=s.x,h.ty-=s.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:a,clear:!0,transform:h,skipUpdateTransform:!1}),t.canvasContext.activeContext=r,t._projTransform=n,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i;const l=new Sn(a);l.transform.worldTransform=this.transform.worldTransform,l.anchor.x=-s.x/s.width,l.anchor.y=-s.y/s.height,l.alpha=i,l._bounds=this._bounds,this._cacheData.sprite=l,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=l.containsPoint.bind(l)},xn.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},xn.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},xn.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ys.removeFromCache(this._cacheData.textureCacheId),Wi.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},xn.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},xn.prototype.name=null,En.prototype.getChildByName=function(t,e){for(let e=0,s=this.children.length;e<s;e++)if(this.children[e].name===t)return this.children[e];if(e)for(let e=0,s=this.children.length;e<s;e++){const s=this.children[e];if(!s.getChildByName)continue;const i=s.getChildByName(t,!0);if(i)return i}return null},xn.prototype.getGlobalPosition=function(t=new Bs,e=!1){return this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};class Mn extends Pi{constructor(t=1){super(Qr,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n   gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n",{uAlpha:1}),this.alpha=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}const Cn={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},Dn=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{","    gl_FragColor = vec4(0.0);","    %blur%","}"].join("\n");class Pn extends Pi{constructor(t,e=8,s=4,i=Pi.defaultResolution,r=5){const n=function(t,e){const s=Math.ceil(t/2);let i,r="\n    attribute vec2 aVertexPosition;\n\n    uniform mat3 projectionMatrix;\n\n    uniform float strength;\n\n    varying vec2 vBlurTexCoords[%size%];\n\n    uniform vec4 inputSize;\n    uniform vec4 outputFrame;\n\n    vec4 filterVertexPosition( void )\n    {\n        vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n        return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n    }\n\n    vec2 filterTextureCoord( void )\n    {\n        return aVertexPosition * (outputFrame.zw * inputSize.zw);\n    }\n\n    void main(void)\n    {\n        gl_Position = filterVertexPosition();\n\n        vec2 textureCoord = filterTextureCoord();\n        %blur%\n    }",n="";i=e?"vBlurTexCoords[%index%] =  textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] =  textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let e=0;e<t;e++){let t=i.replace("%index%",e.toString());t=t.replace("%sampleIndex%",e-(s-1)+".0"),n+=t,n+="\n"}return r=r.replace("%blur%",n),r=r.replace("%size%",t.toString()),r}(r,t),a=function(t){const e=Cn[t],s=e.length;let i,r=Dn,n="";for(let r=0;r<t;r++){let a="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",r.toString());i=r,r>=s&&(i=t-r-1),a=a.replace("%value%",e[i].toString()),n+=a,n+="\n"}return r=r.replace("%blur%",n),r=r.replace("%size%",t.toString()),r}(r);super(n,a),this.horizontal=t,this.resolution=i,this._quality=0,this.quality=s,this.blur=e}apply(t,e,s,i){if(s?this.horizontal?this.uniforms.strength=1/s.width*(s.width/e.width):this.uniforms.strength=1/s.height*(s.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,s,i);else{const r=t.getFilterTexture(),n=t.renderer;let a=e,o=r;this.state.blend=!1,t.applyFilter(this,a,o,_.CLEAR);for(let e=1;e<this.passes-1;e++){t.bindAndClear(a,_.BLIT),this.uniforms.uSampler=o;const e=o;o=a,a=e,n.shader.bind(this),n.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,o,s,i),t.returnFilterTexture(r)}}get blur(){return this.strength}set blur(t){this.padding=1+2*Math.abs(t),this.strength=t}get quality(){return this._quality}set quality(t){this._quality=t,this.passes=t}}class On extends Pi{constructor(t=8,e=4,s=Pi.defaultResolution,i=5){super(),this._repeatEdgePixels=!1,this.blurXFilter=new Pn(!0,t,e,s,i),this.blurYFilter=new Pn(!1,t,e,s,i),this.resolution=s,this.quality=e,this.blur=t,this.repeatEdgePixels=!1}apply(t,e,s,i){const r=Math.abs(this.blurXFilter.strength),n=Math.abs(this.blurYFilter.strength);if(r&&n){const r=t.getFilterTexture();this.blurXFilter.apply(t,e,r,_.CLEAR),this.blurYFilter.apply(t,r,s,i),t.returnFilterTexture(r)}else n?this.blurYFilter.apply(t,e,s,i):this.blurXFilter.apply(t,e,s,i)}updatePadding(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))}get blur(){return this.blurXFilter.blur}set blur(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()}get quality(){return this.blurXFilter.quality}set quality(t){this.blurXFilter.quality=this.blurYFilter.quality=t}get blurX(){return this.blurXFilter.blur}set blurX(t){this.blurXFilter.blur=t,this.updatePadding()}get blurY(){return this.blurYFilter.blur}set blurY(t){this.blurYFilter.blur=t,this.updatePadding()}get blendMode(){return this.blurYFilter.blendMode}set blendMode(t){this.blurYFilter.blendMode=t}get repeatEdgePixels(){return this._repeatEdgePixels}set repeatEdgePixels(t){this._repeatEdgePixels=t,this.updatePadding()}}class Fn extends Pi{constructor(){const t={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(Jr,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n    vec4 c = texture2D(uSampler, vTextureCoord);\n\n    if (uAlpha == 0.0) {\n        gl_FragColor = c;\n        return;\n    }\n\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\n    if (c.a > 0.0) {\n      c.rgb /= c.a;\n    }\n\n    vec4 result;\n\n    result.r = (m[0] * c.r);\n        result.r += (m[1] * c.g);\n        result.r += (m[2] * c.b);\n        result.r += (m[3] * c.a);\n        result.r += m[4];\n\n    result.g = (m[5] * c.r);\n        result.g += (m[6] * c.g);\n        result.g += (m[7] * c.b);\n        result.g += (m[8] * c.a);\n        result.g += m[9];\n\n    result.b = (m[10] * c.r);\n       result.b += (m[11] * c.g);\n       result.b += (m[12] * c.b);\n       result.b += (m[13] * c.a);\n       result.b += m[14];\n\n    result.a = (m[15] * c.r);\n       result.a += (m[16] * c.g);\n       result.a += (m[17] * c.b);\n       result.a += (m[18] * c.a);\n       result.a += m[19];\n\n    vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n    // Premultiply alpha again.\n    rgb *= result.a;\n\n    gl_FragColor = vec4(rgb, result.a);\n}\n",t),this.alpha=1}_loadMatrix(t,e=!1){let s=t;e&&(this._multiply(s,this.uniforms.m,t),s=this._colorMatrix(s)),this.uniforms.m=s}_multiply(t,e,s){return t[0]=e[0]*s[0]+e[1]*s[5]+e[2]*s[10]+e[3]*s[15],t[1]=e[0]*s[1]+e[1]*s[6]+e[2]*s[11]+e[3]*s[16],t[2]=e[0]*s[2]+e[1]*s[7]+e[2]*s[12]+e[3]*s[17],t[3]=e[0]*s[3]+e[1]*s[8]+e[2]*s[13]+e[3]*s[18],t[4]=e[0]*s[4]+e[1]*s[9]+e[2]*s[14]+e[3]*s[19]+e[4],t[5]=e[5]*s[0]+e[6]*s[5]+e[7]*s[10]+e[8]*s[15],t[6]=e[5]*s[1]+e[6]*s[6]+e[7]*s[11]+e[8]*s[16],t[7]=e[5]*s[2]+e[6]*s[7]+e[7]*s[12]+e[8]*s[17],t[8]=e[5]*s[3]+e[6]*s[8]+e[7]*s[13]+e[8]*s[18],t[9]=e[5]*s[4]+e[6]*s[9]+e[7]*s[14]+e[8]*s[19]+e[9],t[10]=e[10]*s[0]+e[11]*s[5]+e[12]*s[10]+e[13]*s[15],t[11]=e[10]*s[1]+e[11]*s[6]+e[12]*s[11]+e[13]*s[16],t[12]=e[10]*s[2]+e[11]*s[7]+e[12]*s[12]+e[13]*s[17],t[13]=e[10]*s[3]+e[11]*s[8]+e[12]*s[13]+e[13]*s[18],t[14]=e[10]*s[4]+e[11]*s[9]+e[12]*s[14]+e[13]*s[19]+e[14],t[15]=e[15]*s[0]+e[16]*s[5]+e[17]*s[10]+e[18]*s[15],t[16]=e[15]*s[1]+e[16]*s[6]+e[17]*s[11]+e[18]*s[16],t[17]=e[15]*s[2]+e[16]*s[7]+e[17]*s[12]+e[18]*s[17],t[18]=e[15]*s[3]+e[16]*s[8]+e[17]*s[13]+e[18]*s[18],t[19]=e[15]*s[4]+e[16]*s[9]+e[17]*s[14]+e[18]*s[19]+e[19],t}_colorMatrix(t){const e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e}brightness(t,e){const s=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(s,e)}tint(t,e){const[s,i,r]=Ie.shared.setValue(t).toArray(),n=[s,0,0,0,0,0,i,0,0,0,0,0,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)}greyscale(t,e){const s=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(s,e)}blackAndWhite(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)}hue(t,e){t=(t||0)/180*Math.PI;const s=Math.cos(t),i=Math.sin(t),r=1/3,n=(0,Math.sqrt)(r),a=[s+(1-s)*r,r*(1-s)-n*i,r*(1-s)+n*i,0,0,r*(1-s)+n*i,s+r*(1-s),r*(1-s)-n*i,0,0,r*(1-s)-n*i,r*(1-s)+n*i,s+r*(1-s),0,0,0,0,0,1,0];this._loadMatrix(a,e)}contrast(t,e){const s=(t||0)+1,i=-.5*(s-1),r=[s,0,0,0,i,0,s,0,0,i,0,0,s,0,i,0,0,0,1,0];this._loadMatrix(r,e)}saturate(t=0,e){const s=2*t/3+1,i=-.5*(s-1),r=[s,i,i,0,0,i,s,i,0,0,i,i,s,0,0,0,0,0,1,0];this._loadMatrix(r,e)}desaturate(){this.saturate(-1)}negative(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)}sepia(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)}technicolor(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)}polaroid(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)}toBGR(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)}kodachrome(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)}browni(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)}vintage(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)}colorTone(t,e,s,i,r){t=t||.2,e=e||.15,s=s||16770432,i=i||3375104;const n=Ie.shared,[a,o,h]=n.setValue(s).toArray(),[l,u,d]=n.setValue(i).toArray(),c=[.3,.59,.11,0,0,a,o,h,t,0,l,u,d,e,0,a-l,o-u,h-d,0,0];this._loadMatrix(c,r)}night(t,e){const s=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(s,e)}predator(t,e){const s=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(s,e)}lsd(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)}reset(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)}get matrix(){return this.uniforms.m}set matrix(t){this.uniforms.m=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}Fn.prototype.grayscale=Fn.prototype.greyscale;class Bn extends Pi{constructor(t,e){const s=new Hs;t.renderable=!1,super("attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0)  ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n  vec4 map =  texture2D(mapSampler, vFilterCoord);\n\n  map -= 0.5;\n  map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n  gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:t._texture,filterMatrix:s,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=t,this.maskMatrix=s,null==e&&(e=20),this.scale=new Bs(e,e)}apply(t,e,s,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const r=this.maskSprite.worldTransform,n=Math.sqrt(r.a*r.a+r.b*r.b),a=Math.sqrt(r.c*r.c+r.d*r.d);0!==n&&0!==a&&(this.uniforms.rotation[0]=r.a/n,this.uniforms.rotation[1]=r.b/n,this.uniforms.rotation[2]=r.c/a,this.uniforms.rotation[3]=r.d/a),t.applyFilter(this,e,s,i)}get map(){return this.uniforms.mapSampler}set map(t){this.uniforms.mapSampler=t}}class Nn extends Pi{constructor(){super("\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n               out vec2 v_rgbNW, out vec2 v_rgbNE,\n               out vec2 v_rgbSW, out vec2 v_rgbSE,\n               out vec2 v_rgbM) {\n    v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n    v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n    v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n    v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n    v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n   gl_Position = filterVertexPosition();\n\n   vFragCoord = aVertexPosition * outputFrame.zw;\n\n   texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN   (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL   (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX     8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n          vec2 v_rgbNW, vec2 v_rgbNE,\n          vec2 v_rgbSW, vec2 v_rgbSE,\n          vec2 v_rgbM) {\n    vec4 color;\n    vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n    vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n    vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n    vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n    vec4 texColor = texture2D(tex, v_rgbM);\n    vec3 rgbM  = texColor.xyz;\n    vec3 luma = vec3(0.299, 0.587, 0.114);\n    float lumaNW = dot(rgbNW, luma);\n    float lumaNE = dot(rgbNE, luma);\n    float lumaSW = dot(rgbSW, luma);\n    float lumaSE = dot(rgbSE, luma);\n    float lumaM  = dot(rgbM,  luma);\n    float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n    float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n    mediump vec2 dir;\n    dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n    dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n    float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n                          (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n    float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n    dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n              max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n                  dir * rcpDirMin)) * inverseVP;\n\n    vec3 rgbA = 0.5 * (\n                       texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n                       texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n    vec3 rgbB = rgbA * 0.5 + 0.25 * (\n                                     texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n                                     texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n    float lumaB = dot(rgbB, luma);\n    if ((lumaB < lumaMin) || (lumaB > lumaMax))\n        color = vec4(rgbA, texColor.a);\n    else\n        color = vec4(rgbB, texColor.a);\n    return color;\n}\n\nvoid main() {\n\n      vec4 color;\n\n      color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n      gl_FragColor = color;\n}\n')}}class Ln extends Pi{constructor(t=.5,e=Math.random()){super(Jr,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n    return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n    vec4 color = texture2D(uSampler, vTextureCoord);\n    float randomValue = rand(gl_FragCoord.xy * uSeed);\n    float diff = (randomValue - 0.5) * uNoise;\n\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\n    if (color.a > 0.0) {\n        color.rgb /= color.a;\n    }\n\n    color.r += diff;\n    color.g += diff;\n    color.b += diff;\n\n    // Premultiply alpha again.\n    color.rgb *= color.a;\n\n    gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0}),this.noise=t,this.seed=e}get noise(){return this.uniforms.uNoise}set noise(t){this.uniforms.uNoise=t}get seed(){return this.uniforms.uSeed}set seed(t){this.uniforms.uSeed=t}}const Gn={AlphaFilter:Mn,BlurFilter:On,BlurFilterPass:Pn,ColorMatrixFilter:Fn,DisplacementFilter:Bn,FXAAFilter:Nn,NoiseFilter:Ln};Object.entries(Gn).forEach((([t,e])=>{Object.defineProperty(Gn,t,{get:()=>e})}));const Un=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this.tickerAdded||!this.domElement||($r.system.add(this.tickerUpdate,this,Wr.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){!this.tickerAdded||($r.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove)return void(this._didMove=!1);const t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}tickerUpdate(t){this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())}};class kn{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=kn.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Bs,this.page=new Bs,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,s){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,s,i,r){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class Xn extends kn{constructor(){super(...arguments),this.client=new Bs,this.movement=new Bs,this.offset=new Bs,this.global=new Bs,this.screen=new Bs}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,s){return t.worldTransform.applyInverse(s||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,s,i,r,n,a,o,h,l,u,d,c,p,f){throw new Error("Method not implemented.")}}class Hn extends Xn{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class Vn extends Xn{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}Vn.DOM_DELTA_PIXEL=0,Vn.DOM_DELTA_LINE=1,Vn.DOM_DELTA_PAGE=2;const Wn=new Bs,Yn=new Bs;class jn{constructor(t){this.dispatch=new W,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];if(e)for(let s=0,i=e.length;s<i;s++)e[s].fn(t);else console.warn(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){Un.pauseUpdate=!0;const s=this[this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive"](this.rootTarget,this.rootTarget.eventMode,Wn.set(t,e),this.hitTestFn,this.hitPruneFn);return s&&s[0]}propagate(t,e){if(!t.target)return;const s=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let i=0,r=s.length-1;i<r;i++)if(t.currentTarget=s[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let i=s.length-2;i>=0;i--)if(t.currentTarget=s[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,s=this._allInteractiveElements){if(0===s.length)return;t.eventPhase=t.BUBBLING_PHASE;const i=Array.isArray(e)?e:[e];for(let e=s.length-1;e>=0;e--)i.forEach((i=>{t.currentTarget=s[e],this.notifyTarget(t,i)}))}propagationPath(t){const e=[t];for(let s=0;s<2048&&t!==this.rootTarget;s++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,s,i,r,n=!1){let a=!1;if(this._interactivePrune(t))return null;if(("dynamic"===t.eventMode||"dynamic"===e)&&(Un.pauseUpdate=!1),t.interactiveChildren&&t.children){const o=t.children;for(let h=o.length-1;h>=0;h--){const l=o[h],u=this.hitTestMoveRecursive(l,this._isInteractive(e)?e:l.eventMode,s,i,r,n||r(t,s));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const e=t.isInteractive();(u.length>0||e)&&(e&&this._allInteractiveElements.push(t),u.push(t)),0===this._hitElements.length&&(this._hitElements=u),a=!0}}}const o=this._isInteractive(e),h=t.isInteractive();return h&&h&&this._allInteractiveElements.push(t),n||this._hitElements.length>0?null:a?this._hitElements:o&&!r(t,s)&&i(t,s)?h?[t]:[]:null}hitTestRecursive(t,e,s,i,r){if(this._interactivePrune(t)||r(t,s))return null;if(("dynamic"===t.eventMode||"dynamic"===e)&&(Un.pauseUpdate=!1),t.interactiveChildren&&t.children){const n=t.children;for(let a=n.length-1;a>=0;a--){const o=n[a],h=this.hitTestRecursive(o,this._isInteractive(e)?e:o.eventMode,s,i,r);if(h){if(h.length>0&&!h[h.length-1].parent)continue;const e=t.isInteractive();return(h.length>0||e)&&h.push(t),h}}}const n=this._isInteractive(e),a=t.isInteractive();return n&&i(t,s)?a?[t]:[]:null}_isInteractive(t){return"static"===t||"dynamic"===t}_interactivePrune(t){return!(t&&!t.isMask&&t.visible&&t.renderable&&"none"!==t.eventMode&&("passive"!==t.eventMode||t.interactiveChildren)&&!t.isMask)}hitPruneFn(t,e){var s;if(t.hitArea&&(t.worldTransform.applyInverse(e,Yn),!t.hitArea.contains(Yn.x,Yn.y)))return!0;if(t._mask){const i=t._mask.isMaskData?t._mask.maskObject:t._mask;if(i&&(null==(s=i.containsPoint)||!s.call(i,e)))return!0}return!1}hitTestFn(t,e){return"passive"!==t.eventMode&&(!!t.hitArea||!!t.containsPoint&&t.containsPoint(e))}notifyTarget(t,e){var s,i;const r=`on${e=null!=e?e:t.type}`;null==(i=(s=t.currentTarget)[r])||i.call(s,t);const n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof Hn))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)this.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){const t=2===e.button;this.dispatchEvent(e,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){var e,s,i;if(!(t instanceof Hn))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const r=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const n="mouse"===r.pointerType||"pen"===r.pointerType,a=this.trackingData(t.pointerId),o=this.findMountedTarget(a.overTargets);if((null==(e=a.overTargets)?void 0:e.length)>0&&o!==r.target){const e="mousemove"===t.type?"mouseout":"pointerout",s=this.createPointerEvent(t,e,o);if(this.dispatchEvent(s,"pointerout"),n&&this.dispatchEvent(s,"mouseout"),!r.composedPath().includes(o)){const e=this.createPointerEvent(t,"pointerleave",o);for(e.eventPhase=e.AT_TARGET;e.target&&!r.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),n&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(s)}if(o!==r.target){const e="mousemove"===t.type?"mouseover":"pointerover",s=this.clonePointerEvent(r,e);this.dispatchEvent(s,"pointerover"),n&&this.dispatchEvent(s,"mouseover");let i=null==o?void 0:o.parent;for(;i&&i!==this.rootTarget.parent&&i!==r.target;)i=i.parent;if(!i||i===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==o&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),n&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(s)}const h=[],l=null==(s=this.enableGlobalMoveEvents)||s;this.moveOnAll?h.push("pointermove"):this.dispatchEvent(r,"pointermove"),l&&h.push("globalpointermove"),"touch"===r.pointerType&&(this.moveOnAll?h.splice(1,0,"touchmove"):this.dispatchEvent(r,"touchmove"),l&&h.push("globaltouchmove")),n&&(this.moveOnAll?h.splice(1,0,"mousemove"):this.dispatchEvent(r,"mousemove"),l&&h.push("globalmousemove"),this.cursor=null==(i=r.target)?void 0:i.cursor),h.length>0&&this.all(r,h),this._allInteractiveElements.length=0,this._hitElements.length=0,a.overTargets=r.composedPath(),this.freeEvent(r)}mapPointerOver(t){var e;if(!(t instanceof Hn))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const s=this.trackingData(t.pointerId),i=this.createPointerEvent(t),r="mouse"===i.pointerType||"pen"===i.pointerType;this.dispatchEvent(i,"pointerover"),r&&this.dispatchEvent(i,"mouseover"),"mouse"===i.pointerType&&(this.cursor=null==(e=i.target)?void 0:e.cursor);const n=this.clonePointerEvent(i,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),r&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;s.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(n)}mapPointerOut(t){if(!(t instanceof Hn))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId);if(e.overTargets){const s="mouse"===t.pointerType||"pen"===t.pointerType,i=this.findMountedTarget(e.overTargets),r=this.createPointerEvent(t,"pointerout",i);this.dispatchEvent(r),s&&this.dispatchEvent(r,"mouseout");const n=this.createPointerEvent(t,"pointerleave",i);for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),s&&this.notifyTarget(n,"mouseleave"),n.target=n.target.parent;e.overTargets=null,this.freeEvent(r),this.freeEvent(n)}this.cursor=null}mapPointerUp(t){if(!(t instanceof Hn))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=performance.now(),s=this.createPointerEvent(t);if(this.dispatchEvent(s,"pointerup"),"touch"===s.pointerType)this.dispatchEvent(s,"touchend");else if("mouse"===s.pointerType||"pen"===s.pointerType){const t=2===s.button;this.dispatchEvent(s,t?"rightup":"mouseup")}const i=this.trackingData(t.pointerId),r=this.findMountedTarget(i.pressTargetsByButton[t.button]);let n=r;if(r&&!s.composedPath().includes(r)){let e=r;for(;e&&!s.composedPath().includes(e);){if(s.currentTarget=e,this.notifyTarget(s,"pointerupoutside"),"touch"===s.pointerType)this.notifyTarget(s,"touchendoutside");else if("mouse"===s.pointerType||"pen"===s.pointerType){const t=2===s.button;this.notifyTarget(s,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete i.pressTargetsByButton[t.button],n=e}if(n){const r=this.clonePointerEvent(s,"click");r.target=n,r.path=null,i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:r.target,timeStamp:e});const a=i.clicksByButton[t.button];if(a.target===r.target&&e-a.timeStamp<200?++a.clickCount:a.clickCount=1,a.target=r.target,a.timeStamp=e,r.detail=a.clickCount,"mouse"===r.pointerType){const t=2===r.button;this.dispatchEvent(r,t?"rightclick":"click")}else"touch"===r.pointerType&&this.dispatchEvent(r,"tap");this.dispatchEvent(r,"pointertap"),this.freeEvent(r)}this.freeEvent(s)}mapPointerUpOutside(t){if(!(t instanceof Hn))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),s=this.findMountedTarget(e.pressTargetsByButton[t.button]),i=this.createPointerEvent(t);if(s){let r=s;for(;r;)i.currentTarget=r,this.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?this.notifyTarget(i,"touchendoutside"):("mouse"===i.pointerType||"pen"===i.pointerType)&&this.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),r=r.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(i)}mapWheel(t){if(!(t instanceof Vn))return void console.warn("EventBoundary cannot map a non-wheel event as a wheel event");const e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let s=1;s<t.length&&t[s].parent===e;s++)e=t[s];return e}createPointerEvent(t,e,s){var i;const r=this.allocateEvent(Hn);return this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=null!=(i=null!=s?s:this.hitTest(r.global.x,r.global.y))?i:this._hitElements[0],"string"==typeof e&&(r.type=e),r}createWheelEvent(t){const e=this.allocateEvent(Vn);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){const s=this.allocateEvent(Hn);return s.nativeEvent=t.nativeEvent,s.originalEvent=t.originalEvent,this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.target=t.target,s.path=t.composedPath().slice(),s.type=null!=e?e:s.type,s}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof Hn&&e instanceof Hn&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof Xn&&e instanceof Xn&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}notifyListeners(t,e){const s=t.currentTarget._events[e];if(s&&t.currentTarget.isInteractive())if("fn"in s)s.once&&t.currentTarget.removeListener(e,s.fn,void 0,!0),s.fn.call(s.context,t);else for(let i=0,r=s.length;i<r&&!t.propagationImmediatelyStopped;i++)s[i].once&&t.currentTarget.removeListener(e,s[i].fn,void 0,!0),s[i].fn.call(s[i].context,t)}}const $n={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},qn=class{constructor(t){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new jn(null),Un.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new Hn(null),this.rootWheelEvent=new Vn(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy(bt({},qn.defaultEventFeatures),{set:(t,e,s)=>("globalMove"===e&&(this.rootBoundary.enableGlobalMoveEvents=s),t[e]=s,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){var e,s;const{view:i,resolution:r}=this.renderer;this.setTargetElement(i),this.resolution=r,qn._defaultEventMode=null!=(e=t.eventMode)?e:"auto",Object.assign(this.features,null!=(s=t.eventFeatures)?s:{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(t){t=t||"default";let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this.currentCursor===t)return;this.currentCursor=t;const s=this.cursorStyles[t];if(s)switch(typeof s){case"string":e&&(this.domElement.style.cursor=s);break;case"function":s(t);break;case"object":e&&Object.assign(this.domElement.style,s)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this.rootPointerEvent}onPointerDown(t){if(!this.features.click||(this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.supportsTouchEvents&&"touch"===t.pointerType))return;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,s=e.length;t<s;t++){const s=e[t],i=this.bootstrapEvent(this.rootPointerEvent,s);this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}onPointerMove(t){if(!this.features.move||(this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.supportsTouchEvents&&"touch"===t.pointerType))return;Un.pointerMoved();const e=this.normalizeToPointerData(t);for(let t=0,s=e.length;t<s;t++){const s=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}onPointerUp(t){if(!this.features.click||(this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.supportsTouchEvents&&"touch"===t.pointerType))return;let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);const s=e!==this.domElement?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,e=i.length;t<e;t++){const e=this.bootstrapEvent(this.rootPointerEvent,i[t]);e.type+=s,this.rootBoundary.mapEvent(e)}this.setCursor(this.rootBoundary.cursor)}onPointerOverOut(t){if(!this.features.click||(this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.supportsTouchEvents&&"touch"===t.pointerType))return;const e=this.normalizeToPointerData(t);for(let t=0,s=e.length;t<s;t++){const s=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;const e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this.removeEvents(),this.domElement=t,Un.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;Un.addTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,!0),this.domElement.addEventListener("pointerdown",this.onPointerDown,!0),this.domElement.addEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this.onPointerOverOut,!0),globalThis.addEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,!0),this.domElement.addEventListener("mousedown",this.onPointerDown,!0),this.domElement.addEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this.onPointerOverOut,!0),globalThis.addEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this.onPointerDown,!0),this.domElement.addEventListener("touchend",this.onPointerUp,!0),this.domElement.addEventListener("touchmove",this.onPointerMove,!0)),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;Un.removeTickerListener();const t=this.domElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this.onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,!0),this.domElement.removeEventListener("mousedown",this.onPointerDown,!0),this.domElement.removeEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this.onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this.onPointerDown,!0),this.domElement.removeEventListener("touchend",this.onPointerUp,!0),this.domElement.removeEventListener("touchmove",this.onPointerMove,!0)),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapPositionToPoint(t,e,s){let i;i=this.domElement.parentElement?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0};const r=1/this.resolution;t.x=(e-i.left)*(this.domElement.width/i.width)*r,t.y=(s-i.top)*(this.domElement.height/i.height)*r}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let s=0,i=t.changedTouches.length;s<i;s++){const i=t.changedTouches[s];void 0===i.button&&(i.button=0),void 0===i.buttons&&(i.buttons=1),void 0===i.isPrimary&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===i.width&&(i.width=i.radiusX||1),void 0===i.height&&(i.height=i.radiusY||1),void 0===i.tiltX&&(i.tiltX=0),void 0===i.tiltY&&(i.tiltY=0),void 0===i.pointerType&&(i.pointerType="touch"),void 0===i.pointerId&&(i.pointerId=i.identifier||0),void 0===i.pressure&&(i.pressure=i.force||.5),void 0===i.twist&&(i.twist=0),void 0===i.tangentialPressure&&(i.tangentialPressure=0),void 0===i.layerX&&(i.layerX=i.offsetX=i.clientX),void 0===i.layerY&&(i.layerY=i.offsetY=i.clientY),i.isNormalized=!0,i.type=t.type,e.push(i)}else if(globalThis.MouseEvent&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof globalThis.PointerEvent))e.push(t);else{const s=t;void 0===s.isPrimary&&(s.isPrimary=!0),void 0===s.width&&(s.width=1),void 0===s.height&&(s.height=1),void 0===s.tiltX&&(s.tiltX=0),void 0===s.tiltY&&(s.tiltY=0),void 0===s.pointerType&&(s.pointerType="mouse"),void 0===s.pointerId&&(s.pointerId=1),void 0===s.pressure&&(s.pressure=.5),void 0===s.twist&&(s.twist=0),void 0===s.tangentialPressure&&(s.tangentialPressure=0),s.isNormalized=!0,e.push(s)}return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;return this.transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=$n[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};let Kn=qn;function Zn(t){return"dynamic"===t||"static"===t}Kn.extension={name:"events",type:[rs.RendererSystem,rs.CanvasRendererSystem]},Kn.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0},os.add(Kn);const Qn={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){var t;return null!=(t=this._internalInteractive)?t:Zn(Kn.defaultEventMode)},set interactive(t){Kt("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=t,this.eventMode=t?"static":"auto"},_internalEventMode:void 0,get eventMode(){var t;return null!=(t=this._internalEventMode)?t:Kn.defaultEventMode},set eventMode(t){this._internalInteractive=Zn(t),this._internalEventMode=t},isInteractive(){return"static"===this.eventMode||"dynamic"===this.eventMode},interactiveChildren:!0,hitArea:null,addEventListener(t,e,s){const i="function"==typeof e?void 0:e;t="boolean"==typeof s&&s||"object"==typeof s&&s.capture?`${t}capture`:t,e="function"==typeof e?e:e.handleEvent,this.on(t,e,i)},removeEventListener(t,e,s){const i="function"==typeof e?void 0:e;t="boolean"==typeof s&&s||"object"==typeof s&&s.capture?`${t}capture`:t,e="function"==typeof e?e:e.handleEvent,this.off(t,e,i)},dispatchEvent(t){if(!(t instanceof kn))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};xn.mixin(Qn);const Jn={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};xn.mixin(Jn);class ta{constructor(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(H.tablet||H.phone)&&this.createTouchHook();const e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex=2..toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",(()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()})),document.body.appendChild(t),this._hookDiv=t}destroyTouchHook(){!this._hookDiv||(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null==(t=this.renderer.view.parentNode)||t.appendChild(this.div))}deactivate(){var t;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null==(t=this.div.parentNode)||t.removeChild(this.div))}updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&t.isInteractive()&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);const e=t.children;if(e)for(let t=0;t<e.length;t++)this.updateAccessibleObjects(e[t])}update(){const t=performance.now();if(H.android.device&&t<this.androidUpdateCount||(this.androidUpdateCount=t+this.androidUpdateFrequency,!this.renderer.renderingToScreen))return;this.renderer.lastObjectRendered&&this.updateAccessibleObjects(this.renderer.lastObjectRendered);const{x:e,y:s,width:i,height:r}=this.renderer.view.getBoundingClientRect(),{width:n,height:a,resolution:o}=this.renderer,h=i/n*o,l=r/a*o;let u=this.div;u.style.left=`${e}px`,u.style.top=`${s}px`,u.style.width=`${n}px`,u.style.height=`${a}px`;for(let t=0;t<this.children.length;t++){const e=this.children[t];if(e.renderId!==this.renderId)e._accessibleActive=!1,ke(this.children,t,1),this.div.removeChild(e._accessibleDiv),this.pool.push(e._accessibleDiv),e._accessibleDiv=null,t--;else{u=e._accessibleDiv;let t=e.hitArea;const s=e.worldTransform;e.hitArea?(u.style.left=(s.tx+t.x*s.a)*h+"px",u.style.top=(s.ty+t.y*s.d)*l+"px",u.style.width=t.width*s.a*h+"px",u.style.height=t.height*s.d*l+"px"):(t=e.getBounds(),this.capHitArea(t),u.style.left=t.x*h+"px",u.style.top=t.y*l+"px",u.style.width=t.width*h+"px",u.style.height=t.height*l+"px",u.title!==e.accessibleTitle&&null!==e.accessibleTitle&&(u.title=e.accessibleTitle),u.getAttribute("aria-label")!==e.accessibleHint&&null!==e.accessibleHint&&u.setAttribute("aria-label",e.accessibleHint)),(e.accessibleTitle!==u.title||e.tabIndex!==u.tabIndex)&&(u.title=e.accessibleTitle,u.tabIndex=e.tabIndex,this.debug&&this.updateDebugHTML(u))}}this.renderId++}updateDebugHTML(t){t.innerHTML=`type: ${t.type}</br> title : ${t.title}</br> tabIndex: ${t.tabIndex}`}capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:e,height:s}=this.renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>s&&(t.height=s-t.y)}addChild(t){let e=this.pool.pop();e||(e=document.createElement("button"),e.style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:(!t.accessibleHint||null===t.accessibleHint)&&(e.title=`displayObject ${t.tabIndex}`),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex}_dispatchEvent(t,e){const{displayObject:s}=t.target,i=this.renderer.events.rootBoundary,r=Object.assign(new kn(i),{target:s});i.rootTarget=this.renderer.lastObjectRendered,e.forEach((t=>i.dispatchEvent(r,t)))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){9===t.keyCode&&this.activate()}_onMouseMove(t){0===t.movementX&&0===t.movementY||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}ta.extension={name:"accessibility",type:[rs.RendererPlugin,rs.CanvasRendererPlugin]},os.add(ta);const ea=class{constructor(t){this.stage=new En,t=Object.assign({forceCanvas:!1},t),this.renderer=Zr(t),ea._plugins.forEach((e=>{e.init.call(this,t)}))}render(){this.renderer.render(this.stage)}get view(){return this.renderer.view}get screen(){return this.renderer.screen}destroy(t,e){const s=ea._plugins.slice(0);s.reverse(),s.forEach((t=>{t.destroy.call(this)})),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};let sa=ea;sa._plugins=[],os.handleByList(rs.Application,sa._plugins);class ia{static init(t){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{!this._resizeTo||(this.cancelResize(),this._resizeId=requestAnimationFrame((()=>this.resize())))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;let t,e;if(this.cancelResize(),this._resizeTo===globalThis.window)t=globalThis.innerWidth,e=globalThis.innerHeight;else{const{clientWidth:s,clientHeight:i}=this._resizeTo;t=s,e=i}this.renderer.resize(t,e),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}ia.extension=rs.Application,os.add(ia);const ra={loader:rs.LoadParser,resolver:rs.ResolveParser,cache:rs.CacheParser,detection:rs.DetectionParser};os.handle(rs.Asset,(t=>{const e=t.ref;Object.entries(ra).filter((([t])=>!!e[t])).forEach((([t,s])=>{var i;return os.add(Object.assign(e[t],{extension:null!=(i=e[t].extension)?i:s}))}))}),(t=>{const e=t.ref;Object.keys(ra).filter((t=>!!e[t])).forEach((t=>os.remove(e[t])))}));class na{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach((t=>{this._assetList.push(t)})),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let s=0;s<e;s++)t.push(this._assetList.pop());await this._loader.load(t),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(t){this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())}}function aa(t,e){if(Array.isArray(e)){for(const s of e)if(t.startsWith(`data:${s}`))return!0;return!1}return t.startsWith(`data:${e}`)}function oa(t,e){const s=t.split("?")[0],i=$t.extname(s).toLowerCase();return Array.isArray(e)?e.includes(i):i===e}const ha=(t,e)=>(Array.isArray(t)||(t=[t]),e?t.map((t=>"string"==typeof t?e(t):t)):t),la=(t,e)=>{const s=e.split("?")[1];return s&&(t+=`?${s}`),t};function ua(t,e,s,i,r){const n=e[s];for(let a=0;a<n.length;a++){const o=n[a];s<e.length-1?ua(t.replace(i[s],o),e,s+1,i,r):r.push(t.replace(i[s],o))}}function da(t){const e=t.match(/\{(.*?)\}/g),s=[];if(e){const i=[];e.forEach((t=>{const e=t.substring(1,t.length-1).split(",");i.push(e)})),ua(t,i,0,e,s)}else s.push(t);return s}const ca=t=>!Array.isArray(t);const pa=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||console.warn(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const s=ha(t);let i;for(let t=0;t<this.parsers.length;t++){const r=this.parsers[t];if(r.test(e)){i=r.getCacheableAssets(s,e);break}}i||(i={},s.forEach((t=>{i[t]=e})));const r=Object.keys(i),n={cacheKeys:r,keys:s};if(s.forEach((t=>{this._cacheMap.set(t,n)})),r.forEach((t=>{this._cache.has(t)&&this._cache.get(t)!==e&&console.warn("[Cache] already has key:",t),this._cache.set(t,i[t])})),e instanceof Wi){const t=e;s.forEach((e=>{t.baseTexture!==Wi.EMPTY.baseTexture&&ys.addToCache(t.baseTexture,e),Wi.addToCache(t,e)}))}}remove(t){if(this._cacheMap.get(t),!this._cacheMap.has(t))return void console.warn(`[Assets] Asset id ${t} was not found in the Cache`);const e=this._cacheMap.get(t);e.cacheKeys.forEach((t=>{this._cache.delete(t)})),e.keys.forEach((t=>{this._cacheMap.delete(t)}))}get parsers(){return this._parsers}};class fa{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,s)=>(this._parsersValidated=!1,t[e]=s,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const s={promise:null,parser:null};return s.promise=(async()=>{var i,r;let n=null,a=null;if(e.loadParser&&(a=this._parserHash[e.loadParser],a||console.warn(`[Assets] specified load parser "${e.loadParser}" not found while loading ${t}`)),!a){for(let s=0;s<this.parsers.length;s++){const r=this.parsers[s];if(r.load&&(null==(i=r.test)?void 0:i.call(r,t,e,this))){a=r;break}}if(!a)return console.warn(`[Assets] ${t} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}n=await a.load(t,e,this),s.parser=a;for(let t=0;t<this.parsers.length;t++){const i=this.parsers[t];i.parse&&i.parse&&await(null==(r=i.testParse)?void 0:r.call(i,n,e,this))&&(n=await i.parse(n,e,this)||n,s.parser=i)}return n})(),s}async load(t,e){this._parsersValidated||this._validateParsers();let s=0;const i={},r=ca(t),n=ha(t,(t=>({src:t}))),a=n.length,o=n.map((async t=>{const r=$t.toAbsolute(t.src);if(!i[t.src])try{this.promiseCache[r]||(this.promiseCache[r]=this._getLoadPromiseAndParser(r,t)),i[t.src]=await this.promiseCache[r].promise,e&&e(++s/a)}catch(e){throw delete this.promiseCache[r],delete i[t.src],new Error(`[Loader.load] Failed to load ${r}.\n${e}`)}}));return await Promise.all(o),r?i[n[0].src]:i}async unload(t){const e=ha(t,(t=>({src:t}))).map((async t=>{var e,s;const i=$t.toAbsolute(t.src),r=this.promiseCache[i];if(r){const n=await r.promise;null==(s=null==(e=r.parser)?void 0:e.unload)||s.call(e,n,t,this),delete this.promiseCache[i]}}));await Promise.all(e)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter((t=>t.name)).reduce(((t,e)=>(t[e.name]&&console.warn(`[Assets] loadParser name conflict "${e.name}"`),Qi(bt({},t),{[e.name]:e}))),{})}}var ma=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(ma||{});const _a={extension:{type:rs.LoadParser,priority:ma.Low},name:"loadJson",test:t=>aa(t,"application/json")||oa(t,".json"),load:async t=>await(await A.ADAPTER.fetch(t)).json()};os.add(_a);const ga={name:"loadTxt",extension:{type:rs.LoadParser,priority:ma.Low},test:t=>aa(t,"text/plain")||oa(t,".txt"),load:async t=>await(await A.ADAPTER.fetch(t)).text()};os.add(ga);const xa=["normal","bold","100","200","300","400","500","600","700","800","900"],va=[".ttf",".otf",".woff",".woff2"],ya=["font/ttf","font/otf","font/woff","font/woff2"],Ta=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function ba(t){const e=$t.extname(t),s=$t.basename(t,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map((t=>t.charAt(0).toUpperCase()+t.slice(1)));let i=s.length>0;for(const t of s)if(!t.match(Ta)){i=!1;break}let r=s.join(" ");return i||(r=`"${r.replace(/[\\"]/g,"\\$&")}"`),r}const Ea={extension:{type:rs.LoadParser,priority:ma.Low},name:"loadWebFont",test:t=>aa(t,ya)||oa(t,va),async load(t,e){var s,i,r,n,a,o;const h=A.ADAPTER.getFontFaceSet();if(h){const l=[],u=null!=(i=null==(s=e.data)?void 0:s.family)?i:ba(t),d=null!=(a=null==(n=null==(r=e.data)?void 0:r.weights)?void 0:n.filter((t=>xa.includes(t))))?a:["normal"],c=null!=(o=e.data)?o:{};for(let e=0;e<d.length;e++){const s=d[e],i=new FontFace(u,`url(${encodeURI(t)})`,Qi(bt({},c),{weight:s}));await i.load(),h.add(i),l.push(i)}return 1===l.length?l[0]:l}return console.warn("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(t){(Array.isArray(t)?t:[t]).forEach((t=>A.ADAPTER.getFontFaceSet().delete(t)))}};os.add(Ea);let Aa,Ra=0;const Sa={id:"checkImageBitmap",code:"\n    async function checkImageBitmap()\n    {\n        try\n        {\n            if (typeof createImageBitmap !== 'function') return false;\n\n            const response = await fetch('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=');\n            const imageBlob =  await response.blob();\n            const imageBitmap = await createImageBitmap(imageBlob);\n\n            return imageBitmap.width === 1 && imageBitmap.height === 1;\n        }\n        catch (e)\n        {\n            return false;\n        }\n    }\n    checkImageBitmap().then((result) => { self.postMessage(result); });\n    "},wa={id:"loadImageBitmap",code:"\n    async function loadImageBitmap(url)\n    {\n        const response = await fetch(url);\n\n        if (!response.ok)\n        {\n            throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: `\n                + `${response.status} ${response.statusText}`);\n        }\n\n        const imageBlob =  await response.blob();\n        const imageBitmap = await createImageBitmap(imageBlob);\n\n        return imageBitmap;\n    }\n    self.onmessage = async (event) =>\n    {\n        try\n        {\n            const imageBitmap = await loadImageBitmap(event.data.data[0]);\n\n            self.postMessage({\n                data: imageBitmap,\n                uuid: event.data.uuid,\n                id: event.data.id,\n            }, [imageBitmap]);\n        }\n        catch(e)\n        {\n            self.postMessage({\n                error: e,\n                uuid: event.data.uuid,\n                id: event.data.id,\n            });\n        }\n    };"};let Ia;const Ma=new class{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return void 0!==this._isImageBitmapSupported||(this._isImageBitmapSupported=new Promise((t=>{const e=URL.createObjectURL(new Blob([Sa.code],{type:"application/javascript"})),s=new Worker(e);s.addEventListener("message",(i=>{s.terminate(),URL.revokeObjectURL(e),t(i.data)}))}))),this._isImageBitmapSupported}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){void 0===Aa&&(Aa=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers<Aa&&(Ia||(Ia=URL.createObjectURL(new Blob([wa.code],{type:"application/javascript"}))),this._createdWorkers++,t=new Worker(Ia),t.addEventListener("message",(t=>{this.complete(t.data),this.returnWorker(t.target),this.next()}))),t}returnWorker(t){this.workerPool.push(t)}complete(t){void 0!==t.error?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();const s=new Promise(((s,i)=>{this.queue.push({id:t,arguments:e,resolve:s,reject:i})}));return this.next(),s}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const e=this.queue.pop(),s=e.id;this.resolveHash[Ra]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:Ra++,id:s})}};function Ca(t,e,s){const i=new Wi(t);return i.baseTexture.on("dispose",(()=>{delete e.promiseCache[s]})),i}const Da=[".jpeg",".jpg",".png",".webp",".avif"],Pa=["image/jpeg","image/png","image/webp","image/avif"];async function Oa(t){const e=await A.ADAPTER.fetch(t);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${t}: ${e.status} ${e.statusText}`);const s=await e.blob();return await createImageBitmap(s)}const Fa={name:"loadTextures",extension:{type:rs.LoadParser,priority:ma.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test:t=>aa(t,Pa)||oa(t,Da),async load(t,e,s){let i=null;i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await Ma.isImageBitmapSupported()?await Ma.loadImageBitmap(t):await Oa(t):await new Promise((e=>{i=new Image,i.crossOrigin=this.config.crossOrigin,i.src=t,i.complete?e(i):i.onload=()=>{e(i)}}));const r=new ys(i,bt({resolution:ss(t)},e.data));return r.resource.src=t,Ca(r,s,t)},unload(t){t.destroy(!0)}};os.add(Fa);const Ba={extension:{type:rs.LoadParser,priority:ma.High},name:"loadSVG",test:t=>aa(t,"image/svg+xml")||oa(t,".svg"),testParse:async t=>fn.test(t),async parse(t,e,s){var i;const r=new fn(t,null==(i=null==e?void 0:e.data)?void 0:i.resourceOptions);await r.load();const n=new ys(r,bt({resolution:ss(t)},null==e?void 0:e.data));return n.resource.src=t,Ca(n,s,t)},load:async(t,e)=>(await A.ADAPTER.fetch(t)).text(),unload:Fa.unload};os.add(Ba);class Na{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){var e,s,i;if(this._bundleIdConnector=null!=(e=t.connector)?e:this._bundleIdConnector,this._createBundleAssetId=null!=(s=t.createBundleAssetId)?s:this._createBundleAssetId,this._extractAssetIdFromBundle=null!=(i=t.extractAssetIdFromBundle)?i:this._extractAssetIdFromBundle,"bar"!==this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar")))throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach((t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))})),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if("string"==typeof t)this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach((t=>{this.addBundle(t.name,t.assets)}))}addBundle(t,e){const s=[];Array.isArray(e)?e.forEach((e=>{if("string"==typeof e.name){const i=this._createBundleAssetId(t,e.name);s.push(i),this.add([e.name,i],e.srcs,e.data)}else{const i=e.name.map((e=>this._createBundleAssetId(t,e)));i.forEach((t=>{s.push(t)})),this.add([...e.name,...i],e.srcs)}})):Object.keys(e).forEach((i=>{s.push(this._createBundleAssetId(t,i)),this.add([i,this._createBundleAssetId(t,i)],e[i])})),this._bundles[t]=s}add(t,e,s){const i=ha(t);i.forEach((t=>{this.hasKey(t)&&console.warn(`[Resolver] already has key: ${t} overwriting`)})),Array.isArray(e)||(e="string"==typeof e?da(e):[e]);const r=e.map((t=>{var e;let r=t;if("string"==typeof t){let e=!1;for(let s=0;s<this._parsers.length;s++){const i=this._parsers[s];if(i.test(t)){r=i.parse(t),e=!0;break}}e||(r={src:t})}return r.format||(r.format=r.src.split(".").pop()),r.alias||(r.alias=i),(this._basePath||this._rootPath)&&(r.src=$t.toAbsolute(r.src,this._basePath,this._rootPath)),r.src=this._appendDefaultSearchParams(r.src),r.data=null!=(e=r.data)?e:s,r}));i.forEach((t=>{this._assetMap[t]=r}))}resolveBundle(t){const e=ca(t);t=ha(t);const s={};return t.forEach((t=>{const e=this._bundles[t];if(e){const i=this.resolve(e),r={};for(const e in i){const s=i[e];r[this._extractAssetIdFromBundle(t,e)]=s}s[t]=r}})),e?s[t[0]]:s}resolveUrl(t){const e=this.resolve(t);if("string"!=typeof t){const t={};for(const s in e)t[s]=e[s].src;return t}return e.src}resolve(t){const e=ca(t);t=ha(t);const s={};return t.forEach((t=>{var e;if(!this._resolverHash[t])if(this._assetMap[t]){let s=this._assetMap[t];const i=this._getPreferredOrder(s),r=s[0];null==i||i.priority.forEach((t=>{i.params[t].forEach((e=>{const i=s.filter((s=>!!s[t]&&s[t]===e));i.length&&(s=i)}))})),this._resolverHash[t]=null!=(e=s[0])?e:r}else{let e=t;(this._basePath||this._rootPath)&&(e=$t.toAbsolute(e,this._basePath,this._rootPath)),e=this._appendDefaultSearchParams(e),this._resolverHash[t]={src:e}}s[t]=this._resolverHash[t]})),e?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const e=t[0],s=this._preferredOrder.find((t=>t.params.format.includes(e.format)));if(s)return s}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;return`${t}${/\?/.test(t)?"&":"?"}${this._defaultSearchParams}`}}class La{constructor(){this._detections=[],this._initialized=!1,this.resolver=new Na,this.loader=new fa,this.cache=pa,this._backgroundLoader=new na(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){var e,s,i,r;if(this._initialized)return void console.warn("[Assets]AssetManager already initialized, did you load before calling this Asset.init()?");if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let e=t.manifest;"string"==typeof e&&(e=await this.load(e)),this.resolver.addManifest(e)}const n=null!=(s=null==(e=t.texturePreference)?void 0:e.resolution)?s:1,a="number"==typeof n?[n]:n;let o=[];if(null!=(i=t.texturePreference)&&i.format){const e=null==(r=t.texturePreference)?void 0:r.format;o="string"==typeof e?[e]:e;for(const t of this._detections)await t.test()||(o=await t.remove(o))}else for(const t of this._detections)await t.test()&&(o=await t.add(o));this.resolver.prefer({params:{format:o,resolution:a}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,s){this.resolver.add(t,e,s)}async load(t,e){this._initialized||await this.init();const s=ca(t),i=ha(t).map((t=>"string"!=typeof t?(this.resolver.add(t.src,t),t.src):(this.resolver.hasKey(t)||this.resolver.add(t,t),t))),r=this.resolver.resolve(i),n=await this._mapLoadToResolve(r,e);return s?n[i[0]]:n}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let s=!1;"string"==typeof t&&(s=!0,t=[t]);const i=this.resolver.resolveBundle(t),r={},n=Object.keys(i);let a=0,o=0;const h=()=>{null==e||e(++a/o)},l=n.map((t=>{const e=i[t];return o+=Object.keys(e).length,this._mapLoadToResolve(e,h).then((e=>{r[t]=e}))}));return await Promise.all(l),s?r[t[0]]:r}async backgroundLoad(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach((t=>{this._backgroundLoader.add(Object.values(t))}))}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if("string"==typeof t)return pa.get(t);const e={};for(let s=0;s<t.length;s++)e[s]=pa.get(t[s]);return e}async _mapLoadToResolve(t,e){const s=Object.values(t),i=Object.keys(t);this._backgroundLoader.active=!1;const r=await this.loader.load(s,e);this._backgroundLoader.active=!0;const n={};return s.forEach(((t,e)=>{const s=r[t.src],a=[t.src];t.alias&&a.push(...t.alias),n[i[e]]=s,pa.set(a,s)})),n}async unload(t){this._initialized||await this.init();const e=ha(t).map((t=>"string"!=typeof t?t.src:t)),s=this.resolver.resolve(e);await this._unloadFromResolved(s)}async unloadBundle(t){this._initialized||await this.init(),t=ha(t);const e=this.resolver.resolveBundle(t),s=Object.keys(e).map((t=>this._unloadFromResolved(e[t])));await Promise.all(s)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach((t=>{pa.remove(t.src)})),await this.loader.unload(e)}get detections(){return this._detections}get preferWorkers(){return Fa.config.preferWorkers}set preferWorkers(t){Kt("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach((e=>{!e.config||Object.keys(e.config).filter((e=>e in t)).forEach((s=>{e.config[s]=t[s]}))}))}}const Ga=new La;os.handleByList(rs.LoadParser,Ga.loader.parsers).handleByList(rs.ResolveParser,Ga.resolver.parsers).handleByList(rs.CacheParser,Ga.cache.parsers).handleByList(rs.DetectionParser,Ga.detections);const Ua={extension:rs.CacheParser,test:t=>Array.isArray(t)&&t.every((t=>t instanceof Wi)),getCacheableAssets:(t,e)=>{const s={};return t.forEach((t=>{e.forEach(((e,i)=>{s[t+(0===i?"":i+1)]=e}))})),s}};os.add(Ua);const ka={extension:{type:rs.DetectionParser,priority:1},test:async()=>{if(!globalThis.createImageBitmap)return!1;const t=await A.ADAPTER.fetch("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=").then((t=>t.blob()));return createImageBitmap(t).then((()=>!0),(()=>!1))},add:async t=>[...t,"avif"],remove:async t=>t.filter((t=>"avif"!==t))};os.add(ka);const Xa={extension:{type:rs.DetectionParser,priority:0},test:async()=>{if(!globalThis.createImageBitmap)return!1;const t=await A.ADAPTER.fetch("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=").then((t=>t.blob()));return createImageBitmap(t).then((()=>!0),(()=>!1))},add:async t=>[...t,"webp"],remove:async t=>t.filter((t=>"webp"!==t))};os.add(Xa);const Ha=["png","jpg","jpeg"],Va={extension:{type:rs.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async t=>[...t,...Ha],remove:async t=>t.filter((t=>!Ha.includes(t)))};os.add(Va);const za={extension:rs.ResolveParser,test:Fa.test,parse:t=>{var e,s;return{resolution:parseFloat(null!=(s=null==(e=A.RETINA_PREFIX.exec(t))?void 0:e[1])?s:"1"),format:t.split(".").pop(),src:t}}};os.add(za);var Wa=(t=>(t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t))(Wa||{});const Ya={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35986:1,34798:1,37808:1};let ja,$a;function qa(){$a={s3tc:ja.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:ja.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:ja.getExtension("WEBGL_compressed_texture_etc"),etc1:ja.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:ja.getExtension("WEBGL_compressed_texture_pvrtc")||ja.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:ja.getExtension("WEBGL_compressed_texture_atc"),astc:ja.getExtension("WEBGL_compressed_texture_astc")}}const Ka={extension:{type:rs.DetectionParser,priority:2},test:async()=>{const t=A.ADAPTER.createCanvas().getContext("webgl");return t?(ja=t,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async t=>{$a||qa();const e=[];for(const t in $a)!$a[t]||e.push(t);return[...e,...t]},remove:async t=>($a||qa(),t.filter((t=>!(t in $a))))};os.add(Ka);class Za extends gs{constructor(t,e={width:1,height:1,autoLoad:!0}){let s,i;"string"==typeof t?(s=t,i=new Uint8Array):(s=null,i=t),super(i,e),this.origin=s,this.buffer=i?new hs(i):null,this._load=null,this.loaded=!1,null!==this.origin&&!1!==e.autoLoad&&this.load(),null===this.origin&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load||(this._load=fetch(this.origin).then((t=>t.blob())).then((t=>t.arrayBuffer())).then((t=>(this.data=new Uint32Array(t),this.buffer=new hs(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)))),this._load}}class Qa extends Za{constructor(t,e){super(t,e),this.format=e.format,this.levels=e.levels||1,this._width=e.width,this._height=e.height,this._extension=Qa._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||Qa._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,s){const i=t.gl;if(!t.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;for(let t=0,e=this.levels;t<e;t++){const{levelID:e,levelWidth:s,levelHeight:r,levelBuffer:n}=this._levelBuffers[t];i.compressedTexImage2D(i.TEXTURE_2D,e,this.format,s,r,0,n)}return!0}onBlobLoaded(){this._levelBuffers=Qa._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")}static _createLevelBuffers(t,e,s,i,r,n,a){const o=new Array(s);let h=t.byteOffset,l=n,u=a,d=l+i-1&~(i-1),c=u+r-1&~(r-1),p=d*c*Ya[e];for(let n=0;n<s;n++)o[n]={levelID:n,levelWidth:s>1?l:d,levelHeight:s>1?u:c,levelBuffer:new Uint8Array(t.buffer,h,p)},h+=p,l=l>>1||1,u=u>>1||1,d=l+i-1&~(i-1),c=u+r-1&~(r-1),p=d*c*Ya[e];return o}}const Ja=124,to=3,eo=4,so=7,io=19,ro=2,no=0,ao=1,oo=2,ho=3;var lo=(t=>(t[t.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",t[t.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",t[t.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",t[t.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",t[t.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",t[t.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",t[t.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",t[t.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",t[t.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",t[t.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",t[t.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",t[t.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",t[t.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",t[t.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",t[t.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",t[t.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",t[t.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",t[t.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",t[t.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",t[t.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",t[t.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",t[t.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",t[t.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",t[t.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",t[t.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",t[t.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",t[t.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",t[t.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",t[t.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",t[t.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",t[t.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",t[t.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",t[t.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",t[t.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",t[t.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",t[t.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",t[t.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",t[t.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",t[t.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",t[t.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",t[t.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",t[t.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",t[t.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",t[t.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",t[t.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",t[t.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",t[t.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",t[t.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",t[t.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",t[t.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",t[t.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",t[t.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",t[t.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",t[t.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",t[t.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",t[t.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",t[t.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",t[t.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",t[t.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",t[t.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",t[t.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",t[t.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",t[t.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",t[t.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",t[t.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",t[t.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",t[t.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",t[t.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",t[t.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",t[t.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",t[t.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",t[t.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",t[t.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",t[t.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",t[t.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",t[t.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",t[t.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",t[t.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",t[t.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",t[t.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",t[t.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",t[t.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",t[t.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",t[t.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",t[t.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",t[t.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",t[t.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",t[t.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",t[t.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",t[t.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",t[t.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",t[t.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",t[t.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",t[t.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",t[t.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",t[t.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",t[t.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",t[t.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",t[t.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",t[t.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",t[t.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",t[t.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",t[t.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",t[t.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",t[t.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",t[t.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",t[t.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",t[t.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",t[t.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",t[t.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",t[t.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",t[t.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",t[t.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",t[t.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",t[t.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",t[t.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",t[t.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",t[t.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",t[t.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",t[t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",t[t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",t[t.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT",t))(lo||{}),uo=(t=>(t[t.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",t[t.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",t[t.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D",t))(uo||{});const co={827611204:Wa.COMPRESSED_RGBA_S3TC_DXT1_EXT,861165636:Wa.COMPRESSED_RGBA_S3TC_DXT3_EXT,894720068:Wa.COMPRESSED_RGBA_S3TC_DXT5_EXT},po={70:Wa.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Wa.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Wa.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Wa.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Wa.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Wa.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Wa.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Wa.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Wa.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT};function fo(t){const e=new Uint32Array(t);if(542327876!==e[0])throw new Error("Invalid DDS file magic word");const s=new Uint32Array(t,0,Ja/Uint32Array.BYTES_PER_ELEMENT),i=s[to],r=s[eo],n=s[so],a=new Uint32Array(t,io*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),o=a[1];if(4&o){const s=a[ro];if(808540228!==s){const e=co[s],a=new Uint8Array(t,128);return[new Qa(a,{format:e,width:r,height:i,levels:n})]}const o=128,h=new Uint32Array(e.buffer,o,20/Uint32Array.BYTES_PER_ELEMENT),l=h[no],u=h[ao],d=h[oo],c=h[ho],p=po[l];if(void 0===p)throw new Error(`DDSParser cannot parse texture data with DXGI format ${l}`);if(4===d)throw new Error("DDSParser does not support cubemap textures");if(6===u)throw new Error("DDSParser does not supported 3D texture data");const f=new Array,m=148;if(1===c)f.push(new Uint8Array(t,m));else{const e=Ya[p];let s=0,a=r,o=i;for(let t=0;t<n;t++){s+=Math.max(1,a+3&-4)*Math.max(1,o+3&-4)*e,a>>>=1,o>>>=1}let h=m;for(let e=0;e<c;e++)f.push(new Uint8Array(t,h,s)),h+=s}return f.map((t=>new Qa(t,{format:p,width:r,height:i,levels:n})))}throw 64&o?new Error("DDSParser does not support uncompressed texture data."):512&o?new Error("DDSParser does not supported YUV uncompressed texture data."):131072&o?new Error("DDSParser does not support single-channel (lumninance) texture data!"):2&o?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const mo=[171,75,84,88,32,49,49,187,13,10,26,10],_o=12,go=16,xo=24,vo=28,yo=36,To=40,bo=44,Eo=48,Ao=52,Ro=56,So=60,wo=64,Io={[u.UNSIGNED_BYTE]:1,[u.UNSIGNED_SHORT]:2,[u.INT]:4,[u.UNSIGNED_INT]:4,[u.FLOAT]:4,[u.HALF_FLOAT]:8},Mo={[h.RGBA]:4,[h.RGB]:3,[h.RG]:2,[h.RED]:1,[h.LUMINANCE]:1,[h.LUMINANCE_ALPHA]:2,[h.ALPHA]:1},Co={[u.UNSIGNED_SHORT_4_4_4_4]:2,[u.UNSIGNED_SHORT_5_5_5_1]:2,[u.UNSIGNED_SHORT_5_6_5]:2};function Do(t,e,s=!1){const i=new DataView(e);if(!function(t,e){for(let s=0;s<mo.length;s++)if(e.getUint8(s)!==mo[s])return console.error(`${t} is not a valid *.ktx file!`),!1;return!0}(t,i))return null;const r=67305985===i.getUint32(_o,!0),n=i.getUint32(go,r),a=i.getUint32(xo,r),o=i.getUint32(vo,r),h=i.getUint32(yo,r),l=i.getUint32(To,r)||1,d=i.getUint32(bo,r)||1,c=i.getUint32(Eo,r)||1,p=i.getUint32(Ao,r),f=i.getUint32(Ro,r),m=i.getUint32(So,r);if(0===l||1!==d)throw new Error("Only 2D textures are supported");if(1!==p)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(1!==c)throw new Error("WebGL does not support array textures");const _=h+3&-4,g=l+3&-4,x=new Array(c);let v,y=h*l;if(0===n&&(y=_*g),v=0!==n?Io[n]?Io[n]*Mo[a]:Co[n]:Ya[o],void 0===v)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const T=s?function(t,e,s){const i=new Map;let r=0;for(;r<e;){const n=t.getUint32(wo+r,s),a=wo+r+4,o=3-(n+3)%4;if(0===n||n>e-r){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h<n&&0!==t.getUint8(a+h);h++);if(-1===h){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}const l=(new TextDecoder).decode(new Uint8Array(t.buffer,a,h)),u=new DataView(t.buffer,a+h+1,n-h-1);i.set(l,u),r+=4+n+o}return i}(i,m,r):null;let b=y*v,E=h,A=l,R=_,S=g,w=wo+m;for(let t=0;t<f;t++){const s=i.getUint32(w,r);let a=w+4;for(let s=0;s<c;s++){let i=x[s];i||(i=x[s]=new Array(f)),i[t]={levelID:t,levelWidth:f>1||0!==n?E:R,levelHeight:f>1||0!==n?A:S,levelBuffer:new Uint8Array(e,a,b)},a+=b}w+=s+4,w=w%4!=0?w+4-w%4:w,E=E>>1||1,A=A>>1||1,R=E+4-1&-4,S=A+4-1&-4,b=R*S*v}return 0!==n?{uncompressed:x.map((t=>{let e=t[0].levelBuffer,s=!1;return n===u.FLOAT?e=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):n===u.UNSIGNED_INT?(s=!0,e=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):n===u.INT&&(s=!0,e=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new gs(e,{width:t[0].levelWidth,height:t[0].levelHeight}),type:n,format:s?Po(a):a}})),kvData:T}:{compressed:x.map((t=>new Qa(null,{format:o,width:h,height:l,levels:f,levelBuffers:t}))),kvData:T}}function Po(t){switch(t){case h.RGBA:return h.RGBA_INTEGER;case h.RGB:return h.RGB_INTEGER;case h.RG:return h.RG_INTEGER;case h.RED:return h.RED_INTEGER;default:return t}}const Oo={extension:{type:rs.LoadParser,priority:ma.High},name:"loadDDS",test:t=>oa(t,".dds"),async load(t,e,s){const i=fo(await(await A.ADAPTER.fetch(t)).arrayBuffer()).map((i=>Ca(new ys(i,bt({mipmap:f.OFF,alphaMode:m.NO_PREMULTIPLIED_ALPHA,resolution:ss(t)},e.data)),s,t)));return 1===i.length?i[0]:i},unload(t){Array.isArray(t)?t.forEach((t=>t.destroy(!0))):t.destroy(!0)}};os.add(Oo);const Fo={extension:{type:rs.LoadParser,priority:ma.High},name:"loadKTX",test:t=>oa(t,".ktx"),async load(t,e,s){const i=await(await A.ADAPTER.fetch(t)).arrayBuffer(),{compressed:r,uncompressed:n,kvData:a}=Do(t,i),o=null!=r?r:n,h=bt({mipmap:f.OFF,alphaMode:m.NO_PREMULTIPLIED_ALPHA,resolution:ss(t)},e.data),l=o.map((e=>{o===n&&Object.assign(h,{type:e.type,format:e.format});const i=new ys(e,h);return i.ktxKeyValueData=a,Ca(i,s,t)}));return 1===l.length?l[0]:l},unload(t){Array.isArray(t)?t.forEach((t=>t.destroy(!0))):t.destroy(!0)}};os.add(Fo);const Bo={extension:rs.ResolveParser,test:t=>{const e=t.split("?")[0].split(".").pop();return["basis","ktx","dds"].includes(e)},parse:t=>{var e,s,i,r;if("ktx"===t.split("?")[0].split(".").pop()){const i=[".s3tc.ktx",".s3tc_sRGB.ktx",".etc.ktx",".etc1.ktx",".pvrt.ktx",".atc.ktx",".astc.ktx"];if(i.some((e=>t.endsWith(e))))return{resolution:parseFloat(null!=(s=null==(e=A.RETINA_PREFIX.exec(t))?void 0:e[1])?s:"1"),format:i.find((e=>t.endsWith(e))),src:t}}return{resolution:parseFloat(null!=(r=null==(i=A.RETINA_PREFIX.exec(t))?void 0:i[1])?r:"1"),format:t.split(".").pop(),src:t}}};os.add(Bo);const No=new Ls,Lo=class{constructor(t){this.renderer=t}async image(t,e,s){const i=new Image;return i.src=await this.base64(t,e,s),i}async base64(t,e,s){const i=this.canvas(t);if(void 0!==i.toBlob)return new Promise(((t,r)=>{i.toBlob((e=>{if(!e)return void r(new Error("ICanvas.toBlob failed!"));const s=new FileReader;s.onload=()=>t(s.result),s.onerror=r,s.readAsDataURL(e)}),e,s)}));if(void 0!==i.toDataURL)return i.toDataURL(e,s);if(void 0!==i.convertToBlob){const t=await i.convertToBlob({type:e,quality:s});return new Promise(((e,s)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=s,i.readAsDataURL(t)}))}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t,e){const{pixels:s,width:i,height:r,flipY:n}=this._rawPixels(t,e);n&&Lo._flipY(s,i,r),Lo._unpremultiplyAlpha(s);const a=new qe(i,r,1),o=new ImageData(new Uint8ClampedArray(s.buffer),i,r);return a.context.putImageData(o,0,0),a.canvas}pixels(t,e){const{pixels:s,width:i,height:r,flipY:n}=this._rawPixels(t,e);return n&&Lo._flipY(s,i,r),Lo._unpremultiplyAlpha(s),s}_rawPixels(t,e){const s=this.renderer;if(!s)throw new Error("The Extract has already been destroyed");let i,r,n=!1,a=!1;if(t&&(t instanceof Yi?r=t:(r=s.generateTexture(t,{resolution:s.resolution,multisample:s.multisample}),a=!0)),r){if(i=r.baseTexture.resolution,e=null!=e?e:r.frame,n=!1,!a){s.renderTexture.bind(r);const t=r.framebuffer.glFramebuffers[s.CONTEXT_UID];t.blitFramebuffer&&s.framebuffer.bind(t.blitFramebuffer)}}else i=s.resolution,e||((e=No).width=s.width/i,e.height=s.height/i),n=!0,s.renderTexture.bind();const o=Math.round(e.width*i),h=Math.round(e.height*i),l=new Uint8Array(4*o*h),u=s.gl;return u.readPixels(Math.round(e.x*i),Math.round(e.y*i),o,h,u.RGBA,u.UNSIGNED_BYTE,l),a&&(null==r||r.destroy(!0)),{pixels:l,width:o,height:h,flipY:n}}destroy(){this.renderer=null}static _flipY(t,e,s){const i=e<<2,r=s>>1,n=new Uint8Array(i);for(let e=0;e<r;e++){const r=e*i,a=(s-e-1)*i;n.set(t.subarray(r,r+i)),t.copyWithin(r,a,a+i),t.set(n,a)}}static _unpremultiplyAlpha(t){t instanceof Uint8ClampedArray&&(t=new Uint8Array(t.buffer));const e=t.length;for(let s=0;s<e;s+=4){const e=t[s+3];if(0!==e){const i=255.001/e;t[s]=t[s]*i+.5,t[s+1]=t[s+1]*i+.5,t[s+2]=t[s+2]*i+.5}}}};let Go=Lo;Go.extension={name:"extract",type:rs.RendererSystem},os.add(Go);const Uo={build(t){const e=t.points;let s,i,r,n,a,o;if(t.type===Fs.CIRC){const e=t.shape;s=e.x,i=e.y,a=o=e.radius,r=n=0}else if(t.type===Fs.ELIP){const e=t.shape;s=e.x,i=e.y,a=e.width,o=e.height,r=n=0}else{const e=t.shape,h=e.width/2,l=e.height/2;s=e.x+h,i=e.y+l,a=o=Math.max(0,Math.min(e.radius,Math.min(h,l))),r=h-a,n=l-o}if(!(a>=0&&o>=0&&r>=0&&n>=0))return void(e.length=0);const h=Math.ceil(2.3*Math.sqrt(a+o)),l=8*h+(r?4:0)+(n?4:0);if(e.length=l,0===l)return;if(0===h)return e.length=8,e[0]=e[6]=s+r,e[1]=e[3]=i+n,e[2]=e[4]=s-r,void(e[5]=e[7]=i-n);let u=0,d=4*h+(r?2:0)+2,c=d,p=l;{const t=r+a,o=n,h=s+t,l=s-t,f=i+o;if(e[u++]=h,e[u++]=f,e[--d]=f,e[--d]=l,n){const t=i-o;e[c++]=l,e[c++]=t,e[--p]=t,e[--p]=h}}for(let t=1;t<h;t++){const l=Math.PI/2*(t/h),f=r+Math.cos(l)*a,m=n+Math.sin(l)*o,_=s+f,g=s-f,x=i+m,v=i-m;e[u++]=_,e[u++]=x,e[--d]=x,e[--d]=g,e[c++]=g,e[c++]=v,e[--p]=v,e[--p]=_}{const t=n+o,a=s+r,h=s-r,l=i+t,d=i-t;e[u++]=a,e[u++]=l,e[--p]=d,e[--p]=a,r&&(e[u++]=h,e[u++]=l,e[--p]=d,e[--p]=h)}},triangulate(t,e){const s=t.points,i=e.points,r=e.indices;if(0===s.length)return;let n=i.length/2;const a=n;let o,h;if(t.type!==Fs.RREC){const e=t.shape;o=e.x,h=e.y}else{const e=t.shape;o=e.x+e.width/2,h=e.y+e.height/2}const l=t.matrix;i.push(t.matrix?l.a*o+l.c*h+l.tx:o,t.matrix?l.b*o+l.d*h+l.ty:h),n++,i.push(s[0],s[1]);for(let t=2;t<s.length;t+=2)i.push(s[t],s[t+1]),r.push(n++,a,n);r.push(a+1,a,n)}};function ko(t,e=!1){const s=t.length;if(s<6)return;let i=0;for(let e=0,r=t[s-2],n=t[s-1];e<s;e+=2){const s=t[e],a=t[e+1];i+=(s-r)*(a+n),r=s,n=a}if(!e&&i>0||e&&i<=0){const e=s/2;for(let i=e+e%2;i<s;i+=2){const e=s-i-2,r=s-i-1,n=i,a=i+1;[t[e],t[n]]=[t[n],t[e]],[t[r],t[a]]=[t[a],t[r]]}}}const Xo={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let s=t.points;const i=t.holes,r=e.points,n=e.indices;if(s.length>=6){ko(s,!1);const t=[];for(let e=0;e<i.length;e++){const r=i[e];ko(r.points,!0),t.push(s.length/2),s=s.concat(r.points)}const e=Y(s,t,2);if(!e)return;const a=r.length/2;for(let t=0;t<e.length;t+=3)n.push(e[t]+a),n.push(e[t+1]+a),n.push(e[t+2]+a);for(let t=0;t<s.length;t++)r.push(s[t])}}},Ho={build(t){const e=t.shape,s=e.x,i=e.y,r=e.width,n=e.height,a=t.points;a.length=0,r>=0&&n>=0&&a.push(s,i,s+r,i,s+r,i+n,s,i+n)},triangulate(t,e){const s=t.points,i=e.points;if(0===s.length)return;const r=i.length/2;i.push(s[0],s[1],s[2],s[3],s[6],s[7],s[4],s[5]),e.indices.push(r,r+1,r+2,r+1,r+2,r+3)}},Vo={build(t){Uo.build(t)},triangulate(t,e){Uo.triangulate(t,e)}};var zo=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(zo||{}),Wo=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(Wo||{});const Yo={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let s=Math.ceil(t/this.maxLength);return s<this.minSegments?s=this.minSegments:s>this.maxSegments&&(s=this.maxSegments),s}},jo=Yo;class $o{static curveTo(t,e,s,i,r,n){const a=n[n.length-2],o=n[n.length-1]-e,h=a-t,l=i-e,u=s-t,d=Math.abs(o*u-h*l);if(d<1e-8||0===r)return(n[n.length-2]!==t||n[n.length-1]!==e)&&n.push(t,e),null;const c=o*o+h*h,p=l*l+u*u,f=o*l+h*u,m=r*Math.sqrt(c)/d,_=r*Math.sqrt(p)/d,g=m*f/c,x=_*f/p,v=m*u+_*h,y=m*l+_*o,T=h*(_+g),b=o*(_+g),E=u*(m+x),A=l*(m+x);return{cx:v+t,cy:y+e,radius:r,startAngle:Math.atan2(b-y,T-v),endAngle:Math.atan2(A-y,E-v),anticlockwise:h*l>u*o}}static arc(t,e,s,i,r,n,a,o,h){const l=a-n,u=Yo._segmentsCount(Math.abs(l)*r,40*Math.ceil(Math.abs(l)/Ds)),d=l/(2*u),c=2*d,p=Math.cos(d),f=Math.sin(d),m=u-1,_=m%1/m;for(let t=0;t<=m;++t){const e=d+n+c*(t+_*t),a=Math.cos(e),o=-Math.sin(e);h.push((p*a+f*o)*r+s,(p*-o+f*a)*r+i)}}}class qo{constructor(){this.reset()}begin(t,e,s){this.reset(),this.style=t,this.start=e,this.attribStart=s}end(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Ko{static curveLength(t,e,s,i,r,n,a,o){let h=0,l=0,u=0,d=0,c=0,p=0,f=0,m=0,_=0,g=0,x=0,v=t,y=e;for(let T=1;T<=10;++T)l=T/10,u=l*l,d=u*l,c=1-l,p=c*c,f=p*c,m=f*t+3*p*l*s+3*c*u*r+d*a,_=f*e+3*p*l*i+3*c*u*n+d*o,g=v-m,x=y-_,v=m,y=_,h+=Math.sqrt(g*g+x*x);return h}static curveTo(t,e,s,i,r,n,a){const o=a[a.length-2],h=a[a.length-1];a.length-=2;const l=Yo._segmentsCount(Ko.curveLength(o,h,t,e,s,i,r,n));let u=0,d=0,c=0,p=0,f=0;a.push(o,h);for(let m=1,_=0;m<=l;++m)_=m/l,u=1-_,d=u*u,c=d*u,p=_*_,f=p*_,a.push(c*o+3*d*_*t+3*u*p*s+f*r,c*h+3*d*_*e+3*u*p*i+f*n)}}function Zo(t,e,s,i,r,n,a,o){let h,l;a?(h=i,l=-s):(h=-i,l=s);const u=t-s*r+h,d=e-i*r+l,c=t+s*n+h,p=e+i*n+l;return o.push(u,d,c,p),2}function Qo(t,e,s,i,r,n,a,o){const h=s-t,l=i-e;let u=Math.atan2(h,l),d=Math.atan2(r-t,n-e);o&&u<d?u+=2*Math.PI:!o&&u>d&&(d+=2*Math.PI);let c=u;const p=d-u,f=Math.abs(p),m=Math.sqrt(h*h+l*l),_=1+(15*f*Math.sqrt(m)/Math.PI>>0),g=p/_;if(c+=g,o){a.push(t,e,s,i);for(let s=1,i=c;s<_;s++,i+=g)a.push(t,e,t+Math.sin(i)*m,e+Math.cos(i)*m);a.push(t,e,r,n)}else{a.push(s,i,t,e);for(let s=1,i=c;s<_;s++,i+=g)a.push(t+Math.sin(i)*m,e+Math.cos(i)*m,t,e);a.push(r,n,t,e)}return 2*_}function Jo(t,e){t.lineStyle.native?function(t,e){let s=0;const i=t.shape,r=t.points||i.points,n=i.type!==Fs.POLY||i.closeStroke;if(0===r.length)return;const a=e.points,o=e.indices,h=r.length/2,l=a.length/2;let u=l;for(a.push(r[0],r[1]),s=1;s<h;s++)a.push(r[2*s],r[2*s+1]),o.push(u,u+1),u++;n&&o.push(u,l)}(t,e):function(t,e){const s=t.shape;let i=t.points||s.points.slice();const r=e.closePointEps;if(0===i.length)return;const n=t.lineStyle,a=new Bs(i[0],i[1]),o=new Bs(i[i.length-2],i[i.length-1]),h=s.type!==Fs.POLY||s.closeStroke,l=Math.abs(a.x-o.x)<r&&Math.abs(a.y-o.y)<r;if(h){i=i.slice(),l&&(i.pop(),i.pop(),o.set(i[i.length-2],i[i.length-1]));const t=.5*(a.x+o.x),e=.5*(o.y+a.y);i.unshift(t,e),i.push(t,e)}const u=e.points,d=i.length/2;let c=i.length;const p=u.length/2,f=n.width/2,m=f*f,_=n.miterLimit*n.miterLimit;let g=i[0],x=i[1],v=i[2],y=i[3],T=0,b=0,E=-(x-y),A=g-v,R=0,S=0,w=Math.sqrt(E*E+A*A);E/=w,A/=w,E*=f,A*=f;const I=n.alignment,M=2*(1-I),C=2*I;h||(n.cap===Wo.ROUND?c+=Qo(g-E*(M-C)*.5,x-A*(M-C)*.5,g-E*M,x-A*M,g+E*C,x+A*C,u,!0)+2:n.cap===Wo.SQUARE&&(c+=Zo(g,x,E,A,M,C,!0,u))),u.push(g-E*M,x-A*M,g+E*C,x+A*C);for(let t=1;t<d-1;++t){g=i[2*(t-1)],x=i[2*(t-1)+1],v=i[2*t],y=i[2*t+1],T=i[2*(t+1)],b=i[2*(t+1)+1],E=-(x-y),A=g-v,w=Math.sqrt(E*E+A*A),E/=w,A/=w,E*=f,A*=f,R=-(y-b),S=v-T,w=Math.sqrt(R*R+S*S),R/=w,S/=w,R*=f,S*=f;const e=v-g,s=x-y,r=v-T,a=b-y,o=e*r+s*a,h=s*r-a*e,l=h<0;if(Math.abs(h)<.001*Math.abs(o)){u.push(v-E*M,y-A*M,v+E*C,y+A*C),o>=0&&(n.join===zo.ROUND?c+=Qo(v,y,v-E*M,y-A*M,v-R*M,y-S*M,u,!1)+4:c+=2,u.push(v-R*C,y-S*C,v+R*M,y+S*M));continue}const d=(-E+g)*(-A+y)-(-E+v)*(-A+x),p=(-R+T)*(-S+y)-(-R+v)*(-S+b),I=(e*p-r*d)/h,D=(a*d-s*p)/h,P=(I-v)*(I-v)+(D-y)*(D-y),O=v+(I-v)*M,F=y+(D-y)*M,B=v-(I-v)*C,N=y-(D-y)*C,L=l?M:C,G=P<=Math.min(e*e+s*s,r*r+a*a)+L*L*m;let U=n.join;if(U===zo.MITER&&P/m>_&&(U=zo.BEVEL),G)switch(U){case zo.MITER:u.push(O,F,B,N);break;case zo.BEVEL:l?u.push(O,F,v+E*C,y+A*C,O,F,v+R*C,y+S*C):u.push(v-E*M,y-A*M,B,N,v-R*M,y-S*M,B,N),c+=2;break;case zo.ROUND:l?(u.push(O,F,v+E*C,y+A*C),c+=Qo(v,y,v+E*C,y+A*C,v+R*C,y+S*C,u,!0)+4,u.push(O,F,v+R*C,y+S*C)):(u.push(v-E*M,y-A*M,B,N),c+=Qo(v,y,v-E*M,y-A*M,v-R*M,y-S*M,u,!1)+4,u.push(v-R*M,y-S*M,B,N))}else{switch(u.push(v-E*M,y-A*M,v+E*C,y+A*C),U){case zo.MITER:l?u.push(B,N,B,N):u.push(O,F,O,F),c+=2;break;case zo.ROUND:c+=l?Qo(v,y,v+E*C,y+A*C,v+R*C,y+S*C,u,!0)+2:Qo(v,y,v-E*M,y-A*M,v-R*M,y-S*M,u,!1)+2}u.push(v-R*M,y-S*M,v+R*C,y+S*C),c+=2}}g=i[2*(d-2)],x=i[2*(d-2)+1],v=i[2*(d-1)],y=i[2*(d-1)+1],E=-(x-y),A=g-v,w=Math.sqrt(E*E+A*A),E/=w,A/=w,E*=f,A*=f,u.push(v-E*M,y-A*M,v+E*C,y+A*C),h||(n.cap===Wo.ROUND?c+=Qo(v-E*(M-C)*.5,y-A*(M-C)*.5,v-E*M,y-A*M,v+E*C,y+A*C,u,!1)+2:n.cap===Wo.SQUARE&&(c+=Zo(v,y,E,A,M,C,!1,u)));const D=e.indices,P=Yo.epsilon*Yo.epsilon;for(let t=p;t<c+p-2;++t)g=u[2*t],x=u[2*t+1],v=u[2*(t+1)],y=u[2*(t+1)+1],T=u[2*(t+2)],b=u[2*(t+2)+1],!(Math.abs(g*(y-b)+v*(b-x)+T*(x-y))<P)&&D.push(t,t+1,t+2)}(t,e)}class th{static curveLength(t,e,s,i,r,n){const a=t-2*s+r,o=e-2*i+n,h=2*s-2*t,l=2*i-2*e,u=4*(a*a+o*o),d=4*(a*h+o*l),c=h*h+l*l,p=2*Math.sqrt(u+d+c),f=Math.sqrt(u),m=2*u*f,_=2*Math.sqrt(c),g=d/f;return(m*p+f*d*(p-_)+(4*c*u-d*d)*Math.log((2*f+g+p)/(g+_)))/(4*m)}static curveTo(t,e,s,i,r){const n=r[r.length-2],a=r[r.length-1],o=Yo._segmentsCount(th.curveLength(n,a,t,e,s,i));let h=0,l=0;for(let u=1;u<=o;++u){const d=u/o;h=n+(t-n)*d,l=a+(e-a)*d,r.push(h+(t+(s-t)*d-h)*d,l+(e+(i-e)*d-l)*d)}}}const eh={[Fs.POLY]:Xo,[Fs.CIRC]:Uo,[Fs.ELIP]:Uo,[Fs.RECT]:Ho,[Fs.RREC]:Vo},sh=[],ih=[];class rh{constructor(t,e=null,s=null,i=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=s,this.fillStyle=e,this.matrix=i,this.type=t.type}clone(){return new rh(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const nh=new Bs,ah=class extends Cs{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new gn,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),ih.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),sh.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,s=null,i=null){const r=new rh(t,e,s,i);return this.graphicsData.push(r),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const s=new rh(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return s.lineStyle=i.lineStyle,i.holes.push(s),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let s=0;s<e.length;++s){const i=e[s];if(i.fillStyle.visible&&i.shape&&(i.matrix?i.matrix.applyInverse(t,nh):nh.copyFrom(t),i.shape.contains(nh.x,nh.y))){let t=!1;if(i.holes)for(let e=0;e<i.holes.length;e++)if(i.holes[e].shape.contains(nh.x,nh.y)){t=!0;break}if(!t)return!0}}return!1}updateBatches(){if(!this.graphicsData.length)return void(this.batchable=!0);if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let s=null,i=null;this.batches.length>0&&(s=this.batches[this.batches.length-1],i=s.style);for(let r=this.shapeIndex;r<e.length;r++){this.shapeIndex++;const n=e[r],a=n.fillStyle,o=n.lineStyle;eh[n.type].build(n),n.matrix&&this.transformPoints(n.points,n.matrix),(a.visible||o.visible)&&this.processHoles(n.holes);for(let e=0;e<2;e++){const r=0===e?a:o;if(!r.visible)continue;const h=r.texture.baseTexture,l=this.indices.length,u=this.points.length/2;h.wrapMode=p.REPEAT,0===e?this.processFill(n):this.processLine(n);const d=this.points.length/2-u;0!==d&&(s&&!this._compareStyles(i,r)&&(s.end(l,u),s=null),s||(s=sh.pop()||new qo,s.begin(r,l,u),this.batches.push(s),i=r),this.addUvs(this.points,t,r.texture,u,d,r.matrix))}}const r=this.indices.length,n=this.points.length/2;if(s&&s.end(r,n),0===this.batches.length)return void(this.batchable=!0);const a=n>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const e=this.graphicsData[t],s=e.fillStyle,i=e.lineStyle;if(s&&!s.texture.baseTexture.valid||i&&!i.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,s=t.length;e<s;e++){const s=t[e];for(let t=0;t<s.size;t++){const e=s.start+t;this.indicesUint16[e]=this.indicesUint16[e]-s.attribStart}}}isBatchable(){if(this.points.length>131070)return!1;const t=this.batches;for(let e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<2*ah.BATCHABLE_SIZE}buildDrawCalls(){let t=++ys._globalBatch;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),ih.push(this.drawCalls[t]);this.drawCalls.length=0;const e=this.colors,s=this.textureIds;let i=ih.pop();i||(i=new Ts,i.texArray=new wi),i.texArray.count=0,i.start=0,i.size=0,i.type=o.TRIANGLES;let r=0,n=null,a=0,h=!1,l=o.TRIANGLES,u=0;this.drawCalls.push(i);for(let d=0;d<this.batches.length;d++){const c=this.batches[d],f=8,m=c.style,_=m.texture.baseTexture;h!==!!m.native&&(h=!!m.native,l=h?o.LINES:o.TRIANGLES,n=null,r=f,t++),n!==_&&(n=_,_._batchEnabled!==t&&(r===f&&(t++,r=0,i.size>0&&(i=ih.pop(),i||(i=new Ts,i.texArray=new wi),this.drawCalls.push(i)),i.start=u,i.size=0,i.texArray.count=0,i.type=l),_.touched=1,_._batchEnabled=t,_._batchLocation=r,_.wrapMode=p.REPEAT,i.texArray.elements[i.texArray.count++]=_,r++)),i.size+=c.size,u+=c.size,a=_._batchLocation,this.addColors(e,m.color,m.alpha,c.attribSize,c.attribStart),this.addTextureIds(s,a,c.attribSize,c.attribStart)}ys._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,s=this.colors,i=this.textureIds,r=new ArrayBuffer(3*t.length*4),n=new Float32Array(r),a=new Uint32Array(r);let o=0;for(let r=0;r<t.length/2;r++)n[o++]=t[2*r],n[o++]=t[2*r+1],n[o++]=e[2*r],n[o++]=e[2*r+1],a[o++]=s[r],n[o++]=i[r];this._buffer.update(r),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?Xo.triangulate(t,this):eh[t.type].triangulate(t,this)}processLine(t){Jo(t,this);for(let e=0;e<t.holes.length;e++)Jo(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const s=t[e];eh[s.type].build(s),s.matrix&&this.transformPoints(s.points,s.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let s=0;s<t.length/2;s++){const i=t[2*s],r=t[2*s+1];t[2*s]=e.a*i+e.c*r+e.tx,t[2*s+1]=e.b*i+e.d*r+e.ty}}addColors(t,e,s,i,r=0){const n=Ie.shared.setValue(e).toLittleEndianNumber(),a=Ie.shared.setValue(n).toPremultiplied(s);t.length=Math.max(t.length,r+i);for(let e=0;e<i;e++)t[r+e]=a}addTextureIds(t,e,s,i=0){t.length=Math.max(t.length,i+s);for(let r=0;r<s;r++)t[i+r]=e}addUvs(t,e,s,i,r,n=null){let a=0;const o=e.length,h=s.frame;for(;a<r;){let s=t[2*(i+a)],r=t[2*(i+a)+1];if(n){const t=n.a*s+n.c*r+n.tx;r=n.b*s+n.d*r+n.ty,s=t}a++,e.push(s/h.width,r/h.height)}const l=s.baseTexture;(h.width<l.width||h.height<l.height)&&this.adjustUvs(e,s,o,r)}adjustUvs(t,e,s,i){const r=e.baseTexture,n=1e-6,a=s+2*i,o=e.frame,h=o.width/r.width,l=o.height/r.height;let u=o.x/o.width,d=o.y/o.height,c=Math.floor(t[s]+n),p=Math.floor(t[s+1]+n);for(let e=s+2;e<a;e+=2)c=Math.min(c,Math.floor(t[e]+n)),p=Math.min(p,Math.floor(t[e+1]+n));u-=c,d-=p;for(let e=s;e<a;e+=2)t[e]=(t[e]+u)*h,t[e+1]=(t[e+1]+d)*l}};let oh=ah;oh.BATCHABLE_SIZE=100;class hh{constructor(){this.color=16777215,this.alpha=1,this.texture=Wi.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new hh;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t}reset(){this.color=16777215,this.alpha=1,this.texture=Wi.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class lh extends hh{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=Wo.BUTT,this.join=zo.MITER,this.miterLimit=10}clone(){const t=new lh;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1}}const uh={},dh=class extends En{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new hh,this._lineStyle=new lh,this._matrix=null,this._holeMode=!1,this.state=cs.for2d(),this._geometry=t||new oh,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Ie(16777215),this.blendMode=a.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new dh(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,s,i=.5,r=!1){return"number"==typeof t&&(t={width:t,color:e,alpha:s,alignment:i,native:r}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:Wi.WHITE,color:null!=t&&t.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:Wo.BUTT,join:zo.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const s=t.width>0&&t.alpha>0;return s?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:s},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new ks,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new ks,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const s=this.currentPath.points,i=s[s.length-2],r=s[s.length-1];return(i!==t||r!==e)&&s.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,s,i){this._initCurve();const r=this.currentPath.points;return 0===r.length&&this.moveTo(0,0),th.curveTo(t,e,s,i,r),this}bezierCurveTo(t,e,s,i,r,n){return this._initCurve(),Ko.curveTo(t,e,s,i,r,n,this.currentPath.points),this}arcTo(t,e,s,i,r){this._initCurve(t,e);const n=this.currentPath.points,a=$o.curveTo(t,e,s,i,r,n);if(a){const{cx:t,cy:e,radius:s,startAngle:i,endAngle:r,anticlockwise:n}=a;this.arc(t,e,s,i,r,n)}return this}arc(t,e,s,i,r,n=!1){if(i===r)return this;if(!n&&r<=i?r+=Ds:n&&i<=r&&(i+=Ds),r-i==0)return this;const a=t+Math.cos(i)*s,o=e+Math.sin(i)*s,h=this._geometry.closePointEps;let l=this.currentPath?this.currentPath.points:null;if(l){const t=Math.abs(l[l.length-2]-a),e=Math.abs(l[l.length-1]-o);t<h&&e<h||l.push(a,o)}else this.moveTo(a,o),l=this.currentPath.points;return $o.arc(a,o,t,e,s,i,r,n,l),this}beginFill(t=0,e){return this.beginTextureFill({texture:Wi.WHITE,color:t,alpha:e})}normalizeColor(t){var e;const s=Ie.shared.setValue(null!=(e=t.color)?e:0);t.color=s.toNumber(),null!=t.alpha||(t.alpha=s.alpha)}beginTextureFill(t){const e={texture:Wi.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const s=t.alpha>0;return s?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:s},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,s,i){return this.drawShape(new Ls(t,e,s,i))}drawRoundedRect(t,e,s,i,r){return this.drawShape(new Xs(t,e,s,i,r))}drawCircle(t,e,s){return this.drawShape(new Gs(t,e,s))}drawEllipse(t,e,s,i){return this.drawShape(new Us(t,e,s,i))}drawPolygon(...t){let e,s=!0;const i=t[0];i.points?(s=i.closeStroke,e=i.points):e=Array.isArray(t[0])?t[0]:t;const r=new ks(e);return r.closeStroke=s,this.drawShape(r),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return!(1!==t.length||t[0].shape.type!==Fs.RECT||t[0].matrix||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,s=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=s,this.vertexData=new Float32Array(t.points);for(let i=0;i<s;i++){const s=t.batches[i],r=s.style.color,n=new Float32Array(this.vertexData.buffer,4*s.attribStart*2,2*s.attribSize),a=new Float32Array(t.uvsFloat32.buffer,4*s.attribStart*2,2*s.attribSize),o={vertexData:n,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*s.start,s.size),uvs:a,_batchRGB:Ie.shared.setValue(r).toRgbArray(),_tintRGB:r,_texture:s.style.texture,alpha:s.style.alpha,worldAlpha:1};this.batches[i]=o}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,s=this.batches.length;e<s;e++){const s=this.batches[e];s.worldAlpha=this.worldAlpha*s.alpha,t.plugins[this.pluginName].render(s)}}}_renderDirect(t){const e=this._resolveDirectShader(t),s=this._geometry,i=this.worldAlpha,r=e.uniforms,n=s.drawCalls;r.translationMatrix=this.transform.worldTransform,Ie.shared.setValue(this._tintColor).premultiply(i).toArray(r.tint),t.shader.bind(e),t.geometry.bind(s,e),t.state.set(this.state);for(let e=0,i=n.length;e<i;e++)this._renderDrawCallDirect(t,s.drawCalls[e])}_renderDrawCallDirect(t,e){const{texArray:s,type:i,size:r,start:n}=e,a=s.count;for(let e=0;e<a;e++)t.texture.bind(s.elements[e],e);t.geometry.draw(i,r,n)}_resolveDirectShader(t){let e=this.shader;const s=this.pluginName;if(!e){if(!uh[s]){const{maxTextures:e}=t.plugins[s],i=new Int32Array(e);for(let t=0;t<e;t++)i[t]=t;const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new Hs,default:Ai.from({uSamplers:i},!0)},n=t.plugins[s]._shader.program;uh[s]=new Ri(n,r)}e=uh[s]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:s,maxX:i,maxY:r}=t.bounds;this._bounds.addFrame(this.transform,e,s,i,r)}containsPoint(t){return this.worldTransform.applyInverse(t,dh._TEMP_POINT),this._geometry.containsPoint(dh._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=Ie.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,s=e.a,i=e.b,r=e.c,n=e.d,a=e.tx,o=e.ty,h=this._geometry.points,l=this.vertexData;let u=0;for(let t=0;t<h.length;t+=2){const e=h[t],d=h[t+1];l[u++]=s*e+r*d+a,l[u++]=n*d+i*e+o}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(t)}};let ch=dh;ch.curves=Yo,ch._TEMP_POINT=new Bs;const ph={buildPoly:Xo,buildCircle:Uo,buildRectangle:Ho,buildRoundedRectangle:Vo,buildLine:Jo,ArcUtils:$o,BezierUtils:Ko,QuadraticUtils:th,BatchPart:qo,FILL_COMMANDS:eh,BATCH_POOL:sh,DRAW_CALL_POOL:ih};class fh{constructor(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(t){if(!t&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const e=this.uvBuffer.data;(!this.data||this.data.length!==e.length)&&(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}}const mh=new Bs,_h=new ks,gh=class extends En{constructor(t,e,s,i=o.TRIANGLES){super(),this.geometry=t,this.shader=e,this.state=s||cs.for2d(),this.drawMode=i,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=A.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(t){this.shader=t}get material(){return this.shader}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(t){this.shader.tint=t}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(t){this.shader.texture=t}_render(t){const e=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===o.TRIANGLES&&e.length<2*gh.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)}_renderDefault(t){const e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}_renderToBatch(t){const e=this.geometry,s=this.shader;s.uvMatrix&&(s.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=s._tintRGB,this._texture=s.texture;const i=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[i]),t.plugins[i].render(this)}calculateVertices(){const t=this.geometry.buffers[0],e=t.data,s=t._updateID;if(s===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));const i=this.transform.worldTransform,r=i.a,n=i.b,a=i.c,o=i.d,h=i.tx,l=i.ty,u=this.vertexData;for(let t=0;t<u.length/2;t++){const s=e[2*t],i=e[2*t+1];u[2*t]=r*s+a*i+h,u[2*t+1]=n*s+o*i+l}if(this._roundPixels){const t=A.RESOLUTION;for(let e=0;e<u.length;++e)u[e]=Math.round(u[e]*t)/t}this.vertexDirty=s}calculateUvs(){const t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new fh(t,e.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,mh);const e=this.geometry.getBuffer("aVertexPosition").data,s=_h.points,i=this.geometry.getIndex().data,r=i.length,n=4===this.drawMode?3:1;for(let t=0;t+2<r;t+=n){const r=2*i[t],n=2*i[t+1],a=2*i[t+2];if(s[0]=e[r],s[1]=e[r+1],s[2]=e[n],s[3]=e[n+1],s[4]=e[a],s[5]=e[a+1],_h.contains(mh.x,mh.y))return!0}return!1}destroy(t){super.destroy(t),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null}};let xh=gh;xh.BATCHABLE_SIZE=100;class vh extends Ms{constructor(t,e,s){super();const i=new Es(t),r=new Es(e,!0),n=new Es(s,!0,!0);this.addAttribute("aVertexPosition",i,2,!1,u.FLOAT).addAttribute("aTextureCoord",r,2,!1,u.FLOAT).addIndex(n),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}class yh extends Ri{constructor(t,e){const s={uSampler:t,alpha:1,uTextureMatrix:Hs.IDENTITY,uColor:new Float32Array([1,1,1,1])};(e=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},e)).uniforms&&Object.assign(s,e.uniforms),super(e.program||bi.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n    gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"),s),this._colorDirty=!1,this.uvMatrix=new or(t),this.batchable=void 0===e.program,this.pluginName=e.pluginName,this._tintColor=new Ie(e.tint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0,this.alpha=e.alpha}get texture(){return this.uniforms.uSampler}set texture(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)}set alpha(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(t){t!==this.tint&&(this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}get tintValue(){return this._tintColor.toNumber()}update(){if(this._colorDirty){this._colorDirty=!1;const t=this.texture.baseTexture.alphaMode;Ie.shared.setValue(this._tintColor).premultiply(this._alpha,t).toArray(this.uniforms.uColor)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}class Th extends vh{constructor(t=100,e=100,s=10,i=10){super(),this.segWidth=s,this.segHeight=i,this.width=t,this.height=e,this.build()}build(){const t=this.segWidth*this.segHeight,e=[],s=[],i=[],r=this.segWidth-1,n=this.segHeight-1,a=this.width/r,o=this.height/n;for(let i=0;i<t;i++){const t=i%this.segWidth,h=i/this.segWidth|0;e.push(t*a,h*o),s.push(t/r,h/n)}const h=r*n;for(let t=0;t<h;t++){const e=t%r,s=t/r|0,n=s*this.segWidth+e,a=s*this.segWidth+e+1,o=(s+1)*this.segWidth+e,h=(s+1)*this.segWidth+e+1;i.push(n,a,o,a,h,o)}this.buffers[0].data=new Float32Array(e),this.buffers[1].data=new Float32Array(s),this.indexBuffer.data=new Uint16Array(i),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}}class bh extends vh{constructor(t=200,e,s=0){super(new Float32Array(4*e.length),new Float32Array(4*e.length),new Uint16Array(6*(e.length-1))),this.points=e,this._width=t,this.textureScale=s,this.build()}get width(){return this._width}build(){const t=this.points;if(!t)return;const e=this.getBuffer("aVertexPosition"),s=this.getBuffer("aTextureCoord"),i=this.getIndex();if(t.length<1)return;e.data.length/4!==t.length&&(e.data=new Float32Array(4*t.length),s.data=new Float32Array(4*t.length),i.data=new Uint16Array(6*(t.length-1)));const r=s.data,n=i.data;r[0]=0,r[1]=0,r[2]=0,r[3]=1;let a=0,o=t[0];const h=this._width*this.textureScale,l=t.length;for(let e=0;e<l;e++){const s=4*e;if(this.textureScale>0){const s=o.x-t[e].x,i=o.y-t[e].y,r=Math.sqrt(s*s+i*i);o=t[e],a+=r/h}else a=e/(l-1);r[s]=a,r[s+1]=0,r[s+2]=a,r[s+3]=1}let u=0;for(let t=0;t<l-1;t++){const e=2*t;n[u++]=e,n[u++]=e+1,n[u++]=e+2,n[u++]=e+2,n[u++]=e+1,n[u++]=e+3}s.update(),i.update(),this.updateVertices()}updateVertices(){const t=this.points;if(t.length<1)return;let e,s=t[0],i=0,r=0;const n=this.buffers[0].data,a=t.length,o=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let h=0;h<a;h++){const l=t[h],u=4*h;e=h<t.length-1?t[h+1]:l,r=-(e.x-s.x),i=e.y-s.y;let d=10*(1-h/(a-1));d>1&&(d=1);const c=Math.sqrt(i*i+r*r);c<1e-6?(i=0,r=0):(i/=c,r/=c,i*=o,r*=o),n[u]=l.x+i,n[u+1]=l.y+r,n[u+2]=l.x-i,n[u+3]=l.y-r,s=l}this.buffers[0].update()}update(){this.textureScale>0?this.build():this.updateVertices()}}class Eh extends xh{constructor(t,e,s){super(new Th(t.width,t.height,e,s),new yh(Wi.WHITE)),this.texture=t,this.autoResize=!0}textureUpdated(){this._textureID=this.shader.texture._updateID;const t=this.geometry,{width:e,height:s}=this.shader.texture;this.autoResize&&(t.width!==e||t.height!==s)&&(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())}set texture(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))}get texture(){return this.shader.texture}_render(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),super._render(t)}destroy(t){this.shader.texture.off("update",this.textureUpdated,this),super.destroy(t)}}class Ah{constructor(t,e,s){this.geometry=new Ms,this.indexBuffer=null,this.size=s,this.dynamicProperties=[],this.staticProperties=[];for(let s=0;s<t.length;++s){let i=t[s];i={attributeName:i.attributeName,size:i.size,uploadFunction:i.uploadFunction,type:i.type||u.FLOAT,offset:i.offset},e[s]?this.dynamicProperties.push(i):this.staticProperties.push(i)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}initBuffers(){const t=this.geometry;let e=0;this.indexBuffer=new Es(Fe(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(let t=0;t<this.dynamicProperties.length;++t){const s=this.dynamicProperties[t];s.offset=e,e+=s.size,this.dynamicStride+=s.size}const s=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(s),this.dynamicDataUint32=new Uint32Array(s),this.dynamicBuffer=new Es(this.dynamicData,!1,!1);let i=0;this.staticStride=0;for(let t=0;t<this.staticProperties.length;++t){const e=this.staticProperties[t];e.offset=i,i+=e.size,this.staticStride+=e.size}const r=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(r),this.staticDataUint32=new Uint32Array(r),this.staticBuffer=new Es(this.staticData,!0,!1);for(let e=0;e<this.dynamicProperties.length;++e){const s=this.dynamicProperties[e];t.addAttribute(s.attributeName,this.dynamicBuffer,0,s.type===u.UNSIGNED_BYTE,s.type,4*this.dynamicStride,4*s.offset)}for(let e=0;e<this.staticProperties.length;++e){const s=this.staticProperties[e];t.addAttribute(s.attributeName,this.staticBuffer,0,s.type===u.UNSIGNED_BYTE,s.type,4*this.staticStride,4*s.offset)}}uploadDynamic(t,e,s){for(let i=0;i<this.dynamicProperties.length;i++){const r=this.dynamicProperties[i];r.uploadFunction(t,e,s,r.type===u.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,r.offset)}this.dynamicBuffer._updateID++}uploadStatic(t,e,s){for(let i=0;i<this.staticProperties.length;i++){const r=this.staticProperties[i];r.uploadFunction(t,e,s,r.type===u.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,r.offset)}this.staticBuffer._updateID++}destroy(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()}}class Rh extends Ii{constructor(t){super(t),this.shader=null,this.properties=null,this.tempMatrix=new Hs,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:u.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=Ri.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n    float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n    float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n    vec2 v = vec2(x, y);\n    v = v + aPositionCoord;\n\n    gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vColor = aColor * uColor;\n}\n","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n    vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n    gl_FragColor = color;\n}",{}),this.state=cs.for2d()}render(t){const e=t.children,s=t._maxSize,i=t._batchSize,r=this.renderer;let n=e.length;if(0===n)return;n>s&&!t.autoResize&&(n=s);let a=t._buffers;a||(a=t._buffers=this.generateBuffers(t));const o=e[0]._texture.baseTexture,h=o.alphaMode>0;this.state.blendMode=Pe(t.blendMode,h),r.state.set(this.state);const l=r.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(r.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Ie.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,h).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=o,this.renderer.shader.bind(this.shader);let d=!1;for(let s=0,o=0;s<n;s+=i,o+=1){let h=n-s;h>i&&(h=i),o>=a.length&&a.push(this._generateOneMoreBuffer(t));const u=a[o];u.uploadDynamic(e,s,h);const c=t._bufferUpdateIDs[o]||0;d=d||u._updateID<c,d&&(u._updateID=t._updateID,u.uploadStatic(e,s,h)),r.geometry.bind(u.geometry),l.drawElements(l.TRIANGLES,6*h,l.UNSIGNED_SHORT,0)}}generateBuffers(t){const e=[],s=t._maxSize,i=t._batchSize,r=t._properties;for(let t=0;t<s;t+=i)e.push(new Ah(this.properties,r,i));return e}_generateOneMoreBuffer(t){const e=t._batchSize,s=t._properties;return new Ah(this.properties,s,e)}uploadVertices(t,e,s,i,r,n){let a=0,o=0,h=0,l=0;for(let u=0;u<s;++u){const s=t[e+u],d=s._texture,c=s.scale.x,p=s.scale.y,f=d.trim,m=d.orig;f?(o=f.x-s.anchor.x*m.width,a=o+f.width,l=f.y-s.anchor.y*m.height,h=l+f.height):(a=m.width*(1-s.anchor.x),o=m.width*-s.anchor.x,h=m.height*(1-s.anchor.y),l=m.height*-s.anchor.y),i[n]=o*c,i[n+1]=l*p,i[n+r]=a*c,i[n+r+1]=l*p,i[n+2*r]=a*c,i[n+2*r+1]=h*p,i[n+3*r]=o*c,i[n+3*r+1]=h*p,n+=4*r}}uploadPosition(t,e,s,i,r,n){for(let a=0;a<s;a++){const s=t[e+a].position;i[n]=s.x,i[n+1]=s.y,i[n+r]=s.x,i[n+r+1]=s.y,i[n+2*r]=s.x,i[n+2*r+1]=s.y,i[n+3*r]=s.x,i[n+3*r+1]=s.y,n+=4*r}}uploadRotation(t,e,s,i,r,n){for(let a=0;a<s;a++){const s=t[e+a].rotation;i[n]=s,i[n+r]=s,i[n+2*r]=s,i[n+3*r]=s,n+=4*r}}uploadUvs(t,e,s,i,r,n){for(let a=0;a<s;++a){const s=t[e+a]._texture._uvs;s?(i[n]=s.x0,i[n+1]=s.y0,i[n+r]=s.x1,i[n+r+1]=s.y1,i[n+2*r]=s.x2,i[n+2*r+1]=s.y2,i[n+3*r]=s.x3,i[n+3*r+1]=s.y3,n+=4*r):(i[n]=0,i[n+1]=0,i[n+r]=0,i[n+r+1]=0,i[n+2*r]=0,i[n+2*r+1]=0,i[n+3*r]=0,i[n+3*r+1]=0,n+=4*r)}}uploadTint(t,e,s,i,r,n){for(let a=0;a<s;++a){const s=t[e+a],o=Ie.shared.setValue(s._tintRGB).toPremultiplied(s.alpha,s.texture.baseTexture.alphaMode>0);i[n]=o,i[n+r]=o,i[n+2*r]=o,i[n+3*r]=o,n+=4*r}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}Rh.extension={name:"particle",type:rs.RendererPlugin},os.add(Rh);var Sh=(t=>(t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",t))(Sh||{});const wh={willReadFrequently:!0},Ih=class{static get experimentalLetterSpacingSupported(){let t=Ih._experimentalLetterSpacingSupported;if(void 0!==t){const e=A.ADAPTER.getCanvasRenderingContext2D().prototype;t=Ih._experimentalLetterSpacingSupported="letterSpacing"in e||"textLetterSpacing"in e}return t}constructor(t,e,s,i,r,n,a,o,h){this.text=t,this.style=e,this.width=s,this.height=i,this.lines=r,this.lineWidths=n,this.lineHeight=a,this.maxLineWidth=o,this.fontProperties=h}static measureText(t,e,s,i=Ih._canvas){s=null==s?e.wordWrap:s;const r=e.toFontString(),n=Ih.measureFont(r);0===n.fontSize&&(n.fontSize=e.fontSize,n.ascent=e.fontSize);const a=i.getContext("2d",wh);a.font=r;const o=(s?Ih.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(o.length);let l=0;for(let t=0;t<o.length;t++){const s=Ih._measureText(o[t],e.letterSpacing,a);h[t]=s,l=Math.max(l,s)}let u=l+e.strokeThickness;e.dropShadow&&(u+=e.dropShadowDistance);const d=e.lineHeight||n.fontSize+e.strokeThickness;let c=Math.max(d,n.fontSize+2*e.strokeThickness)+(o.length-1)*(d+e.leading);return e.dropShadow&&(c+=e.dropShadowDistance),new Ih(t,e,u,c,o,h,d+e.leading,l,n)}static _measureText(t,e,s){let i=!1;Ih.experimentalLetterSpacingSupported&&(Ih.experimentalLetterSpacing?(s.letterSpacing=`${e}px`,s.textLetterSpacing=`${e}px`,i=!0):(s.letterSpacing="0px",s.textLetterSpacing="0px"));let r=s.measureText(t).width;return r>0&&(i?r-=e:r+=(Ih.graphemeSegmenter(t).length-1)*e),r}static wordWrap(t,e,s=Ih._canvas){const i=s.getContext("2d",wh);let r=0,n="",a="";const o=Object.create(null),{letterSpacing:h,whiteSpace:l}=e,u=Ih.collapseSpaces(l),d=Ih.collapseNewlines(l);let c=!u;const p=e.wordWrapWidth+h,f=Ih.tokenize(t);for(let t=0;t<f.length;t++){let s=f[t];if(Ih.isNewline(s)){if(!d){a+=Ih.addLine(n),c=!u,n="",r=0;continue}s=" "}if(u){const t=Ih.isBreakingSpace(s),e=Ih.isBreakingSpace(n[n.length-1]);if(t&&e)continue}const l=Ih.getFromCache(s,h,o,i);if(l>p)if(""!==n&&(a+=Ih.addLine(n),n="",r=0),Ih.canBreakWords(s,e.breakWords)){const t=Ih.wordWrapSplit(s);for(let l=0;l<t.length;l++){let u=t[l],d=u,f=1;for(;t[l+f];){const i=t[l+f];if(Ih.canBreakChars(d,i,s,l,e.breakWords))break;u+=i,d=i,f++}l+=f-1;const m=Ih.getFromCache(u,h,o,i);m+r>p&&(a+=Ih.addLine(n),c=!1,n="",r=0),n+=u,r+=m}}else{n.length>0&&(a+=Ih.addLine(n),n="",r=0);const e=t===f.length-1;a+=Ih.addLine(s,!e),c=!1,n="",r=0}else l+r>p&&(c=!1,a+=Ih.addLine(n),n="",r=0),(n.length>0||!Ih.isBreakingSpace(s)||c)&&(n+=s,r+=l)}return a+=Ih.addLine(n,!1),a}static addLine(t,e=!0){return t=Ih.trimRight(t),t=e?`${t}\n`:t}static getFromCache(t,e,s,i){let r=s[t];return"number"!=typeof r&&(r=Ih._measureText(t,e,i)+e,s[t]=r),r}static collapseSpaces(t){return"normal"===t||"pre-line"===t}static collapseNewlines(t){return"normal"===t}static trimRight(t){if("string"!=typeof t)return"";for(let e=t.length-1;e>=0;e--){const s=t[e];if(!Ih.isBreakingSpace(s))break;t=t.slice(0,-1)}return t}static isNewline(t){return"string"==typeof t&&Ih._newlines.includes(t.charCodeAt(0))}static isBreakingSpace(t,e){return"string"==typeof t&&Ih._breakingSpaces.includes(t.charCodeAt(0))}static tokenize(t){const e=[];let s="";if("string"!=typeof t)return e;for(let i=0;i<t.length;i++){const r=t[i],n=t[i+1];Ih.isBreakingSpace(r,n)||Ih.isNewline(r)?(""!==s&&(e.push(s),s=""),e.push(r)):s+=r}return""!==s&&e.push(s),e}static canBreakWords(t,e){return e}static canBreakChars(t,e,s,i,r){return!0}static wordWrapSplit(t){return Ih.graphemeSegmenter(t)}static measureFont(t){if(Ih._fonts[t])return Ih._fonts[t];const e={ascent:0,descent:0,fontSize:0},s=Ih._canvas,i=Ih._context;i.font=t;const r=Ih.METRICS_STRING+Ih.BASELINE_SYMBOL,n=Math.ceil(i.measureText(r).width);let a=Math.ceil(i.measureText(Ih.BASELINE_SYMBOL).width);const o=Math.ceil(Ih.HEIGHT_MULTIPLIER*a);if(a=a*Ih.BASELINE_MULTIPLIER|0,0===n||0===o)return Ih._fonts[t]=e,e;s.width=n,s.height=o,i.fillStyle="#f00",i.fillRect(0,0,n,o),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(r,0,a);const h=i.getImageData(0,0,n,o).data,l=h.length,u=4*n;let d=0,c=0,p=!1;for(d=0;d<a;++d){for(let t=0;t<u;t+=4)if(255!==h[c+t]){p=!0;break}if(p)break;c+=u}for(e.ascent=a-d,c=l-u,p=!1,d=o;d>a;--d){for(let t=0;t<u;t+=4)if(255!==h[c+t]){p=!0;break}if(p)break;c-=u}return e.descent=d-a,e.fontSize=e.ascent+e.descent,Ih._fonts[t]=e,e}static clearMetrics(t=""){t?delete Ih._fonts[t]:Ih._fonts={}}static get _canvas(){if(!Ih.__canvas){let t;try{const e=new OffscreenCanvas(0,0),s=e.getContext("2d",wh);if(null!=s&&s.measureText)return Ih.__canvas=e,e;t=A.ADAPTER.createCanvas()}catch(e){t=A.ADAPTER.createCanvas()}t.width=t.height=10,Ih.__canvas=t}return Ih.__canvas}static get _context(){return Ih.__context||(Ih.__context=Ih._canvas.getContext("2d",wh)),Ih.__context}};let Mh=Ih;Mh.METRICS_STRING="|ÉqÅ",Mh.BASELINE_SYMBOL="M",Mh.BASELINE_MULTIPLIER=1.4,Mh.HEIGHT_MULTIPLIER=2,Mh.graphemeSegmenter=(()=>{if("function"==typeof(null==Intl?void 0:Intl.Segmenter)){const t=new Intl.Segmenter;return e=>[...t.segment(e)].map((t=>t.segment))}return t=>[...t]})(),Mh.experimentalLetterSpacing=!1,Mh._fonts={},Mh._newlines=[10,13],Mh._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];const Ch=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Dh=class{constructor(t){this.styleID=0,this.reset(),Fh(this,t,t)}clone(){const t={};return Fh(t,this,Dh.defaultStyle),new Dh(t)}reset(){Fh(this,Dh.defaultStyle,Dh.defaultStyle)}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(t){const e=Oh(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}get fill(){return this._fill}set fill(t){const e=Oh(t);this._fill!==e&&(this._fill=e,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let s=0;s<t.length;++s)if(t[s]!==e[s])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.styleID++)}get stroke(){return this._stroke}set stroke(t){const e=Oh(t);this._stroke!==e&&(this._stroke=e,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)}toFontString(){const t="number"==typeof this.fontSize?`${this.fontSize}px`:this.fontSize;let e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(let t=e.length-1;t>=0;t--){let s=e[t].trim();!/([\"\'])[^\'\"]+\1/.test(s)&&!Ch.includes(s)&&(s=`"${s}"`),e[t]=s}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${e.join(",")}`}};let Ph=Dh;function Oh(t){const e=Ie.shared;return Array.isArray(t)?t.map((t=>e.setValue(t).toHex())):e.setValue(t).toHex()}function Fh(t,e,s){for(const i in s)Array.isArray(e[i])?t[i]=e[i].slice():t[i]=e[i]}Ph.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Sh.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};const Bh={texture:!0,children:!1,baseTexture:!0},Nh=class extends Sn{constructor(t,e,s){var i;let r=!1;s||(s=A.ADAPTER.createCanvas(),r=!0),s.width=3,s.height=3;const n=Wi.from(s);n.orig=new Ls,n.trim=new Ls,super(n),this._ownCanvas=r,this.canvas=s,this.context=s.getContext("2d",{willReadFrequently:!0}),this._resolution=null!=(i=Nh.defaultResolution)?i:A.RESOLUTION,this._autoResolution=Nh.defaultAutoResolution,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=t,this.style=e,this.localStyleID=-1}static get experimentalLetterSpacing(){return Mh.experimentalLetterSpacing}static set experimentalLetterSpacing(t){Kt("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),Mh.experimentalLetterSpacing=t}updateText(t){const e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;this._font=this._style.toFontString();const s=this.context,i=Mh.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),r=i.width,n=i.height,a=i.lines,o=i.lineHeight,h=i.lineWidths,l=i.maxLineWidth,u=i.fontProperties;let d,c;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,r)+2*e.padding)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,n)+2*e.padding)*this._resolution),s.scale(this._resolution,this._resolution),s.clearRect(0,0,this.canvas.width,this.canvas.height),s.font=this._font,s.lineWidth=e.strokeThickness,s.textBaseline=e.textBaseline,s.lineJoin=e.lineJoin,s.miterLimit=e.miterLimit;const p=e.dropShadow?2:1;for(let t=0;t<p;++t){const r=e.dropShadow&&0===t,p=r?Math.ceil(Math.max(1,n)+2*e.padding):0,f=p*this._resolution;if(r){s.fillStyle="black",s.strokeStyle="black";const t=e.dropShadowColor,i=e.dropShadowBlur*this._resolution,r=e.dropShadowDistance*this._resolution;s.shadowColor=Ie.shared.setValue(t).setAlpha(e.dropShadowAlpha).toRgbaString(),s.shadowBlur=i,s.shadowOffsetX=Math.cos(e.dropShadowAngle)*r,s.shadowOffsetY=Math.sin(e.dropShadowAngle)*r+f}else s.fillStyle=this._generateFillStyle(e,a,i),s.strokeStyle=e.stroke,s.shadowColor="black",s.shadowBlur=0,s.shadowOffsetX=0,s.shadowOffsetY=0;let m=(o-u.fontSize)/2;o-u.fontSize<0&&(m=0);for(let t=0;t<a.length;t++)d=e.strokeThickness/2,c=e.strokeThickness/2+t*o+u.ascent+m,"right"===e.align?d+=l-h[t]:"center"===e.align&&(d+=(l-h[t])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(a[t],d+e.padding,c+e.padding-p,!0),e.fill&&this.drawLetterSpacing(a[t],d+e.padding,c+e.padding-p)}this.updateTexture()}drawLetterSpacing(t,e,s,i=!1){const r=this._style.letterSpacing;let n=!1;if(Mh.experimentalLetterSpacingSupported&&(Mh.experimentalLetterSpacing?(this.context.letterSpacing=`${r}px`,this.context.textLetterSpacing=`${r}px`,n=!0):(this.context.letterSpacing="0px",this.context.textLetterSpacing="0px")),0===r||n)return void(i?this.context.strokeText(t,e,s):this.context.fillText(t,e,s));let a=e;const o=Mh.graphemeSegmenter(t);let h=this.context.measureText(t).width,l=0;for(let t=0;t<o.length;++t){const e=o[t];i?this.context.strokeText(e,a,s):this.context.fillText(e,a,s);let n="";for(let e=t+1;e<o.length;++e)n+=o[e];l=this.context.measureText(n).width,a+=h-l+r,h=l}}updateTexture(){const t=this.canvas;if(this._style.trim){const e=Je(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}const e=this._texture,s=this._style,i=s.trim?0:s.padding,r=e.baseTexture;e.trim.width=e._frame.width=t.width/this._resolution,e.trim.height=e._frame.height=t.height/this._resolution,e.trim.x=-i,e.trim.y=-i,e.orig.width=e._frame.width-2*i,e.orig.height=e._frame.height-2*i,this._onTextureUpdate(),r.setRealSize(t.width,t.height,this._resolution),e.updateUvs(),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}updateTransform(){this.updateText(!0),super.updateTransform()}getBounds(t,e){return this.updateText(!0),-1===this._textureID&&(t=!1),super.getBounds(t,e)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds.call(this,t)}_calculateBounds(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_generateFillStyle(t,e,s){const i=t.fill;if(!Array.isArray(i))return i;if(1===i.length)return i[0];let r;const n=t.dropShadow?t.dropShadowDistance:0,a=t.padding||0,o=this.canvas.width/this._resolution-n-2*a,h=this.canvas.height/this._resolution-n-2*a,l=i.slice(),u=t.fillGradientStops.slice();if(!u.length){const t=l.length+1;for(let e=1;e<t;++e)u.push(e/t)}if(l.unshift(i[0]),u.unshift(0),l.push(i[i.length-1]),u.push(1),t.fillGradientType===Sh.LINEAR_VERTICAL){r=this.context.createLinearGradient(o/2,a,o/2,h+a);const i=s.fontProperties.fontSize+t.strokeThickness;for(let t=0;t<e.length;t++){const n=s.lineHeight*(t-1)+i,a=s.lineHeight*t;let o=a;t>0&&n>a&&(o=(a+n)/2);const d=a+i,c=s.lineHeight*(t+1);let p=d;t+1<e.length&&c<d&&(p=(d+c)/2);const f=(p-o)/h;for(let t=0;t<l.length;t++){let e=0;e="number"==typeof u[t]?u[t]:t/l.length;let s=Math.min(1,Math.max(0,o/h+e*f));s=Number(s.toFixed(5)),r.addColorStop(s,l[t])}}}else{r=this.context.createLinearGradient(a,h/2,o+a,h/2);const t=l.length+1;let e=1;for(let s=0;s<l.length;s++){let i;i="number"==typeof u[s]?u[s]:e/t,r.addColorStop(i,l[s]),e++}}return r}destroy(t){"boolean"==typeof t&&(t={children:t}),t=Object.assign({},Bh,t),super.destroy(t),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this.updateText(!0);const e=Xe(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this.updateText(!0);const e=Xe(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}get style(){return this._style}set style(t){t=t||{},this._style=t instanceof Ph?t:new Ph(t),this.localStyleID=-1,this.dirty=!0}get text(){return this._text}set text(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}};let Lh=Nh;Lh.defaultAutoResolution=!0;class Gh{constructor(t){this.maxItemsPerFrame=t,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-- >0}}function Uh(t,e){var s;let i=!1;if(null!=(s=null==t?void 0:t._textures)&&s.length)for(let s=0;s<t._textures.length;s++)if(t._textures[s]instanceof Wi){const r=t._textures[s].baseTexture;e.includes(r)||(e.push(r),i=!0)}return i}function kh(t,e){if(t.baseTexture instanceof ys){const s=t.baseTexture;return e.includes(s)||e.push(s),!0}return!1}function Xh(t,e){if(t._texture&&t._texture instanceof Wi){const s=t._texture.baseTexture;return e.includes(s)||e.push(s),!0}return!1}function Hh(t,e){return e instanceof Lh&&(e.updateText(!0),!0)}function Vh(t,e){if(e instanceof Ph){const t=e.toFontString();return Mh.measureFont(t),!0}return!1}function zh(t,e){if(t instanceof Lh){e.includes(t.style)||e.push(t.style),e.includes(t)||e.push(t);const s=t._texture.baseTexture;return e.includes(s)||e.push(s),!0}return!1}function Wh(t,e){return t instanceof Ph&&(e.includes(t)||e.push(t),!0)}const Yh=class{constructor(t){this.limiter=new Gh(Yh.uploadsPerFrame),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=()=>{!this.queue||this.prepareItems()},this.registerFindHook(zh),this.registerFindHook(Wh),this.registerFindHook(Uh),this.registerFindHook(kh),this.registerFindHook(Xh),this.registerUploadHook(Hh),this.registerUploadHook(Vh)}upload(t){return new Promise((e=>{t&&this.add(t),this.queue.length?(this.completes.push(e),this.ticking||(this.ticking=!0,$r.system.addOnce(this.tick,this,Wr.UTILITY))):e()}))}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const t=this.queue[0];let e=!1;if(t&&!t._destroyed)for(let s=0,i=this.uploadHooks.length;s<i;s++)if(this.uploadHooks[s](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)$r.system.addOnce(this.tick,this,Wr.UTILITY);else{this.ticking=!1;const t=this.completes.slice(0);this.completes.length=0;for(let e=0,s=t.length;e<s;e++)t[e]()}}registerFindHook(t){return t&&this.addHooks.push(t),this}registerUploadHook(t){return t&&this.uploadHooks.push(t),this}add(t){for(let e=0,s=this.addHooks.length;e<s&&!this.addHooks[e](t,this.queue);e++);if(t instanceof En)for(let e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this}destroy(){this.ticking&&$r.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};let jh=Yh;function $h(t,e){return e instanceof ys&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function qh(t,e){if(!(e instanceof ch))return!1;const{geometry:s}=e;e.finishPoly(),s.updateBatches();const{batches:i}=s;for(let e=0;e<i.length;e++){const{texture:s}=i[e].style;s&&$h(t,s.baseTexture)}return s.batchable||t.geometry.bind(s,e._resolveDirectShader(t)),!0}function Kh(t,e){return t instanceof ch&&(e.push(t),!0)}jh.uploadsPerFrame=4,Object.defineProperties(A,{UPLOADS_PER_FRAME:{get:()=>jh.uploadsPerFrame,set(t){Kt("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),jh.uploadsPerFrame=t}}});class Zh extends jh{constructor(t){super(t),this.uploadHookHelper=this.renderer,this.registerFindHook(Kh),this.registerUploadHook($h),this.registerUploadHook(qh)}}Zh.extension={name:"prepare",type:rs.RendererSystem},os.add(Zh);class Qh extends Sn{constructor(t,e=!0){super(t[0]instanceof Wi?t[0]:t[0].texture),this._textures=null,this._durations=null,this._autoUpdate=e,this._isConnectedToTicker=!1,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=t}stop(){!this._playing||(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&($r.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&($r.shared.add(this.update,this,Wr.HIGH),this._isConnectedToTicker=!0))}gotoAndStop(t){this.stop(),this.currentFrame=t}gotoAndPlay(t){this.currentFrame=t,this.play()}update(t){if(!this._playing)return;const e=this.animationSpeed*t,s=this.currentFrame;if(null!==this._durations){let s=this._currentTime%1*this._durations[this.currentFrame];for(s+=e/60*1e3;s<0;)this._currentTime--,s+=this._durations[this.currentFrame];const i=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);s>=this._durations[this.currentFrame];)s-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=s/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):s!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<s||this.animationSpeed<0&&this.currentFrame>s)&&this.onLoop(),this.updateTexture())}updateTexture(){const t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(t){this.stop(),super.destroy(t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){const e=[];for(let s=0;s<t.length;++s)e.push(Wi.from(t[s]));return new Qh(e)}static fromImages(t){const e=[];for(let s=0;s<t.length;++s)e.push(Wi.from(t[s]));return new Qh(e)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(t){if(t[0]instanceof Wi)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(let e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()}get currentFrame(){let t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t}set currentFrame(t){if(t<0||t>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${t}, expected to be between 0 and totalFrames ${this.totalFrames}.`);const e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?($r.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&($r.shared.add(this.update,this),this._isConnectedToTicker=!0))}}const Jh=new Bs;class tl extends Sn{constructor(t,e=100,s=100){super(t),this.tileTransform=new Js,this._width=e,this._height=s,this.uvMatrix=this.texture.uvMatrix||new or(t),this.pluginName="tilingSprite",this.uvRespectAnchor=!1}get clampMargin(){return this.uvMatrix.clampMargin}set clampMargin(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)}get tileScale(){return this.tileTransform.scale}set tileScale(t){this.tileTransform.scale.copyFrom(t)}get tilePosition(){return this.tileTransform.position}set tilePosition(t){this.tileTransform.position.copyFrom(t)}_onTextureUpdate(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215}_render(t){const e=this._texture;!e||!e.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))}_calculateBounds(){const t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,s=this._width*(1-this._anchor._x),i=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,s,i)}getLocalBounds(t){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new Ls),t=this._localBoundsRect),this._bounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,Jh);const e=this._width,s=this._height,i=-e*this.anchor._x;if(Jh.x>=i&&Jh.x<i+e){const t=-s*this.anchor._y;if(Jh.y>=t&&Jh.y<t+s)return!0}return!1}destroy(t){super.destroy(t),this.tileTransform=null,this.uvMatrix=null}static from(t,e){const s=t instanceof Wi?t:Wi.from(t,e);return new tl(s,e.width,e.height)}get width(){return this._width}set width(t){this._width=t}get height(){return this._height}set height(t){this._height=t}}var el="#version 100\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n";const sl=new Hs;class il extends Ii{constructor(t){super(t),t.runners.contextChange.add(this),this.quad=new qi,this.state=cs.for2d()}contextChange(){const t=this.renderer,e={globals:t.globalUniforms};this.simpleShader=Ri.from(el,"#version 100\n#define SHADER_NAME Tiling-Sprite-Simple-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n    vec4 texSample = texture2D(uSampler, vTextureCoord);\n    gl_FragColor = texSample * uColor;\n}\n",e),this.shader=t.context.webGLVersion>1?Ri.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n    vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n    coord = (uMapCoord * vec3(coord, 1.0)).xy;\n    vec2 unclamped = coord;\n    coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n    vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n    fragmentColor = texSample * uColor;\n}\n",e):Ri.from(el,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n    #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n    vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n    coord = (uMapCoord * vec3(coord, 1.0)).xy;\n    vec2 unclamped = coord;\n    coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n    #ifdef GL_EXT_shader_texture_lod\n        vec4 texSample = unclamped == coord\n            ? texture2D(uSampler, coord) \n            : texture2DLodEXT(uSampler, coord, 0);\n    #else\n        vec4 texSample = texture2D(uSampler, coord);\n    #endif\n\n    gl_FragColor = texSample * uColor;\n}\n",e)}render(t){const e=this.renderer,s=this.quad;let i=s.vertices;i[0]=i[6]=t._width*-t.anchor.x,i[1]=i[3]=t._height*-t.anchor.y,i[2]=i[4]=t._width*(1-t.anchor.x),i[5]=i[7]=t._height*(1-t.anchor.y);const r=t.uvRespectAnchor?t.anchor.x:0,n=t.uvRespectAnchor?t.anchor.y:0;i=s.uvs,i[0]=i[6]=-r,i[1]=i[3]=-n,i[2]=i[4]=1-r,i[5]=i[7]=1-n,s.invalidate();const a=t._texture,o=a.baseTexture,h=o.alphaMode>0,l=t.tileTransform.localTransform,u=t.uvMatrix;let d=o.isPowerOfTwo&&a.frame.width===o.width&&a.frame.height===o.height;d&&(o._glTextures[e.CONTEXT_UID]?d=o.wrapMode!==p.CLAMP:o.wrapMode===p.CLAMP&&(o.wrapMode=p.REPEAT));const c=d?this.simpleShader:this.shader,f=a.width,m=a.height,_=t._width,g=t._height;sl.set(l.a*f/_,l.b*f/g,l.c*m/_,l.d*m/g,l.tx/_,l.ty/g),sl.invert(),d?sl.prepend(u.mapCoord):(c.uniforms.uMapCoord=u.mapCoord.toArray(!0),c.uniforms.uClampFrame=u.uClampFrame,c.uniforms.uClampOffset=u.uClampOffset),c.uniforms.uTransform=sl.toArray(!0),c.uniforms.uColor=Ie.shared.setValue(t.tint).premultiply(t.worldAlpha,h).toArray(c.uniforms.uColor),c.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),c.uniforms.uSampler=a,e.shader.bind(c),e.geometry.bind(s),this.state.blendMode=Pe(t.blendMode,h),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}il.extension={name:"tilingSprite",type:rs.RendererPlugin},os.add(il);const rl=class{constructor(t,e,s=null){this.linkedSheets=[],this._texture=t instanceof Wi?t:null,this.baseTexture=t instanceof ys?t:this._texture.baseTexture,this.textures={},this.animations={},this.data=e;const i=this.baseTexture.resource;this.resolution=this._updateResolution(s||(i?i.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(t=null){const{scale:e}=this.data.meta;let s=ss(t,null);return null===s&&(s=parseFloat(null!=e?e:"1")),1!==s&&this.baseTexture.setResolution(s),s}parse(){return new Promise((t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=rl.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()}))}_processFrames(t){let e=t;const s=rl.BATCH_SIZE;for(;e-t<s&&e<this._frameKeys.length;){const t=this._frameKeys[e],s=this._frames[t],i=s.frame;if(i){let e=null,r=null;const n=!1!==s.trimmed&&s.sourceSize?s.sourceSize:s.frame,a=new Ls(0,0,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution);e=s.rotated?new Ls(Math.floor(i.x)/this.resolution,Math.floor(i.y)/this.resolution,Math.floor(i.h)/this.resolution,Math.floor(i.w)/this.resolution):new Ls(Math.floor(i.x)/this.resolution,Math.floor(i.y)/this.resolution,Math.floor(i.w)/this.resolution,Math.floor(i.h)/this.resolution),!1!==s.trimmed&&s.spriteSourceSize&&(r=new Ls(Math.floor(s.spriteSourceSize.x)/this.resolution,Math.floor(s.spriteSourceSize.y)/this.resolution,Math.floor(i.w)/this.resolution,Math.floor(i.h)/this.resolution)),this.textures[t]=new Wi(this.baseTexture,e,a,r,s.rotated?2:0,s.anchor,s.borders),Wi.addToCache(this.textures[t],t)}e++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let s=0;s<t[e].length;s++){const i=t[e][s];this.animations[e].push(this.textures[i])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*rl.BATCH_SIZE),this._batchIndex++,setTimeout((()=>{this._batchIndex*rl.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())}),0)}destroy(t=!1){var e;for(const t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(null==(e=this._texture)||e.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]}};let nl=rl;nl.BATCH_SIZE=1e3;const al=["jpg","png","jpeg","avif","webp"];function ol(t,e,s){const i={};if(t.forEach((t=>{i[t]=e})),Object.keys(e.textures).forEach((t=>{i[t]=e.textures[t]})),!s){const s=$t.dirname(t[0]);e.linkedSheets.forEach(((t,r)=>{const n=ol([`${s}/${e.data.meta.related_multi_packs[r]}`],t,!0);Object.assign(i,n)}))}return i}const hl={extension:rs.Asset,cache:{test:t=>t instanceof nl,getCacheableAssets:(t,e)=>ol(t,e,!1)},resolver:{test:t=>{const e=t.split("?")[0].split("."),s=e.pop(),i=e.pop();return"json"===s&&al.includes(i)},parse:t=>{var e,s;const i=t.split(".");return{resolution:parseFloat(null!=(s=null==(e=A.RETINA_PREFIX.exec(t))?void 0:e[1])?s:"1"),format:i[i.length-2],src:t}}},loader:{name:"spritesheetLoader",extension:{type:rs.LoadParser,priority:ma.Normal},testParse:async(t,e)=>".json"===$t.extname(e.src).toLowerCase()&&!!t.frames,async parse(t,e,s){var i,r;let n=$t.dirname(e.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");let a=n+t.meta.image;a=la(a,e.src);const o=(await s.load([a]))[a],h=new nl(o.baseTexture,t,e.src);await h.parse();const l=null==(i=null==t?void 0:t.meta)?void 0:i.related_multi_packs;if(Array.isArray(l)){const t=[];for(const i of l){if("string"!=typeof i)continue;let a=n+i;null!=(r=e.data)&&r.ignoreMultiPack||(a=la(a,e.src),t.push(s.load({src:a,data:{ignoreMultiPack:!0}})))}const i=await Promise.all(t);h.linkedSheets=i,i.forEach((t=>{t.linkedSheets=[h].concat(h.linkedSheets.filter((e=>e!==t)))}))}return h},unload(t){t.destroy(!0)}}};os.add(hl);class ll{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class ul{static test(t){return"string"==typeof t&&t.startsWith("info face=")}static parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),s={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const t in e){const i=e[t].match(/^[a-z]+/gm)[0],r=e[t].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),n={};for(const t in r){const e=r[t].split("="),s=e[0],i=e[1].replace(/"/gm,""),a=parseFloat(i),o=isNaN(a)?i:a;n[s]=o}s[i].push(n)}const i=new ll;return s.info.forEach((t=>i.info.push({face:t.face,size:parseInt(t.size,10)}))),s.common.forEach((t=>i.common.push({lineHeight:parseInt(t.lineHeight,10)}))),s.page.forEach((t=>i.page.push({id:parseInt(t.id,10),file:t.file}))),s.char.forEach((t=>i.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)}))),s.kerning.forEach((t=>i.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)}))),s.distanceField.forEach((t=>i.distanceField.push({distanceRange:parseInt(t.distanceRange,10),fieldType:t.fieldType}))),i}}class dl{static test(t){const e=t;return"getElementsByTagName"in e&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")}static parse(t){const e=new ll,s=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),r=t.getElementsByTagName("page"),n=t.getElementsByTagName("char"),a=t.getElementsByTagName("kerning"),o=t.getElementsByTagName("distanceField");for(let t=0;t<s.length;t++)e.info.push({face:s[t].getAttribute("face"),size:parseInt(s[t].getAttribute("size"),10)});for(let t=0;t<i.length;t++)e.common.push({lineHeight:parseInt(i[t].getAttribute("lineHeight"),10)});for(let t=0;t<r.length;t++)e.page.push({id:parseInt(r[t].getAttribute("id"),10)||0,file:r[t].getAttribute("file")});for(let t=0;t<n.length;t++){const s=n[t];e.char.push({id:parseInt(s.getAttribute("id"),10),page:parseInt(s.getAttribute("page"),10)||0,x:parseInt(s.getAttribute("x"),10),y:parseInt(s.getAttribute("y"),10),width:parseInt(s.getAttribute("width"),10),height:parseInt(s.getAttribute("height"),10),xoffset:parseInt(s.getAttribute("xoffset"),10),yoffset:parseInt(s.getAttribute("yoffset"),10),xadvance:parseInt(s.getAttribute("xadvance"),10)})}for(let t=0;t<a.length;t++)e.kerning.push({first:parseInt(a[t].getAttribute("first"),10),second:parseInt(a[t].getAttribute("second"),10),amount:parseInt(a[t].getAttribute("amount"),10)});for(let t=0;t<o.length;t++)e.distanceField.push({fieldType:o[t].getAttribute("fieldType"),distanceRange:parseInt(o[t].getAttribute("distanceRange"),10)});return e}}class cl{static test(t){return!("string"!=typeof t||!t.includes("<font>"))&&dl.test(A.ADAPTER.parseXML(t))}static parse(t){return dl.parse(A.ADAPTER.parseXML(t))}}const pl=[ul,dl,cl];function fl(t){for(let e=0;e<pl.length;e++)if(pl[e].test(t))return pl[e];return null}function ml(t,e,s,i,r,n,a){const o=s.text,h=s.fontProperties;e.translate(i,r),e.scale(n,n);const l=a.strokeThickness/2,u=-a.strokeThickness/2;if(e.font=a.toFontString(),e.lineWidth=a.strokeThickness,e.textBaseline=a.textBaseline,e.lineJoin=a.lineJoin,e.miterLimit=a.miterLimit,e.fillStyle=function(t,e,s,i,r,n){const a=s.fill;if(!Array.isArray(a))return a;if(1===a.length)return a[0];let o;const h=s.dropShadow?s.dropShadowDistance:0,l=s.padding||0,u=t.width/i-h-2*l,d=t.height/i-h-2*l,c=a.slice(),p=s.fillGradientStops.slice();if(!p.length){const t=c.length+1;for(let e=1;e<t;++e)p.push(e/t)}if(c.unshift(a[0]),p.unshift(0),c.push(a[a.length-1]),p.push(1),s.fillGradientType===Sh.LINEAR_VERTICAL){o=e.createLinearGradient(u/2,l,u/2,d+l);let t=0;const i=(n.fontProperties.fontSize+s.strokeThickness)/d;for(let e=0;e<r.length;e++){const s=n.lineHeight*e;for(let e=0;e<c.length;e++){let r=0;r="number"==typeof p[e]?p[e]:e/c.length;const n=s/d+r*i;let a=Math.max(t,n);a=Math.min(a,1),o.addColorStop(a,c[e]),t=a}}}else{o=e.createLinearGradient(l,d/2,u+l,d/2);const t=c.length+1;let s=1;for(let e=0;e<c.length;e++){let i;i="number"==typeof p[e]?p[e]:s/t,o.addColorStop(i,c[e]),s++}}return o}(t,e,a,n,[o],s),e.strokeStyle=a.stroke,a.dropShadow){const t=a.dropShadowColor,s=a.dropShadowBlur*n,i=a.dropShadowDistance*n;e.shadowColor=Ie.shared.setValue(t).setAlpha(a.dropShadowAlpha).toRgbaString(),e.shadowBlur=s,e.shadowOffsetX=Math.cos(a.dropShadowAngle)*i,e.shadowOffsetY=Math.sin(a.dropShadowAngle)*i}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;a.stroke&&a.strokeThickness&&e.strokeText(o,l,u+s.lineHeight-h.descent),a.fill&&e.fillText(o,l,u+s.lineHeight-h.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function _l(t){return t.codePointAt?t.codePointAt(0):t.charCodeAt(0)}function gl(t){return Array.from?Array.from(t):t.split("")}const xl=class{constructor(t,e,s){var i,r;const[n]=t.info,[a]=t.common,[o]=t.page,[h]=t.distanceField,l=ss(o.file),u={};this._ownsTextures=s,this.font=n.face,this.size=n.size,this.lineHeight=a.lineHeight/l,this.chars={},this.pageTextures=u;for(let s=0;s<t.page.length;s++){const{id:i,file:r}=t.page[s];u[i]=e instanceof Array?e[s]:e[r],(null==h?void 0:h.fieldType)&&"none"!==h.fieldType&&(u[i].baseTexture.alphaMode=m.NO_PREMULTIPLIED_ALPHA,u[i].baseTexture.mipmap=f.OFF)}for(let e=0;e<t.char.length;e++){const{id:s,page:i}=t.char[e];let{x:r,y:n,width:a,height:o,xoffset:h,yoffset:d,xadvance:c}=t.char[e];r/=l,n/=l,a/=l,o/=l,h/=l,d/=l,c/=l;const p=new Ls(r+u[i].frame.x/l,n+u[i].frame.y/l,a,o);this.chars[s]={xOffset:h,yOffset:d,xAdvance:c,kerning:{},texture:new Wi(u[i].baseTexture,p),page:i}}for(let e=0;e<t.kerning.length;e++){let{first:s,second:i,amount:r}=t.kerning[e];s/=l,i/=l,r/=l,this.chars[i]&&(this.chars[i].kerning[s]=r)}this.distanceFieldRange=null==h?void 0:h.distanceRange,this.distanceFieldType=null!=(r=null==(i=null==h?void 0:h.fieldType)?void 0:i.toLowerCase())?r:"none"}destroy(){for(const t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(const t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null}static install(t,e,s){let i;if(t instanceof ll)i=t;else{const e=fl(t);if(!e)throw new Error("Unrecognized data format for font.");i=e.parse(t)}e instanceof Wi&&(e=[e]);const r=new xl(i,e,s);return xl.available[r.font]=r,r}static uninstall(t){const e=xl.available[t];if(!e)throw new Error(`No font found named '${t}'`);e.destroy(),delete xl.available[t]}static from(t,e,s){if(!t)throw new Error("[BitmapFont] Property `name` is required.");const i=Object.assign({},xl.defaultOptions,s),{chars:r,padding:n,resolution:a,textureWidth:o,textureHeight:h}=i,l=zn(i,["chars","padding","resolution","textureWidth","textureHeight"]),u=function(t){"string"==typeof t&&(t=[t]);const e=[];for(let s=0,i=t.length;s<i;s++){const i=t[s];if(Array.isArray(i)){if(2!==i.length)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${i.length}.`);const t=i[0].charCodeAt(0),s=i[1].charCodeAt(0);if(s<t)throw new Error("[BitmapFont]: Invalid character range.");for(let i=t,r=s;i<=r;i++)e.push(String.fromCharCode(i))}else e.push(...gl(i))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(r),d=e instanceof Ph?e:new Ph(e),c=o,p=new ll;p.info[0]={face:d.fontFamily,size:d.fontSize},p.common[0]={lineHeight:d.fontSize};let f,m,_,g=0,x=0,v=0;const y=[],T=[];for(let t=0;t<u.length;t++){f||(f=A.ADAPTER.createCanvas(),f.width=o,f.height=h,m=f.getContext("2d"),_=new ys(f,bt({resolution:a},l)),y.push(_),T.push(new Wi(_)),p.page.push({id:T.length-1,file:""}));const e=u[t],s=Mh.measureText(e,d,!1,f),i=s.width,r=Math.ceil(s.height),b=Math.ceil(("italic"===d.fontStyle?2:1)*i);if(x>=h-r*a){if(0===x)throw new Error(`[BitmapFont] textureHeight ${h}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${e}')`);--t,f=null,m=null,_=null,x=0,g=0,v=0;continue}if(v=Math.max(r+s.fontProperties.descent,v),b*a+g>=c){if(0===g)throw new Error(`[BitmapFont] textureWidth ${o}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${e}')`);--t,x+=v*a,x=Math.ceil(x),g=0,v=0;continue}ml(f,m,s,g,x,a,d);const E=_l(s.text);p.char.push({id:E,page:T.length-1,x:g/a,y:x/a,width:b,height:r,xoffset:0,yoffset:0,xadvance:i-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0)}),g+=(b+2*n)*a,g=Math.ceil(g)}for(let t=0,e=u.length;t<e;t++){const s=u[t];for(let t=0;t<e;t++){const e=u[t],i=m.measureText(s).width,r=m.measureText(e).width,n=m.measureText(s+e).width-(i+r);n&&p.kerning.push({first:_l(s),second:_l(e),amount:n})}}const b=new xl(p,T,!0);return void 0!==xl.available[t]&&xl.uninstall(t),xl.available[t]=b,b}};let vl=xl;vl.ALPHA=[["a","z"],["A","Z"]," "],vl.NUMERIC=[["0","9"]],vl.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],vl.ASCII=[[" ","~"]],vl.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:xl.ALPHANUMERIC},vl.available={};const yl=[],Tl=[],bl=[],El=class extends En{constructor(t,e={}){super();const{align:s,tint:i,maxWidth:r,letterSpacing:n,fontName:a,fontSize:o}=Object.assign({},El.styleDefaults,e);if(!vl.available[a])throw new Error(`Missing BitmapFont "${a}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=s,this._tintColor=new Ie(i),this._font=void 0,this._fontName=a,this._fontSize=o,this.text=t,this._maxWidth=r,this._maxLineHeight=0,this._letterSpacing=n,this._anchor=new Zs((()=>{this.dirty=!0}),this,0,0),this._roundPixels=A.ROUND_PIXELS,this.dirty=!0,this._resolution=A.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var t;const e=vl.available[this._fontName],s=this.fontSize,i=s/e.size,r=new Bs,n=[],o=[],h=[],l=gl(this._text.replace(/(?:\r\n|\r)/g,"\n")||" "),u=this._maxWidth*e.size/s,d="none"===e.distanceFieldType?yl:Tl;let c=null,p=0,f=0,m=0,_=-1,g=0,x=0,v=0,y=0;for(let t=0;t<l.length;t++){const s=l[t],i=_l(s);if(/(?:\s)/.test(s)&&(_=t,g=p,y++),"\r"===s||"\n"===s){o.push(p),h.push(-1),f=Math.max(f,p),++m,++x,r.x=0,r.y+=e.lineHeight,c=null,y=0;continue}const a=e.chars[i];if(!a)continue;c&&a.kerning[c]&&(r.x+=a.kerning[c]);const d=bl.pop()||{texture:Wi.EMPTY,line:0,charCode:0,prevSpaces:0,position:new Bs};d.texture=a.texture,d.line=m,d.charCode=i,d.position.x=Math.round(r.x+a.xOffset+this._letterSpacing/2),d.position.y=Math.round(r.y+a.yOffset),d.prevSpaces=y,n.push(d),p=d.position.x+Math.max(a.xAdvance-a.xOffset,a.texture.orig.width),r.x+=a.xAdvance+this._letterSpacing,v=Math.max(v,a.yOffset+a.texture.height),c=i,-1!==_&&u>0&&r.x>u&&(++x,ke(n,1+_-x,1+t-_),t=_,_=-1,o.push(g),h.push(n.length>0?n[n.length-1].prevSpaces:0),f=Math.max(f,g),m++,r.x=0,r.y+=e.lineHeight,c=null,y=0)}const T=l[l.length-1];"\r"!==T&&"\n"!==T&&(/(?:\s)/.test(T)&&(p=g),o.push(p),f=Math.max(f,p),h.push(-1));const b=[];for(let t=0;t<=m;t++){let e=0;"right"===this._align?e=f-o[t]:"center"===this._align?e=(f-o[t])/2:"justify"===this._align&&(e=h[t]<0?0:(f-o[t])/h[t]),b.push(e)}const E=n.length,A={},R=[],S=this._activePagesMeshData;d.push(...S);for(let t=0;t<E;t++){const s=n[t].texture,i=s.baseTexture.uid;if(!A[i]){let t=d.pop();if(!t){const s=new vh;let i,r;"none"===e.distanceFieldType?(i=new yh(Wi.EMPTY),r=a.NORMAL):(i=new yh(Wi.EMPTY,{program:bi.from("// Mesh material default fragment\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n    vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n","// Pixi texture info\r\nvarying vec2 vTextureCoord;\r\nuniform sampler2D uSampler;\r\n\r\n// Tint\r\nuniform vec4 uColor;\r\n\r\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r\nuniform float uFWidth;\r\n\r\nvoid main(void) {\r\n\r\n  // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r\n  vec4 texColor = texture2D(uSampler, vTextureCoord);\r\n\r\n  // MSDF\r\n  float median = texColor.r + texColor.g + texColor.b -\r\n                  min(texColor.r, min(texColor.g, texColor.b)) -\r\n                  max(texColor.r, max(texColor.g, texColor.b));\r\n  // SDF\r\n  median = min(median, texColor.a);\r\n\r\n  float screenPxDistance = uFWidth * (median - 0.5);\r\n  float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r\n  if (median < 0.01) {\r\n    alpha = 0.0;\r\n  } else if (median > 0.99) {\r\n    alpha = 1.0;\r\n  }\r\n\r\n  // Gamma correction for coverage-like alpha\r\n  float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r\n  float gamma = mix(1.0, 1.0 / 2.2, luma);\r\n  float coverage = pow(uColor.a * alpha, gamma);  \r\n\r\n  // NPM Textures, NPM outputs\r\n  gl_FragColor = vec4(uColor.rgb, coverage);\r\n}\r\n"),uniforms:{uFWidth:0}}),r=a.NORMAL_NPM);const n=new xh(s,i);n.blendMode=r,t={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:n,vertices:null,uvs:null,indices:null}}t.index=0,t.indexCount=0,t.vertexCount=0,t.uvsCount=0,t.total=0;const{_textureCache:r}=this;r[i]=r[i]||new Wi(s.baseTexture),t.mesh.texture=r[i],t.mesh.tint=this._tintColor.value,R.push(t),A[i]=t}A[i].total++}for(let t=0;t<S.length;t++)R.includes(S[t])||this.removeChild(S[t].mesh);for(let t=0;t<R.length;t++)R[t].mesh.parent!==this&&this.addChild(R[t].mesh);this._activePagesMeshData=R;for(const e in A){const s=A[e],i=s.total;if(!((null==(t=s.indices)?void 0:t.length)>6*i)||s.vertices.length<2*xh.BATCHABLE_SIZE)s.vertices=new Float32Array(8*i),s.uvs=new Float32Array(8*i),s.indices=new Uint16Array(6*i);else{const t=s.total,e=s.vertices;for(let s=4*t*2;s<e.length;s++)e[s]=0}s.mesh.size=6*i}for(let t=0;t<E;t++){const e=n[t];let s=e.position.x+b[e.line]*("justify"===this._align?e.prevSpaces:1);this._roundPixels&&(s=Math.round(s));const r=s*i,a=e.position.y*i,o=e.texture,h=A[o.baseTexture.uid],l=o.frame,u=o._uvs,d=h.index++;h.indices[6*d+0]=0+4*d,h.indices[6*d+1]=1+4*d,h.indices[6*d+2]=2+4*d,h.indices[6*d+3]=0+4*d,h.indices[6*d+4]=2+4*d,h.indices[6*d+5]=3+4*d,h.vertices[8*d+0]=r,h.vertices[8*d+1]=a,h.vertices[8*d+2]=r+l.width*i,h.vertices[8*d+3]=a,h.vertices[8*d+4]=r+l.width*i,h.vertices[8*d+5]=a+l.height*i,h.vertices[8*d+6]=r,h.vertices[8*d+7]=a+l.height*i,h.uvs[8*d+0]=u.x0,h.uvs[8*d+1]=u.y0,h.uvs[8*d+2]=u.x1,h.uvs[8*d+3]=u.y1,h.uvs[8*d+4]=u.x2,h.uvs[8*d+5]=u.y2,h.uvs[8*d+6]=u.x3,h.uvs[8*d+7]=u.y3}this._textWidth=f*i,this._textHeight=(r.y+e.lineHeight)*i;for(const t in A){const e=A[t];if(0!==this.anchor.x||0!==this.anchor.y){let t=0;const s=this._textWidth*this.anchor.x,i=this._textHeight*this.anchor.y;for(let r=0;r<e.total;r++)e.vertices[t++]-=s,e.vertices[t++]-=i,e.vertices[t++]-=s,e.vertices[t++]-=i,e.vertices[t++]-=s,e.vertices[t++]-=i,e.vertices[t++]-=s,e.vertices[t++]-=i}this._maxLineHeight=v*i;const s=e.mesh.geometry.getBuffer("aVertexPosition"),r=e.mesh.geometry.getBuffer("aTextureCoord"),n=e.mesh.geometry.getIndex();s.data=e.vertices,r.data=e.uvs,n.data=e.indices,s.update(),r.update(),n.update()}for(let t=0;t<n.length;t++)bl.push(n[t]);this._font=e,this.dirty=!1}updateTransform(){this.validate(),this.containerUpdateTransform()}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0);const{distanceFieldRange:e,distanceFieldType:s,size:i}=vl.available[this._fontName];if("none"!==s){const{a:s,b:r,c:n,d:a}=this.worldTransform,o=Math.sqrt(s*s+r*r),h=Math.sqrt(n*n+a*a),l=(Math.abs(o)+Math.abs(h))/2,u=this.fontSize/i,d=t._view.resolution;for(const t of this._activePagesMeshData)t.mesh.shader.uniforms.uFWidth=l*e*u*d}super._render(t)}getLocalBounds(){return this.validate(),super.getLocalBounds()}validate(){const t=vl.available[this._fontName];if(!t)throw new Error(`Missing BitmapFont "${this._fontName}"`);this._font!==t&&(this.dirty=!0),this.dirty&&this.updateText()}get tint(){return this._tintColor.value}set tint(t){if(this.tint!==t){this._tintColor.setValue(t);for(let e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.dirty=!0)}get fontName(){return this._fontName}set fontName(t){if(!vl.available[t])throw new Error(`Missing BitmapFont "${t}"`);this._fontName!==t&&(this._fontName=t,this.dirty=!0)}get fontSize(){var t;return null!=(t=this._fontSize)?t:vl.available[this._fontName].size}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)}get anchor(){return this._anchor}set anchor(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)}get text(){return this._text}set text(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)}get maxWidth(){return this._maxWidth}set maxWidth(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)}get maxLineHeight(){return this.validate(),this._maxLineHeight}get textWidth(){return this.validate(),this._textWidth}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)}get roundPixels(){return this._roundPixels}set roundPixels(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)}get textHeight(){return this.validate(),this._textHeight}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}destroy(t){const{_textureCache:e}=this,s="none"===vl.available[this._fontName].distanceFieldType?yl:Tl;s.push(...this._activePagesMeshData);for(const t of this._activePagesMeshData)this.removeChild(t.mesh);this._activePagesMeshData=[],s.filter((t=>e[t.mesh.texture.baseTexture.uid])).forEach((t=>{t.mesh.texture=Wi.EMPTY}));for(const t in e)e[t].destroy(),delete e[t];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(t)}};let Al=El;Al.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const Rl=[".xml",".fnt"],Sl={extension:{type:rs.LoadParser,priority:ma.Normal},name:"loadBitmapFont",test:t=>Rl.includes($t.extname(t).toLowerCase()),testParse:async t=>ul.test(t)||cl.test(t),async parse(t,e,s){const i=ul.test(t)?ul.parse(t):cl.parse(t),{src:r}=e,{page:n}=i,a=[];for(let t=0;t<n.length;++t){const e=n[t].file;let s=$t.join($t.dirname(r),e);s=la(s,r),a.push(s)}const o=await s.load(a),h=a.map((t=>o[t]));return vl.install(i,h,!0)},load:async(t,e)=>(await A.ADAPTER.fetch(t)).text(),unload(t){t.destroy()}};os.add(Sl);const wl=class extends Ph{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(t){return new wl(Object.keys(wl.defaultOptions).reduce(((e,s)=>Qi(bt({},e),{[s]:t[s]})),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach((t=>{URL.revokeObjectURL(t.src),t.refs--,0===t.refs&&(t.fontFace&&document.fonts.delete(t.fontFace),delete wl.availableFonts[t.originalUrl])})),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(t,e={}){const{availableFonts:s}=wl;if(s[t]){const e=s[t];return this._fonts.push(e),e.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return A.ADAPTER.fetch(t).then((t=>t.blob())).then((async t=>new Promise(((e,s)=>{const i=URL.createObjectURL(t),r=new FileReader;r.onload=()=>e([i,r.result]),r.onerror=s,r.readAsDataURL(t)})))).then((async([i,r])=>{const n=Object.assign({family:$t.basename(t,$t.extname(t)),weight:"normal",style:"normal",src:i,dataSrc:r,refs:1,originalUrl:t,fontFace:null},e);s[t]=n,this._fonts.push(n),this.styleID++;const a=new FontFace(n.family,`url(${n.src})`,{weight:n.weight,style:n.style});n.fontFace=a,await a.load(),document.fonts.add(a),await document.fonts.ready,this.styleID++,this.fontsDirty=!0}))}addOverride(...t){const e=t.filter((t=>!this._overrides.includes(t)));e.length>0&&(this._overrides.push(...e),this.styleID++)}removeOverride(...t){const e=t.filter((t=>this._overrides.includes(t)));e.length>0&&(this._overrides=this._overrides.filter((t=>!e.includes(t))),this.styleID++)}toCSS(t){return[`transform: scale(${t})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?["word-wrap: "+(this.breakWords?"break-all":"break-word"),`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce(((t,e)=>`${t}\n            @font-face {\n                font-family: "${e.family}";\n                src: url('${e.dataSrc}');\n                font-weight: ${e.weight};\n                font-style: ${e.style}; \n            }`),this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=Ce(t)),"number"==typeof t?Me(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,s=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),i=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(255*e|0).toString(16).padStart(2,"0"));const r=`${s}px ${i}px`;return this.dropShadowBlur>0?`text-shadow: ${r} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${r} ${t}`}reset(){Object.assign(this,wl.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise((t=>setTimeout(t,100))):Promise.resolve()}get isSafari(){const{userAgent:t}=A.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};let Il=wl;Il.availableFonts={},Il.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};const Ml=class extends Sn{constructor(t="",e={}){var s;super(Wi.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this._loading=!1,this.localStyleID=-1,this.dirty=!1,this.ownsStyle=!1;const i=new Image,r=Wi.from(i,{scaleMode:A.SCALE_MODE,resourceOptions:{autoLoad:!1}});r.orig=new Ls,r.trim=new Ls,this.texture=r;const n="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xhtml",o=document.createElementNS(n,"svg"),h=document.createElementNS(n,"foreignObject"),l=document.createElementNS(a,"div"),u=document.createElementNS(a,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",o.appendChild(h),this.maxWidth=Ml.defaultMaxWidth,this.maxHeight=Ml.defaultMaxHeight,this._domElement=l,this._styleElement=u,this._svgRoot=o,this._foreignObject=h,this._foreignObject.appendChild(u),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=Ml.defaultAutoResolution,this._resolution=null!=(s=Ml.defaultResolution)?s:A.RESOLUTION,this.text=t,this.style=e}measureText(t){var e,s;const{text:i,style:r,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:i,style:r.toCSS(n)}),this._styleElement.textContent=r.toGlobalCSS(),document.body.appendChild(this._svgRoot);const a=this._domElement.getBoundingClientRect();this._svgRoot.remove();const o=Math.min(this.maxWidth,Math.ceil(a.width)),h=Math.min(this.maxHeight,Math.ceil(a.height));return this._svgRoot.setAttribute("width",o.toString()),this._svgRoot.setAttribute("height",h.toString()),i!==this._text&&(this._domElement.innerHTML=this._text),r!==this._style&&(Object.assign(this._domElement,{style:null==(e=this._style)?void 0:e.toCSS(n)}),this._styleElement.textContent=null==(s=this._style)?void 0:s.toGlobalCSS()),{width:o+2*r.padding,height:h+2*r.padding}}async updateText(t=!0){const{style:e,_image:s,_loadImage:i}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:r,height:n}=this.measureText();s.width=i.width=Math.ceil(Math.max(1,r)),s.height=i.height=Math.ceil(Math.max(1,n)),this._loading||(this._loading=!0,await new Promise((t=>{i.onload=async()=>{await e.onBeforeDraw(),this._loading=!1,s.src=i.src,i.onload=null,i.src="",this.updateTexture(),t()};const r=(new XMLSerializer).serializeToString(this._svgRoot);i.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(r)}`})))}get source(){return this._image}updateTexture(){const{style:t,texture:e,_image:s,resolution:i}=this,{padding:r}=t,{baseTexture:n}=e;e.trim.width=e._frame.width=s.width/i,e.trim.height=e._frame.height=s.height/i,e.trim.x=-r,e.trim.y=-r,e.orig.width=e._frame.width-2*r,e.orig.height=e._frame.height-2*r,this._onTextureUpdate(),n.setRealSize(s.width,s.height,i),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}_renderCanvas(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(t)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds(t)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(t){var e,s,i,r,n;"boolean"==typeof t&&(t={children:t}),t=Object.assign({},Ml.defaultDestroyOptions,t),super.destroy(t);const a=null;this.ownsStyle&&(null==(e=this._style)||e.cleanFonts()),this._style=a,null==(s=this._svgRoot)||s.remove(),this._svgRoot=a,null==(i=this._domElement)||i.remove(),this._domElement=a,null==(r=this._foreignObject)||r.remove(),this._foreignObject=a,null==(n=this._styleElement)||n.remove(),this._styleElement=a,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=a,this._image.src="",this._image=a}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(t){this.updateText(!0);const e=Xe(this.scale.x)||1;this.scale.x=e*t/this._image.width/this.resolution,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(t){this.updateText(!0);const e=Xe(this.scale.y)||1;this.scale.y=e*t/this._image.height/this.resolution,this._height=t}get style(){return this._style}set style(t){this._style!==t&&((t=t||{})instanceof Il?(this.ownsStyle=!1,this._style=t):t instanceof Ph?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=Il.from(t)):(this.ownsStyle=!0,this._style=new Il(t)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(t){t=String(""===t||null==t?" ":t),t=this.sanitiseText(t),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}sanitiseText(t){return t.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};let Cl=Ml;return Cl.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Cl.defaultMaxWidth=2024,Cl.defaultMaxHeight=2024,Cl.defaultAutoResolution=!0,t.ALPHA_MODES=m,t.AbstractMultiResource=on,t.AccessibilityManager=ta,t.AlphaFilter=Mn,t.AnimatedSprite=Qh,t.Application=sa,t.ArrayResource=hn,t.Assets=Ga,t.AssetsClass=La,t.Attribute=As,t.BLEND_MODES=a,t.BUFFER_BITS=n,t.BUFFER_TYPE=b,t.BackgroundSystem=Oi,t.BaseImageResource=ki,t.BasePrepare=jh,t.BaseRenderTexture=Ui,t.BaseTexture=ys,t.BatchDrawCall=Ts,t.BatchGeometry=Cs,t.BatchRenderer=Ci,t.BatchShaderGenerator=Si,t.BatchSystem=Fi,t.BatchTextureArray=wi,t.BitmapFont=vl,t.BitmapFontData=ll,t.BitmapText=Al,t.BlobResource=Za,t.BlurFilter=On,t.BlurFilterPass=Pn,t.Bounds=gn,t.BrowserAdapter=E,t.Buffer=Es,t.BufferResource=gs,t.BufferSystem=sn,t.CLEAR_MODES=_,t.COLOR_MASK_BITS=y,t.Cache=pa,t.CanvasResource=ln,t.Circle=Gs,t.Color=Ie,t.ColorMatrixFilter=Fn,t.CompressedTextureResource=Qa,t.Container=En,t.ContextSystem=Ni,t.CountLimiter=Gh,t.CubeResource=dn,t.DEG_TO_RAD=Os,t.DRAW_MODES=o,t.DisplacementFilter=Bn,t.DisplayObject=xn,t.ENV=i,t.Ellipse=Us,t.EventBoundary=jn,t.EventSystem=Kn,t.ExtensionType=rs,t.Extract=Go,t.FORMATS=h,t.FORMATS_TO_COMPONENTS=Mo,t.FXAAFilter=Nn,t.FederatedDisplayObject=Qn,t.FederatedEvent=kn,t.FederatedMouseEvent=Xn,t.FederatedPointerEvent=Hn,t.FederatedWheelEvent=Vn,t.FillStyle=hh,t.Filter=Pi,t.FilterState=Ki,t.FilterSystem=tr,t.Framebuffer=Gi,t.FramebufferSystem=ir,t.GC_MODES=g,t.GLFramebuffer=er,t.GLProgram=Ar,t.GLTexture=Xr,t.GRAPHICS_CURVES=jo,t.GenerateTextureSystem=yr,t.Geometry=Ms,t.GeometrySystem=nr,t.Graphics=ch,t.GraphicsData=rh,t.GraphicsGeometry=oh,t.HTMLText=Cl,t.HTMLTextStyle=Il,t.IGLUniformData=class{},t.INSTALLED=ps,t.INTERNAL_FORMATS=Wa,t.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL=Ya,t.ImageBitmapResource=cn,t.ImageResource=Xi,t.LINE_CAP=Wo,t.LINE_JOIN=zo,t.LineStyle=lh,t.LoaderParserPriority=ma,t.MASK_TYPES=v,t.MIPMAP_MODES=f,t.MSAA_QUALITY=T,t.MaskData=lr,t.MaskSystem=ur,t.Matrix=Hs,t.Mesh=xh,t.MeshBatchUvs=fh,t.MeshGeometry=vh,t.MeshMaterial=yh,t.MultisampleSystem=tn,t.NineSlicePlane=class extends Eh{constructor(t,e,s,i,r){var n,a,o,h,l,u,d,c;super(Wi.WHITE,4,4),this._origWidth=t.orig.width,this._origHeight=t.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=null!=(a=null!=e?e:null==(n=t.defaultBorders)?void 0:n.left)?a:10,this._rightWidth=null!=(h=null!=i?i:null==(o=t.defaultBorders)?void 0:o.right)?h:10,this._topHeight=null!=(u=null!=s?s:null==(l=t.defaultBorders)?void 0:l.top)?u:10,this._bottomHeight=null!=(c=null!=r?r:null==(d=t.defaultBorders)?void 0:d.bottom)?c:10,this.texture=t}textureUpdated(){this._textureID=this.shader.texture._updateID,this._refresh()}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}updateHorizontalVertices(){const t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height}updateVerticalVertices(){const t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width}_getMinScale(){const t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,s=this._topHeight+this._bottomHeight,i=this._height>s?1:this._height/s;return Math.min(e,i)}get width(){return this._width}set width(t){this._width=t,this._refresh()}get height(){return this._height}set height(t){this._height=t,this._refresh()}get leftWidth(){return this._leftWidth}set leftWidth(t){this._leftWidth=t,this._refresh()}get rightWidth(){return this._rightWidth}set rightWidth(t){this._rightWidth=t,this._refresh()}get topHeight(){return this._topHeight}set topHeight(t){this._topHeight=t,this._refresh()}get bottomHeight(){return this._bottomHeight}set bottomHeight(t){this._bottomHeight=t,this._refresh()}_refresh(){const t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;const s=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=s*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-s*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()}},t.NoiseFilter=Ln,t.ObjectRenderer=Ii,t.ObjectRendererSystem=rn,t.ObservablePoint=Zs,t.PI_2=Ds,t.PRECISION=x,t.ParticleContainer=class extends En{constructor(t=1500,e,s=16384,i=!1){super();s>16384&&(s=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=s,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=a.NORMAL,this.autoResize=i,this.roundPixels=!0,this.baseTexture=null,this.setProperties(e),this._tintColor=new Ie(0),this.tintRgb=new Float32Array(3),this.tint=16777215}setProperties(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])}updateTransform(){this.displayObjectUpdateTransform()}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintColor.toRgbArray(this.tintRgb)}render(t){!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(()=>this.onChildrenChange(0)))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))}onChildrenChange(t){const e=Math.floor(t/this._batchSize);for(;this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID}dispose(){if(this._buffers){for(let t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}}destroy(t){super.destroy(t),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null}},t.ParticleRenderer=Rh,t.PlaneGeometry=Th,t.PluginSystem=gr,t.Point=Bs,t.Polygon=ks,t.Prepare=Zh,t.Program=bi,t.ProjectionSystem=xr,t.Quad=$i,t.QuadUv=qi,t.RAD_TO_DEG=Ps,t.RENDERER_TYPE=r,t.Rectangle=Ls,t.RenderTexture=Yi,t.RenderTexturePool=ji,t.RenderTextureSystem=Er,t.Renderer=an,t.ResizePlugin=ia,t.Resource=_s,t.RopeGeometry=bh,t.RoundedRectangle=Xs,t.Runner=ms,t.SAMPLER_TYPES=d,t.SCALE_MODES=c,t.SHAPES=Fs,t.SVGResource=fn,t.ScissorSystem=mr,t.Shader=Ri,t.ShaderSystem=Fr,t.SimpleMesh=class extends xh{constructor(t=Wi.EMPTY,e,s,i,r){const n=new vh(e,s,i);n.getBuffer("aVertexPosition").static=!1;super(n,new yh(t),null,r),this.autoUpdate=!0}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}_render(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),super._render(t)}},t.SimplePlane=Eh,t.SimpleRope=class extends xh{constructor(t,e,s=0){const i=new bh(t.height,e,s),r=new yh(t);s>0&&(t.baseTexture.wrapMode=p.REPEAT),super(i,r),this.autoUpdate=!0}_render(t){const e=this.geometry;(this.autoUpdate||e._width!==this.shader.texture.height)&&(e._width=this.shader.texture.height,e.update()),super._render(t)}},t.Sprite=Sn,t.SpriteMaskFilter=hr,t.Spritesheet=nl,t.StartupSystem=Br,t.State=cs,t.StateSystem=Lr,t.StencilSystem=_r,t.SystemManager=Gr,t.TARGETS=l,t.TEXT_GRADIENT=Sh,t.TYPES=u,t.TYPES_TO_BYTES_PER_COMPONENT=Io,t.TYPES_TO_BYTES_PER_PIXEL=Co,t.TemporaryDisplayObject=vn,t.Text=Lh,t.TextFormat=ul,t.TextMetrics=Mh,t.TextStyle=Ph,t.Texture=Wi,t.TextureGCSystem=kr,t.TextureMatrix=or,t.TextureSystem=Hr,t.TextureUvs=Hi,t.Ticker=$r,t.TickerPlugin=qr,t.TilingSprite=tl,t.TilingSpriteRenderer=il,t.TimeLimiter=class{constructor(t){this.maxMilliseconds=t,this.frameStart=0}beginFrame(){this.frameStart=Date.now()}allowedToUpload(){return Date.now()-this.frameStart<this.maxMilliseconds}},t.Transform=Js,t.TransformFeedback=class{constructor(){this._glTransformFeedbacks={},this.buffers=[],this.disposeRunner=new ms("disposeTransformFeedback")}bindBuffer(t,e){this.buffers[t]=e}destroy(){this.disposeRunner.emit(this,!1)}},t.TransformFeedbackSystem=Vr,t.UPDATE_PRIORITY=Wr,t.UniformGroup=Ai,t.VERSION="7.2.4",t.VideoResource=_n,t.ViewSystem=zr,t.ViewableBuffer=hs,t.WRAP_MODES=p,t.XMLFormat=dl,t.XMLStringFormat=cl,t.accessibleTarget=Jn,t.autoDetectFormat=fl,t.autoDetectRenderer=Zr,t.autoDetectResource=fs,t.cacheTextureArray=Ua,t.checkDataUrl=aa,t.checkExtension=oa,t.checkMaxIfStatementsInShader=ds,t.convertToList=ha,t.copySearchParams=la,t.createStringVariations=da,t.createTexture=Ca,t.createUBOElements=Mr,t.curves=Yo,t.defaultFilterVertex=Jr,t.defaultVertex=Qr,t.detectAvif=ka,t.detectCompressedTextures=Ka,t.detectDefaults=Va,t.detectWebp=Xa,t.extensions=os,t.filters=Gn,t.generateProgram=Rr,t.generateUniformBufferSync=Dr,t.getFontFamilyName=ba,t.getTestContext=li,t.getUBOData=Cr,t.graphicsUtils=ph,t.groupD8=Ks,t.isMobile=H,t.isSingleItem=ca,t.loadBitmapFont=Sl,t.loadDDS=Oo,t.loadImageBitmap=Oa,t.loadJson=_a,t.loadKTX=Fo,t.loadSVG=Ba,t.loadTextures=Fa,t.loadTxt=ga,t.loadWebFont=Ea,t.parseDDS=fo,t.parseKTX=Do,t.resolveCompressedTextureUrl=Bo,t.resolveTextureUrl=za,t.settings=A,t.spritesheetAsset=hl,t.uniformParsers=ii,t.unsafeEvalSupported=xi,t.utils=is,Object.defineProperty(t,"__esModule",{value:!0}),t}({})
\ No newline at end of file
diff --git a/lib/scripts/tinycolor.js b/lib/scripts/tinycolor.js
new file mode 100644
index 0000000..3c4a921
--- /dev/null
+++ b/lib/scripts/tinycolor.js
@@ -0,0 +1 @@
+function w3color(t,e){return this instanceof w3color?"object"==typeof t?t:(this.attachValues(toColorObject(t)),void(e&&(e.style.backgroundColor=this.toRgbString()))):new w3color(t,e)}function toColorObject(t){var e,r,a,n,i,s,o,h,f,u,l,c=[],b=[],d=[];if(e=(t=w3trim(t.toLowerCase())).substr(0,1).toUpperCase(),r=t.substr(1),h=1,"R"!=e&&"Y"!=e&&"G"!=e&&"C"!=e&&"B"!=e&&"M"!=e&&"W"!=e||isNaN(r)||(6!=t.length||-1!=t.indexOf(","))&&(t="ncol("+t+")"),3==t.length||6==t.length||isNaN(t)||(t="ncol("+t+")"),t.indexOf(",")>0&&-1==t.indexOf("(")&&(t="ncol("+t+")"),"rgb"==t.substr(0,3)||"hsl"==t.substr(0,3)||"hwb"==t.substr(0,3)||"ncol"==t.substr(0,4)||"cmyk"==t.substr(0,4)){if("ncol"==t.substr(0,4)?(4==t.split(",").length&&-1==t.indexOf("ncola")&&(t=t.replace("ncol","ncola")),a="ncol",t=t.substr(4)):"cmyk"==t.substr(0,4)?(a="cmyk",t=t.substr(4)):(a=t.substr(0,3),t=t.substr(3)),n=3,s=!1,"a"==t.substr(0,1).toLowerCase()?(n=4,s=!0,t=t.substr(1)):"cmyk"==a&&(n=4,5==t.split(",").length&&(n=5,s=!0)),c=(t=(t=t.replace("(","")).replace(")","")).split(","),"rgb"==a){if(c.length!=n)return emptyObject();for(i=0;i<n;i++){if((""==c[i]||" "==c[i])&&(c[i]="0"),c[i].indexOf("%")>-1&&(c[i]=c[i].replace("%",""),c[i]=Number(c[i]/100),i<3&&(c[i]=Math.round(255*c[i]))),isNaN(c[i]))return emptyObject();parseInt(c[i])>255&&(c[i]=255),i<3&&(c[i]=parseInt(c[i])),3==i&&Number(c[i])>1&&(c[i]=1)}l={r:c[0],g:c[1],b:c[2]},1==s&&(h=Number(c[3]))}if("hsl"==a||"hwb"==a||"ncol"==a){for(;c.length<n;)c.push("0");for(("hsl"==a||"hwb"==a)&&parseInt(c[0])>=360&&(c[0]=0),i=1;i<n;i++){if(c[i].indexOf("%")>-1){if(c[i]=c[i].replace("%",""),c[i]=Number(c[i]),isNaN(c[i]))return emptyObject();c[i]=c[i]/100}else c[i]=Number(c[i]);Number(c[i])>1&&(c[i]=1),0>Number(c[i])&&(c[i]=0)}"hsl"==a&&(l=hslToRgb(c[0],c[1],c[2]),f=Number(c[0]),u=Number(c[1])),"hwb"==a&&(l=hwbToRgb(c[0],c[1],c[2])),"ncol"==a&&(l=ncolToRgb(c[0],c[1],c[2])),1==s&&(h=Number(c[3]))}if("cmyk"==a){for(;c.length<n;)c.push("0");for(i=0;i<n;i++){if(c[i].indexOf("%")>-1){if(c[i]=c[i].replace("%",""),c[i]=Number(c[i]),isNaN(c[i]))return emptyObject();c[i]=c[i]/100}else c[i]=Number(c[i]);Number(c[i])>1&&(c[i]=1),0>Number(c[i])&&(c[i]=0)}l=cmykToRgb(c[0],c[1],c[2],c[3]),1==s&&(h=Number(c[4]))}}else if("ncs"==t.substr(0,3))l=ncsToRgb(t);else{for(i=0,o=!1,b=getColorArr("names");i<b.length;i++)if(t.toLowerCase()==b[i].toLowerCase()){d=getColorArr("hexs"),o=!0,l={r:parseInt(d[i].substr(0,2),16),g:parseInt(d[i].substr(2,2),16),b:parseInt(d[i].substr(4,2),16)};break}if(0==o){for(3==(t=t.replace("#","")).length&&(t=t.substr(0,1)+t.substr(0,1)+t.substr(1,1)+t.substr(1,1)+t.substr(2,1)+t.substr(2,1)),i=0;i<t.length;i++)if(!isHex(t.substr(i,1)))return emptyObject();for(i=0,c[0]=parseInt(t.substr(0,2),16),c[1]=parseInt(t.substr(2,2),16),c[2]=parseInt(t.substr(4,2),16);i<3;i++)if(isNaN(c[i]))return emptyObject();l={r:c[0],g:c[1],b:c[2]}}}return colorObject(l,h,f,u)}function colorObject(t,e,r,a){var n,i,s,o,h,f;return t?(null===e&&(e=1),n=rgbToHsl(t.r,t.g,t.b),i=rgbToHwb(t.r,t.g,t.b),s=rgbToCmyk(t.r,t.g,t.b),h=r||n.h,f=a||n.s,o=hueToNcol(h),roundDecimals({red:t.r,green:t.g,blue:t.b,hue:h,sat:f,lightness:n.l,whiteness:i.w,blackness:i.b,cyan:s.c,magenta:s.m,yellow:s.y,black:s.k,ncol:o,opacity:e,valid:!0})):emptyObject()}function emptyObject(){return{red:0,green:0,blue:0,hue:0,sat:0,lightness:0,whiteness:0,blackness:0,cyan:0,magenta:0,yellow:0,black:0,ncol:"R",opacity:1,valid:!1}}function getColorArr(t){return"names"==t?["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquaMarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenRod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"]:"hexs"==t?["f0f8ff","faebd7","00ffff","7fffd4","f0ffff","f5f5dc","ffe4c4","000000","ffebcd","0000ff","8a2be2","a52a2a","deb887","5f9ea0","7fff00","d2691e","ff7f50","6495ed","fff8dc","dc143c","00ffff","00008b","008b8b","b8860b","a9a9a9","a9a9a9","006400","bdb76b","8b008b","556b2f","ff8c00","9932cc","8b0000","e9967a","8fbc8f","483d8b","2f4f4f","2f4f4f","00ced1","9400d3","ff1493","00bfff","696969","696969","1e90ff","b22222","fffaf0","228b22","ff00ff","dcdcdc","f8f8ff","ffd700","daa520","808080","808080","008000","adff2f","f0fff0","ff69b4","cd5c5c","4b0082","fffff0","f0e68c","e6e6fa","fff0f5","7cfc00","fffacd","add8e6","f08080","e0ffff","fafad2","d3d3d3","d3d3d3","90ee90","ffb6c1","ffa07a","20b2aa","87cefa","778899","778899","b0c4de","ffffe0","00ff00","32cd32","faf0e6","ff00ff","800000","66cdaa","0000cd","ba55d3","9370db","3cb371","7b68ee","00fa9a","48d1cc","c71585","191970","f5fffa","ffe4e1","ffe4b5","ffdead","000080","fdf5e6","808000","6b8e23","ffa500","ff4500","da70d6","eee8aa","98fb98","afeeee","db7093","ffefd5","ffdab9","cd853f","ffc0cb","dda0dd","b0e0e6","800080","663399","ff0000","bc8f8f","4169e1","8b4513","fa8072","f4a460","2e8b57","fff5ee","a0522d","c0c0c0","87ceeb","6a5acd","708090","708090","fffafa","00ff7f","4682b4","d2b48c","008080","d8bfd8","ff6347","40e0d0","ee82ee","f5deb3","ffffff","f5f5f5","ffff00","9acd32"]:void 0}function roundDecimals(t){return t.red=Number(t.red.toFixed(0)),t.green=Number(t.green.toFixed(0)),t.blue=Number(t.blue.toFixed(0)),t.hue=Number(t.hue.toFixed(0)),t.sat=Number(t.sat.toFixed(2)),t.lightness=Number(t.lightness.toFixed(2)),t.whiteness=Number(t.whiteness.toFixed(2)),t.blackness=Number(t.blackness.toFixed(2)),t.cyan=Number(t.cyan.toFixed(2)),t.magenta=Number(t.magenta.toFixed(2)),t.yellow=Number(t.yellow.toFixed(2)),t.black=Number(t.black.toFixed(2)),t.ncol=t.ncol.substr(0,1)+Math.round(Number(t.ncol.substr(1))),t.opacity=Number(t.opacity.toFixed(2)),t}function hslToRgb(t,e,r){var a,n;return{r:255*hueToRgb(a=2*r-(n=r<=.5?r*(e+1):r+e-r*e),n,(t/=60)+2),g:255*hueToRgb(a,n,t),b:255*hueToRgb(a,n,t-2)}}function hueToRgb(t,e,r){return r<0&&(r+=6),r>=6&&(r-=6),r<1?(e-t)*r+t:r<3?e:r<4?(e-t)*(4-r)+t:t}function hwbToRgb(t,e,r){var a,n,i,s=[];for(n=hslToRgb(t,1,.5),s[0]=n.r/255,s[1]=n.g/255,s[2]=n.b/255,(i=e+r)>1&&(e=Number((e/i).toFixed(2)),r=Number((r/i).toFixed(2))),a=0;a<3;a++)s[a]*=1-e-r,s[a]+=e,s[a]=Number(255*s[a]);return{r:s[0],g:s[1],b:s[2]}}function cmykToRgb(t,e,r,a){return{r:255-255*Math.min(1,t*(1-a)+a),g:255-255*Math.min(1,e*(1-a)+a),b:255-255*Math.min(1,r*(1-a)+a)}}function ncolToRgb(t,e,r){var a,n,i;if(i=t,isNaN(t.substr(0,1))){if(a=t.substr(0,1).toUpperCase(),""==(n=t.substr(1))&&(n=0),isNaN(n=Number(n)))return!1;"R"==a&&(i=0+.6*n),"Y"==a&&(i=60+.6*n),"G"==a&&(i=120+.6*n),"C"==a&&(i=180+.6*n),"B"==a&&(i=240+.6*n),"M"==a&&(i=300+.6*n),"W"==a&&(i=0,e=1-n/100,r=n/100)}return hwbToRgb(i,e,r)}function hueToNcol(t){for(;t>=360;)t-=360;return t<60?"R"+t/.6:t<120?"Y"+(t-60)/.6:t<180?"G"+(t-120)/.6:t<240?"C"+(t-180)/.6:t<300?"B"+(t-240)/.6:t<360?"M"+(t-300)/.6:void 0}function ncsToRgb(t){var e,r,a,n,i,s,o,h,f,u,l,c,b,d,g,m,p;return-1==(t=(t=(t=(t=(t=w3trim(t).toUpperCase()).replace("(","")).replace(")","")).replace("NCS","NCS ")).replace(/  /g," ")).indexOf("NCS")&&(t="NCS "+t),null!==(t=t.match(/^(?:NCS|NCS\sS)\s(\d{2})(\d{2})-(N|[A-Z])(\d{2})?([A-Z])?$/))&&(e=parseInt(t[1],10),r=parseInt(t[2],10),("N"==(a=t[3])||"Y"==a||"R"==a||"B"==a||"G"==a)&&(n=parseInt(t[4],10)||0,"N"!==a?(i=1.05*e-5.25,s=r,"Y"===a&&n<=60?o=1:"Y"===a&&n>60||"R"===a&&n<=80?o=(Math.sqrt(14884-Math.pow(h="Y"===a?n-60:n+40,2))-22)/100:"R"===a&&n>80||"B"===a?o=0:"G"===a&&(o=(Math.sqrt(33800-Math.pow(h=n-170,2))-70)/100),"Y"===a&&n<=80?f=0:"Y"===a&&n>80||"R"===a&&n<=60?f=(104-Math.sqrt(11236-Math.pow(h="Y"===a?n-80+20.5:n+20+20.5,2)))/100:"R"===a&&n>60||"B"===a&&n<=80?f=(Math.sqrt(1e4-Math.pow(h="R"===a?n-60-60:n+40-60,2))-10)/100:"B"===a&&n>80||"G"===a&&n<=40?f=(122-Math.sqrt(19881-Math.pow(h="B"===a?n-80-131:n+20-131,2)))/100:"G"===a&&n>40&&(f=0),"Y"===a?green1=(85-.85*n)/100:"R"===a&&n<=60?green1=0:"R"===a&&n>60?green1=(67.5-Math.sqrt(5776-Math.pow(h=n-60+35,2)))/100:"B"===a&&n<=60?green1=(6.5+Math.sqrt(7044.5-Math.pow(h=1*n-68.5,2)))/100:"B"===a&&n>60||"G"===a&&n<=60?green1=.9:"G"===a&&n>60&&(green1=(90-1/8*(h=n-60))/100),u=((h=(o+green1+f)/3)-o)*(100-s)/100+o,c=(h-f)*(100-s)/100+f,b=1/(u>(l=(h-green1)*(100-s)/100+green1)&&u>c?u:l>u&&l>c?l:c>u&&c>l?c:(u+l+c)/3),(g=parseInt(u*b*(100-i)/100*255,10))>255&&(g=255),(m=parseInt(l*b*(100-i)/100*255,10))>255&&(m=255),(p=parseInt(c*b*(100-i)/100*255,10))>255&&(p=255),g<0&&(g=0),m<0&&(m=0),p<0&&(p=0)):((d=parseInt(255*(1-e/100),10))>255&&(d=255),d<0&&(d=0),g=d,m=d,p=d),{r:g,g:m,b:p}))}function rgbToHsl(t,e,r){var a,n,i,s,o,h,f=[];for(i=0,f[0]=t/255,f[1]=e/255,f[2]=r/255,a=f[0],n=f[0],o=0;i<f.length-1;i++)f[i+1]<=a&&(a=f[i+1]),f[i+1]>=n&&(n=f[i+1],o=i+1);return 0==o&&(h=(f[1]-f[2])/(n-a)),1==o&&(h=2+(f[2]-f[0])/(n-a)),2==o&&(h=4+(f[0]-f[1])/(n-a)),isNaN(h)&&(h=0),(h*=60)<0&&(h+=360),s=(a+n)/2,{h:h,s:a==n?0:s<.5?(n-a)/(n+a):(n-a)/(2-n-a),l:s}}function rgbToHwb(t,e,r){return t/=255,e/=255,r/=255,{h:0==(chroma=(max=Math.max(t,e,r))-(min=Math.min(t,e,r)))?0:t==max?(e-r)/chroma%6*360:e==max?((r-t)/chroma+2)%6*360:((t-e)/chroma+4)%6*360,w:min,b:1-max}}function rgbToCmyk(t,e,r){var a,n,i,s;return t/=255,e/=255,r/=255,1==(s=1-(max=Math.max(t,e,r)))?(a=0,n=0,i=0):(a=(1-t-s)/(1-s),n=(1-e-s)/(1-s),i=(1-r-s)/(1-s)),{c:a,m:n,y:i,k:s}}function toHex(t){for(var e=t.toString(16);e.length<2;)e="0"+e;return e}function cl(t){console.log(t)}function w3trim(t){return t.replace(/^\s+|\s+$/g,"")}function isHex(t){return"0123456789ABCDEFabcdef".indexOf(t)>-1}function w3SetColorsByAttribute(){var t,e,r;for(e=0,t=document.getElementsByTagName("*");e<t.length;e++)(r=t[e].getAttribute("data-w3-color"))&&(t[e].style.backgroundColor=w3color(r).toRgbString())}!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).tinycolor=e()}(this,(function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=/^\s+/,r=/\s+$/;function a(n,i){if(i=i||{},(n=n||"")instanceof a)return n;if(!(this instanceof a))return new a(n,i);var s,o,h,f,u,l,c,b,d,g,m,p,y,M,v,x,A,R,H,G=(o={r:0,g:0,b:0},h=1,f=null,null,u=null,l=!1,c=!1,"string"==typeof(s=n)&&(s=function(t){t=t.replace(e,"").replace(r,"").toLowerCase();var a,n=!1;if(k[t])t=k[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(a=T.rgb.exec(t))?{r:a[1],g:a[2],b:a[3]}:(a=T.rgba.exec(t))?{r:a[1],g:a[2],b:a[3],a:a[4]}:(a=T.hsl.exec(t))?{h:a[1],s:a[2],l:a[3]}:(a=T.hsla.exec(t))?{h:a[1],s:a[2],l:a[3],a:a[4]}:(a=T.hsv.exec(t))?{h:a[1],s:a[2],v:a[3]}:(a=T.hsva.exec(t))?{h:a[1],s:a[2],v:a[3],a:a[4]}:(a=T.hex8.exec(t))?{r:S(a[1]),g:S(a[2]),b:S(a[3]),a:C(a[4]),format:n?"name":"hex8"}:(a=T.hex6.exec(t))?{r:S(a[1]),g:S(a[2]),b:S(a[3]),format:n?"name":"hex"}:(a=T.hex4.exec(t))?{r:S(a[1]+""+a[1]),g:S(a[2]+""+a[2]),b:S(a[3]+""+a[3]),a:C(a[4]+""+a[4]),format:n?"name":"hex8"}:!!(a=T.hex3.exec(t))&&{r:S(a[1]+""+a[1]),g:S(a[2]+""+a[2]),b:S(a[3]+""+a[3]),format:n?"name":"hex"}}(s)),"object"==t(s)&&(F(s.r)&&F(s.g)&&F(s.b)?(b=s.r,d=s.g,g=s.b,o={r:255*w(b,255),g:255*w(d,255),b:255*w(g,255)},l=!0,c="%"===String(s.r).substr(-1)?"prgb":"rgb"):F(s.h)&&F(s.s)&&F(s.v)?(p=f=N(s.s),y=N(s.v),m=6*w(m=s.h,360),p=w(p,100),o={r:255*[y=w(y,100),A=y*(1-(v=m-(M=Math.floor(m)))*p),x=y*(1-p),x,R=y*(1-(1-v)*p),y][H=M%6],g:255*[R,y,y,A,x,x][H],b:255*[x,x,R,y,y,A][H]},l=!0,c="hsv"):F(s.h)&&F(s.s)&&F(s.l)&&(f=N(s.s),u=N(s.l),o=function(t,e,r){var a,n,i;function s(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=w(t,360),e=w(e,100),r=w(r,100),0===e)a=n=i=r;else{var o=r<.5?r*(1+e):r+e-r*e,h=2*r-o;a=s(h,o,t+1/3),n=s(h,o,t),i=s(h,o,t-1/3)}return{r:255*a,g:255*n,b:255*i}}(s.h,f,u),l=!0,c="hsl"),s.hasOwnProperty("a")&&(h=s.a)),h=_(h),{ok:l,format:s.format||c,r:Math.min(255,Math.max(o.r,0)),g:Math.min(255,Math.max(o.g,0)),b:Math.min(255,Math.max(o.b,0)),a:h});this._originalInput=n,this._r=G.r,this._g=G.g,this._b=G.b,this._a=G.a,this._roundA=Math.round(100*this._a)/100,this._format=i.format||G.format,this._gradientType=i.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=G.ok}function n(t,e,r){t=w(t,255),e=w(e,255),r=w(r,255);var a,n,i=Math.max(t,e,r),s=Math.min(t,e,r),o=(i+s)/2;if(i==s)a=n=0;else{var h=i-s;switch(n=o>.5?h/(2-i-s):h/(i+s),i){case t:a=(e-r)/h+(e<r?6:0);break;case e:a=(r-t)/h+2;break;case r:a=(t-e)/h+4}a/=6}return{h:a,s:n,l:o}}function i(t,e,r){t=w(t,255),e=w(e,255),r=w(r,255);var a,n,i=Math.max(t,e,r),s=Math.min(t,e,r),o=i-s;if(n=0===i?0:o/i,i==s)a=0;else{switch(i){case t:a=(e-r)/o+(e<r?6:0);break;case e:a=(r-t)/o+2;break;case r:a=(t-e)/o+4}a/=6}return{h:a,s:n,v:i}}function s(t,e,r,a){var n=[A(Math.round(t).toString(16)),A(Math.round(e).toString(16)),A(Math.round(r).toString(16))];return a&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function o(t,e,r,a){return[A(R(a)),A(Math.round(t).toString(16)),A(Math.round(e).toString(16)),A(Math.round(r).toString(16))].join("")}function h(t,e){e=0===e?0:e||10;var r=a(t).toHsl();return r.s-=e/100,r.s=x(r.s),a(r)}function f(t,e){e=0===e?0:e||10;var r=a(t).toHsl();return r.s+=e/100,r.s=x(r.s),a(r)}function u(t){return a(t).desaturate(100)}function l(t,e){e=0===e?0:e||10;var r=a(t).toHsl();return r.l+=e/100,r.l=x(r.l),a(r)}function c(t,e){e=0===e?0:e||10;var r=a(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-e/100*255))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-e/100*255))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-e/100*255))),a(r)}function b(t,e){e=0===e?0:e||10;var r=a(t).toHsl();return r.l-=e/100,r.l=x(r.l),a(r)}function d(t,e){var r=a(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,a(r)}function g(t){var e=a(t).toHsl();return e.h=(e.h+180)%360,a(e)}function m(t,e){if(isNaN(e)||e<=0)throw Error("Argument to polyad must be a positive number");for(var r=a(t).toHsl(),n=[a(t)],i=360/e,s=1;s<e;s++)n.push(a({h:(r.h+s*i)%360,s:r.s,l:r.l}));return n}function p(t){var e=a(t).toHsl(),r=e.h;return[a(t),a({h:(r+72)%360,s:e.s,l:e.l}),a({h:(r+216)%360,s:e.s,l:e.l})]}function y(t,e,r){e=e||6,r=r||30;var n=a(t).toHsl(),i=360/r,s=[a(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,s.push(a(n));return s}function M(t,e){e=e||6;for(var r=a(t).toHsv(),n=r.h,i=r.s,s=r.v,o=[],h=1/e;e--;)o.push(a({h:n,s:i,v:s})),s=(s+h)%1;return o}a.prototype={isDark:function(){return 128>this.getBrightness()},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,a=this.toRgb();return t=a.r/255,e=a.g/255,r=a.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=_(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),a=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+a+"%)":"hsva("+e+", "+r+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),a=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+a+"%)":"hsla("+e+", "+r+"%, "+a+"%, "+this._roundA+")"},toHex:function(t){return s(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHexNumber:function(){return Number("0x"+this.toHex())},toHex8:function(t){var e,r,a,n,i,s;return e=this._r,r=this._g,a=this._b,n=this._a,i=t,s=[A(Math.round(e).toString(16)),A(Math.round(r).toString(16)),A(Math.round(a).toString(16)),A(R(n))],i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*w(this._r,255))+"%",g:Math.round(100*w(this._g,255))+"%",b:Math.round(100*w(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*w(this._r,255))+"%, "+Math.round(100*w(this._g,255))+"%, "+Math.round(100*w(this._b,255))+"%)":"rgba("+Math.round(100*w(this._r,255))+"%, "+Math.round(100*w(this._g,255))+"%, "+Math.round(100*w(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1||!v[s(this._r,this._g,this._b,!0)])},toFilter:function(t){var e="#"+o(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=a(t);r="#"+o(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,a=this._a<1&&this._a>=0;return e||!a||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),("hex"===t||"hex6"===t)&&(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return a(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(l,arguments)},brighten:function(){return this._applyModification(c,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(f,arguments)},greyscale:function(){return this._applyModification(u,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(g,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(p,arguments)},triad:function(){return this._applyCombination(m,[3])},tetrad:function(){return this._applyCombination(m,[4])}},a.fromRatio=function(e,r){if("object"==t(e)){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]="a"===i?e[i]:N(e[i]));e=n}return a(e,r)},a.equals=function(t,e){return!!t&&!!e&&a(t).toRgbString()==a(e).toRgbString()},a.random=function(){return a.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},a.mix=function(t,e,r){r=0===r?0:r||50;var n=a(t).toRgb(),i=a(e).toRgb(),s=r/100;return a({r:(i.r-n.r)*s+n.r,g:(i.g-n.g)*s+n.g,b:(i.b-n.b)*s+n.b,a:(i.a-n.a)*s+n.a})},a.readability=function(t,e){var r=a(t),n=a(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},a.isReadable=function(t,e,r){var n,i,s,o,h,f=a.readability(t,e);switch(i=!1,(s=r,o=((s=s||{level:"AA",size:"small"}).level||"AA").toUpperCase(),h=(s.size||"small").toLowerCase(),"AA"!==o&&"AAA"!==o&&(o="AA"),"small"!==h&&"large"!==h&&(h="small"),n={level:o,size:h}).level+n.size){case"AAsmall":case"AAAlarge":i=f>=4.5;break;case"AAlarge":i=f>=3;break;case"AAAsmall":i=f>=7}return i},a.mostReadable=function(t,e,r){var n,i,s,o,h=null,f=0;i=(r=r||{}).includeFallbackColors,s=r.level,o=r.size;for(var u=0;u<e.length;u++)(n=a.readability(t,e[u]))>f&&(f=n,h=a(e[u]));return a.isReadable(t,h,{level:s,size:o})||!i?h:(r.includeFallbackColors=!1,a.mostReadable(t,["#fff","#000"],r))};var k=a.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},v=a.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(k);function _(t){return(isNaN(t=parseFloat(t))||t<0||t>1)&&(t=1),t}function w(t,e){"string"==typeof(r=t)&&-1!=r.indexOf(".")&&1===parseFloat(r)&&(t="100%");var r,a,n="string"==typeof(a=t)&&-1!=a.indexOf("%");return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),1e-6>Math.abs(t-e)?1:t%e/parseFloat(e)}function x(t){return Math.min(1,Math.max(0,t))}function S(t){return parseInt(t,16)}function A(t){return 1==t.length?"0"+t:""+t}function N(t){return t<=1&&(t=100*t+"%"),t}function R(t){return Math.round(255*parseFloat(t)).toString(16)}function C(t){return S(t)/255}var H,G,B,T=(G="[\\s|\\(]+("+(H="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+H+")[,|\\s]+("+H+")\\s*\\)?",B="[\\s|\\(]+("+H+")[,|\\s]+("+H+")[,|\\s]+("+H+")[,|\\s]+("+H+")\\s*\\)?",{CSS_UNIT:RegExp(H),rgb:RegExp("rgb"+G),rgba:RegExp("rgba"+B),hsl:RegExp("hsl"+G),hsla:RegExp("hsla"+B),hsv:RegExp("hsv"+G),hsva:RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function F(t){return!!T.CSS_UNIT.exec(t)}return a})),w3color.prototype={toRgbString:function(){return"rgb("+this.red+", "+this.green+", "+this.blue+")"},toRgbaString:function(){return"rgba("+this.red+", "+this.green+", "+this.blue+", "+this.opacity+")"},toHwbString:function(){return"hwb("+this.hue+", "+Math.round(100*this.whiteness)+"%, "+Math.round(100*this.blackness)+"%)"},toHwbStringDecimal:function(){return"hwb("+this.hue+", "+this.whiteness+", "+this.blackness+")"},toHwbaString:function(){return"hwba("+this.hue+", "+Math.round(100*this.whiteness)+"%, "+Math.round(100*this.blackness)+"%, "+this.opacity+")"},toHslString:function(){return"hsl("+this.hue+", "+Math.round(100*this.sat)+"%, "+Math.round(100*this.lightness)+"%)"},toHslStringDecimal:function(){return"hsl("+this.hue+", "+this.sat+", "+this.lightness+")"},toHslaString:function(){return"hsla("+this.hue+", "+Math.round(100*this.sat)+"%, "+Math.round(100*this.lightness)+"%, "+this.opacity+")"},toCmykString:function(){return"cmyk("+Math.round(100*this.cyan)+"%, "+Math.round(100*this.magenta)+"%, "+Math.round(100*this.yellow)+"%, "+Math.round(100*this.black)+"%)"},toCmykStringDecimal:function(){return"cmyk("+this.cyan+", "+this.magenta+", "+this.yellow+", "+this.black+")"},toNcolString:function(){return this.ncol+", "+Math.round(100*this.whiteness)+"%, "+Math.round(100*this.blackness)+"%"},toNcolStringDecimal:function(){return this.ncol+", "+this.whiteness+", "+this.blackness},toNcolaString:function(){return this.ncol+", "+Math.round(100*this.whiteness)+"%, "+Math.round(100*this.blackness)+"%, "+this.opacity},toName:function(){var t,e,r,a=getColorArr("hexs");for(i=0;i<a.length;i++)if(t=parseInt(a[i].substr(0,2),16),e=parseInt(a[i].substr(2,2),16),r=parseInt(a[i].substr(4,2),16),this.red==t&&this.green==e&&this.blue==r)return getColorArr("names")[i];return""},toHexString:function(){return"#"+toHex(this.red)+toHex(this.green)+toHex(this.blue)},toRgb:function(){return{r:this.red,g:this.green,b:this.blue,a:this.opacity}},toHsl:function(){return{h:this.hue,s:this.sat,l:this.lightness,a:this.opacity}},toHwb:function(){return{h:this.hue,w:this.whiteness,b:this.blackness,a:this.opacity}},toCmyk:function(){return{c:this.cyan,m:this.magenta,y:this.yellow,k:this.black,a:this.opacity}},toNcol:function(){return{ncol:this.ncol,w:this.whiteness,b:this.blackness,a:this.opacity}},isDark:function(t){return(299*this.red+587*this.green+114*this.blue)/1e3<(t||128)},saturate:function(t){var e,r;e=t/100||.1,this.sat+=e,this.sat>1&&(this.sat=1),r=colorObject(hslToRgb(this.hue,this.sat,this.lightness),this.opacity,this.hue,this.sat),this.attachValues(r)},desaturate:function(t){var e,r;e=t/100||.1,this.sat-=e,this.sat<0&&(this.sat=0),r=colorObject(hslToRgb(this.hue,this.sat,this.lightness),this.opacity,this.hue,this.sat),this.attachValues(r)},lighter:function(t){var e,r;e=t/100||.1,this.lightness+=e,this.lightness>1&&(this.lightness=1),r=colorObject(hslToRgb(this.hue,this.sat,this.lightness),this.opacity,this.hue,this.sat),this.attachValues(r)},darker:function(t){var e,r;e=t/100||.1,this.lightness-=e,this.lightness<0&&(this.lightness=0),r=colorObject(hslToRgb(this.hue,this.sat,this.lightness),this.opacity,this.hue,this.sat),this.attachValues(r)},attachValues:function(t){this.red=t.red,this.green=t.green,this.blue=t.blue,this.hue=t.hue,this.sat=t.sat,this.lightness=t.lightness,this.whiteness=t.whiteness,this.blackness=t.blackness,this.cyan=t.cyan,this.magenta=t.magenta,this.yellow=t.yellow,this.black=t.black,this.ncol=t.ncol,this.opacity=t.opacity,this.valid=t.valid}}
\ No newline at end of file
diff --git a/lib/scripts/webpage.js b/lib/scripts/webpage.js
new file mode 100644
index 0000000..daf949e
--- /dev/null
+++ b/lib/scripts/webpage.js
@@ -0,0 +1 @@
+let absoluteBasePath,relativeBasePath,relativePathname,webpageContainer,documentContainer,viewContent,leftSidebar,rightSidebar,sidebarCollapseIcons,sidebarGutters,sidebars,sidebarDefaultWidth,sidebarTargetWidth,contentTargetWidth,themeToggle,searchInput,fileTree,outlineTree,fileTreeItems,outlineTreeItems,canvasWrapper,canvas,canvasNodes,canvasBackground,canvasBackgroundPattern,focusedCanvasNode,loadingIcon,documentType,embedType,customType,deviceSize,lastScreenWidth,loadedURL=new URL(window.location.href),isOffline=!1,collapseIconUp=["m7 15 5 5 5-5","m7 9 5-5 5 5"],collapseIconDown=["m7 20 5-5 5 5","m7 4 5 5 5-5"],isTouchDevice=isTouchCapable(),fullyInitialized=!1;async function initGlobalObjects(){"file:"!=window.location.protocol&&await loadIncludes(),loadingIcon=document.createElement("div"),loadingIcon.classList.add("loading-icon"),document.body.appendChild(loadingIcon),loadingIcon.innerHTML="<div></div><div></div><div></div><div></div>",webpageContainer=document.querySelector(".webpage-container"),documentContainer=document.querySelector(".document-container"),leftSidebar=document.querySelector(".sidebar-left"),rightSidebar=document.querySelector(".sidebar-right"),fileTree=document.querySelector(".file-tree"),outlineTree=document.querySelector(".outline-tree"),fileTreeItems=Array.from(document.querySelectorAll(".tree-container.file-tree .tree-item")),sidebars=[],sidebarGutters=[],sidebarCollapseIcons=[],leftSidebar&&rightSidebar&&(sidebarCollapseIcons=Array.from(document.querySelectorAll(".sidebar-collapse-icon")),sidebarGutters=[sidebarCollapseIcons[0].parentElement,sidebarCollapseIcons[1].parentElement],sidebars=[sidebarGutters[0].parentElement,sidebarGutters[1].parentElement]),themeToggle=document.querySelector(".theme-toggle-input")}async function initializePage(){focusedCanvasNode=null,canvasWrapper=document.querySelector(".canvas-wrapper")??canvasWrapper,canvas=document.querySelector(".canvas")??canvas;let e=document.querySelectorAll(".canvas-node");canvasNodes=e.length>0?e:canvasNodes,canvasBackground=document.querySelector(".canvas-background")??canvasBackground,canvasBackgroundPattern=document.querySelector(".canvas-background pattern")??canvasBackgroundPattern,viewContent=document.querySelector(".document-container > .view-content")??document.querySelector(".document-container > .markdown-preview-view")??viewContent,outlineTreeItems=Array.from(document.querySelectorAll(".tree-container.outline-tree .tree-item")),fullyInitialized||("file:"==window.location.protocol&&initializeForFileProtocol(),await initGlobalObjects(),initializeDocumentTypes(document),setupSidebars(),setupThemeToggle(),await setupSearch(),setupRootPath(document),sidebarDefaultWidth=await getComputedPixelValue("--sidebar-width"),contentTargetWidth=.9*await getComputedPixelValue("--line-width"),window.addEventListener("resize",(()=>onResize())),onResize()),setTimeout((()=>documentContainer.classList.remove("hide"))),!rightSidebar||"video"!=embedType&&"embed"!=embedType&&"excalidraw"!=customType&&"kanban"!=customType&&"canvas"!=documentType?rightSidebar&&rightSidebar.temporarilyCollapsed&&rightSidebar.collapsed&&(rightSidebar.collapse(!1),rightSidebar.temporarilyCollapsed=!1):rightSidebar.collapsed||rightSidebar.temporaryCollapse(),parseURLParams(),relativePathname=getVaultRelativePath(loadedURL.href)}function initializePageEvents(e){e&&(setupHeaders(e),setupTrees(e),setupLists(e),setupCallouts(e),setupCheckboxes(e),setupCanvas(e),setupCodeblocks(e),setupLinks(e),setupScroll(e))}function initializeDocumentTypes(e){e.querySelector(".document-container > .markdown-preview-view")?documentType="markdown":e.querySelector(".canvas-wrapper")?documentType="canvas":(documentType="custom",e.querySelector(".kanban-plugin")?customType="kanban":e.querySelector(".excalidraw-plugin")&&(customType="excalidraw"))}function initializeForFileProtocol(){let e=document.querySelector(".graph-view-placeholder");e&&(console.log("Running locally, skipping graph view initialization and hiding graph."),e.style.display="none",e.previousElementSibling.style.display="none")}function onEndResize(){document.body.classList.toggle("resizing",!1)}function onStartResize(){document.body.classList.toggle("resizing",!0)}window.onload=async function(){await initializePage(),initializePageEvents(document),setActiveDocument(loadedURL,!0,!1,!1),fullyInitialized=!0},window.onpopstate=function(e){if(e.preventDefault(),e.stopPropagation(),document.body.classList.contains("floating-sidebars")&&(!leftSidebar.collapsed||!rightSidebar.collapsed))return leftSidebar.collapse(!0),void rightSidebar.collapse(!0);loadDocument(getURLPath(),!1,!0),console.log("Popped state: "+getURLPath())};let checkStillResizingTimeout,isResizing=!1;function onResize(e=!1){function t(e,t){let o=window.innerWidth;return o>e&&o<t&&null==lastScreenWidth||o>e&&o<t&&(lastScreenWidth<=e||lastScreenWidth>=t)}function o(e){let t=window.innerWidth;return t>e&&null==lastScreenWidth||t>e&&lastScreenWidth<e}function n(e){let t=window.innerWidth;return t<e&&null==lastScreenWidth||t<e&&lastScreenWidth>e}isResizing||(onStartResize(),isResizing=!0),o(contentTargetWidth+2*sidebarDefaultWidth)||o(1025)?(deviceSize="large-screen",document.body.classList.toggle("floating-sidebars",!1),document.body.classList.toggle("is-large-screen",!0),document.body.classList.toggle("is-small-screen",!1),document.body.classList.toggle("is-tablet",!1),document.body.classList.toggle("is-phone",!1),sidebars.forEach((function(e){e.collapse(!1)})),sidebarGutters.forEach((function(e){e.collapse(!1)}))):t(1*(contentTargetWidth+sidebarDefaultWidth),contentTargetWidth+2*sidebarDefaultWidth)||t(769,1024)?(deviceSize="small screen",document.body.classList.toggle("floating-sidebars",!1),document.body.classList.toggle("is-large-screen",!1),document.body.classList.toggle("is-small-screen",!0),document.body.classList.toggle("is-tablet",!1),document.body.classList.toggle("is-phone",!1),sidebarGutters.forEach((function(e){e.collapse(!1)})),leftSidebar&&rightSidebar&&!leftSidebar.collapsed&&rightSidebar.collapse(!0)):t(2*sidebarDefaultWidth,1*(contentTargetWidth+sidebarDefaultWidth))||t(481,768)?(deviceSize="tablet",document.body.classList.toggle("floating-sidebars",!0),document.body.classList.toggle("is-large-screen",!1),document.body.classList.toggle("is-small-screen",!1),document.body.classList.toggle("is-tablet",!0),document.body.classList.toggle("is-phone",!1),sidebarGutters.forEach((function(e){e.collapse(!1)})),leftSidebar&&rightSidebar&&!leftSidebar.collapsed&&rightSidebar.collapse(!0),leftSidebar&&!fullyInitialized&&leftSidebar.collapse(!0)):(n(2*sidebarDefaultWidth)||n(480))&&(deviceSize="phone",document.body.classList.toggle("floating-sidebars",!0),document.body.classList.toggle("is-large-screen",!1),document.body.classList.toggle("is-small-screen",!1),document.body.classList.toggle("is-tablet",!1),document.body.classList.toggle("is-phone",!0),sidebars.forEach((function(e){e.collapse(!0)})),sidebarGutters.forEach((function(e){e.collapse(!1)}))),lastScreenWidth=window.innerWidth,null!=checkStillResizingTimeout&&clearTimeout(checkStillResizingTimeout);let i=window.innerWidth;checkStillResizingTimeout=setTimeout((function(){window.innerWidth==i&&(checkStillResizingTimeout=void 0,isResizing=!1,onEndResize())}),200)}function clamp(e,t,o){return Math.min(Math.max(e,t),o)}async function delay(e){return new Promise((t=>setTimeout(t,e)))}async function waitUntil(e,t=100,o=2e3){return new Promise((n=>{let i=0,a=setTimeout((()=>{clearInterval(i),n()}),o);i=setInterval((()=>{e()&&(clearInterval(i),clearTimeout(a),n())}),t)}))}function getElBounds(e){let t=e.getBoundingClientRect(),o=t.x,n=t.y,i=t.width,a=t.height;return{x:o,y:n,width:i,height:a,minX:o,minY:n,maxX:o+i,maxY:n+a,centerX:t.x+t.width/2,centerY:t.y+t.height/2}}async function getComputedPixelValue(e){const t=document.createElement("div");document.body.appendChild(t),t.style.position="absolute",t.style.width=`var(${e})`,await new Promise((e=>setTimeout(e,10)));const o=window.getComputedStyle(t).width;return t.remove(),parseFloat(o)}function getPointerPosition(e){let t=e.touches?Array.from(e.touches):[];return{x:t.length>0?t.reduce(((e,t)=>e+t.clientX),0)/e.touches.length:e.clientX,y:t.length>0?t.reduce(((e,t)=>e+t.clientY),0)/e.touches.length:e.clientY}}function getTouchPosition(e){return{x:e.clientX,y:e.clientY}}function getAllChildrenRecursive(e){let t=[];for(let o=0;o<e.children.length;o++){const n=e.children[o];t.push(n),t=t.concat(getAllChildrenRecursive(n))}return t}function isMobile(){let e=!1;var t;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e}function isTouchCapable(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function downloadBlob(e,t="file.txt"){if(window.navigator&&window.navigator.msSaveOrOpenBlob)return window.navigator.msSaveOrOpenBlob(e);const o=window.URL.createObjectURL(e),n=document.createElement("a");n.href=o,n.download=t,n.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),setTimeout((()=>{window.URL.revokeObjectURL(o),n.remove()}),100)}function extentionToTag(e){return["png","jpg","jpeg","svg","gif","bmp","ico"].includes(e)?"img":["mp4","mov","avi","webm","mpeg"].includes(e)?"video":["mp3","wav","ogg","aac"].includes(e)?"audio":["pdf"].includes(e)?"embed":void 0}let slideUp=(e,t=500)=>{e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=t+"ms",e.style.boxSizing="border-box",e.style.height=e.offsetHeight+"px",e.offsetHeight,e.style.overflow="hidden",e.style.height=0,e.style.paddingTop=0,e.style.paddingBottom=0,e.style.marginTop=0,e.style.marginBottom=0,window.setTimeout((async()=>{e.style.display="none",e.style.removeProperty("height"),e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")}),t)},slideUpAll=(e,t=500)=>{e.forEach((async e=>{e&&(e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=t+"ms",e.style.boxSizing="border-box",e.style.height=e.offsetHeight+"px",e.offsetHeight,e.style.overflow="hidden",e.style.height=0,e.style.paddingTop=0,e.style.paddingBottom=0,e.style.marginTop=0,e.style.marginBottom=0)})),window.setTimeout((async()=>{e.forEach((async e=>{e&&(e.style.display="none",e.style.removeProperty("height"),e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property"))}))}),t)},slideDown=(e,t=500)=>{e.style.removeProperty("display");let o=window.getComputedStyle(e).display;"none"===o&&(o="block"),e.style.display=o;let n=e.offsetHeight;e.style.overflow="hidden",e.style.height=0,e.style.paddingTop=0,e.style.paddingBottom=0,e.style.marginTop=0,e.style.marginBottom=0,e.offsetHeight,e.style.boxSizing="border-box",e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=t+"ms",e.style.height=n+"px",e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),window.setTimeout((async()=>{e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")}),t)},slideDownAll=(e,t=500)=>{e.forEach((async e=>{if(!e)return;e.style.removeProperty("display");let o=window.getComputedStyle(e).display;"none"===o&&(o="block"),e.style.display=o;let n=e.offsetHeight;e.style.overflow="hidden",e.style.height=0,e.style.paddingTop=0,e.style.paddingBottom=0,e.style.marginTop=0,e.style.marginBottom=0,e.offsetHeight,e.style.boxSizing="border-box",e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=t+"ms",e.style.height=n+"px",e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom")})),window.setTimeout((async()=>{e.forEach((async e=>{e&&(e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property"))}))}),t)};var slideToggle=(e,t=500)=>"none"===window.getComputedStyle(e).display?slideDown(e,t):slideUp(e,t),slideToggleAll=(e,t=500)=>"none"===window.getComputedStyle(e[0]).display?slideDownAll(e,t):slideUpAll(e,t);function getURLExtention(e){return e.split(".").pop().split("?")[0].split("#")[0].toLowerCase().trim()}let transferDocument=document.implementation.createHTMLDocument(),loading=!1;async function loadDocument(e,t,o){if(e=decodeURI(e),loading)return void console.log("Already loading document.");loading=!0;let n=new URL(e,absoluteBasePath);if(relativePathname=getVaultRelativePath(n.href),console.log("Loading document: ",n.pathname),n.pathname==loadedURL?.pathname)return console.log("Document already loaded."),loadedURL=n,setActiveDocument(loadedURL,!1,!1),await initializePage(),void(loading=!1);loadedURL=n;let i,a=loadedURL.pathname;await showLoading(!0);try{i=await fetch(a)}catch(e){return window.location.assign(a),void(loading=!1)}if(i.ok){setActiveDocument(loadedURL,o,t);let n=getURLExtention(e);if("/"==n&&(n="html"),documentType="none",embedType="none",customType="none","html"==n){let e=(await i.text()).replaceAll("<!DOCTYPE html>","").replaceAll("<html>","").replaceAll("</html>","");transferDocument.write(e),setupRootPath(transferDocument),initializeDocumentTypes(transferDocument);let t=transferDocument.querySelector(".document-container");documentContainer.innerHTML=t.innerHTML;let o=transferDocument.querySelector(".outline-tree");outlineTree&&o&&(outlineTree.innerHTML=o.innerHTML),document.title=transferDocument.title,transferDocument.close()}else if(documentType="embed",embedType=extentionToTag(n),null!=embedType){let t=document.createElement(embedType);t.controls=!0,t.src=e,t.style.maxWidth="100%","embed"==embedType&&(t.style.width="100%",t.style.height="100%"),t.style.objectFit="contain",viewContent.innerHTML="",viewContent.setAttribute("class","view-content embed"),viewContent.appendChild(t),document.querySelector(".outline-tree")&&(document.querySelector(".outline-tree").innerHTML=""),document.title=e.split("/").pop()}else{downloadBlob(await i.blob(),e.split("/").pop())}await initializePage(),initializePageEvents(documentContainer),initializePageEvents(outlineTree)}else pageNotFound(viewContent);await showLoading(!1),loading=!1}function setActiveDocument(e,t,o,n=!0){let i=getVaultRelativePath(e.href),a=decodeURI(i).split("#")[0].split("?")[0].replace('"','\\"').replace("'","\\'");"/"!=a&&""!=a||(a="index.html");let l=document.querySelector(".file-tree .tree-item.mod-active"),s=document.querySelector(`.file-tree .tree-item:has(>.tree-link[href^="${a}"])`);if(s&&!s.isEqualNode(l)&&(l?.classList.remove("mod-active"),s.classList.add("mod-active"),t&&scrollIntoView(s,{block:"center",inline:"nearest"},n)),"undefined"!=typeof graphData&&window.graphRenderer){let e=graphData?.paths.findIndex((function(e){return e.endsWith(a)}))??-1;e>=0&&(window.graphRenderer.activeNode=e)}console.log("Active document: "+o),o&&"file:"!=window.location.protocol&&(window.history.pushState({path:i},"",i),console.log("Pushed state: "+i))}function parseURLParams(){const e=loadedURL.searchParams.get("mark"),t=loadedURL.searchParams.get("query"),o=decodeURI(loadedURL.hash);if(e&&searchCurrentDocument(e),t&&search(t),o){const e=document.getElementById(o.substring(1));e?scrollIntoView(e,{behavior:"smooth",block:"start"}):console.log("Heading not found: "+o)}}async function showLoading(e){if(documentContainer.style.transitionDuration="",loadingIcon.classList.toggle("show",e),documentContainer.classList.toggle("hide",e),e){let e=getViewBounds();loadingIcon.style.left=e.centerX-loadingIcon.offsetWidth/2+"px",loadingIcon.style.top=e.centerY-loadingIcon.offsetHeight/2+"px","phone"==deviceSize&&leftSidebar.collapse(!0)}await delay(200)}function pageNotFound(e){e.innerHTML="\n\t<div>\n\t\t<center style='position: relative; transform: translateY(20vh); width: 100%; text-align: center;'>\n\t\t\t<h1 style>Page Not Found</h1>\n\t\t</center>\n\t</div>\n\t",document.querySelector(".outline-tree")&&(document.querySelector(".outline-tree").innerHTML=""),console.log("Page not found: "+absoluteBasePath+loadedURL.pathname);let t=getURLRootPath(absoluteBasePath+loadedURL.pathname);relativeBasePath=t,document.querySelector("base").href=t,document.title="Page Not Found"}function setupRootPath(e){let t=e.getElementById("root-path");if(!t)return;let o=t.getAttribute("root-path"),n=document.createElement("base");n.href=o,console.log("Setting root path: "+o),document.querySelector("base").replaceWith(n),document.querySelector("#root-path").setAttribute("root-path",o),relativeBasePath=o,absoluteBasePath=new URL(o,window.location.href).href}function getURLPath(e=window.location.pathname){return null==absoluteBasePath&&setupRootPath(document),e.replace(absoluteBasePath,"")}function getURLRootPath(e=window.location.pathname){let t=getURLPath(e).split("/"),o="";for(let e=0;e<t.length-1;e++)o+="../";return o}function getVaultRelativePath(e){return e.replace(absoluteBasePath,"")}function setupHeaders(e){e.querySelectorAll(".heading-collapse-indicator").forEach((function(e){e.addEventListener("click",(function(){toggleTreeHeaderOpen(e.parentElement.parentElement,!0)}))})),e.querySelectorAll(".heading-wrapper").forEach((function(e){e.collapsed=!1,e.childrenContainer=e.querySelector(".heading-children"),e.parentHeader=e.parentElement.parentElement,e.headerElement=e.querySelector(".heading"),e.markdownPreviewSizer=getHeaderSizerEl(e),e.collapse=function(t,o=!0,n=!1){collapseHeader(e,t,o,n)},e.toggleCollapse=function(t=!0){toggleTreeHeaderOpen(e,t)},e.hide=function(){hideHeader(e)},e.show=function(t=!1,o=!1,n=!1){showHeader(e,t,o,n)}})),e.querySelectorAll(".heading").forEach((function(e){e.headingWrapper=e.parentElement}))}function isHeadingWrapper(e){return!!e&&e.classList.contains("heading-wrapper")}function getHeaderSizerEl(e){let t=e;for(;t&&!t.classList.contains("markdown-preview-sizer");)t=t.parentElement;return t||void 0}async function collapseHeader(e,t,o=!0,n=!1){let i=e.childrenContainer;if(o&&!t){let t=e.parentHeader;isHeadingWrapper(t)&&t.collapse(!1,!0,n)}if(!(e.classList.contains("is-collapsed")!=t))return void(t||"canvas"!=documentType||e.show(!0));if(e.timeout&&(clearTimeout(e.timeout),i.style.transitionDuration="",i.style.height="",e.classList.toggle("is-animating",!1)),t){e.collapseHeight=i.offsetHeight+parseFloat(i.lastChild?.marginBottom||0);let t=e.nextElementSibling;for(;t&&"canvas"==documentType;){let e=t;isHeadingWrapper(e)&&e.show(!1,!0,!0),setTimeout((function(){e.forceShown=!1}),500),t=t.nextElementSibling}}let a=e.collapseHeight;function l(t=void 0){if(null!=t)e.markdownPreviewSizer.style.minHeight=t+"px";else{let t=Array.from(e.markdownPreviewSizer.children).reduce(((e,t)=>e+t.offsetHeight),0);e.markdownPreviewSizer.style.minHeight=t+"px"}}if(i.style.height=a+"px",t||"canvas"!=documentType||e.show(!0),e.collapsed=t,n)return i.style.transitionDuration="0s",e.classList.toggle("is-collapsed",t),i.style.height="",i.style.transitionDuration="",void l();let s=getComputedStyle(i).transitionDuration;s=s.endsWith("s")?parseFloat(s):s.endsWith("ms")?parseFloat(s)/1e3:0;let r=Math.min(s*Math.sqrt(a)/16,.5);i.style.transitionDuration=`${r}s`,i.style.height=t?"0px":a+"px",e.classList.toggle("is-animating",!0),e.classList.toggle("is-collapsed",t),e.markdownPreviewSizer.closest(".markdown-embed")&&l(t?0:void 0),setTimeout((function(){i.style.transitionDuration="",t||(i.style.height=""),e.classList.toggle("is-animating",!1),l()}),1e3*r)}function toggleTreeHeaderOpen(e,t=!0){e.collapse(!e.collapsed,t)}function hideHeader(e){if(e.forceShown)return;if(e.classList.contains("is-hidden")||e.classList.contains("is-collapsed"))return;if("none"==getComputedStyle(e).display)return;let t=e.offsetHeight;e.classList.toggle("is-hidden",!0),0!=t&&(e.style.height=t+"px"),e.style.visibility="hidden"}function showHeader(e,t=!0,o=!1,n=!1){if(n&&(e.forceShown=!0),t){let t=e.parentHeader;isHeadingWrapper(t)&&t.show(!0,!1,n)}if(o){e.querySelectorAll(".heading-wrapper").forEach((function(e){e.show(!1,!0,n)}))}e.classList.contains("is-hidden")&&!e.classList.contains("is-collapsed")&&(e.classList.toggle("is-hidden",!1),e.style.height="",e.style.visibility="")}function setupTrees(e){e.querySelectorAll(".collapse-tree-button").forEach((function(e){e.treeRoot=e.closest(".tree-container"),e.icon=e.firstChild,e.icon.innerHTML="<path d></path><path d></path>",e.setIcon=function(t){e.icon.children[0].setAttribute("d",t?collapseIconUp[0]:collapseIconDown[0]),e.icon.children[1].setAttribute("d",t?collapseIconUp[1]:collapseIconDown[1])},e.collapse=function(t){setTreeCollapsedAll(e.treeRoot.classList.contains("file-tree")?fileTreeItems:outlineTreeItems,t),e.setIcon(t),e.collapsed=t},e.toggleCollapse=function(){e.collapse(!e.collapsed)},e.toggleState=function(t){void 0===t&&(t=!e.collapsed),e.collapsed=t,e.setIcon(t)},e.addEventListener("click",(function(t){return t.preventDefault(),t.stopPropagation(),e.toggleCollapse(),!1})),(e.treeRoot.classList.contains("file-tree")?fileTreeItems:outlineTreeItems).some((e=>!e.classList.contains("is-collapsed")&&e.classList.contains("mod-collapsible")))&&e.toggleState(!1)}));let t=Array.from(e.querySelectorAll(".tree-container.file-tree .tree-item:has(.collapse-icon) > .tree-link")),o=Array.from(e.querySelectorAll(".tree-container.outline-tree .tree-item:has(.collapse-icon) > .tree-link .collapse-icon")),n=Array.from(t).concat(Array.from(o));for(let e of n){let t=e?.closest(".tree-item");t&&e&&e?.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),toggleTreeCollapsed(t)}))}}async function setTreeCollapsed(e,t,o=!0,n=!0){if(e.classList.contains("mod-collapsible")||(e=e.closest(".mod-collapsible")),!e||!e.classList.contains("mod-collapsible"))return;if(e.classList.contains("is-collapsed")==t)return;if(n){let t=e.parentElement.closest(".mod-collapsible");t&&await setTreeCollapsed(t,!1,o,n)}let i=e.querySelector(".tree-item-children");if(t)e.classList.add("is-collapsed"),o?slideUp(i,100):i.style.display="none";else{e.classList.remove("is-collapsed"),o?slideDown(i,100):i.style.display="";let t=e.closest(".tree-container");if(t){let e=t.querySelector(".collapse-tree-button");e&&e.toggleState(!1)}}}async function setTreeCollapsedAll(e,t,o=!0){let n=[];e.forEach((async e=>{if(!e||!e.classList.contains("mod-collapsible"))return;let o=e.querySelector(".tree-item-children");t?e.classList.add("is-collapsed"):e.classList.remove("is-collapsed"),n.push(o)})),t?o?slideUpAll(n,100):n.forEach((async e=>{e&&(e.style.display="none")})):o?slideDownAll(n,100):n.forEach((async e=>{e&&(e.style.display="")}))}function toggleTreeCollapsed(e){(e=e.closest(".tree-item"))&&setTreeCollapsed(e,!e.classList.contains("is-collapsed"))}function toggleTreeCollapsedAll(e){e&&setTreeCollapsedAll(e,!e[0].classList.contains("is-collapsed"))}function getFileTreeItemFromPath(e){return document.querySelector(`.file-tree .tree-item:has(> .tree-link[href^="${e}"])`)}async function filterFileTree(e,t,o,n=!0){n&&await setTreeCollapsedAll(fileTreeItems,!1,!1);let i=Array.from(document.querySelectorAll(".file-tree .tree-item:not(.filtered-out)"));for await(let l of i)l.classList.add("filtered-out");await removeTreeHintLabels();for(let s=0;s<e.length;s++){let r=e[s],c=t[s],d=getFileTreeItemFromPath(r);if(d){d.classList.remove("filtered-out");let u=d.querySelector(".tree-link");u&&(u.href=r+"?mark="+o);let m=d.parentElement.closest(".tree-item");for(;m;)m.classList.remove("filtered-out"),m=m.parentElement.closest(".tree-item");if(c.length>0){let p=d.querySelector(".tree-link").appendChild(document.createElement("div"));function a(e,t){if(""==(e=e.trim()))return;let o=document.createElement("a");o.classList.add("tree-hint-label"),o.classList.add("internal-link"),o.textContent=e,o.href=decodeURI(t).replaceAll(" ","_"),p.appendChild(o)}p.classList.add("tree-hint-container");for(let h of c)a(h,r+"#"+h);setupLinks(p)}}}}async function clearFileTreeFilter(e=!0){await removeTreeHintLabels();let t=document.querySelectorAll(".file-tree .filtered-out");for await(let e of t)e.classList.remove("filtered-out");let o=document.querySelectorAll(".file-tree .tree-link[href*='?mark=']");for await(let e of o){let t=e.href.split("?")[0];t=getVaultRelativePath(t),e.href=t}e&&await setTreeCollapsedAll(fileTreeItems,!0,!1)}async function removeTreeHintLabels(){let e=document.querySelectorAll(".tree-hint-container");for await(let t of e)t.remove()}function sortFileTreeDocuments(e){let t=Array.from(document.querySelectorAll(".file-tree .tree-item.mod-tree-file:not(.filtered-out)"));t.sort(e);for(let e=1;e<t.length;e++){let o=t[e],n=t[e-1];o.parentElement==n.parentElement&&n.after(o)}let o=Array.from(document.querySelectorAll(".file-tree .tree-item.mod-tree-folder:not(.filtered-out)"));o.sort((function(e,o){let n=e.querySelector(".tree-item.mod-tree-file:not(.filtered-out)"),i=o.querySelector(".tree-item.mod-tree-file:not(.filtered-out)");return t.indexOf(n)-t.indexOf(i)}));for(let e=1;e<o.length;e++){let t=o[e],n=!1;for(let i=e-1;i>=0;i--){let e=o[i];if(t.parentElement==e.parentElement){e.after(t),n=!0;break}}n||t.parentElement.prepend(t)}}function sortFileTree(e){let t=Array.from(document.querySelectorAll(".file-tree .tree-item.mod-tree-file:not(.filtered-out)"));t.sort(e);for(let e=1;e<t.length;e++){let o=t[e],n=t[e-1];o.parentElement==n.parentElement&&n.after(o)}let o=Array.from(document.querySelectorAll(".file-tree .tree-item.mod-tree-folder:not(.filtered-out)"));o.sort(e);for(let e=1;e<o.length;e++){let t=o[e],n=!1;for(let i=e-1;i>=0;i--){let e=o[i];if(t.parentElement==e.parentElement){e.after(t),n=!0;break}}n||t.parentElement.prepend(t)}}function sortFileTreeAlphabetically(e=!1){sortFileTree((function(t,o){const n=t.querySelector(".tree-item-title"),i=o.querySelector(".tree-item-title");if(!n||!i)return 0;const a=n.textContent.toLowerCase(),l=i.textContent.toLowerCase();return a.localeCompare(l,void 0,{numeric:!0})*(e?-1:1)}))}function setupLists(e){let t=Array.from(e.querySelectorAll(".list-collapse-indicator"));for(let e=0;e<t.length;e++){let o=t[e];o.addEventListener("click",(function(e){let t=o.closest("li");t&&(t.classList.toggle("is-collapsed"),o.classList.toggle("is-collapsed"))}))}}function setupCanvas(e){if("canvas"!=documentType||!e.querySelector(".canvas-wrapper"))return;e.querySelector(".canvas")?.setAttribute("style","translate: 0px 1px; scale: 1;");let t=getNodesBounds();setViewCenter(t.centerX,t.centerY),e.querySelectorAll(".canvas-node-container").forEach((function(e){var t=e.parentElement;function o(e){t.classList.toggle("is-focused"),null!=focusedCanvasNode&&focusedCanvasNode!=t&&(focusedCanvasNode.classList.remove("is-focused"),focusedCanvasNode.querySelector(".canvas-node-container").style.display=""),focusedCanvasNode=t,t.addEventListener("mouseleave",n),t.addEventListener("touchend",n)}function n(e){focusedCanvasNode&&(focusedCanvasNode.classList.remove("is-focused"),focusedCanvasNode=null),t.removeEventListener("mouseleave",n),t.removeEventListener("touchend",n)}e.addEventListener("mouseenter",o),e.addEventListener("touchstart",o)})),e.querySelectorAll(".canvas-node").forEach((function(e){e.addEventListener("dblclick",(function(t){fitViewToNode(e)}))})),e.querySelectorAll(".canvas-background").forEach((function(e){e.addEventListener("dblclick",(function(e){fitViewToCanvas()}))})),canvasWrapper.addEventListener("mousedown",n),canvasWrapper.addEventListener("touchstart",n);let o=!1;function n(e){let t=e.touches??[];if(o=!1,!(t.length>1)&&(1==e.button||0==e.button||t.length>0)){let n=getPointerPosition(e),i=!1,a=0,l=t.length,s=function(t){let s=t.touches??[],r=getPointerPosition(t);l!=s.length&&(n=r,l=s.length);let c=r.x-n.x,d=r.y-n.y;if((1==e.button||1==s.length)&&focusedCanvasNode){let e=Math.abs(c)>Math.abs(1.5*d),t=Math.abs(d)>Math.abs(1.5*c),n=focusedCanvasNode.querySelector(".markdown-preview-sizer");if(n){let i=n.scrollHeight>n.parentElement.clientHeight+1,a=n.scrollWidth>n.parentElement.clientWidth+1;o=!(!(e&&a||t&&i)||!(window?.navigator?.platform?.startsWith("Win")??1))}}if(0==e.button&&focusedCanvasNode&&""!=focusedCanvasNode.querySelector(".canvas-node-content").textContent.trim()&&(o=!0),o||(translateCanvas(c,d),n=r),2==s.length){let e=getPointerPosition(t,!1),o=getTouchPosition(t.touches[0]),n=getTouchPosition(t.touches[1]),l=Math.sqrt(Math.pow(o.x-n.x,2)+Math.pow(o.y-n.y,2));i||(i=!0,a=l),scaleCanvasAroundPoint(1+(l-a)/a,e.x,e.y),a=l}},r=function(e){document.body.removeEventListener("mousemove",s),document.body.removeEventListener("mouseup",r),document.body.removeEventListener("mouseenter",c),document.body.removeEventListener("touchmove",s),document.body.removeEventListener("touchend",r),document.body.removeEventListener("touchcancel",r),o=!1},c=function(e){1!=e.buttons&&4!=e.buttons&&r(e)};document.body.addEventListener("mousemove",s),document.body.addEventListener("mouseup",r),document.body.addEventListener("mouseenter",c),document.body.addEventListener("touchmove",s),document.body.addEventListener("touchend",r),document.body.addEventListener("touchcancel",r)}}let i=0,a=0;canvasWrapper.addEventListener("mousemove",(function(e){let t=getPointerPosition(e);i=t.x,a=t.y}));let l=1,s=0,r=!1;canvasWrapper.addEventListener("wheel",(function(e){if(focusedCanvasNode){let e=focusedCanvasNode.querySelector(".markdown-preview-sizer");if(e&&e.scrollHeight>e.parentElement.clientHeight)return}if(e.preventDefault(),e.stopPropagation(),r){let t=1;t-=e.deltaY/700*t,t=clamp(t,.1,10);let o=getViewBounds();scaleCanvasAroundPoint(t,o.centerX,o.centerY)}else{let t=0==s;s-=e.deltaY/200;const o=.14*l;s=clamp(s,-o,o),t&&requestAnimationFrame(m)}}));let c=0,d=0,u=0;function m(e){if(c=e-d,0==d&&(c=30),d=e,u=.05*c+.95*u,u>50)return console.log("Scrolling too slow, turning on instant scroll"),void(r=!0);let t=l;l+=s*(c/1e3)*30,l=clamp(l,.1,10);getViewBounds();scaleCanvasAroundPoint(l/t,i,a),s*=.4,Math.abs(s)<.01?(s=0,d=0):requestAnimationFrame(m)}setTimeout(fitViewToCanvas,300)}function getViewBounds(){let e=viewContent.getBoundingClientRect(),t=e.x,o=e.y,n=e.x+e.width,i=e.y+e.height;return{x:t,y:o,width:n-t,height:i-o,minX:t,minY:o,maxX:n,maxY:i,centerX:e.x+e.width/2,centerY:e.y+e.height/2}}function getNodesBounds(){let e=1/0,t=1/0,o=-1/0,n=-1/0;canvasNodes.forEach((function(i){let a=i.getBoundingClientRect();a.x<e&&(e=a.x),a.y<t&&(t=a.y),a.x+a.width>o&&(o=a.x+a.width),a.y+a.height>n&&(n=a.y+a.height)}));let i=o-e,a=n-t;return{x:e,y:t,width:i,height:a,minX:e,minY:t,maxX:o,maxY:n,centerX:e+i/2,centerY:t+a/2}}function getCanvasBounds(){let e=canvas.getBoundingClientRect(),t=e.x,o=e.y,n=e.width,i=e.height;return{x:t,y:o,width:n,height:i,minX:t,minY:o,maxX:t+n,maxY:o+i,centerX:e.x+e.width/2,centerY:e.y+e.height/2}}function scaleCanvasAroundPoint(e,t,o){let n=getCanvasBounds(),i=t-n.x,a=o-n.y,l=t-(n.x+i*e),s=o-(n.y+a*e);return scaleCanvas(e),translateCanvas(l,s),{x:l,y:s}}function scaleCanvas(e){let t=Math.max(e*canvas.style.scale,.001);canvas.style.scale=t,canvasWrapper.style.setProperty("--zoom-multiplier",1/Math.sqrt(t))}function translateCanvas(e,t){let o=canvas.style.translate,n=o.split(" "),i=n.length>0?parseFloat(o.split(" ")[0].trim()):0,a=n.length>1?parseFloat(o.split(" ")[1].trim()):i;canvas.style.translate=`${i+e}px ${a+t}px`}function setViewCenter(e,t){let o=getViewBounds();translateCanvas(o.centerX-e,o.centerY-t)}function getCanvasTranslation(){let e=canvas.style.translate,t=e.split(" "),o=t.length>0?parseFloat(e.split(" ")[0].trim()):0;return{x:o,y:t.length>1?parseFloat(e.split(" ")[1].trim()):o}}function scaleCanvasBackground(e){let t=e*canvasBackgroundPattern.getAttribute("width"),o=e*canvasBackgroundPattern.getAttribute("height");canvasBackgroundPattern.setAttribute("width",t),canvasBackgroundPattern.setAttribute("height",o)}function translateCanvasBackground(e,t){canvasBackgroundPattern.setAttribute("x",e+canvasBackgroundPattern.getAttribute("x")),canvasBackgroundPattern.setAttribute("y",t+canvasBackgroundPattern.getAttribute("y"))}function fitViewToNode(e){let t=getElBounds(e),o=getViewBounds(),n=getCanvasBounds(),i=.8*Math.min(o.width/t.width,o.height/t.height),a=n.x,l=n.y,s=a+(t.centerX-a)*i,r=l+(t.centerY-l)*i,c=o.centerX-s,d=o.centerY-r;t=getElBounds(e),canvas.style.transition="scale 0.5s cubic-bezier(0.5, -0.1, 0.5, 1.1), translate 0.5s cubic-bezier(0.5, -0.1, 0.5, 1.1)",scaleCanvas(i),translateCanvas(c,d),setTimeout((function(){canvas.style.transition=""}),550)}function fitViewToCanvas(){let e=getNodesBounds(),t=getViewBounds(),o=getCanvasBounds(),n=.8*Math.min(t.width/e.width,t.height/e.height),i=o.x,a=o.y,l=i+(e.centerX-i)*n,s=a+(e.centerY-a)*n,r=t.centerX-l,c=t.centerY-s;canvas.style.transition="scale 0.5s cubic-bezier(0.5, -0.1, 0.5, 1.1), translate 0.5s cubic-bezier(0.5, -0.1, 0.5, 1.1)",scaleCanvas(n),translateCanvas(r,c),setTimeout((function(){canvas.style.transition=""}),550)}function setupCallouts(e){e.querySelectorAll(".callout.is-collapsible .callout-title").forEach((function(e){e.addEventListener("click",(function(){var t=this.parentElement;t.classList.toggle("is-collapsed"),e.querySelector(".callout-fold").classList.toggle("is-collapsed"),slideToggle(t.querySelector(".callout-content"),100)}))}))}function setupCheckboxes(e){e.querySelectorAll(".task-list-item-checkbox").forEach((function(e){e.addEventListener("click",(function(){var e=this.parentElement;e.classList.toggle("is-checked"),e.setAttribute("data-task",e.classList.contains("is-checked")?"x":" ")}))})),e.querySelectorAll('.plugin-tasks-list-item input[type="checkbox"]').forEach((function(e){e.checked=e.parentElement.classList.contains("is-checked")})),e.querySelectorAll(".kanban-plugin__item.is-complete").forEach((function(e){e.querySelector('input[type="checkbox"]').checked=!0}))}function setupCodeblocks(e){e.querySelectorAll(".copy-code-button").forEach((function(t){t.addEventListener("click",(function(){var t=this.parentElement.querySelector("code").textContent;navigator.clipboard.writeText(t),this.textContent="Copied!",setTimeout((function(){e.querySelectorAll(".copy-code-button").forEach((function(e){e.textContent="Copy"}))}),2e3)}))}))}function setupLinks(e){e.querySelectorAll(".internal-link, a.tag, .tree-link, .footnote-link").forEach((function(e){e.addEventListener("click",(function(t){let o=e.getAttribute("href");if(t.preventDefault(),t.stopPropagation(),!o)return void console.log("No target found for link");let n=relativePathname.split("#")[0].split("?")[0];(o.startsWith("#")||o.startsWith("?"))&&(o=n+o),loadDocument(o,!0,!e.classList.contains("tree-link"))}))}))}function setupSidebars(){rightSidebar&&leftSidebar&&(sidebarCollapseIcons[0].otherIcon=sidebarCollapseIcons[1],sidebarCollapseIcons[1].otherIcon=sidebarCollapseIcons[0],sidebarCollapseIcons[0].gutter=sidebarGutters[0],sidebarCollapseIcons[1].gutter=sidebarGutters[1],sidebarCollapseIcons[0].sidebar=sidebars[0],sidebarCollapseIcons[1].sidebar=sidebars[1],sidebarGutters[0].otherGutter=sidebarGutters[1],sidebarGutters[1].otherGutter=sidebarGutters[0],sidebarGutters[0].collapseIcon=sidebarCollapseIcons[0],sidebarGutters[1].collapseIcon=sidebarCollapseIcons[1],sidebars[0].otherSidebar=sidebars[1],sidebars[1].otherSidebar=sidebars[0],sidebars[0].gutter=sidebarGutters[0],sidebars[1].gutter=sidebarGutters[1],sidebars.forEach((function(e){e.collapsed=e.classList.contains("is-collapsed"),e.collapse=function(t=!0){if(!t&&this.temporarilyCollapsed&&"large-screen"==deviceSize&&this.gutter.collapse(!0),!t&&document.body.classList.contains("floating-sidebars")){document.body.addEventListener("click",(function t(o){o.target.closest(".sidebar")||(e.collapse(!0),document.body.removeEventListener("click",t))}))}"phone"==deviceSize&&(t||e.otherSidebar.fullCollapse(!0,!0),t&&e.gutter.otherGutter.collapse(!1,!0)),"tablet"==deviceSize&&(t||e.otherSidebar.collapse(!0)),this.classList.toggle("is-collapsed",t),this.collapsed=t},e.temporaryCollapse=function(e=!0){this.temporarilyCollapsed=!0,this.collapse(!0),this.gutter.collapse(!1),this.collapsed=e},e.fullCollapse=function(e=!0,t=!1){this.collapse(e),this.gutter.collapse(!0,t),this.collapsed=e},e.toggleCollapse=function(){this.collapse(!this.collapsed)},e.toggleFullCollapse=function(){this.fullCollapse(!this.collapsed)}})),sidebarGutters.forEach((function(e){e.collapsed=e.classList.contains("is-collapsed"),e.collapse=function(e,t=!1){t&&(this.classList.toggle("is-collapsed",e),this.collapsed=e)},e.toggleCollapse=function(){this.collapse(!this.collapsed)}})),sidebarCollapseIcons.forEach((function(e){e.addEventListener("click",(function(t){t.stopPropagation(),e.sidebar.toggleCollapse()}))})),isMobile()||setupSidebarResize())}function setupSidebarResize(){let e=document.querySelector(".sidebar-left .sidebar-handle"),t=document.querySelector(".sidebar-right .sidebar-handle");if(!e||!t)return;let o=null,n=15*parseFloat(getComputedStyle(e.parentElement).fontSize),i=n/4,a=localStorage.getItem("sidebar-right-width"),l=localStorage.getItem("sidebar-left-width");function s(e){if(!o)return;var t=o.classList.contains("sidebar-left")?e.clientX:window.innerWidth-e.clientX,a=`min(max(${t}px, 15em), 40vw)`;t<i?(o.collapse(!0),o.style.removeProperty("transition-duration")):(o.collapse(!1),o.style.setProperty("--sidebar-width",a),t>n&&(o.style.transitionDuration="0s"))}function r(e){o=e.target.closest(".sidebar"),o.classList.add("is-resizing"),document.addEventListener("pointermove",s),document.addEventListener("pointerup",(function(){document.removeEventListener("pointermove",s);var e=getComputedStyle(o).getPropertyValue("--sidebar-width");let t=o.classList.contains("sidebar-left");localStorage.setItem(t?"sidebar-left-width":"sidebar-right-width",e),o.classList.remove("is-resizing"),o.style.removeProperty("transition-duration")}))}function c(e){let t=e.target.closest(".sidebar");if(t){t.style.removeProperty("transition-duration"),t.style.removeProperty("--sidebar-width");let e=t.classList.contains("sidebar-left");localStorage.removeItem(e?"sidebar-left-width":"sidebar-right-width")}}a&&document.querySelector(".sidebar-right").style.setProperty("--sidebar-width",a),l&&document.querySelector(".sidebar-left").style.setProperty("--sidebar-width",l),e.addEventListener("pointerdown",r),t.addEventListener("pointerdown",r),e.addEventListener("dblclick",c),t.addEventListener("dblclick",c)}function getSidebarWidthProp(){return getComputedPixelValue("--sidebar-width")}function setupThemeToggle(){function e(e,t=!1){if(themeToggle.checked=e,t){var o=document.body.style.transition;document.body.style.transition="none"}!themeToggle.classList.contains("is-checked")&&e?themeToggle.classList.add("is-checked"):themeToggle.classList.contains("is-checked")&&!e&&themeToggle.classList.remove("is-checked"),e?(document.body.classList.contains("theme-dark")&&document.body.classList.remove("theme-dark"),document.body.classList.contains("theme-light")||document.body.classList.add("theme-light")):(document.body.classList.contains("theme-light")&&document.body.classList.remove("theme-light"),document.body.classList.contains("theme-dark")||document.body.classList.add("theme-dark")),t&&setTimeout((function(){document.body.style.transition=o}),100),localStorage.setItem("theme",e?"light":"dark")}themeToggle&&(null!=localStorage.getItem("theme")&&e("light"==localStorage.getItem("theme")),document.body.classList.contains("theme-light")?e(!0):e(!1),document.querySelector(".theme-toggle-input")?.addEventListener("change",(t=>{let o=!("light"==localStorage.getItem("theme"));console.log("Theme toggle changed to: "+o),e(o)})))}let index,searchResults,flashElement=null,flashAnimation=null;function scrollIntoView(e,t,o=!0){setTreeCollapsed(e,!1,o);flashElement&&(flashElement.remove(),flashAnimation.cancel()),flashElement=document.createElement("div"),flashElement.classList.add("scroll-highlight"),e.appendChild(flashElement),t?flashElement.scrollIntoView({behavior:o?"smooth":"auto",...t}):flashElement.scrollIntoView({behavior:o?"smooth":"auto"});var n=e.style.position;e.style.position="relative",flashAnimation=flashElement.animate([{opacity:0},{opacity:.8},{opacity:.8},{opacity:.8},{opacity:.8},{opacity:.8},{opacity:0}],{duration:1500,iterations:1,delay:300}),flashAnimation.onfinish=function(){flashElement.remove(),e.style.position=n}}function setupScroll(e){if("canvas"!=documentType)return;let t=Array.from(e.querySelectorAll(".markdown-preview-view")),o=0,n=0;t.forEach((async function(e){console.log("Setting up markdown view");let t=Array.from(e.querySelectorAll(".heading-wrapper"));e.updateVisibleWindowMarkdown=function(o=!0,i=!0){let a=e.getBoundingClientRect();n=Math.min(.1*a.height,150);let l=a.top-n,s=a.bottom+n;async function r(e){let t=e?.getBoundingClientRect();if(!t)return;let n=t.top<l&&t.bottom<l||t.top>s&&t.bottom>s;n&&o?e.hide():!n&&i&&e.show()}for(let e=0;e<t.length;e++){let o=t[e];o&&r(o)}};let o=0;e.addEventListener("scroll",(function(){Math.abs(e.scrollTop-o)>n/3&&e.updateVisibleWindowMarkdown(!1,!0),o=e.scrollTop}))})),setInterval((async function(){t.length>0&&(t[o].updateVisibleWindowMarkdown(),o=(o+1)%t.length)}),200)}function setupExcalidraw(e){e.querySelectorAll(".excalidraw-svg svg").forEach((function(e){let t=e.querySelector("rect").getAttribute("fill")>"#7F7F7F";e.classList.add(t?"light":"dark")}))}async function setupSearch(){if(isFileProtocol)return;if(searchInput=document.querySelector('input[type="search"]'),!searchInput)return;const e=await fetch("lib/search-index.json"),t=await e.text();index=MiniSearch.loadJSON(t,{fields:["title","path","tags","headers"]});document.querySelector(".search-input-clear-button").addEventListener("click",(e=>{search("")})),searchInput.addEventListener("input",(e=>{const t=e.target.value??"";startsWithAny(t,["#","tag:","title:","name:","header:","H:"])?searchInput.style.color="var(--text-accent)":searchInput.style.color="",search(t)})),searchResults=document.createElement("div"),searchResults.setAttribute("id","search-results")}async function search(e){searchInput.value=e;let t=["title","content","tags","headers","path"];if(e.startsWith("#")&&(t=["tags","headers"]),e.startsWith("tag:")&&(e=e.substring(e.indexOf(":")+1),t=["tags"]),startsWithAny(e,["title:","name:"])&&(e=e.substring(e.indexOf(":")+1),t=["title"]),startsWithAny(e,["header:","H:"])&&(e=e.substring(e.indexOf(":")+1),t=["headers"]),startsWithAny(e,["path:"])&&(e=e.substring(e.indexOf(":")+1),t=["path"]),e.length>=1){const o=index.search(e,{prefix:!0,fuzzy:.3,boost:{title:4,headers:3,tags:2,path:1},fields:t});let n=[],i=[];for(let t of o){if((t.score<.33*o[0].score||n.length>12)&&n.length>3||t.score<.1*o[0].score)break;n.push(t.path);let a=[],l=!1;for(match in t.match){if(t.match[match].includes("headers"))for(let o of t.headers)if(o.toLowerCase().includes(match.toLowerCase())&&(a.push(o),e.toLowerCase()!=match.toLowerCase())){l=!0;break}if(l)break}i.push(a)}if(document.querySelector(".file-tree"))filterFileTree(n,i,e).then((()=>sortFileTreeDocuments(((e,t)=>{if(!e||!t)return 0;let o=getVaultRelativePath(e.firstChild.href),i=getVaultRelativePath(t.firstChild.href);return n.findIndex((e=>o.startsWith(e)))-n.findIndex((e=>i.startsWith(e)))}))));else{const t=document.createElement("div");o.slice(0,10).forEach((o=>{const n=document.createElement("div");n.classList.add("search-result");const i=document.createElement("a");i.classList.add("tree-link");const a=o.path+"?mark="+encodeURIComponent(e);i.setAttribute("href",a),i.appendChild(document.createTextNode(o.title)),n.appendChild(i),t.append(n)})),searchResults.replaceChildren(t),searchInput.parentElement.after(searchResults),initializePageEvents(searchResults)}}else searchResults&&searchResults.parentElement&&searchResults.parentNode.removeChild(searchResults),clearCurrentDocumentSearch(),fileTree&&clearFileTreeFilter().then((()=>sortFileTreeAlphabetically()))}function startsWithAny(e,t){for(let o=0;o<t.length;o++)if(e.startsWith(t[o]))return!0;return!1}async function searchCurrentDocument(e){clearCurrentDocumentSearch();getTextNodes(document.querySelector(".markdown-preview-sizer")??documentContainer).forEach((async t=>{const o=t.nodeValue,n=o.replace(new RegExp(e,"gi"),(e=>`<mark>${e}</mark>`));if(n!==o){const e=document.createElement("div");e.innerHTML=n;Array.from(e.childNodes).forEach((e=>{e.nodeType!=Node.TEXT_NODE&&e.setAttribute("class","search-mark"),t.parentNode.insertBefore(e,t)})),t.parentNode.removeChild(t)}}));let t=document.querySelector(".search-mark");setTimeout((()=>{t&&scrollIntoView(t,{behavior:"smooth",block:"start"})}),500)}function clearCurrentDocumentSearch(){document.querySelectorAll(".search-mark").forEach((e=>{e.outerHTML=e.innerHTML}))}function getTextNodes(e){const t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1);let n;for(;n=o.nextNode();)t.push(n);return t}
\ No newline at end of file
diff --git a/lib/search-index.json b/lib/search-index.json
new file mode 100644
index 0000000..f4e0169
--- /dev/null
+++ b/lib/search-index.json
@@ -0,0 +1 @@
+{"documentCount":30,"nextId":30,"documentIds":{"0":"cv/curriculum-vitae.html","1":"lib\\scripts\\graph-wasm.wasm","2":"lib\\fonts\\94f2f163d4b698242fef.otf","3":"lib\\fonts\\72505e6a122c6acd5471.woff2","4":"lib\\fonts\\2d5198822ab091ce4305.woff2","5":"lib\\fonts\\c8ba52b05a9ef10f4758.woff2","6":"lib\\fonts\\cb10ffd7684cd9836a05.woff2","7":"lib\\fonts\\b5f0f109bc88052d4000.woff2","8":"lib\\fonts\\cbe0ae49c52c920fd563.woff2","9":"lib\\fonts\\535a6cf662596b3bd6a6.woff2","10":"lib\\fonts\\70cc7ff27245e82ad414.ttf","11":"lib\\fonts\\454577c22304619db035.ttf","12":"lib\\fonts\\52ac8f3034507f1d9e53.ttf","13":"lib\\fonts\\05b618077343fbbd92b7.ttf","14":"lib\\fonts\\4bb6ac751d1c5478ff3a.woff2","15":"lib\\media\\874d8b8e340f75575caa.svg","16":"lib\\html\\file-tree.html","17":"lib\\scripts\\webpage.js","18":"lib\\scripts\\graph-view.js","19":"lib\\scripts\\graph-wasm.js","20":"lib\\scripts\\graph-render-worker.js","21":"lib\\scripts\\tinycolor.js","22":"lib\\scripts\\pixi.js","23":"lib\\scripts\\minisearch.js","24":"lib\\media\\favicon.png","25":"lib\\scripts\\graph-data.js","26":"lib\\styles\\obsidian.css","27":"lib\\styles\\global-variable-styles.css","28":"lib\\styles\\main-styles.css","29":"lib\\metadata.json"},"fieldIds":{"path":0,"title":1,"content":2,"tags":3,"headers":4},"fieldLength":{"0":[4,2,80,1,30],"1":[4,2,1,1,1],"2":[4,1,1,1,1],"3":[4,1,1,1,1],"4":[4,1,1,1,1],"5":[4,1,1,1,1],"6":[4,1,1,1,1],"7":[4,1,1,1,1],"8":[4,1,1,1,1],"9":[4,1,1,1,1],"10":[4,1,1,1,1],"11":[4,1,1,1,1],"12":[4,1,1,1,1],"13":[4,1,1,1,1],"14":[4,1,1,1,1],"15":[4,1,1,1,1],"16":[4,2,1,1,1],"17":[4,1,1,1,1],"18":[5,2,1,1,1],"19":[5,2,1,1,1],"20":[6,3,1,1,1],"21":[4,1,1,1,1],"22":[4,1,1,1,1],"23":[4,1,1,1,1],"24":[4,1,1,1,1],"25":[5,2,1,1,1],"26":[4,1,1,1,1],"27":[5,3,1,1,1],"28":[4,2,1,1,1],"29":[3,1,1,1,1]},"averageFieldLength":[4.166666666666667,1.3666666666666667,3.6333333333333333,1,1.9666666666666661],"storedFields":{"0":{"path":"cv/curriculum-vitae.html","title":"Curriculum Vitae","tags":[],"headers":["Public Profiles","CVEs","Certifications","Associations","Development","Security Skills","Essential Skills","Vikrant Singh Chauhan","Data Entry Operator","Cofounder","Backend Developer","Independent Security Researcher","[[Web Developer]]","Security Software Developer / Researcher","Freelance Web Developer (Backend)","School Education","Bachelor of Computer Application (Dropped)","Bachelor of Computer Application"]},"1":{"path":"lib\\scripts\\graph-wasm.wasm","title":"graph-wasm","tags":[],"headers":[]},"2":{"path":"lib\\fonts\\94f2f163d4b698242fef.otf","title":"94f2f163d4b698242fef","tags":[],"headers":[]},"3":{"path":"lib\\fonts\\72505e6a122c6acd5471.woff2","title":"72505e6a122c6acd5471","tags":[],"headers":[]},"4":{"path":"lib\\fonts\\2d5198822ab091ce4305.woff2","title":"2d5198822ab091ce4305","tags":[],"headers":[]},"5":{"path":"lib\\fonts\\c8ba52b05a9ef10f4758.woff2","title":"c8ba52b05a9ef10f4758","tags":[],"headers":[]},"6":{"path":"lib\\fonts\\cb10ffd7684cd9836a05.woff2","title":"cb10ffd7684cd9836a05","tags":[],"headers":[]},"7":{"path":"lib\\fonts\\b5f0f109bc88052d4000.woff2","title":"b5f0f109bc88052d4000","tags":[],"headers":[]},"8":{"path":"lib\\fonts\\cbe0ae49c52c920fd563.woff2","title":"cbe0ae49c52c920fd563","tags":[],"headers":[]},"9":{"path":"lib\\fonts\\535a6cf662596b3bd6a6.woff2","title":"535a6cf662596b3bd6a6","tags":[],"headers":[]},"10":{"path":"lib\\fonts\\70cc7ff27245e82ad414.ttf","title":"70cc7ff27245e82ad414","tags":[],"headers":[]},"11":{"path":"lib\\fonts\\454577c22304619db035.ttf","title":"454577c22304619db035","tags":[],"headers":[]},"12":{"path":"lib\\fonts\\52ac8f3034507f1d9e53.ttf","title":"52ac8f3034507f1d9e53","tags":[],"headers":[]},"13":{"path":"lib\\fonts\\05b618077343fbbd92b7.ttf","title":"05b618077343fbbd92b7","tags":[],"headers":[]},"14":{"path":"lib\\fonts\\4bb6ac751d1c5478ff3a.woff2","title":"4bb6ac751d1c5478ff3a","tags":[],"headers":[]},"15":{"path":"lib\\media\\874d8b8e340f75575caa.svg","title":"874d8b8e340f75575caa","tags":[],"headers":[]},"16":{"path":"lib\\html\\file-tree.html","title":"file-tree","tags":[],"headers":[]},"17":{"path":"lib\\scripts\\webpage.js","title":"webpage","tags":[],"headers":[]},"18":{"path":"lib\\scripts\\graph-view.js","title":"graph-view","tags":[],"headers":[]},"19":{"path":"lib\\scripts\\graph-wasm.js","title":"graph-wasm","tags":[],"headers":[]},"20":{"path":"lib\\scripts\\graph-render-worker.js","title":"graph-render-worker","tags":[],"headers":[]},"21":{"path":"lib\\scripts\\tinycolor.js","title":"tinycolor","tags":[],"headers":[]},"22":{"path":"lib\\scripts\\pixi.js","title":"pixi","tags":[],"headers":[]},"23":{"path":"lib\\scripts\\minisearch.js","title":"minisearch","tags":[],"headers":[]},"24":{"path":"lib\\media\\favicon.png","title":"favicon","tags":[],"headers":[]},"25":{"path":"lib\\scripts\\graph-data.js","title":"graph-data","tags":[],"headers":[]},"26":{"path":"lib\\styles\\obsidian.css","title":"obsidian","tags":[],"headers":[]},"27":{"path":"lib\\styles\\global-variable-styles.css","title":"global-variable-styles","tags":[],"headers":[]},"28":{"path":"lib\\styles\\main-styles.css","title":"main-styles","tags":[],"headers":[]},"29":{"path":"lib\\metadata.json","title":"metadata","tags":[],"headers":[]}},"dirtCount":0,"index":[["variable",{"0":{"27":1},"1":{"27":1}}],["view",{"0":{"18":1},"1":{"18":1}}],["vikrant",{"2":{"0":1},"4":{"0":1}}],["vitae",{"0":{"0":1},"1":{"0":1}}],["render",{"0":{"20":1},"1":{"20":1}}],["researcher",{"2":{"0":2},"4":{"0":2}}],["json",{"0":{"29":1}}],["js",{"0":{"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"25":1}}],["jaipur",{"2":{"0":1}}],["tinycolor",{"0":{"21":1},"1":{"21":1}}],["tree",{"0":{"16":1},"1":{"16":1}}],["ttf",{"0":{"10":1,"11":1,"12":1,"13":1}}],["874d8b8e340f75575caa",{"0":{"15":1},"1":{"15":1}}],["4bb6ac751d1c5478ff3a",{"0":{"14":1},"1":{"14":1}}],["454577c22304619db035",{"0":{"11":1},"1":{"11":1}}],["05b618077343fbbd92b7",{"0":{"13":1},"1":{"13":1}}],["52ac8f3034507f1d9e53",{"0":{"12":1},"1":{"12":1}}],["535a6cf662596b3bd6a6",{"0":{"9":1},"1":{"9":1}}],["70cc7ff27245e82ad414",{"0":{"10":1},"1":{"10":1}}],["72505e6a122c6acd5471",{"0":{"3":1},"1":{"3":1}}],["2d5198822ab091ce4305",{"0":{"4":1},"1":{"4":1}}],["2024",{"2":{"0":1}}],["2020",{"2":{"0":1}}],["2021",{"2":{"0":1}}],["2022",{"2":{"0":1}}],["2023",{"2":{"0":1}}],["2016",{"2":{"0":2}}],["2017",{"2":{"0":1}}],["2018",{"2":{"0":1}}],["2019",{"2":{"0":1}}],["94f2f163d4b698242fef",{"0":{"2":1},"1":{"2":1}}],["lib",{"0":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1}}],["ltd",{"2":{"0":2}}],["metadata",{"0":{"29":1},"1":{"29":1}}],["media",{"0":{"15":1,"24":1}}],["main",{"0":{"28":1},"1":{"28":1}}],["manipal",{"2":{"0":1}}],["minisearch",{"0":{"23":1},"1":{"23":1}}],["moirae",{"2":{"0":1}}],["mobilehackinglab",{"2":{"0":1}}],["university",{"2":{"0":2}}],["uk",{"2":{"0":1}}],["national",{"2":{"0":1}}],["netherlands",{"2":{"0":1}}],["global",{"0":{"27":1},"1":{"27":1}}],["graph",{"0":{"1":1,"18":1,"19":1,"20":1,"25":1},"1":{"1":1,"18":1,"19":1,"20":1,"25":1}}],["gandhi",{"2":{"0":1}}],["government",{"2":{"0":1}}],["favicon",{"0":{"24":1},"1":{"24":1}}],["file",{"0":{"16":1},"1":{"16":1}}],["fire",{"2":{"0":1}}],["fonts",{"0":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1}}],["freelance",{"2":{"0":1},"4":{"0":1}}],["indira",{"2":{"0":1}}],["india",{"2":{"0":3}}],["independent",{"2":{"0":1},"4":{"0":1}}],["infolabs",{"2":{"0":1}}],["zap",{"2":{"0":1}}],["woff2",{"0":{"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"14":1}}],["worker",{"0":{"20":1},"1":{"20":1}}],["work",{"2":{"0":1}}],["wasm",{"0":{"1":2,"19":1},"1":{"1":1,"19":1}}],["webpage",{"0":{"17":1},"1":{"17":1}}],["web",{"2":{"0":3},"4":{"0":2}}],["xpress",{"2":{"0":1}}],["b5f0f109bc88052d4000",{"0":{"7":1},"1":{"7":1}}],["bachelor",{"2":{"0":2},"4":{"0":2}}],["backend",{"2":{"0":2},"4":{"0":2}}],["board",{"2":{"0":1}}],["birth",{"2":{"0":1}}],["haryana",{"2":{"0":1}}],["hsam",{"2":{"0":1}}],["html",{"0":{"0":1,"16":2}}],["obsidian",{"0":{"26":1},"1":{"26":1}}],["otf",{"0":{"2":1}}],["open",{"2":{"0":1}}],["operator",{"2":{"0":1},"4":{"0":1}}],["oscar",{"2":{"0":1}}],["dropped",{"2":{"0":1},"4":{"0":1}}],["doncaster",{"2":{"0":1}}],["developer",{"2":{"0":4},"4":{"0":4}}],["development",{"2":{"0":1},"4":{"0":1}}],["delhi",{"2":{"0":3}}],["deployed",{"2":{"0":1}}],["data",{"0":{"25":1},"1":{"25":1},"2":{"0":1},"4":{"0":1}}],["education",{"2":{"0":1},"4":{"0":1}}],["employed",{"2":{"0":1}}],["entry",{"2":{"0":1},"4":{"0":1}}],["essential",{"2":{"0":1},"4":{"0":1}}],["experience",{"2":{"0":1}}],["styles",{"0":{"26":1,"27":2,"28":2},"1":{"27":1,"28":1}}],["stardum",{"2":{"0":1}}],["svg",{"0":{"15":1}}],["scripts",{"0":{"1":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"25":1}}],["school",{"2":{"0":1},"4":{"0":1}}],["software",{"2":{"0":1},"4":{"0":1}}],["solutions",{"2":{"0":1}}],["self",{"2":{"0":1}}],["service",{"2":{"0":1}}],["security",{"2":{"0":4},"4":{"0":3}}],["singh",{"2":{"0":1},"4":{"0":1}}],["skills",{"2":{"0":3},"4":{"0":2}}],["application",{"2":{"0":2},"4":{"0":2}}],["associations",{"2":{"0":1},"4":{"0":1}}],["accomplishments",{"2":{"0":1}}],["academics",{"2":{"0":1}}],["png",{"0":{"24":1}}],["pixi",{"0":{"22":1},"1":{"22":1}}],["polls",{"2":{"0":1}}],["pvt",{"2":{"0":1}}],["profiles",{"2":{"0":1},"4":{"0":1}}],["present",{"2":{"0":1}}],["public",{"2":{"0":1},"4":{"0":1}}],["css",{"0":{"26":1,"27":1,"28":1}}],["cbe0ae49c52c920fd563",{"0":{"8":1},"1":{"8":1}}],["cb10ffd7684cd9836a05",{"0":{"6":1},"1":{"6":1}}],["c8ba52b05a9ef10f4758",{"0":{"5":1},"1":{"5":1}}],["computer",{"2":{"0":2},"4":{"0":2}}],["cofounder",{"2":{"0":1},"4":{"0":1}}],["creative",{"2":{"0":1}}],["chauhan",{"2":{"0":1},"4":{"0":1}}],["certifications",{"2":{"0":1},"4":{"0":1}}],["curriculum",{"0":{"0":1},"1":{"0":1}}],["cves",{"2":{"0":1},"4":{"0":1}}],["cv",{"0":{"0":1}}]],"serializationVersion":2}
\ No newline at end of file
diff --git a/lib/styles/global-variable-styles.css b/lib/styles/global-variable-styles.css
new file mode 100644
index 0000000..c017093
--- /dev/null
+++ b/lib/styles/global-variable-styles.css
@@ -0,0 +1 @@
+:root body{--line-width:min(40em, calc(100vw - 2em));--line-width-adaptive:min(40em, calc(100vw - 2em));--file-line-width:min(40em, calc(100vw - 2em));--sidebar-width:min(20em, 80vw)}body{--zoom-factor:1!important;--font-text-size:16px}
\ No newline at end of file
diff --git a/lib/styles/main-styles.css b/lib/styles/main-styles.css
new file mode 100644
index 0000000..b10711c
--- /dev/null
+++ b/lib/styles/main-styles.css
@@ -0,0 +1 @@
+body{--color-fade-speed:0.2s}.tree-container{position:relative;height:100%;width:auto;margin-top:3em;margin-bottom:0}.tree-container .tree-header{display:flex;flex-direction:row;align-items:center;position:absolute;top:-3em}.tree-container .tree-header .sidebar-section-header{margin-block:1em;white-space:nowrap}.tree-container:has(.tree-scroll-area:empty){display:none}body .webpage-container .tree-container .tree-scroll-area{width:100%;height:100%;max-height:100%;overflow-y:auto;border-radius:0;position:absolute;margin:0;background-color:transparent}.tree-container .tree-item{display:flex;flex-direction:column;align-items:flex-start;padding:0;padding-block:1px;overflow:hidden!important;flex:none}.tree-container .tree-item-children{padding:0;margin:0;border-left:none;width:100%}.tree-item-title>*{padding:0;margin:0;overflow:hidden;display:inline;text-overflow:ellipsis}.tree-container .tree-item-icon *{color:var(--text-muted);font-family:emoji}.tree-container .tree-item-icon :is(svg,img){-webkit-mask-image-repeat:no-repeat;-webkit-mask-image-position:center;max-width:1.3em;height:100%}.tree-container .tree-item-icon :has(svg){display:contents!important}.tree-container .tree-item-icon{min-width:1.6em;max-width:1.6em;margin-left:2px;display:flex;align-items:center;justify-content:flex-start}.tree-container .tree-item.mod-active>.tree-link>.tree-item-contents{color:var(--interactive-accent)}.tree-container .tree-link{position:relative;display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;border-radius:var(--radius-s);color:var(--nav-item-color);text-decoration-line:none;width:-webkit-fill-available;width:-moz-available;width:fill-available;margin-left:var(--tree-horizontal-spacing)}.tree-container .tree-link:active{color:var(--nav-item-color-active)}.tree-container .tree-item-contents{width:100%;height:100%;margin:0!important;padding:0!important;font-size:unset!important;padding-left:calc(var(--tree-horizontal-spacing) * 2 + var(--collapse-arrow-size))!important;border-radius:var(--radius-s);display:flex!important;flex-direction:row!important;align-items:center!important;color:var(--nav-item-color);transition:background-color .1s}.tree-container .tree-item-title{overflow:hidden;text-overflow:ellipsis!important;text-wrap:nowrap!important;white-space:nowrap!important;position:relative!important;border:none!important;width:100%;width:-webkit-fill-available;width:-moz-available;width:fill-available;background-color:transparent!important;padding-top:calc(var(--tree-vertical-spacing)/ 2)!important;padding-bottom:calc(var(--tree-vertical-spacing)/ 2)!important;margin:0!important;left:0!important;right:0!important;top:0!important;bottom:0!important}.tree-container .tree-item-title::after{right:0;position:absolute!important;margin-right:.5em!important}.tree-container .mod-tree-folder:not(:has(.mod-tree-folder)) .mod-tree-file>.tree-link>.tree-item-contents{padding-left:calc(var(--tree-horizontal-spacing) * 2)!important}.tree-container .collapse-icon{translate:calc(0px - var(--collapse-arrow-size) - var(--tree-horizontal-spacing) * 2) 0;position:absolute;height:100%;padding:var(--tree-horizontal-spacing)}.tree-container .tree-item.mod-tree-folder>.tree-link>.collapse-icon{width:100%}.collapse-icon:hover{color:var(--nav-item-color-hover)}.tree-container .clickable-icon{width:3.2em;height:2.2em}.tree-container .tree-item.is-collapsed>.tree-link>.tree-item-contents>.collapse-icon>svg{transition:transform .1s ease-in-out;transform:rotate(-90deg)}.tree-container .tree-item-contents:hover{color:var(--nav-item-color-hover)}.filtered-out{display:none!important}.tree-container>.tree-scroll-area>* .tree-item{margin-left:calc(var(--tree-horizontal-spacing) * 2 + var(--collapse-arrow-size)/ 2)}.tree-container>.tree-scroll-area>* .tree-item{border-left:var(--nav-indentation-guide-width) solid var(--nav-indentation-guide-color)}.tree-container .tree-scroll-area>*>*>.tree-item{margin-left:calc(var(--tree-horizontal-spacing) + var(--collapse-arrow-size)/ 2)}.tree-container:not(.mod-nav-indicator) .tree-scroll-area .tree-item{border-color:transparent!important}.tree-container .tree-item.mod-active{border-color:var(--interactive-accent)!important;box-shadow:2px 0 0 0 var(--interactive-accent) inset;transition:box-shadow .4s ease-in-out}.tree-container .tree-item:hover:not(.mod-active):not(.mod-collapsible):not(:has(.tree-item:hover)):not(.mod-root > * > *){border-left:var(--nav-indentation-guide-width) solid var(--nav-item-color-hover)}.tree-container .mod-active>.tree-link,.tree-container .tree-link:hover{background-color:var(--nav-item-background-hover);cursor:pointer}.webpage-container .tree-container .tree-item:not(.mod-collapsible)>.tree-item-children>.tree-item>.tree-link,.webpage-container .tree-container>.tree-scroll-area>.tree-item>.tree-link{margin-left:0!important}.tree-container.outline-tree .tree-item[data-depth='1']>.tree-link>.tree-item-contents{font-weight:900;font-size:1.1em;margin-left:0;padding-left:1em}.nav-folder.mod-root .nav-folder>.nav-folder-children{padding:0!important;margin:0!important;border:none!important}.nav-file{border-radius:0!important}.nav-folder.mod-root .nav-folder>.nav-folder-children{border-radius:var(--radius-s)!important}.webpage-container .nav-file-tag{margin-right:1em}.nav-file-title-content,.nav-folder-title-content{margin-bottom:unset!important;display:unset!important;border-radius:unset!important;cursor:unset!important;font-size:unset!important;font-weight:unset!important;line-height:unset!important;padding:unset!important}#webpage-icon :is(svg,img){width:100%;height:100%;box-shadow:none!important;border:none!important;border-radius:0!important;stroke:currentColor}#webpage-icon :has(:is(svg,img)){display:contents!important}#webpage-icon:has(:is(svg,img)){font-size:40px;width:40px;height:40px}#webpage-icon{font-size:40px;margin-bottom:8px;font-family:emoji;width:fit-content}body.show-inline-title .page-title{font-weight:var(--inline-title-weight);font-size:var(--inline-title-size);font-style:var(--inline-title-style);font-variant:var(--inline-title-variant);font-family:var(--inline-title-font);letter-spacing:-.015em;color:var(--inline-title-color)}.heading{position:relative}.heading-wrapper.is-collapsed>.heading::after{content:"..."!important;display:inline-block!important;position:absolute!important;margin:0!important;padding:0!important;margin-left:.3em!important;color:var(--text-muted)}.heading-wrapper{transition:height ease-in-out,margin-bottom ease-in-out;transition-duration:.2s;display:flex;flex-direction:column;position:relative}html>body>.webpage-container>.document-container>.markdown-preview-view>.markdown-preview-sizer>div{margin-inline:0!important;margin:0!important;padding:0!important;width:100%;max-width:100%}.markdown-rendered .heading-wrapper:has(> .heading-children > div:last-child > :is(p,pre,table,ul,ol))+.heading-wrapper>.heading:first-child{margin-top:var(--heading-spacing)}.heading-children{transition:height ease-in-out,margin-bottom ease-in-out;transition-duration:.2s;display:flow;position:relative;contain:inline-size}.heading-children.is-collapsed{padding-top:0}.heading-wrapper.is-animating>.heading-children,.heading-wrapper.is-collapsed>.heading-children{overflow:hidden;overflow:clip}.heading-wrapper>.heading>.heading-after{display:none}.heading-wrapper.is-collapsed>.heading>.heading-after{display:inline-block;margin-left:.3em;opacity:.4;font-size:1em;cursor:auto;user-select:none}.heading-wrapper.is-hidden>*{display:none}.heading-wrapper.is-hidden{visibility:hidden}.collapse-icon:not(.list-collapse-indicator) svg.svg-icon{color:var(--nav-collapse-icon-color);width:var(--collapse-arrow-size);height:var(--collapse-arrow-size);transition:transform .1s ease-in-out 0s;stroke-width:4px;min-width:10px;min-height:10px}div.is-collapsed>*>.heading-collapse-indicator.collapse-icon>svg{transition:transform .1s ease-in-out;transform:rotate(-90deg)}.heading-wrapper .heading-collapse-indicator{opacity:0;transition:opacity .15s ease-in-out;position:absolute;z-index:1;padding:0!important;padding-left:40px!important;padding-right:40px!important;left:-40px!important}.heading-wrapper .heading-collapse-indicator:hover,.heading:hover>.heading-collapse-indicator{opacity:1}.heading-wrapper-span{position:absolute;width:200vw;height:calc(100% + var(--p-spacing) * 2);top:calc(0px - var(--p-spacing));left:-100vw;z-index:-1}.markdown-embed .markdown-embed-content .markdown-preview-view .heading-wrapper-span{width:100%}.theme-toggle-container{--toggle-width:3.5em;--toggle-height:1.75em;--border-radius:calc(var(--toggle-height) / 2);--handle-width:calc(var(--toggle-height) * 0.65);--handle-radius:calc(var(--handle-width) / 2);--handle-margin:calc((var(--toggle-height) / 2.0) - var(--handle-radius));--handle-translation:calc(var(--toggle-width) - var(--handle-width) - (var(--handle-margin) * 2));display:inline-block;cursor:pointer}.clickable-icon,.sidebar-section-header{transition:color var(--color-fade-speed) ease-in-out}@keyframes toggle-slide-right{0%{width:var(--handle-width);transform:translateX(0)}50%{width:calc(var(--toggle-width) * .5)}90%{width:var(--handle-width)}100%{transform:translateX(var(--handle-translation))}}@keyframes toggle-slide-left{0%{width:var(--handle-width);transform:translateX(calc(var(--handle-translation) - ((var(--toggle-width) * .33) - var(--handle-width))))}70%{width:calc(var(--toggle-width) * .5)}100%{width:var(--handle-width);transform:translateX(0)}}@keyframes toggle-expand-right{0%{width:var(--handle-width)}100%{width:calc(var(--toggle-width) * .33)}}@keyframes toggle-expand-left{0%{width:var(--handle-width);transform:translateX(var(--handle-translation))}100%{width:calc(var(--toggle-width) * .33);transform:translateX(calc(var(--handle-translation) - ((var(--toggle-width) * .33) - var(--handle-width))))}}@keyframes toggle-contract{0%{width:calc(var(--toggle-width) * .33)}100%{width:var(--handle-width)}}.theme-toggle-input{display:none;z-index:1000}.toggle-background{position:relative;width:var(--toggle-width);height:var(--toggle-height);border-radius:var(--border-radius);background-color:var(--background-modifier-border);transition:background-color var(--color-fade-speed);z-index:1000;animation-duration:.2s}.toggle-background::before{content:"";position:absolute;left:var(--handle-margin);top:var(--handle-margin);height:var(--handle-width);width:var(--handle-width);border-radius:var(--handle-radius);background-color:var(--text-normal);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);animation:toggle-slide-left ease-in-out normal both;animation-duration:inherit;z-index:1000}.theme-toggle-input:checked~.toggle-background::before{animation:toggle-slide-right ease-in-out normal both;animation-duration:inherit}.theme-toggle-input:active~.toggle-background::before{animation:toggle-expand-right ease-in-out normal both;animation-duration:inherit}.theme-toggle-input:active:checked~.toggle-background::before{animation:toggle-expand-left ease-in-out normal both;animation-duration:inherit}.toggle-background::after{content:"";position:absolute;right:var(--handle-margin);top:calc(var(--handle-margin));height:var(--handle-width);width:var(--handle-width);transition:transform .3s;background:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/></svg>') no-repeat center center;transform:scale(.9)}.theme-toggle-input:checked~.toggle-background::after{transform:translateX(calc(var(--handle-translation) * -1)) scale(.9);background:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sun"><circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/></svg>') no-repeat center center}.graph-view-wrapper{--graph-view-max-height:35vh}#graph-canvas{width:100%;height:100%;aspect-ratio:1;transition:opacity .2s ease-in-out}.graph-view-container.expanded{position:fixed;width:90%;height:90%;max-height:unset;right:5%;top:5%;background-color:var(--background-secondary);z-index:100}body:is(.is-phone,.is-tablet) .graph-view-container.expanded{width:95%;height:95%;right:2.5%;top:2.5%}.graph-view-container{position:relative;width:100%;aspect-ratio:1;max-height:var(--graph-view-max-height);display:flex;transition:background-color var(--color-fade-speed) ease-in-out;touch-action:none;border:1px solid var(--modal-border-color);border-radius:var(--modal-radius);overflow:hidden}.graph-icon{cursor:pointer;color:var(--text-muted)}.graph-view-container .graph-icon>svg{width:24px;height:24px;background-color:var(--color-base-00);outline-width:6px;outline-color:var(--color-base-00);outline-offset:-1px;outline-style:solid;border-radius:100px;margin:10px;transition:outline-color,background-color;transition-timing-function:ease-in-out;transition-duration:var(--color-fade-speed)}.graph-view-placeholder{padding:0;width:100%;aspect-ratio:1;max-height:var(--graph-view-max-height);position:relative;flex:none}.graph-view-placeholder:has(.expanded){border-radius:var(--modal-radius);border:1px solid var(--modal-border-color)}.scale-down{transition:transform .2s ease-in-out;transform:scale(.9)}.scale-up{transition:transform .2s ease-in-out;transform:scale(1)}.graph-expand{position:absolute;top:5px;right:5px}body :is(.canvas-node-container,.canvas-wrapper){cursor:unset!important}.canvas{translate:0 0;scale:1 1;will-change:translate,scale}.canvas-controls{display:none;cursor:default!important}.canvas-card-menu{display:none;cursor:default!important}.canvas-node-content-blocker{pointer-events:none}body.is-phone .sidebar{font-size:1.15em;--tree-vertical-spacing:0.9em;--sidebar-width:85vw!important}body.is-phone{--collapse-arrow-size:13px;--tree-vertical-spacing:0.8em;--tree-horizontal-spacing:0.5em}body.is-phone .heading-wrapper .heading-collapse-indicator{transition:transform .2s ease-in-out .2s}.loading-icon{--width:80px;--height:80px;display:inline-block;position:fixed;left:calc(50% - var(--width)/ 2);top:calc(50% - var(--height)/ 2);width:var(--width);height:var(--height);opacity:0;transition:opacity .5s ease-in-out;pointer-events:none}.loading-icon.show{opacity:1}.loading-icon div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:var(--interactive-accent);animation-timing-function:cubic-bezier(0,1,1,0)}.loading-icon div:first-child{left:8px;animation:lds-ellipsis1 .6s infinite}.loading-icon div:nth-child(2){left:8px;animation:lds-ellipsis2 .6s infinite}.loading-icon div:nth-child(3){left:32px;animation:lds-ellipsis2 .6s infinite}.loading-icon div:nth-child(4){left:56px;animation:lds-ellipsis3 .6s infinite}.loading-icon:not(.show) div{animation-play-state:paused}@keyframes lds-ellipsis1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0,0)}100%{transform:translate(24px,0)}}@media print{body .webpage-container .document-container *{overflow:visible!important;overflow-y:visible!important;overflow-x:visible!important}html body.publish :is(.sidebar,script,style,include){display:none!important}:root,html body.publish>:is(.webpage-container,.document-container,.markdown-preview-view):not(script,style,include){display:contents!important}:root,html body.publish .document-container>.markdown-preview-view{background-color:transparent!important}body{display:inline!important;background:var(--background-primary)}.document-container>.markdown-preview-view>.markdown-preview-sizer{padding:0!important;margin:0!important;padding:var(--file-margins)!important;padding-bottom:0!important}html body.publish :is(.document-container,.markdown-preview-view){margin:0!important;padding:0!important}}.tree-hint-label{font-size:var(--font-smallest);color:var(--text-accent);width:100%;width:-webkit-fill-available;width:-moz-available;width:fill-available;white-space:pre-wrap;text-decoration-line:none}.tree-hint-label:hover{text-decoration-line:underline}.tree-hint-container{width:100%;padding-left:calc(var(--tree-horizontal-spacing) * 2 + var(--collapse-arrow-size));padding-bottom:calc(var(--tree-vertical-spacing)/ 2);display:flex;flex-direction:column}.tree-container .mod-tree-folder:not(:has(.mod-tree-folder)) .mod-tree-file>.tree-link>.tree-hint-container{padding-left:calc(var(--tree-horizontal-spacing) * 2)}.tree-item-contents:has(.tree-item-icon)+.tree-hint-container{margin-left:calc(1.6em + 2px)}a.tree-hint-label:hover{text-decoration-line:underline}.search-mark{margin:0!important;padding:0!important;scroll-margin:2em!important}.search-input-container:has(+ #search-results)>input[type=search]{border-bottom-left-radius:0;border-bottom-right-radius:0}input[type=search]{box-shadow:none!important;height:2.5em;font-size:1em;transition:background,background-color,border;transition-duration:var(--color-fade-speed);transition-timing-function:ease-in-out}.search-input-container{width:100%!important}.search-input-container::before{mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'></circle><line x1='21' y1='21' x2='16.65' y2='16.65'></line></svg>");mask-repeat:no-repeat;top:50%;transform:translateY(-50%)}.sidebar .sidebar-handle:hover~.sidebar-content,.sidebar.is-resizing .sidebar-content{box-shadow:0 0 0 var(--divider-width-hover) var(--divider-color-hover)}.sidebar-handle{width:min(max(calc(var(--sidebar-margin)/ 2),3px),12px);height:calc(100vh - 2 * var(--radius-l));margin-top:var(--radius-l);margin-bottom:var(--radius-l);top:0;position:absolute;cursor:ew-resize;z-index:1;transition:background-color .2s ease-in-out}.sidebar-left .sidebar-handle{right:0}.sidebar-right .sidebar-handle{left:0}.nav-folder-children .nav-folder-title-content::before{margin-right:.5em}.tree-item::before{margin-left:calc(var(--tree-horizontal-spacing) - .3em)}.tree-item-contents:has(.tree-item-icon) .tree-item-title::before,.tree-item-contents:has(.tree-item-icon)::before,.tree-item:has(.tree-item-contents > .tree-item-icon)::before{display:none!important}.anp-simple-rainbow-color-toggle.anp-simple-rainbow-indentation-toggle .tree-container.file-tree .tree-item{border-color:rgba(var(--rainbow-folder-color),.5)}.anp-collapse-folders .tree-container .tree-item .collapse-icon{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M6 14l1.45-2.9A2 2 0 0 1 9.24 10H22a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H20a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E%0A");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M6 14l1.45-2.9A2 2 0 0 1 9.24 10H22a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H20a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E%0A");-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;background-color:currentColor;display:flex;flex-basis:100%;height:16px;width:17px}.anp-collapse-folders .tree-container .tree-item.is-collapsed .collapse-icon{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2z'/%3E%3Cpath d='M2 10h20' /%3E%3C/svg%3E%0A");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2z'/%3E%3Cpath d='M2 10h20' /%3E%3C/svg%3E%0A")}.anp-file-icons .nav-file .nav-file-title::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E%0A");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E%0A");-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;background-color:currentColor;content:"";display:flex;flex-shrink:0;height:var(--size-4-4);margin-left:calc(-1 * var(--size-4-5));opacity:var(--icon-opacity);position:absolute;width:var(--size-4-4)}.anp-collapse-folders .tree-container .tree-item .collapse-icon:hover{color:currentColor}.anp-collapse-folders .tree-container .tree-item .collapse-icon svg{display:none}.document-container .kanban-plugin{position:absolute;padding:0;margin:0;height:100%}.document-container .kanban-plugin{font-family:var(--font-text, var(--default-font));font-size:.875rem;line-height:var(--line-height-tight);width:unset;overflow-y:unset;overflow-wrap:unset;color:unset;user-select:unset;-webkit-user-select:unset}.document-container .kanban-plugin__item-button-wrapper,.kanban-plugin__item-postfix-button.clickable-icon,.kanban-plugin__lane-grip,.kanban-plugin__lane-settings-button.clickable-icon{display:none}.excalidraw-plugin rect,.excalidraw-svg rect{fill:transparent}body.theme-dark .excalidraw-plugin svg.dark,body.theme-dark .excalidraw-svg svg.dark,body.theme-light .excalidraw-plugin svg.light,body.theme-light .excalidraw-svg svg.light{filter:invert(93%) hue-rotate(180deg)}.excalidraw-plugin>svg{width:100%;height:100%}.excalidraw-plugin{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;width:100%;padding:10px}.columnParent{display:flex;padding:15px 20px;flex-wrap:wrap;gap:20px}.columnParent{white-space:normal}.columnChild{flex-grow:1;flex-basis:0px}.obsidian-banner .lock-button{display:none}.markdown-preview-view:has(.obsidian-banner-wrapper){padding-top:0!important}.view-content:has(.mm-mindmap){overflow-y:none}.view-content .mm-mindmap{transform:scale(1);translate:-4000px -4000px;top:70%;left:50%;position:absolute;overflow:hidden;width:100vw}
\ No newline at end of file
diff --git a/lib/styles/obsidian.css b/lib/styles/obsidian.css
new file mode 100644
index 0000000..48655b5
--- /dev/null
+++ b/lib/styles/obsidian.css
@@ -0,0 +1 @@
+:root{--highlight-bg-color:rgba(180, 0, 170, 1);--highlight-selected-bg-color:rgba(0, 100, 0, 1)}:root{--annotation-unfocused-field-background:url("data:image/svg+xml; charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13); '/></svg>");--input-focus-border-color:Highlight;--input-focus-outline:1px solid Canvas;--input-unfocused-border-color:transparent;--input-disabled-border-color:transparent;--input-hover-border-color:black;--link-outline:none}:root{--xfa-unfocused-field-background:url("data:image/svg+xml; charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13); '/></svg>");--xfa-focus-outline:auto}:root{--viewer-container-height:0;--pdfViewer-padding-bottom:0;--page-margin:1px auto -8px;--page-border:9px solid transparent;--spreadHorizontalWrapped-margin-LR:-3.5px;--loading-icon-delay:400ms}[data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg) translateX(-100%)}.hiddenCopyElement{position:absolute;top:0;left:0;width:0;height:0;display:none}.spread{margin-left:3.5px;margin-right:3.5px;text-align:center}.spread{white-space:nowrap}.spread .dummyPage,.spread .page{display:inline-block;vertical-align:middle}body{--anim-duration-none:0;--anim-duration-superfast:70ms;--anim-duration-fast:140ms;--anim-duration-moderate:300ms;--anim-duration-slow:560ms;--anim-motion-smooth:cubic-bezier(0.45, 0.05, 0.55, 0.95);--anim-motion-delay:cubic-bezier(0.65, 0.05, 0.36, 1);--anim-motion-jumpy:cubic-bezier(0.68, -0.55, 0.27, 1.55);--anim-motion-swing:cubic-bezier(0, 0.55, 0.45, 1);--blockquote-border-thickness:2px;--blockquote-border-color:var(--interactive-accent);--blockquote-font-style:normal;--blockquote-color:inherit;--blockquote-background-color:transparent;--bold-weight:var(--font-semibold);--bold-color:inherit;--border-width:1px;--button-radius:var(--input-radius);--callout-border-width:0px;--callout-border-opacity:0.25;--callout-padding:var(--size-4-3) var(--size-4-3) var(--size-4-3) var(--size-4-6);--callout-radius:var(--radius-s);--callout-blend-mode:var(--highlight-mix-blend-mode);--callout-title-color:inherit;--callout-title-padding:0;--callout-title-size:inherit;--callout-content-padding:0;--callout-content-background:transparent;--callout-bug:var(--color-red-rgb);--callout-default:var(--color-blue-rgb);--callout-error:var(--color-red-rgb);--callout-example:var(--color-purple-rgb);--callout-fail:var(--color-red-rgb);--callout-important:var(--color-cyan-rgb);--callout-info:var(--color-blue-rgb);--callout-question:var(--color-orange-rgb);--callout-success:var(--color-green-rgb);--callout-summary:var(--color-cyan-rgb);--callout-tip:var(--color-cyan-rgb);--callout-todo:var(--color-blue-rgb);--callout-warning:var(--color-orange-rgb);--callout-quote:158,158,158;--canvas-background:var(--background-primary);--canvas-card-label-color:var(--text-faint);--canvas-color-1:var(--color-red-rgb);--canvas-color-2:var(--color-orange-rgb);--canvas-color-3:var(--color-yellow-rgb);--canvas-color-4:var(--color-green-rgb);--canvas-color-5:var(--color-cyan-rgb);--canvas-color-6:var(--color-purple-rgb);--canvas-dot-pattern:var(--color-base-30);--checkbox-radius:var(--radius-s);--checkbox-size:var(--font-text-size);--checkbox-marker-color:var(--background-primary);--checkbox-color:var(--interactive-accent);--checkbox-color-hover:var(--interactive-accent-hover);--checkbox-border-color:var(--text-faint);--checkbox-border-color-hover:var(--text-muted);--checklist-done-decoration:line-through;--checklist-done-color:var(--text-muted);--code-white-space:pre-wrap;--code-radius:var(--radius-s);--code-size:var(--font-smaller);--code-background:var(--background-primary-alt);--code-normal:var(--text-muted);--code-comment:var(--text-faint);--code-function:var(--color-yellow);--code-important:var(--color-orange);--code-keyword:var(--color-pink);--code-operator:var(--color-red);--code-property:var(--color-cyan);--code-punctuation:var(--text-muted);--code-string:var(--color-green);--code-tag:var(--color-red);--code-value:var(--color-purple);--collapse-icon-color:var(--text-faint);--collapse-icon-color-collapsed:var(--text-accent);--cursor:default;--cursor-link:pointer;--dialog-width:560px;--dialog-max-width:80vw;--dialog-max-height:85vh;--divider-color:var(--background-modifier-border);--divider-color-hover:var(--interactive-accent);--divider-width:1px;--divider-width-hover:3px;--divider-vertical-height:calc(100% - var(--header-height));--drag-ghost-background:rgba(0, 0, 0, 0.85);--drag-ghost-text-color:#fff;--embed-max-height:4000px;--embed-canvas-max-height:400px;--embed-background:inherit;--embed-border-left:2px solid var(--interactive-accent);--embed-border-right:none;--embed-border-top:none;--embed-border-bottom:none;--embed-padding:0 0 0 var(--size-4-6);--embed-font-style:inherit;--embed-block-shadow-hover:0 0 0 1px var(--background-modifier-border),inset 0 0 0 1px var(--background-modifier-border);--file-line-width:700px;--file-folding-offset:24px;--file-margins:var(--size-4-8);--file-header-font-size:var(--font-ui-small);--file-header-font-weight:400;--file-header-border:var(--border-width) solid transparent;--file-header-justify:center;--font-smallest:0.8em;--font-smaller:0.875em;--font-small:0.933em;--font-ui-smaller:12px;--font-ui-small:13px;--font-ui-medium:15px;--font-ui-large:20px;--font-thin:100;--font-extralight:200;--font-light:300;--font-normal:400;--font-medium:500;--font-semibold:600;--font-bold:700;--font-extrabold:800;--font-black:900;--footnote-size:var(--font-smaller);--graph-controls-width:240px;--graph-text:var(--text-normal);--graph-line:var(--color-base-35, var(--background-modifier-border-focus));--graph-node:var(--text-muted);--graph-node-unresolved:var(--text-faint);--graph-node-focused:var(--text-accent);--graph-node-tag:var(--color-green);--graph-node-attachment:var(--color-yellow);--heading-formatting:var(--text-faint);--heading-spacing:calc(var(--p-spacing) * 2.5);--h1-color:inherit;--h2-color:inherit;--h3-color:inherit;--h4-color:inherit;--h5-color:inherit;--h6-color:inherit;--h1-font:inherit;--h2-font:inherit;--h3-font:inherit;--h4-font:inherit;--h5-font:inherit;--h6-font:inherit;--h1-line-height:1.2;--h2-line-height:1.2;--h3-line-height:1.3;--h4-line-height:1.4;--h5-line-height:var(--line-height-normal);--h6-line-height:var(--line-height-normal);--h1-size:1.802em;--h2-size:1.602em;--h3-size:1.424em;--h4-size:1.266em;--h5-size:1.125em;--h6-size:1em;--h1-style:normal;--h2-style:normal;--h3-style:normal;--h4-style:normal;--h5-style:normal;--h6-style:normal;--h1-variant:normal;--h2-variant:normal;--h3-variant:normal;--h4-variant:normal;--h5-variant:normal;--h6-variant:normal;--h1-weight:700;--h2-weight:600;--h3-weight:600;--h4-weight:600;--h5-weight:600;--h6-weight:600;--header-height:40px;--hr-color:var(--background-modifier-border);--hr-thickness:2px;--icon-size:var(--icon-m);--icon-stroke:var(--icon-m-stroke-width);--icon-xs:14px;--icon-s:16px;--icon-m:18px;--icon-l:18px;--icon-xl:32px;--icon-xs-stroke-width:2px;--icon-s-stroke-width:2px;--icon-m-stroke-width:1.75px;--icon-l-stroke-width:1.75px;--icon-xl-stroke-width:1.25px;--icon-color:var(--text-muted);--icon-color-hover:var(--text-muted);--icon-color-active:var(--text-accent);--icon-color-focused:var(--text-normal);--icon-opacity:0.85;--icon-opacity-hover:1;--icon-opacity-active:1;--clickable-icon-radius:var(--radius-s);--indentation-guide-width:1px;--indentation-guide-width-active:1px;--indentation-guide-color:rgba(var(--mono-rgb-100), 0.12);--indentation-guide-color-active:rgba(var(--mono-rgb-100), 0.3);--inline-title-color:var(--h1-color);--inline-title-font:var(--h1-font);--inline-title-line-height:var(--h1-line-height);--inline-title-size:var(--h1-size);--inline-title-style:var(--h1-style);--inline-title-variant:var(--h1-variant);--inline-title-weight:var(--h1-weight);--inline-title-margin-bottom:0.5em;--input-height:30px;--input-radius:5px;--input-font-weight:var(--font-normal);--input-border-width:1px;--italic-color:inherit;--italic-weight:inherit;--layer-cover:5;--layer-sidedock:10;--layer-status-bar:15;--layer-popover:30;--layer-slides:45;--layer-modal:50;--layer-notice:60;--layer-menu:65;--layer-tooltip:70;--layer-dragged-item:80;--line-height-normal:1.5;--line-height-tight:1.3;--link-color:var(--text-accent);--link-color-hover:var(--text-accent-hover);--link-decoration:underline;--link-decoration-hover:underline;--link-decoration-thickness:auto;--link-external-color:var(--text-accent);--link-external-color-hover:var(--text-accent-hover);--link-external-decoration:underline;--link-external-decoration-hover:underline;--link-external-filter:none;--link-unresolved-color:var(--text-accent);--link-unresolved-opacity:0.7;--link-unresolved-filter:none;--link-unresolved-decoration-style:solid;--link-unresolved-decoration-color:hsla(var(--interactive-accent-hsl), 0.3);--list-indent:2em;--list-spacing:0.075em;--list-marker-color:var(--text-faint);--list-marker-color-hover:var(--text-muted);--list-marker-color-collapsed:var(--text-accent);--list-bullet-border:none;--list-bullet-radius:50%;--list-bullet-size:0.3em;--list-bullet-transform:none;--list-numbered-style:decimal;--nav-item-size:var(--font-ui-small);--nav-item-color:var(--text-muted);--nav-item-color-hover:var(--text-normal);--nav-item-color-active:var(--text-normal);--nav-item-color-selected:var(--text-normal);--nav-item-color-highlighted:var(--text-accent-hover);--nav-item-background-hover:var(--background-modifier-hover);--nav-item-background-active:var(--background-modifier-hover);--nav-item-background-selected:hsla(var(--color-accent-hsl), 0.15);--nav-item-padding:var(--size-4-1) var(--size-4-2) var(--size-4-1) var(--size-4-6);--nav-item-parent-padding:var(--nav-item-padding);--nav-item-children-padding-left:var(--size-2-2);--nav-item-children-margin-left:var(--size-4-3);--nav-item-weight:inherit;--nav-item-weight-hover:inherit;--nav-item-weight-active:inherit;--nav-item-white-space:nowrap;--nav-indentation-guide-width:var(--indentation-guide-width);--nav-indentation-guide-color:var(--indentation-guide-color);--nav-collapse-icon-color:var(--collapse-icon-color);--nav-collapse-icon-color-collapsed:var(--text-faint);--metadata-background:transparent;--metadata-display-reading:block;--metadata-display-editing:block;--metadata-max-width:none;--metadata-padding:var(--size-4-2) 0;--metadata-border-color:var(--background-modifier-border);--metadata-border-radius:0;--metadata-border-width:0;--metadata-divider-color:var(--background-modifier-border);--metadata-divider-color-hover:transparent;--metadata-divider-color-focus:transparent;--metadata-divider-width:0;--metadata-gap:3px;--metadata-property-padding:0;--metadata-property-radius:6px;--metadata-property-background:transparent;--metadata-property-background-hover:transparent;--metadata-property-background-active:var(--background-modifier-hover);--metadata-label-background-hover:transparent;--metadata-label-background-active:var(--background-modifier-hover);--metadata-label-font-size:var(--font-smaller);--metadata-label-font-weight:inherit;--metadata-label-text-color:var(--text-muted);--metadata-label-text-color-hover:var(--text-muted);--metadata-label-width:9em;--metadata-input-height:calc(var(--font-text-size) * 1.75);--metadata-input-text-color:var(--text-normal);--metadata-input-font-size:var(--font-smaller);--metadata-input-background:transparent;--metadata-input-background-hover:transparent;--metadata-input-background-active:var(--background-modifier-hover);--metadata-sidebar-label-font-size:var(--font-ui-small);--metadata-sidebar-input-font-size:var(--font-ui-small);--modal-background:var(--background-primary);--modal-width:90vw;--modal-height:85vh;--modal-max-width:1100px;--modal-max-height:1000px;--modal-max-width-narrow:800px;--modal-border-width:var(--border-width);--modal-border-color:var(--color-base-40, var(--background-modifier-border-focus));--modal-radius:var(--radius-l);--modal-community-sidebar-width:280px;--pill-color:var(--text-muted);--pill-color-hover:var(--text-normal);--pill-color-remove:var(--text-faint);--pill-color-remove-hover:var(--text-accent);--pill-decoration:none;--pill-decoration-hover:none;--pill-background:transparent;--pill-background-hover:transparent;--pill-border-color:var(--background-modifier-border);--pill-border-color-hover:var(--background-modifier-border-hover);--pill-border-width:var(--border-width);--pill-padding-x:0.65em;--pill-padding-y:0.25em;--pill-radius:2em;--pill-weight:inherit;--p-spacing:1rem;--p-spacing-empty:0rem;--pdf-background:var(--background-primary);--pdf-page-background:var(--background-primary);--pdf-shadow:0 0 0 1px rgba(0, 0, 0, 0.05),0 2px 8px rgba(0, 0, 0, 0.1);--pdf-spread-shadow:0 0 0 1px rgba(0, 0, 0, 0.05);--pdf-sidebar-background:var(--background-primary);--pdf-thumbnail-shadow:0 0 0 1px rgba(0, 0, 0, 0.15),0 2px 8px rgba(0, 0, 0, 0.2);--popover-width:450px;--popover-height:400px;--popover-max-height:70vh;--popover-pdf-width:600px;--popover-pdf-height:800px;--popover-font-size:var(--font-text-size);--prompt-width:700px;--prompt-max-width:80vw;--prompt-max-height:70vh;--prompt-border-width:var(--border-width);--prompt-border-color:var(--color-base-40, var(--background-modifier-border-focus));--radius-s:4px;--radius-m:8px;--radius-l:12px;--radius-xl:16px;--ribbon-background:var(--background-secondary);--ribbon-background-collapsed:var(--background-primary);--ribbon-width:44px;--ribbon-padding:var(--size-4-2) var(--size-4-1) var(--size-4-3);--scrollbar-active-thumb-bg:rgba(var(--mono-rgb-100), 0.2);--scrollbar-bg:rgba(var(--mono-rgb-100), 0.05);--scrollbar-thumb-bg:rgba(var(--mono-rgb-100), 0.1);--search-clear-button-color:var(--text-muted);--search-clear-button-size:13px;--search-icon-color:var(--text-muted);--search-icon-size:18px;--search-result-background:var(--background-primary);--size-2-1:2px;--size-2-2:4px;--size-2-3:6px;--size-4-1:4px;--size-4-2:8px;--size-4-3:12px;--size-4-4:16px;--size-4-5:20px;--size-4-6:24px;--size-4-8:32px;--size-4-9:36px;--size-4-12:48px;--size-4-16:64px;--size-4-18:72px;--sidebar-markdown-font-size:calc(var(--font-text-size) * 0.9);--sidebar-tab-text-display:none;--slider-thumb-border-width:1px;--slider-thumb-border-color:var(--background-modifier-border-hover);--slider-thumb-height:18px;--slider-thumb-width:18px;--slider-thumb-y:-6px;--slider-thumb-radius:50%;--slider-s-thumb-size:15px;--slider-s-thumb-position:-5px;--slider-track-background:var(--background-modifier-border);--slider-track-height:3px;--status-bar-background:var(--background-secondary);--status-bar-border-color:var(--divider-color);--status-bar-border-width:1px 0 0 1px;--status-bar-font-size:var(--font-ui-smaller);--status-bar-text-color:var(--text-muted);--status-bar-position:fixed;--status-bar-radius:var(--radius-m) 0 0 0;--status-bar-scroll-padding:calc(var(--status-bar-font-size) + 18px);--swatch-radius:14px;--swatch-height:24px;--swatch-width:24px;--swatch-shadow:inset 0 0 0 1px rgba(var(--mono-rgb-100), 0.15);--tab-background-active:var(--background-primary);--tab-text-color:var(--text-faint);--tab-text-color-active:var(--text-muted);--tab-text-color-focused:var(--text-muted);--tab-text-color-focused-active:var(--text-muted);--tab-text-color-focused-highlighted:var(--text-accent);--tab-text-color-focused-active-current:var(--text-normal);--tab-font-size:var(--font-ui-small);--tab-font-weight:inherit;--tab-container-background:var(--background-secondary);--tab-divider-color:var(--background-modifier-border-hover);--tab-outline-color:var(--divider-color);--tab-outline-width:1px;--tab-curve:6px;--tab-radius:var(--radius-s);--tab-radius-active:6px 6px 0 0;--tab-width:200px;--tab-max-width:320px;--tab-stacked-pane-width:700px;--tab-stacked-header-width:var(--header-height);--tab-stacked-font-size:var(--font-ui-small);--tab-stacked-font-weight:400;--tab-stacked-text-align:left;--tab-stacked-text-transform:rotate(0deg);--tab-stacked-text-writing-mode:vertical-lr;--tab-stacked-shadow:-8px 0 8px 0 rgba(0, 0, 0, 0.05);--table-background:transparent;--table-border-width:1px;--table-border-color:var(--background-modifier-border);--table-white-space:normal;--table-header-background:var(--table-background);--table-header-background-hover:inherit;--table-header-border-width:var(--table-border-width);--table-header-border-color:var(--table-border-color);--table-header-font:inherit;--table-header-size:var(--font-text-size);--table-header-weight:var(--bold-weight);--table-header-color:var(--text-normal);--table-line-height:var(--line-height-tight);--table-text-size:inherit;--table-text-color:inherit;--table-column-max-width:none;--table-column-alt-background:var(--table-background);--table-column-first-border-width:var(--table-border-width);--table-column-last-border-width:var(--table-border-width);--table-row-background-hover:var(--table-background);--table-row-alt-background:var(--table-background);--table-row-last-border-width:var(--table-border-width);--tag-size:var(--font-smaller);--tag-color:var(--text-accent);--tag-color-hover:var(--text-accent);--tag-decoration:none;--tag-decoration-hover:none;--tag-background:hsla(var(--interactive-accent-hsl), 0.1);--tag-background-hover:hsla(var(--interactive-accent-hsl), 0.2);--tag-border-color:hsla(var(--interactive-accent-hsl), 0.15);--tag-border-color-hover:hsla(var(--interactive-accent-hsl), 0.15);--tag-border-width:0px;--tag-padding-x:0.65em;--tag-padding-y:0.25em;--tag-radius:2em;--tag-weight:inherit;--titlebar-background:var(--background-secondary);--titlebar-background-focused:var(--background-secondary-alt);--titlebar-border-width:0px;--titlebar-border-color:var(--background-modifier-border);--titlebar-text-color:var(--text-muted);--titlebar-text-color-focused:var(--text-normal);--titlebar-text-weight:var(--font-bold);--toggle-border-width:2px;--toggle-width:40px;--toggle-radius:18px;--toggle-thumb-color:white;--toggle-thumb-radius:18px;--toggle-thumb-height:18px;--toggle-thumb-width:18px;--toggle-s-border-width:2px;--toggle-s-width:34px;--toggle-s-thumb-height:15px;--toggle-s-thumb-width:15px;--vault-name-font-size:var(--font-ui-small);--vault-name-font-weight:var(--font-medium);--vault-name-color:var(--text-normal);--workspace-background-translucent:rgba(var(--mono-rgb-0), 0.6);--accent-h:258;--accent-s:88%;--accent-l:66%;--background-primary:var(--color-base-00);--background-primary-alt:var(--color-base-10);--background-secondary:var(--color-base-20);--background-modifier-hover:rgba(var(--mono-rgb-100), 0.075);--background-modifier-active-hover:hsla(var(--interactive-accent-hsl), 0.15);--background-modifier-border:var(--color-base-30);--background-modifier-border-hover:var(--color-base-35);--background-modifier-border-focus:var(--color-base-40);--background-modifier-error-rgb:var(--color-red-rgb);--background-modifier-error:var(--color-red);--background-modifier-error-hover:var(--color-red);--background-modifier-success-rgb:var(--color-green-rgb);--background-modifier-success:var(--color-green);--background-modifier-message:rgba(0, 0, 0, 0.9);--background-modifier-form-field:var(--color-base-00);--text-normal:var(--color-base-100);--text-muted:var(--color-base-70);--text-faint:var(--color-base-50);--text-on-accent:white;--text-on-accent-inverted:black;--text-error:var(--color-red);--text-warning:var(--color-orange);--text-success:var(--color-green);--text-selection:hsla(var(--color-accent-hsl), 0.2);--text-highlight-bg-rgb:255,208,0;--text-highlight-bg:rgba(var(--text-highlight-bg-rgb), 0.4);--text-accent:var(--color-accent);--text-accent-hover:var(--color-accent-2);--interactive-normal:var(--color-base-00);--interactive-hover:var(--color-base-10);--interactive-accent-hsl:var(--color-accent-hsl);--interactive-accent:var(--color-accent-1);--interactive-accent-hover:var(--color-accent-2)}.theme-light{color-scheme:light;--highlight-mix-blend-mode:darken;--mono-rgb-0:255,255,255;--mono-rgb-100:0,0,0;--color-red-rgb:233,49,71;--color-red:#e93147;--color-orange-rgb:236,117,0;--color-orange:#ec7500;--color-yellow-rgb:224,172,0;--color-yellow:#e0ac00;--color-green-rgb:8,185,78;--color-green:#08b94e;--color-cyan-rgb:0,191,188;--color-cyan:#00bfbc;--color-blue-rgb:8,109,221;--color-blue:#086ddd;--color-purple-rgb:120,82,238;--color-purple:#7852ee;--color-pink-rgb:213,57,132;--color-pink:#d53984;--color-base-00:#ffffff;--color-base-05:#fcfcfc;--color-base-10:#fafafa;--color-base-20:#f6f6f6;--color-base-25:#e3e3e3;--color-base-30:#e0e0e0;--color-base-35:#d4d4d4;--color-base-40:#bdbdbd;--color-base-50:#ababab;--color-base-60:#707070;--color-base-70:#5c5c5c;--color-base-100:#222222;--color-accent-hsl:var(--accent-h),var(--accent-s),var(--accent-l);--color-accent:hsl(var(--accent-h), var(--accent-s), var(--accent-l));--color-accent-1:hsl(calc(var(--accent-h) - 1), calc(var(--accent-s) * 1.01), calc(var(--accent-l) * 1.075));--color-accent-2:hsl(calc(var(--accent-h) - 3), calc(var(--accent-s) * 1.02), calc(var(--accent-l) * 1.15));--background-secondary-alt:var(--color-base-05);--background-modifier-box-shadow:rgba(0, 0, 0, 0.1);--background-modifier-cover:rgba(220, 220, 220, 0.4);--input-shadow:inset 0 0 0 1px rgba(0, 0, 0, 0.12),0 2px 3px 0 rgba(0,0,0,.05),0 1px 1.5px 0 rgba(0,0,0,.03),0 1px 2px 0 rgba(0,0,0,.04),0 0 0 0 transparent;--input-shadow-hover:inset 0 0 0 1px rgba(0, 0, 0, 0.17),0 2px 3px 0 rgba(0,0,0,.1),0 1px 1.5px 0 rgba(0,0,0,.03),0 1px 2px 0 rgba(0,0,0,.04),0 0 0 0 transparent;--shadow-s:0px 1px 2px rgba(0, 0, 0, 0.028),0px 3.4px 6.7px rgba(0, 0, 0, .042),0px 15px 30px rgba(0, 0, 0, .07);--shadow-l:0px 1.8px 7.3px rgba(0, 0, 0, 0.071),0px 6.3px 24.7px rgba(0, 0, 0, 0.112),0px 30px 90px rgba(0, 0, 0, 0.2)}.theme-dark{color-scheme:dark;--highlight-mix-blend-mode:lighten;--mono-rgb-0:0,0,0;--mono-rgb-100:255,255,255;--color-red-rgb:251,70,76;--color-red:#fb464c;--color-orange-rgb:233,151,63;--color-orange:#e9973f;--color-yellow-rgb:224,222,113;--color-yellow:#e0de71;--color-green-rgb:68,207,110;--color-green:#44cf6e;--color-cyan-rgb:83,223,221;--color-cyan:#53dfdd;--color-blue-rgb:2,122,255;--color-blue:#027aff;--color-purple-rgb:168,130,255;--color-purple:#a882ff;--color-pink-rgb:250,153,205;--color-pink:#fa99cd;--color-base-00:#1e1e1e;--color-base-05:#212121;--color-base-10:#242424;--color-base-20:#262626;--color-base-25:#2a2a2a;--color-base-30:#363636;--color-base-35:#3f3f3f;--color-base-40:#555555;--color-base-50:#666666;--color-base-60:#999999;--color-base-70:#b3b3b3;--color-base-100:#dadada;--color-accent-hsl:var(--accent-h),var(--accent-s),var(--accent-l);--color-accent:hsl(var(--accent-h), var(--accent-s), var(--accent-l));--color-accent-1:hsl(calc(var(--accent-h) - 3), calc(var(--accent-s) * 1.02), calc(var(--accent-l) * 1.15));--color-accent-2:hsl(calc(var(--accent-h) - 5), calc(var(--accent-s) * 1.05), calc(var(--accent-l) * 1.29));--background-modifier-form-field:var(--color-base-25);--background-secondary-alt:var(--color-base-30);--interactive-normal:var(--color-base-30);--interactive-hover:var(--color-base-35);--text-accent:var(--color-accent-1);--interactive-accent:var(--color-accent);--interactive-accent-hover:var(--color-accent-1);--background-modifier-box-shadow:rgba(0, 0, 0, 0.3);--background-modifier-cover:rgba(10, 10, 10, 0.4);--text-selection:hsla(var(--interactive-accent-hsl), 0.25);--input-shadow:inset 0 0.5px 0.5px 0.5px rgba(255, 255, 255, 0.09),0 2px 4px 0 rgba(0,0,0,.15),0 1px 1.5px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.2),0 0 0 0 transparent;--input-shadow-hover:inset 0 0.5px 1px 0.5px rgba(255, 255, 255, 0.16),0 2px 3px 0 rgba(0,0,0,.3),0 1px 1.5px 0 rgba(0,0,0,.2),0 1px 2px 0 rgba(0,0,0,.4),0 0 0 0 transparent;--shadow-s:0px 1px 2px rgba(0, 0, 0, 0.121),0px 3.4px 6.7px rgba(0, 0, 0, 0.179),0px 15px 30px rgba(0, 0, 0, 0.3);--shadow-l:0px 1.8px 7.3px rgba(0, 0, 0, 0.071),0px 6.3px 24.7px rgba(0, 0, 0, 0.112),0px 30px 90px rgba(0, 0, 0, 0.2);--pdf-shadow:0 0 0 1px var(--background-modifier-border);--pdf-thumbnail-shadow:0 0 0 1px var(--background-modifier-border)}iframe{color-scheme:normal}@font-face{font-family:"Avenir Next";font-weight:400;font-style:normal;font-display:swap;src:url("../../lib/fonts/94f2f163d4b698242fef.otf")}@font-face{font-family:Inter;font-style:normal;font-weight:200;font-display:swap;src:url("../../lib/fonts/72505e6a122c6acd5471.woff2") format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:300;font-display:swap;src:url("../../lib/fonts/2d5198822ab091ce4305.woff2") format("woff2")}@font-face{font-family:Inter;font-weight:400;font-style:normal;font-display:swap;src:url("../../lib/fonts/c8ba52b05a9ef10f4758.woff2")}@font-face{font-family:Inter;font-weight:400;font-style:italic;font-display:swap;src:url("../../lib/fonts/cb10ffd7684cd9836a05.woff2")}@font-face{font-family:Inter;font-weight:600;font-style:normal;font-display:swap;src:url("../../lib/fonts/b5f0f109bc88052d4000.woff2")}@font-face{font-family:Inter;font-weight:800;font-style:normal;font-display:swap;src:url("../../lib/fonts/cbe0ae49c52c920fd563.woff2")}@font-face{font-family:Inter;font-weight:800;font-style:italic;font-display:swap;src:url("../../lib/fonts/535a6cf662596b3bd6a6.woff2")}@font-face{font-family:"Source Code Pro";font-weight:400;font-style:normal;font-display:swap;src:url("../../lib/fonts/70cc7ff27245e82ad414.ttf")}@font-face{font-family:"Source Code Pro";font-weight:400;font-style:italic;font-display:swap;src:url("../../lib/fonts/454577c22304619db035.ttf")}@font-face{font-family:"Source Code Pro";font-weight:700;font-style:normal;font-display:swap;src:url("../../lib/fonts/52ac8f3034507f1d9e53.ttf")}@font-face{font-family:"Source Code Pro";font-weight:700;font-style:italic;font-display:swap;src:url("../../lib/fonts/05b618077343fbbd92b7.ttf")}@font-face{font-family:"Flow Circular";font-display:swap;src:url("../../lib/fonts/4bb6ac751d1c5478ff3a.woff2")}@font-face{font-family:"??";unicode-range:U+0}body{--font-default:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Inter","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Microsoft YaHei Light",sans-serif;--font-monospace-default:Menlo,SFMono-Regular,Consolas,"Roboto Mono",'Source Code Pro',monospace;--font-interface-override:'??';--font-interface-theme:'??';--font-interface:var(--font-interface-override),var(--font-interface-theme),var(--default-font, '??'),var(--font-default);--font-text-override:'??';--font-text-theme:'??';--font-text:var(--font-text-override),var(--font-text-theme),var(--font-interface);--font-print-override:'??';--font-print:var(--font-print-override),var(--font-text-override),var(--font-text-theme),'Arial';--font-monospace-override:'??';--font-monospace-theme:'??';--font-monospace:var(--font-monospace-override),var(--font-monospace-theme),var(--font-monospace-default);--font-text-size:16px;--font-mermaid:var(--font-text)}*{box-sizing:border-box}body,html{margin:0;padding:0;height:100%;width:100%;overflow:hidden}body{text-rendering:optimizelegibility;font-family:var(--font-interface);line-height:var(--line-height-tight);font-size:var(--font-ui-medium);background-color:var(--background-primary);color:var(--text-normal);-webkit-tap-highlight-color:rgba(255,255,255,0)}.node-insert-event{animation-duration:10ms;animation-name:node-inserted}.is-flashing{transition:all .25s ease 0s;color:var(--text-normal);mix-blend-mode:var(--highlight-mix-blend-mode);border-radius:var(--radius-s);background-color:var(--text-highlight-bg)!important}body{user-select:none;overflow:hidden}body [contenteditable=""],body [contenteditable=true]{user-select:text}body.is-grabbing{cursor:grabbing!important}body.is-grabbing iframe:not(.is-controlled),body.is-grabbing webview{pointer-events:none}.app-container{display:flex;height:100%;width:100%;position:relative;flex-direction:column}.app-container.no-transition *{transition:none 0s ease 0s!important}.horizontal-main-container{width:100%;display:flex;overflow:hidden;flex:1 0 0px}:focus{outline:0}.is-text-garbled *{font-family:"Flow Circular",sans-serif!important;line-height:1.45em!important}.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none;outline:0}.CodeMirror-vscrollbar{right:0;top:0;overflow:hidden scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow:scroll hidden}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-linebackground{position:absolute;inset:0px;z-index:0}.CodeMirror-scrollbar-filler{background-color:transparent}.CodeMirror-activeline-background{background:0 0}.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{z-index:unset;outline:unset}.CodeMirror-vscrollbar{outline:0}.CodeMirror-hscrollbar{outline:0;z-index:3}.markdown-source-view.mod-cm6.is-readable-line-width .cm-line.HyperMD-table-row{max-width:100%}.markdown-source-view.mod-cm6 .cm-content>[contenteditable=false]{contain:paint!important}.markdown-source-view.mod-cm6 .cm-table-widget{white-space:normal;overflow-wrap:normal;word-break:normal}.empty-state{position:absolute;height:100%;width:100%;top:0;left:0;display:flex;align-items:center;justify-content:center;flex-direction:column}.empty-state-container{max-width:480px;max-height:280px;margin:20px;text-align:center}.empty-state-title{margin:20px 0;font-weight:var(--h2-weight);font-size:var(--h2-size);line-height:var(--line-height-tight);position:relative}.empty-state-action-list{font-size:var(--font-text-size);line-height:var(--line-height-tight);color:var(--text-muted);margin-top:20px}.empty-state-action{cursor:var(--cursor);line-height:36px;color:var(--text-accent)}.empty-state-close-button{display:none}body{--zoom-factor:1;--titlebar-height:30px}.pane-empty{color:var(--text-faint);font-size:var(--font-ui-small);margin:var(--size-4-2) auto;text-align:center}.view-header-title::-webkit-scrollbar{display:none}.view-content{width:100%;height:calc(100% - var(--header-height))}.inline-title{font-weight:var(--inline-title-weight);font-size:var(--inline-title-size);line-height:var(--inline-title-line-height);font-style:var(--inline-title-style);font-variant:var(--inline-title-variant);font-family:var(--inline-title-font);margin-bottom:var(--inline-title-margin-bottom);letter-spacing:-.015em;color:var(--inline-title-color)}.inline-embed .inline-title{display:none}body:not(.show-inline-title) .inline-title:not([data-level]){display:none}::selection{background-color:var(--text-selection)}.markdown-reading-view{display:flex;flex-direction:column}.markdown-preview-view{font-size:var(--font-text-size);font-family:var(--font-text);line-height:var(--line-height-normal);width:100%;height:100%;padding:var(--file-margins);position:relative;overflow-y:auto;overflow-wrap:break-word;color:var(--text-normal);user-select:text;scrollbar-gutter:stable}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer{max-width:var(--file-line-width);margin-left:auto;margin-right:auto}.markdown-rendered.rtl{direction:rtl}.side-dock-actions{flex-direction:column}.side-dock-actions .side-dock-ribbon-action{margin:0 auto}.release-notes-view{padding:var(--file-margins)}.release-notes-view .markdown-preview-view{overflow:visible}.release-notes-view .is-readable-line-width{max-width:var(--file-line-width);margin-left:auto;margin-right:auto}.modal.mod-trust-folder{max-width:700px}.modal.mod-plugin-options .modal-content{margin:var(--size-4-6) 0}.hotkey-list-container{overflow:auto}.search-input-container.mod-hotkey .clickable-icon{padding:var(--size-2-1)}.modal.mod-image-lightbox{max-width:90vw;max-height:90vh;padding:0}.modal.mod-image-lightbox .modal-content{padding:var(--size-4-12) var(--size-4-3) var(--size-4-2) var(--size-4-3);text-align:center}.login-field{max-width:500px;margin:1em auto}.modal.mod-restricted-mode .card{flex:1 0 0px}.search-input-container input:placeholder-shown~.search-input-clear-button{display:none}.installed-plugins-container{padding-top:var(--size-4-4);border-top:1px solid var(--background-modifier-border)}.workspace-tab-header-container-inner::-webkit-scrollbar,.workspace-tab-header-container-inner::-webkit-scrollbar-thumb{display:none}.mod-root .mod-pinned{--icon-size:var(--icon-s);--icon-stroke:var(--icon-s-stroke-width)}.mod-left-split .markdown-preview-view,.mod-right-split .markdown-preview-view{--file-margins:var(--size-4-5)}.mod-left-split .markdown-preview-view,.mod-right-split .markdown-preview-view{font-size:var(--sidebar-markdown-font-size)}.button-container{margin-top:20px}button{app-region:no-drag;display:inline-flex;align-items:center;justify-content:center;color:var(--text-normal);font-size:var(--font-ui-small);border-radius:var(--button-radius);border:0;padding:var(--size-4-1) var(--size-4-3);height:var(--input-height);font-weight:var(--input-font-weight);cursor:var(--cursor);font-family:inherit;outline:0;user-select:none;white-space:nowrap}button:not(.clickable-icon){background-color:var(--interactive-normal);box-shadow:var(--input-shadow)}button:focus-visible{box-shadow:0 0 0 3px var(--background-modifier-border-focus)}button[disabled=true]{cursor:not-allowed}button.mod-cta{background-color:var(--interactive-accent);color:var(--text-on-accent)}button.mod-cta:focus-visible{box-shadow:0 0 0 3px var(--background-modifier-border-focus)}button.mod-muted{background-color:var(--background-secondary);color:var(--text-muted)}button.mod-warning{background-color:var(--background-modifier-error);color:var(--text-on-accent)}button.mod-destructive{color:var(--background-modifier-error)}.icon-button-group{display:inline-block}.icon-button{display:inline-block;color:var(--interactive-normal)}.rich-button{width:auto;padding-top:5px}.rich-button-icon{position:relative;top:6px}.horizontal-preference-group{display:flex}.horizontal-preference-group button{border-radius:0;margin:0 -1px}.horizontal-preference-group button:first-child{border-top-left-radius:var(--input-radius);border-bottom-left-radius:var(--input-radius)}.horizontal-preference-group button:last-child{border-top-right-radius:var(--input-radius);border-bottom-right-radius:var(--input-radius)}.horizontal-preference-group button.is-selected{background-color:var(--interactive-accent);color:var(--text-on-accent)}.card-container{display:flex}.card-container.mod-horizontal{flex-direction:column}.card{background-color:var(--background-secondary-alt);border-radius:4px;border:1px solid var(--background-modifier-border);margin:0 10px;padding:15px 30px;display:flex;flex-direction:column;flex-grow:1}.card ul{padding:0}.card .button-container{margin:10px 0}.card-container.mod-horizontal .card{margin:10px 0}.card-container.mod-horizontal .card ul{padding-left:24px}.card li{margin:5px 0}.card.u-clickable{cursor:var(--cursor)}.card.is-selected{border:1px solid var(--interactive-accent);background-color:hsla(var(--interactive-accent-hsl),.2)}.card-title{text-align:center;font-size:20px;line-height:30px;color:var(--text-muted);margin-bottom:8px}.card-description{color:var(--text-muted);font-size:var(--font-ui-small);line-height:20px;flex-grow:1}.changelog-item{margin:var(--size-4-2) 0;font-size:var(--font-ui-medium);line-height:var(--line-height)}.changelog-item::before{content:attr(data-label);width:50px;border-radius:var(--radius-m);font-size:var(--font-ui-small);display:inline-block;text-align:center;margin-right:14px;text-transform:uppercase;letter-spacing:1px;line-height:22px}.changelog-item.mod-success::before{background-color:var(--background-modifier-success)}.changelog-item.mod-highlighted::before{background-color:var(--interactive-accent)}.page-container{width:50vw;max-width:1000px;margin:0 auto;padding:50px 0;background-color:var(--background-primary)}.page-title{font-weight:var(--font-extrabold);font-size:46px}[contenteditable]{outline:0}.rich-link{color:var(--text-accent);position:relative;padding-left:30px}.rich-link-icon{position:absolute;left:5px;top:3px}.horizontal-link-group{text-align:center}.horizontal-link-group a,.horizontal-link-group span{margin:0 10px}.footer-link-group{list-style:none;display:inline-block;margin:0 30px;padding:0}.footer-link{margin:4px 0}.list-item{display:flex;padding:0;margin:8px 0;gap:var(--size-4-2);align-items:center}.list-item-part.mod-extended{flex-grow:1;overflow-wrap:anywhere}.list-item-part.clickable-icon{display:flex;align-items:center;justify-content:center;padding:var(--size-2-2);cursor:var(--cursor);border-radius:var(--radius-s);color:var(--icon-color)}.list-item-part.clickable-icon:active,.list-item-part.clickable-icon:hover{color:var(--icon-color-hover);background-color:var(--background-modifier-hover)}.lightbox{display:none;position:fixed;z-index:999;width:100%;height:100%;text-align:center;top:0;left:0;background:rgba(0,0,0,.8)}.lightbox img{max-width:90vw;max-height:90vh;margin-top:5vh}.lightbox:target{display:block}.u-center-text{text-align:center}.u-faded-text{color:var(--text-muted)}.u-pop{color:var(--text-accent);font-weight:var(--font-semibold)}.u-muted{color:var(--text-muted)}.u-small{font-size:.8em}.u-clickable{cursor:var(--cursor)}.u-pop-bg{background-color:var(--interactive-accent);color:var(--text-on-accent);display:inline-block;padding:3px 16px;border-radius:20px;opacity:.6;cursor:default}.components-container h3{font-weight:var(--font-semibold);font-size:30px;margin:60px 0 25px}.components-container .checkbox-demo{margin:10px 0}.components-container .checkbox-demo label{display:inline-block;width:300px}.diff-view{height:100%;overflow:auto;user-select:text}.diff-line{padding:0 var(--size-4-2)}.diff-line.mod-left{background-color:rgba(var(--background-modifier-error-rgb),.2)}.diff-line.mod-left .diff-changed{background-color:rgba(var(--background-modifier-error-rgb),.4)}.diff-line.mod-right{background-color:rgba(var(--background-modifier-success-rgb),.2)}.diff-line.mod-right .diff-changed{background-color:rgba(var(--background-modifier-success-rgb),.4)}.diff-collapsed{text-align:center;color:var(--text-muted);cursor:pointer;font-size:var(--font-ui-small);margin:var(--size-4-2) 0}.diff-collapsed:hover{color:var(--text-accent)}.markdown-reading-view.is-searching{flex-direction:column-reverse}.mod-active .document-search-container{background-color:var(--background-primary)}.document-search-container{display:flex;flex-direction:column;padding:var(--size-4-2) 0;margin:0 var(--size-4-4);gap:var(--size-4-2);z-index:var(--layer-popover)}.document-replace,.document-search{width:100%;max-width:var(--file-line-width);margin:0 auto;display:flex;padding:0 var(--size-4-2);gap:var(--size-4-2)}.document-replace{display:none}.document-search-container.mod-replace-mode .document-replace{display:flex}input.document-replace-input,input.document-search-input{flex-grow:1}input.document-replace-input.mod-no-match,input.document-search-input.mod-no-match{background-color:rgba(var(--background-modifier-error-rgb),.2)}.document-replace-buttons,.document-search-buttons{display:flex;gap:var(--size-4-2);align-items:center}.document-search-button{font-size:var(--font-ui-small);padding:0 var(--size-4-2);color:var(--text-muted)}.document-search-close-button{cursor:var(--cursor);position:relative;top:2px;font-size:24px;line-height:20px;height:24px;width:24px;padding:0 var(--size-2-2);border-radius:var(--radius-s);color:var(--text-muted)}.document-search-close-button::before{font-family:Inter,sans-serif;content:"×";font-weight:300}.markdown-rendered .search-highlight>div{position:absolute;pointer-events:none;box-shadow:0 0 0 2px var(--text-normal);opacity:.3;mix-blend-mode:var(--highlight-mix-blend-mode);border-radius:2px}.markdown-rendered .search-highlight>div.is-active{box-shadow:0 0 0 3px var(--text-accent);opacity:1}select{app-region:no-drag;height:var(--input-height);font-size:var(--font-ui-small);font-family:inherit;font-weight:var(--input-font-weight);color:var(--text-normal);line-height:var(--line-height-tight);padding:0 1.9em 0 .8em;max-width:100%;box-sizing:border-box;margin:0;border:0;box-shadow:var(--input-shadow);border-radius:var(--input-radius);appearance:none;background-color:var(--interactive-normal);background-repeat:no-repeat,repeat;background-position:right .7em top 50%,0 0;background-size:.65em,100%}select:focus{box-shadow:0 0 0 3px var(--background-modifier-border-focus);outline:0}.flair{background-color:var(--interactive-normal);border-radius:var(--radius-s);color:var(--text-normal);font-size:10px;letter-spacing:.05em;margin-left:var(--size-4-2);padding:var(--size-2-1) var(--size-2-2);position:relative;text-transform:uppercase;white-space:nowrap;vertical-align:middle}.flair.mod-flat{vertical-align:top}.flair.mod-pop{background-color:var(--interactive-accent);color:var(--text-on-accent)}.markdown-preview-view:not(.allow-fold-headings) .heading-collapse-indicator,.markdown-preview-view:not(.allow-fold-lists) .list-collapse-indicator{display:none}.collapse-indicator,.fold-gutter{opacity:0}.collapse-indicator:hover,.fold-gutter.is-collapsed,.fold-gutter:hover,.is-collapsed .collapse-indicator,.metadata-properties-heading:hover .collapse-indicator,h1:hover .collapse-indicator,h2:hover .collapse-indicator,h3:hover .collapse-indicator,h4:hover .collapse-indicator,h5:hover .collapse-indicator,h6:hover .collapse-indicator{opacity:1}.collapse-icon{display:flex;align-items:center}.collapse-icon::before{content:"​"}.collapse-icon svg.svg-icon{color:var(--nav-collapse-icon-color);stroke-width:4px;width:10px;height:10px;transition:transform .1s ease-in-out 0s}.collapse-icon.is-collapsed svg.svg-icon{transform:rotate(-90deg)}.rtl .collapse-icon.is-collapsed svg.svg-icon{transform:rotate(90deg)}.view-content .collapse-indicator svg.svg-icon,.view-content .list-collapse-indicator svg.svg-icon{color:var(--collapse-icon-color)}.view-content .is-collapsed .collapse-indicator svg.svg-icon,.view-content .is-collapsed .list-collapse-indicator svg.svg-icon{color:var(--collapse-icon-color-collapsed)}.markdown-preview-view .collapse-indicator{float:left;cursor:var(--cursor)}.markdown-preview-view .collapse-indicator .svg-icon{vertical-align:middle}.markdown-preview-view li.is-collapsed>ol,.markdown-preview-view li.is-collapsed>ul{display:none}.markdown-preview-view .heading-collapse-indicator{margin-left:-22px;padding:0 6px}svg.svg-icon{height:var(--icon-size);width:var(--icon-size);stroke-width:var(--icon-stroke)}.nav-buttons-container,.side-dock-actions,.view-actions{display:flex;justify-content:center}.side-dock-actions{gap:var(--size-2-3)}.view-actions{gap:0;align-items:center;--icon-size:var(--icon-s)}.nav-file-icon .svg-icon{--icon-size:var(--icon-s);--icon-stroke:var(--icon-s-stroke-width)}.clickable-icon.side-dock-ribbon-action .svg-icon{--icon-size:var(--icon-l);--icon-stroke:var(--icon-l-stroke-width)}.clickable-icon.side-dock-ribbon-action:active{color:var(--icon-color-focused)}.clickable-icon{app-region:no-drag;background-color:transparent;display:flex;align-items:center;justify-content:center;padding:var(--size-2-2) var(--size-2-3);cursor:var(--cursor);border-radius:var(--clickable-icon-radius);color:var(--icon-color);opacity:var(--icon-opacity);transition:opacity .15s ease-in-out 0s;height:auto}.clickable-icon.is-active{opacity:var(--icon-opacity-hover);color:var(--icon-color-active);background-color:var(--background-modifier-active-hover)}.clickable-icon.mod-warning{color:var(--text-error)}.text-icon-button{app-region:no-drag;display:inline-flex;align-items:center;color:var(--text-muted);font-size:var(--font-ui-small);border-radius:var(--button-radius);padding:var(--size-2-1) var(--size-4-3) var(--size-2-1) var(--size-4-2);height:var(--input-height);font-weight:var(--input-font-weight);cursor:var(--cursor);font-family:inherit;gap:var(--size-2-2);user-select:none;white-space:nowrap}.text-icon-button .text-button-icon{display:flex;align-items:center;justify-content:center}.text-icon-button .text-button-icon svg.svg-icon{height:var(--icon-size);width:var(--icon-size);stroke-width:var(--icon-stroke)}.text-icon-button:focus{box-shadow:0 0 0 2px var(--background-modifier-border-focus);outline:0}.markdown-rendered.show-indentation-guide li>ol,.markdown-rendered.show-indentation-guide li>ul{position:relative}.markdown-rendered.show-indentation-guide li>ol::before,.markdown-rendered.show-indentation-guide li>ul::before{content:"​";position:absolute;display:block;left:-1em;top:0;bottom:0;border-right:var(--indentation-guide-width) solid var(--indentation-guide-color)}.input-label{display:inline-block;width:150px;text-align:right;margin-right:var(--size-4-2)}.input-button{padding:6px 14px;margin-left:14px;color:var(--text-muted);font-size:var(--font-ui-medium);position:relative;top:-1px}input.metadata-input-text,input[type=date],input[type=datetime-local],input[type=email],input[type=number],input[type=password],input[type=search],input[type=text],textarea{app-region:no-drag;background:var(--background-modifier-form-field);border:var(--input-border-width) solid var(--background-modifier-border);color:var(--text-normal);font-family:inherit;padding:var(--size-4-1) var(--size-4-2);font-size:var(--font-ui-small);border-radius:var(--input-radius);outline:0}input.metadata-input-text:active,input.metadata-input-text:focus,input[type=date]:active,input[type=date]:focus,input[type=datetime-local]:active,input[type=datetime-local]:focus,input[type=email]:active,input[type=email]:focus,input[type=number]:active,input[type=number]:focus,input[type=password]:active,input[type=password]:focus,input[type=search]:active,input[type=search]:focus,input[type=text]:active,input[type=text]:focus,textarea:active,textarea:focus{border-color:var(--background-modifier-border-focus);transition:box-shadow .15s ease-in-out 0s,border .15s ease-in-out 0s}input.metadata-input-text:active,input.metadata-input-text:focus,input.metadata-input-text:focus-visible,input[type=date]:active,input[type=date]:focus,input[type=date]:focus-visible,input[type=datetime-local]:active,input[type=datetime-local]:focus,input[type=datetime-local]:focus-visible,input[type=email]:active,input[type=email]:focus,input[type=email]:focus-visible,input[type=number]:active,input[type=number]:focus,input[type=number]:focus-visible,input[type=password]:active,input[type=password]:focus,input[type=password]:focus-visible,input[type=search]:active,input[type=search]:focus,input[type=search]:focus-visible,input[type=text]:active,input[type=text]:focus,input[type=text]:focus-visible,textarea:active,textarea:focus,textarea:focus-visible{box-shadow:0 0 0 2px var(--background-modifier-border-focus)}input.metadata-input-text::placeholder,input[type=date]::placeholder,input[type=datetime-local]::placeholder,input[type=email]::placeholder,input[type=number]::placeholder,input[type=password]::placeholder,input[type=search]::placeholder,input[type=text]::placeholder,textarea::placeholder{color:var(--text-faint)}input[type=email],input[type=number],input[type=password],input[type=search],input[type=text]{height:var(--input-height)}textarea{line-height:var(--line-height-tight)}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{display:none;pointer-events:none}input[type=number]::-webkit-inner-spin-button{appearance:none}input[type=date],input[type=datetime-local]{font-variant-numeric:tabular-nums;position:relative}input[type=date]::-webkit-datetime-edit-text,input[type=datetime-local]::-webkit-datetime-edit-text{color:var(--text-faint)}input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator{position:absolute;left:var(--size-4-1);opacity:.5}input[type=date]::-webkit-datetime-edit-day-field:active,input[type=date]::-webkit-datetime-edit-day-field:focus,input[type=date]::-webkit-datetime-edit-month-field:active,input[type=date]::-webkit-datetime-edit-month-field:focus,input[type=date]::-webkit-datetime-edit-year-field:active,input[type=date]::-webkit-datetime-edit-year-field:focus,input[type=datetime-local]::-webkit-datetime-edit-day-field:active,input[type=datetime-local]::-webkit-datetime-edit-day-field:focus,input[type=datetime-local]::-webkit-datetime-edit-month-field:active,input[type=datetime-local]::-webkit-datetime-edit-month-field:focus,input[type=datetime-local]::-webkit-datetime-edit-year-field:active,input[type=datetime-local]::-webkit-datetime-edit-year-field:focus{background-color:var(--text-selection);color:var(--text-normal);cursor:text}body:not(.is-ios):not(.is-android) input[type=date],body:not(.is-ios):not(.is-android) input[type=datetime-local]{padding-left:var(--size-4-6)}input[type=range]{width:100px;appearance:none;background-color:var(--slider-track-background);border-radius:var(--slider-track-height);height:var(--slider-track-height);padding:0;outline:0}input[type=range]::-webkit-slider-runnable-track{height:6px;appearance:none}input[type=range]::-webkit-slider-thumb{appearance:none;height:var(--slider-thumb-height);width:var(--slider-thumb-width);border-radius:var(--slider-thumb-radius);cursor:default;background:#fff;border:var(--slider-thumb-border-width) solid var(--slider-thumb-border-color);position:relative;top:var(--slider-thumb-y);transition:all .1s linear 0s;box-shadow:rgba(0,0,0,.05) 0 1px 1px 0,rgba(0,0,0,.1) 0 2px 2px 0}input[type=range]::-webkit-slider-thumb:active,input[type=range]::-webkit-slider-thumb:hover{background:#fff;border-color:var(--background-modifier-border-focus);box-shadow:rgba(0,0,0,.1) 0 1px 2px 0,rgba(0,0,0,.2) 0 2px 3px 0;transition:all .1s linear 0s}body:not(.is-mobile) input[type=range]:focus{box-shadow:none}body:not(.is-mobile) input[type=range]:focus::-webkit-slider-thumb{box-shadow:rgba(0,0,0,.05) 0 1px 2px 0,rgba(0,0,0,.2) 0 2px 3px 0}body:not(.is-mobile) input[type=range]:focus-visible::-webkit-slider-thumb{border-color:var(--background-modifier-border-focus);box-shadow:0 1px 2px 0 rgba(0,0,0,.05),0 2px 3px 0 rgba(0,0,0,.2),0 0 0 2px var(--background-modifier-border-focus)}input[type=color]{appearance:none;width:calc(var(--swatch-width) + 4px);background-color:transparent;border:none;cursor:var(--cursor);padding:0}input[type=color]::-webkit-color-swatch-wrapper{padding:2px}input[type=color]::-webkit-color-swatch{border:0;box-shadow:var(--swatch-shadow);border-radius:var(--swatch-radius);height:var(--swatch-height);width:var(--swatch-width);align-self:center}input[type=color]:focus-visible::-webkit-color-swatch,input[type=color]:focus::-webkit-color-swatch{box-shadow:var(--swatch-shadow),0 0 0 3px var(--background-modifier-border-focus)}select.mod-hidden{display:none}.notice-container{z-index:var(--layer-notice);position:fixed;top:22px;right:0;padding:10px;overflow:hidden}.notice{background-color:var(--background-modifier-message);border-radius:var(--radius-m);box-shadow:0 2px 8px var(--background-modifier-box-shadow);color:#fafafa;font-size:var(--font-ui-small);line-height:var(--line-height-tight);padding:.75em 1em;max-width:300px;margin-bottom:14px;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;cursor:var(--cursor)}.debug-textarea{width:100%;height:50vh;max-height:80vh;font-family:var(--font-monospace);tab-size:4;resize:none}.modal-container{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;width:100%;height:100%;z-index:var(--layer-modal)}.modal-container.mod-dim .modal{box-shadow:var(--shadow-l)}.modal-bg{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--background-modifier-cover)}.modal{--checkbox-size:var(--font-ui-medium);background-color:var(--modal-background);border-radius:var(--modal-radius);border:var(--modal-border-width) solid var(--modal-border-color);padding:var(--size-4-4);position:relative;min-height:100px;width:var(--dialog-width);max-width:var(--dialog-max-width);max-height:var(--dialog-max-height);display:flex;flex-direction:column;overflow:auto}.modal.mod-scrollable-content{padding:0;overflow:hidden}.modal.mod-scrollable-content .modal-title{padding:var(--size-4-4) var(--size-4-4) 0 var(--size-4-4)}.modal.mod-scrollable-content .modal-content{padding:0 var(--size-4-4) var(--size-4-4) var(--size-4-4);overflow:auto}body:not(.native-scrollbars) .modal-close-button{right:12px}.modal-close-button{cursor:var(--cursor);position:absolute;top:var(--size-2-3);right:var(--size-2-3);font-size:24px;line-height:20px;height:24px;width:24px;padding:0 var(--size-2-2);border-radius:var(--radius-s);color:var(--text-muted)}.modal-close-button::before{font-family:Inter,sans-serif;content:"×";font-weight:300}.modal-title{font-size:var(--font-ui-large);margin-bottom:.75em;font-weight:var(--font-semibold);text-align:left;line-height:var(--line-height-tight)}.modal-title:empty{display:none}.modal-content{flex:1 1 auto;font-size:var(--font-ui-medium)}.modal-button-container{margin-top:1.5em;display:flex;justify-content:flex-end;gap:var(--size-4-2);flex-wrap:wrap;font-size:var(--font-ui-medium)}.modal-button-container .mod-checkbox{flex-grow:1;display:flex;align-items:center;gap:var(--size-4-1)}.modal-button-container .mod-secondary{margin-right:auto}.modal.mod-scrollable-content>.modal-button-container{margin-top:0;border-top:1px solid var(--background-modifier-border);padding:var(--size-4-4)}.modal-checkbox-label{cursor:var(--cursor);margin-left:10px;user-select:none}.mod-warning{color:var(--text-error)}.mod-success{color:var(--text-success)}.modal .modal-nav-action{background-color:unset;margin-top:var(--size-4-1);position:absolute;top:0;width:unset}.modal .modal-nav-action.mod-secondary{left:0}.modal .modal-nav-action.mod-cta{color:var(--color-accent);font-weight:var(--font-semibold);right:0}.nav-buttons-container{flex-wrap:wrap;gap:var(--size-2-1)}.nav-buttons-container.has-separator{border-bottom:1px solid var(--background-modifier-border);padding-bottom:var(--size-2-3);margin-bottom:var(--size-4-2)}.multi-select-container{display:inline-flex;vertical-align:top;flex-wrap:wrap;min-height:var(--input-height);width:100%;background:var(--background-modifier-form-field);border:var(--input-border-width) solid var(--background-modifier-border);color:var(--text-normal);font-size:var(--font-ui-small);border-radius:var(--input-radius);outline:0;padding:var(--size-4-1);gap:var(--size-4-1)}.multi-select-pill{--icon-size:var(--icon-xs);--icon-stroke:var(--icon-xs-stroke-width);display:flex;align-items:center;background-color:var(--pill-background);border:var(--pill-border-width) solid var(--pill-border-color);border-radius:var(--pill-radius);color:var(--pill-color);cursor:var(--cursor);font-weight:var(--pill-weight);padding:var(--pill-padding-y) 0;line-height:1;max-width:100%;gap:var(--size-2-1)}.multi-select-pill-content{margin-left:var(--pill-padding-x)}.multi-select-pill-remove-button{margin-right:min(var(--size-2-3),var(--pill-padding-x));cursor:var(--cursor);color:var(--pill-color-remove);border-radius:var(--radius-s);display:flex;align-items:center;--icon-size:var(--icon-xs);--icon-stroke:var(--icon-xs-stroke-width)}.multi-select-pill-remove-button:hover{color:var(--pill-color-remove-hover)}.multi-select-input{cursor:text;font-family:var(--font-interface);width:2ch;min-width:2ch;flex-grow:1;color:var(--text-normal);background-color:inherit;border:none}.multi-select-input:empty::before{content:attr(placeholder);color:var(--text-faint);pointer-events:none}.multi-select-duplicate{animation:2s ease-in 0s 1 normal none running multi-select-highlight}.markdown-rendered progress{-webkit-writing-mode:horizontal-tb;writing-mode:horizontal-tb;appearance:none;box-sizing:border-box;display:inline-block;height:6px;margin-bottom:4px;max-width:100%;overflow:hidden;border-radius:0;border:0;vertical-align:-.2rem}.markdown-rendered progress[value]::-webkit-progress-bar{background-color:var(--background-secondary);box-shadow:inset 0 0 0 1px var(--background-modifier-border);border-radius:6px;overflow:hidden}.markdown-rendered progress[value]::-webkit-progress-value{background-color:var(--interactive-accent);overflow:hidden}body:not(.native-scrollbars) ::-webkit-scrollbar{width:12px;height:12px;border-radius:var(--radius-l);background-color:transparent}body:not(.native-scrollbars) ::-webkit-scrollbar-track{background-color:transparent}body:not(.native-scrollbars) ::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-bg);border-radius:var(--radius-l);background-clip:padding-box;border-style:solid;border-color:transparent;border-image:initial;border-width:3px 3px 3px 2px;min-height:45px}body:not(.native-scrollbars) ::-webkit-scrollbar-thumb:active{border-radius:var(--radius-l)}body:not(.native-scrollbars) ::-webkit-scrollbar-thumb:active,body:not(.native-scrollbars) ::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-active-thumb-bg)}body:not(.native-scrollbars) ::-webkit-scrollbar-corner{background:0 0}.checkbox-container{app-region:no-drag;cursor:var(--cursor);background-color:var(--background-modifier-border-hover);border-radius:var(--toggle-radius);display:inline-block;flex-shrink:0;height:calc(var(--toggle-thumb-height) + var(--toggle-border-width) * 2);position:relative;user-select:none;width:var(--toggle-width);box-shadow:rgba(0,0,0,.07) 0 4px 10px inset,rgba(0,0,0,.21) 0 0 1px inset;transition:box-shadow .15s ease-in-out 0s,outline .15s ease-in-out 0s,border .15s ease-in-out 0s,opacity .15s ease-in-out 0s;outline:0 solid var(--background-modifier-border-focus)}.checkbox-container input[type=checkbox]{position:absolute;opacity:0;left:0}.checkbox-container:focus-within{outline:var(--toggle-border-width) solid var(--background-modifier-border-focus)}.checkbox-container.is-enabled{background-color:var(--interactive-accent)}.checkbox-container.is-enabled::after{transform:translate3d(calc(var(--toggle-width) - var(--toggle-thumb-width) - var(--toggle-border-width)),0,0)}.checkbox-container.is-enabled:active::after{left:-4px}.checkbox-container::before{content:"";display:block;position:absolute;inset:0px;opacity:0}.checkbox-container::after{pointer-events:none;content:"";display:block;position:absolute;background-color:var(--toggle-thumb-color);width:var(--toggle-thumb-width);height:var(--toggle-thumb-height);margin:var(--toggle-border-width) 0 0 0;border-radius:var(--toggle-thumb-radius);transition:transform .15s ease-in-out 0s,width .1s ease-in-out 0s,left .1s ease-in-out 0s;left:0;transform:translate3d(var(--toggle-border-width),0,0);box-shadow:rgba(0,0,0,.15) 0 1px 2px}.checkbox-container:active::after{width:calc(var(--toggle-thumb-width) + var(--toggle-border-width))}.checkbox-container.mod-small{width:var(--toggle-s-width);height:calc(var(--toggle-s-thumb-height) + var(--toggle-s-border-width) * 2)}.checkbox-container.mod-small:focus-within{outline:var(--toggle-s-border-width) solid var(--background-modifier-border-focus)}.checkbox-container.mod-small::after{width:var(--toggle-s-thumb-width);height:var(--toggle-s-thumb-height);margin:var(--toggle-s-border-width) 0 0 0;transform:translate3d(var(--toggle-s-border-width),0,0)}.checkbox-container.mod-small.is-enabled::after{transform:translate3d(calc(var(--toggle-s-width) - var(--toggle-s-thumb-width) - var(--toggle-s-border-width)),0,0)}.checkbox-container.mod-small:active::after{width:calc(var(--toggle-s-thumb-width) + var(--toggle-s-border-width))}.tree-item-self{align-items:baseline;display:flex;border-radius:var(--radius-s);color:var(--nav-item-color);font-size:var(--nav-item-size);line-height:var(--line-height-tight);font-weight:var(--nav-item-weight);margin-bottom:var(--size-2-1);padding:var(--nav-item-padding);position:relative}.tree-item-self.mod-collapsible{padding:var(--nav-item-parent-padding)}.tree-item-self.mod-collapsible.is-being-dragged-over{border-radius:var(--radius-s);color:var(--nav-item-color-highlighted);background:hsla(var(--interactive-accent-hsl),.1)}.tree-item-self.mod-collapsible.is-being-dragged-over .collapse-icon{color:var(--nav-item-color-highlighted)}.tree-item-self.is-being-renamed .tree-item-inner{cursor:text}.tree-item-self.is-clickable{cursor:var(--cursor)}.tree-item-self.is-active,body:not(.is-grabbing) .tree-item-self.is-active:hover{color:var(--nav-item-color-active);background-color:var(--nav-item-background-active);font-weight:var(--nav-item-weight-active)}.tree-item-self.is-selected,body:not(.is-grabbing) .tree-item-self.is-selected:hover{color:var(--nav-item-color-selected);background-color:var(--nav-item-background-selected)}.tree-item-self.is-being-dragged,body:not(.is-grabbing) .tree-item-self.is-being-dragged:hover{color:var(--text-on-accent);background-color:var(--interactive-accent)}.tree-item-self.is-being-dragged .tree-item-icon,body:not(.is-grabbing) .tree-item-self.is-being-dragged:hover .tree-item-icon{color:var(--text-on-accent)}body:not(.is-phone) .workspace-leaf.mod-active .tree-item-self.has-focus{border-radius:var(--radius-s);box-shadow:0 0 0 2px var(--background-modifier-border-focus)}body:not(.is-phone) .workspace-leaf.mod-active .tree-item-self.has-focus:focus-within{box-shadow:0 0 0 2px var(--interactive-accent)}.tree-item-self .tree-item-icon{position:absolute;margin-left:calc(-1 * var(--size-4-5));width:var(--size-4-4);display:flex;align-items:center;justify-content:center;opacity:var(--icon-opacity);color:var(--icon-color);flex:0 0 auto}.tree-item-self .tree-item-icon::before{content:"​"}.tree-item-self .tree-item-icon .svg-icon:not(.right-triangle){--icon-size:var(--icon-xs);--icon-stroke:var(--icon-s-stroke-width)}.tree-item-flair-outer{padding-left:var(--size-4-1);margin-left:auto;display:flex;flex-shrink:0;align-items:center}.tree-item-flair{font-size:var(--font-ui-smaller);color:var(--text-faint);line-height:1;border-radius:var(--radius-s)}.tree-item-inner{overflow:hidden}.tree-item-inner-text{overflow:hidden;text-overflow:ellipsis}.tree-item-inner-subtext{color:var(--text-faint);font-size:85%}.tree-item-children{padding-left:var(--nav-item-children-padding-left);margin-left:var(--nav-item-children-margin-left);margin-bottom:1px;border-left:var(--nav-indentation-guide-width) solid var(--nav-indentation-guide-color)}audio{outline:0}.markdown-rendered audio{max-width:100%;outline:0}audio{width:100%;height:42px}audio::-webkit-media-controls-enclosure{border-radius:calc(var(--radius-m) - 1px);border:1px solid var(--background-modifier-border);background-color:var(--background-primary-alt)}audio::-webkit-media-controls-current-time-display,audio::-webkit-media-controls-time-remaining-display{font-family:var(--font-interface)}iframe{border:0}kbd{color:var(--code-normal);font-family:var(--font-monospace);background-color:var(--code-background);border-radius:var(--radius-s);font-size:var(--code-size);padding:.1em .25em}.pdf-outline-view .tree-item-self:not(.mod-collapsible){padding-left:calc(10px + var(--size-4-2) + var(--size-2-3))}.pdf-outline-view .tree-item-self.mod-active{color:var(--nav-item-color-active);background-color:var(--nav-item-background-active);font-weight:var(--nav-item-weight-active)}.pdf-outline-view .tree-item-flair{white-space:nowrap}.pdf-findbar input[type=checkbox]{display:none;pointer-events:none}.scrollWrapped) .page,.spread .page{border:var(--size-4-1) solid transparent}.popupWrapper{--pdf-popup-width:280px;font-size:var(--font-ui-medium);pointer-events:none;position:absolute;transform:translate(-50%,0);z-index:10000}.popupWrapper>div{margin:var(--size-4-3);background-color:var(--background-primary);border-radius:var(--radius-s);filter:drop-shadow(rgba(0, 0, 0, .2) 0px 0px 1px) drop-shadow(rgba(0, 0, 0, .3) 0px 1px 2px) drop-shadow(rgba(0, 0, 0, .3) 0px 4px 6px)}.popupWrapper>div::after{background:var(--background-primary);border-top-left-radius:2px;content:"";height:var(--size-4-3);left:calc(50% - 2px);position:absolute;top:-5px;transform:rotate(45deg);width:var(--size-4-3);z-index:-1}.popup{cursor:initial;display:flex;flex-direction:column;pointer-events:auto;user-select:text;white-space:normal;width:var(--pdf-popup-width);overflow-wrap:break-word}.popupContent{font-size:var(--font-ui-small);line-height:var(--line-height-tight);max-height:200px;overflow:auto;padding:var(--size-4-4)}.popupContent:empty{display:none}.popupMeta{--icon-size:var(--font-ui-small);--icon-stroke:2.5px;align-items:center;background-color:var(--background-secondary);border-top:1px solid var(--background-modifier-border);color:var(--text-muted);display:flex;font-size:var(--font-ui-smaller);gap:var(--size-4-1);justify-content:space-between;padding:var(--size-4-1) var(--size-4-2);border-bottom-left-radius:var(--radius-s);border-bottom-right-radius:var(--radius-s)}.popupContent:empty+.popupMeta{border-top:none;background-color:var(--background-primary);border-top-left-radius:var(--radius-s);border-top-right-radius:var(--radius-s)}.popupMeta .clickable-icon{margin-right:calc(var(--size-4-1) * -1);margin-left:calc(var(--size-2-1) * -1)}.popupDate{white-space:nowrap}.markdown-rendered video{max-width:100%;outline:0}.markdown-rendered blockquote{color:var(--blockquote-color);font-style:var(--blockquote-font-style);background-color:var(--blockquote-background-color);border-left:var(--blockquote-border-thickness) solid var(--blockquote-border-color);padding:0 0 0 var(--size-4-6);margin-inline:0px}.markdown-rendered blockquote>:first-child{margin-top:0}.markdown-rendered blockquote>:last-child{margin-bottom:0}.callout{--callout-color:var(--callout-default);--callout-icon:lucide-pencil}.callout[data-callout=abstract],.callout[data-callout=summary],.callout[data-callout=tldr]{--callout-color:var(--callout-summary);--callout-icon:lucide-clipboard-list}.callout[data-callout=info]{--callout-color:var(--callout-info);--callout-icon:lucide-info}.callout[data-callout=todo]{--callout-color:var(--callout-todo);--callout-icon:lucide-check-circle-2}.callout[data-callout=important]{--callout-color:var(--callout-important);--callout-icon:lucide-flame}.callout[data-callout=hint],.callout[data-callout=tip]{--callout-color:var(--callout-tip);--callout-icon:lucide-flame}.callout[data-callout=check],.callout[data-callout=done],.callout[data-callout=success]{--callout-color:var(--callout-success);--callout-icon:lucide-check}.callout[data-callout=faq],.callout[data-callout=help],.callout[data-callout=question]{--callout-color:var(--callout-question);--callout-icon:help-circle}.callout[data-callout=attention],.callout[data-callout=caution],.callout[data-callout=warning]{--callout-color:var(--callout-warning);--callout-icon:lucide-alert-triangle}.callout[data-callout=fail],.callout[data-callout=failure],.callout[data-callout=missing]{--callout-color:var(--callout-fail);--callout-icon:lucide-x}.callout[data-callout=danger],.callout[data-callout=error]{--callout-color:var(--callout-error);--callout-icon:lucide-zap}.callout[data-callout=bug]{--callout-color:var(--callout-bug);--callout-icon:lucide-bug}.callout[data-callout=example]{--callout-color:var(--callout-example);--callout-icon:lucide-list}.callout[data-callout=cite],.callout[data-callout=quote]{--callout-color:var(--callout-quote);--callout-icon:quote-glyph}.callout{overflow:hidden;border-style:solid;border-color:rgba(var(--callout-color),var(--callout-border-opacity));border-width:var(--callout-border-width);border-radius:var(--callout-radius);margin:1em 0;mix-blend-mode:var(--callout-blend-mode);background-color:rgba(var(--callout-color),.1);padding:var(--callout-padding)}.callout.is-collapsible .callout-title{cursor:var(--cursor)}.callout-title{padding:var(--callout-title-padding);display:flex;gap:var(--size-4-1);font-size:var(--callout-title-size);color:rgb(var(--callout-color));line-height:var(--line-height-tight);align-items:flex-start}.callout-content{overflow-x:auto;padding:var(--callout-content-padding);background-color:var(--callout-content-background)}.callout-icon{flex:0 0 auto;display:flex;align-items:center}.callout-icon .svg-icon{color:rgb(var(--callout-color))}.callout-icon::after{content:"​"}.callout-title-inner{font-weight:var(--bold-weight);color:var(--callout-title-color)}.callout-fold{display:flex;align-items:center;padding-right:var(--size-4-2)}.callout-fold::after{content:"​"}.callout-fold .svg-icon{transition:transform .1s ease-in-out 0s}.callout-fold.is-collapsed .svg-icon{transform:rotate(-90deg)}.markdown-rendered code{color:var(--code-normal);font-family:var(--font-monospace);background-color:var(--code-background);border-radius:var(--code-radius);font-size:var(--code-size);padding:.1em .25em}.cm-s-obsidian span.cm-inline-code span.cm-inline-code.hmd-hidden-token{font-size:0px}.markdown-rendered pre{position:relative;padding:var(--size-4-3) var(--size-4-4);min-height:38px;background-color:var(--code-background);border-radius:var(--code-radius);white-space:var(--code-white-space);overflow-x:auto}.markdown-rendered pre code{border:none;padding:0;background-color:transparent}.markdown-rendered pre:not(:hover)>button.copy-code-button{display:none}.markdown-rendered button.copy-code-button{margin:6px;padding:6px 8px;height:auto;background-color:transparent;box-shadow:none;color:var(--text-muted);font-size:var(--font-ui-smaller);font-family:var(--font-interface);position:absolute;top:0;right:0}code[class*=language-],pre[class*=language-]{color:var(--code-normal);background:0 0;overflow-wrap:break-word;white-space:pre-wrap;word-break:normal;font-family:var(--font-monospace);text-align:left;word-spacing:normal;line-height:var(--line-height-normal);hyphens:none}:not(pre)>code[class*=language-],pre[class*=language-]{background:var(--code-background)}pre[class*=language-]{overflow:hidden}code[class*=language-]{display:block;padding:1em;overflow:auto}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:var(--code-comment)}.token.namespace{opacity:.7}.token.constant,.token.deleted,.token.symbol,.token.tag{color:var(--code-tag)}.token.punctuation{color:var(--code-punctuation)}.token.boolean,.token.number{color:var(--code-value)}.token.attr-name,.token.char,.token.inserted,.token.selector,.token.string{color:var(--code-string)}.token.operator{color:var(--code-operator)}.language-css .token.string,.style .token.string,.token.entity,.token.parameter,.token.property,.token.url,.token.variable{color:var(--code-property)}.token.atrule,.token.attr-value,.token.builtin,.token.class-name,.token.function,.token.property-access{color:var(--code-function)}.token.keyword{color:var(--code-keyword)}.token.important,.token.regex{color:var(--code-important)}.markdown-preview-view .markdown-embed .markdown-preview-view{--file-folding-offset:0px;height:100%;padding:0}.markdown-preview-view .markdown-embed .markdown-preview-view .markdown-preview-pusher h1,.markdown-preview-view .markdown-embed .markdown-preview-view .markdown-preview-pusher h2,.markdown-preview-view .markdown-embed .markdown-preview-view .markdown-preview-pusher h3,.markdown-preview-view .markdown-embed .markdown-preview-view .markdown-preview-pusher h4,.markdown-preview-view .markdown-embed .markdown-preview-view .markdown-preview-pusher h5,.markdown-preview-view .markdown-embed .markdown-preview-view .markdown-preview-pusher h6{margin-top:0}.file-embed,.markdown-embed{position:relative}.file-embed-link,.markdown-embed-link{position:absolute;top:4px;right:4px;color:var(--icon-color);opacity:var(--icon-opacity);cursor:var(--cursor-link);padding:var(--size-2-2);border-radius:var(--radius-s);display:flex;align-items:center;--icon-size:var(--icon-s);--icon-stroke:var(--icon-s-stroke-width)}.file-embed-title{display:flex;align-items:center;justify-content:center;gap:var(--size-4-2)}.file-embed-icon{color:var(--text-muted);display:flex}.file-embed{display:flex;justify-content:center;border-radius:var(--radius-m);background-color:var(--background-primary-alt)}.file-embed.mod-empty,.file-embed.mod-generic{cursor:var(--cursor-link);padding:var(--size-4-2);color:var(--text-muted);text-align:center;font-size:var(--font-smaller)}.markdown-embed-content{height:100%}.embed-title{align-items:center;display:flex;gap:var(--size-4-1);font-size:var(--font-text-size);font-weight:var(--bold-weight);text-align:left;text-overflow:ellipsis;white-space:nowrap;padding:0 0 var(--size-4-2) 0}.markdown-embed{font-style:var(--embed-font-style);background-color:var(--embed-background);border-top:var(--embed-border-top);border-right:var(--embed-border-right);border-bottom:var(--embed-border-bottom);border-left:var(--embed-border-left);margin:0;padding:var(--embed-padding)}.markdown-embed .markdown-preview-view{padding:0}.internal-embed:not(.image-embed){display:block}.internal-embed audio,.internal-embed img:not([width]),.internal-embed video{max-width:100%}.inline-embed .markdown-embed-content{height:fit-content;max-height:var(--embed-max-height);overflow:auto}.inline-embed .markdown-embed-content p:first-child{margin-top:0}.inline-embed .markdown-source-view.mod-cm6 .cm-editor{min-height:unset}.embed-iframe{width:100%;height:100%}iframe.external-embed{width:600px;max-width:100%;height:350px}.footnote-link{text-decoration:none}.footnotes{font-size:var(--footnote-size)}.footnote-ref{vertical-align:super}.footnote-backref{color:var(--text-faint);text-decoration:none}.markdown-rendered .frontmatter.mod-failed{position:relative}.markdown-rendered .frontmatter.mod-failed .mod-error{color:var(--text-error);font-size:var(--font-smaller)}.markdown-rendered .frontmatter.mod-failed::after{content:"";position:absolute;top:0;right:0;width:100%;height:100%;background-color:var(--background-modifier-error);opacity:.3;mix-blend-mode:var(--highlight-mix-blend-mode)}.metadata-container{--input-height:var(--metadata-input-height);border-radius:var(--metadata-border-radius);background-color:var(--metadata-background);border-color:var(--metadata-border-color);border-style:solid;border-width:var(--metadata-border-width);padding:var(--metadata-padding);color:var(--text-muted);position:relative;max-width:var(--metadata-max-width);margin-block-end:var(--p-spacing);transform:translateX(calc(var(--size-4-1) * -1))}.metadata-container .metadata-add-button{padding-left:var(--size-2-3);margin-top:.5em;font-size:var(--metadata-label-font-size)}.markdown-embed-content .metadata-container{display:none}.metadata-container.is-collapsed .metadata-property{display:none}.metadata-container:focus-within .metadata-property.is-selected{color:var(--nav-item-color-selected);background-color:var(--nav-item-background-selected)}.metadata-properties{display:flex;flex-direction:column;gap:var(--metadata-gap)}.metadata-properties-heading{display:inline-block;padding:var(--size-4-1);margin-bottom:var(--size-4-2);position:relative;line-height:1.2}.metadata-properties-heading::before{content:"";border-radius:var(--metadata-property-radius);position:absolute;display:inline-block;inset:0px}.metadata-properties-heading:focus::before{box-shadow:0 0 0 2px var(--background-modifier-border-focus)}.metadata-properties-heading .collapse-indicator{position:absolute;left:-22px;padding:0 6px}.metadata-properties-title{user-select:none;font-size:max(var(--font-ui-small), 1em);color:var(--text-normal);font-weight:var(--font-medium)}.metadata-input-text{background-color:transparent;width:100%;min-height:var(--input-height);border-width:0;resize:none;overflow-y:hidden}.metadata-input-text::-webkit-date-and-time-value{text-align:left}.metadata-input-text.mod-date{padding-right:0;width:auto}.metadata-property{position:relative;display:flex;align-items:start;padding:var(--metadata-property-padding);border-radius:var(--metadata-property-radius);overflow:hidden;background-color:var(--metadata-property-background)}.metadata-property:focus-within{background-color:var(--metadata-property-background-hover);--metadata-divider-color:var(--metadata-divider-color-focus);box-shadow:0 0 0 2px var(--background-modifier-border-focus)}.metadata-property-icon{cursor:var(--cursor);color:var(--icon-color);display:flex;align-items:center;padding:var(--size-4-1) 0;height:var(--input-height);user-select:none}.metadata-property-icon::before{content:"​";width:var(--size-4-1)}.metadata-input-number{background-color:transparent;width:100%;border-width:0}input[type=checkbox].metadata-input-checkbox{margin-left:var(--size-4-2)}.metadata-property-key{display:flex;align-self:stretch;align-items:flex-start;flex-direction:row;flex-shrink:0;border-bottom:var(--metadata-divider-width) solid var(--metadata-divider-color);background-color:var(--metadata-label-background);width:var(--metadata-label-width);min-width:var(--metadata-label-width)}.metadata-property-key:focus-within{background-color:var(--metadata-label-background-active)}input.metadata-property-key-input{border:none;flex-grow:1;color:var(--metadata-label-text-color);font-size:var(--metadata-label-font-size);font-weight:var(--metadata-label-font-weight);height:var(--input-height);background-color:transparent;display:flex;align-items:center;text-overflow:ellipsis;overflow:hidden}input.metadata-property-key-input:active,input.metadata-property-key-input:focus{background-color:transparent}.metadata-property button{margin-top:var(--size-4-2)}.metadata-property .multi-select-container,.metadata-property input[type=date],.metadata-property input[type=datetime-local],.metadata-property input[type=number],.metadata-property input[type=text]{border-radius:0;border:none}.metadata-property .multi-select-container:active,.metadata-property .multi-select-container:focus,.metadata-property .multi-select-container:hover,.metadata-property input[type=date]:active,.metadata-property input[type=date]:focus,.metadata-property input[type=date]:hover,.metadata-property input[type=datetime-local]:active,.metadata-property input[type=datetime-local]:focus,.metadata-property input[type=datetime-local]:hover,.metadata-property input[type=number]:active,.metadata-property input[type=number]:focus,.metadata-property input[type=number]:hover,.metadata-property input[type=text]:active,.metadata-property input[type=text]:focus,.metadata-property input[type=text]:hover{box-shadow:none;border:none}.metadata-property .metadata-input-number,.metadata-property .metadata-input-text,.metadata-property .multi-select-container{background-color:transparent}.metadata-property .metadata-input-number:hover,.metadata-property .metadata-input-text:hover,.metadata-property .multi-select-container:hover{background-color:transparent}.metadata-property .metadata-input-number:active,.metadata-property .metadata-input-number:focus,.metadata-property .metadata-input-number:focus-within,.metadata-property .metadata-input-text:active,.metadata-property .metadata-input-text:focus,.metadata-property .metadata-input-text:focus-within,.metadata-property .multi-select-container:active,.metadata-property .multi-select-container:focus,.metadata-property .multi-select-container:focus-within{background-color:transparent}.metadata-property .metadata-input-text{text-overflow:ellipsis;overflow:hidden}.metadata-property .multi-select-container input{background-color:transparent}.metadata-property .multi-select-container{padding:var(--size-4-1) var(--size-4-2)}.metadata-property[data-property-key=tags]{--pill-color:var(--tag-color);--pill-color-hover:var(--tag-color-hover);--pill-color-remove:var(--tag-color);--pill-color-remove-hover:var(--tag-color-hover);--pill-decoration:var(--tag-decoration);--pill-decoration-hover:var(--tag-decoration-hover);--pill-background:var(--tag-background);--pill-background-hover:var(--tag-background-hover);--pill-border-color:var(--tag-border-color);--pill-border-color-hover:var(--tag-border-color-hover);--pill-border-width:var(--tag-border-width);--pill-padding-x:var(--tag-padding-x);--pill-padding-y:var(--tag-padding-y);--pill-radius:var(--tag-radius);--pill-weight:var(--tag-weight)}.metadata-property[data-property-key=tags] .multi-select-pill{cursor:var(--cursor-link)}.metadata-property:not([data-property-key=tags]){--pill-border-width:0;--pill-padding-x:0;--pill-padding-y:0;--pill-color:var(--metadata-input-text-color)}.metadata-property:not([data-property-key=tags]) .multi-select-pill{line-height:var(--line-height-tight)}.metadata-property-warning-icon{--icon-size:var(--icon-s);position:absolute;right:var(--size-2-1);top:var(--size-2-1);bottom:var(--size-2-1);align-items:center;display:flex;color:var(--text-warning)}.metadata-property-value{display:flex;flex:1 1 auto;gap:var(--size-2-2);align-items:center;align-self:stretch;min-height:var(--input-height);background-color:var(--metadata-input-background);border-bottom:var(--metadata-divider-width) solid var(--metadata-divider-color);overflow:hidden}.metadata-property-value.mod-external-link:not(:placeholder-shown){text-decoration-line:var(--link-decoration);text-decoration-thickness:var(--link-decoration-thickness);text-decoration-color:var(--text-faint)}.metadata-property-value .mod-unknown{color:var(--text-warning);padding:var(--size-4-1) var(--size-4-2);font-size:var(--metadata-input-font-size);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.metadata-property-value .multi-select-input{font-size:inherit}.metadata-property-value .multi-select-input:focus{min-width:10ch}.metadata-property-value .metadata-link-inner,.metadata-property-value .multi-select-container,.metadata-property-value input{font-size:var(--metadata-input-font-size)}.metadata-property-value .multi-select-container{--background-modifier-form-field:transparent;--background-modifier-border:transparent}.metadata-property-value .multi-select-container .multi-select-pill.is-invalid{--pill-background:transparent;--pill-color:var(--text-error);--pill-color-remove:var(--text-error)}.metadata-property-value .external-link.multi-select-pill-content,.metadata-property-value .internal-link .multi-select-pill-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.metadata-property-value .clickable-icon{--icon-size:var(--icon-xs);--icon-stroke:var(--icon-xs-stroke-width);margin-right:2px;margin-left:-4px;padding:4px}.metadata-property-value .clickable-icon:hover{background:0 0;color:var(--text-normal);cursor:var(--cursor-link)}.metadata-property-value:focus-within{background-color:var(--metadata-input-background-active)}.metadata-input-longtext{cursor:text;white-space:pre-wrap;-webkit-box-orient:vertical;-webkit-line-clamp:3;color:var(--metadata-input-text-color);font-size:var(--metadata-input-font-size);max-height:300px;overflow-y:auto;padding:var(--size-4-1) var(--size-4-2);width:100%}.metadata-input-longtext:focus{-webkit-line-clamp:unset}.metadata-input-longtext:not(:empty){display:-webkit-box}.metadata-input-longtext:empty::before{content:attr(placeholder);color:var(--text-faint)}.metadata-link{cursor:text;align-items:center;padding:var(--size-4-1) var(--size-4-2);display:flex;gap:var(--size-4-2);width:100%}.metadata-link-inner{cursor:var(--cursor-link);color:var(--link-color);text-decoration-line:var(--link-decoration);text-decoration-thickness:var(--link-decoration-thickness);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.metadata-link-flair{--icon-size:var(--icon-xs);background-color:transparent;cursor:text;margin-left:auto;display:flex;align-items:center;justify-content:center;padding:var(--size-2-1);border-radius:var(--clickable-icon-radius);color:var(--icon-color);opacity:0;transition:opacity .15s ease-in-out 0s;height:auto}.markdown-preview-view .metadata-container{display:none}.markdown-preview-view.show-properties .metadata-container{display:var(--metadata-display-reading)}.markdown-preview-view.show-properties .metadata-container[data-property-count="0"]{display:none}.markdown-rendered li h1,.markdown-rendered li h2,.markdown-rendered li h3,.markdown-rendered li h4,.markdown-rendered li h5{margin-top:0;margin-bottom:0}.markdown-rendered div:has(> :is(p,pre,table,ul,ol))+div>:is(h1,h2,h3,h4,h5,h6){margin-top:var(--heading-spacing)}.markdown-rendered h1,h1{font-variant:var(--h1-variant);letter-spacing:-.015em;line-height:var(--h1-line-height);font-size:var(--h1-size);color:var(--h1-color);font-weight:var(--h1-weight);font-style:var(--h1-style);font-family:var(--h1-font);margin-block-start:var(--p-spacing);margin-block-end:var(--p-spacing)}.markdown-rendered h1 a,h1 a{font-weight:inherit}.markdown-rendered h2,h2{font-variant:var(--h2-variant);letter-spacing:-.015em;line-height:var(--h2-line-height);font-size:var(--h2-size);color:var(--h2-color);font-weight:var(--h2-weight);font-style:var(--h2-style);font-family:var(--h2-font);margin-block-start:var(--p-spacing);margin-block-end:var(--p-spacing)}.markdown-rendered h2 a,h2 a{font-weight:inherit}.markdown-rendered h3,h3{font-variant:var(--h3-variant);letter-spacing:-.015em;line-height:var(--h3-line-height);font-size:var(--h3-size);color:var(--h3-color);font-weight:var(--h3-weight);font-style:var(--h3-style);font-family:var(--h3-font);margin-block-start:var(--p-spacing);margin-block-end:var(--p-spacing)}.markdown-rendered h3 a,h3 a{font-weight:inherit}.markdown-rendered h4,h4{font-variant:var(--h4-variant);letter-spacing:.015em;line-height:var(--h4-line-height);font-size:var(--h4-size);color:var(--h4-color);font-weight:var(--h4-weight);font-style:var(--h4-style);font-family:var(--h4-font);margin-block-start:var(--p-spacing);margin-block-end:var(--p-spacing)}.markdown-rendered h4 a,h4 a{font-weight:inherit}.markdown-rendered h5,h5{font-variant:var(--h5-variant);letter-spacing:.015em;font-size:var(--h5-size);line-height:var(--h5-line-height);color:var(--h5-color);font-weight:var(--h5-weight);font-style:var(--h5-style);font-family:var(--h5-font);margin-block-start:var(--p-spacing);margin-block-end:var(--p-spacing)}.markdown-rendered h5 a,h5 a{font-weight:inherit}.markdown-rendered h6,h6{font-variant:var(--h6-variant);letter-spacing:.015em;font-size:var(--h6-size);line-height:var(--h6-line-height);color:var(--h6-color);font-weight:var(--h6-weight);font-style:var(--h6-style);font-family:var(--h6-font);margin-block-start:var(--p-spacing);margin-block-end:var(--p-spacing)}.markdown-rendered h6 a,h6 a{font-weight:inherit}.inline-title[data-level="1"]{font-variant:var(--h1-variant);letter-spacing:-.015em;line-height:var(--h1-line-height);font-size:var(--h1-size);color:var(--h1-color);font-weight:var(--h1-weight);font-style:var(--h1-style);font-family:var(--h1-font)}.inline-title[data-level="1"] a{font-weight:inherit}.inline-title[data-level="2"]{font-variant:var(--h2-variant);letter-spacing:-.015em;line-height:var(--h2-line-height);font-size:var(--h2-size);color:var(--h2-color);font-weight:var(--h2-weight);font-style:var(--h2-style);font-family:var(--h2-font)}.inline-title[data-level="2"] a{font-weight:inherit}.inline-title[data-level="3"]{font-variant:var(--h3-variant);letter-spacing:-.015em;line-height:var(--h3-line-height);font-size:var(--h3-size);color:var(--h3-color);font-weight:var(--h3-weight);font-style:var(--h3-style);font-family:var(--h3-font)}.inline-title[data-level="3"] a{font-weight:inherit}.inline-title[data-level="4"]{font-variant:var(--h4-variant);letter-spacing:.015em;line-height:var(--h4-line-height);font-size:var(--h4-size);color:var(--h4-color);font-weight:var(--h4-weight);font-style:var(--h4-style);font-family:var(--h4-font)}.inline-title[data-level="4"] a{font-weight:inherit}.inline-title[data-level="5"]{font-variant:var(--h5-variant);letter-spacing:.015em;font-size:var(--h5-size);line-height:var(--h5-line-height);color:var(--h5-color);font-weight:var(--h5-weight);font-style:var(--h5-style);font-family:var(--h5-font)}.inline-title[data-level="5"] a{font-weight:inherit}.inline-title[data-level="6"]{font-variant:var(--h6-variant);letter-spacing:.015em;font-size:var(--h6-size);line-height:var(--h6-line-height);color:var(--h6-color);font-weight:var(--h6-weight);font-style:var(--h6-style);font-family:var(--h6-font)}.inline-title[data-level="6"] a{font-weight:inherit}hr{border-right-width:initial;border-bottom-width:initial;border-left-width:initial;border-right-style:none;border-bottom-style:none;border-left-style:none;border-image:initial;border-color:var(--hr-color);margin:2rem 0}.markdown-rendered hr{border-right-width:initial;border-bottom-width:initial;border-left-width:initial;border-right-style:none;border-bottom-style:none;border-left-style:none;border-image:initial;border-color:var(--hr-color)}.cm-s-obsidian .hmd-fold-html-stub.omittable,.cm-s-obsidian .omittable.hmd-fold-code-stub{display:none}.cm-s-obsidian .hmd-fold-html:hover .hmd-fold-html-stub.omittable,.cm-s-obsidian .hmd-fold-html:hover .omittable.hmd-fold-code-stub{display:block;right:0;bottom:100%;margin:0;position:absolute;z-index:100}.markdown-preview-view img,.markdown-rendered img{image-rendering:-webkit-optimize-contrast}.markdown-preview-view img:not([width]),.markdown-rendered img:not([width]){max-width:100%;outline:0}.internal-query{margin:0;border-top:1px solid var(--background-modifier-border)}.internal-query .search-result-container{padding:var(--size-4-2);max-height:800px;overflow:auto;border:1px solid var(--background-modifier-border);background-color:var(--background-secondary);border-radius:var(--radius-m)}ol ol ul,ol ul,ol ul ul,ul ol ul,ul ul,ul ul ul{list-style-type:disc}ol{list-style-type:var(--list-numbered-style)}ol>li::marker,ul>li::marker{color:var(--list-marker-color)}ol>li.is-collapsed::marker,ul>li.is-collapsed::marker{color:var(--list-marker-color-collapsed)}.markdown-rendered ol,.markdown-rendered ul{padding-inline-start:var(--list-indent);margin-block-start:var(--p-spacing);margin-block-end:var(--p-spacing)}.markdown-rendered ol ol,.markdown-rendered ol ul,.markdown-rendered ul ol,.markdown-rendered ul ul{margin-block:0px}.markdown-rendered ol li p:first-of-type,.markdown-rendered ul li p:first-of-type{margin-block-start:0px}.markdown-rendered ol li p:last-of-type,.markdown-rendered ul li p:last-of-type{margin-block-end:0px}.markdown-rendered ol>li,.markdown-rendered ul>li{padding-top:var(--list-spacing);padding-bottom:var(--list-spacing)}.markdown-preview-view ol>li,.markdown-preview-view ul>li{padding-top:var(--list-spacing);padding-bottom:var(--list-spacing)}.markdown-rendered .list-collapse-indicator{margin-inline-start:-3em;padding-inline-end:2em}.markdown-rendered .list-bullet{float:left;margin-inline-start:-1em}.markdown-rendered .task-list-item>.list-bullet{display:none}.markdown-rendered ul.has-list-bullet{list-style-type:"​"}.markdown-rendered ul.has-list-bullet>li::marker{color:transparent}.list-bullet{color:transparent;position:relative;display:inline-flex;justify-content:center;align-items:center;will-change:transform}.list-bullet::before{content:"​"}.list-bullet::after{position:absolute;content:"​";pointer-events:none;color:var(--list-marker-color);border-radius:var(--list-bullet-radius);width:var(--list-bullet-size);height:var(--list-bullet-size);border:var(--list-bullet-border);transform:var(--list-bullet-transform);background-color:var(--list-marker-color);transition:transform .15s ease 0s,box-shadow .15s ease 0s;will-change:transform}.list-bullet::selection{background-color:transparent!important}li.is-collapsed .list-bullet::after{background-color:var(--list-marker-color-collapsed);box-shadow:0 0 0 4px var(--background-modifier-active-hover)}a{color:var(--link-color);outline:0;text-decoration-line:var(--link-decoration);text-decoration-thickness:var(--link-decoration-thickness);cursor:var(--cursor-link)}.external-link{color:var(--link-external-color);text-decoration-line:var(--link-external-decoration);background-position:right 4px;background-repeat:no-repeat;background-image:linear-gradient(transparent,transparent),url("../../lib/media/874d8b8e340f75575caa.svg");background-size:13px;padding-right:16px;cursor:var(--cursor-link);filter:var(--link-external-filter)}.markdown-rendered .internal-link,.metadata-container .internal-link{cursor:var(--cursor-link);text-decoration-line:var(--link-decoration);color:var(--link-color)}.markdown-rendered .internal-link.is-unresolved,.metadata-container .internal-link.is-unresolved{color:var(--link-unresolved-color);opacity:var(--link-unresolved-opacity);filter:var(--link-unresolved-filter);text-decoration-style:var(--link-unresolved-decoration-style);text-decoration-color:var(--link-unresolved-decoration-color)}.inline-block{display:inline-block;vertical-align:middle}.hidden-token{display:inline;letter-spacing:-1ch;font-family:monospace;color:transparent;font-size:1px!important}.cm-s-obsidian span.hmd-hidden-token.cm-formatting-code,.cm-s-obsidian span.hmd-hidden-token.cm-formatting-em,.cm-s-obsidian span.hmd-hidden-token.cm-formatting-link,.cm-s-obsidian span.hmd-hidden-token.cm-formatting-strikethrough,.cm-s-obsidian span.hmd-hidden-token.cm-formatting-strong{display:inline;letter-spacing:-1ch;font-family:monospace;color:transparent;font-size:1px!important}.mod-cm5 .cm-s-obsidian .HyperMD-table-row>:last-child{padding-right:52px!important}.cm-s-obsidian .cm-s-obsidian span.hmd-hidden-token.cm-formatting-task{color:transparent!important}mjx-container{outline:0}.markdown-rendered table{border-collapse:collapse;line-height:var(--table-line-height)}.markdown-rendered td,.markdown-rendered th{padding:var(--size-2-2) var(--size-4-2);border:var(--table-border-width) solid var(--table-border-color);max-width:var(--table-column-max-width)}.markdown-rendered td{font-size:var(--table-text-size);color:var(--table-text-color)}.markdown-rendered th{font-size:var(--table-header-size);font-weight:var(--table-header-weight);color:var(--table-header-color);font-family:var(--table-header-font);text-align:left;line-height:var(--line-height-tight)}.markdown-rendered th[align=center]{text-align:center}.markdown-rendered th[align=right]{text-align:right}.markdown-rendered tbody>tr>td,.markdown-rendered thead>tr>th{white-space:var(--table-white-space);text-overflow:ellipsis;overflow:hidden}.markdown-rendered tbody tr{background-color:var(--table-background)}.markdown-rendered tbody tr:nth-child(odd){background-color:var(--table-row-alt-background)}.markdown-rendered tbody tr>td:nth-child(2n+2){background-color:var(--table-column-alt-background)}.markdown-rendered tbody tr:last-child>td{border-bottom-width:var(--table-row-last-border-width)}.markdown-rendered tbody tr>td:first-child{border-left-width:var(--table-column-first-border-width)}.markdown-rendered tbody tr>td:last-child{border-right-width:var(--table-column-last-border-width)}.markdown-rendered thead tr{background-color:var(--table-header-background)}.markdown-rendered thead tr>th{border-top-width:var(--table-header-border-width);border-color:var(--table-header-border-color)}.markdown-rendered thead tr>th:nth-child(2n+2){background-color:var(--table-column-alt-background)}.markdown-rendered thead tr>th:first-child{border-left-width:var(--table-column-first-border-width)}.markdown-rendered thead tr>th:last-child{border-right-width:var(--table-column-last-border-width)}.cm-s-obsidian .HyperMD-table-row{white-space:pre;word-break:normal;overflow-wrap:normal;font-size:.95em;font-family:var(--font-monospace)}.cm-s-obsidian .hmd-table-column,.cm-s-obsidian .hmd-table-column-content{display:inline-block}.cm-s-obsidian .hmd-table-column-left{text-align:left}.cm-s-obsidian .hmd-table-column-center{text-align:center}.cm-s-obsidian .hmd-table-column-right{text-align:right}.cm-s-obsidian .HyperMD-table-row span.cm-hmd-table-sep,.cm-s-obsidian .HyperMD-table-row-1{color:var(--text-faint)}.cm-s-obsidian .HyperMD-table-row-0{color:var(--table-header-color)}.cm-s-obsidian .CodeMirror-linewidget table,.cm-s-obsidian .hmd-fold-html table{border-collapse:collapse}.cm-s-obsidian .CodeMirror-linewidget table td,.cm-s-obsidian .cm-s-obsidian .CodeMirror-linewidget table th,.cm-s-obsidian .hmd-fold-html table td,.cm-s-obsidian .hmd-fold-html table th{padding:10px;border:1px solid #ccc}.cm-s-obsidian .hmd-inactive-line.HyperMD-table-row-1{color:transparent;text-shadow:none}.cm-s-obsidian .hmd-inactive-line.HyperMD-table-row-1>span{background:url("data:image/png; base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAQAAAAziH6sAAAADklEQVR42mOc+Z9x5n8ACTkDM4ikM1IAAAAASUVORK5CYII=") 0 center repeat-x}.cm-s-obsidian .hmd-inactive-line.HyperMD-table-row span.cm-hmd-table-sep{color:transparent}.markdown-source-view.mod-cm6 .cm-line.HyperMD-table-row{min-width:max-content}.markdown-source-view.mod-cm6 .cm-table-widget table{margin-bottom:0}a.tag{background-color:var(--tag-background);border:var(--tag-border-width) solid var(--tag-border-color);border-radius:var(--tag-radius);color:var(--tag-color);font-size:var(--tag-size);font-weight:var(--tag-weight);text-decoration:var(--tag-decoration);padding:var(--tag-padding-y) var(--tag-padding-x);line-height:1}a.tag{background-color:var(--tag-background);border:var(--tag-border-width) solid var(--tag-border-color);border-radius:var(--tag-radius);color:var(--tag-color);font-size:var(--tag-size);font-weight:var(--tag-weight);text-decoration:var(--tag-decoration);padding:var(--tag-padding-y) var(--tag-padding-x);line-height:1}input[type=checkbox]{appearance:none;border-radius:var(--checkbox-radius);border:1px solid var(--checkbox-border-color);flex-shrink:0;padding:0;margin:0;margin-inline-end:6px;width:var(--checkbox-size);height:var(--checkbox-size);position:relative;transition:box-shadow .15s ease-in-out 0s}input[type=checkbox]:active,input[type=checkbox]:focus,input[type=checkbox]:hover{outline:0;border-color:var(--checkbox-border-color-hover)}input[type=checkbox]:focus-visible{box-shadow:0 0 0 2px var(--background-modifier-border-focus)}input[type=checkbox]:checked::after{content:"";top:-1px;left:-1px;position:absolute;width:var(--checkbox-size);height:var(--checkbox-size);display:block;background-color:var(--checkbox-marker-color);-webkit-mask-position:52% 52%;-webkit-mask-size:65%;-webkit-mask-repeat:no-repeat;-webkit-mask-image:url("data:image/svg+xml;  utf8, <svg width=\"12px\" height=\"10px\" viewBox=\"0 0 12 8\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"><g transform=\"translate(-4.000000, -6.000000)\" fill=\"%23000000\"><path d=\"M8.1043257,14.0367999 L4.52468714,10.5420499 C4.32525014,10.3497722 4.32525014,10.0368095 4.52468714,9.8424863 L5.24777413,9.1439454 C5.44721114,8.95166768 5.77142411,8.95166768 5.97086112,9.1439454 L8.46638057,11.5903727 L14.0291389,6.1442083 C14.2285759,5.95193057 14.5527889,5.95193057 14.7522259,6.1442083 L15.4753129,6.84377194 C15.6747499,7.03604967 15.6747499,7.35003511 15.4753129,7.54129009 L8.82741268,14.0367999 C8.62797568,14.2290777 8.3037627,14.2290777 8.1043257,14.0367999\"></path></g></g></svg>")}input[type=checkbox]:checked{background-color:var(--checkbox-color);border-color:var(--checkbox-color)}input[type=checkbox][data-indeterminate=true]:not(:checked)::after{content:"";position:absolute;top:calc(var(--checkbox-size)/ 2 - 2px);width:calc(var(--checkbox-size) - 6px);left:0;right:0;margin:0 auto;height:2px;display:block;border-radius:2px;background-color:var(--text-normal)}.task-list-item-checkbox{width:var(--checkbox-size);height:var(--checkbox-size)}.markdown-preview-view .task-list-item-checkbox{position:relative;top:.2em;margin-inline-end:.6em}ul>li.task-list-item{list-style:none}ul>li.task-list-item .task-list-item-checkbox{margin-inline-start:calc(var(--checkbox-size) * -1.5)}ul>li.task-list-item[data-task="X"],ul>li.task-list-item[data-task="x"]{text-decoration:var(--checklist-done-decoration);color:var(--checklist-done-color)}.cm-s-obsidian span.hmd-hidden-token.cm-formatting-task{color:transparent!important}b,strong{font-weight:var(--bold-weight);color:var(--bold-color)}em,i{font-style:italic;color:var(--italic-color)}.markdown-rendered p{margin-block-start:var(--p-spacing);margin-block-end:var(--p-spacing)}.markdown-rendered mark{background-color:var(--text-highlight-bg);color:var(--text-normal)}.markdown-rendered mark .internal-link{color:var(--text-normal)}.embedded-backlinks .backlink-pane .tree-item-self{font-size:max(var(--font-ui-small),var(--font-smaller));align-items:center}.embedded-backlinks .backlink-pane>.tree-item-self{font-size:max(var(--font-ui-small),1em);gap:var(--size-2-3);width:fit-content}.embedded-backlinks .backlink-pane .tree-item-flair{font-size:max(var(--font-ui-small),var(--font-smallest))}.view-action.mod-bookmark{--icon-color:var(--icon-color-active);--icon-color-hover:var(--icon-color-active)}.nav-buttons-container.has-separator{border-bottom:1px solid var(--background-modifier-border);padding-bottom:var(--size-2-3);margin-bottom:var(--size-4-2)}.nav-files-container{flex-grow:1;overflow:hidden auto;padding:0 var(--size-4-3) var(--size-4-6) var(--size-4-3);scroll-padding-block:var(--size-4-2)}.nav-folder.mod-root>.nav-folder-title{font-size:var(--vault-name-font-size);color:var(--vault-name-color);font-weight:var(--vault-name-font-weight);cursor:default}.nav-folder.mod-root>.nav-folder-title.is-being-dragged-over{background-color:hsla(var(--interactive-accent-hsl),.2)}.nav-folder.mod-root>.nav-folder-children{border-left:none;margin-left:0;padding-left:0}.nav-file-tag{background-color:var(--background-modifier-hover);border-radius:var(--radius-s);font-size:9px;font-weight:var(--font-semibold);letter-spacing:.05em;line-height:var(--line-height-normal);margin-left:var(--size-2-3);padding:0 var(--size-4-1);text-transform:uppercase;align-self:center}.nav-file-icon{display:inline-flex;align-items:center;margin-right:var(--size-2-3);position:relative;color:var(--icon-color);opacity:var(--icon-opacity)}.nav-files-container:not(.show-unsupported) .is-unsupported{display:none}.nav-file-title-content,.nav-folder-title-content{display:inline-block;overflow-wrap:anywhere;overflow:hidden;white-space:var(--nav-item-white-space);text-overflow:ellipsis}.nav-files-container{flex-grow:1;overflow:hidden auto;padding:0 var(--size-4-3) var(--size-4-6) var(--size-4-3);scroll-padding-block:var(--size-4-2)}.nav-folder.mod-root>.nav-folder-title{font-size:var(--vault-name-font-size);color:var(--vault-name-color);font-weight:var(--vault-name-font-weight);cursor:default}.nav-folder.mod-root>.nav-folder-title.is-being-dragged-over{background-color:hsla(var(--interactive-accent-hsl),.2)}.nav-folder.mod-root .nav-folder>.nav-folder-children{padding-left:var(--nav-item-children-padding-left);margin:0 0 0 var(--nav-item-children-margin-left);border-left:var(--nav-indentation-guide-width) solid var(--nav-indentation-guide-color)}.nav-file{border-radius:var(--radius-s)}.nav-folder-title{padding:var(--nav-item-parent-padding)}.nav-file-title{padding:var(--nav-item-padding)}.nav-file-title,.nav-folder-title{margin-bottom:var(--size-2-1);display:flex;border-radius:var(--radius-s);cursor:var(--cursor);color:var(--nav-item-color);font-size:var(--nav-item-size);font-weight:var(--nav-item-weight);line-height:var(--line-height-tight)}.nav-file-title.is-active,.nav-folder-title.is-active,body:not(.is-grabbing) .nav-file-title.is-active:hover,body:not(.is-grabbing) .nav-folder-title.is-active:hover{color:var(--nav-item-color-active);background-color:var(--nav-item-background-active);font-weight:var(--nav-item-weight-active)}.nav-file-title.is-selected,.nav-folder-title.is-selected,body:not(.is-grabbing) .nav-file-title.is-selected:hover,body:not(.is-grabbing) .nav-folder-title.is-selected:hover{color:var(--nav-item-color-selected);background-color:var(--nav-item-background-selected)}.nav-file-title.is-being-dragged,.nav-folder-title.is-being-dragged,body:not(.is-grabbing) .nav-file-title.is-being-dragged,body:not(.is-grabbing) .nav-folder-title.is-being-dragged{background-color:var(--interactive-accent);color:var(--text-on-accent)}.nav-file-title.is-being-dragged .nav-folder-collapse-indicator,.nav-folder-title.is-being-dragged .nav-folder-collapse-indicator,body:not(.is-grabbing) .nav-file-title.is-being-dragged .nav-folder-collapse-indicator,body:not(.is-grabbing) .nav-folder-title.is-being-dragged .nav-folder-collapse-indicator{color:var(--text-on-accent)}.nav-file-title.is-being-dragged .nav-file-tag,.nav-folder-title.is-being-dragged .nav-file-tag,body:not(.is-grabbing) .nav-file-title.is-being-dragged .nav-file-tag,body:not(.is-grabbing) .nav-folder-title.is-being-dragged .nav-file-tag{color:var(--text-normal)}.nav-folder-title.is-being-dragged-over{border-radius:var(--radius-s);color:var(--nav-item-color-highlighted);background:hsla(var(--interactive-accent-hsl),.1)}.nav-folder-title.is-being-dragged-over .collapse-icon{color:var(--nav-item-color-highlighted)}.file-tree-item-checkbox,.file-tree-item-icon{flex-shrink:0}.file-tree-item-title{flex-grow:1;word-break:break-word}.file-tree-item-icon{--icon-size:var(--icon-s);--icon-stroke:var(--icon-s-stroke-width);margin-right:var(--size-4-1);color:var(--icon-color);position:relative;top:var(--size-2-1)}.file-tree .tree-item-inner{display:flex;align-items:center;position:relative;width:100%}.file-tree .tree-item-flair{line-height:1;padding:var(--size-2-1) var(--size-2-3);color:var(--text-on-accent)}.file-tree .is-selected{color:var(--text-normal)}.file-tree .mod-changed.is-selected{background-color:hsla(var(--interactive-accent-hsl),.2)}.file-tree .mod-changed .tree-item-flair{color:var(--text-accent-hover)}.file-tree .mod-new.is-selected{background-color:rgba(var(--background-modifier-success-rgb),.2)}.file-tree .mod-new .tree-item-flair{color:var(--text-success)}.file-tree .mod-deleted.is-selected,.file-tree .mod-to-delete.is-selected{background-color:rgba(var(--background-modifier-error-rgb),.2)}.file-tree .mod-deleted .tree-item-flair,.file-tree .mod-to-delete .tree-item-flair{color:var(--text-error)}.file-tree .mod-to-delete .tree-item-flair{display:none}.file-tree .mod-to-delete.is-selected .tree-item-flair{display:block}.file-tree .clickable-icon{display:flex;--icon-size:var(--icon-s);--icon-stroke:var(--icon-s-stroke-width)}.graph-view.color-fill{color:var(--graph-node)}.graph-view.color-fill-focused{color:var(--graph-node-focused)}.graph-view.color-fill-tag{color:var(--graph-node-tag)}.graph-view.color-fill-attachment{color:var(--graph-node-attachment)}.graph-view.color-fill-unresolved{color:var(--graph-node-unresolved);opacity:.5}.graph-view.color-fill-1{color:var(--text-muted)}.graph-view.color-fill-2{color:var(--text-muted)}.graph-view.color-fill-3{color:var(--text-muted)}.graph-view.color-fill-4{color:var(--text-muted)}.graph-view.color-fill-5{color:var(--text-muted)}.graph-view.color-fill-6{color:var(--text-muted)}.graph-view.color-arrow{color:var(--text-normal);opacity:.5}.graph-view.color-circle{color:var(--graph-node-focused)}.graph-view.color-line{color:var(--graph-line)}.graph-view.color-text{color:var(--graph-text)}.graph-view.color-fill-highlight{color:var(--interactive-accent)}.graph-view.color-line-highlight{color:var(--interactive-accent)}.graph-controls{border-radius:var(--radius-m);position:absolute;right:var(--size-4-3);top:var(--size-4-3);padding:0;background-color:var(--background-primary);width:var(--graph-controls-width);overflow:auto}.graph-controls:not(.is-close){max-height:calc(100% - var(--size-4-4));border:1px solid var(--background-modifier-border);box-shadow:var(--shadow-s)}.graph-controls.is-close{min-width:inherit;width:auto;background-color:var(--background-primary);border:1px solid transparent;padding:var(--size-2-3)}.graph-controls.is-close>.graph-control-section{display:none}.graph-controls input[type=range],.graph-controls input[type=text]{width:100%;font-size:var(--font-ui-small)}.graph-controls .mod-cta{margin-top:var(--size-2-3);width:100%}.graph-controls::-webkit-scrollbar,.graph-controls::-webkit-scrollbar-thumb{display:none}.graph-color-group{--swatch-height:18px;--swatch-width:18px;position:relative;display:flex;align-items:center;padding:0 0 6px;transition:top .2s ease-in-out 0s}.graph-color-group input[type=color]{margin:0 2px 0 6px}.graph-color-group .clickable-icon{padding:var(--size-2-2)}.graph-color-button-container{text-align:center;margin-bottom:10px}.graph-color-button-container button{margin:0;width:100%}.graph-color-group.drag-ghost input[type=text]{width:100%}.graph-color-group.drag-ghost input[type=color]{margin-left:6px}.graph-control-section.mod-color-groups .tree-item-children.is-grabbing .graph-color-groups-container{padding-bottom:40px}.graph-controls-button{display:none;z-index:1}.graph-controls-button.mod-close,.graph-controls-button.mod-reset{position:absolute;top:var(--size-4-2);right:var(--size-4-2);padding:var(--size-2-2)}.graph-controls:not(.is-close) .graph-controls-button.mod-close,.graph-controls:not(.is-close) .graph-controls-button.mod-reset{display:flex}.graph-controls-button.mod-reset{right:36px}.graph-controls.is-close .graph-controls-button.mod-open{display:flex}.graph-controls-button.mod-animate{margin-top:var(--size-4-2)}.graph-controls.is-close .graph-controls-button.mod-animate{display:flex}.graph-control-section{padding:var(--size-2-3) var(--size-4-3);border-bottom:1px solid var(--background-modifier-border)}.graph-control-section:last-child{border-bottom:none}.graph-control-section:last-child .tree-item-children{padding-bottom:var(--size-4-4)}.graph-control-section>.tree-item-self{padding-left:var(--size-4-4)}.graph-control-section .tree-item-children{margin:0;padding:var(--size-4-1) 0;border-left:none}.metadata-container{container:metadata/inline-size}.site-list-container{border-top:1px solid var(--background-modifier-border);margin-bottom:var(--size-4-4)}.site-list-container .list-item:last-child{padding-top:var(--size-4-4)}.site-list-item-name{flex-grow:1}.slug-input{text-transform:lowercase}.passwords-container{margin-bottom:var(--size-4-4)}.password-item{border-radius:var(--radius-s);padding:var(--size-4-2) var(--size-4-4);margin:var(--size-4-1) 0}.tree-item.mod-custom-nav.hidden .tree-item-self{color:var(--text-faint)}.tree-item.mod-custom-nav .tree-item-inner{display:flex;align-items:center;position:relative}.tree-list{padding:var(--size-4-4) 0}.tree-list-header{border-bottom:1px solid var(--background-modifier-border);padding:var(--size-4-2) 0;line-height:1.1;display:flex;align-items:center;justify-content:space-between}.tree-list-title{font-size:var(--font-ui-medium);font-weight:var(--font-semibold)}.tree-list-action{align-items:center;display:flex;color:var(--text-muted);font-size:var(--font-ui-small)}.search-input-container{position:relative}.search-input-container::before{top:calc((var(--input-height) - var(--search-icon-size))/ 2);left:8px;position:absolute;content:"";height:var(--search-icon-size);width:var(--search-icon-size);display:block;background-color:var(--search-icon-color);-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'></circle><line x1='21' y1='21' x2='16.65' y2='16.65'></line></svg>");-webkit-mask-repeat:no-repeat}.search-input-container input{display:block;width:100%;padding-right:28px;padding-left:36px}.global-search-input-container.search-input-container input{padding-right:56px}.search-input-clear-button{position:absolute;background:0 0;border-radius:50%;color:var(--search-clear-button-color);cursor:var(--cursor);top:0;right:2px;bottom:0;line-height:0;height:var(--input-height);width:28px;margin:auto;padding:0;text-align:center;display:flex;justify-content:center;align-items:center;transition:color .15s ease-in-out 0s}.search-input-clear-button::after{content:"";height:var(--search-clear-button-size);width:var(--search-clear-button-size);display:block;background-color:currentcolor;-webkit-mask-image:url("data:image/svg+xml,<svg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM3.8705 3.09766L6.00003 5.22718L8.12955 3.09766L8.9024 3.8705L6.77287 6.00003L8.9024 8.12955L8.12955 8.9024L6.00003 6.77287L3.8705 8.9024L3.09766 8.12955L5.22718 6.00003L3.09766 3.8705L3.8705 3.09766Z' fill='currentColor'/></svg>");-webkit-mask-repeat:no-repeat}.search-input-clear-button:active,.search-input-clear-button:hover{color:var(--text-normal);transition:color .15s ease-in-out 0s}.search-input-suggest-button{position:absolute;left:0;top:0;color:var(--text-faint);cursor:var(--cursor);padding:var(--size-4-1) var(--size-4-2);opacity:0;z-index:10}.outgoing-link-pane{overflow-y:auto;padding:var(--size-4-3) var(--size-4-3) var(--size-4-8);flex:1 0 0px}.outgoing-link-pane .search-result-container{padding:var(--size-4-1) 1px var(--size-4-4)}.backlink-pane>.tree-item-self,.outgoing-link-pane>.tree-item-self{color:var(--text-normal);padding-left:var(--size-4-2)}.backlink-pane>.tree-item-self .tree-item-inner,.outgoing-link-pane>.tree-item-self .tree-item-inner{font-weight:var(--font-medium)}.backlink-pane>.tree-item-self.is-collapsed,.outgoing-link-pane>.tree-item-self.is-collapsed{color:var(--text-faint)}.backlink-pane>.tree-item-self .collapse-icon,.outgoing-link-pane>.tree-item-self .collapse-icon{display:none}.search-result-container{padding:var(--size-4-3) var(--size-4-3) var(--size-4-4);position:relative;flex:1 0 0px}.search-result-container.mod-global-search{overflow-y:auto}.search-result-container::before{content:" ";position:absolute;top:0;width:0;height:3px}.search-suggest-info-text{color:var(--text-muted);margin-left:4px}.search-suggest-icon{padding:4px;border-radius:var(--radius-s)}.search-suggest-icon{align-items:center;display:flex}.search-suggest-item{padding:var(--size-4-1) var(--size-4-2);border-radius:var(--radius-s)}.search-suggest-item.mod-group{align-items:center;margin:0;color:var(--text-muted);padding:0 0 0 var(--size-4-2);cursor:default;font-weight:var(--font-semibold);font-size:var(--font-ui-smaller);border-radius:0}.search-suggest-item.mod-group:not(:first-child){border-top:1px solid var(--background-modifier-border);margin-top:6px;padding:6px 6px 0 14px;margin-left:-6px;margin-right:-6px}.search-suggest-item.mod-group.is-selected,.search-suggest-item.mod-group:hover{background-color:initial}.search-empty-state{color:var(--text-faint);font-size:var(--font-ui-small);margin:0 0 var(--size-4-3);padding-left:var(--size-4-2)}.search-result{word-break:break-word}.search-result:not(.is-collapsed) .search-result-file-title{color:var(--nav-item-color-active)}.search-result-file-matches{font-size:var(--font-ui-smaller);line-height:var(--line-height-tight);background-color:var(--search-result-background);border-radius:var(--radius-s);overflow:hidden;margin:var(--size-4-1) 0 var(--size-4-2);color:var(--text-muted);box-shadow:0 0 0 1px var(--background-modifier-border)}.search-result-file-matches:empty{display:none}.search-info-more-matches{color:var(--text-faint)}.search-result-file-match{cursor:var(--cursor);position:relative;padding:var(--size-4-2) var(--size-4-5) var(--size-4-2) var(--size-4-3);white-space:pre-wrap;width:100%;border-bottom:1px solid var(--background-modifier-border)}.search-result-file-match:last-child{border-bottom:none}.search-result-file-match:hover .search-result-file-match-replace-button{display:block}.search-result-file-match-replace-button{display:none;position:absolute;height:auto;bottom:5px;right:24px;padding:var(--size-4-1) var(--size-4-2);color:var(--text-muted);font-size:var(--font-ui-smaller)}.search-result-hover-button{position:absolute;display:flex;right:2px;border-radius:var(--radius-s);color:var(--text-faint);padding:1px 3px}.search-result-hover-button.mod-top{top:2px}.search-result-hover-button.mod-bottom{bottom:2px}.search-result-file-matched-text{color:var(--text-normal);background-color:var(--text-highlight-bg)}.search-info-container{color:var(--text-muted);padding:var(--size-4-1) var(--size-4-4) var(--size-4-1);font-size:var(--font-ui-smaller)}.search-info-children{padding-left:20px;border-left:1px solid var(--background-modifier-border);margin:1px 0}.copy-search-result-container{display:flex;flex-direction:column}.copy-search-result-textarea{height:300px;max-height:20vh;resize:none}.search-result-file-match-destination-file-container{margin-top:var(--size-2-3)}.search-result-file-match-destination-file{display:inline-flex;background-color:var(--interactive-normal);border-radius:var(--radius-s);box-shadow:var(--input-shadow);color:var(--text-muted);padding:var(--size-2-2) var(--size-2-3);margin-bottom:var(--size-2-1)}.search-result-file-match-destination-file-icon{--icon-size:var(--icon-xs);--icon-stroke:var(--icon-xs-stroke-width);margin-right:var(--size-4-1);display:flex;color:var(--text-faint)}.search-result-file-match-destination-file-icon .svg-icon{align-self:center}.search-result-file-match-destination-file-name{white-space:pre-wrap;word-break:break-all}body:not(.is-phone) .workspace-leaf.mod-active .search-result.has-focus .tree-item-self{border-radius:var(--radius-s);box-shadow:inset 0 0 0 2px var(--background-modifier-border-focus)}.search-results-info{color:var(--text-muted);display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--background-modifier-border);margin:var(--size-4-1) var(--size-4-2) 0;padding-bottom:var(--size-4-1);white-space:nowrap}.search-results-result-count{font-size:var(--font-ui-smaller)}.search-row{display:flex;margin:var(--size-4-2);gap:var(--size-4-1)}.search-params{margin:var(--size-4-1) var(--size-4-4)}.search-params input[type=range],.search-params input[type=text]{width:100%;font-size:var(--font-ui-small)}.search-params .mod-cta{margin-top:var(--size-2-3);width:100%}.search-params::-webkit-scrollbar,.search-params::-webkit-scrollbar-thumb{display:none}.global-search-input-container{flex-grow:1}.more-options-icon{--icon-size:10px;background-color:var(--icon-color);border-radius:50%;color:var(--background-secondary);display:flex;margin-left:var(--size-2-3);opacity:var(--icon-opacity);padding:.5px}.clickable-icon:hover .more-options-icon{background-color:var(--icon-color-hover);opacity:var(--icon-opacity-hover)}.slides-container{position:fixed;top:0;left:0;height:100vh;width:100vw;transition:-webkit-transform .8s ease 0s;background-color:#191919;z-index:var(--layer-slides);border:none}.slides-container li .collapse-indicator{display:none}.slides-close-btn{display:inline-block;position:absolute;top:var(--size-4-2);right:var(--size-4-2);color:var(--text-faint);cursor:var(--cursor);z-index:1}.reveal input[type=checkbox]{width:24px;height:24px}.reveal .footnote-item,.reveal .task-list-item{list-style:none}.reveal .task-list-item{margin-left:-1.5em}.mod-selectable{cursor:var(--cursor);padding:var(--size-4-2) var(--size-4-4);border-radius:var(--radius-m)}.sync-file-tree-container{max-height:calc(90vh - 250px);overflow:auto}.tag-pane-tag.is-active{background-color:var(--interactive-accent);color:var(--text-on-accent)}.tag-pane-tag.is-active .tag-pane-tag-count{background-color:var(--background-modifier-hover);color:var(--text-normal)}.tag-container{font-size:var(--font-ui-small);padding:var(--size-4-3) var(--size-4-3) var(--size-4-8);overflow:auto}.tree-item-children .tag-pane-tag .tag-pane-tag-parent{display:none}body:not(.is-phone) .workspace-leaf.mod-active .tree-item.has-focus>.tag-pane-tag{border-radius:var(--radius-s);box-shadow:0 0 0 2px var(--background-modifier-border-focus)}.mod-canvas-color-1{--canvas-color:var(--canvas-color-1)}.mod-canvas-color-2{--canvas-color:var(--canvas-color-2)}.mod-canvas-color-3{--canvas-color:var(--canvas-color-3)}.mod-canvas-color-4{--canvas-color:var(--canvas-color-4)}.mod-canvas-color-5{--canvas-color:var(--canvas-color-5)}.mod-canvas-color-6{--canvas-color:var(--canvas-color-6)}body{--canvas-color:192,192,192}body.theme-dark{--canvas-color:126,126,126}.canvas-wrapper{position:absolute;width:100%;height:100%;left:0;top:0;--resizer-size:20px;--shadow-stationary:0px 0.5px 1px 0.5px rgba(0, 0, 0, 0.1);--shadow-drag:0px 2px 10px rgba(0, 0, 0, 0.1);--shadow-border-accent:0 0 0 2px var(--color-accent);--zoom-multiplier:1;background-color:var(--canvas-background);overflow:hidden;contain:strict;touch-action:none;user-select:none}.canvas-wrapper.is-dragging{cursor:grabbing}.canvas-wrapper.is-dragging iframe:not(.is-controlled),.canvas-wrapper.is-dragging webview{pointer-events:none}.canvas-wrapper.is-screenshotting{z-index:999999}.canvas-wrapper.is-screenshotting .canvas-controls{display:none!important}.canvas-wrapper.is-screenshotting *{pointer-events:none!important}.canvas-mover{position:absolute;width:100%;height:100%;left:0;top:0;cursor:grab}.canvas-mover:active{cursor:grabbing}.canvas-background{position:absolute;width:100%;height:100%;left:0;top:0;pointer-events:none}.canvas-background circle{fill:var(--canvas-dot-pattern)}.canvas{position:absolute;width:100%;height:100%;left:0;top:0;transform-origin:0px 0px;pointer-events:none}.canvas>*{pointer-events:initial}.canvas-selection{pointer-events:none;position:absolute;background-color:hsla(var(--color-accent-hsl),.1);border:2px solid var(--color-accent);z-index:-1}.canvas-selection.mod-group-selection{border-width:3px;border-radius:3px;background-color:hsla(var(--color-accent-hsl),.03);border-color:hsla(var(--color-accent-hsl),.3);pointer-events:initial}.canvas-wrapper:not(.mod-readonly) .canvas-selection.mod-group-selection{cursor:grab}.canvas-wrapper:not(.mod-readonly) .canvas-selection.mod-group-selection:active{cursor:grabbing}.canvas-selection.mod-node-highlight{border-radius:var(--radius-m)}.canvas-controls{display:flex;position:absolute;z-index:var(--layer-cover);font-size:var(--font-ui-medium)}.canvas-controls{right:var(--size-4-2);top:var(--size-4-2);gap:var(--size-4-2);display:flex;flex-direction:column}.canvas-control-group{border-radius:var(--radius-s);background-color:var(--background-primary);border:1px solid var(--background-modifier-border);box-shadow:var(--input-shadow);display:flex;flex-direction:column;overflow:hidden}.canvas-control-item{border-radius:0;box-shadow:none;height:auto;display:flex;line-height:1;font-size:inherit;align-items:center;justify-content:center;cursor:var(--cursor);padding:var(--size-4-2);border-bottom:1px solid var(--background-modifier-border);color:var(--text-muted);background-color:var(--interactive-normal);--icon-size:var(--icon-s);--icon-stroke:var(--icon-s-stroke-width)}.canvas-control-item:last-child{border-bottom:none}.canvas-control-item.is-active{color:var(--color-accent)}.canvas-control-item.is-disabled svg{color:var(--text-faint)}.canvas-control-item svg{pointer-events:none}.canvas-node-container{background-color:var(--background-primary);border-radius:var(--radius-m);border:2px solid rgb(var(--canvas-color));contain:strict;display:flex;flex-direction:column;overflow:hidden;position:absolute;left:0;top:0;width:100%;height:100%;box-shadow:var(--shadow-stationary)}.canvas-node-label{position:absolute;left:0;top:calc(-1 * var(--size-4-1) * var(--zoom-multiplier));transform:translate(0,-100%) scale(var(--zoom-multiplier));transform-origin:left bottom;max-width:calc(100% / var(--zoom-multiplier));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--canvas-card-label-color);--icon-size:1em}body:not(.is-ios) .canvas-wrapper.mod-animating .canvas-node-label{transition:transform .5s cubic-bezier(.16, 1, .3, 1) 0s}.canvas-node-label svg{position:relative;top:2px;margin-right:var(--size-4-1)}.canvas-node-label.mod-hover-label{opacity:0}.canvas-wrapper.mod-zoomed-out .canvas-node-label{display:none}.canvas-node-placeholder{display:flex;align-items:center;justify-content:center;text-align:center;width:100%;height:100%;overflow:hidden;overflow-wrap:anywhere;padding:var(--size-4-6);font-size:32px;font-weight:var(--font-semibold)}.canvas-node-placeholder::after{border-radius:var(--radius-s);content:" ";display:block;position:absolute;top:var(--size-4-4);right:var(--size-4-4);bottom:var(--size-4-4);left:var(--size-4-4);background-color:rgba(var(--canvas-color),.1)}.canvas-icon-placeholder{display:flex;width:40%;height:40%}.canvas-icon-placeholder svg{opacity:.3;color:rgb(var(--canvas-color));width:100%;height:100%}.canvas-node-interaction-layer{position:absolute;width:0;height:0;pointer-events:none}.canvas-node-interaction-layer>*{pointer-events:initial}.canvas-node{--shadow-border-themed-inset:inset 0 0 0 1px rgb(var(--canvas-color));--shadow-border-themed:0 0 0 2px rgb(var(--canvas-color));position:absolute;width:0;height:0}.canvas-node.is-dragging{pointer-events:none}.canvas-node.is-dragging .canvas-node-container{box-shadow:var(--shadow-drag)}.canvas-node.is-focused,.canvas-node.is-selected{touch-action:initial}.canvas-node.is-focused .canvas-node-label,.canvas-node.is-selected .canvas-node-label{color:var(--text-muted)}.canvas-node.is-focused .canvas-node-container,.canvas-node.is-selected .canvas-node-container{border-color:var(--color-accent);box-shadow:var(--shadow-stationary),var(--shadow-border-accent)}.canvas-node.is-focused.is-dragging .canvas-node-container,.canvas-node.is-selected.is-dragging .canvas-node-container{box-shadow:var(--shadow-drag),var(--shadow-border-accent)}.canvas-node.is-themed .canvas-node-container{border-color:rgba(var(--canvas-color),.7);box-shadow:inset 0 0 0 1px rgba(var(--canvas-color),.7),var(--shadow-stationary)}.canvas-node.is-focused.is-themed .canvas-node-container,.canvas-node.is-selected.is-themed .canvas-node-container{border-color:rgb(var(--canvas-color));box-shadow:var(--shadow-border-themed-inset),var(--shadow-border-themed)}.canvas-node.is-focused.is-themed.is-dragging .canvas-node-container,.canvas-node.is-selected.is-themed.is-dragging .canvas-node-container{box-shadow:var(--shadow-border-themed-inset),var(--shadow-border-themed)}.canvas-node.is-dummy{cursor:grabbing}.canvas-node.is-dummy .canvas-node-container{border:4px solid var(--color-accent);box-shadow:rgba(0,0,0,.15) 0 2px 10px;background-color:hsla(var(--color-accent-hsl),.2)}.canvas-node.is-focused:not(.is-dragging) .canvas-node-content-blocker{display:none}.canvas-node-content-blocker{position:absolute;width:100%;height:100%;left:0;top:0;z-index:var(--layer-cover)}.canvas-node-group:not(.is-focused):not(.is-selected){pointer-events:none}.canvas-node-group .canvas-node-resizer{pointer-events:initial}.canvas-node-group .canvas-node-container{background-color:transparent}.canvas-node-group .canvas-node-content{background-color:rgba(var(--canvas-color),.07)}.canvas-group-label{position:absolute;left:0;top:calc(-1 * var(--size-4-1) * var(--zoom-multiplier));transform:translate(0,-100%) scale(var(--zoom-multiplier));transform-origin:left bottom;max-width:calc(100% / var(--zoom-multiplier));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:initial;font-size:1.5em;padding:var(--size-4-1) var(--size-4-2);border-radius:var(--radius-s);color:var(--text-muted);background-color:rgba(var(--canvas-color),.1);line-height:1}body:not(.is-ios) .canvas-wrapper.mod-animating .canvas-group-label{transition:transform .5s cubic-bezier(.16, 1, .3, 1) 0s}.canvas-wrapper:not(.mod-readonly) .canvas-group-label{cursor:grab}.canvas-wrapper:not(.mod-readonly) .canvas-group-label:active{cursor:grabbing}.canvas-group-label[contenteditable=true]{cursor:text;background-color:var(--background-primary);box-shadow:0 0 0 2px rgb(var(--canvas-color));color:var(--text-normal);text-overflow:initial}.canvas-node-group.is-themed .canvas-group-label:not([contenteditable=true]){background-color:rgb(var(--canvas-color))}.canvas-node-group.is-themed .canvas-group-label:not([contenteditable=true]).mod-foreground-light{color:var(--text-on-accent)}.canvas-node-group.is-themed .canvas-group-label:not([contenteditable=true]).mod-foreground-dark{color:var(--text-on-accent-inverted)}.canvas-node-content{backface-visibility:hidden;width:100%;height:100%;overflow:hidden;position:relative}.canvas-node-content.markdown-embed{border:none;padding:0}.canvas-node-content.markdown-embed .inline-title{cursor:text}.canvas-node-content.markdown-embed>.markdown-embed-content>.markdown-preview-view{padding:0 var(--size-4-6);display:flex;flex-direction:column}.canvas-wrapper:not(.mod-readonly) .canvas-node-content.markdown-embed>.markdown-embed-content>.markdown-preview-view{user-select:none}.canvas-node-content.markdown-embed>.markdown-embed-content>.markdown-preview-view::after,.canvas-node-content.markdown-embed>.markdown-embed-content>.markdown-preview-view::before{content:" ";display:block;min-height:min(calc(var(--canvas-node-height) * .1 - 3px),var(--size-4-6));max-height:var(--size-4-4);flex:1 1 0px}.canvas-node-content.markdown-embed>.markdown-embed-content>.markdown-preview-view>.markdown-preview-sizer{flex:1 0 0px}.canvas-node-content.markdown-embed>.markdown-embed-content>.markdown-preview-view .callout{mix-blend-mode:normal}.canvas-node-content.markdown-embed>.markdown-embed-content>.markdown-preview-view .markdown-preview-pusher+div>:first-child{margin-top:0}.canvas-node-content.markdown-embed>.markdown-embed-content>.markdown-preview-view .markdown-preview-sizer>div:last-child>:last-child{margin-bottom:0}.is-focused .canvas-node-content.markdown-embed>.markdown-embed-content>.markdown-preview-view{transform:translateZ(0)}.canvas-node.is-themed .canvas-node-content{background-color:rgba(var(--canvas-color),.07)}.canvas-node-content.media-embed{justify-content:center;align-items:center;display:flex}.canvas-node-content.media-embed audio,.canvas-node-content.media-embed img,.canvas-node-content.media-embed video{flex-shrink:0;flex-grow:1}.canvas-node-content.media-embed audio,.canvas-node-content.media-embed img:not([width]),.canvas-node-content.media-embed video{max-width:100%}.canvas-node-resizer{position:absolute;height:calc(var(--resizer-size) * var(--zoom-multiplier));width:calc(var(--resizer-size) * var(--zoom-multiplier))}.is-selected .canvas-node-resizer{pointer-events:none}.canvas-wrapper.mod-readonly .canvas-node-resizer{display:none}.canvas-node-resizer[data-resize=top]{left:0;right:0;width:auto;top:calc(var(--resizer-size) * var(--zoom-multiplier) * -.5);cursor:ns-resize}.canvas-node-resizer[data-resize=bottom]{left:0;right:0;width:auto;bottom:calc(var(--resizer-size) * var(--zoom-multiplier) * -.5);cursor:ns-resize}.canvas-node-resizer[data-resize=left]{top:0;bottom:0;height:auto;left:calc(var(--resizer-size) * var(--zoom-multiplier) * -.5);cursor:ew-resize}.canvas-node-resizer[data-resize=right]{top:0;bottom:0;height:auto;right:calc(var(--resizer-size) * var(--zoom-multiplier) * -.5);cursor:ew-resize}.canvas-node-resizer[data-resize=topright]{right:calc(var(--resizer-size) * var(--zoom-multiplier) * -.5);top:calc(var(--resizer-size) * var(--zoom-multiplier) * -.5);cursor:nesw-resize}.canvas-node-resizer[data-resize=bottomright]{right:calc(var(--resizer-size) * var(--zoom-multiplier) * -.5);bottom:calc(var(--resizer-size) * var(--zoom-multiplier) * -.5);cursor:nwse-resize}.canvas-node-resizer[data-resize=topleft]{left:calc(var(--resizer-size) * var(--zoom-multiplier) * -.5);top:calc(var(--resizer-size) * var(--zoom-multiplier) * -.5);cursor:nwse-resize}.canvas-node-resizer[data-resize=bottomleft]{left:calc(var(--resizer-size) * var(--zoom-multiplier) * -.5);bottom:calc(var(--resizer-size) * var(--zoom-multiplier) * -.5);cursor:nesw-resize}.canvas-node-connection-point{width:calc(var(--resizer-size) * var(--zoom-multiplier));height:calc(var(--resizer-size) * var(--zoom-multiplier));position:absolute;pointer-events:all;cursor:pointer}.canvas-node-connection-point[data-side=top]{top:1px;left:calc(50% - var(--resizer-size) * var(--zoom-multiplier)/ 2)}.canvas-node-connection-point[data-side=right]{right:1px;top:calc(50% - var(--resizer-size) * var(--zoom-multiplier)/ 2)}.canvas-node-connection-point[data-side=bottom]{bottom:1px;left:calc(50% - var(--resizer-size) * var(--zoom-multiplier)/ 2)}.canvas-node-connection-point[data-side=left]{left:1px;top:calc(50% - var(--resizer-size) * var(--zoom-multiplier)/ 2)}.canvas-node-connection-point::after{content:" ";background-color:var(--color-accent);border-radius:50%;border:3px solid var(--background-modifier-border);box-sizing:border-box;display:block;height:calc(var(--resizer-size) * var(--zoom-multiplier));opacity:0;position:relative;width:calc(var(--resizer-size) * var(--zoom-multiplier));left:0;top:0}.canvas-node-resizer:hover .canvas-node-connection-point::after{opacity:1}.canvas-snaps{position:absolute;width:100%;height:100%;left:0;top:0;overflow:visible;pointer-events:none;opacity:.6}.canvas-snaps line{stroke-width:1px;stroke:var(--color-accent)}.canvas-snaps circle{fill:var(--color-accent)}.canvas-edges{position:absolute;width:100%;height:100%;left:0;top:0;overflow:visible;pointer-events:none}.canvas-edges>*{pointer-events:initial}.canvas-edges path.canvas-display-path{pointer-events:none;stroke-width:calc(3px * var(--zoom-multiplier));stroke:rgb(var(--canvas-color));fill:none;transition:stroke-width .1s ease-out 0s}.canvas-edges path.canvas-interaction-path{pointer-events:stroke;stroke-width:calc(24px * var(--zoom-multiplier));stroke-linecap:round;stroke:transparent;fill:none;transition:stroke .1s ease-out 0s}.canvas-wrapper:not(.mod-readonly) .canvas-edges path.canvas-interaction-path{cursor:grab}.canvas-wrapper:not(.mod-readonly) .canvas-edges path.canvas-interaction-path:active{cursor:grabbing}.canvas-edges polygon.canvas-path-end{pointer-events:none;stroke:rgb(var(--canvas-color));fill:rgb(var(--canvas-color));stroke-linecap:round;stroke-linejoin:round;stroke-width:1px;transform-box:fill-box;transform:scale(var(--zoom-multiplier));transform-origin:center top}.canvas-edges g.is-focused path.canvas-display-path,.canvas:not(.is-connecting) .canvas-edges g:hover path.canvas-display-path{stroke-width:calc(5.5px * var(--zoom-multiplier))}.canvas-edges g.is-focused path.canvas-interaction-path,.canvas:not(.is-connecting) .canvas-edges g:hover path.canvas-interaction-path{stroke:rgba(var(--canvas-color),0.1)}.canvas-path-label-wrapper{position:absolute;width:fit-content;height:fit-content}.canvas-path-label{font-size:calc(var(--font-ui-large) * var(--zoom-multiplier));background-color:var(--background-primary);border-radius:var(--radius-s);padding:calc(var(--size-2-3) * var(--zoom-multiplier));line-height:var(--line-height-tight);white-space:pre-wrap;transform:translate(-50%,-50%);text-align:center;max-width:calc(17em * var(--zoom-multiplier))}.canvas-color-picker-item{cursor:var(--cursor);width:24px;height:24px;margin:2px;border-radius:12px;border:2px solid var(--background-primary);background-color:rgb(var(--canvas-color))}.canvas-color-picker-item.is-active{box-shadow:0 0 0 2px rgb(var(--canvas-color))}.canvas-color-picker-item input[type=color]{margin:-4px 0 0 -2px;--swatch-width:20px;--swatch-height:20px;opacity:0}.canvas-color-picker-item.canvas-color-picker-custom:not(.is-active){background:conic-gradient(var(--color-red),var(--color-yellow),var(--color-green),var(--color-blue),var(--color-purple),var(--color-red))}.canvas-empty-embed-container{align-items:center;display:flex;flex-direction:column;gap:var(--size-4-6);justify-content:center;height:100%;padding:var(--size-4-3);text-align:center}.canvas-empty-embed-action-list{display:flex;flex-direction:column;gap:var(--size-4-3)}.canvas-empty-embed-action-list button{font-size:var(--font-text-size);padding:var(--size-4-5) var(--size-4-9)}.canvas-help{display:flex;flex-direction:column;gap:var(--size-4-3)}.canvas-instruction{display:flex;justify-content:space-between}.canvas-instruction-desc{display:flex;gap:var(--size-4-1)}.canvas-minimap{width:100%;height:100%;padding:var(--size-4-1)}.inline-embed>.canvas-minimap{max-height:var(--embed-canvas-max-height)}.canvas-minimap rect{stroke-width:5px;stroke:var(--background-modifier-border);fill:var(--background-modifier-border);fill-opacity:0.65}.canvas-minimap rect.is-themed{stroke:rgb(var(--canvas-color));fill:rgb(var(--canvas-color));fill-opacity:0.5}.canvas-minimap path{stroke:rgb(192,192,192);fill:none}.canvas-minimap path.is-themed{stroke:rgb(var(--canvas-color))}.canvas-cursor{position:absolute;width:1px;height:1px;border:5px solid var(--color-accent);border-radius:5px;pointer-events:none}.canvas-watermark *{font-family:var(--font-default)!important}.starter{user-select:none;padding-top:0!important}.starter-screen{display:flex;flex-direction:column;background-color:var(--background-primary);width:100%;height:100%}.starter-screen-inner{flex-grow:1;display:flex;height:calc(100% - 24px)}.splash{align-items:center;background-color:var(--background-primary);display:flex;flex-direction:column;justify-content:center;flex:1 1 auto;text-align:center;padding:36px 0 0}.splash-brand{flex:0 0 content;padding:20px 0}.splash-brand-logo-text{margin-top:20px;color:#fff}.splash-brand-version{color:var(--text-muted);margin-top:8px;font-size:var(--font-ui-small)}.help-options-container{flex:1 0 0px;overflow:auto;width:100%;max-width:82%;text-align:left;padding:var(--size-4-6) 0}.help-options-container::-webkit-scrollbar{display:none}.open-vault-options-container::-webkit-scrollbar{display:none}.open-vault-options input[type=text]{width:150px}.open-vault-options.mod-login input[type=text]{width:250px}.quick-start-container{margin-bottom:10px}.quick-start-container button{font-size:var(--font-ui-medium);padding:8px 60px}.open-folder-input[type=text]{font-size:var(--font-ui-small);width:200px;height:28px}.browse-folder-button{margin-left:10px}.open-folder-button{margin-top:14px;padding:6px 36px}.starter .notice{top:38px}.recent-vaults-list-item-name[contenteditable]{cursor:text;border-color:var(--interactive-accent);background-color:var(--background-modifier-hover);font-size:.9em;padding:0 var(--size-4-1)}:root{--safe-area-inset-top:env(safe-area-inset-top);--safe-area-inset-bottom:env(safe-area-inset-bottom);--safe-area-inset-left:env(safe-area-inset-left);--safe-area-inset-right:env(safe-area-inset-right)}.is-tablet{--nav-item-padding:var(--size-2-3) var(--size-4-2) var(--size-2-3) var(--size-4-6);--tab-font-size:var(--font-ui-smaller)}.is-tablet.theme-dark{--titlebar-background:var(--background-primary);--titlebar-background-focused:var(--background-primary);--interactive-normal:var(--background-modifier-border);--modal-background:var(--background-secondary)}.is-mobile .tree-item .tree-item-self{padding-right:var(--size-4-2)}.is-mobile input[type=text]{width:100%}.is-mobile .markdown-rendered pre:not(:hover)>button.copy-code-button{display:block}.is-mobile .markdown-rendered button.copy-code-button{width:auto}.is-mobile .markdown-rendered .heading-collapse-indicator{margin-left:-20px}.is-mobile .markdown-rendered ol,.is-mobile .markdown-rendered ul{padding-inline-start:25px}.is-tablet .mod-left-split-toggle{display:none}.is-tablet button:not(.clickable-icon){padding:var(--size-4-1) var(--size-4-5)}.mod-tappable{transition:opacity .15s ease-in-out 0s}.mod-tappable.mod-tap{opacity:.5}.is-tablet .horizontal-tab-nav-item,.is-tablet .vertical-tab-nav-item{padding:var(--size-4-2) var(--size-4-3)}.is-tablet .modal.mod-settings .vertical-tab-header{max-width:none}.is-tablet.theme-dark .community-item,.is-tablet.theme-dark .vertical-tab-content{background-color:var(--background-secondary)}body.is-tablet .workspace-drawer.mod-left .workspace-drawer-inner{padding-left:var(--ribbon-width)}.workspace-drawer .nav-buttons-container::-webkit-scrollbar,.workspace-drawer .nav-buttons-container::-webkit-scrollbar-thumb,.workspace-drawer .workspace-drawer-actions::-webkit-scrollbar,.workspace-drawer .workspace-drawer-actions::-webkit-scrollbar-thumb{visibility:hidden}.workspace-drawer-ribbon::-webkit-scrollbar,.workspace-drawer-ribbon::-webkit-scrollbar-thumb{visibility:hidden;width:0}.is-tablet .workspace-drawer .workspace-drawer-header-icon.mod-settings{display:none}body.is-tablet .sidebar-toggle-button{padding-left:var(--size-4-2);--icon-color:var(--interactive-accent);--icon-color-hover:var(--interactive-accent);--icon-color-active:var(--interactive-accent-hover);--icon-color-focus:var(--interactive-accent-hover);--icon-size:var(--icon-l);--icon-stroke:var(--icon-l-stroke-width)}body.is-tablet .mobile-navbar{display:none}.is-mobile .prompt-input[type=text]{padding:var(--size-4-4)}.is-phone .prompt-input[type=text]{border:none}.pull-action{position:absolute;background-color:var(--background-secondary);z-index:var(--layer-popover);color:var(--text-muted);font-size:90%;transition:background-color 150ms ease-in-out 0s}.pull-action.mod-activated{background-color:var(--interactive-accent);color:var(--text-on-accent)}.pull-down-action{top:0;left:0;right:0;width:96%;max-width:500px;margin:var(--safe-area-inset-top) auto 0 auto;padding:var(--size-4-3) var(--size-4-4);text-align:center;border-radius:40px}.pull-out-action{top:50%;padding:var(--size-4-3) var(--size-4-4);border-radius:40px;margin:0 var(--size-4-4)}.is-tablet.is-ios .mobile-toolbar{padding-bottom:16px}.mobile-toolbar-options-container::-webkit-scrollbar{width:0!important;height:0!important}.is-tablet.theme-dark .suggestion-container{background-color:var(--background-secondary)}.is-mobile .file-tree .tree-item-self{font-size:var(--font-ui-small)}.markdown-preview-view .heading-collapse-indicator{margin-left:calc(0px - var(--collapse-arrow-size) - 10px)!important;padding:0 0!important}.node-insert-event{animation-duration:unset!important;animation-name:none!important}hr{border:none;border-top:var(--hr-thickness) solid;border-color:var(--hr-color)}.cm-fold-indicator.is-collapsed .collapse-indicator,.cm-gutterElement .is-collapsed .collapse-indicator,.cm-gutterElement:hover .collapse-indicator,.cm-line:hover .cm-fold-indicator .collapse-indicator,.collapse-indicator:hover,.fold-gutter.is-collapsed,.fold-gutter:hover,.is-collapsed .collapse-indicator,.metadata-properties-heading:hover .collapse-indicator,h1:hover .collapse-indicator,h2:hover .collapse-indicator,h3:hover .collapse-indicator,h4:hover .collapse-indicator,h5:hover .collapse-indicator,h6:hover .collapse-indicator{opacity:1;transition:opacity .15s ease-in-out}.collapse-indicator,.fold-gutter{opacity:0;transition:opacity .15s ease-in-out}@media print{html body>:not(.print){display:unset!important}.collapse-indicator{display:none!important}.is-collapsed>element>.collapse-indicator{display:unset!important}}.mod-header .metadata-container{display:none!important}.markdown-embed .heading-collapse-indicator{translate:-1em 0}.markdown-embed.internal-embed.inline-embed .markdown-embed-content,.markdown-embed.internal-embed.inline-embed .markdown-embed-content .markdown-preview-view{overflow:visible!important}.markdown-embed-link{display:none!important}.canvas-wrapper:not(.mod-readonly) .canvas-node-content.markdown-embed>.markdown-embed-content>.markdown-preview-view{user-select:text!important}.canvas-card-menu{display:none;cursor:default!important}.canvas-controls{display:none;cursor:default!important}.canvas-background{pointer-events:visible!important;cursor:grab!important}.canvas-background:active{cursor:grabbing!important}.canvas-node-connection-point{display:none;cursor:default!important}.canvas-node-content{backface-visibility:visible!important}.canvas-menu-container{display:none}.canvas-node-content-blocker{cursor:pointer!important}.canvas-wrapper{position:relative;cursor:default!important}.canvas-node-resizer{cursor:default!important}.canvas-node-container{cursor:default!important}.markdown-rendered pre:not(:hover)>button.copy-code-button{display:unset;opacity:0}.markdown-rendered pre:hover>button.copy-code-button{opacity:1}.markdown-rendered pre button.copy-code-button{transition:opacity .2s ease-in-out,width .3s ease-in-out,background-color .2s ease-in-out;text-overflow:clip}.markdown-rendered pre>button.copy-code-button:hover{background-color:var(--interactive-normal)}.markdown-rendered pre>button.copy-code-button:active{background-color:var(--interactive-hover);box-shadow:var(--input-shadow);transition:none}.webpage-container .is-collapsed .collapse-indicator svg.svg-icon,.webpage-container .is-collapsed .list-collapse-indicator svg.svg-icon{color:var(--collapse-icon-color-collapsed)}
\ No newline at end of file