diff --git a/docs/_app/immutable/assets/0.bfb7888c.css b/docs/_app/immutable/assets/0.e8eba8d3.css similarity index 56% rename from docs/_app/immutable/assets/0.bfb7888c.css rename to docs/_app/immutable/assets/0.e8eba8d3.css index 6dca998..b4d6ec2 100644 --- a/docs/_app/immutable/assets/0.bfb7888c.css +++ b/docs/_app/immutable/assets/0.e8eba8d3.css @@ -1 +1 @@ -.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.z-10{z-index:10}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mt-2{margin-top:.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.w-full{width:100%}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto}.border-collapse{border-collapse:collapse}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.gap-10{gap:2.5rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.border{border-width:1px}.p-2{padding:.5rem}.p-4{padding:1rem}.text-center{text-align:center}.text-xl{font-size:1.25rem;line-height:1.75rem}.leading-4{line-height:1rem}.underline{text-decoration-line:underline}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}h1{font-size:var(--font-size-5);font-weight:var(--font-weight-bold);margin-bottom:var(--spacing-12)}h2{font-size:var(--font-size-4);font-weight:var(--font-weight-semibold)}body{margin:0;font-weight:var(--font-weight-normal);background-color:var(--colour-brand)}code{counter-reset:step;counter-increment:step 0}.shiki{border-radius:var(--spacing-1);padding:var(--spacing-6) var(--spacing-4);margin:var(--spacing-4) auto var(--spacing-18);box-shadow:var(--shadow-elevation-medium);overflow-x:auto;max-width:var(--max-width-full)}.highlight-line{display:inline-block;background-color:var(--colour-code-background-highlighted);width:calc(var(--max-width-full) + var(--spacing-4));border-left:var(--spacing-1) solid var(--colour-code-line-highlight);margin-left:calc(-1 * var(--spacing-1))}:root{--colour-brand: hsl(193 67% 34%);--colour-light: hsl(7 53% 97%);--colour-code-line-numbers: hsl(219 14% 71% / .8);--colour-code-line-highlight: hsl(34 96% 55%);--colour-code-background-hue: 220;--colour-code-background-saturation: 13%;--colour-code-background-lightness: 18%;--colour-code-background-highlighted: hsl( var(--colour-code-background-hue) var(--colour-code-background-saturation) calc(var(--colour-code-background-lightness) + 5%) );--spacing-px: 1px;--spacing-px-2: 2px;--spacing-0: 0;--spacing-1: .25rem;--spacing-2: .5rem;--spacing-4: 1rem;--spacing-6: 1.5rem;--spacing-12: 3rem;--spacing-18: 4.5rem;--max-width-wrapper: 48rem;--max-width-full: 100%;--font-size-root: 16px;--font-size-3: 1.563rem;--font-size-4: 1.953rem;--font-size-5: 2.441rem;--font-size-6: 3.052rem;--font-weight-normal: 400;--font-weight-semibold: 600;--font-weight-bold: 700;--line-height-normal: 1.5;--shadow-color: 194deg 84% 18%;--shadow-elevation-medium: -1px 1px 1.6px hsl(var(--shadow-color) / .36), -3.3px 3.3px 5.3px -.8px hsl(var(--shadow-color) / .36), -8.2px 8.2px 13px -1.7px hsl(var(--shadow-color) / .36), -20px 20px 31.8px -2.5px hsl(var(--shadow-color) / .36)}code .line:before{display:inline-block;content:counter(step);counter-increment:step;width:var(--spacing-6);margin-right:var(--spacing-6);text-align:right;font-variant-numeric:tabular-nums;color:var(--colour-line-numbers)}input{padding:6px;border-radius:4px}@media (min-width: 640px){.sm\:block{display:block}.sm\:inline{display:inline}}@media (min-width: 1024px){.lg\:hidden{display:none}.lg\:flex-none{flex:none}.lg\:p-10{padding:2.5rem}.lg\:text-left{text-align:left}}:root{--sk-back-h: 206;--sk-selection-color: hsla(204, 100%, 63%, .3);--sk-focus-outline: 0 0 0 2px hsla(var(--sk-theme-1-hsl), .6);--sk-theme-1: var(--sk-theme-1-hsl);--sk-theme-2: var(--sk-theme-2-hsl);--sk-theme-3: var(--sk-theme-3-hsl);--sk-text-warning: hsl(var(--sk-text-warning-hsl));--sk-nav-height: 6rem;--sk-page-padding-top: 6rem;--sk-page-padding-bottom: 6rem;--sk-page-padding-side: 2.4rem;--sk-thick-border-width: .3rem;--sk-border-radius: .4rem;--sk-page-main-width: 80rem;--sk-font: "Overpass", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--sk-font-mono: "Fira Mono", monospace;--sk-text-xxl: 3.6rem;--sk-text-xl: 3rem;--sk-text-l: 2.4rem;--sk-text-m: 2rem;--sk-text-s: 1.6rem;--sk-text-xs: 1.3rem;--sk-line-max-width: 84rem;--m: 10px}@media only screen and (prefers-color-scheme: dark){:root{color-scheme:dark;--sk-back-1: hsl(0, 0%, 10%);--sk-back-2: hsl(0, 0%, 18%);--sk-back-3: hsl(var(--sk-back-3-hsl));--sk-back-4: hsl(0, 0%, 22%);--sk-back-5: hsl(0, 0%, 40%);--sk-back-translucent: hsla(0, 0%, 100%, .1);--sk-theme-1-hsl: hsl(38.77deg 71.8% 58.64%);--sk-theme-2-hsl: 240, 8%, 44%;--sk-theme-3-hsl: 204, 100%, 63%;--sk-text-1: hsl(0, 0%, 90%);--sk-text-2: hsl(0, 0%, 80%);--sk-text-3: hsl(0, 0%, 65%);--sk-text-4: hsl(0, 0%, 45%);--sk-text-translucent: hsla(0, 0%, 100%, .9);--sk-scrollbar: rgba(255, 255, 255, .3);--sk-back-3-hsl: 0, 0%, 14%;--sk-theme-1-variant: hsl(202, 88%, 66%);--sk-theme-2-variant: hsl(240, 8%, 35%);--sk-theme-3-variant: hsl(204, 100%, 50%);--sk-text-warning-hsl: 32, 67%, 56%;--sk-code-ts-bg: var(--sk-back-2);--sk-code-bg: var(--sk-back-3);--sk-code-base: hsl(45, 7%, 75%);--sk-code-comment: hsl(0, 0%, 55%);--sk-code-keyword: hsl(204, 88%, 65%);--sk-code-function: hsl(19, 67%, 75%);--sk-code-string: hsl(41, 37%, 68%);--sk-code-number: hsl(120, 100%, 25%);--sk-code-template-string: hsl(2, 80%, 47%);--sk-code-tags: var(--sk-code-function);--sk-code-important: var(--sk-code-string);--sk-code-diff-base: hsla(0, 0%, 100%, .5);--sk-code-diff-inserted: hsl(120, 46%, 48%);--sk-code-diff-removed: hsl(2, 64%, 70%);--toggle-dark: block;--toggle-light: none;--sdt-bg-main: #585858;--sdt-shadow-color: #333;--sdt-color: #eee;--sdt-clock-color: var(--sdt-color);--sdt-clock-color-hover: var(--sdt-color);--sdt-clock-time-bg: transparent;--sdt-clock-time-bg-hover: transparent;--sdt-clock-disabled: #b22222;--sdt-clock-disabled-bg: var(--sdt-bg-main);--sdt-clock-selected-bg: var(--sdt-bg-selected);--sdt-header-color: #eee;--sdt-bg-selected: #e1ac4a;--sdt-table-disabled-date: #b22222;--sdt-table-disabled-date-bg: var(--sdt-bg-main);--sdt-table-data-bg-hover: #777;--sdt-table-selected-bg: var(--sdt-bg-selected);--sdt-header-btn-bg-hover: #777;--sdt-color-selected: #fff;--sdt-table-today-indicator: #ccc;--sdt-clock-bg: #999;--sdt-today-bg: #e4a124;--sdt-today-color: #fff;--sdt-clear-color: #666;--sdt-clear-bg: #ddd;--sdt-clear-hover-color: #fff;--sdt-clear-hover-bg: #dc3545}html.light{color-scheme:light;--sk-back-3-hsl: 206, 64%, 98%;--sk-back-1: hsl(0, 0%, 100%);--sk-back-2: hsl(0, 0%, 100%);--sk-back-3: hsl(var(--sk-back-3-hsl));--sk-back-4: hsl(206, 44%, 93%);--sk-back-5: hsl(206, 20%, 80%);--sk-theme-1-hsl: 15, 100%, 50%;--sk-theme-2-hsl: 240, 8%, 44%;--sk-theme-3-hsl: 204, 100%, 63%;--sk-text-1: hsl(0, 0%, 13%);--sk-text-2: hsl(0, 0%, 27%);--sk-text-3: var(--sk-theme-2);--sk-text-4: hsl(0, 0%, 65%);--sk-scrollbar: rgba(0, 0, 0, .3);--sk-theme-1-variant: hsl(202, 100%, 40%);--sk-theme-2-variant: hsl(240, 8%, 44%);--sk-theme-3-variant: hsl(204, 100%, 63%);--sk-code-bg: var(--sk-back-3);--sk-code-ts-bg: var(--sk-back-1);--sk-code-base: hsl(45, 7%, 35%);--sk-code-comment: hsl(0, 0%, 41%);--sk-code-keyword: hsl(204, 88%, 35%);--sk-code-function: hsl(19, 67%, 44%);--sk-code-string: hsl(41, 37%, 38%);--sk-code-number: hsl(120, 100%, 25%);--sk-code-template-string: hsl(2, 80%, 47%);--sk-code-tags: var(--sk-code-function);--sk-code-important: var(--sk-code-string);--sk-code-diff-base: hsla(0, 0%, 0%, .6);--sk-code-diff-inserted: hsl(120, 100%, 25%);--sk-code-diff-removed: hsl(2, 80%, 47%);--sk-text-warning-hsl: 32, 95%, 44%;--sk-back-translucent: hsla(0, 0%, 0%, .1);--sk-text-translucent: hsla(0, 0%, 0%, .7);--toggle-dark: none;--toggle-light: block;--sdt-bg-main: #fff;--sdt-shadow-color: #ccc;--sdt-color: inherit;--sdt-clock-color: var(--sdt-color);--sdt-clock-color-hover: var(--sdt-color);--sdt-clock-time-bg: transparent;--sdt-clock-time-bg-hover: transparent;--sdt-clock-disabled: #b22222;--sdt-clock-disabled-bg: var(--sdt-bg-main);--sdt-header-color: #000;--sdt-bg-selected: #286090;--sdt-clock-selected-bg: var(--sdt-bg-selected);--sdt-table-disabled-date: #b22222;--sdt-table-disabled-date-bg: var(--sdt-bg-main);--sdt-table-data-bg-hover: #eee;--sdt-table-selected-bg: var(--sdt-bg-selected);--sdt-header-btn-bg-hover: #dfdfdf;--sdt-color-selected: #fff;--sdt-table-today-indicator: #ccc;--sdt-clock-bg: #eeeded;--sdt-today-bg: #1e486d;--sdt-today-color: #fff;--sdt-clear-color: #dc3545;--sdt-clear-bg: #fff;--sdt-clear-hover-color: #fff;--sdt-clear-hover-bg: #dc3545}}@media screen and (min-width: 480px){:root{--sk-page-padding-side: 3.2rem}}@media screen and (min-width: 768px){:root{--sk-text-xxl: 5.4rem;--sk-text-xl: 3.6rem;--sk-page-padding-top: 8rem;--sk-page-padding-side: 4.8rem}}@media screen and (prefers-color-scheme: light){:root{color-scheme:light;--sk-back-3-hsl: 206, 64%, 98%;--sk-back-1: hsl(0, 0%, 100%);--sk-back-2: hsl(0, 0%, 100%);--sk-back-3: hsl(var(--sk-back-3-hsl));--sk-back-4: hsl(206, 44%, 93%);--sk-back-5: hsl(206, 20%, 80%);--sk-theme-1-hsl: 15, 100%, 50%;--sk-theme-2-hsl: 240, 8%, 44%;--sk-theme-3-hsl: 204, 100%, 63%;--sk-text-1: hsl(0, 0%, 13%);--sk-text-2: hsl(0, 0%, 27%);--sk-text-3: var(--sk-theme-2);--sk-text-4: hsl(0, 0%, 65%);--sk-scrollbar: rgba(0, 0, 0, .3);--sk-theme-1-variant: hsl(202, 100%, 40%);--sk-theme-2-variant: hsl(240, 8%, 44%);--sk-theme-3-variant: hsl(204, 100%, 63%);--sk-code-bg: var(--sk-back-3);--sk-code-ts-bg: var(--sk-back-1);--sk-code-base: hsl(45, 7%, 35%);--sk-code-comment: hsl(0, 0%, 41%);--sk-code-keyword: hsl(204, 88%, 35%);--sk-code-function: hsl(19, 67%, 44%);--sk-code-string: hsl(41, 37%, 38%);--sk-code-number: hsl(120, 100%, 25%);--sk-code-template-string: hsl(2, 80%, 47%);--sk-code-tags: var(--sk-code-function);--sk-code-important: var(--sk-code-string);--sk-code-diff-base: hsla(0, 0%, 0%, .4);--sk-code-diff-inserted: hsl(120, 100%, 25%);--sk-code-diff-removed: hsl(2, 80%, 47%);--sk-text-warning-hsl: 32, 95%, 44%;--sk-back-translucent: hsla(0, 0%, 0%, .1);--sk-text-translucent: hsla(0, 0%, 0%, .7);--toggle-dark: none;--toggle-light: block;--sdt-bg-main: #fff;--sdt-shadow-color: #ccc;--sdt-color: inherit;--sdt-clock-color: var(--sdt-color);--sdt-clock-color-hover: var(--sdt-color);--sdt-clock-time-bg: transparent;--sdt-clock-time-bg-hover: transparent;--sdt-clock-disabled: #b22222;--sdt-clock-disabled-bg: var(--sdt-bg-main);--sdt-header-color: inherit;--sdt-bg-selected: #286090;--sdt-clock-selected-bg: var(--sdt-bg-selected);--sdt-table-disabled-date: #b22222;--sdt-table-disabled-date-bg: var(--sdt-bg-main);--sdt-table-data-bg-hover: #eee;--sdt-table-selected-bg: var(--sdt-bg-selected);--sdt-header-btn-bg-hover: #dfdfdf;--sdt-color-selected: #fff;--sdt-table-today-indicator: #ccc;--sdt-clock-bg: #eeeded;--sdt-today-bg: #1e486d;--sdt-today-color: #fff;--sdt-clear-color: #dc3545;--sdt-clear-bg: #fff;--sdt-clear-hover-color: #fff;--sdt-clear-hover-bg: #dc3545}html.dark{color-scheme:dark;--sk-back-1: hsl(0, 0%, 10%);--sk-back-2: hsl(0, 0%, 18%);--sk-back-3: hsl(var(--sk-back-3-hsl));--sk-back-4: hsl(0, 0%, 22%);--sk-back-5: hsl(0, 0%, 40%);--sk-back-translucent: hsla(0, 0%, 100%, .1);--sk-theme-1-hsl: 15, 100%, 55%;--sk-theme-2-hsl: 240, 8%, 44%;--sk-theme-3-hsl: 204, 100%, 63%;--sk-text-1: hsl(0, 0%, 90%);--sk-text-2: hsl(0, 0%, 80%);--sk-text-3: hsl(0, 0%, 65%);--sk-text-4: hsl(0, 0%, 45%);--sk-text-translucent: hsla(0, 0%, 100%, .9);--sk-scrollbar: rgba(255, 255, 255, .3);--sk-back-3-hsl: 0, 0%, 14%;--sk-theme-1-variant: hsl(202, 100%, 40%);--sk-theme-2-variant: hsl(240, 8%, 35%);--sk-theme-3-variant: hsl(204, 100%, 50%);--sk-text-warning-hsl: 32, 67%, 56%;--sk-code-ts-bg: var(--sk-back-2);--sk-code-bg: var(--sk-back-3);--sk-code-base: hsl(45, 7%, 75%);--sk-code-comment: hsl(0, 0%, 55%);--sk-code-keyword: hsl(204, 88%, 65%);--sk-code-function: hsl(19, 67%, 75%);--sk-code-string: hsl(41, 37%, 68%);--sk-code-number: hsl(120, 100%, 25%);--sk-code-template-string: hsl(2, 80%, 47%);--sk-code-tags: var(--sk-code-function);--sk-code-important: var(--sk-code-string);--sk-code-diff-base: hsla(0, 0%, 100%, .5);--sk-code-diff-inserted: hsl(120, 46%, 48%);--sk-code-diff-removed: hsl(2, 64%, 70%);--toggle-dark: block;--toggle-light: none;--sdt-bg-main: #585858;--sdt-shadow-color: #ccc;--sdt-color: #eee;--sdt-clock-color: var(--sdt-color);--sdt-clock-color-hover: var(--sdt-color);--sdt-clock-time-bg: transparent;--sdt-clock-time-bg-hover: transparent;--sdt-clock-disabled: #b22222;--sdt-clock-disabled-bg: var(--sdt-bg-main);--sdt-header-color: #eee;--sdt-bg-selected: #126cbb;--sdt-clock-selected-bg: var(--sdt-bg-selected);--sdt-table-disabled-date: #b22222;--sdt-table-disabled-date-bg: var(--sdt-bg-main);--sdt-table-data-bg-hover: #777;--sdt-table-selected-bg: var(--sdt-bg-selected);--sdt-header-btn-bg-hover: #777;--sdt-color-selected: #fff;--sdt-table-today-indicator: #ccc;--sdt-clock-bg: #999;--sdt-today-bg: #1e486d;--sdt-today-color: #fff;--sdt-clear-color: #666;--sdt-clear-bg: #ddd;--sdt-clear-hover-color: #fff;--sdt-clear-hover-bg: #dc3545}}.light-toggle{display:var(--toggle-light)}.dark-toggle{display:var(--toggle-dark)}@font-face{font-family:Overpass;font-style:normal;font-weight:300;src:local("Overpass Light "),local("Overpass-Light"),url(/svelty-picker/_app/immutable/assets/overpass-latin-300.3782c01a.woff2) format("woff2")}@font-face{font-family:Overpass;font-style:normal;font-weight:600;src:local("Overpass Bold "),local("Overpass-Bold"),url(/svelty-picker/_app/immutable/assets/overpass-latin-600.0ca25556.woff2) format("woff2")}@font-face{font-family:Fira Mono;font-style:normal;font-weight:400;src:local("Fira Mono Regular "),local("Fira Mono-Regular"),url(/svelty-picker/_app/immutable/assets/fira-mono-latin-400.8d4e0c52.woff2) format("woff2")}html{font-size:62.5%;-webkit-text-size-adjust:100%;-ms-overflow-style:-ms-autohiding-scrollbar;box-sizing:border-box;border-collapse:collapse}body{font-size:1.6rem;font-family:var(--sk-font);line-height:1.618;color:var(--sk-text-2);background-color:var(--sk-back-1);width:100%;-o-tab-size:2;tab-size:2;-moz-tab-size:2}*{box-sizing:inherit;margin:0;padding:0;scrollbar-width:thin;scrollbar-color:var(--sk-scrollbar) transparent;-webkit-overflow-scrolling:touch}*:focus-visible{outline:2px solid hsla(var(--sk-theme-1-hsl),.6);transition:.1s ease}p,ul,ol{margin:1em 0}a{position:relative;text-decoration:none;cursor:pointer;color:inherit}a:hover{text-decoration:underline}h6{font-size:var(--sk-text-xs)}h5,h4{font-size:var(--sk-text-s)}h3{font-size:var(--sk-text-m)}h2{font-size:var(--sk-text-l)}h1{font-size:var(--sk-text-xxl)}h1,h2,h3,h4,h5,h6{position:relative;font-weight:400;line-height:1.35;color:var(--sk-text-1)}strong{font-weight:600}code,kbd{font-size:var(--sk-text-xs);font-family:var(--sk-font-mono);line-height:1.7}code{position:relative;border-radius:.3em;white-space:nowrap;color:var(--sk-text-2);-webkit-font-smoothing:initial;padding:.4rem;margin:0 .2rem;top:-.1rem;background:var(--sk-back-4)}pre{overflow-x:auto}pre code{white-space:inherit;background-color:transparent;padding:0;margin:0;top:0;background:transparent}::-moz-selection{background:var(--sk-selection-color)}::selection{background:var(--sk-selection-color)}blockquote{position:relative;margin:1.6rem 0 2.4rem;padding:2rem 2.4rem 1.8rem;max-width:var(--sk-line-max-width)}blockquote p,blockquote ul{font-size:var(--sk-text-s)}blockquote :last-child{margin:0}button{font-family:inherit;font-size:inherit;background-color:transparent;border:none;color:currentColor;cursor:pointer}button[disabled]{opacity:.55;pointer-events:none}button>svg{position:relative;top:-.1rem;width:2rem!important;height:2rem!important;stroke:currentColor!important}a{position:relative;padding:0 0 1px;color:var(--sk-theme-1);color:color-mix(in hwb,var(--sk-theme-1) 100%,var(--sk-text-1) 25%)}table{width:100%;font-size:var(--sk-text-s)}td,th{text-align:left;border-bottom:1px solid #eee;padding:.4rem .8rem .4rem 0}table code,table span{white-space:pre}figcaption,.post aside{max-width:none;margin:0 auto;padding:1.6rem 0 0 .8rem;font:1.2rem/1.6 var(--sk-font-mono)}.visually-hidden{border:0;clip:rect(0 0 0 0);height:auto;margin:0;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.text h2{margin-top:7rem;border-bottom:1px solid var(--sk-back-4)}.text h3{margin-top:5rem}.text p,.text ol,.text ul{margin:1em 0}.text section{max-width:var(--sk-line-max-width);padding:0 0 0 1rem}.text section h2,.text section h3,.text section h4{margin-left:-1rem}.text code{padding:.2rem .4rem;margin:0 .2rem;top:-.1rem;background:var(--sk-back-4)}.text .code-block{position:relative}.text pre{margin:1em 0;width:100%;padding:1rem;box-shadow:inset 1px 1px 6px #1d56800f;box-sizing:border-box;background-color:var(--sk-code-bg);color:var(--sk-code-base);border-radius:var(--sk-border-radius);font-size:var(--sk-text-s);overflow-x:auto}.text pre code{padding:0;margin:0;top:0;background:transparent}.text p code{max-width:100%;display:inline-flex;overflow-x:auto;padding-top:0;padding-bottom:0}.text .code-block .filename{content:attr(data-file);display:block;width:100%;font-family:var(--sk-font-mono);font-size:1.2rem;font-weight:400;padding:1rem 1rem .8rem;color:var(--sk-text-2);background:var(--sk-back-4);border-radius:var(--sk-border-radius) var(--sk-border-radius) 0 0;box-sizing:border-box}.text .code-block pre{margin-top:0;border-radius:0 0 var(--sk-border-radius) var(--sk-border-radius)}.text a:where(:not(.permalink)){--color: hsla(var(--primary-hsl, var(--sk-theme-1-hsl)));color:var(--color);box-shadow:inset 0 -1px 0 0 var(--color);transition:box-shadow .1s ease-in-out}.text a:where(:not(.permalink)):hover{text-decoration:none;box-shadow:inset 0 -2px 0 0 var(--color)}.text a:where(:not(.permalink)) code{all:unset!important;color:inherit;background-color:transparent!important}.text pre a:hover{border-bottom:1px solid var(--sk-theme-1);text-decoration:none!important}.text pre.border{border-left:5px solid var(--sk-theme-2)}.text pre.language-diff code{color:var(--sk-code-diff-base)}.language-diff .inserted,.language-diff .deleted{position:relative}.language-diff .inserted{color:var(--sk-code-diff-inserted)}.language-diff .deleted{color:var(--sk-code-diff-removed);-webkit-user-select:none;-moz-user-select:none;user-select:none}.language-diff .inserted:before,.language-diff .deleted:before{position:absolute;left:-.6rem;top:-.2rem;font-size:1.2rem}.language-diff .inserted:before{content:"+"}.language-diff .deleted:before{content:"-"}.token.comment.wrapped{display:block;white-space:pre-wrap;padding-left:calc(var(--indent) + 2ch);text-indent:calc(-1 * var(--indent) - 2ch);min-height:1.35em}.api-section{background:var(--sk-back-4);padding:1rem;margin-bottom:1rem;max-width:var(--sk-line-max-width);border-radius:var(--sk-border-radius)}.ts-block{margin:1em 0;max-width:var(--sk-line-max-width);background:var(--sk-code-ts-bg);border-radius:var(--sk-border-radius);filter:drop-shadow(2px 2px 8px rgba(0,0,0,.08));overflow:hidden}.ts-block>pre{--shiki-color-background: var(--sk-code-ts-bg);margin:0;border-radius:0;box-shadow:none;background:var(--sk-code-ts-bg)}.ts-block .ts-block-property p,.ts-block-property pre{margin:1rem 0}.ts-block-property>pre{margin:0;padding-left:1rem;border-radius:0;box-shadow:none;border-top:1px solid var(--sk-back-4)}.ts-block-property-details{padding:0 1rem 0 2rem}.ts-block-property-details blockquote{margin:1rem 0}.ts-block-property-children{margin:0rem -1rem 0rem 1rem}.ts-block-property-bullets .tag{font-size:1.4rem;text-transform:uppercase;color:#666}.ts-block-property ul:last-child{margin-bottom:0}.text [id]{scroll-margin-top:calc(var(--sk-nav-height) + 4rem)}.text a.permalink{position:absolute!important;display:block;background:url(../icons/link.svg) 0 50% no-repeat;background-size:1em 1em;width:1.4em;height:1em;left:-1.3em;opacity:0;transition:opacity .2s;bottom:.25em}@media (min-width: 768px){.text a.permalink:focus,.text h2:hover a.permalink,.text h3:hover a.permalink,.text h4:hover a.permalink,.text h5:hover a.permalink,.text h6:hover a.permalink{opacity:1}}@media (max-width: 768px){.text a.permalink{transform:scale(.6);opacity:1;left:-1em}}.text ol,.text ul{--list-padding: 3rem;margin-left:var(--list-padding)}.text ul{list-style:none}.text ol{list-style:decimal}.text li{position:relative;max-width:calc(var(--sk-line-max-width) - var(--list-padding));line-height:1.5;margin:0 0 .5em}.text ul li:before{content:"";position:absolute;margin-top:.8rem;margin-left:-1.8rem;background-color:var(--sk-back-5);width:.6rem;height:.6rem;border-radius:2px;opacity:.7}.text table{margin:1em 0}.text small{font-size:var(--sk-text-s);float:right;pointer-events:all;color:var(--sk-theme-1);cursor:pointer}.text blockquote{--primary-hsl: var(--sk-theme-1-hsl);background-color:hsla(var(--primary-hsl),.02);color:var(--sk-text-1);border:1px solid hsl(var(--primary-hsl));border-radius:var(--sk-border-radius);padding:1rem;filter:drop-shadow(2px 2px 6px hsla(var(--primary-hsl),.2))}.text blockquote:before{content:"note";display:block;font-size:1.2rem;font-weight:600;text-transform:uppercase;color:hsl(var(--primary-hsl));margin-bottom:.5rem}.text blockquote :first-child{margin-top:0}.text blockquote :last-child{margin-bottom:0}.text blockquote.deprecated{--primary-hsl: var(--sk-text-warning-hsl)}.text blockquote.deprecated:before{content:"Deprecated"}.text section a:hover{text-decoration:underline}.text section a code{color:inherit;background:rgba(255,62,0,.1)!important}.text ul ul{margin-bottom:0}body{--shiki-color-text: var(--sk-code-base);--shiki-color-background: var(--sk-back-3);--shiki-token-constant: var(--sk-code-base);--shiki-token-string: var(--sk-code-string);--shiki-token-comment: var(--sk-code-comment);--shiki-token-keyword: var(--sk-code-keyword);--shiki-token-parameter: var(--sk-code-base);--shiki-token-function: var(--sk-code-function);--shiki-token-string-expression: var(--sk-code-string);--shiki-token-punctuation: var(--sk-code-base);--shiki-token-link: var(--sk-code-keyword)}.token{color:var(--sk-code-base)}.token.tag,.token.attr-value .attr-equals{color:var(--sk-code-function)}.token.string,.token.interpolation-punctuation,.token.attr-value,.token.inserted{color:var(--sk-code-string)}.token.builtin,.token.function{color:var(--sk-code-function)}.token.keyword,.token.boolean{color:var(--sk-code-keyword)}.token.comment{color:var(--sk-code-comment)}.token.deleted{color:#fc9b9b}.token.template-string .interpolation-punctuation,.token.template-string .string{color:var(--sk-code-template-string)}.language-id,pre.twoslash .error,pre.twoslash .error-behind{display:none}pre.twoslash data-lsp{transition:border-color .3s;border-bottom:1px dotted transparent}pre.twoslash:hover data-lsp{border-color:var(--sk-back-5)}.flex{display:flex;gap:16px}.inline-flex{display:inline-flex;gap:8px}.items-center{align-items:center}.toc.svelte-1iuyc2v.svelte-1iuyc2v{padding-left:0}.toc.svelte-1iuyc2v li.svelte-1iuyc2v{display:block;line-height:1.2;margin:0 0 1em}div.svelte-1iuyc2v.svelte-1iuyc2v{display:flex;flex-direction:row;padding:.2rem 3rem;margin:0 -3rem}div.active.svelte-1iuyc2v.svelte-1iuyc2v{color:#fff;text-decoration:underline}a.svelte-1iuyc2v.svelte-1iuyc2v{display:flex;flex:1 1 auto;position:relative;color:var(--sk-text-2);border-bottom:none;font-size:1.6rem;align-items:center;justify-content:flex-start;padding:0}div.active.svelte-1iuyc2v a.svelte-1iuyc2v{color:orange}a.svelte-1iuyc2v.svelte-1iuyc2v:hover{color:var(--sk-text-1)}.svelte-progress-bar.svelte-1rjlpd{position:fixed;top:0;left:0;height:3px;transition:width .21s ease-in-out}.svelte-progress-bar-hiding.svelte-1rjlpd{transition:top .8s ease;top:-8px}.svelte-progress-bar-leader.svelte-1rjlpd{position:absolute;top:0;right:0;height:5px;width:100px;transform:rotate(2.5deg) translateY(-4px);box-shadow:0 0 8px}.theme-toggle.svelte-13r8zzi>svg.svelte-13r8zzi{width:32px;height:32px}aside.svelte-1tdygp0{padding:32px;background-color:var(--sk-back-1);transition:transform .3s ease-in-out,box-shadow .3s ease-in-out}aside.opened.svelte-1tdygp0{transform:translate(0)}@media screen and (max-width: 1023px){aside.svelte-1tdygp0{z-index:15;top:0;position:absolute;transform:translate(-100%);bottom:0;overflow-y:auto}aside.opened.svelte-1tdygp0{box-shadow:0 20px 20px #ccc}}main.svelte-1tdygp0{flex:1 1 0}.home-link.svelte-1tdygp0{font-size:24px;font-weight:700}.header.svelte-1tdygp0{padding:16px;justify-content:space-between;border-bottom:2px solid var(--sk-back-3)}.fullbody.svelte-1tdygp0{min-height:100vh;display:flex;flex-flow:column} +.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.z-10{z-index:10}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mt-2{margin-top:.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.w-full{width:100%}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto}.border-collapse{border-collapse:collapse}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.gap-10{gap:2.5rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.border{border-width:1px}.p-2{padding:.5rem}.p-4{padding:1rem}.text-center{text-align:center}.text-xl{font-size:1.25rem;line-height:1.75rem}.leading-4{line-height:1rem}.underline{text-decoration-line:underline}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}h1{font-size:var(--font-size-5);font-weight:var(--font-weight-bold);margin-bottom:var(--spacing-12)}h2{font-size:var(--font-size-4);font-weight:var(--font-weight-semibold)}body{margin:0;font-weight:var(--font-weight-normal);background-color:var(--colour-brand)}code{counter-reset:step;counter-increment:step 0}.shiki{border-radius:var(--spacing-1);padding:var(--spacing-6) var(--spacing-4);margin:var(--spacing-4) auto var(--spacing-18);box-shadow:var(--shadow-elevation-medium);overflow-x:auto;max-width:var(--max-width-full)}.highlight-line{display:inline-block;background-color:var(--colour-code-background-highlighted);width:calc(var(--max-width-full) + var(--spacing-4));border-left:var(--spacing-1) solid var(--colour-code-line-highlight);margin-left:calc(-1 * var(--spacing-1))}:root{--colour-brand: hsl(193 67% 34%);--colour-light: hsl(7 53% 97%);--colour-code-line-numbers: hsl(219 14% 71% / .8);--colour-code-line-highlight: hsl(34 96% 55%);--colour-code-background-hue: 220;--colour-code-background-saturation: 13%;--colour-code-background-lightness: 18%;--colour-code-background-highlighted: hsl( var(--colour-code-background-hue) var(--colour-code-background-saturation) calc(var(--colour-code-background-lightness) + 5%) );--spacing-px: 1px;--spacing-px-2: 2px;--spacing-0: 0;--spacing-1: .25rem;--spacing-2: .5rem;--spacing-4: 1rem;--spacing-6: 1.5rem;--spacing-12: 3rem;--spacing-18: 4.5rem;--max-width-wrapper: 48rem;--max-width-full: 100%;--font-size-root: 16px;--font-size-3: 1.563rem;--font-size-4: 1.953rem;--font-size-5: 2.441rem;--font-size-6: 3.052rem;--font-weight-normal: 400;--font-weight-semibold: 600;--font-weight-bold: 700;--line-height-normal: 1.5;--shadow-color: 194deg 84% 18%;--shadow-elevation-medium: -1px 1px 1.6px hsl(var(--shadow-color) / .36), -3.3px 3.3px 5.3px -.8px hsl(var(--shadow-color) / .36), -8.2px 8.2px 13px -1.7px hsl(var(--shadow-color) / .36), -20px 20px 31.8px -2.5px hsl(var(--shadow-color) / .36)}code .line:before{display:inline-block;content:counter(step);counter-increment:step;width:var(--spacing-6);margin-right:var(--spacing-6);text-align:right;font-variant-numeric:tabular-nums;color:var(--colour-line-numbers)}input{padding:6px;border-radius:4px}@media (min-width: 640px){.sm\:block{display:block}.sm\:inline{display:inline}}@media (min-width: 1024px){.lg\:hidden{display:none}.lg\:flex-none{flex:none}.lg\:p-10{padding:2.5rem}.lg\:text-left{text-align:left}}:root{--sk-back-h: 206;--sk-selection-color: hsla(204, 100%, 63%, .3);--sk-focus-outline: 0 0 0 2px hsla(var(--sk-theme-1-hsl), .6);--sk-theme-1: var(--sk-theme-1-hsl);--sk-theme-2: var(--sk-theme-2-hsl);--sk-theme-3: var(--sk-theme-3-hsl);--sk-text-warning: hsl(var(--sk-text-warning-hsl));--sk-nav-height: 6rem;--sk-page-padding-top: 6rem;--sk-page-padding-bottom: 6rem;--sk-page-padding-side: 2.4rem;--sk-thick-border-width: .3rem;--sk-border-radius: .4rem;--sk-page-main-width: 80rem;--sk-font: "Overpass", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--sk-font-mono: "Fira Mono", monospace;--sk-text-xxl: 3.6rem;--sk-text-xl: 3rem;--sk-text-l: 2.4rem;--sk-text-m: 2rem;--sk-text-s: 1.6rem;--sk-text-xs: 1.3rem;--sk-line-max-width: 84rem;--m: 10px}@media only screen and (prefers-color-scheme: dark){:root{color-scheme:dark;--sk-back-1: hsl(0, 0%, 10%);--sk-back-2: hsl(0, 0%, 18%);--sk-back-3: hsl(var(--sk-back-3-hsl));--sk-back-4: hsl(0, 0%, 22%);--sk-back-5: hsl(0, 0%, 40%);--sk-back-translucent: hsla(0, 0%, 100%, .1);--sk-theme-1-hsl: hsl(38.77deg 71.8% 58.64%);--sk-theme-2-hsl: 240, 8%, 44%;--sk-theme-3-hsl: 204, 100%, 63%;--sk-text-1: hsl(0, 0%, 90%);--sk-text-2: hsl(0, 0%, 80%);--sk-text-3: hsl(0, 0%, 65%);--sk-text-4: hsl(0, 0%, 45%);--sk-text-translucent: hsla(0, 0%, 100%, .9);--sk-scrollbar: rgba(255, 255, 255, .3);--sk-back-3-hsl: 0, 0%, 14%;--sk-theme-1-variant: hsl(202, 88%, 66%);--sk-theme-2-variant: hsl(240, 8%, 35%);--sk-theme-3-variant: hsl(204, 100%, 50%);--sk-text-warning-hsl: 32, 67%, 56%;--sk-code-ts-bg: var(--sk-back-2);--sk-code-bg: var(--sk-back-3);--sk-code-base: hsl(45, 7%, 75%);--sk-code-comment: hsl(0, 0%, 55%);--sk-code-keyword: hsl(204, 88%, 65%);--sk-code-function: hsl(19, 67%, 75%);--sk-code-string: hsl(41, 37%, 68%);--sk-code-number: hsl(120, 100%, 25%);--sk-code-template-string: hsl(2, 80%, 47%);--sk-code-tags: var(--sk-code-function);--sk-code-important: var(--sk-code-string);--sk-code-diff-base: hsla(0, 0%, 100%, .5);--sk-code-diff-inserted: hsl(120, 46%, 48%);--sk-code-diff-removed: hsl(2, 64%, 70%);--toggle-dark: block;--toggle-light: none;--sdt-bg-main: #585858;--sdt-shadow-color: #333;--sdt-color: #eee;--sdt-clock-color: var(--sdt-color);--sdt-clock-color-hover: var(--sdt-color);--sdt-clock-time-bg: transparent;--sdt-clock-time-bg-hover: transparent;--sdt-clock-disabled: #b22222;--sdt-clock-disabled-bg: var(--sdt-bg-main);--sdt-clock-selected-bg: var(--sdt-bg-selected);--sdt-header-color: #eee;--sdt-bg-selected: #e1ac4a;--sdt-table-disabled-date: #b22222;--sdt-table-disabled-date-bg: var(--sdt-bg-main);--sdt-table-data-bg-hover: #777;--sdt-table-selected-bg: var(--sdt-bg-selected);--sdt-header-btn-bg-hover: #777;--sdt-color-selected: #fff;--sdt-table-today-indicator: #ccc;--sdt-clock-bg: #999;--sdt-today-bg: #e4a124;--sdt-today-color: #fff;--sdt-clear-color: #666;--sdt-clear-bg: #ddd;--sdt-clear-hover-color: #fff;--sdt-clear-hover-bg: #dc3545}html.light{color-scheme:light;--sk-back-3-hsl: 206, 64%, 98%;--sk-back-1: hsl(0, 0%, 100%);--sk-back-2: hsl(0, 0%, 100%);--sk-back-3: hsl(var(--sk-back-3-hsl));--sk-back-4: hsl(206, 44%, 93%);--sk-back-5: hsl(206, 20%, 80%);--sk-theme-1-hsl: 15, 100%, 50%;--sk-theme-2-hsl: 240, 8%, 44%;--sk-theme-3-hsl: 204, 100%, 63%;--sk-text-1: hsl(0, 0%, 13%);--sk-text-2: hsl(0, 0%, 27%);--sk-text-3: var(--sk-theme-2);--sk-text-4: hsl(0, 0%, 65%);--sk-scrollbar: rgba(0, 0, 0, .3);--sk-theme-1-variant: hsl(202, 100%, 40%);--sk-theme-2-variant: hsl(240, 8%, 44%);--sk-theme-3-variant: hsl(204, 100%, 63%);--sk-code-bg: var(--sk-back-3);--sk-code-ts-bg: var(--sk-back-1);--sk-code-base: hsl(45, 7%, 35%);--sk-code-comment: hsl(0, 0%, 41%);--sk-code-keyword: hsl(204, 88%, 35%);--sk-code-function: hsl(19, 67%, 44%);--sk-code-string: hsl(41, 37%, 38%);--sk-code-number: hsl(120, 100%, 25%);--sk-code-template-string: hsl(2, 80%, 47%);--sk-code-tags: var(--sk-code-function);--sk-code-important: var(--sk-code-string);--sk-code-diff-base: hsla(0, 0%, 0%, .6);--sk-code-diff-inserted: hsl(120, 100%, 25%);--sk-code-diff-removed: hsl(2, 80%, 47%);--sk-text-warning-hsl: 32, 95%, 44%;--sk-back-translucent: hsla(0, 0%, 0%, .1);--sk-text-translucent: hsla(0, 0%, 0%, .7);--toggle-dark: none;--toggle-light: block;--sdt-bg-main: #fff;--sdt-shadow-color: #ccc;--sdt-color: inherit;--sdt-clock-color: var(--sdt-color);--sdt-clock-color-hover: var(--sdt-color);--sdt-clock-time-bg: transparent;--sdt-clock-time-bg-hover: transparent;--sdt-clock-disabled: #b22222;--sdt-clock-disabled-bg: var(--sdt-bg-main);--sdt-header-color: #000;--sdt-bg-selected: #286090;--sdt-clock-selected-bg: var(--sdt-bg-selected);--sdt-table-disabled-date: #b22222;--sdt-table-disabled-date-bg: var(--sdt-bg-main);--sdt-table-data-bg-hover: #eee;--sdt-table-selected-bg: var(--sdt-bg-selected);--sdt-header-btn-bg-hover: #dfdfdf;--sdt-color-selected: #fff;--sdt-table-today-indicator: #ccc;--sdt-clock-bg: #eeeded;--sdt-today-bg: #1e486d;--sdt-today-color: #fff;--sdt-clear-color: #dc3545;--sdt-clear-bg: #fff;--sdt-clear-hover-color: #fff;--sdt-clear-hover-bg: #dc3545}}@media screen and (min-width: 480px){:root{--sk-page-padding-side: 3.2rem}}@media screen and (min-width: 768px){:root{--sk-text-xxl: 5.4rem;--sk-text-xl: 3.6rem;--sk-page-padding-top: 8rem;--sk-page-padding-side: 4.8rem}}@media screen and (prefers-color-scheme: light){:root{color-scheme:light;--sk-back-3-hsl: 206, 64%, 98%;--sk-back-1: hsl(0, 0%, 100%);--sk-back-2: hsl(0, 0%, 100%);--sk-back-3: hsl(var(--sk-back-3-hsl));--sk-back-4: hsl(206, 44%, 93%);--sk-back-5: hsl(206, 20%, 80%);--sk-theme-1-hsl: 15, 100%, 50%;--sk-theme-2-hsl: 240, 8%, 44%;--sk-theme-3-hsl: 204, 100%, 63%;--sk-text-1: hsl(0, 0%, 13%);--sk-text-2: hsl(0, 0%, 27%);--sk-text-3: var(--sk-theme-2);--sk-text-4: hsl(0, 0%, 65%);--sk-scrollbar: rgba(0, 0, 0, .3);--sk-theme-1-variant: hsl(202, 100%, 40%);--sk-theme-2-variant: hsl(240, 8%, 44%);--sk-theme-3-variant: hsl(204, 100%, 63%);--sk-code-bg: var(--sk-back-3);--sk-code-ts-bg: var(--sk-back-1);--sk-code-base: hsl(45, 7%, 35%);--sk-code-comment: hsl(0, 0%, 41%);--sk-code-keyword: hsl(204, 88%, 35%);--sk-code-function: hsl(19, 67%, 44%);--sk-code-string: hsl(41, 37%, 38%);--sk-code-number: hsl(120, 100%, 25%);--sk-code-template-string: hsl(2, 80%, 47%);--sk-code-tags: var(--sk-code-function);--sk-code-important: var(--sk-code-string);--sk-code-diff-base: hsla(0, 0%, 0%, .4);--sk-code-diff-inserted: hsl(120, 100%, 25%);--sk-code-diff-removed: hsl(2, 80%, 47%);--sk-text-warning-hsl: 32, 95%, 44%;--sk-back-translucent: hsla(0, 0%, 0%, .1);--sk-text-translucent: hsla(0, 0%, 0%, .7);--toggle-dark: none;--toggle-light: block;--sdt-bg-main: #fff;--sdt-shadow-color: #ccc;--sdt-color: inherit;--sdt-clock-color: var(--sdt-color);--sdt-clock-color-hover: var(--sdt-color);--sdt-clock-time-bg: transparent;--sdt-clock-time-bg-hover: transparent;--sdt-clock-disabled: #b22222;--sdt-clock-disabled-bg: var(--sdt-bg-main);--sdt-header-color: inherit;--sdt-bg-selected: #286090;--sdt-clock-selected-bg: var(--sdt-bg-selected);--sdt-table-disabled-date: #b22222;--sdt-table-disabled-date-bg: var(--sdt-bg-main);--sdt-table-data-bg-hover: #eee;--sdt-table-selected-bg: var(--sdt-bg-selected);--sdt-header-btn-bg-hover: #dfdfdf;--sdt-color-selected: #fff;--sdt-table-today-indicator: #ccc;--sdt-clock-bg: #eeeded;--sdt-today-bg: #1e486d;--sdt-today-color: #fff;--sdt-clear-color: #dc3545;--sdt-clear-bg: #fff;--sdt-clear-hover-color: #fff;--sdt-clear-hover-bg: #dc3545}html.dark{color-scheme:dark;--sk-back-1: hsl(0, 0%, 10%);--sk-back-2: hsl(0, 0%, 18%);--sk-back-3: hsl(var(--sk-back-3-hsl));--sk-back-4: hsl(0, 0%, 22%);--sk-back-5: hsl(0, 0%, 40%);--sk-back-translucent: hsla(0, 0%, 100%, .1);--sk-theme-1-hsl: 15, 100%, 55%;--sk-theme-2-hsl: 240, 8%, 44%;--sk-theme-3-hsl: 204, 100%, 63%;--sk-text-1: hsl(0, 0%, 90%);--sk-text-2: hsl(0, 0%, 80%);--sk-text-3: hsl(0, 0%, 65%);--sk-text-4: hsl(0, 0%, 45%);--sk-text-translucent: hsla(0, 0%, 100%, .9);--sk-scrollbar: rgba(255, 255, 255, .3);--sk-back-3-hsl: 0, 0%, 14%;--sk-theme-1-variant: hsl(202, 100%, 40%);--sk-theme-2-variant: hsl(240, 8%, 35%);--sk-theme-3-variant: hsl(204, 100%, 50%);--sk-text-warning-hsl: 32, 67%, 56%;--sk-code-ts-bg: var(--sk-back-2);--sk-code-bg: var(--sk-back-3);--sk-code-base: hsl(45, 7%, 75%);--sk-code-comment: hsl(0, 0%, 55%);--sk-code-keyword: hsl(204, 88%, 65%);--sk-code-function: hsl(19, 67%, 75%);--sk-code-string: hsl(41, 37%, 68%);--sk-code-number: hsl(120, 100%, 25%);--sk-code-template-string: hsl(2, 80%, 47%);--sk-code-tags: var(--sk-code-function);--sk-code-important: var(--sk-code-string);--sk-code-diff-base: hsla(0, 0%, 100%, .5);--sk-code-diff-inserted: hsl(120, 46%, 48%);--sk-code-diff-removed: hsl(2, 64%, 70%);--toggle-dark: block;--toggle-light: none;--sdt-bg-main: #585858;--sdt-shadow-color: #ccc;--sdt-color: #eee;--sdt-clock-color: var(--sdt-color);--sdt-clock-color-hover: var(--sdt-color);--sdt-clock-time-bg: transparent;--sdt-clock-time-bg-hover: transparent;--sdt-clock-disabled: #b22222;--sdt-clock-disabled-bg: var(--sdt-bg-main);--sdt-header-color: #eee;--sdt-bg-selected: #126cbb;--sdt-clock-selected-bg: var(--sdt-bg-selected);--sdt-table-disabled-date: #b22222;--sdt-table-disabled-date-bg: var(--sdt-bg-main);--sdt-table-data-bg-hover: #777;--sdt-table-selected-bg: var(--sdt-bg-selected);--sdt-header-btn-bg-hover: #777;--sdt-color-selected: #fff;--sdt-table-today-indicator: #ccc;--sdt-clock-bg: #999;--sdt-today-bg: #1e486d;--sdt-today-color: #fff;--sdt-clear-color: #666;--sdt-clear-bg: #ddd;--sdt-clear-hover-color: #fff;--sdt-clear-hover-bg: #dc3545}}.light-toggle{display:var(--toggle-light)}.dark-toggle{display:var(--toggle-dark)}@font-face{font-family:Overpass;font-style:normal;font-weight:300;src:local("Overpass Light "),local("Overpass-Light"),url(./overpass-latin-300.3782c01a.woff2) format("woff2")}@font-face{font-family:Overpass;font-style:normal;font-weight:600;src:local("Overpass Bold "),local("Overpass-Bold"),url(./overpass-latin-600.0ca25556.woff2) format("woff2")}@font-face{font-family:Fira Mono;font-style:normal;font-weight:400;src:local("Fira Mono Regular "),local("Fira Mono-Regular"),url(./fira-mono-latin-400.8d4e0c52.woff2) format("woff2")}html{font-size:62.5%;-webkit-text-size-adjust:100%;-ms-overflow-style:-ms-autohiding-scrollbar;box-sizing:border-box;border-collapse:collapse}body{font-size:1.6rem;font-family:var(--sk-font);line-height:1.618;color:var(--sk-text-2);background-color:var(--sk-back-1);width:100%;-o-tab-size:2;tab-size:2;-moz-tab-size:2}*{box-sizing:inherit;margin:0;padding:0;scrollbar-width:thin;scrollbar-color:var(--sk-scrollbar) transparent;-webkit-overflow-scrolling:touch}*:focus-visible{outline:2px solid hsla(var(--sk-theme-1-hsl),.6);transition:.1s ease}p,ul,ol{margin:1em 0}a{position:relative;text-decoration:none;cursor:pointer;color:inherit}a:hover{text-decoration:underline}h6{font-size:var(--sk-text-xs)}h5,h4{font-size:var(--sk-text-s)}h3{font-size:var(--sk-text-m)}h2{font-size:var(--sk-text-l)}h1{font-size:var(--sk-text-xxl)}h1,h2,h3,h4,h5,h6{position:relative;font-weight:400;line-height:1.35;color:var(--sk-text-1)}strong{font-weight:600}code,kbd{font-size:var(--sk-text-xs);font-family:var(--sk-font-mono);line-height:1.7}code{position:relative;border-radius:.3em;white-space:nowrap;color:var(--sk-text-2);-webkit-font-smoothing:initial;padding:.4rem;margin:0 .2rem;top:-.1rem;background:var(--sk-back-4)}pre{overflow-x:auto}pre code{white-space:inherit;background-color:transparent;padding:0;margin:0;top:0;background:transparent}::-moz-selection{background:var(--sk-selection-color)}::selection{background:var(--sk-selection-color)}blockquote{position:relative;margin:1.6rem 0 2.4rem;padding:2rem 2.4rem 1.8rem;max-width:var(--sk-line-max-width)}blockquote p,blockquote ul{font-size:var(--sk-text-s)}blockquote :last-child{margin:0}button{font-family:inherit;font-size:inherit;background-color:transparent;border:none;color:currentColor;cursor:pointer}button[disabled]{opacity:.55;pointer-events:none}button>svg{position:relative;top:-.1rem;width:2rem!important;height:2rem!important;stroke:currentColor!important}a{position:relative;padding:0 0 1px;color:var(--sk-theme-1);color:color-mix(in hwb,var(--sk-theme-1) 100%,var(--sk-text-1) 25%)}table{width:100%;font-size:var(--sk-text-s)}td,th{text-align:left;border-bottom:1px solid #eee;padding:.4rem .8rem .4rem 0}table code,table span{white-space:pre}figcaption,.post aside{max-width:none;margin:0 auto;padding:1.6rem 0 0 .8rem;font:1.2rem/1.6 var(--sk-font-mono)}.visually-hidden{border:0;clip:rect(0 0 0 0);height:auto;margin:0;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.text h2{margin-top:7rem;border-bottom:1px solid var(--sk-back-4)}.text h3{margin-top:5rem}.text p,.text ol,.text ul{margin:1em 0}.text section{max-width:var(--sk-line-max-width);padding:0 0 0 1rem}.text section h2,.text section h3,.text section h4{margin-left:-1rem}.text code{padding:.2rem .4rem;margin:0 .2rem;top:-.1rem;background:var(--sk-back-4)}.text .code-block{position:relative}.text pre{margin:1em 0;width:100%;padding:1rem;box-shadow:inset 1px 1px 6px #1d56800f;box-sizing:border-box;background-color:var(--sk-code-bg);color:var(--sk-code-base);border-radius:var(--sk-border-radius);font-size:var(--sk-text-s);overflow-x:auto}.text pre code{padding:0;margin:0;top:0;background:transparent}.text p code{max-width:100%;display:inline-flex;overflow-x:auto;padding-top:0;padding-bottom:0}.text .code-block .filename{content:attr(data-file);display:block;width:100%;font-family:var(--sk-font-mono);font-size:1.2rem;font-weight:400;padding:1rem 1rem .8rem;color:var(--sk-text-2);background:var(--sk-back-4);border-radius:var(--sk-border-radius) var(--sk-border-radius) 0 0;box-sizing:border-box}.text .code-block pre{margin-top:0;border-radius:0 0 var(--sk-border-radius) var(--sk-border-radius)}.text a:where(:not(.permalink)){--color: hsla(var(--primary-hsl, var(--sk-theme-1-hsl)));color:var(--color);box-shadow:inset 0 -1px 0 0 var(--color);transition:box-shadow .1s ease-in-out}.text a:where(:not(.permalink)):hover{text-decoration:none;box-shadow:inset 0 -2px 0 0 var(--color)}.text a:where(:not(.permalink)) code{all:unset!important;color:inherit;background-color:transparent!important}.text pre a:hover{border-bottom:1px solid var(--sk-theme-1);text-decoration:none!important}.text pre.border{border-left:5px solid var(--sk-theme-2)}.text pre.language-diff code{color:var(--sk-code-diff-base)}.language-diff .inserted,.language-diff .deleted{position:relative}.language-diff .inserted{color:var(--sk-code-diff-inserted)}.language-diff .deleted{color:var(--sk-code-diff-removed);-webkit-user-select:none;-moz-user-select:none;user-select:none}.language-diff .inserted:before,.language-diff .deleted:before{position:absolute;left:-.6rem;top:-.2rem;font-size:1.2rem}.language-diff .inserted:before{content:"+"}.language-diff .deleted:before{content:"-"}.token.comment.wrapped{display:block;white-space:pre-wrap;padding-left:calc(var(--indent) + 2ch);text-indent:calc(-1 * var(--indent) - 2ch);min-height:1.35em}.api-section{background:var(--sk-back-4);padding:1rem;margin-bottom:1rem;max-width:var(--sk-line-max-width);border-radius:var(--sk-border-radius)}.ts-block{margin:1em 0;max-width:var(--sk-line-max-width);background:var(--sk-code-ts-bg);border-radius:var(--sk-border-radius);filter:drop-shadow(2px 2px 8px rgba(0,0,0,.08));overflow:hidden}.ts-block>pre{--shiki-color-background: var(--sk-code-ts-bg);margin:0;border-radius:0;box-shadow:none;background:var(--sk-code-ts-bg)}.ts-block .ts-block-property p,.ts-block-property pre{margin:1rem 0}.ts-block-property>pre{margin:0;padding-left:1rem;border-radius:0;box-shadow:none;border-top:1px solid var(--sk-back-4)}.ts-block-property-details{padding:0 1rem 0 2rem}.ts-block-property-details blockquote{margin:1rem 0}.ts-block-property-children{margin:0rem -1rem 0rem 1rem}.ts-block-property-bullets .tag{font-size:1.4rem;text-transform:uppercase;color:#666}.ts-block-property ul:last-child{margin-bottom:0}.text [id]{scroll-margin-top:calc(var(--sk-nav-height) + 4rem)}.text a.permalink{position:absolute!important;display:block;background:url(../icons/link.svg) 0 50% no-repeat;background-size:1em 1em;width:1.4em;height:1em;left:-1.3em;opacity:0;transition:opacity .2s;bottom:.25em}@media (min-width: 768px){.text a.permalink:focus,.text h2:hover a.permalink,.text h3:hover a.permalink,.text h4:hover a.permalink,.text h5:hover a.permalink,.text h6:hover a.permalink{opacity:1}}@media (max-width: 768px){.text a.permalink{transform:scale(.6);opacity:1;left:-1em}}.text ol,.text ul{--list-padding: 3rem;margin-left:var(--list-padding)}.text ul{list-style:none}.text ol{list-style:decimal}.text li{position:relative;max-width:calc(var(--sk-line-max-width) - var(--list-padding));line-height:1.5;margin:0 0 .5em}.text ul li:before{content:"";position:absolute;margin-top:.8rem;margin-left:-1.8rem;background-color:var(--sk-back-5);width:.6rem;height:.6rem;border-radius:2px;opacity:.7}.text table{margin:1em 0}.text small{font-size:var(--sk-text-s);float:right;pointer-events:all;color:var(--sk-theme-1);cursor:pointer}.text blockquote{--primary-hsl: var(--sk-theme-1-hsl);background-color:hsla(var(--primary-hsl),.02);color:var(--sk-text-1);border:1px solid hsl(var(--primary-hsl));border-radius:var(--sk-border-radius);padding:1rem;filter:drop-shadow(2px 2px 6px hsla(var(--primary-hsl),.2))}.text blockquote:before{content:"note";display:block;font-size:1.2rem;font-weight:600;text-transform:uppercase;color:hsl(var(--primary-hsl));margin-bottom:.5rem}.text blockquote :first-child{margin-top:0}.text blockquote :last-child{margin-bottom:0}.text blockquote.deprecated{--primary-hsl: var(--sk-text-warning-hsl)}.text blockquote.deprecated:before{content:"Deprecated"}.text section a:hover{text-decoration:underline}.text section a code{color:inherit;background:rgba(255,62,0,.1)!important}.text ul ul{margin-bottom:0}body{--shiki-color-text: var(--sk-code-base);--shiki-color-background: var(--sk-back-3);--shiki-token-constant: var(--sk-code-base);--shiki-token-string: var(--sk-code-string);--shiki-token-comment: var(--sk-code-comment);--shiki-token-keyword: var(--sk-code-keyword);--shiki-token-parameter: var(--sk-code-base);--shiki-token-function: var(--sk-code-function);--shiki-token-string-expression: var(--sk-code-string);--shiki-token-punctuation: var(--sk-code-base);--shiki-token-link: var(--sk-code-keyword)}.token{color:var(--sk-code-base)}.token.tag,.token.attr-value .attr-equals{color:var(--sk-code-function)}.token.string,.token.interpolation-punctuation,.token.attr-value,.token.inserted{color:var(--sk-code-string)}.token.builtin,.token.function{color:var(--sk-code-function)}.token.keyword,.token.boolean{color:var(--sk-code-keyword)}.token.comment{color:var(--sk-code-comment)}.token.deleted{color:#fc9b9b}.token.template-string .interpolation-punctuation,.token.template-string .string{color:var(--sk-code-template-string)}.language-id,pre.twoslash .error,pre.twoslash .error-behind{display:none}pre.twoslash data-lsp{transition:border-color .3s;border-bottom:1px dotted transparent}pre.twoslash:hover data-lsp{border-color:var(--sk-back-5)}.flex{display:flex;gap:16px}.inline-flex{display:inline-flex;gap:8px}.items-center{align-items:center}.toc.svelte-1iuyc2v.svelte-1iuyc2v{padding-left:0}.toc.svelte-1iuyc2v li.svelte-1iuyc2v{display:block;line-height:1.2;margin:0 0 1em}div.svelte-1iuyc2v.svelte-1iuyc2v{display:flex;flex-direction:row;padding:.2rem 3rem;margin:0 -3rem}div.active.svelte-1iuyc2v.svelte-1iuyc2v{color:#fff;text-decoration:underline}a.svelte-1iuyc2v.svelte-1iuyc2v{display:flex;flex:1 1 auto;position:relative;color:var(--sk-text-2);border-bottom:none;font-size:1.6rem;align-items:center;justify-content:flex-start;padding:0}div.active.svelte-1iuyc2v a.svelte-1iuyc2v{color:orange}a.svelte-1iuyc2v.svelte-1iuyc2v:hover{color:var(--sk-text-1)}.svelte-progress-bar.svelte-1rjlpd{position:fixed;top:0;left:0;height:3px;transition:width .21s ease-in-out}.svelte-progress-bar-hiding.svelte-1rjlpd{transition:top .8s ease;top:-8px}.svelte-progress-bar-leader.svelte-1rjlpd{position:absolute;top:0;right:0;height:5px;width:100px;transform:rotate(2.5deg) translateY(-4px);box-shadow:0 0 8px}.theme-toggle.svelte-13r8zzi>svg.svelte-13r8zzi{width:32px;height:32px}aside.svelte-1tdygp0{padding:32px;background-color:var(--sk-back-1);transition:transform .3s ease-in-out,box-shadow .3s ease-in-out}aside.opened.svelte-1tdygp0{transform:translate(0)}@media screen and (max-width: 1023px){aside.svelte-1tdygp0{z-index:15;top:0;position:absolute;transform:translate(-100%);bottom:0;overflow-y:auto}aside.opened.svelte-1tdygp0{box-shadow:0 20px 20px #ccc}}main.svelte-1tdygp0{flex:1 1 0}.home-link.svelte-1tdygp0{font-size:24px;font-weight:700}.header.svelte-1tdygp0{padding:16px;justify-content:space-between;border-bottom:2px solid var(--sk-back-3)}.fullbody.svelte-1tdygp0{min-height:100vh;display:flex;flex-flow:column} diff --git a/docs/_app/immutable/chunks/4.a8c4ad61.js b/docs/_app/immutable/chunks/4.a8c4ad61.js new file mode 100644 index 0000000..357eb6b --- /dev/null +++ b/docs/_app/immutable/chunks/4.a8c4ad61.js @@ -0,0 +1,391 @@ +var jp=Object.defineProperty;var Vp=(s,e,t)=>e in s?jp(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var qe=(s,e,t)=>(Vp(s,typeof e!="symbol"?e+"":e,t),t),Hp=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)};var ol=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)};var Ns=(s,e,t)=>(Hp(s,e,"access private method"),t);import{a as Fp,d as Wp,s as qp}from"./data.2bee4aae.js";import{s as be,f as x,g as A,h as P,d as _,j as k,i as S,r as de,u as _t,l as I,a as Q,m as z,c as ee,v as ie,w as y,y as ue,n as re,C as Tt,e as ce,k as it,J as Dr,K as Eo,E as Et,F as Ot,G as Dt,L as Pr,M as Uf,p as Ye,H as Kf,z as Oo,A as Me,x as Te,N as Pn,D as Nr,O as pa,B as Ve,t as as,P as ri,Q as Jf,R as ln,S as ma,T as Gf,o as Do,U as cr,q as ga,V as Up,W as ba}from"./scheduler.8d4e2d99.js";import{S as _e,i as ke,a as w,t as T,g as Se,c as xe,f as _a,b as U,d as G,m as K,e as J,h as on,n as ka,l as Kp}from"./index.e9e8ac0c.js";import{M as Jp,f as Gp}from"./Markdown.6d2b36a1.js";import{n as Yp}from"./stores.d3d5ea2d.js";import{e as Oe,u as Xp,d as Zp}from"./each.5f097185.js";import{w as ot,r as Qp,k as em}from"./singletons.957017c7.js";import{_ as Mn}from"./preload-helper.a4192956.js";import{s as va}from"./index.9ff153fe.js";function ya(s,e){const t={},n={},i={$$scope:1};let r=s.length;for(;r--;){const l=s[r],o=e[r];if(o){for(const a in l)a in o||(n[a]=1);for(const a in o)i[a]||(t[a]=o[a],i[a]=1);s[r]=o}else for(const a in l)i[a]=1}for(const l in n)l in t||(t[l]=void 0);return t}function wa(s){return typeof s=="object"&&s!==null?s:{}}async function tm({params:s}){const e=Fp(Wp,s.slug);return{title:e.title,slug:s.slug,repl:e.files}}const lS=Object.freeze(Object.defineProperty({__proto__:null,load:tm},Symbol.toStringTag,{value:"Module"}));function Sa(s,e,t){const n=s.slice();return n[3]=e[t],n[5]=t,n}function xa(s){let e,t=s[3]+"",n,i,r,l;function o(){return s[2](s[5])}return{c(){e=x("button"),n=I(t),i=Q(),this.h()},l(a){e=A(a,"BUTTON",{class:!0});var h=P(e);n=z(h,t),i=ee(h),h.forEach(_),this.h()},h(){k(e,"class","svelte-o6j61a"),ie(e,"selected",s[0]===s[5])},m(a,h){S(a,e,h),y(e,n),y(e,i),r||(l=ue(e,"click",o),r=!0)},p(a,h){s=a,h&2&&t!==(t=s[3]+"")&&re(n,t),h&1&&ie(e,"selected",s[0]===s[5])},d(a){a&&_(e),r=!1,l()}}}function nm(s){let e,t=Oe(s[1]),n=[];for(let i=0;it(0,i=l);return s.$$set=l=>{"labels"in l&&t(1,n=l.labels),"offset"in l&&t(0,i=l.offset)},[i,n,r]}class sm extends _e{constructor(e){super(),ke(this,e,im,nm,be,{labels:1,offset:0})}}class De{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Ti(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),an.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ti(this,e,t);let n=[];return this.decompose(e,t,n,0),an.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new ts(this),r=new ts(e);for(let l=t,o=t;;){if(i.next(l),r.next(l),l=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new ts(this,e)}iterRange(e,t=this.length){return new Yf(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Xf(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?De.empty:e.length<=32?new Ke(e):an.from(Ke.split(e,[]))}}class Ke extends De{constructor(e,t=rm(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let l=this.text[r],o=i+l.length;if((t?n:o)>=e)return new lm(i,o,n,l);i=o+1,n++}}decompose(e,t,n,i){let r=e<=0&&t>=this.length?this:new Ke(Aa(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let l=n.pop(),o=er(r.text,l.text.slice(),0,r.length);if(o.length<=32)n.push(new Ke(o,l.length+r.length));else{let a=o.length>>1;n.push(new Ke(o.slice(0,a)),new Ke(o.slice(a)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof Ke))return super.replace(e,t,n);[e,t]=Ti(this,e,t);let i=er(this.text,er(n.text,Aa(this.text,0,e)),t),r=this.length+n.length-(t-e);return i.length<=32?new Ke(i,r):an.from(Ke.split(i,[]),r)}sliceString(e,t=this.length,n=` +`){[e,t]=Ti(this,e,t);let i="";for(let r=0,l=0;r<=t&&le&&l&&(i+=n),er&&(i+=o.slice(Math.max(0,e-r),t-r)),r=a+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,n.length==32&&(t.push(new Ke(n,i)),n=[],i=-1);return i>-1&&t.push(new Ke(n,i)),t}}class an extends De{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,i){for(let r=0;;r++){let l=this.children[r],o=i+l.length,a=n+l.lines-1;if((t?a:o)>=e)return l.lineInner(e,t,n,i);i=o+1,n=a+1}}decompose(e,t,n,i){for(let r=0,l=0;l<=t&&r=l){let h=i&((l<=e?1:0)|(a>=t?2:0));l>=e&&a<=t&&!h?n.push(o):o.decompose(e-l,t-l,n,h)}l=a+1}}replace(e,t,n){if([e,t]=Ti(this,e,t),n.lines=r&&t<=o){let a=l.replace(e-r,t-r,n),h=this.lines-l.lines+a.lines;if(a.lines>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[i]=a,new an(c,this.length-(t-e)+n.length)}return super.replace(r,o,a)}r=o+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` +`){[e,t]=Ti(this,e,t);let i="";for(let r=0,l=0;re&&r&&(i+=n),el&&(i+=o.sliceString(e-l,t-l,n)),l=a+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof an))return 0;let n=0,[i,r,l,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==l||r==o)return n;let a=this.children[i],h=e.children[r];if(a!=h)return n+a.scanIdentical(h,t);n+=a.length+1}}static from(e,t=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let p of e)p.flatten(d);return new Ke(d,t)}let i=Math.max(32,n>>5),r=i<<1,l=i>>1,o=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof an)for(let m of d.children)f(m);else d.lines>l&&(a>l||!a)?(u(),o.push(d)):d instanceof Ke&&a&&(p=c[c.length-1])instanceof Ke&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new Ke(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>i&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(o.push(c.length==1?c[0]:an.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),o.length==1?o[0]:new an(o,t)}}De.empty=new Ke([""],0);function rm(s){let e=-1;for(let t of s)e+=t.length+1;return e}function er(s,e,t=0,n=1e9){for(let i=0,r=0,l=!0;r=t&&(a>n&&(o=o.slice(0,n-i)),i0?1:(e instanceof Ke?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],l=r>>1,o=i instanceof Ke?i.text.length:i.children.length;if(l==(t>0?o:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(i instanceof Ke){let a=i.text[l+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=i.children[l+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof Ke?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Yf{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new ts(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Xf{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(De.prototype[Symbol.iterator]=function(){return this.iter()},ts.prototype[Symbol.iterator]=Yf.prototype[Symbol.iterator]=Xf.prototype[Symbol.iterator]=function(){return this});class lm{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function Ti(s,e,t){return e=Math.max(0,Math.min(s.length,e)),[e,Math.max(e,Math.min(s.length,t))]}let xi="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(s=>s?parseInt(s,36):1);for(let s=1;ss)return xi[e-1]<=s;return!1}function Ca(s){return s>=127462&&s<=127487}const Ma=8205;function mt(s,e,t=!0,n=!0){return(t?Zf:am)(s,e,n)}function Zf(s,e,t){if(e==s.length)return e;e&&Qf(s.charCodeAt(e))&&eu(s.charCodeAt(e-1))&&e--;let n=ns(s,e);for(e+=Dl(n);e=0&&Ca(ns(s,l));)r++,l-=2;if(r%2==0)break;e+=2}else break}return e}function am(s,e,t){for(;e>0;){let n=Zf(s,e-2,t);if(n=56320&&s<57344}function eu(s){return s>=55296&&s<56320}function ns(s,e){let t=s.charCodeAt(e);if(!eu(t)||e+1==s.length)return t;let n=s.charCodeAt(e+1);return Qf(n)?(t-55296<<10)+(n-56320)+65536:t}function oS(s){return s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320))}function Dl(s){return s<65536?1:2}const Pl=/\r\n?|\n/;var vt=function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s}(vt||(vt={}));class mn{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-i);r+=o}else{if(n!=vt.Simple&&h>=e&&(n==vt.TrackDel&&ie||n==vt.TrackBefore&&ie))return null;if(h>e||h==e&&t<0&&!o)return e==i||t<0?r:r+a;r+=a}i=h}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n=0&&i<=t&&o>=e)return it?"cover":!0;i=o}return!1}toString(){let e="";for(let t=0;t=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new mn(e)}static create(e){return new mn(e)}}class Ge extends mn{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Nl(this,(t,n,i,r,l)=>e=e.replace(i,i+(n-t),l),!1),e}mapDesc(e,t=!1){return Bl(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,r=0;i=0){t[i]=o,t[i+1]=l;let a=i>>1;for(;n.length0&&jn(n,t,r.text),r.forward(c),o+=c}let h=e[l++];for(;o>1].toJSON()))}return e}static of(e,t,n){let i=[],r=[],l=0,o=null;function a(c=!1){if(!c&&!i.length)return;lu||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?De.of(d.split(n||Pl)):d:De.empty,m=p.length;if(f==u&&m==0)return;fl&&ht(i,f-l,-1),ht(i,u-f,m),jn(r,i,p),l=u}}return h(e),a(!o),o}static empty(e){return new Ge(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;io&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;n.length=0&&t<=0&&t==s[i+1]?s[i]+=e:e==0&&s[i]==0?s[i+1]+=t:n?(s[i]+=e,s[i+1]+=t):s.push(e,t)}function jn(s,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||l==s.sections.length||s.sections[l+1]<0);)o=s.sections[l++],a=s.sections[l++];e(i,h,r,c,f),i=h,r=c}}}function Bl(s,e,t,n=!1){let i=[],r=n?[]:null,l=new hs(s),o=new hs(e);for(let a=-1;;)if(l.ins==-1&&o.ins==-1){let h=Math.min(l.len,o.len);ht(i,h,-1),l.forward(h),o.forward(h)}else if(o.ins>=0&&(l.ins<0||a==l.i||l.off==0&&(o.len=0&&a=0){let h=0,c=l.len;for(;c;)if(o.ins==-1){let f=Math.min(c,o.len);h+=f,c-=f,o.forward(f)}else if(o.ins==0&&o.lena||l.ins>=0&&l.len>a)&&(o||n.length>h),r.forward2(a),l.forward(a)}}}}class hs{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?De.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?De.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class oi{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new oi(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return q.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return q.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return q.range(e.anchor,e.head)}static create(e,t,n){return new oi(e,t,n)}}class q{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:q.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new q(e.ranges.map(t=>oi.fromJSON(t)),e.main)}static single(e,t=e){return new q([q.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;ie?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort((i,r)=>i.from-r.from),t=e.indexOf(n);for(let i=1;ir.head?q.range(a,o):q.range(o,a))}}return new q(e,t)}}function nu(s,e){for(let t of s.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Po=0;class le{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=Po++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new le(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:No),!!e.static,e.enables)}of(e){return new tr([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new tr(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new tr(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function No(s,e){return s==e||s.length==e.length&&s.every((t,n)=>t===e[n])}class tr{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=Po++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,l=e[r]>>1,o=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[l]=n(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Ll(f,c)){let d=n(f);if(o?!Ta(d,f.values[l],i):!i(d,f.values[l]))return f.values[l]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=ur(u,p);if(this.dependencies.every(g=>g instanceof le?u.facet(g)===f.facet(g):g instanceof Nt?u.field(g,!1)==f.field(g,!1):!0)||(o?Ta(d=n(f),m,i):i(d=n(f),m)))return f.values[l]=m,0}else d=n(f);return f.values[l]=d,1}}}}function Ta(s,e,t){if(s.length!=e.length)return!1;for(let n=0;ns[a.id]),i=t.map(a=>a.type),r=n.filter(a=>!(a&1)),l=s[e.id]>>1;function o(a){let h=[];for(let c=0;cn===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Ea).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,i)=>{let r=n.values[t],l=this.updateF(r,i);return this.compareF(r,l)?0:(n.values[t]=l,1)},reconfigure:(n,i)=>i.config.address[this.id]!=null?(n.values[t]=i.field(this),0):(n.values[t]=this.create(n),1)}}init(e){return[this,Ea.of({field:this,create:e})]}get extension(){return this}}const li={lowest:4,low:3,default:2,high:1,highest:0};function Wi(s){return e=>new iu(e,s)}const Br={highest:Wi(li.highest),high:Wi(li.high),default:Wi(li.default),low:Wi(li.low),lowest:Wi(li.lowest)};class iu{constructor(e,t){this.inner=e,this.prec=t}}class Lt{of(e){return new $l(this,e)}reconfigure(e){return Lt.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class $l{constructor(e,t){this.compartment=e,this.inner=t}}class fr{constructor(e,t,n,i,r,l){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=l,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let i=[],r=Object.create(null),l=new Map;for(let u of cm(e,t,l))u instanceof Nt?i.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let o=Object.create(null),a=[],h=[];for(let u of i)o[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=n==null?void 0:n.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(o[p.id]=a.length<<1|1,No(m,d))a.push(n.facet(p));else{let g=p.combine(d.map(b=>b.value));a.push(n&&p.compare(g,n.facet(p))?n.facet(p):g)}else{for(let g of d)g.type==0?(o[g.id]=a.length<<1|1,a.push(g.value)):(o[g.id]=h.length<<1,h.push(b=>g.dynamicSlot(b)));o[p.id]=h.length<<1,h.push(g=>hm(g,p,d))}}let f=h.map(u=>u(o));return new fr(e,l,f,o,a,r)}}function cm(s,e,t){let n=[[],[],[],[],[]],i=new Map;function r(l,o){let a=i.get(l);if(a!=null){if(a<=o)return;let h=n[a].indexOf(l);h>-1&&n[a].splice(h,1),l instanceof $l&&t.delete(l.compartment)}if(i.set(l,o),Array.isArray(l))for(let h of l)r(h,o);else if(l instanceof $l){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(l.compartment)||l.inner;t.set(l.compartment,h),r(h,o)}else if(l instanceof iu)r(l.inner,l.prec);else if(l instanceof Nt)n[o].push(l),l.provides&&r(l.provides,o);else if(l instanceof tr)n[o].push(l),l.facet.extensions&&r(l.facet.extensions,li.default);else{let h=l.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,o)}}return r(s,li.default),n.reduce((l,o)=>l.concat(o))}function is(s,e){if(e&1)return 2;let t=e>>1,n=s.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;s.status[t]=4;let i=s.computeSlot(s,s.config.dynamicSlots[t]);return s.status[t]=2|i}function ur(s,e){return e&1?s.config.staticValues[e>>1]:s.values[e>>1]}const su=le.define(),Rl=le.define({combine:s=>s.some(e=>e),static:!0}),ru=le.define({combine:s=>s.length?s[0]:void 0,static:!0}),lu=le.define(),ou=le.define(),au=le.define(),hu=le.define({combine:s=>s.length?s[0]:!1});class Yn{constructor(e,t){this.type=e,this.value=t}static define(){return new fm}}class fm{of(e){return new Yn(this,e)}}class um{constructor(e){this.map=e}of(e){return new Ne(this,e)}}class Ne{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Ne(this.type,t)}is(e){return this.type==e}static define(e={}){return new um(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let r=i.map(t);r&&n.push(r)}return n}}Ne.reconfigure=Ne.define();Ne.appendConfig=Ne.define();class Xe{constructor(e,t,n,i,r,l){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=l,this._doc=null,this._state=null,n&&nu(n,t.newLength),r.some(o=>o.type==Xe.time)||(this.annotations=r.concat(Xe.time.of(Date.now())))}static create(e,t,n,i,r,l){return new Xe(e,t,n,i,r,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Xe.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Xe.time=Yn.define();Xe.userEvent=Yn.define();Xe.addToHistory=Yn.define();Xe.remote=Yn.define();function dm(s,e){let t=[];for(let n=0,i=0;;){let r,l;if(n=s[n]))r=s[n++],l=s[n++];else if(i=0;i--){let r=n[i](s);r instanceof Xe?s=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Xe?s=r[0]:s=fu(e,Ai(r),!1)}return s}function mm(s){let e=s.startState,t=e.facet(au),n=s;for(let i=t.length-1;i>=0;i--){let r=t[i](s);r&&Object.keys(r).length&&(n=cu(n,Il(e,r,s.changes.newLength),!0))}return n==s?s:Xe.create(e,s.changes,s.selection,n.effects,n.annotations,n.scrollIntoView)}const gm=[];function Ai(s){return s==null?gm:Array.isArray(s)?s:[s]}var xn=function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s}(xn||(xn={}));const bm=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let zl;try{zl=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function _m(s){if(zl)return zl.test(s);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||bm.test(t)))return!0}return!1}function km(s){return e=>{if(!/\S/.test(e))return xn.Space;if(_m(e))return xn.Word;for(let t=0;t-1)return xn.Word;return xn.Other}}class ye{constructor(e,t,n,i,r,l){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,l&&(l._state=this);for(let o=0;oi.set(h,a)),t=null),i.set(o.value.compartment,o.value.extension)):o.is(Ne.reconfigure)?(t=null,n=o.value):o.is(Ne.appendConfig)&&(t=null,n=Ai(n).concat(o.value));let r;t?r=e.startState.values.slice():(t=fr.resolve(n,i,this),r=new ye(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let l=e.startState.facet(Rl)?e.newSelection:e.newSelection.asSingle();new ye(t,e.newDoc,l,r,(o,a)=>a.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:q.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],l=Ai(n.effects);for(let o=1;ol.spec.fromJSON(o,a)))}}return ye.create({doc:e.doc,selection:q.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=fr.resolve(e.extensions||[],new Map),n=e.doc instanceof De?e.doc:De.of((e.doc||"").split(t.staticFacet(ye.lineSeparator)||Pl)),i=e.selection?e.selection instanceof q?e.selection:q.single(e.selection.anchor,e.selection.head):q.single(0);return nu(i,n.length),t.staticFacet(Rl)||(i=i.asSingle()),new ye(t,n,i,t.dynamicSlots.map(()=>null),(r,l)=>l.create(r),null)}get tabSize(){return this.facet(ye.tabSize)}get lineBreak(){return this.facet(ye.lineSeparator)||` +`}get readOnly(){return this.facet(hu)}phrase(e,...t){for(let n of this.facet(ye.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let r=+(i||1);return!r||r>t.length?n:t[r-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(su))for(let l of r(this,t,n))Object.prototype.hasOwnProperty.call(l,e)&&i.push(l[e]);return i}charCategorizer(e){return km(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),l=e-n,o=e-n;for(;l>0;){let a=mt(t,l,!1);if(r(t.slice(a,l))!=xn.Word)break;l=a}for(;os.length?s[0]:4});ye.lineSeparator=ru;ye.readOnly=hu;ye.phrases=le.define({compare(s,e){let t=Object.keys(s),n=Object.keys(e);return t.length==n.length&&t.every(i=>s[i]==e[i])}});ye.languageData=su;ye.changeFilter=lu;ye.transactionFilter=ou;ye.transactionExtender=au;Lt.reconfigure=Ne.define();function Pi(s,e,t={}){let n={};for(let i of s)for(let r of Object.keys(i)){let l=i[r],o=n[r];if(o===void 0)n[r]=l;else if(!(o===l||l===void 0))if(Object.hasOwnProperty.call(t,r))n[r]=t[r](o,l);else throw new Error("Config merge conflict for field "+r)}for(let i in e)n[i]===void 0&&(n[i]=e[i]);return n}class Ei{eq(e){return this==e}range(e,t=e){return jl.create(e,t,this)}}Ei.prototype.startSide=Ei.prototype.endSide=0;Ei.prototype.point=!1;Ei.prototype.mapMode=vt.TrackDel;let jl=class uu{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new uu(e,t,n)}};function Vl(s,e){return s.from-e.from||s.value.startSide-e.value.startSide}class Bo{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let l=i,o=r.length;;){if(l==o)return l;let a=l+o>>1,h=r[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==l)return h>=0?l:o;h>=0?o=a:l=a+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),l=this.findIndex(n,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(l<0&&(l=u),h.point&&(o=Math.max(o,d-u)),n.push(h),i.push(u-l),r.push(d-l))}return{mapped:n.length?new Bo(i,r,n,o):null,pos:l}}}class Ee{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new Ee(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:r=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(n&&(t=t.slice().sort(Vl)),this.isEmpty)return t.length?Ee.of(t):this;let o=new du(this,null,-1).goto(0),a=0,h=[],c=new ai;for(;o.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else o.rangeIndex==1&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||ro.to||r=r&&e<=r+l.length&&l.between(r,e-r,t-r,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return cs.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return cs.from(e).goto(t)}static compare(e,t,n,i,r=-1){let l=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Oa(l,o,n),h=new qi(l,a,r),c=new qi(o,a,r);n.iterGaps((f,u,d)=>Da(h,f,c,u,d,i)),n.empty&&n.length==0&&Da(h,0,c,0,0,i)}static eq(e,t,n=0,i){i==null&&(i=1e9-1);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),l=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=l.length)return!1;if(!r.length)return!0;let o=Oa(r,l),a=new qi(r,o,0).goto(n),h=new qi(l,o,0).goto(n);for(;;){if(a.to!=h.to||!Hl(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>i)return!0;a.next(),h.next()}}static spans(e,t,n,i,r=-1){let l=new qi(e,null,r).goto(t),o=t,a=l.openStart;for(;;){let h=Math.min(l.to,n);if(l.point){let c=l.activeForPoint(l.to),f=l.pointFromo&&(i.span(o,h,l.active,a),a=l.openEnd(h));if(l.to>n)return a+(l.point&&l.to>n?1:0);o=l.to,l.next()}}static of(e,t=!1){let n=new ai;for(let i of e instanceof jl?[e]:t?vm(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return Ee.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=Ee.empty;i=i.nextLayer)t=new Ee(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}Ee.empty=new Ee([],[],null,-1);function vm(s){if(s.length>1)for(let e=s[0],t=1;t0)return s.slice().sort(Vl);e=n}return s}Ee.empty.nextLayer=Ee.empty;class ai{finishChunk(e){this.chunks.push(new Bo(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new ai)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Ee.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Ee.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Oa(s,e,t){let n=new Map;for(let r of s)for(let l=0;l=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&i.push(new du(l,t,n,r));return i.length==1?i[0]:new cs(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)al(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)al(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),al(this.heap,0)}}}function al(s,e){for(let t=s[e];;){let n=(e<<1)+1;if(n>=s.length)break;let i=s[n];if(n+1=0&&(i=s[n+1],n++),t.compare(i)<0)break;s[n]=t,s[e]=i,e=n}}class qi{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=cs.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Bs(this.active,e),Bs(this.activeTo,e),Bs(this.activeRank,e),this.minActive=Pa(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t0;)t++;Ls(this.active,t,n),Ls(this.activeTo,t,i),Ls(this.activeRank,t,r),e&&Ls(e,t,this.cursor.from),this.minActive=Pa(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&Bs(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[i]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function Da(s,e,t,n,i,r){s.goto(e),t.goto(n);let l=n+i,o=n,a=n-e;for(;;){let h=s.to+a-t.to||s.endSide-t.endSide,c=h<0?s.to+a:t.to,f=Math.min(c,l);if(s.point||t.point?s.point&&t.point&&(s.point==t.point||s.point.eq(t.point))&&Hl(s.activeForPoint(s.to),t.activeForPoint(t.to))||r.comparePoint(o,f,s.point,t.point):f>o&&!Hl(s.active,t.active)&&r.compareRange(o,f,s.active,t.active),c>l)break;o=c,h<=0&&s.next(),h>=0&&t.next()}}function Hl(s,e){if(s.length!=e.length)return!1;for(let t=0;t=e;n--)s[n+1]=s[n];s[e]=t}function Pa(s,e){let t=-1,n=1e9;for(let i=0;i=e)return i;if(i==s.length)break;r+=s.charCodeAt(i)==9?t-r%t:1,i=mt(s,i)}return n===!0?-1:s.length}function ym(s,e,t,n,i,r){let l=hl(t,s,e),o=hl(n,s,e),a=hl(i,s,e);return l<0&&(l+=e),o<0&&(o+=e),a=r==="min"?Math.max(l,Math.min(o,a)):Math.min(o,Math.max(l,a)),i.endsWith("%")?e?`${100*a/e}%`:"0%":`${a}px`}function hl(s,e,t){const n=parseFloat(s);if(s.endsWith("px"))return n;if(s.endsWith("%"))return t*n/100;if(s.endsWith("rem"))return n*parseFloat(getComputedStyle(document.documentElement).fontSize);if(s.endsWith("em"))return n*parseFloat(getComputedStyle(e).fontSize);throw new Error(`Invalid length: ${s}`)}const wm=s=>({}),Na=s=>({}),Sm=s=>({}),Ba=s=>({});function La(s){let e,t,n,i;return{c(){e=x("div"),this.h()},l(r){e=A(r,"DIV",{class:!0}),P(e).forEach(_),this.h()},h(){k(e,"class",t=s[1]+" divider svelte-mwcui7"),ie(e,"disabled",s[3])},m(r,l){S(r,e,l),n||(i=Uf(s[10].call(null,e,s[16])),n=!0)},p(r,l){l&2&&t!==(t=r[1]+" divider svelte-mwcui7")&&k(e,"class",t),l&10&&ie(e,"disabled",r[3])},d(r){r&&_(e),n=!1,i()}}}function $a(s){let e;return{c(){e=x("div"),this.h()},l(t){e=A(t,"DIV",{class:!0}),P(e).forEach(_),this.h()},h(){k(e,"class","mousecatcher svelte-mwcui7")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function xm(s){let e,t,n,i,r,l,o,a,h,c;const f=s[15].a,u=Tt(f,s,s[14],Ba),d=s[15].b,p=Tt(d,s,s[14],Na);let m=s[2]!=="0%"&&s[2]!=="100%"&&La(s),g=s[8]&&$a();return{c(){e=x("div"),t=x("div"),u&&u.c(),n=Q(),i=x("div"),p&&p.c(),r=Q(),m&&m.c(),a=Q(),g&&g.c(),h=ce(),this.h()},l(b){e=A(b,"DIV",{"data-pane":!0,class:!0,style:!0});var v=P(e);t=A(v,"DIV",{class:!0});var O=P(t);u&&u.l(O),O.forEach(_),n=ee(v),i=A(v,"DIV",{class:!0});var M=P(i);p&&p.l(M),M.forEach(_),r=ee(v),m&&m.l(v),v.forEach(_),a=ee(b),g&&g.l(b),h=ce(),this.h()},h(){k(t,"class","pane svelte-mwcui7"),k(i,"class","pane svelte-mwcui7"),k(e,"data-pane",s[0]),k(e,"class",l="container "+s[1]+" svelte-mwcui7"),it(e,"--pos",s[7]),Dr(()=>s[18].call(e))},m(b,v){S(b,e,v),y(e,t),u&&u.m(t,null),y(e,n),y(e,i),p&&p.m(i,null),y(e,r),m&&m.m(e,null),s[17](e),o=Eo(e,s[18].bind(e)),S(b,a,v),g&&g.m(b,v),S(b,h,v),c=!0},p(b,[v]){u&&u.p&&(!c||v&16384)&&Et(u,f,b,b[14],c?Dt(f,b[14],v,Sm):Ot(b[14]),Ba),p&&p.p&&(!c||v&16384)&&Et(p,d,b,b[14],c?Dt(d,b[14],v,wm):Ot(b[14]),Na),b[2]!=="0%"&&b[2]!=="100%"?m?m.p(b,v):(m=La(b),m.c(),m.m(e,null)):m&&(m.d(1),m=null),(!c||v&1)&&k(e,"data-pane",b[0]),(!c||v&2&&l!==(l="container "+b[1]+" svelte-mwcui7"))&&k(e,"class",l),(!c||v&128)&&it(e,"--pos",b[7]),b[8]?g||(g=$a(),g.c(),g.m(h.parentNode,h)):g&&(g.d(1),g=null)},i(b){c||(w(u,b),w(p,b),c=!0)},o(b){T(u,b),T(p,b),c=!1},d(b){b&&(_(e),_(a),_(h)),u&&u.d(b),p&&p.d(b),m&&m.d(),s[17](null),o(),g&&g.d(b)}}}function Am(s,e,t){let n,{$$slots:i={},$$scope:r}=e;const l=Pr();let{id:o=void 0}=e,{type:a}=e,{pos:h="50%"}=e,{min:c="0%"}=e,{max:f="100%"}=e,{disabled:u=!1}=e,{priority:d="min"}=e,p,m=!1,g=0,b=0;function v(E,V){if(u)return;const{top:$,left:F}=p.getBoundingClientRect(),R=a==="horizontal"?E-F:V-$,D=a==="horizontal"?g:b;t(7,n=h.endsWith("%")?`${100*R/D}%`:`${R}px`),l("change")}function O(E,V){const $=F=>{if(F.pointerType==="mouse"&&F.button===2||F.pointerType!=="mouse"&&!F.isPrimary)return;E.setPointerCapture(F.pointerId),F.preventDefault(),t(8,m=!0);const R=()=>{t(8,m=!1),E.setPointerCapture(F.pointerId),window.removeEventListener("pointermove",V,!1),window.removeEventListener("pointerup",R,!1)};window.addEventListener("pointermove",V,!1),window.addEventListener("pointerup",R,!1)};return E.addEventListener("pointerdown",$,{capture:!0,passive:!1}),{destroy(){E.removeEventListener("pointerdown",$)}}}const M=E=>v(E.clientX,E.clientY);function B(E){Ye[E?"unshift":"push"](()=>{p=E,t(4,p)})}function N(){g=this.clientWidth,b=this.clientHeight,t(5,g),t(6,b)}return s.$$set=E=>{"id"in E&&t(0,o=E.id),"type"in E&&t(1,a=E.type),"pos"in E&&t(2,h=E.pos),"min"in E&&t(11,c=E.min),"max"in E&&t(12,f=E.max),"disabled"in E&&t(3,u=E.disabled),"priority"in E&&t(13,d=E.priority),"$$scope"in E&&t(14,r=E.$$scope)},s.$$.update=()=>{s.$$.dirty&4&&t(7,n=h),s.$$.dirty&14578&&p&&t(7,n=ym(p,a==="horizontal"?g:b,c,f,n,d))},[o,a,h,u,p,g,b,n,m,v,O,c,f,d,r,i,M,B,N]}class pu extends _e{constructor(e){super(),ke(this,e,Am,xm,be,{id:0,type:1,pos:2,min:11,max:12,disabled:3,priority:13})}}function Cm(){return new Worker(""+new URL("../workers/index-99560f9a.js",import.meta.url).href)}const cl=new Map;let fl=1;class Mm{constructor({packages_url:e,svelte_url:t,onstatus:n}){qe(this,"worker");const i=`${e}:${t}`;if(!cl.has(i)){const r=new Cm;r.postMessage({type:"init",packages_url:e,svelte_url:t}),cl.set(i,r)}this.worker=cl.get(i),this.handlers=new Map,this.worker.addEventListener("message",r=>{const l=this.handlers.get(r.data.uid);if(l){if(r.data.type==="status"){n(r.data.message);return}n(null),l(r.data),this.handlers.delete(r.data.uid)}})}bundle(e){return new Promise(t=>{this.handlers.set(fl,t),this.worker.postMessage({uid:fl,type:"bundle",files:e}),fl+=1})}destroy(){this.worker.terminate()}}const mu=Symbol("repl");function di(){return Oo(mu)}function Tm(s){Kf(mu,s)}function $e(s){return`${s.name}.${s.type}`}function Ra(s,e,t){const n=s.slice();n[37]=e[t],n[40]=t;const i=$e(n[37]);return n[38]=i,n}function Em(s){const e=s.slice(),t=e[4].find(n=>$e(n)===e[1]);return e[41]=t,e}function Ia(s){let e,t=[],n=new Map,i,r,l='',o,a,h=Oe(s[4]);const c=f=>f[37].name;for(let f=0;f',c,f,u=s[0]&&s[37].modified&&ja();function d(){return s[23](s[37])}function p(...b){return s[24](s[37],...b)}function m(){return s[25](s[38])}function g(...b){return s[26](s[38],...b)}return{c(){e=x("div"),n=I(t),i=I("."),l=I(r),u&&u.c(),o=Q(),a=x("span"),a.innerHTML=h,this.h()},l(b){e=A(b,"DIV",{class:!0,title:!0});var v=P(e);n=z(v,t),i=z(v,"."),l=z(v,r),u&&u.l(v),v.forEach(_),o=ee(b),a=A(b,"SPAN",{class:!0,"data-svelte-h":!0}),Te(a)!=="svelte-1v5c9kn"&&(a.innerHTML=h),this.h()},h(){k(e,"class","editable svelte-1fyxfyn"),k(e,"title","edit component name"),k(a,"class","remove svelte-1fyxfyn")},m(b,v){S(b,e,v),y(e,n),y(e,i),y(e,l),u&&u.m(e,null),S(b,o,v),S(b,a,v),c||(f=[ue(e,"click",d),ue(e,"keyup",p),ue(a,"click",m),ue(a,"keyup",g)],c=!0)},p(b,v){s=b,v[0]&16&&t!==(t=s[37].name+"")&&re(n,t),v[0]&16&&r!==(r=s[37].type+"")&&re(l,r),s[0]&&s[37].modified?u||(u=ja(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(b){b&&(_(e),_(o),_(a)),u&&u.d(),c=!1,Pn(f)}}}function za(s){let e,t=s[41]&&Va(s);return{c(){t&&t.c(),e=ce()},l(n){t&&t.l(n),e=ce()},m(n,i){t&&t.m(n,i),S(n,e,i)},p(n,i){n[41]?t?t.p(n,i):(t=Va(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(n){n&&_(e),t&&t.d(n)}}}function Dm(s){let e,t,n=s[0]&&s[37].modified&&Ha();return{c(){e=x("div"),t=I("App.svelte"),n&&n.c(),this.h()},l(i){e=A(i,"DIV",{class:!0});var r=P(e);t=z(r,"App.svelte"),n&&n.l(r),r.forEach(_),this.h()},h(){k(e,"class","uneditable svelte-1fyxfyn")},m(i,r){S(i,e,r),y(e,t),n&&n.m(e,null)},p(i,r){i[0]&&i[37].modified?n||(n=Ha(),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&_(e),n&&n.d()}}}function ja(s){let e;return{c(){e=I("*")},l(t){e=z(t,"*")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function Va(s){let e,t=s[2]+(/\./.test(s[2])?"":`.${s[41].type}`),n,i,r,l,o;function a(...h){return s[22](s[41],...h)}return{c(){e=x("span"),n=I(t),i=Q(),r=x("input"),this.h()},l(h){e=A(h,"SPAN",{class:!0});var c=P(e);n=z(c,t),c.forEach(_),i=ee(h),r=A(h,"INPUT",{spellcheck:!0,class:!0}),this.h()},h(){k(e,"class","input-sizer svelte-1fyxfyn"),r.autofocus=!0,k(r,"spellcheck",!1),k(r,"class","svelte-1fyxfyn"),ie(r,"duplicate",s[16](s[41]))},m(h,c){S(h,e,c),y(e,n),S(h,i,c),S(h,r,c),ri(r,s[2]),r.focus(),l||(o=[ue(r,"input",s[21]),ue(r,"focus",s[14]),ue(r,"blur",s[12]),ue(r,"keydown",a)],l=!0)},p(h,c){s=h,c[0]&22&&t!==(t=s[2]+(/\./.test(s[2])?"":`.${s[41].type}`))&&re(n,t),c[0]&4&&r.value!==s[2]&&ri(r,s[2]),c[0]&65554&&ie(r,"duplicate",s[16](s[41]))},d(h){h&&(_(e),_(i),_(r)),l=!1,Pn(o)}}}function Ha(s){let e;return{c(){e=I("*")},l(t){e=z(t,"*")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function Fa(s,e){let t,n,i,r,l,o,a;function h(m,g){return m[37].name==="App"&&m[38]!==m[1]?Dm:m[38]===m[1]?za:Om}function c(m,g){return g===za?Em(m):m}let f=h(e),u=f(c(e,f));function d(){return e[27](e[38])}function p(...m){return e[28](e[38],...m)}return{key:s,first:null,c(){t=x("div"),n=x("i"),i=Q(),u.c(),this.h()},l(m){t=A(m,"DIV",{id:!0,class:!0,role:!0,tabindex:!0,draggable:!0});var g=P(t);n=A(g,"I",{class:!0}),P(n).forEach(_),i=ee(g),u.l(g),g.forEach(_),this.h()},h(){k(n,"class","drag-handle svelte-1fyxfyn"),k(t,"id",r=e[37].name),k(t,"class","button svelte-1fyxfyn"),k(t,"role","button"),k(t,"tabindex","0"),k(t,"draggable",l=e[38]!==e[1]),ie(t,"active",e[38]===e[5]),ie(t,"draggable",e[38]!==e[1]&&e[40]!==0),ie(t,"drag-over",e[3]===e[37].name),this.first=t},m(m,g){S(m,t,g),y(t,n),y(t,i),u.m(t,null),o||(a=[ue(t,"click",d),ue(t,"keyup",p),ue(t,"dblclick",Nr(Nm)),ue(t,"dragstart",e[17]),ue(t,"dragover",pa(e[19])),ue(t,"dragleave",e[18]),ue(t,"drop",pa(e[20]))],o=!0)},p(m,g){e=m,f===(f=h(e))&&u?u.p(c(e,f),g):(u.d(1),u=f(c(e,f)),u&&(u.c(),u.m(t,null))),g[0]&16&&r!==(r=e[37].name)&&k(t,"id",r),g[0]&18&&l!==(l=e[38]!==e[1])&&k(t,"draggable",l),g[0]&48&&ie(t,"active",e[38]===e[5]),g[0]&18&&ie(t,"draggable",e[38]!==e[1]&&e[40]!==0),g[0]&24&&ie(t,"drag-over",e[3]===e[37].name)},d(m){m&&_(t),u.d(),o=!1,Pn(a)}}}function Pm(s){let e,t=s[4].length&&Ia(s);return{c(){e=x("div"),t&&t.c(),this.h()},l(n){e=A(n,"DIV",{class:!0});var i=P(e);t&&t.l(i),i.forEach(_),this.h()},h(){k(e,"class","component-selector svelte-1fyxfyn")},m(n,i){S(n,e,i),t&&t.m(e,null)},p(n,i){n[4].length?t?t.p(n,i):(t=Ia(n),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},i:de,o:de,d(n){n&&_(e),t&&t.d()}}}const Nm=()=>{};function Bm(s,e,t){let n,i,r,l,{show_modified:o}=e;const a=Pr(),{files:h,handle_select:c,module_editor:f,rebundle:u,selected:d,selected_name:p,EDITOR_STATE_MAP:m}=di();Me(s,h,X=>t(4,n=X)),Me(s,f,X=>t(32,l=X)),Me(s,d,X=>t(31,i=X)),Me(s,p,X=>t(5,r=X));let g=null,b="";function v(X){r!==X&&(t(1,g=null),c(X))}function O(X){r===$e(X)&&(t(1,g=$e(X)),t(2,b=X.name))}async function M(){const X=/(.+)\.(svelte|js|json|md|css)$/.exec(b??""),pe=n.find(Ae=>$e(Ae)===g);if(!pe||(pe.name=X?X[1]:b,!i))return;if($(i)){let Ae=1,lt=i.name;do{const Vt=n.find(Gt=>$e(Gt)===$e(pe)&&Gt.source===i.source);if(!Vt)break;Vt.name=`${lt}_${Ae++}`}while($(i));const St=n.findIndex(Vt=>$e(Vt)===$e(pe));Ve(h,n[St]=pe,n)}const et=n.findIndex(Ae=>$e(Ae)===$e(pe));if(X!=null&&X[2]&&Ve(h,n[et].type=X[2],n),g){const Ae=m.get(g);Ae&&(m.set($e(pe),Ae),m.delete(g))}t(1,g=null),c($e(pe)),h.set(n),await as(),l==null||l.focus(),u()}function B(X){const pe=n.find(lt=>$e(lt)===X),et=n.findIndex(lt=>$e(lt)===X);!pe||!confirm(`Are you sure you want to delete ${$e(pe)}?`)||(Ve(h,n=n.filter(lt=>$e(lt)!==X),n),a("remove",{files:n,diff:pe}),m.delete($e(pe)),c(Ve(p,r=et===1?"App.svelte":$e(pe),r)))}async function N(X){await as(),X.currentTarget.select()}let E=1;function V(){const X={name:E++?`Component${E}`:"Component1",type:"svelte",source:"",modified:!0};Ve(h,n=n.concat(X),n),t(1,g=$e(X)),t(2,b=X.name),c(g),u(),a("add",{files:n,diff:X}),h.set(n)}function $(X){return n.find(pe=>JSON.stringify(pe)!==JSON.stringify(i)&&pe.name===X.name)}let F=null,R=null;function D(X){F=X.currentTarget.id}function C(){t(3,R=null)}function W(X){t(3,R=X.currentTarget.id)}function ne(){if(F&&R){const X=n.findIndex(Ae=>Ae.name===F),pe=n.findIndex(Ae=>Ae.name===R),et=n[X];n.splice(X,1),Ve(h,n=n.slice(0,pe).concat(et).concat(n.slice(pe)),n)}F=t(3,R=null)}function Y(){b=this.value,t(2,b)}const he=(X,pe)=>{pe.key==="Enter"&&(pe.preventDefault(),$(X)||pe.currentTarget.blur())},j=X=>O(X),fe=(X,pe)=>pe.key===" "&&O(X),ge=X=>B(X),Re=(X,pe)=>pe.key===" "&&B(X),we=X=>v(X),dt=(X,pe)=>pe.key===" "&&v(X);return s.$$set=X=>{"show_modified"in X&&t(0,o=X.show_modified)},[o,g,b,R,n,r,h,f,d,p,v,O,M,B,N,V,$,D,C,W,ne,Y,he,j,fe,ge,Re,we,dt]}class Lm extends _e{constructor(e){super(),ke(this,e,Bm,Pm,be,{show_modified:0},null,[-1,-1])}}const Wl="ͼ",Wa=typeof Symbol>"u"?"__"+Wl:Symbol.for(Wl),ql=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),qa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class qn{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function r(l,o,a,h){let c=[],f=/^@(\w+)\b/.exec(l[0]),u=f&&f[1]=="keyframes";if(f&&o==null)return a.push(l[0]+";");for(let d in o){let p=o[d];if(/&/.test(d))r(d.split(/,\s*/).map(m=>l.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(i(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((n&&!f&&!h?l.map(n):l).join(", ")+" {"+c.join(" ")+"}")}for(let l in e)r(i(l),e[l],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=qa[Wa]||1;return qa[Wa]=e+1,Wl+e.toString(36)}static mount(e,t,n){let i=e[ql],r=n&&n.nonce;i?r&&i.setNonce(r):i=new $m(e,r),i.mount(Array.isArray(t)?t:[t])}}let Ua=new Map;class $m{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let r=Ua.get(n);if(r)return e.adoptedStyleSheets=[r.sheet,...e.adoptedStyleSheets],e[ql]=r;this.sheet=new i.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Ua.set(n,this)}else{this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let r=e.head||e;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],e[ql]=this}mount(e){let t=this.sheet,n=0,i=0;for(let r=0;r-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,l),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Rm=typeof navigator<"u"&&/Mac/.test(navigator.platform),Im=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var st=0;st<10;st++)Un[48+st]=Un[96+st]=String(st);for(var st=1;st<=24;st++)Un[st+111]="F"+st;for(var st=65;st<=90;st++)Un[st]=String.fromCharCode(st+32),fs[st]=String.fromCharCode(st);for(var ul in Un)fs.hasOwnProperty(ul)||(fs[ul]=Un[ul]);function zm(s){var e=Rm&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||Im&&s.shiftKey&&s.key&&s.key.length==1||s.key=="Unidentified",t=!e&&s.key||(s.shiftKey?fs:Un)[s.keyCode]||s.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function dr(s){let e;return s.nodeType==11?e=s.getSelection?s:s.ownerDocument:e=s,e.getSelection()}function Ul(s,e){return e?s==e||s.contains(e.nodeType!=1?e.parentNode:e):!1}function jm(s){let e=s.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function nr(s,e){if(!e.anchorNode)return!1;try{return Ul(s,e.anchorNode)}catch{return!1}}function us(s){return s.nodeType==3?hi(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function ss(s,e,t,n){return t?Ka(s,e,t,n,-1)||Ka(s,e,t,n,1):!1}function ds(s){for(var e=0;;e++)if(s=s.previousSibling,!s)return e}function Ka(s,e,t,n,i){for(;;){if(s==t&&e==n)return!0;if(e==(i<0?0:Tn(s))){if(s.nodeName=="DIV")return!1;let r=s.parentNode;if(!r||r.nodeType!=1)return!1;e=ds(s)+(i<0?0:1),s=r}else if(s.nodeType==1){if(s=s.childNodes[e+(i<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;e=i<0?Tn(s):0}else return!1}}function Tn(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function Lo(s,e){let t=e?s.left:s.right;return{left:t,right:t,top:s.top,bottom:s.bottom}}function Vm(s){return{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function gu(s,e){let t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-s.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-s.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function Hm(s,e,t,n,i,r,l,o){let a=s.ownerDocument,h=a.defaultView||window;for(let c=s,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,m=1;if(d)u=Vm(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let v=c.getBoundingClientRect();({scaleX:p,scaleY:m}=gu(c,v)),u={left:v.left,right:v.left+c.clientWidth*p,top:v.top,bottom:v.top+c.clientHeight*m}}let g=0,b=0;if(i=="nearest")e.top0&&e.bottom>u.bottom+b&&(b=e.bottom-u.bottom+b+l)):e.bottom>u.bottom&&(b=e.bottom-u.bottom+l,t<0&&e.top-b0&&e.right>u.right+g&&(g=e.right-u.right+g+r)):e.right>u.right&&(g=e.right-u.right+r,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class Wm{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Tn(t):0),n,Math.min(e.focusOffset,n?Tn(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}let ki=null;function bu(s){if(s.setActive)return s.setActive();if(ki)return s.focus(ki);let e=[];for(let t=s;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(s.focus(ki==null?{get preventScroll(){return ki={preventScroll:!0},!0}}:void 0),!ki){ki=!1;for(let t=0;tMath.max(1,s.scrollHeight-s.clientHeight-4)}class ct{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new ct(e.parentNode,ds(e),t)}static after(e,t){return new ct(e.parentNode,ds(e)+1,t)}}const $o=[];class je{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let n=this.dom,i=null,r;for(let l of this.children){if(l.flags&7){if(!l.dom&&(r=i?i.nextSibling:n.firstChild)){let o=je.get(r);(!o||!o.parent&&o.canReuseDOM(l))&&l.reuseDOM(r)}l.sync(e,t),l.flags&=-8}if(r=i?i.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&r!=l.dom&&(t.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=Ga(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,r&&t&&t.node==n&&(t.written=!0);r;)r=Ga(r)}else if(this.flags&1)for(let n of this.children)n.flags&7&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let i=Tn(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;i==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?i=-1:i=1),e=r}i<0?n=e:n=e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!je.get(n);)n=n.nextSibling;if(!n)return this.length;for(let i=0,r=0;;i++){let l=this.children[i];if(l.dom==n)return r;r+=l.length+l.breakAfter}}domBoundsAround(e,t,n=0){let i=-1,r=-1,l=-1,o=-1;for(let a=0,h=n,c=n;at)return f.domBoundsAround(e,t,h);if(u>=e&&i==-1&&(i=a,r=h),h>t&&f.dom.parentNode==this.dom){l=a,o=c;break}c=u,h=u+f.breakAfter}return{from:r,to:o<0?n+this.length:o,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:l=0?this.children[l].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=$o){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function yu(s,e,t,n,i,r,l,o,a){let{children:h}=s,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:l;if(!(e==n&&c&&!l&&!u&&r.length<2&&c.merge(t,i,r.length?f:null,t==0,o,a))){if(n0&&(!l&&r.length&&c.merge(t,c.length,r[0],!1,o,0)?c.breakAfter=r.shift().breakAfter:(t2);var se={mac:Za||/Mac/.test(Mt.platform),windows:/Win/.test(Mt.platform),linux:/Linux|X11/.test(Mt.platform),ie:Lr,ie_version:Su?Kl.documentMode||6:Gl?+Gl[1]:Jl?+Jl[1]:0,gecko:Ya,gecko_version:Ya?+(/Firefox\/(\d+)/.exec(Mt.userAgent)||[0,0])[1]:0,chrome:!!dl,chrome_version:dl?+dl[1]:0,ios:Za,android:/Android\b/.test(Mt.userAgent),webkit:Xa,safari:xu,webkit_version:Xa?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:Kl.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Km=256;class En extends je{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof En)||this.length-(t-e)+n.length>Km||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new En(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ct(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Jm(this.dom,e,t)}}class On extends je{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let i of t)i.setParent(this)}setAttrs(e){if(_u(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,i,r,l){return n&&(!(n instanceof On&&n.mark.eq(this.mark))||e&&r<=0||te&&t.push(n=e&&(i=r),n=a,r++}let l=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new On(this.mark,t,l)}domAtPos(e){return Au(this,e)}coordsAt(e,t){return Mu(this,e,t)}}function Jm(s,e,t){let n=s.nodeValue.length;e>n&&(e=n);let i=e,r=e,l=0;e==0&&t<0||e==n&&t>=0?se.chrome||se.gecko||(e?(i--,l=1):r=0)?0:o.length-1];return se.safari&&!l&&a.width==0&&(a=Array.prototype.find.call(o,h=>h.width)||a),l?Lo(a,l<0):a||null}class Vn extends je{static create(e,t,n){return new Vn(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=Vn.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,i,r,l){return n&&(!(n instanceof Vn)||!this.widget.compare(n.widget)||e>0&&r<=0||t0)?ct.before(this.dom):ct.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let i=this.dom.getClientRects(),r=null;if(!i.length)return null;let l=this.side?this.side<0:e>0;for(let o=l?i.length-1:0;r=i[o],!(e>0?o==0:o==i.length-1||r.top0?ct.before(this.dom):ct.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return De.empty}get isHidden(){return!0}}En.prototype.children=Vn.prototype.children=Oi.prototype.children=$o;function Au(s,e){let t=s.dom,{children:n}=s,i=0;for(let r=0;ir&&e0;r--){let l=n[r-1];if(l.dom.parentNode==t)return l.domAtPos(l.length)}for(let r=i;r0&&e instanceof On&&i.length&&(n=i[i.length-1])instanceof On&&n.mark.eq(e.mark)?Cu(n,e.children[0],t-1):(i.push(e),e.setParent(s)),s.length+=e.length}function Mu(s,e,t){let n=null,i=-1,r=null,l=-1;function o(h,c){for(let f=0,u=0;f=c&&(d.children.length?o(d,c-u):(!r||r.isHidden&&t>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,l=c-u):(u-1?1:0)!=i.length-(t&&i.indexOf(t)>-1?1:0))return!1;for(let r of n)if(r!=t&&(i.indexOf(r)==-1||s[r]!==e[r]))return!1;return!0}function Xl(s,e,t){let n=!1;if(e)for(let i in e)t&&i in t||(n=!0,i=="style"?s.style.cssText="":s.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(n=!0,i=="style"?s.style.cssText=t[i]:s.setAttribute(i,t[i]));return n}function Ym(s){let e=Object.create(null);for(let t=0;t0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Ro(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Cu(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=Yl(t,this.attrs||{})),n&&(this.attrs=Yl({class:n},this.attrs||{}))}domAtPos(e){return Au(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(_u(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Xl(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&je.get(i)instanceof On;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((n=je.get(i))===null||n===void 0?void 0:n.isEditable)==!1&&(!se.ios||!this.children.some(r=>r instanceof En))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof En)||/[^ -~]/.test(n.text))return null;let i=us(n.dom);if(i.length!=1)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=Mu(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:i}=this.parent.view.viewState,r=n.bottom-n.top;if(Math.abs(r-i.lineHeight)<2&&i.textHeight=t){if(r instanceof Je)return r;if(l>t)break}i=l+r.breakAfter}return null}}class Wn extends je{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,i,r,l){return n&&(!(n instanceof Wn)||!this.widget.compare(n.widget)||e>0&&r<=0||t0}}class pi{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var gt=function(s){return s[s.Text=0]="Text",s[s.WidgetBefore=1]="WidgetBefore",s[s.WidgetAfter=2]="WidgetAfter",s[s.WidgetRange=3]="WidgetRange",s}(gt||(gt={}));class Be extends Ei{constructor(e,t,n,i){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Ss(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Kn(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,i;if(e.isBlockGap)n=-5e8,i=4e8;else{let{start:r,end:l}=Tu(e,t);n=(r?t?-3e8:-1:5e8)-1,i=(l?t?2e8:1:-6e8)+1}return new Kn(e,n,i,t,e.widget||null,!0)}static line(e){return new xs(e)}static set(e,t=!1){return Ee.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Be.none=Ee.empty;class Ss extends Be{constructor(e){let{start:t,end:n}=Tu(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof Ss&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&Ro(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Ss.prototype.point=!1;class xs extends Be{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof xs&&this.spec.class==e.spec.class&&Ro(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}xs.prototype.mapMode=vt.TrackBefore;xs.prototype.point=!0;class Kn extends Be{constructor(e,t,n,i,r,l){super(t,n,r,e),this.block=i,this.isReplace=l,this.mapMode=i?t<=0?vt.TrackBefore:vt.TrackAfter:vt.TrackDel}get type(){return this.startSide!=this.endSide?gt.WidgetRange:this.startSide<=0?gt.WidgetBefore:gt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Kn&&Xm(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Kn.prototype.point=!0;function Tu(s,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=s;return t==null&&(t=s.inclusive),n==null&&(n=s.inclusive),{start:t??e,end:n??e}}function Xm(s,e){return s==e||!!(s&&e&&s.compare(e))}function Zl(s,e,t,n=0){let i=t.length-1;i>=0&&t[i]+n>=s?t[i]=Math.max(t[i],e):t.push(s,e)}class rs{constructor(e,t,n,i){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Wn&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Je),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append($s(new Oi(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Wn)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:l,done:o}=this.cursor.next(this.skip);if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(l){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append($s(new En(this.text.slice(this.textOff,this.textOff+i)),t),n),this.atCursorPos=!0,this.textOff+=i,e-=i,n=0}}span(e,t,n,i){this.buildText(t-e,n,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,n,i,r,l){if(this.disallowBlockEffectsFor[l]&&n instanceof Kn){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let o=t-e;if(n instanceof Kn)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Wn(n.widget||new eh("div"),o,n));else{let a=Vn.create(n.widget||new eh("span"),o,o?0:n.startSide),h=this.atCursorPos&&!a.isEditable&&r<=i.length&&(e0),c=!a.isEditable&&(ei.length||n.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),h&&(f.append($s(new Oi(1),i),r),r=i.length+Math.max(0,r-i.length)),f.append($s(a,i),r),this.atCursorPos=c,this.pendingBuffer=c?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,i,r){let l=new rs(e,t,n,r);return l.openEnd=Ee.spans(i,t,n,l),l.openStart<0&&(l.openStart=l.openEnd),l.finish(l.openEnd),l}}function $s(s,e){for(let t of e)s=new On(t,[s],s.length);return s}class eh extends pi{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}var He=function(s){return s[s.LTR=0]="LTR",s[s.RTL=1]="RTL",s}(He||(He={}));const ci=He.LTR,Io=He.RTL;function Eu(s){let e=[];for(let t=0;t=t){if(o.level==n)return l;(r<0||(i!=0?i<0?o.fromt:e[r].level>o.level))&&(r=l)}}if(r<0)throw new RangeError("Index out of range");return r}}function Du(s,e){if(s.length!=e.length)return!1;for(let t=0;t=0;m-=3)if(en[m+1]==-d){let g=en[m+2],b=g&2?i:g&4?g&1?r:i:0;b&&(Ie[f]=Ie[en[m]]=b),o=m;break}}else{if(en.length==189)break;en[o++]=f,en[o++]=u,en[o++]=a}else if((p=Ie[f])==2||p==1){let m=p==i;a=m?0:1;for(let g=o-3;g>=0;g-=3){let b=en[g+2];if(b&2)break;if(m)en[g+2]|=2;else{if(b&4)break;en[g+2]|=4}}}}}function ig(s,e,t,n){for(let i=0,r=n;i<=t.length;i++){let l=i?t[i-1].to:s,o=ia;)p==g&&(p=t[--m].from,g=m?t[m-1].to:s),Ie[--p]=d;a=c}else r=h,a++}}}function eo(s,e,t,n,i,r,l){let o=n%2?2:1;if(n%2==i%2)for(let a=e,h=0;aa&&l.push(new Hn(a,m.from,d));let g=m.direction==ci!=!(d%2);to(s,g?n+1:n,i,m.inner,m.from,m.to,l),a=m.to}p=m.to}else{if(p==t||(c?Ie[p]!=o:Ie[p]==o))break;p++}u?eo(s,a,p,n+1,i,u,l):ae;){let c=!0,f=!1;if(!h||a>r[h-1].to){let m=Ie[a-1];m!=o&&(c=!1,f=m==16)}let u=!c&&o==1?[]:null,d=c?n:n+1,p=a;e:for(;;)if(h&&p==r[h-1].to){if(f)break e;let m=r[--h];if(!c)for(let g=m.from,b=h;;){if(g==e)break e;if(b&&r[b-1].to==g)g=r[--b].from;else{if(Ie[g-1]==o)break e;break}}if(u)u.push(m);else{m.toIe.length;)Ie[Ie.length]=256;let n=[],i=e==ci?0:1;return to(s,i,i,t,0,s.length,n),n}function Pu(s){return[new Hn(0,s,0)]}let Nu="";function rg(s,e,t,n,i){var r;let l=n.head-s.from,o=Hn.find(e,l,(r=n.bidiLevel)!==null&&r!==void 0?r:-1,n.assoc),a=e[o],h=a.side(i,t);if(l==h){let u=o+=i?1:-1;if(u<0||u>=e.length)return null;a=e[o=u],l=a.side(!i,t),h=a.side(i,t)}let c=mt(s.text,l,a.forward(i,t));(ca.to)&&(c=h),Nu=s.text.slice(Math.min(l,c),Math.max(l,c));let f=o==(i?e.length-1:0)?null:e[o+(i?1:-1)];return f&&c==h&&f.level+(i?0:1)s.some(e=>e)}),Vu=le.define({combine:s=>s.some(e=>e)});class Mi{constructor(e,t="nearest",n="nearest",i=5,r=5,l=!1){this.range=e,this.y=t,this.x=n,this.yMargin=i,this.xMargin=r,this.isSnapshot=l}map(e){return e.empty?this:new Mi(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Mi(q.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Rs=Ne.define({map:(s,e)=>s.map(e)});function An(s,e,t){let n=s.facet(Ru);n.length?n[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const $r=le.define({combine:s=>s.length?s[0]:!0});let og=0;const Yi=le.define();class rt{constructor(e,t,n,i,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=i,this.extension=r(this)}static define(e,t){const{eventHandlers:n,eventObservers:i,provide:r,decorations:l}=t||{};return new rt(og++,e,n,i,o=>{let a=[Yi.of(o)];return l&&a.push(ps.of(h=>{let c=h.plugin(o);return c?l(c):Be.none})),r&&a.push(r(o)),a})}static fromClass(e,t){return rt.define(n=>new e(n),t)}}class pl{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(An(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){An(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){An(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Hu=le.define(),zo=le.define(),ps=le.define(),Fu=le.define(),jo=le.define(),Wu=le.define();function th(s,e){let t=s.state.facet(Wu);if(!t.length)return t;let n=t.map(r=>r instanceof Function?r(s):r),i=[];return Ee.spans(n,e.from,e.to,{point(){},span(r,l,o,a){let h=r-e.from,c=l-e.from,f=i;for(let u=o.length-1;u>=0;u--,a--){let d=o[u].spec.bidiIsolate,p;if(d==null&&(d=lg(e.text,h,c)),a>0&&f.length&&(p=f[f.length-1]).to==h&&p.direction==d)p.to=c,f=p.inner;else{let m={from:h,to:c,direction:d,inner:[]};f.push(m),f=m.inner}}}}),i}const qu=le.define();function Uu(s){let e=0,t=0,n=0,i=0;for(let r of s.state.facet(qu)){let l=r(s);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(t=Math.max(t,l.right)),l.top!=null&&(n=Math.max(n,l.top)),l.bottom!=null&&(i=Math.max(i,l.bottom)))}return{left:e,right:t,top:n,bottom:i}}const Xi=le.define();class It{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}join(e){return new It(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>n.toA)){if(i.toAc)break;r+=2}if(!a)return n;new It(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),l=a.toA,o=a.toB}}}class pr{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Ge.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let i=[];this.changes.iterChangedRanges((r,l,o,a)=>i.push(new It(r,l,o,a))),this.changedRanges=i}static create(e,t,n){return new pr(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class nh extends je{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Je],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new It(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:h,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let i=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!pg(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let r=i>-1?hg(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:c}=this.hasComposition;n=new It(h,c,e.changes.mapPos(h,-1),e.changes.mapPos(c,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(se.ie||se.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,o=this.updateDeco(),a=ug(l,o,e.changes);return n=It.extendWithRanges(n,a),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let l=se.chrome||se.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,l),this.flags&=-8,l&&(l.written||i.selectionRange.focusNode!=l.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(l=>l.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?i[l]:null;if(!o)break;let{fromA:a,toA:h,fromB:c,toB:f}=o,u,d,p,m;if(n&&n.range.fromBc){let M=rs.build(this.view.state.doc,c,n.range.fromB,this.decorations,this.dynamicDecorationMap),B=rs.build(this.view.state.doc,n.range.toB,f,this.decorations,this.dynamicDecorationMap);d=M.breakAtStart,p=M.openStart,m=B.openEnd;let N=this.compositionView(n);B.breakAtStart?N.breakAfter=1:B.content.length&&N.merge(N.length,N.length,B.content[0],!1,B.openStart,0)&&(N.breakAfter=B.content[0].breakAfter,B.content.shift()),M.content.length&&N.merge(0,0,M.content[M.content.length-1],!0,0,M.openEnd)&&M.content.pop(),u=M.content.concat(N).concat(B.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:m}=rs.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:b}=r.findPos(h,1),{i:v,off:O}=r.findPos(a,-1);yu(this,v,O,g,b,u,d,p,m)}n&&this.fixCompositionDOM(n)}compositionView(e){let t=new En(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new On(i,[t],t.length);let n=new Je;return n.append(t,0),n}fixCompositionDOM(e){let t=(r,l)=>{l.flags|=8|(l.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(l);let o=je.get(r);o&&o!=l&&(o.dom=null),l.setDOM(r)},n=this.childPos(e.range.fromB,1),i=this.children[n.i];t(e.line,i);for(let r=e.marks.length-1;r>=-1;r--)n=i.childPos(n.off,1),i=i.children[n.i],t(r>=0?e.marks[r].node:e.text,i)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,i=n==this.dom,r=!i&&nr(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(i||t||r))return;let l=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(o.anchor)),h=o.empty?a:this.moveToLine(this.domAtPos(o.head));if(se.gecko&&o.empty&&!this.hasComposition&&ag(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new ct(f,0),l=!0}let c=this.view.observer.selectionRange;(l||!c.focusNode||(!ss(a.node,a.offset,c.anchorNode,c.anchorOffset)||!ss(h.node,h.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,o))&&(this.view.observer.ignore(()=>{se.android&&se.chrome&&this.dom.contains(c.focusNode)&&dg(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=dr(this.view.root);if(f)if(o.empty){if(se.gecko){let u=cg(a.node,a.offset);if(u&&u!=3){let d=Ju(a.node,a.offset,u==1?1:-1);d&&(a=new ct(d.node,d.offset))}}f.collapse(a.node,a.offset),o.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=o.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();o.anchor>o.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new ct(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new ct(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ss(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=dr(e.root),{anchorNode:i,anchorOffset:r}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let l=Je.find(this,t.head);if(!l)return;let o=l.posAtStart;if(t.head==o||t.head==o+l.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&n.collapse(i,r)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let i=e.offset;!n&&i=0;i--){let r=je.get(t.childNodes[i]);r instanceof Je&&(n=r.domAtPos(r.length))}return n?new ct(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=je.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;l--){let o=this.children[l],a=r-o.breakAfter,h=a-o.length;if(ae||o.covers(1))&&(!n||o instanceof Je&&!(n instanceof Je&&t>=0))&&(n=o,i=h),r=h}return n?n.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),i=this.children[t];if(!(i instanceof Je))return null;for(;i.children.length;){let{i:o,off:a}=i.childPos(n,1);for(;;o++){if(o==i.children.length)return null;if((i=i.children[o]).length)break}n=a}if(!(i instanceof En))return null;let r=mt(i.text,n);if(r==n)return null;let l=hi(i.dom,n,r).getClientRects();for(let o=0;oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==He.LTR;for(let h=0,c=0;ci)break;if(h>=n){let d=f.dom.getBoundingClientRect();if(t.push(d.height),l){let p=f.dom.lastChild,m=p?us(p):[];if(m.length){let g=m[m.length-1],b=a?g.right-d.left:d.right-g.left;b>o&&(o=b,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?He.RTL:He.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Je){let l=r.measureTextSize();if(l)return l}let e=document.createElement("div"),t,n,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=us(e.firstChild)[0];t=e.getBoundingClientRect().height,n=r?r.width/27:7,i=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new vu(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,i=0;;i++){let r=i==t.viewports.length?null:t.viewports[i],l=r?r.from-1:this.length;if(l>n){let o=(t.lineBlockAt(l).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(Be.replace({widget:new ih(o),block:!0,inclusive:!0,isBlockGap:!0}).range(n,l))}if(!r)break;n=r.to+1}return Be.set(e)}updateDeco(){let e=this.view.state.facet(ps).map((i,r)=>(this.dynamicDecorationMap[r]=typeof i=="function")?i(this.view):i),t=!1,n=this.view.state.facet(Fu).map((i,r)=>{let l=typeof i=="function";return l&&(t=!0),l?i(this.view):i});n.length&&(this.dynamicDecorationMap[e.length]=t,e.push(Ee.join(n)));for(let i=e.length;it.anchor?-1:1),i;if(!n)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,i.left),top:Math.min(n.top,i.top),right:Math.max(n.right,i.right),bottom:Math.max(n.bottom,i.bottom)});let r=Uu(this.view),l={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:o,offsetHeight:a}=this.view.scrollDOM;Hm(this.view.scrollDOM,l,t.head0)n=n.childNodes[i-1],i=Tn(n);else break}if(t>=0)for(let n=s,i=e;;){if(n.nodeType==3)return{node:n,offset:i};if(n.nodeType==1&&i=0)n=n.childNodes[i],i=0;else break}return null}function cg(s,e){return s.nodeType!=1?0:(e&&s.childNodes[e-1].contentEditable=="false"?1:0)|(e{ne.from&&(t=!0)}),t}function mg(s,e,t=1){let n=s.charCategorizer(e),i=s.doc.lineAt(e),r=e-i.from;if(i.length==0)return q.cursor(e);r==0?t=1:r==i.length&&(t=-1);let l=r,o=r;t<0?l=mt(i.text,r,!1):o=mt(i.text,r);let a=n(i.text.slice(l,o));for(;l>0;){let h=mt(i.text,l,!1);if(n(i.text.slice(h,l))!=a)break;l=h}for(;os?e.left-s:Math.max(0,s-e.right)}function bg(s,e){return e.top>s?e.top-s:Math.max(0,s-e.bottom)}function ml(s,e){return s.tope.top+1}function sh(s,e){return es.bottom?{top:s.top,left:s.left,right:s.right,bottom:e}:s}function io(s,e,t){let n,i,r,l,o=!1,a,h,c,f;for(let p=s.firstChild;p;p=p.nextSibling){let m=us(p);for(let g=0;gO||l==O&&r>v){n=p,i=b,r=v,l=O;let M=O?t0?g0)}v==0?t>b.bottom&&(!c||c.bottomb.top)&&(h=p,f=b):c&&ml(c,b)?c=rh(c,b.bottom):f&&ml(f,b)&&(f=sh(f,b.top))}}if(c&&c.bottom>=t?(n=a,i=c):f&&f.top<=t&&(n=h,i=f),!n)return{node:s,offset:0};let u=Math.max(i.left,Math.min(i.right,e));if(n.nodeType==3)return lh(n,u,t);if(o&&n.contentEditable!="false")return io(n,u,t);let d=Array.prototype.indexOf.call(s.childNodes,n)+(e>=(i.left+i.right)/2?1:0);return{node:s,offset:d}}function lh(s,e,t){let n=s.nodeValue.length,i=-1,r=1e9,l=0;for(let o=0;ot?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((se.chrome||se.gecko)&&hi(s,o).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:s,offset:o+(d?1:0)};i=o+(d?1:0),r=f}}}return{node:s,offset:i>-1?i:l>0?s.nodeValue.length:0}}function Gu(s,e,t,n=-1){var i,r;let l=s.contentDOM.getBoundingClientRect(),o=l.top+s.viewState.paddingTop,a,{docHeight:h}=s.viewState,{x:c,y:f}=e,u=f-o;if(u<0)return 0;if(u>h)return s.state.doc.length;for(let M=s.viewState.heightOracle.textHeight/2,B=!1;a=s.elementAtHeight(u),a.type!=gt.Text;)for(;u=n>0?a.bottom+M:a.top-M,!(u>=0&&u<=h);){if(B)return t?null:0;B=!0,n=-n}f=o+u;let d=a.from;if(ds.viewport.to)return s.viewport.to==s.state.doc.length?s.state.doc.length:t?null:oh(s,l,a,c,f);let p=s.dom.ownerDocument,m=s.root.elementFromPoint?s.root:p,g=m.elementFromPoint(c,f);g&&!s.contentDOM.contains(g)&&(g=null),g||(c=Math.max(l.left+1,Math.min(l.right-1,c)),g=m.elementFromPoint(c,f),g&&!s.contentDOM.contains(g)&&(g=null));let b,v=-1;if(g&&((i=s.docView.nearest(g))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let M=p.caretPositionFromPoint(c,f);M&&({offsetNode:b,offset:v}=M)}else if(p.caretRangeFromPoint){let M=p.caretRangeFromPoint(c,f);M&&({startContainer:b,startOffset:v}=M,(!s.contentDOM.contains(b)||se.safari&&_g(b,v,c)||se.chrome&&kg(b,v,c))&&(b=void 0))}}if(!b||!s.docView.dom.contains(b)){let M=Je.find(s.docView,d);if(!M)return u>a.top+a.height/2?a.to:a.from;({node:b,offset:v}=io(M.dom,c,f))}let O=s.docView.nearest(b);if(!O)return null;if(O.isWidget&&((r=O.dom)===null||r===void 0?void 0:r.nodeType)==1){let M=O.dom.getBoundingClientRect();return e.ys.defaultLineHeight*1.5){let o=s.viewState.heightOracle.textHeight,a=Math.floor((i-t.top-(s.defaultLineHeight-o)*.5)/o);r+=a*s.viewState.heightOracle.lineLength}let l=s.state.sliceDoc(t.from,t.to);return t.from+Fl(l,r,s.state.tabSize)}function _g(s,e,t){let n;if(s.nodeType!=3||e!=(n=s.nodeValue.length))return!1;for(let i=s.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return hi(s,n-1,n).getBoundingClientRect().left>t}function kg(s,e,t){if(e!=0)return!1;for(let i=s;;){let r=i.parentNode;if(!r||r.nodeType!=1||r.firstChild!=i)return!1;if(r.classList.contains("cm-line"))break;i=r}let n=s.nodeType==1?s.getBoundingClientRect():hi(s,0,Math.max(s.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function so(s,e){let t=s.lineBlockAt(e);if(Array.isArray(t.type)){for(let n of t.type)if(n.to>e||n.to==e&&(n.to==t.to||n.type==gt.Text))return n}return t}function vg(s,e,t,n){let i=so(s,e.head),r=!n||i.type!=gt.Text||!(s.lineWrapping||i.widgetLineBreaks)?null:s.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(r){let l=s.dom.getBoundingClientRect(),o=s.textDirectionAt(i.from),a=s.posAtCoords({x:t==(o==He.LTR)?l.right-1:l.left+1,y:(r.top+r.bottom)/2});if(a!=null)return q.cursor(a,t?-1:1)}return q.cursor(t?i.to:i.from,t?-1:1)}function ah(s,e,t,n){let i=s.state.doc.lineAt(e.head),r=s.bidiSpans(i),l=s.textDirectionAt(i.from);for(let o=e,a=null;;){let h=rg(i,r,l,o,t),c=Nu;if(!h){if(i.number==(t?s.state.doc.lines:1))return o;c=` +`,i=s.state.doc.line(i.number+(t?1:-1)),r=s.bidiSpans(i),h=s.visualLineSide(i,!t)}if(a){if(!a(c))return o}else{if(!n)return h;a=n(c)}o=h}}function yg(s,e,t){let n=s.state.charCategorizer(e),i=n(t);return r=>{let l=n(r);return i==xn.Space&&(i=l),i==l}}function wg(s,e,t,n){let i=e.head,r=t?1:-1;if(i==(t?s.state.doc.length:0))return q.cursor(i,e.assoc);let l=e.goalColumn,o,a=s.contentDOM.getBoundingClientRect(),h=s.coordsAtPos(i,e.assoc||-1),c=s.documentTop;if(h)l==null&&(l=h.left-a.left),o=r<0?h.top:h.bottom;else{let d=s.viewState.lineBlockAt(i);l==null&&(l=Math.min(a.right-a.left,s.defaultCharacterWidth*(i-d.from))),o=(r<0?d.top:d.bottom)+c}let f=a.left+l,u=n??s.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=o+(u+d)*r,m=Gu(s,{x:f,y:p},!1,r);if(pa.bottom||(r<0?mi)){let g=s.docView.coordsForChar(m),b=!g||p{if(e>r&&ei(s)),t.from,e.head>t.from?-1:1);return n==t.from?t:q.cursor(n,nnull),se.gecko&&zg(e.contentDOM.ownerDocument)}handleEvent(e){!Dg(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let n=this.handlers[e];if(n){for(let i of n.observers)i(this.view,t);for(let i of n.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=xg(e),n=this.handlers,i=this.view.contentDOM;for(let r in t)if(r!="scroll"){let l=!t[r].handlers.length,o=n[r];o&&l!=!o.handlers.length&&(i.removeEventListener(r,this.handleEvent),o=null),o||i.addEventListener(r,this.handleEvent,{passive:l})}for(let r in n)r!="scroll"&&!t[r]&&i.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()n.keyCode==e.keyCode))&&!e.ctrlKey||Ag.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,Ci(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:se.safari&&!se.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function hh(s,e){return(t,n)=>{try{return e.call(s,n,t)}catch(i){An(t.state,i)}}}function xg(s){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of s){let i=n.spec;if(i&&i.domEventHandlers)for(let r in i.domEventHandlers){let l=i.domEventHandlers[r];l&&t(r).handlers.push(hh(n.value,l))}if(i&&i.domEventObservers)for(let r in i.domEventObservers){let l=i.domEventObservers[r];l&&t(r).observers.push(hh(n.value,l))}}for(let n in Ut)t(n).handlers.push(Ut[n]);for(let n in Kt)t(n).observers.push(Kt[n]);return e}const Yu=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Ag="dthko",Xu=[16,17,18,20,91,92,224,225],Is=6;function zs(s){return Math.max(0,s)*.7+8}function Cg(s,e){return Math.max(Math.abs(s.clientX-e.clientX),Math.abs(s.clientY-e.clientY))}class Mg{constructor(e,t,n,i){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=Fm(e.contentDOM),this.atoms=e.state.facet(jo).map(l=>l(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ye.allowMultipleSelections)&&Tg(e,t),this.dragging=Og(e,t)&&td(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Cg(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},l=Uu(this.view);e.clientX-l.left<=r.left+Is?n=-zs(r.left-e.clientX):e.clientX+l.right>=r.right-Is&&(n=zs(e.clientX-r.right)),e.clientY-l.top<=r.top+Is?i=-zs(r.top-e.clientY):e.clientY+l.bottom>=r.bottom-Is&&(i=zs(e.clientY-r.bottom)),this.setScrollSpeed(n,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nthis.select(this.lastEvent),20)}}function Tg(s,e){let t=s.state.facet(Bu);return t.length?t[0](e):se.mac?e.metaKey:e.ctrlKey}function Eg(s,e){let t=s.state.facet(Lu);return t.length?t[0](e):se.mac?!e.altKey:!e.ctrlKey}function Og(s,e){let{main:t}=s.state.selection;if(t.empty)return!1;let n=dr(s.root);if(!n||n.rangeCount==0)return!0;let i=n.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function Dg(s,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=s.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=je.get(t))&&n.ignoreEvent(e))return!1;return!0}const Ut=Object.create(null),Kt=Object.create(null),Zu=se.ie&&se.ie_version<15||se.ios&&se.webkit_version<604;function Pg(s){let e=s.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{s.focus(),t.remove(),Qu(s,t.value)},50)}function Qu(s,e){let{state:t}=s,n,i=1,r=t.toText(e),l=r.lines==t.selection.ranges.length;if(ro!=null&&t.selection.ranges.every(a=>a.empty)&&ro==r.toString()){let a=-1;n=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((l?r.line(i++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:q.cursor(h.from+f.length)}})}else l?n=t.changeByRange(a=>{let h=r.line(i++);return{changes:{from:a.from,to:a.to,insert:h.text},range:q.cursor(a.from+h.length)}}):n=t.replaceSelection(r);s.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Kt.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft};Ut.keydown=(s,e)=>(s.inputState.setSelectionOrigin("select"),e.keyCode==27&&(s.inputState.lastEscPress=Date.now()),!1);Kt.touchstart=(s,e)=>{s.inputState.lastTouchTime=Date.now(),s.inputState.setSelectionOrigin("select.pointer")};Kt.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")};Ut.mousedown=(s,e)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of s.state.facet($u))if(t=n(s,e),t)break;if(!t&&e.button==0&&(t=Lg(s,e)),t){let n=!s.hasFocus;s.inputState.startMouseSelection(new Mg(s,e,t,n)),n&&s.observer.ignore(()=>bu(s.contentDOM));let i=s.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function ch(s,e,t,n){if(n==1)return q.cursor(e,t);if(n==2)return mg(s.state,e,t);{let i=Je.find(s.docView,e),r=s.state.doc.lineAt(i?i.posAtEnd:e),l=i?i.posAtStart:r.from,o=i?i.posAtEnd:r.to;return os>=e.top&&s<=e.bottom,fh=(s,e,t)=>ed(e,t)&&s>=t.left&&s<=t.right;function Ng(s,e,t,n){let i=Je.find(s.docView,e);if(!i)return 1;let r=e-i.posAtStart;if(r==0)return 1;if(r==i.length)return-1;let l=i.coordsAt(r,-1);if(l&&fh(t,n,l))return-1;let o=i.coordsAt(r,1);return o&&fh(t,n,o)?1:l&&ed(n,l)?-1:1}function uh(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Ng(s,t,e.clientX,e.clientY)}}const Bg=se.ie&&se.ie_version<=11;let dh=null,ph=0,mh=0;function td(s){if(!Bg)return s.detail;let e=dh,t=mh;return dh=s,mh=Date.now(),ph=!e||t>Date.now()-400&&Math.abs(e.clientX-s.clientX)<2&&Math.abs(e.clientY-s.clientY)<2?(ph+1)%3:1}function Lg(s,e){let t=uh(s,e),n=td(e),i=s.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),i=i.map(r.changes))},get(r,l,o){let a=uh(s,r),h,c=ch(s,a.pos,a.bias,n);if(t.pos!=a.pos&&!l){let f=ch(s,t.pos,t.bias,n),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=$g(i,a.pos))?h:o?i.addRange(c):q.create([c])}}}function $g(s,e){for(let t=0;t=e)return q.create(s.ranges.slice(0,t).concat(s.ranges.slice(t+1)),s.mainIndex==t?0:s.mainIndex-(s.mainIndex>t?1:0))}return null}Ut.dragstart=(s,e)=>{let{selection:{main:t}}=s.state;if(e.target.draggable){let i=s.docView.nearest(e.target);if(i&&i.isWidget){let r=i.posAtStart,l=r+i.length;(r>=t.to||l<=t.from)&&(t=q.range(r,l))}}let{inputState:n}=s;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",s.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};Ut.dragend=s=>(s.inputState.draggedContent=null,!1);function gh(s,e,t,n){if(!t)return;let i=s.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=s.inputState,l=n&&r&&Eg(s,e)?{from:r.from,to:r.to}:null,o={from:i,insert:t},a=s.state.changes(l?[l,o]:o);s.focus(),s.dispatch({changes:a,selection:{anchor:a.mapPos(i,-1),head:a.mapPos(i,1)},userEvent:l?"move.drop":"input.drop"}),s.inputState.draggedContent=null}Ut.drop=(s,e)=>{if(!e.dataTransfer)return!1;if(s.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),i=0,r=()=>{++i==t.length&&gh(s,e,n.filter(l=>l!=null).join(s.state.lineBreak),!1)};for(let l=0;l{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(n[l]=o.result),r()},o.readAsText(t[l])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return gh(s,e,n,!0),!0}return!1};Ut.paste=(s,e)=>{if(s.state.readOnly)return!0;s.observer.flush();let t=Zu?null:e.clipboardData;return t?(Qu(s,t.getData("text/plain")||t.getData("text/uri-text")),!0):(Pg(s),!1)};function Rg(s,e){let t=s.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),s.focus()},50)}function Ig(s){let e=[],t=[],n=!1;for(let i of s.selection.ranges)i.empty||(e.push(s.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:r}of s.selection.ranges){let l=s.doc.lineAt(r);l.number>i&&(e.push(l.text),t.push({from:l.from,to:Math.min(s.doc.length,l.to+1)})),i=l.number}n=!0}return{text:e.join(s.lineBreak),ranges:t,linewise:n}}let ro=null;Ut.copy=Ut.cut=(s,e)=>{let{text:t,ranges:n,linewise:i}=Ig(s.state);if(!t&&!i)return!1;ro=i?t:null,e.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let r=Zu?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(Rg(s,t),!1)};const nd=Yn.define();function id(s,e){let t=[];for(let n of s.facet(zu)){let i=n(s,e);i&&t.push(i)}return t?s.update({effects:t,annotations:nd.of(!0)}):null}function sd(s){setTimeout(()=>{let e=s.hasFocus;if(e!=s.inputState.notifiedFocused){let t=id(s.state,e);t?s.dispatch(t):s.update([])}},10)}Kt.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),sd(s)};Kt.blur=s=>{s.observer.clearSelectionRange(),sd(s)};Kt.compositionstart=Kt.compositionupdate=s=>{s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0)};Kt.compositionend=s=>{s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,se.chrome&&se.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50)};Kt.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()};Ut.beforeinput=(s,e)=>{var t;let n;if(se.chrome&&se.android&&(n=Yu.find(i=>i.inputType==e.inputType))&&(s.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let i=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>i+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return!1};const bh=new Set;function zg(s){bh.has(s)||(bh.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}const _h=["pre-wrap","normal","pre-line","break-spaces"];class jg{constructor(e){this.lineWrapping=e,this.doc=De.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return _h.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=i,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>sr&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return bt.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,i){let r=this,l=n.doc;for(let o=i.length-1;o>=0;o--){let{fromA:a,toA:h,fromB:c,toB:f}=i[o],u=r.lineAt(a,ze.ByPosNoHeight,n.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,ze.ByPosNoHeight,n,0,0);for(f+=d.to-h,h=d.to;o>0&&u.from<=i[o-1].toA;)a=i[o-1].fromA,c=i[o-1].fromB,o--,ar*2){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),n+=1+o.break,i-=o.size}else if(r>i*2){let o=e[n];o.break?e.splice(n,1,o.left,null,o.right):e.splice(n,1,o.left,o.right),n+=2+o.break,r-=o.size}else break;else if(i=r&&l(this.blockAt(0,n,i,r))}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(e,i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ct extends rd{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,i){return new hn(i,this.length,n,this.height,this.breaks)}replace(e,t,n){let i=n[0];return n.length==1&&(i instanceof Ct||i instanceof nt&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof nt?i=new Ct(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):bt.of(n)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more?this.setHeight(e,i.heights[i.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class nt extends bt{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,r=i-n+1,l,o=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);l=a/r,this.length>r+1&&(o=(this.height-a)/(this.length-r-1))}else l=this.height/r;return{firstLine:n,lastLine:i,perLine:l,perChar:o}}blockAt(e,t,n,i){let{firstLine:r,lastLine:l,perLine:o,perChar:a}=this.heightMetrics(t,i);if(t.lineWrapping){let h=i+Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length),c=t.doc.lineAt(h),f=o+c.length*a,u=Math.max(n,e-f/2);return new hn(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(l-r,Math.floor((e-n)/o))),{from:c,length:f}=t.doc.line(r+h);return new hn(c,f,n+o*h,o,0)}}lineAt(e,t,n,i,r){if(t==ze.ByHeight)return this.blockAt(e,n,i,r);if(t==ze.ByPosNoHeight){let{from:d,to:p}=n.doc.lineAt(e);return new hn(d,p-d,0,0,0)}let{firstLine:l,perLine:o,perChar:a}=this.heightMetrics(n,r),h=n.doc.lineAt(e),c=o+h.length*a,f=h.number-l,u=i+o*f+a*(h.from-r-f);return new hn(h.from,h.length,Math.max(i,Math.min(u,i+this.height-c)),c,0)}forEachLine(e,t,n,i,r,l){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:o,perLine:a,perChar:h}=this.heightMetrics(n,r);for(let c=e,f=i;c<=t;){let u=n.doc.lineAt(c);if(c==e){let p=u.number-o;f+=a*p+h*(e-r-p)}let d=a+h*u.length;l(new hn(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(e,t,n){let i=this.length-t;if(i>0){let r=n[n.length-1];r instanceof nt?n[n.length-1]=new nt(r.length+i):n.push(null,new nt(i-1))}if(e>0){let r=n[0];r instanceof nt?n[0]=new nt(e+r.length):n.unshift(new nt(e-1),null)}return bt.of(n)}decomposeLeft(e,t){t.push(new nt(e-1),null)}decomposeRight(e,t){t.push(null,new nt(this.length-e-1))}updateHeight(e,t=0,n=!1,i){let r=t+this.length;if(i&&i.from<=t+this.length&&i.more){let l=[],o=Math.max(t,i.from),a=-1;for(i.from>t&&l.push(new nt(i.from-t-1).updateHeight(e,t));o<=r&&i.more;){let c=e.doc.lineAt(o).length;l.length&&l.push(null);let f=i.heights[i.index++];a==-1?a=f:Math.abs(f-a)>=sr&&(a=-2);let u=new Ct(c,f);u.outdated=!1,l.push(u),o+=c+1}o<=r&&l.push(null,new nt(r-o).updateHeight(e,o));let h=bt.of(l);return(a<0||Math.abs(h.height-this.height)>=sr||Math.abs(a-this.heightMetrics(e,t).perLine)>=sr)&&(e.heightChanged=!0),h}else(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Hg extends bt{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,i){let r=n+this.left.height;return eo))return h;let c=t==ze.ByPosNoHeight?ze.ByPosNoHeight:ze.ByPos;return a?h.join(this.right.lineAt(o,c,n,l,o)):this.left.lineAt(o,c,n,i,r).join(h)}forEachLine(e,t,n,i,r,l){let o=i+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,o,a,l);else{let h=this.lineAt(a,ze.ByPos,n,i,r);e=e&&h.from<=t&&l(h),t>h.to&&this.right.forEachLine(h.to+1,t,n,o,a,l)}}replace(e,t,n){let i=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,n));let r=[];e>0&&this.decomposeLeft(e,r);let l=r.length;for(let o of n)r.push(o);if(e>0&&kh(r,l-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e2*t.size||t.size>2*e.size?bt.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,i){let{left:r,right:l}=this,o=t+r.length+this.break,a=null;return i&&i.from<=t+r.length&&i.more?a=r=r.updateHeight(e,t,n,i):r.updateHeight(e,t,n),i&&i.from<=o+l.length&&i.more?a=l=l.updateHeight(e,o,n,i):l.updateHeight(e,o,n),a?this.balanced(r,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function kh(s,e){let t,n;s[e]==null&&(t=s[e-1])instanceof nt&&(n=s[e+1])instanceof nt&&s.splice(e-1,3,new nt(t.length+1+n.length))}const Fg=5;class Vo{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Ct?i.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Ct(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=Fg)&&this.addLineDeco(i,r,l)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ct(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new nt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ct)return e;let t=new Ct(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ct)&&!this.isCovered?this.nodes.push(new Ct(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),l=Math.min(l,u.right),o=Math.max(o,u.top),a=h==s.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,l)-t.left,top:o-(t.top+e),bottom:Math.max(o,a)-(t.top+e)}}function Kg(s,e){let t=s.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class bl{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;ntypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new jg(t),this.stateDeco=e.facet(ps).filter(n=>typeof n!="function"),this.heightMap=bt.empty().applyChanges(this.stateDeco,De.empty,this.heightOracle.setDoc(e.doc),[new It(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Be.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let i=n?t.head:t.anchor;if(!e.some(({from:r,to:l})=>i>=r&&i<=l)){let{from:r,to:l}=this.lineBlockAt(i);e.push(new js(r,l))}}this.viewports=e.sort((n,i)=>n.from-i.from),this.scaler=this.heightMap.height<=7e6?yh:new Xg(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:Zi(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(ps).filter(c=>typeof c!="function");let i=e.changedRanges,r=It.extendWithRanges(i,Wg(n,this.stateDeco,e?e.changes:Ge.empty(this.state.doc.length))),l=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=l&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Vu)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),i=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?He.RTL:He.LTR;let l=this.heightOracle.mustRefreshForWrapping(r),o=t.getBoundingClientRect(),a=l||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let h=0,c=0;if(o.width&&o.height){let{scaleX:M,scaleY:B}=gu(t,o);(this.scaleX!=M||this.scaleY!=B)&&(this.scaleX=M,this.scaleY=B,h|=8,l=a=!0)}let f=(parseInt(n.paddingTop)||0)*this.scaleY,u=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=ku(e.scrollDOM);let p=(this.printing?Kg:Ug)(t,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),a){let M=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(M)&&(l=!0),l||i.lineWrapping&&Math.abs(v-this.contentDOMWidth)>i.charWidth){let{lineHeight:B,charWidth:N,textHeight:E}=e.docView.measureTextSize();l=B>0&&i.refresh(r,B,N,E,v/N,M),l&&(e.docView.minWidth=0,h|=8)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),i.heightChanged=!1;for(let B of this.viewports){let N=B.from==this.viewport.from?M:e.docView.measureVisibleLineHeights(B);this.heightMap=(l?bt.empty().applyChanges(this.stateDeco,De.empty,this.heightOracle,[new It(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,l,new Vg(B.from,N))}i.heightChanged&&(h|=2)}let O=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return O&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||O)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,r=this.heightOracle,{visibleTop:l,visibleBottom:o}=this,a=new js(i.lineAt(l-n*1e3,ze.ByHeight,r,0,0).from,i.lineAt(o+(1-n)*1e3,ze.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(h,ze.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=o+Math.max(10,Math.min(n,250)))&&i>l-2*1e3&&r>1,l=i<<1;if(this.defaultTextDirection!=He.LTR&&!n)return[];let o=[],a=(h,c,f,u)=>{if(c-hh&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-h)g.fromb));if(!m){if(cg.from<=c&&g.to>=c)){let g=t.moveToLineBoundary(q.cursor(c),!1,!0).head;g>h&&(c=g)}m=new bl(h,c,this.gapSize(f,h,c,u))}o.push(m)};for(let h of this.viewportLines){if(h.lengthh.from&&a(h.from,u,h,c),dt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Ee.spans(e,this.viewport.from,this.viewport.to,{span(i,r){t.push({from:i,to:r})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some((i,r)=>i.from!=t[r].from||i.to!=t[r].to);return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Zi(this.heightMap.lineAt(e,ze.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return Zi(this.heightMap.lineAt(this.scaler.fromDOM(e),ze.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Zi(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class js{constructor(e,t){this.from=e,this.to=t}}function Gg(s,e,t){let n=[],i=s,r=0;return Ee.spans(t,s,e,{span(){},point(l,o){l>i&&(n.push({from:i,to:l}),r+=l-i),i=o}},20),i=1)return e[e.length-1].to;let n=Math.floor(s*t);for(let i=0;;i++){let{from:r,to:l}=e[i],o=l-r;if(n<=o)return r+n;n-=o}}function Hs(s,e){let t=0;for(let{from:n,to:i}of s.ranges){if(e<=i){t+=e-n;break}t+=i-n}return t/s.total}function Yg(s,e){for(let t of s)if(e(t))return t}const yh={toDOM(s){return s},fromDOM(s){return s},scale:1};class Xg{constructor(e,t,n){let i=0,r=0,l=0;this.viewports=n.map(({from:o,to:a})=>{let h=t.lineAt(o,ze.ByPos,e,0,0).top,c=t.lineAt(a,ze.ByPos,e,0,0).bottom;return i+=c-h,{from:o,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let o of this.viewports)o.domTop=l+(o.top-r)*this.scale,l=o.domBottom=o.domTop+(o.bottom-o.top),r=o.bottom}toDOM(e){for(let t=0,n=0,i=0;;t++){let r=tZi(i,e)):s._content)}const Fs=le.define({combine:s=>s.join(" ")}),lo=le.define({combine:s=>s.indexOf(!0)>-1}),oo=qn.newName(),ld=qn.newName(),od=qn.newName(),ad={"&light":"."+ld,"&dark":"."+od};function ao(s,e,t){return new qn(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,i=>{if(i=="&")return s;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):s+" "+n}})}const Zg=ao("."+oo,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ad),Qi="￿";class Qg{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(ye.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Qi}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let r=this.text.length;this.readNode(i);let l=i.nextSibling;if(l==t)break;let o=je.get(i),a=je.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:wh(i))||wh(l)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>r)&&this.lineBreak(),i=l}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,l=1,o;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,n),l=this.lineSeparator.length):(o=i.exec(t))&&(r=o.index,l=o[0].length),this.append(t.slice(n,r<0?t.length:r)),r<0)break;if(this.lineBreak(),l>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=l-1);n=r+l}}readNode(e){if(e.cmIgnore)return;let t=je.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let i=n.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(e0(e,n.node,n.offset)?t:0))}}function e0(s,e,t){for(;;){if(!e||t-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let o=r||l?[]:s0(e),a=new Qg(o,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=r0(o,this.bounds.from)}else{let o=e.observer.selectionRange,a=r&&r.node==o.focusNode&&r.offset==o.focusOffset||!Ul(e.contentDOM,o.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(o.focusNode,o.focusOffset),h=l&&l.node==o.anchorNode&&l.offset==o.anchorOffset||!Ul(e.contentDOM,o.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(o.anchorNode,o.anchorOffset),c=e.viewport;if((se.ios||se.chrome)&&e.state.selection.main.empty&&a!=h&&(c.from>0||c.toDate.now()-100?s.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:o}=e.bounds,a=i.from,h=null;(r===8||se.android&&e.text.length=i.from&&t.to<=i.to&&(t.from!=i.from||t.to!=i.to)&&i.to-i.from-(t.to-t.from)<=4?t={from:i.from,to:i.to,insert:s.state.doc.slice(i.from,t.from).append(t.insert).append(s.state.doc.slice(t.to,i.to))}:(se.mac||se.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=q.single(n.main.anchor-1,n.main.head-1)),t={from:i.from,to:i.to,insert:De.of([" "])}):se.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==` + `&&s.lineWrapping&&(n&&(n=q.single(n.main.anchor-1,n.main.head-1)),t={from:i.from,to:i.to,insert:De.of([" "])}),t){if(se.ios&&s.inputState.flushIOSKey()||se.android&&(t.from==i.from&&t.to==i.to&&t.insert.length==1&&t.insert.lines==2&&Ci(s.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.lengthi.head)&&Ci(s.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&Ci(s.contentDOM,"Delete",46)))return!0;let l=t.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let o,a=()=>o||(o=n0(s,t,n));return s.state.facet(Iu).some(h=>h(s,t.from,t.to,l,a))||s.dispatch(a()),!0}else if(n&&!n.main.eq(i)){let l=!1,o="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(l=!0),o=s.inputState.lastSelectionOrigin),s.dispatch({selection:n,scrollIntoView:l,userEvent:o}),!0}else return!1}function n0(s,e,t){let n,i=s.state,r=i.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&s.inputState.composing<0){let o=r.frome.to?i.sliceDoc(e.to,r.to):"";n=i.replaceSelection(s.state.toText(o+e.insert.sliceString(0,void 0,s.state.lineBreak)+a))}else{let o=i.changes(e),a=t&&t.main.to<=o.newLength?t.main:void 0;if(i.selection.ranges.length>1&&s.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let h=s.state.sliceDoc(e.from,e.to),c,f=t&&Ku(s,t.main.head);if(f){let p=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-p}}else c=s.state.doc.lineAt(r.head);let u=r.to-e.to,d=r.to-r.from;n=i.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:o,range:a||p.map(o)};let m=p.to-u,g=m-h.length;if(p.to-p.from!=d||s.state.sliceDoc(g,m)!=h||p.to>=c.from&&p.from<=c.to)return{range:p};let b=i.changes({from:g,to:m,insert:e.insert}),v=p.to-r.to;return{changes:b,range:a?q.range(Math.max(0,a.anchor+v),Math.max(0,a.head+v)):p.map(b)}})}else n={changes:o,selection:a&&i.selection.replaceRange(a)}}let l="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,l+=".compose",s.inputState.compositionFirstChange&&(l+=".start",s.inputState.compositionFirstChange=!1)),i.update(n,{userEvent:l,scrollIntoView:!0})}function i0(s,e,t,n){let i=Math.min(s.length,e.length),r=0;for(;r0&&o>0&&s.charCodeAt(l-1)==e.charCodeAt(o-1);)l--,o--;if(n=="end"){let a=Math.max(0,r-Math.min(l,o));t-=l+a-r}if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}else if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}return{from:r,toA:l,toB:o}}function s0(s){let e=[];if(s.root.activeElement!=s.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:i,focusOffset:r}=s.observer.selectionRange;return t&&(e.push(new Sh(t,n)),(i!=t||r!=n)&&e.push(new Sh(i,r))),e}function r0(s,e){if(s.length==0)return null;let t=s[0].pos,n=s.length==2?s[1].pos:t;return t>-1&&n>-1?q.single(t+e,n+e):null}const l0={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},_l=se.ie&&se.ie_version<=11;class o0{constructor(e){this.view=e,this.active=!1,this.selectionRange=new Wm,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(se.ie&&se.ie_version<=11||se.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),_l&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet($r)?n.root.activeElement!=this.dom:!nr(n.dom,i))return;let r=i.anchorNode&&n.docView.nearest(i.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(se.ie&&se.ie_version<=11||se.android&&se.chrome)&&!n.state.selection.main.empty&&i.focusNode&&ss(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=se.safari&&e.root.nodeType==11&&jm(this.dom.ownerDocument)==this.dom&&a0(this.view)||dr(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=nr(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Ci(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,i=!1;for(let r of e){let l=this.readMutation(r);l&&(l.typeOver&&(i=!0),t==-1?{from:t,to:n}=l:(t=Math.min(l.from,t),n=Math.max(l.to,n)))}return{from:t,to:n,typeOver:i}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),i=this.selectionChanged&&nr(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new t0(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,i=hd(this.view,t);return this.view.state==n&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=xh(t,e.previousSibling||e.target.previousSibling,-1),i=xh(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function xh(s,e,t){for(;e;){let n=je.get(e);if(n&&n.parent==s)return n;let i=e.parentNode;e=i!=s.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function a0(s){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(s.contentDOM.addEventListener("beforeinput",t,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let n=e.startContainer,i=e.startOffset,r=e.endContainer,l=e.endOffset,o=s.docView.domAtPos(s.state.selection.main.anchor);return ss(o.node,o.offset,r,l)&&([n,i,r,l]=[r,l,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:l}}class ae{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(n=>n.forEach(i=>t(i,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||qm(e.parent)||document,this.viewState=new vh(e.state||ye.create(e)),e.scrollTo&&e.scrollTo.is(Rs)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Yi).map(n=>new pl(n));for(let n of this.plugins)n.update(this);this.observer=new o0(this),this.inputState=new Sg(this),this.inputState.ensureHandlers(this.plugins),this.docView=new nh(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof Xe?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,i,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let l=this.hasFocus,o=0,a=null;e.some(u=>u.annotation(nd))?(this.inputState.notifiedFocused=l,o=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,a=id(r,l),a||(o=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(ye.phrases)!=this.state.facet(ye.phrases))return this.setState(r);i=pr.create(this,r,e),i.flags|=o;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new Mi(d.empty?d:q.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(Rs)&&(f=d.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=mr.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(Xi)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Fs)!=i.state.facet(Fs)&&(this.viewState.mustMeasureContent=!0),(t||n||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!i.empty)for(let u of this.state.facet(no))try{u(i)}catch(d){An(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!hd(this,c)&&h.force&&Ci(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new vh(e),this.plugins=e.facet(Yi).map(n=>new pl(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new nh(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Yi),n=e.state.facet(Yi);if(t!=n){let i=[];for(let r of n){let l=t.indexOf(r);if(l<0)i.push(new pl(r));else{let o=this.plugins[l];o.mustUpdate=e,i.push(o)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,i=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:l}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(l<0)if(ku(n))r=-1,l=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(i);r=d.from,l=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return An(this.state,p),Ah}}),f=pr.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f));for(let d=0;d1||p<-1){i=i+p,n.scrollTop=i/this.scaleY,l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let o of this.state.facet(no))o(t)}get themeClasses(){return oo+" "+(this.state.facet(lo)?od:ld)+" "+this.state.facet(Fs)}updateAttrs(){let e=Ch(this,Hu,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet($r)?"true":"false",class:"cm-content",style:`${se.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Ch(this,zo,t);let n=this.observer.ignore(()=>{let i=Xl(this.contentDOM,this.contentAttrs,t),r=Xl(this.dom,this.editorAttrs,e);return i||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let i of n.effects)if(i.is(ae.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Xi);let e=this.state.facet(ae.cspNonce);qn.mount(this.root,this.styleModules.concat(Zg).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tn.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return gl(this,e,ah(this,e,t,n))}moveByGroup(e,t){return gl(this,e,ah(this,e,t,n=>yg(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),i=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return q.cursor(r.side(t,i)+e.from,r.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,n=!0){return vg(this,e,t,n)}moveVertically(e,t,n){return gl(this,e,wg(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Gu(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),l=r[Hn.find(r,e-i.from,-1,t)];return Lo(n,l.dir==He.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(ju)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>h0)return Pu(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||Du(r.isolates,n=th(this,e))))return r.order;n||(n=th(this,e));let i=sg(e.text,t,n);return this.bidiCache.push(new mr(e.from,e.to,t,n,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||se.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{bu(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Rs.of(new Mi(typeof e=="number"?q.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Rs.of(new Mi(q.cursor(n.from),"start","start",n.top-e,t,!0))}static domEventHandlers(e){return rt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return rt.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=qn.newName(),i=[Fs.of(n),Xi.of(ao(`.${n}`,e))];return t&&t.dark&&i.push(lo.of(!0)),i}static baseTheme(e){return Br.lowest(Xi.of(ao("."+oo,e,ad)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&&je.get(n)||je.get(e);return((t=i==null?void 0:i.rootView)===null||t===void 0?void 0:t.view)||null}}ae.styleModule=Xi;ae.inputHandler=Iu;ae.focusChangeEffect=zu;ae.perLineTextDirection=ju;ae.exceptionSink=Ru;ae.updateListener=no;ae.editable=$r;ae.mouseSelectionStyle=$u;ae.dragMovesSelection=Lu;ae.clickAddsSelectionRange=Bu;ae.decorations=ps;ae.outerDecorations=Fu;ae.atomicRanges=jo;ae.bidiIsolatedRanges=Wu;ae.scrollMargins=qu;ae.darkTheme=lo;ae.cspNonce=le.define({combine:s=>s.length?s[0]:""});ae.contentAttributes=zo;ae.editorAttributes=Hu;ae.lineWrapping=ae.contentAttributes.of({class:"cm-lineWrapping"});ae.announce=Ne.define();const h0=4096,Ah={};class mr{constructor(e,t,n,i,r,l){this.from=e,this.to=t,this.dir=n,this.isolates=i,this.fresh=r,this.order=l}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:He.LTR;for(let r=Math.max(0,e.length-10);r=0;i--){let r=n[i],l=typeof r=="function"?r(s):r;l&&Yl(l,t)}return t}const c0=se.mac?"mac":se.windows?"win":se.linux?"linux":"key";function f0(s,e){const t=s.split(/-(?!$)/);let n=t[t.length-1];n=="Space"&&(n=" ");let i,r,l,o;for(let a=0;an.concat(i),[]))),t}function hS(s,e,t){return ud(fd(s.state),e,s,t)}let zn=null;const d0=4e3;function p0(s,e=c0){let t=Object.create(null),n=Object.create(null),i=(l,o)=>{let a=n[l];if(a==null)n[l]=o;else if(a!=o)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},r=(l,o,a,h,c)=>{var f,u;let d=t[l]||(t[l]=Object.create(null)),p=o.split(/ (?!$)/).map(b=>f0(b,e));for(let b=1;b{let M=zn={view:O,prefix:v,scope:l};return setTimeout(()=>{zn==M&&(zn=null)},d0),!0}]})}let m=p.join(" ");i(m,!1);let g=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&g.run.push(a),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let l of s){let o=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let h of o){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(l.any)}let a=l[e]||l.key;if(a)for(let h of o)r(h,a,l.run,l.preventDefault,l.stopPropagation),l.shift&&r(h,"Shift-"+a,l.shift,l.preventDefault,l.stopPropagation)}return t}function ud(s,e,t,n){let i=zm(e),r=ns(i,0),l=Dl(r)==i.length&&i!=" ",o="",a=!1,h=!1,c=!1;zn&&zn.view==t&&zn.scope==n&&(o=zn.prefix+" ",Xu.indexOf(e.keyCode)<0&&(h=!0,zn=null));let f=new Set,u=g=>{if(g){for(let b of g.run)if(!f.has(b)&&(f.add(b),b(t,e)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=s[n],p,m;return d&&(u(d[o+Ws(i,e,!l)])?a=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(se.windows&&e.ctrlKey&&e.altKey)&&(p=Un[e.keyCode])&&p!=i?(u(d[o+Ws(p,e,!0)])||e.shiftKey&&(m=fs[e.keyCode])!=i&&m!=p&&u(d[o+Ws(m,e,!1)]))&&(a=!0):l&&e.shiftKey&&u(d[o+Ws(i,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),a}class As{constructor(e,t,n,i,r){this.className=e,this.left=t,this.top=n,this.width=i,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let r=dd(e);return[new As(t,i.left-r.left,i.top-r.top,null,i.bottom-i.top)]}else return m0(e,t,n)}}function dd(s){let e=s.scrollDOM.getBoundingClientRect();return{left:(s.textDirection==He.LTR?e.left:e.right-s.scrollDOM.clientWidth*s.scaleX)-s.scrollDOM.scrollLeft*s.scaleX,top:e.top-s.scrollDOM.scrollTop*s.scaleY}}function Th(s,e,t){let n=q.cursor(e);return{from:Math.max(t.from,s.moveToLineBoundary(n,!1,!0).from),to:Math.min(t.to,s.moveToLineBoundary(n,!0,!0).from),type:gt.Text}}function m0(s,e,t){if(t.to<=s.viewport.from||t.from>=s.viewport.to)return[];let n=Math.max(t.from,s.viewport.from),i=Math.min(t.to,s.viewport.to),r=s.textDirection==He.LTR,l=s.contentDOM,o=l.getBoundingClientRect(),a=dd(s),h=l.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=o.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=o.right-(c?parseInt(c.paddingRight):0),d=so(s,n),p=so(s,i),m=d.type==gt.Text?d:null,g=p.type==gt.Text?p:null;if(m&&(s.lineWrapping||d.widgetLineBreaks)&&(m=Th(s,n,m)),g&&(s.lineWrapping||p.widgetLineBreaks)&&(g=Th(s,i,g)),m&&g&&m.from==g.from)return v(O(t.from,t.to,m));{let B=m?O(t.from,null,m):M(d,!1),N=g?O(null,t.to,g):M(p,!0),E=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&B.bottom+s.defaultLineHeight/2D&&W.from=Y)break;ge>ne&&R(Math.max(fe,ne),B==null&&fe<=D,Math.min(ge,Y),N==null&&ge>=C,j.dir)}if(ne=he.to+1,ne>=Y)break}return F.length==0&&R(D,B==null,C,N==null,s.textDirection),{top:V,bottom:$,horizontal:F}}function M(B,N){let E=o.top+(N?B.top:B.bottom);return{top:E,bottom:E,horizontal:[]}}}function g0(s,e){return s.constructor==e.constructor&&s.eq(e)}class b0{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(rr)!=e.state.facet(rr)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,n=e.facet(rr);for(;t!g0(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[n].constructor&&i.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(i.draw(),t);for(;t;){let i=t.nextSibling;t.remove(),t=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const rr=le.define();function pd(s){return[rt.define(e=>new b0(e,s)),rr.of(s)]}const md=!se.ios,ms=le.define({combine(s){return Pi(s,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function cS(s={}){return[ms.of(s),_0,k0,v0,Vu.of(!0)]}function gd(s){return s.startState.facet(ms)!=s.state.facet(ms)}const _0=pd({above:!0,markers(s){let{state:e}=s,t=e.facet(ms),n=[];for(let i of e.selection.ranges){let r=i==e.selection.main;if(i.empty?!r||md:t.drawRangeCursor){let l=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=i.empty?i:q.cursor(i.head,i.head>i.anchor?-1:1);for(let a of As.forRange(s,l,o))n.push(a)}}return n},update(s,e){s.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=gd(s);return t&&Eh(s.state,e),s.docChanged||s.selectionSet||t},mount(s,e){Eh(e.state,s)},class:"cm-cursorLayer"});function Eh(s,e){e.style.animationDuration=s.facet(ms).cursorBlinkRate+"ms"}const k0=pd({above:!1,markers(s){return s.state.selection.ranges.map(e=>e.empty?[]:As.forRange(s,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(s,e){return s.docChanged||s.selectionSet||s.viewportChanged||gd(s)},class:"cm-selectionLayer"}),ho={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};md&&(ho[".cm-line"].caretColor="transparent !important",ho[".cm-content"]={caretColor:"transparent !important"});const v0=Br.highest(ae.theme(ho)),bd=Ne.define({map(s,e){return s==null?null:e.mapPos(s)}}),es=Nt.define({create(){return null},update(s,e){return s!=null&&(s=e.changes.mapPos(s)),e.effects.reduce((t,n)=>n.is(bd)?n.value:t,s)}}),y0=rt.fromClass(class{constructor(s){this.view=s,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(s){var e;let t=s.state.field(es);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(s.startState.field(es)!=t||s.docChanged||s.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:s}=this,e=s.state.field(es),t=e!=null&&s.coordsAtPos(e);if(!t)return null;let n=s.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+s.scrollDOM.scrollLeft*s.scaleX,top:t.top-n.top+s.scrollDOM.scrollTop*s.scaleY,height:t.bottom-t.top}}drawCursor(s){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;s?(this.cursor.style.left=s.left/e+"px",this.cursor.style.top=s.top/t+"px",this.cursor.style.height=s.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(s){this.view.state.field(es)!=s&&this.view.dispatch({effects:bd.of(s)})}},{eventObservers:{dragover(s){this.setDropPos(this.view.posAtCoords({x:s.clientX,y:s.clientY}))},dragleave(s){(s.target==this.view.contentDOM||!this.view.contentDOM.contains(s.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function fS(){return[es,y0]}function Oh(s,e,t,n,i){e.lastIndex=0;for(let r=s.iterRange(t,n),l=t,o;!r.next().done;l+=r.value.length)if(!r.lineBreak)for(;o=e.exec(r.value);)i(l+o.index,o)}function w0(s,e){let t=s.visibleRanges;if(t.length==1&&t[0].from==s.viewport.from&&t[0].to==s.viewport.to)return t;let n=[];for(let{from:i,to:r}of t)i=Math.max(s.state.doc.lineAt(i).from,i-e),r=Math.min(s.state.doc.lineAt(r).to,r+e),n.length&&n[n.length-1].to>=i?n[n.length-1].to=r:n.push({from:i,to:r});return n}class S0{constructor(e){const{regexp:t,decoration:n,decorate:i,boundary:r,maxLength:l=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(o,a,h,c)=>i(c,h,h+o[0].length,o,a);else if(typeof n=="function")this.addMatch=(o,a,h,c)=>{let f=n(o,a,h);f&&c(h,h+o[0].length,f)};else if(n)this.addMatch=(o,a,h,c)=>c(h,h+o[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=l}createDeco(e){let t=new ai,n=t.add.bind(t);for(let{from:i,to:r}of w0(e,this.maxLength))Oh(e.state.doc,this.regexp,i,r,(l,o)=>this.addMatch(o,e,l,n));return t.finish()}updateDeco(e,t){let n=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((r,l,o,a)=>{a>e.view.viewport.from&&o1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),n,i):t}updateRange(e,t,n,i){for(let r of e.visibleRanges){let l=Math.max(r.from,n),o=Math.min(r.to,i);if(o>l){let a=e.state.doc.lineAt(l),h=a.toa.from;l--)if(this.boundary.test(a.text[l-1-a.from])){c=l;break}for(;ou.push(b.range(m,g));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:u})}}return t}}const co=/x/.unicode!=null?"gu":"g",x0=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,co),A0={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let kl=null;function C0(){var s;if(kl==null&&typeof document<"u"&&document.body){let e=document.body.style;kl=((s=e.tabSize)!==null&&s!==void 0?s:e.MozTabSize)!=null}return kl||!1}const lr=le.define({combine(s){let e=Pi(s,{render:null,specialChars:x0,addSpecialChars:null});return(e.replaceTabs=!C0())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,co)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,co)),e}});function uS(s={}){return[lr.of(s),M0()]}let Dh=null;function M0(){return Dh||(Dh=rt.fromClass(class{constructor(s){this.view=s,this.decorations=Be.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(s.state.facet(lr)),this.decorations=this.decorator.createDeco(s)}makeDecorator(s){return new S0({regexp:s.specialChars,decoration:(e,t,n)=>{let{doc:i}=t.state,r=ns(e[0],0);if(r==9){let l=i.lineAt(n),o=t.state.tabSize,a=Ni(l.text,o,n-l.from);return Be.replace({widget:new D0((o-a%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=Be.replace({widget:new O0(s,r)}))},boundary:s.replaceTabs?void 0:/[^]/})}update(s){let e=s.state.facet(lr);s.startState.facet(lr)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(s.view)):this.decorations=this.decorator.updateDeco(s,this.decorations)}},{decorations:s=>s.decorations}))}const T0="•";function E0(s){return s>=32?T0:s==10?"␤":String.fromCharCode(9216+s)}class O0 extends pi{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=E0(this.code),n=e.state.phrase("Control character")+" "+(A0[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,n,t);if(i)return i;let r=document.createElement("span");return r.textContent=t,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class D0 extends pi{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function dS(){return N0}const P0=Be.line({class:"cm-activeLine"}),N0=rt.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.docChanged||s.selectionSet)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let e=-1,t=[];for(let n of s.state.selection.ranges){let i=s.lineBlockAt(n.head);i.from>e&&(t.push(P0.range(i.from)),e=i.from)}return Be.set(t)}},{decorations:s=>s.decorations}),fo=2e3;function B0(s,e,t){let n=Math.min(e.line,t.line),i=Math.max(e.line,t.line),r=[];if(e.off>fo||t.off>fo||e.col<0||t.col<0){let l=Math.min(e.off,t.off),o=Math.max(e.off,t.off);for(let a=n;a<=i;a++){let h=s.doc.line(a);h.length<=o&&r.push(q.range(h.from+l,h.to+o))}}else{let l=Math.min(e.col,t.col),o=Math.max(e.col,t.col);for(let a=n;a<=i;a++){let h=s.doc.line(a),c=Fl(h.text,l,s.tabSize,!0);if(c<0)r.push(q.cursor(h.to));else{let f=Fl(h.text,o,s.tabSize);r.push(q.range(h.from+c,h.from+f))}}}return r}function L0(s,e){let t=s.coordsAtPos(s.viewport.from);return t?Math.round(Math.abs((t.left-e)/s.defaultCharacterWidth)):-1}function Ph(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1),n=s.state.doc.lineAt(t),i=t-n.from,r=i>fo?-1:i==n.length?L0(s,e.clientX):Ni(n.text,s.state.tabSize,t-n.from);return{line:n.number,col:r,off:i}}function $0(s,e){let t=Ph(s,e),n=s.state.selection;return t?{update(i){if(i.docChanged){let r=i.changes.mapPos(i.startState.doc.line(t.line).from),l=i.state.doc.lineAt(r);t={line:l.number,col:t.col,off:Math.min(t.off,l.length)},n=n.map(i.changes)}},get(i,r,l){let o=Ph(s,i);if(!o)return n;let a=B0(s.state,t,o);return a.length?l?q.create(a.concat(n.ranges)):q.create(a):n}}:null}function pS(s){let e=(s==null?void 0:s.eventFilter)||(t=>t.altKey&&t.button==0);return ae.mouseSelectionStyle.of((t,n)=>e(n)?$0(t,n):null)}const R0={Alt:[18,s=>!!s.altKey],Control:[17,s=>!!s.ctrlKey],Shift:[16,s=>!!s.shiftKey],Meta:[91,s=>!!s.metaKey]},I0={style:"cursor: crosshair"};function mS(s={}){let[e,t]=R0[s.key||"Alt"],n=rt.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[n,ae.contentAttributes.of(i=>{var r;return!((r=i.plugin(n))===null||r===void 0)&&r.isDown?I0:null})]}const Ui="-10000px";class _d{constructor(e,t,n,i){this.facet=t,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(l=>l);let r=null;this.tooltipViews=this.tooltips.map(l=>r=n(l,r))}update(e,t){var n;let i=e.state.facet(this.facet),r=i.filter(a=>a);if(i===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let l=[],o=t?[]:null;for(let a=0;at[h]=a),t.length=o.length),this.input=i,this.tooltips=r,this.tooltipViews=l,!0}}function z0(s){let{win:e}=s;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const vl=le.define({combine:s=>{var e,t,n;return{position:se.ios?"absolute":((e=s.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=s.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=s.find(i=>i.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||z0}}}),Nh=new WeakMap,Ho=rt.fromClass(class{constructor(s){this.view=s,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=s.state.facet(vl);this.position=e.position,this.parent=e.parent,this.classes=s.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new _d(s,kd,(t,n)=>this.createTooltip(t,n),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),s.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let s of this.manager.tooltipViews)this.intersectionObserver.observe(s.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(s){s.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(s,this.above);e&&this.observeIntersection();let t=e||s.geometryChanged,n=s.state.facet(vl);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(s,e){let t=s.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),s.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.insertBefore(i,n)}return t.dom.style.position=this.position,t.dom.style.top=Ui,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var s,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(s=n.destroy)===null||s===void 0||s.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let s=this.view.dom.getBoundingClientRect(),e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(se.gecko)n=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==Ui&&i.style.left=="0px"){let r=i.getBoundingClientRect();n=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,t=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:s,parent:this.parent?this.container.getBoundingClientRect():s,pos:this.manager.tooltips.map((i,r)=>{let l=this.manager.tooltipViews[r];return l.getCoords?l.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(vl).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(s){var e;if(s.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{editor:t,space:n,scaleX:i,scaleY:r}=s,l=[];for(let o=0;o=Math.min(t.bottom,n.bottom)||f.rightMath.min(t.right,n.right)+.1){c.style.top=Ui;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=u.right-u.left,g=(e=Nh.get(h))!==null&&e!==void 0?e:u.bottom-u.top,b=h.offset||V0,v=this.view.textDirection==He.LTR,O=u.width>n.right-n.left?v?n.left:n.right-u.width:v?Math.min(f.left-(d?14:0)+b.x,n.right-m):Math.max(n.left,f.left-m+(d?14:0)-b.x),M=this.above[o];!a.strictSide&&(M?f.top-(u.bottom-u.top)-b.yn.bottom)&&M==n.bottom-f.bottom>f.top-n.top&&(M=this.above[o]=!M);let B=(M?f.top-n.top:n.bottom-f.bottom)-p;if(BO&&V.topN&&(N=M?V.top-g-2-p:V.bottom+p+2);if(this.position=="absolute"?(c.style.top=(N-s.parent.top)/r+"px",c.style.left=(O-s.parent.left)/i+"px"):(c.style.top=N/r+"px",c.style.left=O/i+"px"),d){let V=f.left+(v?b.x:-b.x)-(O+14-7);d.style.left=V/i+"px"}h.overlap!==!0&&l.push({left:O,top:N,right:E,bottom:N+g}),c.classList.toggle("cm-tooltip-above",M),c.classList.toggle("cm-tooltip-below",!M),h.positioned&&h.positioned(s.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let s of this.manager.tooltipViews)s.dom.style.top=Ui}},{eventObservers:{scroll(){this.maybeMeasure()}}}),j0=ae.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),V0={x:0,y:0},kd=le.define({enables:[Ho,j0]}),gr=le.define({combine:s=>s.reduce((e,t)=>e.concat(t),[])});class Rr{static create(e){return new Rr(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new _d(e,gr,(t,n)=>this.createHostedView(t,n),t=>t.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let i=n[e];if(i!==void 0){if(t===void 0)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const H0=kd.compute([gr],s=>{let e=s.facet(gr);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return(n=t.end)!==null&&n!==void 0?n:t.pos})),create:Rr.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class F0{constructor(e,t,n,i,r){this.view=e,this.source=t,this.field=n,this.setHover=i,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;eo.bottom||t.xo.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),h=a&&a.dir==He.RTL?-1:1;r=t.x{this.pending==o&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>An(e.state,a,"hover tooltip"))}else l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])})}get tooltip(){let e=this.view.plugin(Ho),t=e?e.manager.tooltips.findIndex(n=>n.create==Rr.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:r}=this;if(i.length&&r&&!W0(r.dom,e)||this.pending){let{pos:l}=i[0]||this.pending,o=(n=(t=i[0])===null||t===void 0?void 0:t.end)!==null&&n!==void 0?n:l;(l==o?this.view.posAtCoords(this.lastMove)!=l:!q0(this.view,l,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const qs=4;function W0(s,e){let t=s.getBoundingClientRect();return e.clientX>=t.left-qs&&e.clientX<=t.right+qs&&e.clientY>=t.top-qs&&e.clientY<=t.bottom+qs}function q0(s,e,t,n,i,r){let l=s.scrollDOM.getBoundingClientRect(),o=s.documentTop+s.documentPadding.top+s.contentHeight;if(l.left>n||l.righti||Math.min(l.bottom,o)=e&&a<=t}function gS(s,e={}){let t=Ne.define(),n=Nt.define({create(){return[]},update(i,r){if(i.length&&(e.hideOnChange&&(r.docChanged||r.selection)?i=[]:e.hideOn&&(i=i.filter(l=>!e.hideOn(r,l))),r.docChanged))for(let l of i){let o=r.changes.mapPos(l.pos,-1,vt.TrackDel);if(o!=null){let a=Object.assign(Object.create(null),l);a.pos=o,a.end!=null&&(a.end=r.changes.mapPos(a.end))}}for(let l of r.effects)l.is(t)&&(i=l.value),l.is(U0)&&(i=[]);return i},provide:i=>gr.from(i)});return[n,rt.define(i=>new F0(i,s,n,t,e.hoverTime||300)),H0]}function bS(s,e){let t=s.plugin(Ho);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}const U0=Ne.define(),Bh=le.define({combine(s){let e,t;for(let n of s)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function _S(s,e){let t=s.plugin(vd),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}const vd=rt.fromClass(class{constructor(s){this.input=s.state.facet($h),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(s));let e=s.state.facet(Bh);this.top=new Us(s,!0,e.topContainer),this.bottom=new Us(s,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(s){let e=s.state.facet(Bh);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Us(s.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Us(s.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=s.state.facet($h);if(t!=this.input){let n=t.filter(a=>a),i=[],r=[],l=[],o=[];for(let a of n){let h=this.specs.indexOf(a),c;h<0?(c=a(s.view),o.push(c)):(c=this.panels[h],c.update&&c.update(s)),i.push(c),(c.top?r:l).push(c)}this.specs=n,this.panels=i,this.top.sync(r),this.bottom.sync(l);for(let a of o)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let n of this.panels)n.update&&n.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>ae.scrollMargins.of(e=>{let t=e.plugin(s);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Us{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Lh(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Lh(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Lh(s){let e=s.nextSibling;return s.remove(),e}const $h=le.define({enables:vd});class Dn extends Ei{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Dn.prototype.elementClass="";Dn.prototype.toDOM=void 0;Dn.prototype.mapMode=vt.TrackBefore;Dn.prototype.startSide=Dn.prototype.endSide=-1;Dn.prototype.point=!0;const or=le.define(),K0={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ee.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ls=le.define();function J0(s){return[yd(),ls.of(Object.assign(Object.assign({},K0),s))]}const uo=le.define({combine:s=>s.some(e=>e)});function yd(s){let e=[G0];return s&&s.fixed===!1&&e.push(uo.of(!0)),e}const G0=rt.fromClass(class{constructor(s){this.view=s,this.prevViewport=s.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=s.state.facet(ls).map(e=>new Ih(s,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!s.state.facet(uo),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),s.scrollDOM.insertBefore(this.dom,s.contentDOM)}update(s){if(this.updateGutters(s)){let e=this.prevViewport,t=s.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}s.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(uo)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=s.view.viewport}syncGutters(s){let e=this.dom.nextSibling;s&&this.dom.remove();let t=Ee.iter(this.view.state.facet(or),this.view.viewport.from),n=[],i=this.gutters.map(r=>new Y0(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(r.type)){let l=!0;for(let o of r.type)if(o.type==gt.Text&&l){po(t,n,o.from);for(let a of i)a.line(this.view,o,n);l=!1}else if(o.widget)for(let a of i)a.widget(this.view,o)}else if(r.type==gt.Text){po(t,n,r.from);for(let l of i)l.line(this.view,r,n)}else if(r.widget)for(let l of i)l.widget(this.view,r);for(let r of i)r.finish();s&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(s){let e=s.startState.facet(ls),t=s.state.facet(ls),n=s.docChanged||s.heightChanged||s.viewportChanged||!Ee.eq(s.startState.facet(or),s.state.facet(or),s.view.viewport.from,s.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(s)&&(n=!0);else{n=!0;let i=[];for(let r of t){let l=e.indexOf(r);l<0?i.push(new Ih(this.view,r)):(this.gutters[l].update(s),i.push(this.gutters[l]))}for(let r of this.gutters)r.dom.remove(),i.indexOf(r)<0&&r.destroy();for(let r of i)this.dom.appendChild(r.dom);this.gutters=i}return n}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove()}},{provide:s=>ae.scrollMargins.of(e=>{let t=e.plugin(s);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==He.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function Rh(s){return Array.isArray(s)?s:[s]}function po(s,e,t){for(;s.value&&s.from<=t;)s.from==t&&e.push(s.value),s.next()}class Y0{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Ee.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,r=(t.top-this.height)/e.scaleY,l=t.height/e.scaleY;if(this.i==i.elements.length){let o=new wd(e,l,r,n);i.elements.push(o),i.dom.appendChild(o.dom)}else i.elements[this.i].update(e,l,r,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];po(this.cursor,i,t.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let l=this.gutter;i.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Ih{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,i=>{let r=i.target,l;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();l=(a.top+a.bottom)/2}else l=i.clientY;let o=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[n](e,o,i)&&i.preventDefault()});this.markers=Rh(t.markers(e)),t.initialSpacer&&(this.spacer=new wd(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Rh(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let n=e.view.viewport;return!Ee.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class wd{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),X0(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let r=0,l=0;;){let o=l,a=rr(o,a,h)||l(o,a,h):l}return n}})}});class yl extends Dn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function wl(s,e){return s.state.facet(wi).formatNumber(e,s.state)}const Q0=ls.compute([wi],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Z0)},lineMarker(e,t,n){return n.some(i=>i.toDOM)?null:new yl(wl(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(wi)!=e.state.facet(wi),initialSpacer(e){return new yl(wl(e,zh(e.state.doc.lines)))},updateSpacer(e,t){let n=wl(t.view,zh(t.view.state.doc.lines));return n==e.number?e:new yl(n)},domEventHandlers:s.facet(wi).domEventHandlers}));function kS(s={}){return[wi.of(s),yd(),Q0]}function zh(s){let e=9;for(;e{let e=[],t=-1;for(let n of s.selection.ranges){let i=s.doc.lineAt(n.head).from;i>t&&(t=i,e.push(e1.range(i)))}return Ee.of(e)});function vS(){return t1}const n1=1024;let i1=0;class $t{constructor(e,t){this.from=e,this.to=t}}class ve{constructor(e={}){this.id=i1++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=wt.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}ve.closedBy=new ve({deserialize:s=>s.split(" ")});ve.openedBy=new ve({deserialize:s=>s.split(" ")});ve.group=new ve({deserialize:s=>s.split(" ")});ve.isolate=new ve({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});ve.contextHash=new ve({perNode:!0});ve.lookAhead=new ve({perNode:!0});ve.mounted=new ve({perNode:!0});class gs{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[ve.mounted.id]}}const s1=Object.create(null);class wt{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):s1,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new wt(e.name||"",t,e.id,n);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(i)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ve.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return n=>{for(let i=n.prop(ve.group),r=-1;r<(i?i.length:0);r++){let l=t[r<0?n.name:i[r]];if(l)return l}}}}wt.none=new wt("",Object.create(null),0,8);class Sd{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(l|We.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=i&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(o||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:qo(wt.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,i)=>new Ze(this.type,t,n,i,this.propValues),e.makeTree||((t,n,i)=>new Ze(wt.none,t,n,i)))}static build(e){return a1(e)}}Ze.empty=new Ze(wt.none,[],[],0);class Fo{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Fo(this.buffer,this.index)}}class Jn{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return wt.none}toString(){let e=[];for(let t=0;t0));a=l[a+3]);return o}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),l=0;for(let o=e,a=0;o=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function bs(s,e,t,n){for(var i;s.from==s.to||(t<1?s.from>=e:s.from>e)||(t>-1?s.to<=e:s.to0?o.length:-1;e!=h;e+=t){let c=o[e],f=a[e]+l.from;if(xd(i,n,f,f+c.length)){if(c instanceof Jn){if(r&We.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-f,i);if(u>-1)return new cn(new r1(l,c,e,f),null,u)}else if(r&We.IncludeAnonymous||!c.type.isAnonymous||Wo(c)){let u;if(!(r&We.IgnoreMounts)&&(u=gs.get(c))&&!u.overlay)return new ft(u.tree,f,e,l);let d=new ft(c,f,e,l);return r&We.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,i)}}}if(r&We.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let i;if(!(n&We.IgnoreOverlays)&&(i=gs.get(this._tree))&&i.overlay){let r=e-this.from;for(let{from:l,to:o}of i.overlay)if((t>0?l<=r:l=r:o>r))return new ft(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Vh(s,e,t,n){let i=s.cursor(),r=[];if(!i.firstChild())return r;if(t!=null){for(let l=!1;!l;)if(l=i.type.is(t),!i.nextSibling())return r}for(;;){if(n!=null&&i.type.is(n))return r;if(i.type.is(e)&&r.push(i.node),!i.nextSibling())return n==null?r:[]}}function mo(s,e,t=e.length-1){for(let n=s.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class r1{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class cn extends Ad{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new cn(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&We.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new cn(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new cn(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new cn(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let l=n.buffer[this.index+1];e.push(n.slice(i,r,l)),t.push(0)}return new Ze(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Cd(s){if(!s.length)return null;let e=0,t=s[0];for(let r=1;rt.from||l.to=e){let o=new ft(l.tree,l.overlay[0].from+r.from,-1,r);(i||(i=[n])).push(bs(o,e,t,!1))}}return i?Cd(i):n}class br{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof ft)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof ft?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&We.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&We.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&We.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let r=t+e,l=e<0?-1:n._tree.children.length;r!=l;r+=e){let o=n._tree.children[r];if(this.mode&We.IncludeAnonymous||o instanceof Jn||!o.type.isAnonymous||Wo(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let l=e;l;l=l._parent)if(l.index==i){if(i==this.index)return l;t=l,n=r+1;break e}i=this.stack[--r]}for(let i=n;i=0;r--){if(r<0)return mo(this.node,e,i);let l=n[t.buffer[this.stack[r]]];if(!l.isAnonymous){if(e[i]&&e[i]!=l.name)return!1;i--}}return!0}}function Wo(s){return s.children.some(e=>e instanceof Jn||!e.type.isAnonymous||Wo(e))}function a1(s){var e;let{buffer:t,nodeSet:n,maxBufferLength:i=n1,reused:r=[],minRepeatType:l=n.types.length}=s,o=Array.isArray(t)?new Fo(t,t.length):t,a=n.types,h=0,c=0;function f(B,N,E,V,$,F){let{id:R,start:D,end:C,size:W}=o,ne=c;for(;W<0;)if(o.next(),W==-1){let ge=r[R];E.push(ge),V.push(D-B);return}else if(W==-3){h=R;return}else if(W==-4){c=R;return}else throw new RangeError(`Unrecognized record size: ${W}`);let Y=a[R],he,j,fe=D-B;if(C-D<=i&&(j=g(o.pos-N,$))){let ge=new Uint16Array(j.size-j.skip),Re=o.pos-j.size,we=ge.length;for(;o.pos>Re;)we=b(j.start,ge,we);he=new Jn(ge,C-j.start,n),fe=j.start-B}else{let ge=o.pos-W;o.next();let Re=[],we=[],dt=R>=l?R:-1,X=0,pe=C;for(;o.pos>ge;)dt>=0&&o.id==dt&&o.size>=0?(o.end<=pe-i&&(p(Re,we,D,X,o.end,pe,dt,ne),X=Re.length,pe=o.end),o.next()):F>2500?u(D,ge,Re,we):f(D,ge,Re,we,dt,F+1);if(dt>=0&&X>0&&X-1&&X>0){let et=d(Y);he=qo(Y,Re,we,0,Re.length,0,C-D,et,et)}else he=m(Y,Re,we,C-D,ne-C)}E.push(he),V.push(fe)}function u(B,N,E,V){let $=[],F=0,R=-1;for(;o.pos>N;){let{id:D,start:C,end:W,size:ne}=o;if(ne>4)o.next();else{if(R>-1&&C=0;W-=3)D[ne++]=$[W],D[ne++]=$[W+1]-C,D[ne++]=$[W+2]-C,D[ne++]=ne;E.push(new Jn(D,$[2]-C,n)),V.push(C-B)}}function d(B){return(N,E,V)=>{let $=0,F=N.length-1,R,D;if(F>=0&&(R=N[F])instanceof Ze){if(!F&&R.type==B&&R.length==V)return R;(D=R.prop(ve.lookAhead))&&($=E[F]+R.length+D)}return m(B,N,E,V,$)}}function p(B,N,E,V,$,F,R,D){let C=[],W=[];for(;B.length>V;)C.push(B.pop()),W.push(N.pop()+E-$);B.push(m(n.types[R],C,W,F-$,D-F)),N.push($-E)}function m(B,N,E,V,$=0,F){if(h){let R=[ve.contextHash,h];F=F?[R].concat(F):[R]}if($>25){let R=[ve.lookAhead,$];F=F?[R].concat(F):[R]}return new Ze(B,N,E,V,F)}function g(B,N){let E=o.fork(),V=0,$=0,F=0,R=E.end-i,D={size:0,start:0,skip:0};e:for(let C=E.pos-B;E.pos>C;){let W=E.size;if(E.id==N&&W>=0){D.size=V,D.start=$,D.skip=F,F+=4,V+=4,E.next();continue}let ne=E.pos-W;if(W<0||ne=l?4:0,he=E.start;for(E.next();E.pos>ne;){if(E.size<0)if(E.size==-3)Y+=4;else break e;else E.id>=l&&(Y+=4);E.next()}$=he,V+=W,F+=Y}return(N<0||V==B)&&(D.size=V,D.start=$,D.skip=F),D.size>4?D:void 0}function b(B,N,E){let{id:V,start:$,end:F,size:R}=o;if(o.next(),R>=0&&V4){let C=o.pos-(R-4);for(;o.pos>C;)E=b(B,N,E)}N[--E]=D,N[--E]=F-B,N[--E]=$-B,N[--E]=V}else R==-3?h=V:R==-4&&(c=V);return E}let v=[],O=[];for(;o.pos>0;)f(s.start||0,s.bufferStart||0,v,O,-1,0);let M=(e=s.length)!==null&&e!==void 0?e:v.length?O[0]+v[0].length:0;return new Ze(a[s.topID],v.reverse(),O.reverse(),M)}const Hh=new WeakMap;function ar(s,e){if(!s.isAnonymous||e instanceof Jn||e.type!=s)return 1;let t=Hh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=s||!(n instanceof Ze)){t=1;break}t+=ar(s,n)}Hh.set(e,t)}return t}function qo(s,e,t,n,i,r,l,o,a){let h=0;for(let p=n;p=c)break;N+=E}if(O==M+1){if(N>c){let E=p[M];d(E.children,E.positions,0,E.children.length,m[M]+v);continue}f.push(p[M])}else{let E=m[O-1]+p[O-1].length-B;f.push(qo(s,p,m,M,O,B,E,null,a))}u.push(B+v-r)}}return d(e,t,n,i,0),(o||a)(f,u,l)}class yS{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof cn?this.setBuffer(e.context.buffer,e.index,t):e instanceof ft&&this.map.set(e.tree,t)}get(e){return e instanceof cn?this.getBuffer(e.context.buffer,e.index):e instanceof ft?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Cn{constructor(e,t,n,i,r=!1,l=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(r?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let i=[new Cn(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&i.push(r);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,l=e.length?e[0]:null;for(let o=0,a=0,h=0;;o++){let c=o=n)for(;l&&l.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Cn(d,p,u.tree,u.offset+h,o>0,!!c)}if(u&&i.push(u),l.to>f)break;l=rnew $t(i.from,i.to)):[new $t(0,0)]:[new $t(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let r=i.advance();if(r)return r}}};class c1{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function SS(s){return(e,t,n,i)=>new u1(e,s,t,n,i)}class Fh{constructor(e,t,n,i,r){this.parser=e,this.parse=t,this.overlay=n,this.target=i,this.from=r}}function Wh(s){if(!s.length||s.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class f1{constructor(e,t,n,i,r,l,o){this.parser=e,this.predicate=t,this.mounts=n,this.index=i,this.start=r,this.target=l,this.prev=o,this.depth=0,this.ranges=[]}}const go=new ve({perNode:!0});class u1{constructor(e,t,n,i,r){this.nest=t,this.input=n,this.fragments=i,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new Ze(n.type,n.children,n.positions,n.length,n.propValues.concat([[go,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[ve.mounted.id]=new gs(t,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(t){let h=t.mounts.find(c=>c.frag.from<=i.from&&c.frag.to>=i.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=i.from&&u<=i.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}o=!1}else if(n&&(l=d1(n.ranges,i.from,i.to)))o=l!=2;else if(!i.type.isAnonymous&&(r=this.nest(i,this.input))&&(i.fromnew $t(f.from-i.from,f.to-i.from)):null,i.tree,c.length?c[0].from:i.from)),r.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):o=!1}}else t&&(a=t.predicate(i))&&(a===!0&&(a=new $t(i.from,i.to)),a.fromnew $t(c.from-t.start,c.to-t.start)),t.target,h[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function d1(s,e,t){for(let n of s){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function qh(s,e,t,n,i,r){if(e=e&&t.enter(n,1,We.IgnoreOverlays|We.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof Ze)t=t.children[0];else break}return!1}}class m1{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(go))!==null&&t!==void 0?t:n.to,this.inner=new Uh(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(go))!==null&&e!==void 0?e:t.to,this.inner=new Uh(t.tree,-t.offset)}}findMounts(e,t){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let l=(n=r.tree)===null||n===void 0?void 0:n.prop(ve.mounted);if(l&&l.parser==t)for(let o=this.fragI;o=r.to)break;a.tree==this.curFrag.tree&&i.push({frag:a,pos:r.from-a.offset,mount:l})}}}return i}}function Kh(s,e){let t=null,n=e;for(let i=1,r=0;i=o)break;a.to<=l||(t||(n=t=e.slice()),a.fromo&&t.splice(r+1,0,new $t(o,a.to))):a.to>o?t[r--]=new $t(o,a.to):t.splice(r--,1))}}return n}function g1(s,e,t,n){let i=0,r=0,l=!1,o=!1,a=-1e9,h=[];for(;;){let c=i==s.length?1e9:l?s[i].to:s[i].from,f=r==e.length?1e9:o?e[r].to:e[r].from;if(l!=o){let u=Math.max(a,t),d=Math.min(c,f,n);unew $t(u.from+n,u.to+n)),f=g1(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,m=p?h:f[u].from;if(m>d&&t.push(new Cn(d,m,i.tree,-l,r.from>=d||r.openStart,r.to<=m||r.openEnd)),p)break;d=f[u].to}}else t.push(new Cn(a,h,i.tree,-l,r.from>=l||r.openStart,r.to<=o||r.openEnd))}return t}let b1=0;class rn{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=b1++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new rn([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new _r;return t=>t.modified.indexOf(e)>-1?t:_r.get(t.base||t,t.modified.concat(e).sort((n,i)=>n.id-i.id))}}let _1=0;class _r{constructor(){this.instances=[],this.id=_1++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(o=>o.base==e&&k1(t,o.modified));if(n)return n;let i=[],r=new rn(i,e,t);for(let o of t)o.instances.push(r);let l=v1(t);for(let o of e.set)if(!o.modified.length)for(let a of l)i.push(_r.get(o,a));return r}}function k1(s,e){return s.length==e.length&&s.every((t,n)=>t==e[n])}function v1(s){let e=[[]];for(let t=0;tn.length-t.length)}function y1(s){let e=Object.create(null);for(let t in s){let n=s[t];Array.isArray(n)||(n=[n]);for(let i of t.split(" "))if(i){let r=[],l=2,o=i;for(let f=0;;){if(o=="..."&&f>0&&f+3==i.length){l=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!u)throw new RangeError("Invalid path: "+i);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==i.length)break;let d=i[f++];if(f==i.length&&d=="!"){l=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);o=i.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+i);let c=new kr(n,l,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Md.add(e)}const Md=new ve;class kr{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let l=i;for(let o of r)for(let a of o.set){let h=t[a.id];if(h){l=l?l+" "+h:h;break}}return l},scope:n}}function w1(s,e){let t=null;for(let n of s){let i=n.style(e);i&&(t=t?t+" "+i:i)}return t}function S1(s,e,t,n=0,i=s.length){let r=new x1(n,Array.isArray(e)?e:[e],t);r.highlightRange(s.cursor(),n,i,"",r.highlighters),r.flush(i)}class x1{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,r){let{type:l,from:o,to:a}=e;if(o>=n||a<=t)return;l.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(l)));let h=i,c=A1(e)||kr.empty,f=w1(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(t,o),h),c.opaque)return;let u=e.tree&&e.tree.prop(ve.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+o,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,b=o;;g++){let v=g=O||!e.nextSibling())););if(!v||O>n)break;b=v.to+o,b>t&&(this.highlightRange(d.cursor(),Math.max(t,v.from+o),Math.min(n,b),"",p),this.startSpan(Math.min(n,b),h))}m&&e.parent()}else if(e.firstChild()){u&&(i="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,r),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function A1(s){let e=s.type.prop(Md);for(;e&&e.context&&!s.matchContext(e.context);)e=e.next;return e||null}const Z=rn.define,Js=Z(),Rn=Z(),Gh=Z(Rn),Yh=Z(Rn),In=Z(),Gs=Z(In),Sl=Z(In),sn=Z(),ii=Z(sn),tn=Z(),nn=Z(),bo=Z(),Ki=Z(bo),Ys=Z(),L={comment:Js,lineComment:Z(Js),blockComment:Z(Js),docComment:Z(Js),name:Rn,variableName:Z(Rn),typeName:Gh,tagName:Z(Gh),propertyName:Yh,attributeName:Z(Yh),className:Z(Rn),labelName:Z(Rn),namespace:Z(Rn),macroName:Z(Rn),literal:In,string:Gs,docString:Z(Gs),character:Z(Gs),attributeValue:Z(Gs),number:Sl,integer:Z(Sl),float:Z(Sl),bool:Z(In),regexp:Z(In),escape:Z(In),color:Z(In),url:Z(In),keyword:tn,self:Z(tn),null:Z(tn),atom:Z(tn),unit:Z(tn),modifier:Z(tn),operatorKeyword:Z(tn),controlKeyword:Z(tn),definitionKeyword:Z(tn),moduleKeyword:Z(tn),operator:nn,derefOperator:Z(nn),arithmeticOperator:Z(nn),logicOperator:Z(nn),bitwiseOperator:Z(nn),compareOperator:Z(nn),updateOperator:Z(nn),definitionOperator:Z(nn),typeOperator:Z(nn),controlOperator:Z(nn),punctuation:bo,separator:Z(bo),bracket:Ki,angleBracket:Z(Ki),squareBracket:Z(Ki),paren:Z(Ki),brace:Z(Ki),content:sn,heading:ii,heading1:Z(ii),heading2:Z(ii),heading3:Z(ii),heading4:Z(ii),heading5:Z(ii),heading6:Z(ii),contentSeparator:Z(sn),list:Z(sn),quote:Z(sn),emphasis:Z(sn),strong:Z(sn),link:Z(sn),monospace:Z(sn),strikethrough:Z(sn),inserted:Z(),deleted:Z(),changed:Z(),invalid:Z(),meta:Ys,documentMeta:Z(Ys),annotation:Z(Ys),processingInstruction:Z(Ys),definition:rn.defineModifier(),constant:rn.defineModifier(),function:rn.defineModifier(),standard:rn.defineModifier(),local:rn.defineModifier(),special:rn.defineModifier()};Td([{tag:L.link,class:"tok-link"},{tag:L.heading,class:"tok-heading"},{tag:L.emphasis,class:"tok-emphasis"},{tag:L.strong,class:"tok-strong"},{tag:L.keyword,class:"tok-keyword"},{tag:L.atom,class:"tok-atom"},{tag:L.bool,class:"tok-bool"},{tag:L.url,class:"tok-url"},{tag:L.labelName,class:"tok-labelName"},{tag:L.inserted,class:"tok-inserted"},{tag:L.deleted,class:"tok-deleted"},{tag:L.literal,class:"tok-literal"},{tag:L.string,class:"tok-string"},{tag:L.number,class:"tok-number"},{tag:[L.regexp,L.escape,L.special(L.string)],class:"tok-string2"},{tag:L.variableName,class:"tok-variableName"},{tag:L.local(L.variableName),class:"tok-variableName tok-local"},{tag:L.definition(L.variableName),class:"tok-variableName tok-definition"},{tag:L.special(L.variableName),class:"tok-variableName2"},{tag:L.definition(L.propertyName),class:"tok-propertyName tok-definition"},{tag:L.typeName,class:"tok-typeName"},{tag:L.namespace,class:"tok-namespace"},{tag:L.className,class:"tok-className"},{tag:L.macroName,class:"tok-macroName"},{tag:L.propertyName,class:"tok-propertyName"},{tag:L.operator,class:"tok-operator"},{tag:L.comment,class:"tok-comment"},{tag:L.meta,class:"tok-meta"},{tag:L.invalid,class:"tok-invalid"},{tag:L.punctuation,class:"tok-punctuation"}]);var xl;const Si=new ve;function C1(s){return le.define({combine:s?e=>e.concat(s):void 0})}const M1=new ve;class qt{constructor(e,t,n=[],i=""){this.data=e,this.name=i,ye.prototype.hasOwnProperty("tree")||Object.defineProperty(ye.prototype,"tree",{get(){return Pt(this)}}),this.parser=t,this.extension=[Gn.of(this),ye.languageData.of((r,l,o)=>{let a=Xh(r,l,o),h=a.type.prop(Si);if(!h)return[];let c=r.facet(h),f=a.type.prop(M1);if(f){let u=a.resolve(l-a.from,o);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(n)}isActiveAt(e,t,n=-1){return Xh(e,t,n).type.prop(Si)==this.data}findRegions(e){let t=e.facet(Gn);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(r,l)=>{if(r.prop(Si)==this.data){n.push({from:l,to:l+r.length});return}let o=r.prop(ve.mounted);if(o){if(o.tree.prop(Si)==this.data){if(o.overlay)for(let a of o.overlay)n.push({from:a.from+l,to:a.to+l});else n.push({from:l,to:l+r.length});return}else if(o.overlay){let a=n.length;if(i(o.tree,o.overlay[0].from+l),n.length>a)return}}for(let a=0;an.isTop?t:void 0)]}),e.name)}configure(e,t){return new _o(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Pt(s){let e=s.field(qt.state,!1);return e?e.tree:Ze.empty}class T1{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Ji=null;class vr{constructor(e,t,n=[],i,r,l,o,a){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=l,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new vr(e,t,[],Ze.empty,0,n,[],null)}startParse(){return this.parser.startParse(new T1(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Ze.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Cn.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Ji;Ji=this;try{return e()}finally{Ji=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Zh(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:r,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),n=Cn.applyChanges(n,a),i=Ze.empty,r=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Zh(this.fragments,i,r),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends h1{createParse(t,n,i){let r=i[0].from,l=i[i.length-1].to;return{parsedPos:r,advance(){let a=Ji;if(a){for(let h of i)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=l,new Ze(wt.none,[],[],l-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Ji}}function Zh(s,e,t){return Cn.applyChanges(s,[{fromA:e,toA:t,fromB:e,toB:t}])}class Di{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new Di(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=vr.create(e.facet(Gn).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new Di(n)}}qt.state=Nt.define({create:Di.init,update(s,e){for(let t of e.effects)if(t.is(qt.setState))return t.value;return e.startState.facet(Gn)!=e.state.facet(Gn)?Di.init(e.state):s.apply(e)}});let Ed=s=>{let e=setTimeout(()=>s(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Ed=s=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(s,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Al=typeof navigator<"u"&&(!((xl=navigator.scheduling)===null||xl===void 0)&&xl.isInputPending)?()=>navigator.scheduling.isInputPending():null,E1=rt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(qt.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(qt.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Ed(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndi+1e3,a=r.context.work(()=>Al&&Al()||Date.now()>l,i+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:qt.setState.of(new Di(r.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>An(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Gn=le.define({combine(s){return s.length?s[0]:null},enables:s=>[qt.state,E1,ae.contentAttributes.compute([s],e=>{let t=e.facet(s);return t&&t.name?{"data-language":t.name}:{}})]});class AS{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Od{constructor(e,t,n,i,r,l=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=i,this.loadFunc=r,this.support=l,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new Od(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let n=/\.([^.]+)$/.exec(t);if(n){for(let i of e)if(i.extensions.indexOf(n[1])>-1)return i}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(r=>r==t))return i;if(n)for(let i of e)for(let r of i.alias){let l=t.indexOf(r);if(l>-1&&(r.length>2||!/\w/.test(t[l-1])&&!/\w/.test(t[l+r.length])))return i}return null}}const O1=le.define(),Ir=le.define({combine:s=>{if(!s.length)return" ";let e=s[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return e}});function yr(s){let e=s.facet(Ir);return e.charCodeAt(0)==9?s.tabSize*e.length:e.length}function _s(s,e){let t="",n=s.tabSize,i=s.facet(Ir)[0];if(i==" "){for(;e>=n;)t+=" ",e-=n;i=" "}for(let r=0;r=e?P1(s,t,e):null}class zr{constructor(e,t={}){this.state=e,this.options=t,this.unit=yr(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:r}=this.options;return i!=null&&i>=n.from&&i<=n.to?r&&i==e?{text:"",from:e}:(t<0?i-1&&(r+=l-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return Ni(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let l=r(i);if(l>-1)return l}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const D1=new ve;function P1(s,e,t){let n=e.resolveStack(t),i=n.node.enterUnfinishedNodesBefore(t);if(i!=n.node){let r=[];for(let l=i;l!=n.node;l=l.parent)r.push(l);for(let l=r.length-1;l>=0;l--)n={node:r[l],next:n}}return Dd(n,s,t)}function Dd(s,e,t){for(let n=s;n;n=n.next){let i=B1(n.node);if(i)return i(Ko.create(e,t,n))}return 0}function N1(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function B1(s){let e=s.type.prop(D1);if(e)return e;let t=s.firstChild,n;if(t&&(n=t.type.prop(ve.closedBy))){let i=s.lastChild,r=i&&n.indexOf(i.name)>-1;return l=>Pd(l,!0,1,void 0,r&&!N1(l)?i.from:void 0)}return s.parent==null?L1:null}function L1(){return 0}class Ko extends zr{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new Ko(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if($1(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Dd(this.context.next,this.base,this.pos)}}function $1(s,e){for(let t=e;t;t=t.parent)if(s==t)return!0;return!1}function R1(s){let e=s.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let i=s.options.simulateBreak,r=s.state.doc.lineAt(t.from),l=i==null||i<=r.from?r.to:Math.min(r.to,i);for(let o=t.to;;){let a=e.childAfter(o);if(!a||a==n)return null;if(!a.type.isSkipped)return a.fromPd(n,e,t,s)}function Pd(s,e,t,n,i){let r=s.textAfter,l=r.match(/^\s*/)[0].length,o=n&&r.slice(l,l+n.length)==n||i==s.pos+l,a=e?R1(s):null;return a?o?s.column(a.from):s.column(a.to):s.baseIndent+(o?0:s.unit*t)}const MS=s=>s.baseIndent;function TS({except:s,units:e=1}={}){return t=>{let n=s&&s.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}const I1=200;function ES(){return ye.transactionFilter.of(s=>{if(!s.docChanged||!s.isUserEvent("input.type")&&!s.isUserEvent("input.complete"))return s;let e=s.startState.languageDataAt("indentOnInput",s.startState.selection.main.head);if(!e.length)return s;let t=s.newDoc,{head:n}=s.newSelection.main,i=t.lineAt(n);if(n>i.from+I1)return s;let r=t.sliceString(i.from,n);if(!e.some(h=>h.test(r)))return s;let{state:l}=s,o=-1,a=[];for(let{head:h}of l.selection.ranges){let c=l.doc.lineAt(h);if(c.from==o)continue;o=c.from;let f=Uo(l,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=_s(l,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[s,{changes:a,sequential:!0}]:s})}const z1=le.define(),j1=new ve;function OS(s){let e=s.firstChild,t=s.lastChild;return e&&e.tot)continue;if(r&&o.from=e&&h.to>t&&(r=h)}}return r}function H1(s){let e=s.lastChild;return e&&e.to==s.to&&e.type.isError}function wr(s,e,t){for(let n of s.facet(z1)){let i=n(s,e,t);if(i)return i}return V1(s,e,t)}function Nd(s,e){let t=e.mapPos(s.from,1),n=e.mapPos(s.to,-1);return t>=n?void 0:{from:t,to:n}}const jr=Ne.define({map:Nd}),Cs=Ne.define({map:Nd});function Bd(s){let e=[];for(let{head:t}of s.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(s.lineBlockAt(t));return e}const fi=Nt.define({create(){return Be.none},update(s,e){s=s.map(e.changes);for(let t of e.effects)if(t.is(jr)&&!F1(s,t.value.from,t.value.to)){let{preparePlaceholder:n}=e.state.facet(Jo),i=n?Be.replace({widget:new G1(n(e.state,t.value))}):Qh;s=s.update({add:[i.range(t.value.from,t.value.to)]})}else t.is(Cs)&&(s=s.update({filter:(n,i)=>t.value.from!=n||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:n}=e.selection.main;s.between(n,n,(i,r)=>{in&&(t=!0)}),t&&(s=s.update({filterFrom:n,filterTo:n,filter:(i,r)=>r<=n||i>=n}))}return s},provide:s=>ae.decorations.from(s),toJSON(s,e){let t=[];return s.between(0,e.doc.length,(n,i)=>{t.push(n,i)}),t},fromJSON(s){if(!Array.isArray(s)||s.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!i||i.from>r)&&(i={from:r,to:l})}),i}function F1(s,e,t){let n=!1;return s.between(e,e,(i,r)=>{i==e&&r==t&&(n=!0)}),n}function Ld(s,e){return s.field(fi,!1)?e:e.concat(Ne.appendConfig.of(Rd()))}const W1=s=>{for(let e of Bd(s)){let t=wr(s.state,e.from,e.to);if(t)return s.dispatch({effects:Ld(s.state,[jr.of(t),$d(s,t)])}),!0}return!1},q1=s=>{if(!s.state.field(fi,!1))return!1;let e=[];for(let t of Bd(s)){let n=Sr(s.state,t.from,t.to);n&&e.push(Cs.of(n),$d(s,n,!1))}return e.length&&s.dispatch({effects:e}),e.length>0};function $d(s,e,t=!0){let n=s.state.doc.lineAt(e.from).number,i=s.state.doc.lineAt(e.to).number;return ae.announce.of(`${s.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${s.state.phrase("to")} ${i}.`)}const U1=s=>{let{state:e}=s,t=[];for(let n=0;n{let e=s.state.field(fi,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,s.state.doc.length,(n,i)=>{t.push(Cs.of({from:n,to:i}))}),s.dispatch({effects:t}),!0},DS=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:W1},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:q1},{key:"Ctrl-Alt-[",run:U1},{key:"Ctrl-Alt-]",run:K1}],J1={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Jo=le.define({combine(s){return Pi(s,J1)}});function Rd(s){let e=[fi,X1];return s&&e.push(Jo.of(s)),e}function Id(s,e){let{state:t}=s,n=t.facet(Jo),i=l=>{let o=s.lineBlockAt(s.posAtDOM(l.target)),a=Sr(s.state,o.from,o.to);a&&s.dispatch({effects:Cs.of(a)}),l.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(s,i,e);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=i,r}const Qh=Be.replace({widget:new class extends pi{toDOM(s){return Id(s,null)}}});class G1 extends pi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Id(e,this.value)}}const Y1={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Cl extends Dn{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function PS(s={}){let e=Object.assign(Object.assign({},Y1),s),t=new Cl(e,!0),n=new Cl(e,!1),i=rt.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Gn)!=l.state.facet(Gn)||l.startState.field(fi,!1)!=l.state.field(fi,!1)||Pt(l.startState)!=Pt(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new ai;for(let a of l.viewportLineBlocks){let h=Sr(l.state,a.from,a.to)?n:wr(l.state,a.from,a.to)?t:null;h&&o.add(a.from,a.from,h)}return o.finish()}}),{domEventHandlers:r}=e;return[i,J0({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(i))===null||o===void 0?void 0:o.markers)||Ee.empty},initialSpacer(){return new Cl(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(l,o,a)=>{if(r.click&&r.click(l,o,a))return!0;let h=Sr(l.state,o.from,o.to);if(h)return l.dispatch({effects:Cs.of(h)}),!0;let c=wr(l.state,o.from,o.to);return c?(l.dispatch({effects:jr.of(c)}),!0):!1}})}),Rd()]}const X1=ae.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Ms{constructor(e,t){this.specs=e;let n;function i(o){let a=qn.newName();return(n||(n=Object.create(null)))["."+a]=o,a}const r=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,l=t.scope;this.scope=l instanceof qt?o=>o.prop(Si)==l.data:l?o=>o==l:void 0,this.style=Td(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:r}).style,this.module=n?new qn(n):null,this.themeType=t.themeType}static define(e,t){return new Ms(e,t||{})}}const ko=le.define(),zd=le.define({combine(s){return s.length?[s[0]]:null}});function Ml(s){let e=s.facet(ko);return e.length?e:s.facet(zd)}function Z1(s,e){let t=[eb],n;return s instanceof Ms&&(s.module&&t.push(ae.styleModule.of(s.module)),n=s.themeType),e!=null&&e.fallback?t.push(zd.of(s)):n?t.push(ko.computeN([ae.darkTheme],i=>i.facet(ae.darkTheme)==(n=="dark")?[s]:[])):t.push(ko.of(s)),t}class Q1{constructor(e){this.markCache=Object.create(null),this.tree=Pt(e.state),this.decorations=this.buildDeco(e,Ml(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Pt(e.state),n=Ml(e.state),i=n!=Ml(e.startState),{viewport:r}=e.view,l=e.changes.mapPos(this.decoratedTo,1);t.length=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=l):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return Be.none;let n=new ai;for(let{from:i,to:r}of e.visibleRanges)S1(this.tree,t,(l,o,a)=>{n.add(l,o,this.markCache[a]||(this.markCache[a]=Be.mark({class:a})))},i,r);return n.finish()}}const eb=Br.high(rt.fromClass(Q1,{decorations:s=>s.decorations})),NS=Ms.define([{tag:L.meta,color:"#404740"},{tag:L.link,textDecoration:"underline"},{tag:L.heading,textDecoration:"underline",fontWeight:"bold"},{tag:L.emphasis,fontStyle:"italic"},{tag:L.strong,fontWeight:"bold"},{tag:L.strikethrough,textDecoration:"line-through"},{tag:L.keyword,color:"#708"},{tag:[L.atom,L.bool,L.url,L.contentSeparator,L.labelName],color:"#219"},{tag:[L.literal,L.inserted],color:"#164"},{tag:[L.string,L.deleted],color:"#a11"},{tag:[L.regexp,L.escape,L.special(L.string)],color:"#e40"},{tag:L.definition(L.variableName),color:"#00f"},{tag:L.local(L.variableName),color:"#30a"},{tag:[L.typeName,L.namespace],color:"#085"},{tag:L.className,color:"#167"},{tag:[L.special(L.variableName),L.macroName],color:"#256"},{tag:L.definition(L.propertyName),color:"#00c"},{tag:L.comment,color:"#940"},{tag:L.invalid,color:"#f00"}]),tb=ae.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),jd=1e4,Vd="()[]{}",Hd=le.define({combine(s){return Pi(s,{afterCursor:!0,brackets:Vd,maxScanDistance:jd,renderMatch:sb})}}),nb=Be.mark({class:"cm-matchingBracket"}),ib=Be.mark({class:"cm-nonmatchingBracket"});function sb(s){let e=[],t=s.matched?nb:ib;return e.push(t.range(s.start.from,s.start.to)),s.end&&e.push(t.range(s.end.from,s.end.to)),e}const rb=Nt.define({create(){return Be.none},update(s,e){if(!e.docChanged&&!e.selection)return s;let t=[],n=e.state.facet(Hd);for(let i of e.state.selection.ranges){if(!i.empty)continue;let r=fn(e.state,i.head,-1,n)||i.head>0&&fn(e.state,i.head-1,1,n)||n.afterCursor&&(fn(e.state,i.head,1,n)||i.headae.decorations.from(s)}),lb=[rb,tb];function BS(s={}){return[Hd.of(s),lb]}const ob=new ve;function vo(s,e,t){let n=s.prop(e<0?ve.openedBy:ve.closedBy);if(n)return n;if(s.name.length==1){let i=t.indexOf(s.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function yo(s){let e=s.type.prop(ob);return e?e(s.node):s}function fn(s,e,t,n={}){let i=n.maxScanDistance||jd,r=n.brackets||Vd,l=Pt(s),o=l.resolveInner(e,t);for(let a=o;a;a=a.parent){let h=vo(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return ab(s,e,t,a,c,h,r)}}return hb(s,e,t,l,o.type,i,r)}function ab(s,e,t,n,i,r,l){let o=n.parent,a={from:i.from,to:i.to},h=0,c=o==null?void 0:o.cursor();if(c&&(t<0?c.childBefore(n.from):c.childAfter(n.to)))do if(t<0?c.to<=n.from:c.from>=n.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=s.doc.iterRange(e,t>0?s.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let b=l.indexOf(d[m]);if(!(b<0||n.resolveInner(p+m,1).type!=i))if(b%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:b>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}const cb=Object.create(null),ec=[wt.none],tc=[],nc=Object.create(null),fb=Object.create(null);for(let[s,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])fb[s]=ub(cb,e);function Tl(s,e){tc.indexOf(s)>-1||(tc.push(s),console.warn(e))}function ub(s,e){let t=[];for(let o of e.split(" ")){let a=[];for(let h of o.split(".")){let c=s[h]||L[h];c?typeof c=="function"?a.length?a=a.map(c):Tl(h,`Modifier ${h} used at start of tag`):a.length?Tl(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:Tl(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),i=n+" "+t.map(o=>o.id),r=nc[i];if(r)return r.id;let l=nc[i]=wt.define({id:ec.length,name:n,props:[y1({[n]:t})]});return ec.push(l),l.id}He.RTL,He.LTR;const db=s=>{let{state:e}=s,t=e.doc.lineAt(e.selection.main.from),n=Yo(s.state,t.from);return n.line?pb(s):n.block?gb(s):!1};function Go(s,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=s(e,t);return i?(n(t.update(i)),!0):!1}}const pb=Go(kb,0),mb=Go(Fd,0),gb=Go((s,e)=>Fd(s,e,_b(e)),0);function Yo(s,e){let t=s.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Gi=50;function bb(s,{open:e,close:t},n,i){let r=s.sliceDoc(n-Gi,n),l=s.sliceDoc(i,i+Gi),o=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(l)[0].length,h=r.length-o;if(r.slice(h-e.length,h)==e&&l.slice(a,a+t.length)==t)return{open:{pos:n-o,margin:o&&1},close:{pos:i+a,margin:a&&1}};let c,f;i-n<=2*Gi?c=f=s.sliceDoc(n,i):(c=s.sliceDoc(n,n+Gi),f=s.sliceDoc(i-Gi,i));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:n+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:i-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function _b(s){let e=[];for(let t of s.selection.ranges){let n=s.doc.lineAt(t.from),i=t.to<=n.to?n:s.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>n.from?e[r].to=i.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:i.to})}return e}function Fd(s,e,t=e.selection.ranges){let n=t.map(r=>Yo(e,r.from).block);if(!n.every(r=>r))return null;let i=t.map((r,l)=>bb(e,n[l],r.from,r.to));if(s!=2&&!i.every(r=>r))return{changes:e.changes(t.map((r,l)=>i[l]?[]:[{from:r.from,insert:n[l].open+" "},{from:r.to,insert:" "+n[l].close}]))};if(s!=1&&i.some(r=>r)){let r=[];for(let l=0,o;li&&(r==l||l>f.from)){i=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:o,token:a,indent:h,empty:c,single:f}of n)(f||!c)&&r.push({from:o.from+h,insert:a+" "});let l=e.changes(r);return{changes:l,selection:e.selection.map(l,1)}}else if(s!=1&&n.some(r=>r.comment>=0)){let r=[];for(let{line:l,comment:o,token:a}of n)if(o>=0){let h=l.from+o,c=h+a.length;l.text[c-l.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const wo=Yn.define(),vb=Yn.define(),yb=le.define(),Wd=le.define({combine(s){return Pi(s,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}}),Xo=Nt.define({create(){return un.empty},update(s,e){let t=e.state.facet(Wd),n=e.annotation(wo);if(n){let a=yt.fromTransaction(e,n.selection),h=n.side,c=h==0?s.undone:s.done;return a?c=xr(c,c.length,t.minDepth,a):c=Kd(c,e.startState.selection),new un(h==0?n.rest:c,h==0?c:n.rest)}let i=e.annotation(vb);if((i=="full"||i=="before")&&(s=s.isolate()),e.annotation(Xe.addToHistory)===!1)return e.changes.empty?s:s.addMapping(e.changes.desc);let r=yt.fromTransaction(e),l=e.annotation(Xe.time),o=e.annotation(Xe.userEvent);return r?s=s.addChanges(r,l,o,t,e):e.selection&&(s=s.addSelection(e.startState.selection,l,o,t.newGroupDelay)),(i=="full"||i=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(e=>e.toJSON()),undone:s.undone.map(e=>e.toJSON())}},fromJSON(s){return new un(s.done.map(yt.fromJSON),s.undone.map(yt.fromJSON))}});function LS(s={}){return[Xo,Wd.of(s),ae.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?qd:e.inputType=="historyRedo"?So:null;return n?(e.preventDefault(),n(t)):!1}})]}const ic=Xo;function Vr(s,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let i=t.field(Xo,!1);if(!i)return!1;let r=i.pop(s,t,e);return r?(n(r),!0):!1}}const qd=Vr(0,!1),So=Vr(1,!1),wb=Vr(0,!0),Sb=Vr(1,!0);class yt{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new yt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new yt(e.changes&&Ge.fromJSON(e.changes),[],e.mapped&&mn.fromJSON(e.mapped),e.startSelection&&q.fromJSON(e.startSelection),e.selectionsAfter.map(q.fromJSON))}static fromTransaction(e,t){let n=Rt;for(let i of e.startState.facet(yb)){let r=i(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new yt(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Rt)}static selection(e){return new yt(void 0,Rt,void 0,void 0,e)}}function xr(s,e,t,n){let i=e+1>t+20?e-t-1:0,r=s.slice(i,e);return r.push(n),r}function xb(s,e){let t=[],n=!1;return s.iterChangedRanges((i,r)=>t.push(i,r)),e.iterChangedRanges((i,r,l,o)=>{for(let a=0;a=h&&l<=c&&(n=!0)}}),n}function Ab(s,e){return s.ranges.length==e.ranges.length&&s.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function Ud(s,e){return s.length?e.length?s.concat(e):s:e}const Rt=[],Cb=200;function Kd(s,e){if(s.length){let t=s[s.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Cb));return n.length&&n[n.length-1].eq(e)?s:(n.push(e),xr(s,s.length-1,1e9,t.setSelAfter(n)))}else return[yt.selection([e])]}function Mb(s){let e=s[s.length-1],t=s.slice();return t[s.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function El(s,e){if(!s.length)return s;let t=s.length,n=Rt;for(;t;){let i=Tb(s[t-1],e,n);if(i.changes&&!i.changes.empty||i.effects.length){let r=s.slice(0,t);return r[t-1]=i,r}else e=i.mapped,t--,n=i.selectionsAfter}return n.length?[yt.selection(n)]:Rt}function Tb(s,e,t){let n=Ud(s.selectionsAfter.length?s.selectionsAfter.map(o=>o.map(e)):Rt,t);if(!s.changes)return yt.selection(n);let i=s.changes.map(e),r=e.mapDesc(s.changes,!0),l=s.mapped?s.mapped.composeDesc(r):r;return new yt(i,Ne.mapEffects(s.effects,e),l,s.startSelection.map(r),n)}const Eb=/^(input\.type|delete)($|\.)/;class un{constructor(e,t,n=0,i=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new un(this.done,this.undone):this}addChanges(e,t,n,i,r){let l=this.done,o=l[l.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!n||Eb.test(n))&&(!o.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?s.moveByChar(t,e):Hr(t,e))}function ut(s){return s.textDirectionAt(s.state.selection.main.head)==He.LTR}const Gd=s=>Jd(s,!ut(s)),Yd=s=>Jd(s,ut(s));function Xd(s,e){return Jt(s,t=>t.empty?s.moveByGroup(t,e):Hr(t,e))}const Ob=s=>Xd(s,!ut(s)),Db=s=>Xd(s,ut(s));function Pb(s,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(s.sliceDoc(e.from,e.to)))||e.firstChild}function Fr(s,e,t){let n=Pt(s).resolveInner(e.head),i=t?ve.closedBy:ve.openedBy;for(let a=e.head;;){let h=t?n.childAfter(a):n.childBefore(a);if(!h)break;Pb(s,h,i)?n=h:a=t?h.to:h.from}let r=n.type.prop(i),l,o;return r&&(l=t?fn(s,n.from,1):fn(s,n.to,-1))&&l.matched?o=t?l.end.to:l.end.from:o=t?n.to:n.from,q.cursor(o,t?-1:1)}const Nb=s=>Jt(s,e=>Fr(s.state,e,!ut(s))),Bb=s=>Jt(s,e=>Fr(s.state,e,ut(s)));function Zd(s,e){return Jt(s,t=>{if(!t.empty)return Hr(t,e);let n=s.moveVertically(t,e);return n.head!=t.head?n:s.moveToLineBoundary(t,e)})}const Qd=s=>Zd(s,!1),ep=s=>Zd(s,!0);function tp(s){let e=s.scrollDOM.clientHeightl.empty?s.moveVertically(l,e,t.height):Hr(l,e));if(i.eq(n.selection))return!1;let r;if(t.selfScroll){let l=s.coordsAtPos(n.selection.main.head),o=s.scrollDOM.getBoundingClientRect(),a=o.top+t.marginTop,h=o.bottom-t.marginBottom;l&&l.top>a&&l.bottomnp(s,!1),xo=s=>np(s,!0);function Xn(s,e,t){let n=s.lineBlockAt(e.head),i=s.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?n.to:n.from)&&(i=s.moveToLineBoundary(e,t,!1)),!t&&i.head==n.from&&n.length){let r=/^\s*/.exec(s.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;r&&e.head!=n.from+r&&(i=q.cursor(n.from+r))}return i}const Lb=s=>Jt(s,e=>Xn(s,e,!0)),$b=s=>Jt(s,e=>Xn(s,e,!1)),Rb=s=>Jt(s,e=>Xn(s,e,!ut(s))),Ib=s=>Jt(s,e=>Xn(s,e,ut(s))),zb=s=>Jt(s,e=>q.cursor(s.lineBlockAt(e.head).from,1)),jb=s=>Jt(s,e=>q.cursor(s.lineBlockAt(e.head).to,-1));function Vb(s,e,t){let n=!1,i=Bi(s.selection,r=>{let l=fn(s,r.head,-1)||fn(s,r.head,1)||r.head>0&&fn(s,r.head-1,1)||r.headVb(s,e,!1);function zt(s,e){let t=Bi(s.state.selection,n=>{let i=e(n);return q.range(n.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(s.state.selection)?!1:(s.dispatch(gn(s.state,t)),!0)}function ip(s,e){return zt(s,t=>s.moveByChar(t,e))}const sp=s=>ip(s,!ut(s)),rp=s=>ip(s,ut(s));function lp(s,e){return zt(s,t=>s.moveByGroup(t,e))}const Fb=s=>lp(s,!ut(s)),Wb=s=>lp(s,ut(s)),qb=s=>zt(s,e=>Fr(s.state,e,!ut(s))),Ub=s=>zt(s,e=>Fr(s.state,e,ut(s)));function op(s,e){return zt(s,t=>s.moveVertically(t,e))}const ap=s=>op(s,!1),hp=s=>op(s,!0);function cp(s,e){return zt(s,t=>s.moveVertically(t,e,tp(s).height))}const rc=s=>cp(s,!1),lc=s=>cp(s,!0),Kb=s=>zt(s,e=>Xn(s,e,!0)),Jb=s=>zt(s,e=>Xn(s,e,!1)),Gb=s=>zt(s,e=>Xn(s,e,!ut(s))),Yb=s=>zt(s,e=>Xn(s,e,ut(s))),Xb=s=>zt(s,e=>q.cursor(s.lineBlockAt(e.head).from)),Zb=s=>zt(s,e=>q.cursor(s.lineBlockAt(e.head).to)),oc=({state:s,dispatch:e})=>(e(gn(s,{anchor:0})),!0),ac=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.doc.length})),!0),hc=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.selection.main.anchor,head:0})),!0),cc=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),Qb=({state:s,dispatch:e})=>(e(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),e_=({state:s,dispatch:e})=>{let t=Wr(s).map(({from:n,to:i})=>q.range(n,Math.min(i+1,s.doc.length)));return e(s.update({selection:q.create(t),userEvent:"select"})),!0},t_=({state:s,dispatch:e})=>{let t=Bi(s.selection,n=>{var i;let r=Pt(s).resolveStack(n.from,1);for(let l=r;l;l=l.next){let{node:o}=l;if((o.from=n.to||o.to>n.to&&o.from<=n.from)&&(!((i=o.parent)===null||i===void 0)&&i.parent))return q.range(o.to,o.from)}return n});return e(gn(s,t)),!0},n_=({state:s,dispatch:e})=>{let t=s.selection,n=null;return t.ranges.length>1?n=q.create([t.main]):t.main.empty||(n=q.create([q.cursor(t.main.head)])),n?(e(gn(s,n)),!0):!1};function Ts(s,e){if(s.state.readOnly)return!1;let t="delete.selection",{state:n}=s,i=n.changeByRange(r=>{let{from:l,to:o}=r;if(l==o){let a=e(r);al&&(t="delete.forward",a=Xs(s,a,!0)),l=Math.min(l,a),o=Math.max(o,a)}else l=Xs(s,l,!1),o=Xs(s,o,!0);return l==o?{range:r}:{changes:{from:l,to:o},range:q.cursor(l,li(s)))n.between(e,e,(i,r)=>{ie&&(e=t?r:i)});return e}const fp=(s,e)=>Ts(s,t=>{let n=t.from,{state:i}=s,r=i.doc.lineAt(n),l,o;if(!e&&n>r.from&&nfp(s,!1),up=s=>fp(s,!0),dp=(s,e)=>Ts(s,t=>{let n=t.head,{state:i}=s,r=i.doc.lineAt(n),l=i.charCategorizer(n);for(let o=null;;){if(n==(e?r.to:r.from)){n==t.head&&r.number!=(e?i.doc.lines:1)&&(n+=e?1:-1);break}let a=mt(r.text,n-r.from,e)+r.from,h=r.text.slice(Math.min(n,a)-r.from,Math.max(n,a)-r.from),c=l(h);if(o!=null&&c!=o)break;(h!=" "||n!=t.head)&&(o=c),n=a}return n}),pp=s=>dp(s,!1),i_=s=>dp(s,!0),s_=s=>Ts(s,e=>{let t=s.lineBlockAt(e.head).to;return e.headTs(s,e=>{let t=s.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),l_=s=>Ts(s,e=>{let t=s.moveToLineBoundary(e,!0).head;return e.head{if(s.readOnly)return!1;let t=s.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:De.of(["",""])},range:q.cursor(n.from)}));return e(s.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},a_=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=s.changeByRange(n=>{if(!n.empty||n.from==0||n.from==s.doc.length)return{range:n};let i=n.from,r=s.doc.lineAt(i),l=i==r.from?i-1:mt(r.text,i-r.from,!1)+r.from,o=i==r.to?i+1:mt(r.text,i-r.from,!0)+r.from;return{changes:{from:l,to:o,insert:s.doc.slice(i,o).append(s.doc.slice(l,i))},range:q.cursor(o)}});return t.changes.empty?!1:(e(s.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Wr(s){let e=[],t=-1;for(let n of s.selection.ranges){let i=s.doc.lineAt(n.from),r=s.doc.lineAt(n.to);if(!n.empty&&n.to==r.from&&(r=s.doc.lineAt(n.to-1)),t>=i.number){let l=e[e.length-1];l.to=r.to,l.ranges.push(n)}else e.push({from:i.from,to:r.to,ranges:[n]});t=r.number+1}return e}function mp(s,e,t){if(s.readOnly)return!1;let n=[],i=[];for(let r of Wr(s)){if(t?r.to==s.doc.length:r.from==0)continue;let l=s.doc.lineAt(t?r.to+1:r.from-1),o=l.length+1;if(t){n.push({from:r.to,to:l.to},{from:r.from,insert:l.text+s.lineBreak});for(let a of r.ranges)i.push(q.range(Math.min(s.doc.length,a.anchor+o),Math.min(s.doc.length,a.head+o)))}else{n.push({from:l.from,to:r.from},{from:r.to,insert:s.lineBreak+l.text});for(let a of r.ranges)i.push(q.range(a.anchor-o,a.head-o))}}return n.length?(e(s.update({changes:n,scrollIntoView:!0,selection:q.create(i,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const h_=({state:s,dispatch:e})=>mp(s,e,!1),c_=({state:s,dispatch:e})=>mp(s,e,!0);function gp(s,e,t){if(s.readOnly)return!1;let n=[];for(let i of Wr(s))t?n.push({from:i.from,insert:s.doc.slice(i.from,i.to)+s.lineBreak}):n.push({from:i.to,insert:s.lineBreak+s.doc.slice(i.from,i.to)});return e(s.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const f_=({state:s,dispatch:e})=>gp(s,e,!1),u_=({state:s,dispatch:e})=>gp(s,e,!0),d_=s=>{if(s.state.readOnly)return!1;let{state:e}=s,t=e.changes(Wr(e).map(({from:i,to:r})=>(i>0?i--:rs.moveVertically(i,!0)).map(t);return s.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function p_(s,e){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Pt(s).resolveInner(e),n=t.childBefore(e),i=t.childAfter(e),r;return n&&i&&n.to<=e&&i.from>=e&&(r=n.type.prop(ve.closedBy))&&r.indexOf(i.name)>-1&&s.doc.lineAt(n.to).from==s.doc.lineAt(i.from).from&&!/\S/.test(s.sliceDoc(n.to,i.from))?{from:n.to,to:i.from}:null}const m_=bp(!1),g_=bp(!0);function bp(s){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:r,to:l}=i,o=e.doc.lineAt(r),a=!s&&r==l&&p_(e,r);s&&(r=l=(l<=o.to?o:e.doc.lineAt(l)).to);let h=new zr(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=Uo(h,r);for(c==null&&(c=Ni(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));lo.from&&r{let i=[];for(let l=n.from;l<=n.to;){let o=s.doc.lineAt(l);o.number>t&&(n.empty||n.to>o.from)&&(e(o,i,n),t=o.number),l=o.to+1}let r=s.changes(i);return{changes:i,range:q.range(r.mapPos(n.anchor,1),r.mapPos(n.head,1))}})}const b_=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=Object.create(null),n=new zr(s,{overrideIndentation:r=>{let l=t[r];return l??-1}}),i=Zo(s,(r,l,o)=>{let a=Uo(n,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=_s(s,a);(h!=c||o.froms.readOnly?!1:(e(s.update(Zo(s,(t,n)=>{n.push({from:t.from,insert:s.facet(Ir)})}),{userEvent:"input.indent"})),!0),kp=({state:s,dispatch:e})=>s.readOnly?!1:(e(s.update(Zo(s,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=Ni(i,s.tabSize),l=0,o=_s(s,Math.max(0,r-yr(s)));for(;l({mac:s.key,run:s.run,shift:s.shift}))),v_=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Nb,shift:qb},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Bb,shift:Ub},{key:"Alt-ArrowUp",run:h_},{key:"Shift-Alt-ArrowUp",run:f_},{key:"Alt-ArrowDown",run:c_},{key:"Shift-Alt-ArrowDown",run:u_},{key:"Escape",run:n_},{key:"Mod-Enter",run:g_},{key:"Alt-l",mac:"Ctrl-l",run:e_},{key:"Mod-i",run:t_,preventDefault:!0},{key:"Mod-[",run:kp},{key:"Mod-]",run:_p},{key:"Mod-Alt-\\",run:b_},{key:"Shift-Mod-k",run:d_},{key:"Shift-Mod-\\",run:Hb},{key:"Mod-/",run:db},{key:"Alt-A",run:mb}].concat(k_),y_={key:"Tab",run:_p,shift:kp};let pt=[],w_=(s,e)=>{let t,n=[],i={lc:0,l:e||0,value:s,set(r){i.value=r,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(r){t=n;let l=!pt.length;for(let o=0;o{n===t&&(n=n.slice());let o=n.indexOf(r);~o&&(n.splice(o,2),i.lc--,i.lc||i.off())}},subscribe(r,l){let o=i.listen(r,l);return r(i.value),o},off(){}};return i},S_=(s={})=>{let e=w_(s);return e.setKey=function(t,n){typeof n>"u"?t in e.value&&(e.value={...e.value},delete e.value[t],e.notify(t)):e.value[t]!==n&&(e.value={...e.value,[t]:n},e.notify(t))},e};var x_=()=>S_({view:null,extensions:null,value:null}),A_=(s,e)=>{if(Fn(e))throw new Error("No options provided. At least `value` is required.");let{value:t,instanceStore:n,onChangeBehavior:i={kind:"debounce",duration:50}}=e,r,l=new Promise(E=>r=E),o,a=[];const h=new Lt,c=new Lt,f=new Lt,u=new Lt,d=new Lt,p=new Lt,m=new Lt,g=new Lt,b=ae.updateListener.of(E=>N(E));async function v(E){return Promise.all([b,p.of(bc(E)),m.of(await mc(E)),h.of(await fc(E)??[]),cd.of([...v_,...E.useTabs?[y_]:[]]),c.of(await uc(E)),f.of(dc(E)),u.of(await pc(E)),d.of(gc(E)),g.of(await _c(E))])}function O(E){const V=o.state.doc.toString();vi(V,t)||(t=V,s.dispatchEvent(new CustomEvent("codemirror:textChange",{detail:t}))),n==null||n.set({value:t,view:o,extensions:a}),s.dispatchEvent(new CustomEvent("codemirror:change",{detail:E}))}const{kind:M="debounce",duration:B=50}=i;let N=M==="debounce"?kc(O,B):vc(O,B);return(async()=>{a=await v(e);const E=ye.create({doc:t,extensions:a,selection:{anchor:e.cursorPos??0,head:e.cursorPos??0}});o=new ae({state:E,parent:s}),Fn(e.cursorPos)||o.focus(),r()})(),{async update(E){var D,C;await l;const V={};vi(t,E.value)||(t=E.value,V.changes={from:0,to:o.state.doc.length,insert:t}),!Fn(E.cursorPos)&&!vi(e.cursorPos,E.cursorPos)&&(V.selection={anchor:E.cursorPos??0,head:E.cursorPos??0},o.focus());async function $(W,ne,Y){V.effects=V.effects??[];const he=V.effects;let j=!0;for(const fe of ne){const ge=E[fe],Re=e[fe];if(!Fn(ge)&&(j=!1,!vi(ge,Re)))return he.push(W.reconfigure(await Y(E)))}j&&he.push(W.reconfigure([]))}await Promise.all([$(h,["setup"],fc),$(c,["lang"],uc),$(u,["useTabs","tabSize"],pc),$(f,["theme"],dc),$(p,["extensions"],bc),$(d,["readonly"],gc),$(m,["autocomplete"],mc),$(g,["lint","lintOptions"],_c)]),o.dispatch(V);const{kind:F="debounce",duration:R=50}=E.onChangeBehavior??{kind:"debounce",duration:50};(!vi((D=e.onChangeBehavior)==null?void 0:D.kind,F)||!vi((C=e.onChangeBehavior)==null?void 0:C.duration,R))&&(N=F==="debounce"?kc(O,R):vc(O,R)),e=E,a=await v(E)},destroy(){l.then(()=>o==null?void 0:o.destroy())}}};async function fc(s){const{setup:e}=s;if(Fn(e))return[];if(e==="basic")return(await Mn(()=>import("./basic-setup-BJSL5TOQ.8dd571f7.js"),["./basic-setup-BJSL5TOQ.8dd571f7.js","./index.38abadcc.js","./index.18375e6b.js"],import.meta.url)).default(s);if(e==="minimal")return(await Mn(()=>import("./minimal-setup-Y523JPZT.65abc013.js"),[],import.meta.url)).default(s);throw new Error("`setup` can only be `basic` or `minimal`. If you wish to provide another setup, pass through `extensions` prop.")}async function uc({lang:s,langMap:e}){if(Fn(s))return[];if(typeof s=="string"){if(!e)throw new Error("`langMap` is required when `lang` is a string.");if(!(s in e))throw new Error(`Language "${s}" is not defined in \`langMap\`.`);return await e[s]()}return s}function dc({theme:s,styles:e}){return[s,e&&ae.theme(e)].filter(Boolean)}async function pc({useTabs:s=!1,tabSize:e=2}){return[ye.tabSize.of(e),Ir.of(s?" ":" ".repeat(e))]}async function mc({autocomplete:s}){if(Fn(s))return[];const{autocompletion:e}=await Mn(()=>import("./index.38abadcc.js"),[],import.meta.url);return e(typeof s=="object"&&s?s:{})}function gc({readonly:s}){return ye.readOnly.of(!!s)}function bc({extensions:s}){return s??[]}async function _c({lint:s,lintOptions:e={}}){if(Fn(s))return[];if(!C_(s))throw new Error("`lint` must be a function.");const{linter:t}=await Mn(()=>import("./index.18375e6b.js").then(n=>n.i),[],import.meta.url);return t(s,e)}var vi=(s,e)=>s===e,Fn=s=>typeof s>"u",C_=s=>typeof s=="function";function kc(s,e,t=!1){let n;return function(...r){const l=this;n?clearTimeout(n):t&&s.apply(l,r),n=setTimeout(o,e||100);function o(){t||s.apply(l,r),n=null}}}function vc(s,e){let t,n=!1;function i(r){if(t){s.apply(r,t),setTimeout(i,e,r),t=null;return}n=!1}return function(...l){const o=this;if(n){t=l;return}s.apply(o,l),n=!0,setTimeout(i,e,o)}}function M_(s){let e;const t=s[7].default,n=Tt(t,s,s[6],null);return{c(){n&&n.c()},l(i){n&&n.l(i)},m(i,r){n&&n.m(i,r),e=!0},p(i,r){n&&n.p&&(!e||r&64)&&Et(n,t,i,i[6],e?Dt(t,i[6],r,null):Ot(i[6]),null)},i(i){e||(w(n,i),e=!0)},o(i){T(n,i),e=!1},d(i){n&&n.d(i)}}}function T_(s){let e,t=s[4](s[1])+"",n,i,r;return{c(){e=x("button"),n=I(t),this.h()},l(l){e=A(l,"BUTTON",{class:!0});var o=P(e);n=z(o,t),o.forEach(_),this.h()},h(){k(e,"class","svelte-1w145fq"),ie(e,"navigable",s[1].filename)},m(l,o){S(l,e,o),y(e,n),i||(r=[ue(e,"click",s[8]),ue(e,"keyup",s[9])],i=!0)},p(l,o){o&2&&t!==(t=l[4](l[1])+"")&&re(n,t),o&2&&ie(e,"navigable",l[1].filename)},i:de,o:de,d(l){l&&_(e),i=!1,Pn(r)}}}function E_(s){let e,t,n,i,r,l;const o=[T_,M_],a=[];function h(c,f){return c[1]?0:1}return t=h(s),n=a[t]=o[t](s),{c(){e=x("div"),n.c(),this.h()},l(c){e=A(c,"DIV",{class:!0});var f=P(e);n.l(f),f.forEach(_),this.h()},h(){k(e,"class",i="message "+s[0]+" svelte-1w145fq"),ie(e,"truncate",s[2])},m(c,f){S(c,e,f),a[t].m(e,null),l=!0},p(c,[f]){let u=t;t=h(c),t===u?a[t].p(c,f):(Se(),T(a[u],1,1,()=>{a[u]=null}),xe(),n=a[t],n?n.p(c,f):(n=a[t]=o[t](c),n.c()),w(n,1),n.m(e,null)),(!l||f&1&&i!==(i="message "+c[0]+" svelte-1w145fq"))&&k(e,"class",i),(!l||f&5)&&ie(e,"truncate",c[2])},i(c){l||(w(n),c&&Dr(()=>{l&&(r||(r=_a(e,va,{duration:100},!0)),r.run(1))}),l=!0)},o(c){T(n),c&&(r||(r=_a(e,va,{duration:100},!1)),r.run(0)),l=!1},d(c){c&&_(e),a[t].d(),c&&r&&r.end()}}}function O_(s,e,t){let{$$slots:n={},$$scope:i}=e,{kind:r="info"}=e,{details:l=void 0}=e,{filename:o=void 0}=e,{truncate:a=!1}=e;const{go_to_warning_pos:h}=di();function c(d){let p=d.message||"[missing message]",m=[];return d.filename&&d.filename!==o&&m.push(d.filename),d.start&&m.push(d.start.line,d.start.column),p+(m.length?` (${m.join(":")})`:"")}const f=()=>h(l),u=d=>d.key===" "&&h(l);return s.$$set=d=>{"kind"in d&&t(0,r=d.kind),"details"in d&&t(1,l=d.details),"filename"in d&&t(5,o=d.filename),"truncate"in d&&t(2,a=d.truncate),"$$scope"in d&&t(6,i=d.$$scope)},[r,l,a,h,c,o,i,n,f,u]}class Li extends _e{constructor(e){super(),ke(this,e,O_,E_,be,{kind:0,details:1,filename:5,truncate:2})}}const D_=ae.theme({"&":{color:"var(--sk-code-base)",backgroundColor:"transparent"},".cm-content":{caretColor:"var(--sk-theme-3)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--sk-theme-3)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--sk-selection-color)"},".cm-panels":{backgroundColor:"var(--sk-back-2)",color:"var(--sk-text-2)"},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"var(--sk-theme-2)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:"var(--sk-back-3)",border:"none"},".cm-activeLineGutter":{backgroundColor:"var(--sk-back-4)"},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:"var(--sk-back-3)"},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:"var(--sk-back-3)",borderBottomColor:"var(--sk-back-3)"},".cm-tooltip-autocomplete":{color:"var(--sk-text-2) !important",perspective:"1px","& > ul > li[aria-selected]":{backgroundColor:"var(--sk-back-4)",color:"var(--sk-text-1) !important"}}},{dark:!0}),P_=Ms.define([{tag:L.keyword,color:"var(--sk-code-keyword)"},{tag:[L.name,L.deleted,L.character,L.propertyName,L.macroName],color:"var(--sk-code-base)"},{tag:[L.function(L.variableName),L.labelName],color:"var(--sk-code-tags)"},{tag:[L.color,L.constant(L.name),L.standard(L.name)],color:"var(--sk-code-base)"},{tag:[L.definition(L.name),L.separator],color:"var(--sk-code-base)"},{tag:[L.typeName,L.className,L.number,L.changed,L.annotation,L.modifier,L.self,L.namespace],color:"var(--sk-code-tags)"},{tag:[L.operator,L.operatorKeyword,L.url,L.escape,L.regexp,L.link,L.special(L.string)],color:"var(--sk-code-base)"},{tag:[L.meta,L.comment],color:"var(--sk-code-comment)"},{tag:L.strong,fontWeight:"bold"},{tag:L.emphasis,fontStyle:"italic"},{tag:L.strikethrough,textDecoration:"line-through"},{tag:L.link,color:"var(--sk-code-base)",textDecoration:"underline"},{tag:L.heading,fontWeight:"bold",color:"var(--sk-text-1)"},{tag:[L.atom,L.bool],color:"var(--sk-code-atom)"},{tag:[L.processingInstruction,L.string,L.inserted],color:"var(--sk-code-string)"},{tag:L.invalid,color:"#ff008c"}]),yc=[D_,Z1(P_)];function wc(s){let e,t,n,i,r,l;return r=new Li({props:{kind:"info",$$slots:{default:[N_]},$$scope:{ctx:s}}}),{c(){e=x("pre"),t=I(s[5]),n=Q(),i=x("div"),U(r.$$.fragment),this.h()},l(o){e=A(o,"PRE",{style:!0,class:!0});var a=P(e);t=z(a,s[5]),a.forEach(_),n=ee(o),i=A(o,"DIV",{style:!0});var h=P(i);G(r.$$.fragment,h),h.forEach(_),this.h()},h(){it(e,"position","absolute"),it(e,"left","0"),it(e,"top","0"),k(e,"class","svelte-1s16tri"),it(i,"position","absolute"),it(i,"width","100%"),it(i,"bottom","0")},m(o,a){S(o,e,a),y(e,t),S(o,n,a),S(o,i,a),K(r,i,null),l=!0},p(o,a){(!l||a[0]&32)&&re(t,o[5]);const h={};a[1]&4&&(h.$$scope={dirty:a,ctx:o}),r.$set(h)},i(o){l||(w(r.$$.fragment,o),l=!0)},o(o){T(r.$$.fragment,o),l=!1},d(o){o&&(_(e),_(n),_(i)),J(r)}}}function N_(s){let e;return{c(){e=I("loading editor...")},l(t){e=z(t,"loading editor...")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function B_(s){let e,t,n,i,r,l=!s[4].view&&wc(s);return{c(){e=x("div"),l&&l.c(),this.h()},l(o){e=A(o,"DIV",{class:!0});var a=P(e);l&&l.l(a),a.forEach(_),this.h()},h(){k(e,"class","codemirror-container svelte-1s16tri")},m(o,a){S(o,e,a),l&&l.m(e,null),n=!0,i||(r=[Uf(t=A_.call(null,e,{value:s[5],setup:"basic",useTabs:s[2],tabSize:2,theme:yc,readonly:s[1],cursorPos:s[7],lang:s[6],langMap:{js:Sc,json:xc,md:Ac,css:Cc,svelte:Mc},lint:s[0],lintOptions:{delay:200},autocomplete:s[3],extensions:[s[10]],instanceStore:s[9]})),ue(e,"codemirror:textChange",s[25])],i=!0)},p(o,a){o[4].view?l&&(Se(),T(l,1,1,()=>{l=null}),xe()):l?(l.p(o,a),a[0]&16&&w(l,1)):(l=wc(o),l.c(),w(l,1),l.m(e,null)),t&&Jf(t.update)&&a[0]&239&&t.update.call(null,{value:o[5],setup:"basic",useTabs:o[2],tabSize:2,theme:yc,readonly:o[1],cursorPos:o[7],lang:o[6],langMap:{js:Sc,json:xc,md:Ac,css:Cc,svelte:Mc},lint:o[0],lintOptions:{delay:200},autocomplete:o[3],extensions:[o[10]],instanceStore:o[9]})},i(o){n||(w(l),n=!0)},o(o){T(l),n=!1},d(o){o&&_(e),l&&l.d(),i=!1,Pn(r)}}}const vp=ot(0),Sc=()=>Mn(()=>import("./index.802ca127.js").then(s=>s.i),["./index.802ca127.js","./index.849c6c27.js","./scheduler.8d4e2d99.js","./index.38abadcc.js"],import.meta.url).then(s=>s.javascript()),xc=()=>Mn(()=>import("./index.fb7d013e.js"),["./index.fb7d013e.js","./index.849c6c27.js","./scheduler.8d4e2d99.js"],import.meta.url).then(s=>s.json()),Ac=()=>Mn(()=>import("./index.c29c19ae.js"),["./index.c29c19ae.js","./index.38abadcc.js","./index.55f722b2.js","./index.849c6c27.js","./scheduler.8d4e2d99.js","./index.387c6852.js","./index.802ca127.js"],import.meta.url).then(s=>s.markdown()),Cc=()=>Mn(()=>import("./index.387c6852.js"),["./index.387c6852.js","./index.849c6c27.js","./scheduler.8d4e2d99.js"],import.meta.url).then(s=>s.css()),Mc=()=>Mn(()=>import("./index.1f9146dd.js"),["./index.1f9146dd.js","./index.849c6c27.js","./scheduler.8d4e2d99.js","./index.387c6852.js","./index.802ca127.js","./index.38abadcc.js","./index.55f722b2.js"],import.meta.url).then(s=>s.svelte());function L_(s,e,t){let n,{errorLoc:i=null}=e,{diagnostics:r=void 0}=e,{readonly:l=!1}=e,{tab:o=!0}=e,{autocomplete:a=!0}=e;const h=Pr();let c="",f="svelte";async function u(j){d(j)}async function d(j){if(n.view&&(await as(),j.lang&&j.lang!==f&&t(6,f=j.lang),j.code!==void 0)){const{scrollLeft:fe,scrollTop:ge}=n.view.scrollDOM;t(5,c=j.code),Ve(F,n.view.scrollDOM.scrollTop=ge,n),Ve(F,n.view.scrollDOM.scrollLeft=fe,n)}}function p(j){t(7,ne=j)}let m;const g=new Promise(j=>t(23,m=j));function b(){var j;(j=n.view)==null||j.requestMeasure()}function v(){var j;(j=n.view)==null||j.focus()}function O(){var j;return(j=n.view)==null?void 0:j.state.toJSON({history:ic})}function M(j){var fe;n.view&&(n.view.setState(ye.fromJSON(j,{extensions:W,doc:j.doc},{history:ic})),(fe=n.view)==null||fe.dispatch({changes:{from:0,to:n.view.state.doc.length,insert:j.doc},effects:[Ne.reconfigure.of(n.extensions??[])]}))}async function B(){var j,fe;await as(),(j=n.view)==null||j.setState(ye.create({extensions:W,doc:""})),(fe=n.view)==null||fe.dispatch({changes:{from:0,to:n.view.state.doc.length,insert:""},effects:[Ne.reconfigure.of(n.extensions??[])]})}const N=Ne.define(),E=Nt.define({create(){return Be.none},update(j,fe){j=j.map(fe.changes);for(let ge of fe.effects)ge.is(N)&&(j=j.update({add:ge.value,sort:!0}));return j},provide:j=>ae.decorations.from(j)});function V({from:j,to:fe,className:ge="mark-text"}){var we;const Re=Be.mark({class:ge});(we=n.view)==null||we.dispatch({effects:[Ne.appendConfig.of(E),N.of([Re.range(j,fe)])]})}function $(){var j;(j=n.view)==null||j.dispatch({effects:Ne.reconfigure.of(n.extensions??[])})}const F=x_();Me(s,F,j=>t(4,n=j));let R,D,C=!1,W=[],ne=0;const Y=ae.updateListener.of(j=>{j.selectionSet&&vp.set(j.state.selection.main.head)}),he=({detail:j})=>{t(5,c=j),h("change",{value:c})};return s.$$set=j=>{"errorLoc"in j&&t(11,i=j.errorLoc),"diagnostics"in j&&t(0,r=j.diagnostics),"readonly"in j&&t(1,l=j.readonly),"tab"in j&&t(2,o=j.tab),"autocomplete"in j&&t(3,a=j.autocomplete)},s.$$.update=()=>{s.$$.dirty[0]&8388624&&n.view&&m(),s.$$.dirty[0]&16&&n.view&&R&&D&&b(),s.$$.dirty[0]&16779264&&i&&(V({from:i.character,to:i.character+1,className:"error-loc"}),i.line)},[r,l,o,a,n,c,f,ne,h,F,Y,i,u,d,p,g,b,v,O,M,B,V,$,m,C,he]}class qr extends _e{constructor(e){super(),ke(this,e,L_,B_,be,{errorLoc:11,diagnostics:0,readonly:1,tab:2,autocomplete:3,set:12,update:13,setCursor:14,isReady:15,resize:16,focus:17,getEditorState:18,setEditorState:19,clearEditorState:20,markText:21,unmarkText:22},null,[-1,-1])}get set(){return this.$$.ctx[12]}get update(){return this.$$.ctx[13]}get setCursor(){return this.$$.ctx[14]}get isReady(){return this.$$.ctx[15]}get resize(){return this.$$.ctx[16]}get focus(){return this.$$.ctx[17]}get getEditorState(){return this.$$.ctx[18]}get setEditorState(){return this.$$.ctx[19]}get clearEditorState(){return this.$$.ctx[20]}get markText(){return this.$$.ctx[21]}get unmarkText(){return this.$$.ctx[22]}}function Tc(s,e,t){const n=s.slice();return n[17]=e[t],n}function $_(s){let e,t,n=Oe(s[3]),i=[];for(let l=0;lT(i[l],1,1,()=>{i[l]=null});return{c(){for(let l=0;l0?1:-1}return~(l=u(s))&&(o=f[l]=c[l](s)),{c(){e=x("div"),t=x("div"),U(n.$$.fragment),i=Q(),r=x("div"),o&&o.c(),this.h()},l(d){e=A(d,"DIV",{class:!0});var p=P(e);t=A(p,"DIV",{class:!0,translate:!0});var m=P(t);G(n.$$.fragment,m),m.forEach(_),i=ee(p),r=A(p,"DIV",{class:!0});var g=P(r);o&&o.l(g),g.forEach(_),p.forEach(_),this.h()},h(){k(t,"class","editor notranslate svelte-62nfk2"),k(t,"translate","no"),k(r,"class","info svelte-62nfk2"),k(e,"class","editor-wrapper svelte-62nfk2")},m(d,p){S(d,e,p),y(e,t),K(n,t,null),y(e,i),y(e,r),~l&&f[l].m(r,null),a=!0},p(d,[p]){const m={};p&1&&(m.errorLoc=d[0]),p&2&&(m.autocomplete=d[1]),n.$set(m);let g=l;l=u(d),l===g?~l&&f[l].p(d,p):(o&&(Se(),T(f[g],1,1,()=>{f[g]=null}),xe()),~l?(o=f[l],o?o.p(d,p):(o=f[l]=c[l](d),o.c()),w(o,1),o.m(r,null)):o=null)},i(d){a||(w(n.$$.fragment,d),w(o),a=!0)},o(d){T(n.$$.fragment,d),T(o),a=!1},d(d){d&&_(e),s[15](null),J(n),~l&&f[l].d()}}}function z_(s,e,t){let n,i,r,l,o,{errorLoc:a=null}=e,{autocomplete:h}=e;function c(){o==null||o.focus()}const{bundle:f,handle_change:u,module_editor:d,selected:p,bundling:m}=di();Me(s,f,M=>t(14,l=M)),Me(s,d,M=>t(5,o=M)),Me(s,p,M=>t(13,i=M)),Me(s,m,M=>t(16,r=M));let g=null,b=[];async function v(){return await r,[...i&&(g==null?void 0:g.filename)===$e(i)?[{from:g.start.character,to:g.end.character,severity:"error",message:g.message}]:[],...b.filter(M=>i&&M.filename===$e(i)).map(M=>({from:M.start.character,to:M.end.character,severity:"warning",message:M.message}))]}function O(M){Ye[M?"unshift":"push"](()=>{o=M,d.set(o)})}return s.$$set=M=>{"errorLoc"in M&&t(0,a=M.errorLoc),"autocomplete"in M&&t(1,h=M.autocomplete)},s.$$.update=()=>{s.$$.dirty&8192&&t(4,n=(i==null?void 0:i.name)+"."+(i==null?void 0:i.type)),s.$$.dirty&16384&&l&&(t(2,g=l==null?void 0:l.error),t(3,b=(l==null?void 0:l.warnings)??[]))},[a,h,g,b,n,o,f,u,d,p,m,v,c,i,l,O]}class j_ extends _e{constructor(e){super(),ke(this,e,z_,I_,be,{errorLoc:0,autocomplete:1,focus:12})}get focus(){return this.$$.ctx[12]}}function V_(s){let e,t,n;return{c(){e=x("input"),this.h()},l(i){e=A(i,"INPUT",{type:!0,class:!0}),this.h()},h(){k(e,"type","checkbox"),k(e,"class","svelte-1ja98dc")},m(i,r){S(i,e,r),e.checked=s[0],t||(n=ue(e,"change",s[1]),t=!0)},p(i,[r]){r&1&&(e.checked=i[0])},i:de,o:de,d(i){i&&_(e),t=!1,n()}}}function H_(s,e,t){let{checked:n=!1}=e;function i(){n=this.checked,t(0,n)}return s.$$set=r=>{"checked"in r&&t(0,n=r.checked)},[n,i]}class yi extends _e{constructor(e){super(),ke(this,e,H_,V_,be,{checked:0})}}function F_(s){let e,t,n="input",i,r,l,o,a,h,c="output",f;function u(p){s[1](p)}let d={};return s[0]!==void 0&&(d.checked=s[0]),l=new yi({props:d}),Ye.push(()=>on(l,"checked",u)),{c(){e=x("label"),t=x("span"),t.textContent=n,i=Q(),r=x("span"),U(l.$$.fragment),a=Q(),h=x("span"),h.textContent=c,this.h()},l(p){e=A(p,"LABEL",{class:!0});var m=P(e);t=A(m,"SPAN",{style:!0,class:!0,"data-svelte-h":!0}),Te(t)!=="svelte-iwcvz2"&&(t.textContent=n),i=ee(m),r=A(m,"SPAN",{style:!0,class:!0});var g=P(r);G(l.$$.fragment,g),g.forEach(_),a=ee(m),h=A(m,"SPAN",{class:!0,"data-svelte-h":!0}),Te(h)!=="svelte-4pjs0t"&&(h.textContent=c),m.forEach(_),this.h()},h(){it(t,"text-align","right"),k(t,"class","svelte-l6oyfu"),ie(t,"active",!s[0]),it(r,"display","grid"),it(r,"place-items","center"),k(r,"class","svelte-l6oyfu"),k(h,"class","svelte-l6oyfu"),ie(h,"active",s[0]),k(e,"class","input-output-toggle svelte-l6oyfu")},m(p,m){S(p,e,m),y(e,t),y(e,i),y(e,r),K(l,r,null),y(e,a),y(e,h),f=!0},p(p,[m]){(!f||m&1)&&ie(t,"active",!p[0]);const g={};!o&&m&1&&(o=!0,g.checked=p[0],ln(()=>o=!1)),l.$set(g),(!f||m&1)&&ie(h,"active",p[0])},i(p){f||(w(l.$$.fragment,p),f=!0)},o(p){T(l.$$.fragment,p),f=!1},d(p){p&&_(e),J(l)}}}function W_(s,e,t){let{checked:n=!1}=e;function i(r){n=r,t(0,n)}return s.$$set=r=>{"checked"in r&&t(0,n=r.checked)},[n,i]}class q_ extends _e{constructor(e){super(),ke(this,e,W_,F_,be,{checked:0})}}function Qo(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Zn=Qo();function yp(s){Zn=s}const wp=/[&<>"']/,U_=new RegExp(wp.source,"g"),Sp=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,K_=new RegExp(Sp.source,"g"),J_={"&":"&","<":"<",">":">",'"':""","'":"'"},Oc=s=>J_[s];function at(s,e){if(e){if(wp.test(s))return s.replace(U_,Oc)}else if(Sp.test(s))return s.replace(K_,Oc);return s}const G_=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function xp(s){return s.replace(G_,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Y_=/(^|[^\[])\^/g;function Le(s,e){s=typeof s=="string"?s:s.source,e=e||"";const t={replace:(n,i)=>(i=i.source||i,i=i.replace(Y_,"$1"),s=s.replace(n,i),t),getRegex:()=>new RegExp(s,e)};return t}const X_=/[^\w:]/g,Z_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Dc(s,e,t){if(s){let n;try{n=decodeURIComponent(xp(t)).replace(X_,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}e&&!Z_.test(t)&&(t=nk(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const Zs={},Q_=/^[^:]+:\/*[^/]*$/,ek=/^([^:]+:)[\s\S]*$/,tk=/^([^:]+:\/*[^/]*)[\s\S]*$/;function nk(s,e){Zs[" "+s]||(Q_.test(s)?Zs[" "+s]=s+"/":Zs[" "+s]=hr(s,"/",!0)),s=Zs[" "+s];const t=s.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:s.replace(ek,"$1")+e:e.charAt(0)==="/"?t?e:s.replace(tk,"$1")+e:s+e}const Ar={exec:function(){}};function Pc(s,e){const t=s.replace(/\|/g,(r,l,o)=>{let a=!1,h=l;for(;--h>=0&&o[h]==="\\";)a=!a;return a?"|":" |"}),n=t.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>e)n.splice(e);else for(;n.length{const r=i.match(/^\s+/);if(r===null)return i;const[l]=r;return l.length>=n.length?i.slice(n.length):i}).join(` +`)}class Cr{constructor(e){this.options=e||Zn}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:hr(n,` +`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=rk(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const i=hr(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const n=t[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(n);return this.lexer.state.top=i,{type:"blockquote",raw:t[0],tokens:r,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,i,r,l,o,a,h,c,f,u,d,p,m=t[1].trim();const g=m.length>1,b={type:"list",raw:"",ordered:g,start:g?+m.slice(0,-1):"",loose:!1,items:[]};m=g?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=g?m:"[*+-]");const v=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(p=!1,!(!(t=v.exec(e))||this.rules.block.hr.test(e)));){if(n=t[0],e=e.substring(n.length),c=t[2].split(` +`,1)[0].replace(/^\t+/,M=>" ".repeat(3*M.length)),f=e.split(` +`,1)[0],this.options.pedantic?(l=2,d=c.trimLeft()):(l=t[2].search(/[^ ]/),l=l>4?1:l,d=c.slice(l),l+=t[1].length),a=!1,!c&&/^ *$/.test(f)&&(n+=f+` +`,e=e.substring(f.length+1),p=!0),!p){const M=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),B=new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),N=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),E=new RegExp(`^ {0,${Math.min(3,l-1)}}#`);for(;e&&(u=e.split(` +`,1)[0],f=u,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(N.test(f)||E.test(f)||M.test(f)||B.test(e)));){if(f.search(/[^ ]/)>=l||!f.trim())d+=` +`+f.slice(l);else{if(a||c.search(/[^ ]/)>=4||N.test(c)||E.test(c)||B.test(c))break;d+=` +`+f}!a&&!f.trim()&&(a=!0),n+=u+` +`,e=e.substring(u.length+1),c=f.slice(l)}}b.loose||(h?b.loose=!0:/\n *\n *$/.test(n)&&(h=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(d),i&&(r=i[0]!=="[ ] ",d=d.replace(/^\[[ xX]\] +/,""))),b.items.push({type:"list_item",raw:n,task:!!i,checked:r,loose:!1,text:d}),b.raw+=n}b.items[b.items.length-1].raw=n.trimRight(),b.items[b.items.length-1].text=d.trimRight(),b.raw=b.raw.trimRight();const O=b.items.length;for(o=0;oN.type==="space"),B=M.length>0&&M.some(N=>/\n.*\n/.test(N.raw));b.loose=B}if(b.loose)for(o=0;o$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const n={type:"table",header:Pc(t[1]).map(i=>({text:i})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(n.header.length===n.align.length){n.raw=t[0];let i=n.align.length,r,l,o,a;for(r=0;r({text:h}));for(i=n.header.length,l=0;l/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):at(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;const l=hr(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{const l=ik(t[2],"()");if(l>-1){const a=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let i=t[2],r="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);l&&(i=l[1],r=l[3])}else r=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),Nc(t,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:r&&r.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(/\s+/g," ");if(i=t[i.toLowerCase()],!i){const r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return Nc(n,i,n[0],this.lexer)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrong.lDelim.exec(e);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const l=i[0].length-1;let o,a,h=l,c=0;const f=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+l);(i=f.exec(t))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(a=o.length,i[3]||i[4]){h+=a;continue}else if((i[5]||i[6])&&l%3&&!((l+a)%3)){c+=a;continue}if(h-=a,h>0)continue;a=Math.min(a,a+h+c);const u=e.slice(0,l+i.index+a+1);if(Math.min(l,a)%2){const p=u.slice(1,-1);return{type:"em",raw:u,text:p,tokens:this.lexer.inlineTokens(p)}}const d=u.slice(2,-2);return{type:"strong",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=at(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let i,r;return n[2]==="@"?(i=at(this.options.mangle?t(n[1]):n[1]),r="mailto:"+i):(i=at(n[1]),r=i),{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let i,r;if(n[2]==="@")i=at(this.options.mangle?t(n[0]):n[0]),r="mailto:"+i;else{let l;do l=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(l!==n[0]);i=at(n[0]),n[1]==="www."?r="http://"+n[0]:r=n[0]}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):at(n[0]):n[0]:i=at(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:i}}}}const oe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Ar,lheading:/^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};oe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;oe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;oe.def=Le(oe.def).replace("label",oe._label).replace("title",oe._title).getRegex();oe.bullet=/(?:[*+-]|\d{1,9}[.)])/;oe.listItemStart=Le(/^( *)(bull) */).replace("bull",oe.bullet).getRegex();oe.list=Le(oe.list).replace(/bull/g,oe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+oe.def.source+")").getRegex();oe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";oe._comment=/|$)/;oe.html=Le(oe.html,"i").replace("comment",oe._comment).replace("tag",oe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();oe.lheading=Le(oe.lheading).replace(/bull/g,oe.bullet).getRegex();oe.paragraph=Le(oe._paragraph).replace("hr",oe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oe._tag).getRegex();oe.blockquote=Le(oe.blockquote).replace("paragraph",oe.paragraph).getRegex();oe.normal={...oe};oe.gfm={...oe.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};oe.gfm.table=Le(oe.gfm.table).replace("hr",oe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oe._tag).getRegex();oe.gfm.paragraph=Le(oe._paragraph).replace("hr",oe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",oe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oe._tag).getRegex();oe.pedantic={...oe.normal,html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",oe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ar,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Le(oe.normal._paragraph).replace("hr",oe.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",oe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const te={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ar,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ar,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~";te.punctuation=Le(te.punctuation,"u").replace(/punctuation/g,te._punctuation).getRegex();te.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;te.anyPunctuation=/\\[punct]/g;te._escapes=/\\([punct])/g;te._comment=Le(oe._comment).replace("(?:-->|$)","-->").getRegex();te.emStrong.lDelim=Le(te.emStrong.lDelim,"u").replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimAst=Le(te.emStrong.rDelimAst,"gu").replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimUnd=Le(te.emStrong.rDelimUnd,"gu").replace(/punct/g,te._punctuation).getRegex();te.anyPunctuation=Le(te.anyPunctuation,"gu").replace(/punct/g,te._punctuation).getRegex();te._escapes=Le(te._escapes,"gu").replace(/punct/g,te._punctuation).getRegex();te._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;te._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;te.autolink=Le(te.autolink).replace("scheme",te._scheme).replace("email",te._email).getRegex();te._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;te.tag=Le(te.tag).replace("comment",te._comment).replace("attribute",te._attribute).getRegex();te._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;te._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;te._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;te.link=Le(te.link).replace("label",te._label).replace("href",te._href).replace("title",te._title).getRegex();te.reflink=Le(te.reflink).replace("label",te._label).replace("ref",oe._label).getRegex();te.nolink=Le(te.nolink).replace("ref",oe._label).getRegex();te.reflinkSearch=Le(te.reflinkSearch,"g").replace("reflink",te.reflink).replace("nolink",te.nolink).getRegex();te.normal={...te};te.pedantic={...te.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",te._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te._label).getRegex()};te.gfm={...te.normal,escape:Le(te.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),e+="&#"+n+";";return e}class dn{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Zn,this.options.tokenizer=this.options.tokenizer||new Cr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:oe.normal,inline:te.normal};this.options.pedantic?(t.block=oe.pedantic,t.inline=te.pedantic):this.options.gfm&&(t.block=oe.gfm,this.options.breaks?t.inline=te.breaks:t.inline=te.gfm),this.tokenizer.rules=t}static get rules(){return{block:oe,inline:te}}static lex(e,t){return new dn(t).lex(e)}static lexInline(e,t){return new dn(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,` +`),this.blockTokens(e,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(o,a,h)=>a+" ".repeat(h.length));let n,i,r,l;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(o=>(n=o.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=` +`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=` +`+n.raw,i.text+=` +`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=` +`+n.raw,i.text+=` +`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(r=e,this.options.extensions&&this.options.extensions.startBlock){let o=1/0;const a=e.slice(1);let h;this.options.extensions.startBlock.forEach(function(c){h=c.call({lexer:this},a),typeof h=="number"&&h>=0&&(o=Math.min(o,h))}),o<1/0&&o>=0&&(r=e.substring(0,o+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r))){i=t[t.length-1],l&&i.type==="paragraph"?(i.raw+=` +`+n.raw,i.text+=` +`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n),l=r.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&i.type==="text"?(i.raw+=` +`+n.raw,i.text+=` +`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,i,r,l=e,o,a,h;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)c.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(l))!=null;)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(h=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(n=c.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,l,h)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e,Bc)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e,Bc))){e=e.substring(n.raw.length),t.push(n);continue}if(r=e,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const f=e.slice(1);let u;this.options.extensions.startInline.forEach(function(d){u=d.call({lexer:this},f),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(r=e.substring(0,c+1))}if(n=this.tokenizer.inlineText(r,lk)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(h=n.raw.slice(-1)),a=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}}class Mr{constructor(e){this.options=e||Zn}code(e,t,n){const i=(t||"").match(/\S*/)[0];if(this.options.highlight){const r=this.options.highlight(e,i);r!=null&&r!==e&&(n=!0,e=r)}return e=e.replace(/\n$/,"")+` +`,i?'
'+(n?e:at(e,!0))+`
+`:"
"+(n?e:at(e,!0))+`
+`}blockquote(e){return`
+${e}
+`}html(e,t){return e}heading(e,t,n,i){if(this.options.headerIds){const r=this.options.headerPrefix+i.slug(n);return`${e} +`}return`${e} +`}hr(){return this.options.xhtml?`
+`:`
+`}list(e,t,n){const i=t?"ol":"ul",r=t&&n!==1?' start="'+n+'"':"";return"<"+i+r+`> +`+e+" +`}listitem(e){return`
  • ${e}
  • +`}checkbox(e){return" "}paragraph(e){return`

    ${e}

    +`}table(e,t){return t&&(t=`${t}`),` + +`+e+` +`+t+`
    +`}tablerow(e){return` +${e} +`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+` +`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?"
    ":"
    "}del(e){return`${e}`}link(e,t,n){if(e=Dc(this.options.sanitize,this.options.baseUrl,e),e===null)return n;let i='",i}image(e,t,n){if(e=Dc(this.options.sanitize,this.options.baseUrl,e),e===null)return n;let i=`${n}":">",i}text(e){return e}}class ea{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class ta{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[e];do i++,n=e+"-"+i;while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=i,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class pn{constructor(e){this.options=e||Zn,this.options.renderer=this.options.renderer||new Mr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ea,this.slugger=new ta}static parse(e,t){return new pn(t).parse(e)}static parseInline(e,t){return new pn(t).parseInline(e)}parse(e,t=!0){let n="",i,r,l,o,a,h,c,f,u,d,p,m,g,b,v,O,M,B,N;const E=e.length;for(i=0;i0&&v.tokens[0].type==="paragraph"?(v.tokens[0].text=B+" "+v.tokens[0].text,v.tokens[0].tokens&&v.tokens[0].tokens.length>0&&v.tokens[0].tokens[0].type==="text"&&(v.tokens[0].tokens[0].text=B+" "+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:"text",text:B}):b+=B),b+=this.parse(v.tokens,g),u+=this.renderer.listitem(b,M,O);n+=this.renderer.list(u,p,m);continue}case"html":{n+=this.renderer.html(d.text,d.block);continue}case"paragraph":{n+=this.renderer.paragraph(this.parseInline(d.tokens));continue}case"text":{for(u=d.tokens?this.parseInline(d.tokens):d.text;i+1{n=n.concat(this.walkTokens(i[r],t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if(r.renderer){const l=t.renderers[r.name];l?t.renderers[r.name]=function(...o){let a=r.renderer.apply(this,o);return a===!1&&(a=l.apply(this,o)),a}:t.renderers[r.name]=r.renderer}if(r.tokenizer){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[r.level]?t[r.level].unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),i.extensions=t),n.renderer){const r=this.defaults.renderer||new Mr(this.defaults);for(const l in n.renderer){const o=r[l];r[l]=(...a)=>{let h=n.renderer[l].apply(r,a);return h===!1&&(h=o.apply(r,a)),h}}i.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new Cr(this.defaults);for(const l in n.tokenizer){const o=r[l];r[l]=(...a)=>{let h=n.tokenizer[l].apply(r,a);return h===!1&&(h=o.apply(r,a)),h}}i.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new os;for(const l in n.hooks){const o=r[l];os.passThroughHooks.has(l)?r[l]=a=>{if(this.defaults.async)return Promise.resolve(n.hooks[l].call(r,a)).then(c=>o.call(r,c));const h=n.hooks[l].call(r,a);return o.call(r,h)}:r[l]=(...a)=>{let h=n.hooks[l].apply(r,a);return h===!1&&(h=o.apply(r,a)),h}}i.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens;i.walkTokens=function(l){let o=[];return o.push(n.walkTokens.call(this,l)),r&&(o=o.concat(r.call(this,l))),o}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}}ws=new WeakSet,Co=function(e,t){return(n,i,r)=>{typeof i=="function"&&(r=i,i=null);const l={...i};i={...this.defaults,...l};const o=Ns(this,Or,Ap).call(this,i.silent,i.async,r);if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(sk(i,r),i.hooks&&(i.hooks.options=i),r){const a=i.highlight;let h;try{i.hooks&&(n=i.hooks.preprocess(n)),h=e(n,i)}catch(u){return o(u)}const c=u=>{let d;if(!u)try{i.walkTokens&&this.walkTokens(h,i.walkTokens),d=t(h,i),i.hooks&&(d=i.hooks.postprocess(d))}catch(p){u=p}return i.highlight=a,u?o(u):r(null,d)};if(!a||a.length<3||(delete i.highlight,!h.length))return c();let f=0;this.walkTokens(h,u=>{u.type==="code"&&(f++,setTimeout(()=>{a(u.text,u.lang,(d,p)=>{if(d)return c(d);p!=null&&p!==u.text&&(u.text=p,u.escaped=!0),f--,f===0&&c()})},0))}),f===0&&c();return}if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(a=>e(a,i)).then(a=>i.walkTokens?Promise.all(this.walkTokens(a,i.walkTokens)).then(()=>a):a).then(a=>t(a,i)).then(a=>i.hooks?i.hooks.postprocess(a):a).catch(o);try{i.hooks&&(n=i.hooks.preprocess(n));const a=e(n,i);i.walkTokens&&this.walkTokens(a,i.walkTokens);let h=t(a,i);return i.hooks&&(h=i.hooks.postprocess(h)),h}catch(a){return o(a)}}},Or=new WeakSet,Ap=function(e,t,n){return i=>{if(i.message+=` +Please report this to https://github.com/markedjs/marked.`,e){const r="

    An error occurred:

    "+at(i.message+"",!0)+"
    ";if(t)return Promise.resolve(r);if(n){n(null,r);return}return r}if(t)return Promise.reject(i);if(n){n(i);return}throw i}};const ui=new ok(Zn);function Pe(s,e,t){return ui.parse(s,e,t)}Pe.options=Pe.setOptions=function(s){return ui.setOptions(s),Pe.defaults=ui.defaults,yp(Pe.defaults),Pe};Pe.getDefaults=Qo;Pe.defaults=Zn;Pe.use=function(...s){return ui.use(...s),Pe.defaults=ui.defaults,yp(Pe.defaults),Pe};Pe.walkTokens=function(s,e){return ui.walkTokens(s,e)};Pe.parseInline=ui.parseInline;Pe.Parser=pn;Pe.parser=pn.parse;Pe.Renderer=Mr;Pe.TextRenderer=ea;Pe.Lexer=dn;Pe.lexer=dn.lex;Pe.Tokenizer=Cr;Pe.Slugger=ta;Pe.Hooks=os;Pe.parse=Pe;Pe.options;Pe.setOptions;Pe.use;Pe.walkTokens;Pe.parseInline;pn.parse;dn.lex;function Lc(s,e,t){const n=s.slice();return n[22]=e[t][0],n[23]=e[t][1],n}function ak(s){let e,t;return{c(){e=x("span"),t=I(s[9])},l(n){e=A(n,"SPAN",{});var i=P(e);t=z(i,s[9]),i.forEach(_)},m(n,i){S(n,e,i),y(e,t)},p(n,i){i&512&&re(t,n[9])},d(n){n&&_(e)}}}function hk(s){let e,t,n,i;return{c(){e=x("button"),t=I(s[9]),this.h()},l(r){e=A(r,"BUTTON",{class:!0});var l=P(e);t=z(l,s[9]),l.forEach(_),this.h()},h(){k(e,"class","ast-toggle svelte-4kp1v9"),ie(e,"open",!s[0])},m(r,l){S(r,e,l),y(e,t),n||(i=ue(e,"click",s[17]),n=!0)},p(r,l){l&512&&re(t,r[9]),l&1&&ie(e,"open",!r[0])},d(r){r&&_(e),n=!1,i()}}}function ck(s){let e,t=JSON.stringify(s[1])+"",n,i;return{c(){e=x("span"),n=I(t),this.h()},l(r){e=A(r,"SPAN",{class:!0});var l=P(e);n=z(l,t),l.forEach(_),this.h()},h(){k(e,"class",i="token "+typeof s[1]+" svelte-4kp1v9")},m(r,l){S(r,e,l),y(e,n)},p(r,l){l&2&&t!==(t=JSON.stringify(r[1])+"")&&re(n,t),l&2&&i!==(i="token "+typeof r[1]+" svelte-4kp1v9")&&k(e,"class",i)},i:de,o:de,d(r){r&&_(e)}}}function fk(s){let e,t,n,i;const r=[dk,uk],l=[];function o(a,h){return a[0]&&!a[10]?0:1}return e=o(s),t=l[e]=r[e](s),{c(){t.c(),n=ce()},l(a){t.l(a),n=ce()},m(a,h){l[e].m(a,h),S(a,n,h),i=!0},p(a,h){let c=e;e=o(a),e===c?l[e].p(a,h):(Se(),T(l[c],1,1,()=>{l[c]=null}),xe(),t=l[e],t?t.p(a,h):(t=l[e]=r[e](a),t.c()),w(t,1),t.m(n.parentNode,n))},i(a){i||(w(t),i=!0)},o(a){T(t),i=!1},d(a){a&&_(n),l[e].d(a)}}}function uk(s){let e,t=s[6]?"[":"{",n,i,r,l,o,a=s[6]?"]":"}",h,c,f=Oe(Object.entries(s[1])),u=[];for(let p=0;pT(u[p],1,1,()=>{u[p]=null});return{c(){e=x("span"),n=I(t),i=Q(),r=x("ul");for(let p=0;p{u[g]=null}),xe(),i=u[n],i?i.p(p,m):(i=u[n]=f[n](p),i.c()),w(i,1),i.m(e,null)),(!r||m&1056)&&ie(e,"marked",!p[10]&&p[5])},i(p){r||(w(i),r=!0)},o(p){T(i),r=!1},d(p){p&&_(e),c&&c.d(),u[n].d(),s[19](null),l=!1,Pn(o)}}}function mk(s,e,t){let n,i,r,l,o,a,h,c,{key:f=""}=e,{value:u}=e,{collapsed:d=!0}=e,{path_nodes:p=[]}=e,{autoscroll:m=!0}=e;const{module_editor:g,toggleable:b}=di();Me(s,g,$=>t(21,h=$)),Me(s,b,$=>t(16,c=$));let v,O="";function M($){o&&($.stopPropagation(),"start"in u&&"end"in u&&typeof u.start=="number"&&typeof u.end=="number"&&(h==null||h.markText({from:u.start??0,to:u.end??0})))}function B($){o&&($.stopPropagation(),h==null||h.unmarkText())}const N=()=>t(0,d=!d),E=()=>t(0,d=!d);function V($){Ye[$?"unshift":"push"](()=>{v=$,t(4,v)})}return s.$$set=$=>{"key"in $&&t(15,f=$.key),"value"in $&&t(1,u=$.value),"collapsed"in $&&t(0,d=$.collapsed),"path_nodes"in $&&t(2,p=$.path_nodes),"autoscroll"in $&&t(3,m=$.autoscroll)},s.$$.update=()=>{if(s.$$.dirty&6&&t(10,n=p[0]===u),s.$$.dirty&6&&t(5,i=p[p.length-1]===u),s.$$.dirty&2&&t(6,r=Array.isArray(u)),s.$$.dirty&2&&t(7,l=u&&typeof u=="object"),s.$$.dirty&130&&(o=l&&"start"in u&&"end"in u&&typeof u.start=="number"&&typeof u.end=="number"),s.$$.dirty&32768&&t(9,a=f?`${f}:`:""),s.$$.dirty&6&&t(0,d=!p.includes(u)),s.$$.dirty&195)e:{if(!l||!d)break e;if(r){if(!("length"in u))break e;t(8,O=`[ ${u.length} element${u.length===1?"":"s"} ]`)}else t(8,O=`{ ${Object.keys(u).join(", ")} }`)}s.$$.dirty&65592&&m&&i&&!c&&as().then(()=>{v&&v.scrollIntoView()})},[d,u,p,m,v,i,r,l,O,a,n,g,b,M,B,f,c,N,E,V]}class Cp extends _e{constructor(e){super(),ke(this,e,mk,pk,be,{key:15,value:1,collapsed:0,path_nodes:2,autoscroll:3})}}function gk(s){let e,t="No AST available";return{c(){e=x("p"),e.textContent=t},l(n){e=A(n,"P",{"data-svelte-h":!0}),Te(e)!=="svelte-chie2w"&&(e.textContent=t)},m(n,i){S(n,e,i)},p:de,i:de,o:de,d(n){n&&_(e)}}}function bk(s){let e,t,n,i,r;return n=new Cp({props:{value:s[0],path_nodes:s[2],autoscroll:s[1],collapsed:!1}}),{c(){e=x("ul"),t=I(` + `),U(n.$$.fragment),i=I(` + `),this.h()},l(l){e=A(l,"UL",{class:!0});var o=P(e);t=z(o,` + `),G(n.$$.fragment,o),i=z(o,` + `),o.forEach(_),this.h()},h(){k(e,"class","svelte-l8zkkp")},m(l,o){S(l,e,o),y(e,t),K(n,e,null),y(e,i),r=!0},p(l,o){const a={};o&1&&(a.value=l[0]),o&4&&(a.path_nodes=l[2]),o&2&&(a.autoscroll=l[1]),n.$set(a)},i(l){r||(w(n.$$.fragment,l),r=!0)},o(l){T(n.$$.fragment,l),r=!1},d(l){l&&_(e),J(n)}}}function _k(s){let e;return{c(){e=I("The AST is not public API and may change at any point in time")},l(t){e=z(t,"The AST is not public API and may change at any point in time")},m(t,n){S(t,e,n)},d(t){t&&_(e)}}}function kk(s){let e,t,n,i,r,l,o,a,h,c,f,u;const d=[bk,gk],p=[];function m(g,b){return typeof g[0]=="object"?0:1}return l=m(s),o=p[l]=d[l](s),f=new Li({props:{kind:"info",$$slots:{default:[_k]},$$scope:{ctx:s}}}),{c(){e=x("div"),t=x("pre"),n=I(" "),i=x("code"),r=I(` + `),o.c(),a=I(` + `),h=I(` + `),c=Q(),U(f.$$.fragment),this.h()},l(g){e=A(g,"DIV",{class:!0});var b=P(e);t=A(b,"PRE",{class:!0});var v=P(t);n=z(v," "),i=A(v,"CODE",{class:!0});var O=P(i);r=z(O,` + `),o.l(O),a=z(O,` + `),O.forEach(_),h=z(v,` + `),v.forEach(_),c=ee(b),G(f.$$.fragment,b),b.forEach(_),this.h()},h(){k(i,"class","svelte-l8zkkp"),k(t,"class","svelte-l8zkkp"),k(e,"class","ast-view svelte-l8zkkp")},m(g,b){S(g,e,b),y(e,t),y(t,n),y(t,i),y(i,r),p[l].m(i,null),y(i,a),y(t,h),y(e,c),K(f,e,null),u=!0},p(g,[b]){let v=l;l=m(g),l===v?p[l].p(g,b):(Se(),T(p[v],1,1,()=>{p[v]=null}),xe(),o=p[l],o?o.p(g,b):(o=p[l]=d[l](g),o.c()),w(o,1),o.m(i,a));const O={};b&32&&(O.$$scope={dirty:b,ctx:g}),f.$set(O)},i(g){u||(w(o),w(f.$$.fragment,g),u=!0)},o(g){T(o),T(f.$$.fragment,g),u=!1},d(g){g&&_(e),p[l].d(),J(f)}}}function Mp(s,e){const t=e[e.length-1];if(t){for(const n of Object.values(t))if(typeof n=="object"){const i=Mp(s,e.concat([n]));if(i)return i}if("start"in t&&"end"in t&&typeof t.start=="number"&&typeof t.end=="number"&&t.start<=s&&s<=t.end)return e}}function vk(s){let e=0;for(const t of Object.values(s))t&&typeof t.end=="number"&&t.end>e&&(e=t.end);return e}function yk(s,e,t){let n,i,r;Me(s,vp,a=>t(4,r=a));let{ast:l}=e,{autoscroll:o=!0}=e;return s.$$set=a=>{"ast"in a&&t(0,l=a.ast),"autoscroll"in a&&t(1,o=a.autoscroll)},s.$$.update=()=>{s.$$.dirty&17&&t(3,n=l?Math.min(r,vk(l)):r),s.$$.dirty&9&&t(2,i=Mp(n,[l])||[])},[l,o,i,n,r]}class wk extends _e{constructor(e){super(),ke(this,e,yk,kk,be,{ast:0,autoscroll:1})}}function Sk(){return new Worker(""+new URL("../workers/index-1f87fee6.js",import.meta.url).href)}const Ol=new Map;let xk=1;class Ak{constructor(e){qe(this,"worker");qe(this,"handlers",new Map);if(!Ol.has(e)){const t=new Sk;t.postMessage({type:"init",svelte_url:e}),Ol.set(e,t)}this.worker=Ol.get(e),this.worker.addEventListener("message",t=>{const n=this.handlers.get(t.data.id);n&&(n(t.data.result),this.handlers.delete(t.data.id))})}compile(e,t,n){return new Promise(i=>{const r=xk++;this.handlers.set(r,i),this.worker.postMessage({id:r,type:"compile",source:e.source,options:Object.assign({name:e.name,filename:`${e.name}.svelte`},t),entry:e.name==="App",return_ast:n})})}destroy(){this.worker.terminate()}}function Ck(s){let e,t,n,i,r="generate:",l,o,a,h,c='"dom"',f,u,d,p,m='"ssr",',g,b,v,O="dev:",M,B,N,E,V,$=s[0].dev+"",F,R,D,C,W,ne="css:",Y,he,j,fe,ge='"injected"',Re,we,dt,X,pe='"external"',et,Ae,lt,St,Vt='"none",',Gt,kt,_n,Es="hydratable:",Ri,Bt,Ii,Nn,Yt,Bn=s[0].hydratable+"",kn,Ln,zi,xt,vn,Os="customElement:",ji,Ht,H,Ue,Qe,Ft=s[0].customElement+"",mi,Kr,Jr,Wt,Qn,na="immutable:",Gr,yn,Yr,Xr,gi,Vi=s[0].immutable+"",Ds,Zr,Qr,Xt,ei,ia="legacy:",el,wn,tl,nl,bi,Hi=s[0].legacy+"",Ps,il,Sn,sl,rl,ll,sa;function Lp(me){s[5](me)}let ra={};s[0].dev!==void 0&&(ra.checked=s[0].dev),B=new yi({props:ra}),Ye.push(()=>on(B,"checked",Lp));function $p(me){s[9](me)}let la={};s[0].hydratable!==void 0&&(la.checked=s[0].hydratable),Bt=new yi({props:la}),Ye.push(()=>on(Bt,"checked",$p));function Rp(me){s[10](me)}let oa={};s[0].customElement!==void 0&&(oa.checked=s[0].customElement),Ht=new yi({props:oa}),Ye.push(()=>on(Ht,"checked",Rp));function Ip(me){s[11](me)}let aa={};s[0].immutable!==void 0&&(aa.checked=s[0].immutable),yn=new yi({props:aa}),Ye.push(()=>on(yn,"checked",Ip));function zp(me){s[12](me)}let ha={};return s[0].legacy!==void 0&&(ha.checked=s[0].legacy),wn=new yi({props:ha}),Ye.push(()=>on(wn,"checked",zp)),sl=ma(s[3][0]),rl=ma(s[3][1]),{c(){e=x("div"),t=I(`result = svelte.compile(source, { + `),n=x("div"),i=x("span"),i.textContent=r,l=Q(),o=x("input"),a=Q(),h=x("label"),h.innerHTML=c,f=Q(),u=x("input"),d=Q(),p=x("label"),p.innerHTML=m,g=Q(),b=x("label"),v=x("span"),v.textContent=O,M=Q(),U(B.$$.fragment),E=Q(),V=x("span"),F=I($),R=I(","),D=Q(),C=x("div"),W=x("span"),W.textContent=ne,Y=Q(),he=x("input"),j=Q(),fe=x("label"),fe.innerHTML=ge,Re=Q(),we=x("input"),dt=Q(),X=x("label"),X.innerHTML=pe,et=Q(),Ae=x("input"),lt=Q(),St=x("label"),St.innerHTML=Vt,Gt=Q(),kt=x("label"),_n=x("span"),_n.textContent=Es,Ri=Q(),U(Bt.$$.fragment),Nn=Q(),Yt=x("span"),kn=I(Bn),Ln=I(","),zi=Q(),xt=x("label"),vn=x("span"),vn.textContent=Os,ji=Q(),U(Ht.$$.fragment),Ue=Q(),Qe=x("span"),mi=I(Ft),Kr=I(","),Jr=Q(),Wt=x("label"),Qn=x("span"),Qn.textContent=na,Gr=Q(),U(yn.$$.fragment),Xr=Q(),gi=x("span"),Ds=I(Vi),Zr=I(","),Qr=Q(),Xt=x("label"),ei=x("span"),ei.textContent=ia,el=Q(),U(wn.$$.fragment),nl=Q(),bi=x("span"),Ps=I(Hi),il=I(` + });`),this.h()},l(me){e=A(me,"DIV",{class:!0});var Ce=P(e);t=z(Ce,`result = svelte.compile(source, { + `),n=A(Ce,"DIV",{class:!0});var At=P(n);i=A(At,"SPAN",{class:!0,"data-svelte-h":!0}),Te(i)!=="svelte-t8nsvv"&&(i.textContent=r),l=ee(At),o=A(At,"INPUT",{id:!0,type:!0,class:!0}),a=ee(At),h=A(At,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),Te(h)!=="svelte-gndn9e"&&(h.innerHTML=c),f=ee(At),u=A(At,"INPUT",{id:!0,type:!0,class:!0}),d=ee(At),p=A(At,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),Te(p)!=="svelte-1335xie"&&(p.innerHTML=m),At.forEach(_),g=ee(Ce),b=A(Ce,"LABEL",{class:!0});var Zt=P(b);v=A(Zt,"SPAN",{class:!0,"data-svelte-h":!0}),Te(v)!=="svelte-1i9e2k1"&&(v.textContent=O),M=ee(Zt),G(B.$$.fragment,Zt),E=ee(Zt),V=A(Zt,"SPAN",{class:!0});var Fi=P(V);F=z(Fi,$),Fi.forEach(_),R=z(Zt,","),Zt.forEach(_),D=ee(Ce),C=A(Ce,"DIV",{class:!0});var tt=P(C);W=A(tt,"SPAN",{class:!0,"data-svelte-h":!0}),Te(W)!=="svelte-hu2ox1"&&(W.textContent=ne),Y=ee(tt),he=A(tt,"INPUT",{id:!0,type:!0,class:!0}),j=ee(tt),fe=A(tt,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),Te(fe)!=="svelte-rv5qmc"&&(fe.innerHTML=ge),Re=ee(tt),we=A(tt,"INPUT",{id:!0,type:!0,class:!0}),dt=ee(tt),X=A(tt,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),Te(X)!=="svelte-9m8h80"&&(X.innerHTML=pe),et=ee(tt),Ae=A(tt,"INPUT",{id:!0,type:!0,class:!0}),lt=ee(tt),St=A(tt,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),Te(St)!=="svelte-1gsgvhw"&&(St.innerHTML=Vt),tt.forEach(_),Gt=ee(Ce),kt=A(Ce,"LABEL",{class:!0});var Qt=P(kt);_n=A(Qt,"SPAN",{class:!0,"data-svelte-h":!0}),Te(_n)!=="svelte-7z4zo"&&(_n.textContent=Es),Ri=ee(Qt),G(Bt.$$.fragment,Qt),Nn=ee(Qt),Yt=A(Qt,"SPAN",{class:!0});var ca=P(Yt);kn=z(ca,Bn),ca.forEach(_),Ln=z(Qt,","),Qt.forEach(_),zi=ee(Ce),xt=A(Ce,"LABEL",{class:!0});var ti=P(xt);vn=A(ti,"SPAN",{class:!0,"data-svelte-h":!0}),Te(vn)!=="svelte-1aqgqk3"&&(vn.textContent=Os),ji=ee(ti),G(Ht.$$.fragment,ti),Ue=ee(ti),Qe=A(ti,"SPAN",{class:!0});var fa=P(Qe);mi=z(fa,Ft),fa.forEach(_),Kr=z(ti,","),ti.forEach(_),Jr=ee(Ce),Wt=A(Ce,"LABEL",{class:!0});var ni=P(Wt);Qn=A(ni,"SPAN",{class:!0,"data-svelte-h":!0}),Te(Qn)!=="svelte-eljvs4"&&(Qn.textContent=na),Gr=ee(ni),G(yn.$$.fragment,ni),Xr=ee(ni),gi=A(ni,"SPAN",{class:!0});var ua=P(gi);Ds=z(ua,Vi),ua.forEach(_),Zr=z(ni,","),ni.forEach(_),Qr=ee(Ce),Xt=A(Ce,"LABEL",{class:!0});var _i=P(Xt);ei=A(_i,"SPAN",{class:!0,"data-svelte-h":!0}),Te(ei)!=="svelte-1t9suxf"&&(ei.textContent=ia),el=ee(_i),G(wn.$$.fragment,_i),nl=ee(_i),bi=A(_i,"SPAN",{class:!0});var da=P(bi);Ps=z(da,Hi),da.forEach(_),_i.forEach(_),il=z(Ce,` + });`),Ce.forEach(_),this.h()},h(){k(i,"class","key svelte-1s7ndru"),k(o,"id","dom-input"),k(o,"type","radio"),o.__value="dom",ri(o,o.__value),k(o,"class","svelte-1s7ndru"),k(h,"for","dom-input"),k(h,"class","svelte-1s7ndru"),k(u,"id","ssr-input"),k(u,"type","radio"),u.__value="ssr",ri(u,u.__value),k(u,"class","svelte-1s7ndru"),k(p,"for","ssr-input"),k(p,"class","svelte-1s7ndru"),k(n,"class","option svelte-1s7ndru"),k(v,"class","key svelte-1s7ndru"),k(V,"class","boolean svelte-1s7ndru"),k(b,"class","option svelte-1s7ndru"),k(W,"class","key svelte-1s7ndru"),k(he,"id","injected-input"),k(he,"type","radio"),he.__value="injected",ri(he,he.__value),k(he,"class","svelte-1s7ndru"),k(fe,"for","injected-input"),k(fe,"class","svelte-1s7ndru"),k(we,"id","external-input"),k(we,"type","radio"),we.__value="external",ri(we,we.__value),k(we,"class","svelte-1s7ndru"),k(X,"for","external-input"),k(X,"class","svelte-1s7ndru"),k(Ae,"id","none-input"),k(Ae,"type","radio"),Ae.__value="none",ri(Ae,Ae.__value),k(Ae,"class","svelte-1s7ndru"),k(St,"for","none-input"),k(St,"class","svelte-1s7ndru"),k(C,"class","option svelte-1s7ndru"),k(_n,"class","key svelte-1s7ndru"),k(Yt,"class","boolean svelte-1s7ndru"),k(kt,"class","option svelte-1s7ndru"),k(vn,"class","key svelte-1s7ndru"),k(Qe,"class","boolean svelte-1s7ndru"),k(xt,"class","option svelte-1s7ndru"),k(Qn,"class","key svelte-1s7ndru"),k(gi,"class","boolean svelte-1s7ndru"),k(Wt,"class","option svelte-1s7ndru"),k(ei,"class","key svelte-1s7ndru"),k(bi,"class","boolean svelte-1s7ndru"),k(Xt,"class","option svelte-1s7ndru"),k(e,"class","options svelte-1s7ndru"),sl.p(he,we,Ae),rl.p(o,u)},m(me,Ce){S(me,e,Ce),y(e,t),y(e,n),y(n,i),y(n,l),y(n,o),o.checked=o.__value===s[0].generate,y(n,a),y(n,h),y(n,f),y(n,u),u.checked=u.__value===s[0].generate,y(n,d),y(n,p),y(e,g),y(e,b),y(b,v),y(b,M),K(B,b,null),y(b,E),y(b,V),y(V,F),y(b,R),y(e,D),y(e,C),y(C,W),y(C,Y),y(C,he),he.checked=he.__value===s[0].css,y(C,j),y(C,fe),y(C,Re),y(C,we),we.checked=we.__value===s[0].css,y(C,dt),y(C,X),y(C,et),y(C,Ae),Ae.checked=Ae.__value===s[0].css,y(C,lt),y(C,St),y(e,Gt),y(e,kt),y(kt,_n),y(kt,Ri),K(Bt,kt,null),y(kt,Nn),y(kt,Yt),y(Yt,kn),y(kt,Ln),y(e,zi),y(e,xt),y(xt,vn),y(xt,ji),K(Ht,xt,null),y(xt,Ue),y(xt,Qe),y(Qe,mi),y(xt,Kr),y(e,Jr),y(e,Wt),y(Wt,Qn),y(Wt,Gr),K(yn,Wt,null),y(Wt,Xr),y(Wt,gi),y(gi,Ds),y(Wt,Zr),y(e,Qr),y(e,Xt),y(Xt,ei),y(Xt,el),K(wn,Xt,null),y(Xt,nl),y(Xt,bi),y(bi,Ps),y(e,il),Sn=!0,ll||(sa=[ue(o,"change",s[2]),ue(u,"change",s[4]),ue(he,"change",s[6]),ue(we,"change",s[7]),ue(Ae,"change",s[8])],ll=!0)},p(me,[Ce]){Ce&1&&(o.checked=o.__value===me[0].generate),Ce&1&&(u.checked=u.__value===me[0].generate);const At={};!N&&Ce&1&&(N=!0,At.checked=me[0].dev,ln(()=>N=!1)),B.$set(At),(!Sn||Ce&1)&&$!==($=me[0].dev+"")&&re(F,$),Ce&1&&(he.checked=he.__value===me[0].css),Ce&1&&(we.checked=we.__value===me[0].css),Ce&1&&(Ae.checked=Ae.__value===me[0].css);const Zt={};!Ii&&Ce&1&&(Ii=!0,Zt.checked=me[0].hydratable,ln(()=>Ii=!1)),Bt.$set(Zt),(!Sn||Ce&1)&&Bn!==(Bn=me[0].hydratable+"")&&re(kn,Bn);const Fi={};!H&&Ce&1&&(H=!0,Fi.checked=me[0].customElement,ln(()=>H=!1)),Ht.$set(Fi),(!Sn||Ce&1)&&Ft!==(Ft=me[0].customElement+"")&&re(mi,Ft);const tt={};!Yr&&Ce&1&&(Yr=!0,tt.checked=me[0].immutable,ln(()=>Yr=!1)),yn.$set(tt),(!Sn||Ce&1)&&Vi!==(Vi=me[0].immutable+"")&&re(Ds,Vi);const Qt={};!tl&&Ce&1&&(tl=!0,Qt.checked=me[0].legacy,ln(()=>tl=!1)),wn.$set(Qt),(!Sn||Ce&1)&&Hi!==(Hi=me[0].legacy+"")&&re(Ps,Hi)},i(me){Sn||(w(B.$$.fragment,me),w(Bt.$$.fragment,me),w(Ht.$$.fragment,me),w(yn.$$.fragment,me),w(wn.$$.fragment,me),Sn=!0)},o(me){T(B.$$.fragment,me),T(Bt.$$.fragment,me),T(Ht.$$.fragment,me),T(yn.$$.fragment,me),T(wn.$$.fragment,me),Sn=!1},d(me){me&&_(e),J(B),J(Bt),J(Ht),J(yn),J(wn),sl.r(),rl.r(),ll=!1,Pn(sa)}}}function Mk(s,e,t){let n;const{compile_options:i}=di();Me(s,i,g=>t(0,n=g));const r=[[],[]];function l(){n.generate=this.__value,i.set(n)}function o(){n.generate=this.__value,i.set(n)}function a(g){s.$$.not_equal(n.dev,g)&&(n.dev=g,i.set(n))}function h(){n.css=this.__value,i.set(n)}function c(){n.css=this.__value,i.set(n)}function f(){n.css=this.__value,i.set(n)}function u(g){s.$$.not_equal(n.hydratable,g)&&(n.hydratable=g,i.set(n))}function d(g){s.$$.not_equal(n.customElement,g)&&(n.customElement=g,i.set(n))}function p(g){s.$$.not_equal(n.immutable,g)&&(n.immutable=g,i.set(n))}function m(g){s.$$.not_equal(n.legacy,g)&&(n.legacy=g,i.set(n))}return[n,i,l,r,o,a,h,c,f,u,d,p,m]}class Tk extends _e{constructor(e){super(),ke(this,e,Mk,Ck,be,{})}}function Rc(s){return Object.prototype.toString.call(s)==="[object Date]"}function Mo(s,e,t,n){if(typeof t=="number"||Rc(t)){const i=n-t,r=(t-e)/(s.dt||1/60),l=s.opts.stiffness*i,o=s.opts.damping*r,a=(l-o)*s.inv_mass,h=(r+a)*s.dt;return Math.abs(h)Mo(s,e[r],t[r],n[r]));if(typeof t=="object"){const i={};for(const r in t)i[r]=Mo(s,e[r],t[r],n[r]);return i}else throw new Error(`Cannot spring ${typeof t} values`)}}function Ek(s,e={}){const t=ot(s),{stiffness:n=.15,damping:i=.8,precision:r=.01}=e;let l,o,a,h=s,c=s,f=1,u=0,d=!1;function p(g,b={}){c=g;const v=a={};return s==null||b.hard||m.stiffness>=1&&m.damping>=1?(d=!0,l=ka(),h=g,t.set(s=c),Promise.resolve()):(b.soft&&(u=1/((b.soft===!0?.5:+b.soft)*60),f=0),o||(l=ka(),d=!1,o=Kp(O=>{if(d)return d=!1,o=null,!1;f=Math.min(f+u,1);const M={inv_mass:f,opts:m,settled:!0,dt:(O-l)*60/1e3},B=Mo(M,h,s,c);return l=O,h=s,t.set(s=B),M.settled&&(o=null),!M.settled})),new Promise(O=>{o.promise.then(()=>{v===a&&O()})}))}const m={set:p,update:(g,b)=>p(g(c,s),b),subscribe:t.subscribe,stiffness:n,damping:i,precision:r};return m}const Ok=s=>({}),Ic=s=>({}),Dk=s=>({}),zc=s=>({}),Pk=s=>({}),jc=s=>({});function Nk(s){let e,t;const n=s[5].main,i=Tt(n,s,s[7],Ic);return{c(){e=x("section"),i&&i.c(),this.h()},l(r){e=A(r,"SECTION",{slot:!0,class:!0});var l=P(e);i&&i.l(l),l.forEach(_),this.h()},h(){k(e,"slot","a"),k(e,"class","svelte-fqifjb")},m(r,l){S(r,e,l),i&&i.m(e,null),t=!0},p(r,l){i&&i.p&&(!t||l&128)&&Et(i,n,r,r[7],t?Dt(n,r[7],l,Ok):Ot(r[7]),Ic)},i(r){t||(w(i,r),t=!0)},o(r){T(i,r),t=!1},d(r){r&&_(e),i&&i.d(r)}}}function Bk(s){let e,t,n,i,r,l,o,a,h,c;const f=s[5]["panel-header"],u=Tt(f,s,s[7],jc),d=s[5]["panel-body"],p=Tt(d,s,s[7],zc);return{c(){e=x("section"),t=x("button"),n=x("span"),i=I(s[1]),r=Q(),u&&u.c(),l=Q(),o=x("div"),p&&p.c(),this.h()},l(m){e=A(m,"SECTION",{slot:!0,class:!0});var g=P(e);t=A(g,"BUTTON",{class:!0});var b=P(t);n=A(b,"SPAN",{class:!0});var v=P(n);i=z(v,s[1]),v.forEach(_),r=ee(b),u&&u.l(b),b.forEach(_),l=ee(g),o=A(g,"DIV",{class:!0});var O=P(o);p&&p.l(O),O.forEach(_),g.forEach(_),this.h()},h(){k(n,"class","panel-heading svelte-fqifjb"),k(t,"class","panel-header svelte-fqifjb"),k(o,"class","panel-body svelte-fqifjb"),k(e,"slot","b"),k(e,"class","svelte-fqifjb")},m(m,g){S(m,e,g),y(e,t),y(t,n),y(n,i),y(t,r),u&&u.m(t,null),y(e,l),y(e,o),p&&p.m(o,null),a=!0,h||(c=ue(t,"click",s[3]),h=!0)},p(m,g){(!a||g&2)&&re(i,m[1]),u&&u.p&&(!a||g&128)&&Et(u,f,m,m[7],a?Dt(f,m[7],g,Pk):Ot(m[7]),jc),p&&p.p&&(!a||g&128)&&Et(p,d,m,m[7],a?Dt(d,m[7],g,Dk):Ot(m[7]),zc)},i(m){a||(w(u,m),w(p,m),a=!0)},o(m){T(u,m),T(p,m),a=!1},d(m){m&&_(e),u&&u.d(m),p&&p.d(m),h=!1,c()}}}function Lk(s){let e,t,n;function i(l){s[6](l)}let r={max:Tp,min:"10%",type:"vertical",priority:"max",$$slots:{b:[Bk],a:[Nk]},$$scope:{ctx:s}};return s[0]!==void 0&&(r.pos=s[0]),e=new pu({props:r}),Ye.push(()=>on(e,"pos",i)),{c(){U(e.$$.fragment)},l(l){G(e.$$.fragment,l)},m(l,o){K(e,l,o),n=!0},p(l,[o]){const a={};o&130&&(a.$$scope={dirty:o,ctx:l}),!t&&o&1&&(t=!0,a.pos=l[0],ln(()=>t=!1)),e.$set(a)},i(l){n||(w(e.$$.fragment,l),n=!0)},o(l){T(e.$$.fragment,l),n=!1},d(l){J(e,l)}}}const Qs=/(\d+)(?:(px|rem|%|em))/i;let Tp="90%";function $k(s,e,t){let n,i,{$$slots:r={},$$scope:l}=e,{panel:o}=e,{pos:a="90%"}=e;const h=Ek(+a.replace(Qs,"$1"),{stiffness:.2,damping:.5});Me(s,h,u=>t(4,i=u));const c=()=>{const u=+a.replace(Qs,"$1");h.set(u,{hard:!0}),u>80?h.set(n):(n=u,h.set(+Tp.replace(Qs,"$1")))};function f(u){a=u,t(0,a),t(4,i)}return s.$$set=u=>{"panel"in u&&t(1,o=u.panel),"pos"in u&&t(0,a=u.pos),"$$scope"in u&&t(7,l=u.$$scope)},s.$$.update=()=>{s.$$.dirty&16&&t(0,a=i+"%"),s.$$.dirty&1&&(n=Math.min(+a.replace(Qs,"$1"),70))},[a,o,h,c,i,r,f,l]}class Ep extends _e{constructor(e){super(),ke(this,e,$k,Lk,be,{panel:1,pos:0})}}let Rk=1;const si=()=>{};class Ik{constructor(e,t){qe(this,"iframe");qe(this,"handlers",{on_fetch_progress:si,on_console:si,on_error:si,on_console_group:si,on_console_group_collapsed:si,on_console_group_end:si,on_unhandled_rejection:si});qe(this,"pending_cmds",new Map);qe(this,"handle_event",e=>this.handle_repl_message(e));this.iframe=e,this.handlers=t,window.addEventListener("message",this.handle_event,!1)}destroy(){window.removeEventListener("message",this.handle_event)}iframe_command(e,t){return new Promise((n,i)=>{var l;const r=Rk++;this.pending_cmds.set(r,{resolve:n,reject:i}),(l=this.iframe.contentWindow)==null||l.postMessage({action:e,cmd_id:r,args:t},"*")})}handle_command_message(e){let t=e.action,n=e.cmd_id,i=this.pending_cmds.get(n);if(i){if(this.pending_cmds.delete(n),t==="cmd_error"){let{message:r,stack:l}=e,o=new Error(r);o.stack=l,i.reject(o)}t==="cmd_ok"&&i.resolve(e.args)}else console.error("command not found",n,e,[...this.pending_cmds.keys()])}handle_repl_message(e){if(e.source!==this.iframe.contentWindow)return;const{action:t,args:n}=e.data;switch(t){case"cmd_error":case"cmd_ok":return this.handle_command_message(e.data);case"fetch_progress":return this.handlers.on_fetch_progress(n.remaining);case"error":return this.handlers.on_error(e.data);case"unhandledrejection":return this.handlers.on_unhandled_rejection(e.data);case"console":return this.handlers.on_console(e.data);case"console_group":return this.handlers.on_console_group(e.data);case"console_group_collapsed":return this.handlers.on_console_group_collapsed(e.data);case"console_group_end":return this.handlers.on_console_group_end(e.data)}}eval(e){return this.iframe_command("eval",{script:e})}handle_links(){return this.iframe_command("catch_clicks",{})}}const Vc={};function bn(s,e){const t=Oo(Vc),n=typeof s=="function"?s(t):s,i={...t,...n};return e!=null&&e.expandable&&(i.isParentExpanded=i.expanded),Kf(Vc,i),t}function Hc(s){let e,t,n="▶",i,r,l;return{c(){e=x("span"),t=x("span"),i=I(n),this.h()},l(o){e=A(o,"SPAN",{class:!0});var a=P(e);t=A(a,"SPAN",{class:!0});var h=P(t);i=z(h,n),h.forEach(_),a.forEach(_),this.h()},h(){k(t,"class","arrow svelte-1qd6nto"),ie(t,"expanded",s[2]),k(e,"class","container svelte-1qd6nto")},m(o,a){S(o,e,a),y(e,t),y(t,i),r||(l=ue(e,"click",s[4]),r=!0)},p(o,a){a&4&&ie(t,"expanded",o[2])},d(o){o&&_(e),r=!1,l()}}}function zk(s){let e,t=s[1]&&Hc(s);return{c(){t&&t.c(),e=ce()},l(n){t&&t.l(n),e=ce()},m(n,i){t&&t.m(n,i),S(n,e,i)},p(n,[i]){n[1]?t?t.p(n,i):(t=Hc(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:de,o:de,d(n){n&&_(e),t&&t.d(n)}}}function jk(s,e,t){let n,i,r=de,l=()=>(r(),r=Gf(h,f=>t(2,i=f)),h);s.$$.on_destroy.push(()=>r());const{expanded:o,expandable:a}=bn();Me(s,a,f=>t(1,n=f));let{expanded:h=o}=e;l();const c=f=>{f.stopPropagation(),Ve(h,i=!i,i)};return s.$$set=f=>{"expanded"in f&&l(t(0,h=f.expanded))},[h,n,i,a,c]}class Op extends _e{constructor(e){super(),ke(this,e,jk,zk,be,{expanded:0})}}function Vk(s){let e;const t=s[1].default,n=Tt(t,s,s[0],null);return{c(){n&&n.c()},l(i){n&&n.l(i)},m(i,r){n&&n.m(i,r),e=!0},p(i,[r]){n&&n.p&&(!e||r&1)&&Et(n,t,i,i[0],e?Dt(t,i[0],r,null):Ot(i[0]),null)},i(i){e||(w(n,i),e=!0)},o(i){T(n,i),e=!1},d(i){n&&n.d(i)}}}function Hk(s,e,t){let{$$slots:n={},$$scope:i}=e;return bn({displayMode:"summary"}),s.$$set=r=>{"$$scope"in r&&t(0,i=r.$$scope)},[i,n]}class Fk extends _e{constructor(e){super(),ke(this,e,Hk,Vk,be,{})}}function Wk(s){let e;const t=s[3].default,n=Tt(t,s,s[2],null);return{c(){n&&n.c()},l(i){n&&n.l(i)},m(i,r){n&&n.m(i,r),e=!0},p(i,[r]){n&&n.p&&(!e||r&4)&&Et(n,t,i,i[2],e?Dt(t,i[2],r,null):Ot(i[2]),null)},i(i){e||(w(n,i),e=!0)},o(i){T(n,i),e=!1},d(i){n&&n.d(i)}}}function qk(s,e,t){let{$$slots:n={},$$scope:i}=e,{expanded:r}=e,{key:l}=e;const o=ot(!1);return bn(({keyPath:a,level:h})=>(l!=="[[Entries]]"&&(a=[...a,l],h=h+1),{keyPath:a,level:h,expanded:r,expandable:o})),s.$$set=a=>{"expanded"in a&&t(0,r=a.expanded),"key"in a&&t(1,l=a.key),"$$scope"in a&&t(2,i=a.$$scope)},[r,l,i,n]}class Dp extends _e{constructor(e){super(),ke(this,e,qk,Wk,be,{expanded:0,key:1})}}function Fc(s,e,t){const n=s.slice();return n[19]=e[t],n[21]=t,n}const Uk=s=>({key:s&1}),Wc=s=>({key:s[19],index:s[21]}),Kk=s=>({key:s&1}),qc=s=>({key:s[19],index:s[21]}),Jk=s=>({}),Uc=s=>({root:s[6]}),Gk=s=>({}),Kc=s=>({});function Yk(s){let e,t,n,i,r,l,o,a,h=s[6]&&Zk(s);n=new Fk({props:{$$slots:{default:[Qk]},$$scope:{ctx:s}}});let c=s[4]&&Jc(s);return{c(){e=x("span"),h&&h.c(),t=Q(),U(n.$$.fragment),i=Q(),c&&c.c(),r=ce(),this.h()},l(f){e=A(f,"SPAN",{class:!0});var u=P(e);h&&h.l(u),t=ee(u),G(n.$$.fragment,u),u.forEach(_),i=ee(f),c&&c.l(f),r=ce(),this.h()},h(){k(e,"class","root svelte-19drypg")},m(f,u){S(f,e,u),h&&h.m(e,null),y(e,t),K(n,e,null),S(f,i,u),c&&c.m(f,u),S(f,r,u),l=!0,o||(a=ue(e,"click",s[9]),o=!0)},p(f,u){f[6]&&h.p(f,u);const d={};u&8192&&(d.$$scope={dirty:u,ctx:f}),n.$set(d),f[4]?c?(c.p(f,u),u&16&&w(c,1)):(c=Jc(f),c.c(),w(c,1),c.m(r.parentNode,r)):c&&(Se(),T(c,1,1,()=>{c=null}),xe())},i(f){l||(w(h),w(n.$$.fragment,f),w(c),l=!0)},o(f){T(h),T(n.$$.fragment,f),T(c),l=!1},d(f){f&&(_(e),_(i),_(r)),h&&h.d(),J(n),c&&c.d(f),o=!1,a()}}}function Xk(s){let e;const t=s[11].summary,n=Tt(t,s,s[13],Kc);return{c(){n&&n.c()},l(i){n&&n.l(i)},m(i,r){n&&n.m(i,r),e=!0},p(i,r){n&&n.p&&(!e||r&8192)&&Et(n,t,i,i[13],e?Dt(t,i[13],r,Gk):Ot(i[13]),Kc)},i(i){e||(w(n,i),e=!0)},o(i){T(n,i),e=!1},d(i){n&&n.d(i)}}}function Zk(s){let e,t;return e=new Op({props:{expanded:s[7]}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p:de,i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function Qk(s){let e;const t=s[11].preview,n=Tt(t,s,s[13],Uc);return{c(){n&&n.c()},l(i){n&&n.l(i)},m(i,r){n&&n.m(i,r),e=!0},p(i,r){n&&n.p&&(!e||r&8192)&&Et(n,t,i,i[13],e?Dt(t,i[13],r,Jk):Ot(i[13]),Uc)},i(i){e||(w(n,i),e=!0)},o(i){T(n,i),e=!1},d(i){n&&n.d(i)}}}function Jc(s){let e,t,n,i,r=Oe(s[0]),l=[];for(let a=0;aT(l[a],1,1,()=>{l[a]=null});return{c(){e=x("ul");for(let a=0;a{};function iv(s,e,t){let n,i,r,{$$slots:l={},$$scope:o}=e,{keys:a}=e,{shouldShowColon:h=void 0}=e,{expandKey:c=N=>N}=e,{defaultExpanded:f=!1}=e;const{isParentExpanded:u,displayMode:d,root:p,expanded:m,expandable:g,keyPath:b,level:v,shouldExpandNode:O}=bn({root:!1},{expandable:!0});if(Me(s,m,N=>t(4,i=N)),Me(s,g,N=>t(14,r=N)),Ve(g,r=!0,r),d!=="summary"){if(!f){const N=O({keyPath:b,level:v});N!==void 0&&(f=N)}Do(()=>u.subscribe(N=>{N?m.set(f):m.set(!1)}))}function M(){Ve(m,i=!i,i)}const B=N=>n[N].update(E=>!E);return s.$$set=N=>{"keys"in N&&t(0,a=N.keys),"shouldShowColon"in N&&t(1,h=N.shouldShowColon),"expandKey"in N&&t(2,c=N.expandKey),"defaultExpanded"in N&&t(10,f=N.defaultExpanded),"$$scope"in N&&t(13,o=N.$$scope)},s.$$.update=()=>{s.$$.dirty&1&&t(3,n=a.map(()=>ot(!1)))},[a,h,c,n,i,d,p,m,g,M,f,l,B,o]}class jt extends _e{constructor(e){super(),ke(this,e,iv,tv,be,{keys:0,shouldShowColon:1,expandKey:2,defaultExpanded:10})}}function Xc(s,e,t){const n=s.slice();return n[9]=e[t],n[11]=t,n}const sv=s=>({item:s&1}),Zc=s=>({item:s[9],index:s[11]});function Qc(s){let e,t,n,i,r,l=s[3]&&ef(s),o=Oe(s[0]),a=[];for(let u=0;uT(a[u],1,1,()=>{a[u]=null});let c=s[1]&&rf(),f=s[4]&&lf(s);return{c(){l&&l.c(),e=Q();for(let u=0;u{n=null}),xe())},i(i){t||(w(n),t=!0)},o(i){T(n),t=!1},d(i){i&&_(e),n&&n.d(i)}}}function lv(s,e,t){let{$$slots:n={},$$scope:i}=e,{list:r}=e,{hasMore:l}=e,{label:o=void 0}=e,{prefix:a=void 0}=e,{postfix:h=void 0}=e,{root:c=!1}=e;const{showPreview:f}=bn();return s.$$set=u=>{"list"in u&&t(0,r=u.list),"hasMore"in u&&t(1,l=u.hasMore),"label"in u&&t(2,o=u.label),"prefix"in u&&t(3,a=u.prefix),"postfix"in u&&t(4,h=u.postfix),"root"in u&&t(5,c=u.root),"$$scope"in u&&t(7,i=u.$$scope)},[r,l,o,a,h,c,f,i,n]}class $i extends _e{constructor(e){super(),ke(this,e,lv,rv,be,{list:0,hasMore:1,label:2,prefix:3,postfix:4,root:5})}}function ov(s){let e,t=(s[1]??"{…}")+"",n;return{c(){e=x("span"),n=I(t),this.h()},l(i){e=A(i,"SPAN",{class:!0});var r=P(e);n=z(r,t),r.forEach(_),this.h()},h(){k(e,"class","label")},m(i,r){S(i,e,r),y(e,n)},p(i,r){r&2&&t!==(t=(i[1]??"{…}")+"")&&re(n,t)},d(i){i&&_(e)}}}function av(s){let e,t=s[6]+"",n,i,r=": ",l,o,a;return o=new Fe({props:{value:s[0][s[6]]}}),{c(){e=x("span"),n=I(t),i=x("span"),l=I(r),U(o.$$.fragment),this.h()},l(h){e=A(h,"SPAN",{class:!0});var c=P(e);n=z(c,t),c.forEach(_),i=A(h,"SPAN",{class:!0});var f=P(i);l=z(f,r),f.forEach(_),G(o.$$.fragment,h),this.h()},h(){k(e,"class","property"),k(i,"class","operator")},m(h,c){S(h,e,c),y(e,n),S(h,i,c),y(i,l),K(o,h,c),a=!0},p(h,c){(!a||c&64)&&t!==(t=h[6]+"")&&re(n,t);const f={};c&65&&(f.value=h[0][h[6]]),o.$set(f)},i(h){a||(w(o.$$.fragment,h),a=!0)},o(h){T(o.$$.fragment,h),a=!1},d(h){h&&(_(e),_(i)),J(o,h)}}}function hv(s){let e,t;return e=new $i({props:{list:s[3],hasMore:s[3].length({6:n}),({item:n})=>n?64:0]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&8&&(r.list=n[3]),i&12&&(r.hasMore=n[3].length({4:n}),({key:n})=>n?16:0],item_key:[cv,({key:n})=>({4:n}),({key:n})=>n?16:0],preview:[hv,({root:n})=>({5:n}),({root:n})=>n?32:0],summary:[ov]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,[i]){const r={};i&4&&(r.keys=n[2]),i&191&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function dv(s,e,t){let n,i,{value:r}=e,{summary:l}=e;return s.$$set=o=>{"value"in o&&t(0,r=o.value),"summary"in o&&t(1,l=o.summary)},s.$$.update=()=>{s.$$.dirty&1&&t(2,n=Object.getOwnPropertyNames(r)),s.$$.dirty&4&&t(3,i=n.slice(0,5))},[r,l,n,i]}class To extends _e{constructor(e){super(),ke(this,e,dv,uv,be,{value:0,summary:1})}}function pv(s){let e,t,n=s[0].length+"",i,r;return{c(){e=x("span"),t=I("Array("),i=I(n),r=I(")"),this.h()},l(l){e=A(l,"SPAN",{class:!0});var o=P(e);t=z(o,"Array("),i=z(o,n),r=z(o,")"),o.forEach(_),this.h()},h(){k(e,"class","label")},m(l,o){S(l,e,o),y(e,t),y(e,i),y(e,r)},p(l,o){o&1&&n!==(n=l[0].length+"")&&re(i,n)},d(l){l&&_(e)}}}function mv(s){let e,t;return e=new Fe({props:{value:s[5]}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&32&&(r.value=n[5]),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function gv(s){let e,t;return e=new $i({props:{list:s[1],hasMore:s[1].length({5:n}),({item:n})=>n?32:0]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&2&&(r.list=n[1]),i&3&&(r.hasMore=n[1].length({3:n}),({key:n})=>n?8:0],item_key:[bv,({key:n})=>({3:n}),({key:n})=>n?8:0],preview:[gv,({root:n})=>({4:n}),({root:n})=>n?16:0],summary:[pv]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,[i]){const r={};i&4&&(r.keys=n[2]),i&91&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function vv(s,e,t){let n,i,{value:r}=e;return s.$$set=l=>{"value"in l&&t(0,r=l.value)},s.$$.update=()=>{s.$$.dirty&1&&t(2,n=Object.getOwnPropertyNames(r)),s.$$.dirty&1&&t(1,i=r.slice(0,5))},[r,i,n]}class yv extends _e{constructor(e){super(),ke(this,e,vv,kv,be,{value:0})}}function wv(s){let e,t,n,i=s[3].length+"",r,l;return{c(){e=x("span"),t=I(s[1]),n=I("("),r=I(i),l=I(")"),this.h()},l(o){e=A(o,"SPAN",{class:!0});var a=P(e);t=z(a,s[1]),n=z(a,"("),r=z(a,i),l=z(a,")"),a.forEach(_),this.h()},h(){k(e,"class","label")},m(o,a){S(o,e,a),y(e,t),y(e,n),y(e,r),y(e,l)},p(o,a){a&2&&re(t,o[1]),a&8&&i!==(i=o[3].length+"")&&re(r,i)},d(o){o&&_(e)}}}function Sv(s){let e,t;return e=new Fe({props:{value:s[9]}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&512&&(r.value=n[9]),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function xv(s){let e,t;return e=new $i({props:{list:s[4],hasMore:s[4].length({9:n}),({item:n})=>n?512:0]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&16&&(r.list=n[4]),i&20&&(r.hasMore=n[4].length({7:n}),({key:n})=>n?128:0],item_key:[Tv,({key:n})=>({7:n}),({key:n})=>n?128:0]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&8&&(r.keys=n[3]),i&1156&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function Tv(s){let e,t=s[7]+"",n;return{c(){e=x("span"),n=I(t),this.h()},l(i){e=A(i,"SPAN",{class:!0});var r=P(e);n=z(r,t),r.forEach(_),this.h()},h(){k(e,"class","property")},m(i,r){S(i,e,r),y(e,n)},p(i,r){r&128&&t!==(t=i[7]+"")&&re(n,t)},d(i){i&&_(e)}}}function Ev(s){let e,t;return e=new Fe({props:{value:s[2][s[7]]}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&132&&(r.value=n[2][n[7]]),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function Ov(s){let e,t,n,i;const r=[Mv,Cv],l=[];function o(a,h){return a[6]===ks?0:1}return e=o(s),t=l[e]=r[e](s),{c(){t.c(),n=ce()},l(a){t.l(a),n=ce()},m(a,h){l[e].m(a,h),S(a,n,h),i=!0},p(a,h){let c=e;e=o(a),e===c?l[e].p(a,h):(Se(),T(l[c],1,1,()=>{l[c]=null}),xe(),t=l[e],t?t.p(a,h):(t=l[e]=r[e](a),t.c()),w(t,1),t.m(n.parentNode,n))},i(a){i||(w(t),i=!0)},o(a){T(t),i=!1},d(a){a&&_(n),l[e].d(a)}}}function Dv(s){let e,t;return e=new jt({props:{keys:[ks,"size"],shouldShowColon:s[5],$$slots:{item_value:[Ov,({key:n})=>({6:n}),({key:n})=>n?64:0],item_key:[Av,({key:n})=>({6:n}),({key:n})=>n?64:0],preview:[xv,({root:n})=>({8:n}),({root:n})=>n?256:0],summary:[wv]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,[i]){const r={};i&1375&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}const ks="[[Entries]]";function Pv(s,e,t){let n,{value:i}=e,{nodeType:r}=e,l=[],o=[];const a=h=>h!==ks;return s.$$set=h=>{"value"in h&&t(0,i=h.value),"nodeType"in h&&t(1,r=h.nodeType)},s.$$.update=()=>{if(s.$$.dirty&1){let h=[],c=[],f=0;for(const u of i)h.push(f++),c.push(u);t(3,l=h),t(2,o=c)}s.$$.dirty&4&&t(4,n=o.slice(0,5))},[i,r,o,l,n,a]}class Nv extends _e{constructor(e){super(),ke(this,e,Pv,Dv,be,{value:0,nodeType:1})}}function Bv(s){let e,t,n=s[2].length+"",i,r;return{c(){e=x("span"),t=I("Map("),i=I(n),r=I(")"),this.h()},l(l){e=A(l,"SPAN",{color:!0});var o=P(e);t=z(o,"Map("),i=z(o,n),r=z(o,")"),o.forEach(_),this.h()},h(){k(e,"color","label")},m(l,o){S(l,e,o),y(e,t),y(e,i),y(e,r)},p(l,o){o&4&&n!==(n=l[2].length+"")&&re(i,n)},d(l){l&&_(e)}}}function Lv(s){let e,t,n=" => ",i,r,l;return e=new Fe({props:{value:s[11]}}),r=new Fe({props:{value:s[0].get(s[11])}}),{c(){U(e.$$.fragment),t=x("span"),i=I(n),U(r.$$.fragment),this.h()},l(o){G(e.$$.fragment,o),t=A(o,"SPAN",{class:!0});var a=P(t);i=z(a,n),a.forEach(_),G(r.$$.fragment,o),this.h()},h(){k(t,"class","operator")},m(o,a){K(e,o,a),S(o,t,a),y(t,i),K(r,o,a),l=!0},p(o,a){const h={};a&2048&&(h.value=o[11]),e.$set(h);const c={};a&2049&&(c.value=o[0].get(o[11])),r.$set(c)},i(o){l||(w(e.$$.fragment,o),w(r.$$.fragment,o),l=!0)},o(o){T(e.$$.fragment,o),T(r.$$.fragment,o),l=!1},d(o){o&&_(t),J(e,o),J(r,o)}}}function $v(s){let e,t;return e=new $i({props:{list:s[4],hasMore:s[4].length({11:n}),({item:n})=>n?2048:0]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&16&&(r.list=n[4]),i&17&&(r.hasMore=n[4].length({8:n}),({key:n})=>n?256:0],item_key:[jv,({key:n})=>({8:n}),({key:n})=>n?256:0]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&2&&(r.keys=n[1]),i&4&&(r.expandKey=n[5]),i&4364&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function jv(s){let e,t=s[8]+"",n;return{c(){e=x("span"),n=I(t),this.h()},l(i){e=A(i,"SPAN",{class:!0});var r=P(e);n=z(r,t),r.forEach(_),this.h()},h(){k(e,"class","property")},m(i,r){S(i,e,r),y(e,n)},p(i,r){r&256&&t!==(t=i[8]+"")&&re(n,t)},d(i){i&&_(e)}}}function Vv(s){let e,t="{ ",n,i,r,l=" => ",o,a,h,c=" }",f,u;return i=new Fe({props:{value:s[2][s[8]]}}),a=new Fe({props:{value:s[3][s[8]]}}),{c(){e=x("span"),n=I(t),U(i.$$.fragment),r=x("span"),o=I(l),U(a.$$.fragment),h=x("span"),f=I(c),this.h()},l(d){e=A(d,"SPAN",{class:!0});var p=P(e);n=z(p,t),p.forEach(_),G(i.$$.fragment,d),r=A(d,"SPAN",{class:!0});var m=P(r);o=z(m,l),m.forEach(_),G(a.$$.fragment,d),h=A(d,"SPAN",{class:!0});var g=P(h);f=z(g,c),g.forEach(_),this.h()},h(){k(e,"class","operator"),k(r,"class","operator"),k(h,"class","operator")},m(d,p){S(d,e,p),y(e,n),K(i,d,p),S(d,r,p),y(r,o),K(a,d,p),S(d,h,p),y(h,f),u=!0},p(d,p){const m={};p&260&&(m.value=d[2][d[8]]),i.$set(m);const g={};p&264&&(g.value=d[3][d[8]]),a.$set(g)},i(d){u||(w(i.$$.fragment,d),w(a.$$.fragment,d),u=!0)},o(d){T(i.$$.fragment,d),T(a.$$.fragment,d),u=!1},d(d){d&&(_(e),_(r),_(h)),J(i,d),J(a,d)}}}function Hv(s){let e,t=s[9]+"",n;return{c(){e=x("span"),n=I(t),this.h()},l(i){e=A(i,"SPAN",{class:!0});var r=P(e);n=z(r,t),r.forEach(_),this.h()},h(){k(e,"class","property")},m(i,r){S(i,e,r),y(e,n)},p(i,r){r&512&&t!==(t=i[9]+"")&&re(n,t)},d(i){i&&_(e)}}}function Fv(s){let e,t;return e=new Fe({props:{value:s[9]==="key"?s[2][s[8]]:s[3][s[8]]}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&780&&(r.value=n[9]==="key"?n[2][n[8]]:n[3][n[8]]),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function Wv(s){let e,t;return e=new jt({props:{keys:["key","value"],$$slots:{item_value:[Fv,({key:n})=>({9:n}),({key:n})=>n?512:0],item_key:[Hv,({key:n})=>({9:n}),({key:n})=>n?512:0],preview:[Vv]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&4876&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function qv(s){let e,t,n,i;const r=[zv,Iv],l=[];function o(a,h){return a[7]===vs?0:1}return e=o(s),t=l[e]=r[e](s),{c(){t.c(),n=ce()},l(a){t.l(a),n=ce()},m(a,h){l[e].m(a,h),S(a,n,h),i=!0},p(a,h){let c=e;e=o(a),e===c?l[e].p(a,h):(Se(),T(l[c],1,1,()=>{l[c]=null}),xe(),t=l[e],t?t.p(a,h):(t=l[e]=r[e](a),t.c()),w(t,1),t.m(n.parentNode,n))},i(a){i||(w(t),i=!0)},o(a){T(t),i=!1},d(a){a&&_(n),l[e].d(a)}}}function Uv(s){let e,t;return e=new jt({props:{keys:[vs,"size"],shouldShowColon:s[6],$$slots:{item_value:[qv,({key:n})=>({7:n}),({key:n})=>n?128:0],item_key:[Rv,({key:n})=>({7:n}),({key:n})=>n?128:0],preview:[$v,({root:n})=>({10:n}),({root:n})=>n?1024:0],summary:[Bv]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,[i]){const r={};i&5279&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}const vs="[[Entries]]";function Kv(s,e,t){let n,{value:i}=e;bn();let r=[],l=[],o=[];const a=c=>l[c],h=c=>c!==vs;return s.$$set=c=>{"value"in c&&t(0,i=c.value)},s.$$.update=()=>{if(s.$$.dirty&1){let c=[],f=[],u=[],d=0;for(const p of i)c.push(d++),f.push(p[0]),u.push(p[1]);t(1,r=c),t(2,l=f),t(3,o=u)}s.$$.dirty&1&&t(4,n=Array.from(i.keys()).slice(0,5))},[i,r,l,o,n,a,h]}class Jv extends _e{constructor(e){super(),ke(this,e,Kv,Uv,be,{value:0})}}function Gv(s){let e,t,n;return{c(){e=x("span"),t=I(s[0]),this.h()},l(i){e=A(i,"SPAN",{class:!0});var r=P(e);t=z(r,s[0]),r.forEach(_),this.h()},h(){k(e,"class",n=cr(s[1])+" svelte-l95iub")},m(i,r){S(i,e,r),y(e,t)},p(i,[r]){r&1&&re(t,i[0]),r&2&&n!==(n=cr(i[1])+" svelte-l95iub")&&k(e,"class",n)},i:de,o:de,d(i){i&&_(e)}}}function Yv(s,e,t){let{value:n,nodeType:i}=e;return s.$$set=r=>{"value"in r&&t(0,n=r.value),"nodeType"in r&&t(1,i=r.nodeType)},[n,i]}class $n extends _e{constructor(e){super(),ke(this,e,Yv,Gv,be,{value:0,nodeType:1})}}function of(s,e,t){const n=s.slice();n[6]=e[t],n[9]=t;const i=n[9]T(i[l],1,1,()=>{i[l]=null});return{c(){for(let l=0;l0)},m(a,h){S(a,e,h),K(t,e,null),y(e,n),y(n,r),S(a,l,h),o=!0},p(a,h){const c={};h&1&&(c.value=a[6]+(a[7]?"\\n":"")),t.$set(c),(!o||h&1)&&i!==(i=a[7]?" +":"")&&re(r,i)},i(a){o||(w(t.$$.fragment,a),o=!0)},o(a){T(t.$$.fragment,a),o=!1},d(a){a&&(_(e),_(l)),J(t)}}}function Qv(s){let e,t,n,i,r,l;const o=[Zv,Xv],a=[];function h(c,f){return c[1]?0:1}return t=h(s),n=a[t]=o[t](s),{c(){e=x("span"),n.c()},l(c){e=A(c,"SPAN",{});var f=P(e);n.l(f),f.forEach(_)},m(c,f){S(c,e,f),a[t].m(e,null),i=!0,r||(l=ue(e,"click",s[4]),r=!0)},p(c,[f]){let u=t;t=h(c),t===u?a[t].p(c,f):(Se(),T(a[u],1,1,()=>{a[u]=null}),xe(),n=a[t],n?n.p(c,f):(n=a[t]=o[t](c),n.c()),w(n,1),n.m(e,null))},i(c){i||(w(n),i=!0)},o(c){T(n),i=!1},d(c){c&&_(e),a[t].d(),r=!1,l()}}}function ey(s,e,t){let n,i,{stack:r}=e;const{expanded:l,expandable:o}=bn();Me(s,l,h=>t(1,i=h)),Me(s,o,h=>t(5,n=h)),Ve(o,n=!0,n);const a=()=>Ve(l,i=!i,i);return s.$$set=h=>{"stack"in h&&t(0,r=h.stack)},[r,i,l,o,a]}class ty extends _e{constructor(e){super(),ke(this,e,ey,Qv,be,{stack:0})}}function ny(s){let e,t,n=String(s[0].message)+"",i;return{c(){e=x("span"),t=I("Error: "),i=I(n),this.h()},l(r){e=A(r,"SPAN",{class:!0});var l=P(e);t=z(l,"Error: "),i=z(l,n),l.forEach(_),this.h()},h(){k(e,"class","label")},m(r,l){S(r,e,l),y(e,t),y(e,i)},p(r,l){l&1&&n!==(n=String(r[0].message)+"")&&re(i,n)},d(r){r&&_(e)}}}function iy(s){let e,t,n=String(s[0].message)+"",i;return{c(){e=x("span"),t=I("Error: "),i=I(n),this.h()},l(r){e=A(r,"SPAN",{class:!0});var l=P(e);t=z(l,"Error: "),i=z(l,n),l.forEach(_),this.h()},h(){k(e,"class","label")},m(r,l){S(r,e,l),y(e,t),y(e,i)},p(r,l){l&1&&n!==(n=String(r[0].message)+"")&&re(i,n)},d(r){r&&_(e)}}}function sy(s){let e,t=s[2]+"",n;return{c(){e=x("span"),n=I(t),this.h()},l(i){e=A(i,"SPAN",{class:!0});var r=P(e);n=z(r,t),r.forEach(_),this.h()},h(){k(e,"class","property")},m(i,r){S(i,e,r),y(e,n)},p(i,r){r&4&&t!==(t=i[2]+"")&&re(n,t)},d(i){i&&_(e)}}}function ry(s){let e,t;return e=new Fe({props:{value:s[0][s[2]]}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&5&&(r.value=n[0][n[2]]),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function ly(s){let e,t;return e=new ty({props:{stack:s[1]}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&2&&(r.stack=n[1]),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function oy(s){let e,t,n,i;const r=[ly,ry],l=[];function o(a,h){return a[2]==="stack"?0:1}return e=o(s),t=l[e]=r[e](s),{c(){t.c(),n=ce()},l(a){t.l(a),n=ce()},m(a,h){l[e].m(a,h),S(a,n,h),i=!0},p(a,h){let c=e;e=o(a),e===c?l[e].p(a,h):(Se(),T(l[c],1,1,()=>{l[c]=null}),xe(),t=l[e],t?t.p(a,h):(t=l[e]=r[e](a),t.c()),w(t,1),t.m(n.parentNode,n))},i(a){i||(w(t),i=!0)},o(a){T(t),i=!1},d(a){a&&_(n),l[e].d(a)}}}function ay(s){let e,t;return e=new jt({props:{keys:["message","stack"],$$slots:{item_value:[oy,({key:n})=>({2:n}),({key:n})=>n?4:0],item_key:[sy,({key:n})=>({2:n}),({key:n})=>n?4:0],preview:[iy],summary:[ny]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,[i]){const r={};i&15&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function hy(s,e,t){let n,{value:i}=e;return s.$$set=r=>{"value"in r&&t(0,i=r.value)},s.$$.update=()=>{s.$$.dirty&1&&t(1,n=i.stack.split(` +`))},[i,n]}class cy extends _e{constructor(e){super(),ke(this,e,hy,ay,be,{value:0})}}function fy(s,e){const t=Object.prototype.toString.call(s).slice(8,-1);return t==="Object"?!e&&typeof s[Symbol.iterator]=="function"?"Iterable":s.constructor.name:t}function uy(s){let e,t,n,i;return{c(){e=x("span"),t=I('"'),n=I(s[0]),i=I('"'),this.h()},l(r){e=A(r,"SPAN",{class:!0});var l=P(e);t=z(l,'"'),n=z(l,s[0]),i=z(l,'"'),l.forEach(_),this.h()},h(){k(e,"class","svelte-1fvwa9c")},m(r,l){S(r,e,l),y(e,t),y(e,n),y(e,i)},p(r,l){l&1&&re(n,r[0])},d(r){r&&_(e)}}}function dy(s){let e,t,n=s[0].slice(0,30)+(s[0].length>30?"…":""),i,r;return{c(){e=x("span"),t=I('"'),i=I(n),r=I('"'),this.h()},l(l){e=A(l,"SPAN",{class:!0});var o=P(e);t=z(o,'"'),i=z(o,n),r=z(o,'"'),o.forEach(_),this.h()},h(){k(e,"class","svelte-1fvwa9c")},m(l,o){S(l,e,o),y(e,t),y(e,i),y(e,r)},p(l,o){o&1&&n!==(n=l[0].slice(0,30)+(l[0].length>30?"…":""))&&re(i,n)},d(l){l&&_(e)}}}function py(s){let e;function t(r,l){return r[1]==="summary"?dy:uy}let i=t(s)(s);return{c(){i.c(),e=ce()},l(r){i.l(r),e=ce()},m(r,l){i.m(r,l),S(r,e,l)},p(r,[l]){i.p(r,l)},i:de,o:de,d(r){r&&_(e),i.d(r)}}}function my(s,e,t){let n,{value:i}=e;const r={"\n":"\\n"," ":"\\t","\r":"\\r"},{displayMode:l}=bn();return s.$$set=o=>{"value"in o&&t(2,i=o.value)},s.$$.update=()=>{s.$$.dirty&4&&t(0,n=i.replace(/[\n\t\r]/g,o=>r[o]))},[n,l,i]}class gy extends _e{constructor(e){super(),ke(this,e,my,py,be,{value:2})}}function by(s){let e,t="ƒ";return{c(){e=x("span"),e.textContent=t,this.h()},l(n){e=A(n,"SPAN",{class:!0,"data-svelte-h":!0}),Te(e)!=="svelte-migemc"&&(e.textContent=t),this.h()},h(){k(e,"class","i svelte-1eamqdt")},m(n,i){S(n,e,i)},p:de,d(n){n&&_(e)}}}function hf(s){let e,t=ff(s[2])+"",n;return{c(){e=x("span"),n=I(t),this.h()},l(i){e=A(i,"SPAN",{class:!0});var r=P(e);n=z(r,t),r.forEach(_),this.h()},h(){k(e,"class","fn i svelte-1eamqdt")},m(i,r){S(i,e,r),y(e,n)},p(i,r){r&4&&t!==(t=ff(i[2])+"")&&re(n,t)},d(i){i&&_(e)}}}function cf(s){let e,t=uf(s[2])+"",n;return{c(){e=x("span"),n=I(t),this.h()},l(i){e=A(i,"SPAN",{class:!0});var r=P(e);n=z(r,t),r.forEach(_),this.h()},h(){k(e,"class","i svelte-1eamqdt")},m(i,r){S(i,e,r),y(e,n)},p(i,r){r&4&&t!==(t=uf(i[2])+"")&&re(n,t)},d(i){i&&_(e)}}}function _y(s){let e,t,n=!s[2].isArrow&&hf(s),i=!s[2].isClass&&cf(s);return{c(){n&&n.c(),e=ce(),i&&i.c(),t=ce()},l(r){n&&n.l(r),e=ce(),i&&i.l(r),t=ce()},m(r,l){n&&n.m(r,l),S(r,e,l),i&&i.m(r,l),S(r,t,l)},p(r,l){r[2].isArrow?n&&(n.d(1),n=null):n?n.p(r,l):(n=hf(r),n.c(),n.m(e.parentNode,e)),r[2].isClass?i&&(i.d(1),i=null):i?i.p(r,l):(i=cf(r),i.c(),i.m(t.parentNode,t))},d(r){r&&(_(e),_(t)),n&&n.d(r),i&&i.d(r)}}}function ky(s){let e,t=s[6]+"",n,i;return{c(){e=x("span"),n=I(t),this.h()},l(r){e=A(r,"SPAN",{class:!0});var l=P(e);n=z(l,t),l.forEach(_),this.h()},h(){k(e,"class",i=s[6]===ys||s[6]===Tr?"internal":"property")},m(r,l){S(r,e,l),y(e,n)},p(r,l){l&64&&t!==(t=r[6]+"")&&re(n,t),l&64&&i!==(i=r[6]===ys||r[6]===Tr?"internal":"property")&&k(e,"class",i)},d(r){r&&_(e)}}}function vy(s){let e,t;return e=new Fe({props:{value:s[3](s[6])}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&64&&(r.value=n[3](n[6])),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function yy(s){let e,t;return e=new To({props:{value:s[3](s[6])}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&64&&(r.value=n[3](n[6])),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function wy(s){let e,t;return{c(){e=x("span"),t=I(s[0]),this.h()},l(n){e=A(n,"SPAN",{class:!0});var i=P(e);t=z(i,s[0]),i.forEach(_),this.h()},h(){k(e,"class","i svelte-1eamqdt")},m(n,i){S(n,e,i),y(e,t)},p(n,i){i&1&&re(t,n[0])},i:de,o:de,d(n){n&&_(e)}}}function Sy(s){let e,t,n,i;const r=[wy,yy,vy],l=[];function o(a,h){return a[6]===ys?0:a[6]==="prototype"?1:2}return e=o(s),t=l[e]=r[e](s),{c(){t.c(),n=ce()},l(a){t.l(a),n=ce()},m(a,h){l[e].m(a,h),S(a,n,h),i=!0},p(a,h){let c=e;e=o(a),e===c?l[e].p(a,h):(Se(),T(l[c],1,1,()=>{l[c]=null}),xe(),t=l[e],t?t.p(a,h):(t=l[e]=r[e](a),t.c()),w(t,1),t.m(n.parentNode,n))},i(a){i||(w(t),i=!0)},o(a){T(t),i=!1},d(a){a&&_(n),l[e].d(a)}}}function xy(s){let e,t;return e=new jt({props:{keys:s[1],$$slots:{item_value:[Sy,({key:n})=>({6:n}),({key:n})=>n?64:0],item_key:[ky,({key:n})=>({6:n}),({key:n})=>n?64:0],preview:[_y],summary:[by]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,[i]){const r={};i&2&&(r.keys=n[1]),i&197&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}const ys="[[Function]]",Tr="[[Prototype]]";function Ay(s){const e=s.match(/^(?:(async)\s+)?(?:function)?(\*)?\s*([^(]+)?(\([^)]*\))\s*(=>)?/),t=e==null?void 0:e[1],n=e==null?void 0:e[2],i=e==null?void 0:e[3],r=e==null?void 0:e[4],l=e==null?void 0:e[5],o=s.match(/^class\s+([^\s]+)/),a=o==null?void 0:o[1];return{args:r,isAsync:t,isGenerator:n,fnName:i,isArrow:l,isClass:a}}function ff({isGenerator:s,isAsync:e,isClass:t}){return t?`class ${t}`:(e?"async ":"")+"ƒ"+(s?"*":"")}function uf({isAsync:s,isArrow:e,fnName:t,args:n}){return(e&&s?"async":"")+" "+(t??"")+n+(e?" => …":"")}function Cy(s){try{return s.toString()}catch{switch(s.constructor.name){case"AsyncFunction":return"async function () {}";case"AsyncGeneratorFunction":return"async function * () {}";case"GeneratorFunction:":return"function * () {}";default:return"function () {}"}}}function My(s,e,t){let n,i,r,{value:l}=e;function o(h){return h===Tr?l.__proto__:l[h]}function a(h){return h===ys?!0:o(h)}return s.$$set=h=>{"value"in h&&t(4,l=h.value)},s.$$.update=()=>{s.$$.dirty&16&&t(0,n=Cy(l)),s.$$.dirty&1&&t(2,i=Ay(n))},t(1,r=["length","name","prototype",ys,Tr].filter(a)),[n,r,i,o,l]}class Ty extends _e{constructor(e){super(),ke(this,e,My,xy,be,{value:4})}}function Ey(s){let e,t=s[3]?"writable(":"readable(",n,i,r=")",l,o;return i=new Fe({props:{value:s[2]}}),{c(){e=x("span"),n=I(t),U(i.$$.fragment),l=I(r),this.h()},l(a){e=A(a,"SPAN",{class:!0});var h=P(e);n=z(h,t),G(i.$$.fragment,h),l=z(h,r),h.forEach(_),this.h()},h(){k(e,"class","label")},m(a,h){S(a,e,h),y(e,n),K(i,e,null),y(e,l),o=!0},p(a,h){(!o||h&8)&&t!==(t=a[3]?"writable(":"readable(")&&re(n,t);const c={};h&4&&(c.value=a[2]),i.$set(c)},i(a){o||(w(i.$$.fragment,a),o=!0)},o(a){T(i.$$.fragment,a),o=!1},d(a){a&&_(e),J(i)}}}function Oy(s){let e,t=s[10]+"",n,i,r=": ",l,o,a;return o=new Fe({props:{value:s[0][s[10]]}}),{c(){e=x("span"),n=I(t),i=x("span"),l=I(r),U(o.$$.fragment),this.h()},l(h){e=A(h,"SPAN",{class:!0});var c=P(e);n=z(c,t),c.forEach(_),i=A(h,"SPAN",{class:!0});var f=P(i);l=z(f,r),f.forEach(_),G(o.$$.fragment,h),this.h()},h(){k(e,"class","property"),k(i,"class","operator")},m(h,c){S(h,e,c),y(e,n),S(h,i,c),y(i,l),K(o,h,c),a=!0},p(h,c){(!a||c&1024)&&t!==(t=h[10]+"")&&re(n,t);const f={};c&1025&&(f.value=h[0][h[10]]),o.$set(f)},i(h){a||(w(o.$$.fragment,h),a=!0)},o(h){T(o.$$.fragment,h),a=!1},d(h){h&&(_(e),_(i)),J(o,h)}}}function Dy(s){let e,t;return e=new $i({props:{list:s[4],hasMore:s[4].length({10:n}),({item:n})=>n?1024:0]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&16&&(r.list=n[4]),i&18&&(r.hasMore=n[4].length({8:n}),({key:n})=>n?256:0],item_key:[Py,({key:n})=>({8:n}),({key:n})=>n?256:0],preview:[Dy,({root:n})=>({9:n}),({root:n})=>n?512:0],summary:[Ey]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,[i]){const r={};i&32&&(r.keys=n[5]),i&2847&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}const Er="$value";function Ly(s,e,t){let n,i,r,l,o,a,h=de,c=()=>(h(),h=Gf(f,d=>t(7,a=d)),f);s.$$.on_destroy.push(()=>h());let{value:f}=e;c();function u(d){return d===Er?l:f[d]}return s.$$set=d=>{"value"in d&&c(t(0,f=d.value))},s.$$.update=()=>{s.$$.dirty&1&&t(1,n=Object.getOwnPropertyNames(f)),s.$$.dirty&2&&t(5,i=[Er,...n]),s.$$.dirty&2&&t(4,r=n.slice(0,5)),s.$$.dirty&128&&t(2,l=a),s.$$.dirty&1&&t(3,o=typeof f.set=="function")},[f,n,l,o,r,i,u,a]}class $y extends _e{constructor(e){super(),ke(this,e,Ly,By,be,{value:0})}}function Ry(s){let e,t,n,i=s[0].length+"",r,l;return{c(){e=x("span"),t=I(s[1]),n=I("("),r=I(i),l=I(")"),this.h()},l(o){e=A(o,"SPAN",{class:!0});var a=P(e);t=z(a,s[1]),n=z(a,"("),r=z(a,i),l=z(a,")"),a.forEach(_),this.h()},h(){k(e,"class","label")},m(o,a){S(o,e,a),y(e,t),y(e,n),y(e,r),y(e,l)},p(o,a){a&2&&re(t,o[1]),a&1&&i!==(i=o[0].length+"")&&re(r,i)},d(o){o&&_(e)}}}function Iy(s){let e,t;return e=new Fe({props:{value:s[8]}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&256&&(r.value=n[8]),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function zy(s){let e,t;return e=new $i({props:{list:s[2],hasMore:s[2].length({8:n}),({item:n})=>n?256:0]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&4&&(r.list=n[2]),i&5&&(r.hasMore=n[2].length({6:n}),({key:n})=>n?64:0],item_key:[jy,({key:n})=>({6:n}),({key:n})=>n?64:0],preview:[zy,({root:n})=>({7:n}),({root:n})=>n?128:0],summary:[Ry]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,[i]){const r={};i&8&&(r.keys=n[3]),i&711&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}const df="Symbol(Symbol.toStringTag)";function Fy(s,e,t){let n,i,{value:r}=e,{nodeType:l}=e;const o=["buffer","byteLength","byteOffset","length",df];function a(h){return h===df?r[Symbol.toStringTag]:r[h]}return s.$$set=h=>{"value"in h&&t(0,r=h.value),"nodeType"in h&&t(1,l=h.nodeType)},s.$$.update=()=>{s.$$.dirty&1&&t(3,n=[...Object.getOwnPropertyNames(r),...o]),s.$$.dirty&1&&t(2,i=r.slice(0,5))},[r,l,i,n,o,a]}class Wy extends _e{constructor(e){super(),ke(this,e,Fy,Hy,be,{value:0,nodeType:1})}}function qy(s){let e,t;return{c(){e=x("span"),t=I(s[1]),this.h()},l(n){e=A(n,"SPAN",{class:!0});var i=P(e);t=z(i,s[1]),i.forEach(_),this.h()},h(){k(e,"class","regex svelte-17k1wqt")},m(n,i){S(n,e,i),y(e,t)},p(n,i){i&2&&re(t,n[1])},d(n){n&&_(e)}}}function Uy(s){let e,t;return{c(){e=x("span"),t=I(s[1]),this.h()},l(n){e=A(n,"SPAN",{class:!0});var i=P(e);t=z(i,s[1]),i.forEach(_),this.h()},h(){k(e,"class","regex svelte-17k1wqt")},m(n,i){S(n,e,i),y(e,t)},p(n,i){i&2&&re(t,n[1])},d(n){n&&_(e)}}}function Ky(s){let e,t=String(s[3])+"",n;return{c(){e=x("span"),n=I(t),this.h()},l(i){e=A(i,"SPAN",{class:!0});var r=P(e);n=z(r,t),r.forEach(_),this.h()},h(){k(e,"class","internal")},m(i,r){S(i,e,r),y(e,n)},p(i,r){r&8&&t!==(t=String(i[3])+"")&&re(n,t)},d(i){i&&_(e)}}}function Jy(s){let e,t;return e=new Fe({props:{value:s[0][s[3]]}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&9&&(r.value=n[0][n[3]]),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function Gy(s){let e,t;return e=new jt({props:{keys:s[2],$$slots:{item_value:[Jy,({key:n})=>({3:n}),({key:n})=>n?8:0],item_key:[Ky,({key:n})=>({3:n}),({key:n})=>n?8:0],preview:[Uy],summary:[qy]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,[i]){const r={};i&27&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function Yy(s,e,t){let n,{value:i}=e;const r=["lastIndex","dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"];return s.$$set=l=>{"value"in l&&t(0,i=l.value)},s.$$.update=()=>{s.$$.dirty&1&&t(1,n=i.toString())},[i,n,r]}class Xy extends _e{constructor(e){super(),ke(this,e,Yy,Gy,be,{value:0})}}function Zy(s){let e,t,n;const i=[{value:s[0]},s[1]];var r=s[2];function l(o,a){let h={};if(a!==void 0&&a&3)h=ya(i,[a&1&&{value:o[0]},a&2&&wa(o[1])]);else for(let c=0;c{J(h,1)}),xe()}r?(e=ga(r,l(o,a)),U(e.$$.fragment),w(e.$$.fragment,1),K(e,t.parentNode,t)):e=null}else if(r){const h=a&3?ya(i,[a&1&&{value:o[0]},a&2&&wa(o[1])]):{};e.$set(h)}},i(o){n||(e&&w(e.$$.fragment,o),n=!0)},o(o){e&&T(e.$$.fragment,o),n=!1},d(o){o&&_(t),e&&J(e,o)}}}function Qy(s,e,t){let n,i,r,{value:l}=e;const o=ot();Me(s,o,c=>t(4,r=c));const{shouldTreatIterableAsObject:a}=bn();function h(c,f){switch(c){case"Object":return typeof f.subscribe=="function"?[$y]:[To];case"Error":return[cy];case"Array":return[yv];case"Map":return[Jv];case"Iterable":case"Set":return[Nv,{nodeType:c}];case"Number":return[$n,{nodeType:c}];case"String":return[gy];case"Boolean":return[$n,{nodeType:c,value:f?"true":"false"}];case"Date":return[$n,{nodeType:c,value:f.toISOString()}];case"Null":return[$n,{nodeType:c,value:"null"}];case"Undefined":return[$n,{nodeType:c,value:"undefined"}];case"Function":case"AsyncFunction":case"AsyncGeneratorFunction":case"GeneratorFunction":return[Ty];case"Symbol":return[$n,{nodeType:c,value:f.toString()}];case"BigInt":return[$n,{nodeType:c,value:String(f)+"n"}];case"ArrayBuffer":return[$n,{nodeType:c,value:`ArrayBuffer(${f.byteLength})`}];case"BigInt64Array":case"BigUint64Array":case"Float32Array":case"Float64Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint8ClampedArray":case"Uint16Array":case"Uint32Array":return[Wy,{nodeType:c}];case"RegExp":return[Xy];default:return[To,{summary:c}]}}return s.$$set=c=>{"value"in c&&t(0,l=c.value)},s.$$.update=()=>{s.$$.dirty&1&&Ve(o,r=fy(l,a),r),s.$$.dirty&17&&t(2,[n,i]=h(r,l),n,(t(1,i),t(4,r),t(0,l)))},[l,i,n,o,r]}class Fe extends _e{constructor(e){super(),ke(this,e,Qy,Zy,be,{value:0})}}function ew({defaultExpandedPaths:s,defaultExpandedLevel:e}){const t=s.map(i=>i.split("."));function n(i){e:for(const r of t){if(i.length>r.length)continue;const l=Math.min(i.length,r.length);for(let o=0;on(c),level:0,keyPath:[],showPreview:r,shouldTreatIterableAsObject:l}),s.$$set=c=>{"value"in c&&t(0,i=c.value),"shouldShowPreview"in c&&t(2,r=c.shouldShowPreview),"shouldTreatIterableAsObject"in c&&t(3,l=c.shouldTreatIterableAsObject),"defaultExpandedPaths"in c&&t(4,o=c.defaultExpandedPaths),"defaultExpandedLevel"in c&&t(5,a=c.defaultExpandedLevel)},s.$$.update=()=>{s.$$.dirty&48&&(n=ew({defaultExpandedPaths:o,defaultExpandedLevel:a}))},[i,h,r,l,o,a]}class Ur extends _e{constructor(e){super(),ke(this,e,iw,nw,be,{value:0,shouldShowPreview:2,shouldTreatIterableAsObject:3,defaultExpandedPaths:4,defaultExpandedLevel:5})}}function pf(s,e,t){const n=s.slice();return n[5]=e[t],n}function mf(s,e,t){const n=s.slice();return n[8]=e[t],n}function gf(s,e,t){const n=s.slice();return n[8]=e[t],n}function bf(s){let e,t=s[8]+"",n;return{c(){e=x("th"),n=I(t),this.h()},l(i){e=A(i,"TH",{class:!0});var r=P(e);n=z(r,t),r.forEach(_),this.h()},h(){k(e,"class","svelte-18024gr")},m(i,r){S(i,e,r),y(e,n)},p(i,r){r&4&&t!==(t=i[8]+"")&&re(n,t)},d(i){i&&_(e)}}}function sw(s){let e;return{c(){e=x("td"),this.h()},l(t){e=A(t,"TD",{class:!0}),P(e).forEach(_),this.h()},h(){k(e,"class","svelte-18024gr")},m(t,n){S(t,e,n)},p:de,i:de,o:de,d(t){t&&_(e)}}}function rw(s){let e,t,n;return t=new Ur({props:{value:s[0][s[5]][s[8]]}}),{c(){e=x("td"),U(t.$$.fragment),this.h()},l(i){e=A(i,"TD",{class:!0});var r=P(e);G(t.$$.fragment,r),r.forEach(_),this.h()},h(){k(e,"class","svelte-18024gr")},m(i,r){S(i,e,r),K(t,e,null),n=!0},p(i,r){const l={};r&7&&(l.value=i[0][i[5]][i[8]]),t.$set(l)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){T(t.$$.fragment,i),n=!1},d(i){i&&_(e),J(t)}}}function lw(s){let e,t,n;return t=new Ur({props:{value:s[0][s[5]]}}),{c(){e=x("td"),U(t.$$.fragment),this.h()},l(i){e=A(i,"TD",{class:!0});var r=P(e);G(t.$$.fragment,r),r.forEach(_),this.h()},h(){k(e,"class","svelte-18024gr")},m(i,r){S(i,e,r),K(t,e,null),n=!0},p(i,r){const l={};r&3&&(l.value=i[0][i[5]]),t.$set(l)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){T(t.$$.fragment,i),n=!1},d(i){i&&_(e),J(t)}}}function ow(s){let e,t=s[5]+"",n;return{c(){e=x("td"),n=I(t),this.h()},l(i){e=A(i,"TD",{class:!0});var r=P(e);n=z(r,t),r.forEach(_),this.h()},h(){k(e,"class","svelte-18024gr")},m(i,r){S(i,e,r),y(e,n)},p(i,r){r&2&&t!==(t=i[5]+"")&&re(n,t)},i:de,o:de,d(i){i&&_(e)}}}function _f(s){let e,t,n,i;const r=[ow,lw,rw,sw],l=[];function o(a,h){return a[8]===Pp?0:a[8]===Np?1:a[8]in a[0][a[5]]?2:3}return e=o(s),t=l[e]=r[e](s),{c(){t.c(),n=ce()},l(a){t.l(a),n=ce()},m(a,h){l[e].m(a,h),S(a,n,h),i=!0},p(a,h){let c=e;e=o(a),e===c?l[e].p(a,h):(Se(),T(l[c],1,1,()=>{l[c]=null}),xe(),t=l[e],t?t.p(a,h):(t=l[e]=r[e](a),t.c()),w(t,1),t.m(n.parentNode,n))},i(a){i||(w(t),i=!0)},o(a){T(t),i=!1},d(a){a&&_(n),l[e].d(a)}}}function kf(s){let e,t,n,i=Oe(s[2]),r=[];for(let o=0;oT(r[o],1,1,()=>{r[o]=null});return{c(){e=x("tr");for(let o=0;oT(f[d],1,1,()=>{f[d]=null});return{c(){e=x("div"),t=x("table"),n=x("thead"),i=x("tr");for(let d=0;dc.add(d)):c.add(Np)}return[...c]}return s.$$set=a=>{"data"in a&&t(0,r=a.data),"columns"in a&&t(3,l=a.columns)},s.$$.update=()=>{s.$$.dirty&1&&t(1,n=Object.keys(r)),s.$$.dirty&11&&t(2,i=l||o(r,n))},[r,n,i,l]}class cw extends _e{constructor(e){super(),ke(this,e,hw,aw,be,{data:0,columns:3})}}function vf(s,e,t){const n=s.slice();return n[3]=e[t],n}function yf(s,e,t){const n=s.slice();return n[6]=e[t],n}function wf(s,e,t){const n=s.slice();return n[9]=e[t],n[11]=t,n}function Sf(s,e,t){const n=s.slice();return n[12]=e[t],n}function xf(s,e,t){const n=s.slice();return n[12]=e[t],n}function Af(s){let e,t;return e=new cw({props:{data:s[0].args[0],columns:s[0].args[1]}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&1&&(r.data=n[0].args[0]),i&1&&(r.columns=n[0].args[1]),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function Cf(s){let e,t=s[0].count+"",n,i;return{c(){e=x("span"),n=I(t),i=I("x"),this.h()},l(r){e=A(r,"SPAN",{class:!0});var l=P(e);n=z(l,t),i=z(l,"x"),l.forEach(_),this.h()},h(){k(e,"class","count svelte-u1yz2a")},m(r,l){S(r,e,l),y(e,n),y(e,i)},p(r,l){l&1&&t!==(t=r[0].count+"")&&re(n,t)},d(r){r&&_(e)}}}function Mf(s){let e,t="▶",n,i;return{c(){e=x("button"),e.textContent=t,this.h()},l(r){e=A(r,"BUTTON",{class:!0,"data-svelte-h":!0}),Te(e)!=="svelte-1q39ddm"&&(e.textContent=t),this.h()},h(){k(e,"class","arrow svelte-u1yz2a"),ie(e,"expand",!s[0].collapsed)},m(r,l){S(r,e,l),n||(i=ue(e,"click",s[2]),n=!0)},p(r,l){l&1&&ie(e,"expand",!r[0].collapsed)},d(r){r&&_(e),n=!1,i()}}}function Tf(s){let e,t="Assertion failed:";return{c(){e=x("span"),e.textContent=t,this.h()},l(n){e=A(n,"SPAN",{class:!0,"data-svelte-h":!0}),Te(e)!=="svelte-1ee0p76"&&(e.textContent=t),this.h()},h(){k(e,"class","assert svelte-u1yz2a")},m(n,i){S(n,e,i)},d(n){n&&_(e)}}}function fw(s){let e,t,n=Oe(s[0].args??[]),i=[];for(let l=0;lT(i[l],1,1,()=>{i[l]=null});return{c(){for(let l=0;lT(i[l],1,1,()=>{i[l]=null});return{c(){for(let l=0;l1&&Cf(s),O=(s[0].level==="trace"||s[0].level==="assert")&&Mf(s),M=s[0].level==="assert"&&Tf();const B=[gw,mw,pw,dw,uw,fw],N=[];function E(D,C){return C&1&&(l=null),D[0].level==="clear"?0:D[0].level==="unclonable"?1:D[0].level==="group"?2:(l==null&&(l=!!D[0].level.startsWith("system")),l?3:D[0].args&&D[0].level==="table"?4:5)}o=E(s,-1),a=N[o]=B[o](s);let V=Oe(new Array(s[1]-1)),$=[];for(let D=0;D{b=null}),xe()),s[0].count&&s[0].count>1?v?v.p(s,C):(v=Cf(s),v.c(),v.m(t,n)):v&&(v.d(1),v=null),s[0].level==="trace"||s[0].level==="assert"?O?O.p(s,C):(O=Mf(s),O.c(),O.m(t,i)):O&&(O.d(1),O=null),s[0].level==="assert"?M||(M=Tf(),M.c(),M.m(t,r)):M&&(M.d(1),M=null);let W=o;if(o=E(s,C),o===W?N[o].p(s,C):(Se(),T(N[W],1,1,()=>{N[W]=null}),xe(),a=N[o],a?a.p(s,C):(a=N[o]=B[o](s),a.c()),w(a,1),a.m(t,h)),C&2){V=Oe(new Array(s[1]-1));let ne;for(ne=0;ne{F=null}),xe()),(s[0].level==="trace"||s[0].level==="assert")&&!s[0].collapsed?R?R.p(s,C):(R=Bf(s),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null)},i(D){p||(w(b),w(a),w(F),p=!0)},o(D){T(b),T(a),T(F),p=!1},d(D){D&&(_(e),_(t),_(f),_(u),_(d)),b&&b.d(D),v&&v.d(),O&&O.d(),M&&M.d(),N[o].d(),_t($,D),F&&F.d(D),R&&R.d(D),m=!1,g()}}}function _w(s,e,t){let{log:n}=e,{level:i=1}=e;function r(){t(0,n.collapsed=!n.collapsed,n)}return s.$$set=l=>{"log"in l&&t(0,n=l.log),"level"in l&&t(1,i=l.level)},[n,i,r]}class Bp extends _e{constructor(e){super(),ke(this,e,_w,bw,be,{log:0,level:1})}}function $f(s,e,t){const n=s.slice();return n[2]=e[t],n}function Rf(s){let e,t;return e=new Bp({props:{log:s[2]}}),{c(){U(e.$$.fragment)},l(n){G(e.$$.fragment,n)},m(n,i){K(e,n,i),t=!0},p(n,i){const r={};i&1&&(r.log=n[2]),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function kw(s){let e,t,n=Oe(s[0]),i=[];for(let l=0;lT(i[l],1,1,()=>{i[l]=null});return{c(){e=x("div");for(let l=0;l{"logs"in r&&t(0,n=r.logs),"theme"in r&&t(1,i=r.theme)},[n,i]}class yw extends _e{constructor(e){super(),ke(this,e,vw,kw,be,{logs:0,theme:1})}}function ww(s,e){if(!s)return;const t=s.split(` +`)[1],n=/:(\d+):(\d+)\)$/.exec(t);if(!n)return null;const i=+n[1],r=+n[2];return Sw({line:i,column:r},e)}function Sw(s,e){const n=qp.decode(e.mappings)[s.line-1];for(let i=0;i + + + + +