squiffy-runtime 7.0.0-beta.7 → 7.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/confirmDialog.d.ts +8 -0
- package/dist/events.d.ts +10 -0
- package/dist/every.d.ts +12 -0
- package/dist/every.test.d.ts +1 -0
- package/dist/playerSettings.d.ts +17 -0
- package/dist/preview-html.js +1 -1
- package/dist/settings.test.d.ts +1 -0
- package/dist/settingsDialog.d.ts +17 -0
- package/dist/squiffy.page.css +4 -1
- package/dist/squiffy.preview.html +673 -83
- package/dist/squiffy.runtime.css +531 -1
- package/dist/squiffy.runtime.d.ts +5 -1
- package/dist/squiffy.runtime.global.js +106 -85
- package/dist/squiffy.runtime.global.js.map +1 -1
- package/dist/squiffy.runtime.js +4743 -4157
- package/dist/squiffy.runtime.js.map +1 -1
- package/dist/state.d.ts +1 -0
- package/dist/style.test.d.ts +1 -0
- package/dist/textProcessor.d.ts +8 -0
- package/dist/transitions.test.d.ts +1 -0
- package/dist/types.d.ts +43 -0
- package/dist/uiLinks.test.d.ts +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.test.d.ts +1 -0
- package/package.json +3 -3
- package/src/animation.test.ts +44 -0
- package/src/animation.ts +7 -3
- package/src/confirmDialog.ts +66 -0
- package/src/events.ts +17 -0
- package/src/every.test.ts +25 -0
- package/src/every.ts +94 -0
- package/src/panels.test.ts +24 -0
- package/src/playerSettings.ts +128 -0
- package/src/plugins/animate.ts +9 -0
- package/src/plugins/live.ts +3 -1
- package/src/plugins/plugins.test.ts +17 -0
- package/src/preview.test.ts +53 -3
- package/src/preview.ts +60 -1
- package/src/settings.test.ts +233 -0
- package/src/settingsDialog.ts +160 -0
- package/src/squiffy.page.css +4 -1
- package/src/squiffy.runtime.css +531 -1
- package/src/squiffy.runtime.test.ts +613 -16
- package/src/squiffy.runtime.ts +372 -19
- package/src/state.ts +16 -1
- package/src/style.test.ts +89 -0
- package/src/textProcessor.ts +141 -6
- package/src/transitions.test.ts +302 -0
- package/src/types.ts +56 -0
- package/src/uiLinks.test.ts +156 -0
- package/src/utils.test.ts +60 -0
- package/src/utils.ts +44 -14
- package/dist/infixExpressions.d.ts +0 -7
- package/src/infixExpressions.test.ts +0 -516
- package/src/infixExpressions.ts +0 -672
- /package/dist/{infixExpressions.test.d.ts → animation.test.d.ts} +0 -0
package/dist/preview-html.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// The Squiffy preview page, built from squiffy-runtime's src/preview.main.ts
|
|
2
|
-
export const previewHtml = "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>Squiffy preview</title>\n<style>\n/* Core Squiffy Runtime Styles. See https://squiffystory.com/styling/ for how to customise these. */\n\n/* Colours. Each has a light and a dark value, and light-dark() picks one from the page's\n color-scheme. This file doesn't set color-scheme itself, so a story embedded in a page stays\n light unless the page opts in to dark mode. The exported story's page (squiffy.page.css) sets\n \"color-scheme: light dark\", so it follows the reader's system setting. */\n:root\n{\n --squiffy-text: light-dark(#1f2328, #e4e4e7);\n --squiffy-background: light-dark(#ffffff, #18181b);\n /* Secondary text: the header buttons, and links waiting for valid input */\n --squiffy-muted: light-dark(#6b6f76, #9a9ca3);\n /* The lines between sections */\n --squiffy-border: light-dark(#e2e2e6, #34343a);\n --squiffy-link: light-dark(#1d5fd6, #7aa7ff);\n --squiffy-link-hover: light-dark(#0f3f99, #b0cbff);\n --squiffy-error: light-dark(#c62828, #ff7b72);\n --squiffy-success: light-dark(#2e7d32, #6cc070);\n}\n\n/* Link styles */\na.squiffy-link\n{\n color: var(--squiffy-link);\n text-decoration: underline;\n text-decoration-color: currentColor;\n text-decoration-thickness: from-font;\n text-underline-offset: 0.15em;\n cursor: pointer;\n transition: color 0.4s ease-in-out, text-decoration-color 0.4s ease-in-out;\n}\n\na.squiffy-link:hover\n{\n color: var(--squiffy-link-hover);\n}\n\na.squiffy-link:focus-visible,\nbutton.squiffy-header-button:focus-visible,\n.squiffy-continue:focus-visible\n{\n outline: 2px solid var(--squiffy-link);\n outline-offset: 2px;\n border-radius: 2px;\n}\n\n/* Rotate/sequence links - visually distinct as they update in-place rather than advancing the story */\na.squiffy-link[data-handler=\"rotate\"],\na.squiffy-link[data-handler=\"sequence\"] {\n text-decoration-style: dotted;\n}\n\n/* Disabled link states */\na.squiffy-link.disabled,\ndiv.squiffy-output-section:not(:last-child) a.squiffy-link,\ndiv.squiffy-output-section.links-disabled a.squiffy-link\n{\n text-decoration: inherit;\n text-decoration-color: transparent;\n color: inherit !important;\n cursor: inherit;\n pointer-events: none;\n}\n\n/* Links disabled due to input validation */\na.squiffy-link.validation-disabled\n{\n text-decoration: inherit;\n text-decoration-color: transparent;\n color: var(--squiffy-muted) !important;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n/* Invalid input field states */\ninput.squiffy-invalid,\ntextarea.squiffy-invalid,\nselect.squiffy-invalid\n{\n border-color: var(--squiffy-error) !important;\n box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--squiffy-error) 25%, transparent);\n}\n\n/* Valid input field states (optional, provides positive feedback) */\ninput:not([disabled]):valid,\ntextarea:not([disabled]):valid,\nselect:not([disabled]):valid\n{\n border-color: var(--squiffy-success);\n}\n\n/* Focus state for invalid inputs */\ninput.squiffy-invalid:focus,\ntextarea.squiffy-invalid:focus,\nselect.squiffy-invalid:focus\n{\n outline: none;\n border-color: var(--squiffy-error) !important;\n box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--squiffy-error) 50%, transparent);\n}\n\n/* Header button styles: the Back, Restart and light/dark buttons, which are icons */\nbutton.squiffy-header-button\n{\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--squiffy-muted);\n cursor: pointer;\n background: none;\n border: none;\n border-radius: 0.375em;\n padding: 0.375em;\n font: inherit;\n vertical-align: middle;\n transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;\n}\n\nbutton.squiffy-header-button:hover:not(:disabled)\n{\n color: var(--squiffy-text);\n background-color: color-mix(in srgb, currentColor 10%, transparent);\n}\n\nbutton.squiffy-header-button svg\n{\n width: 1.25em;\n height: 1.25em;\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n/* The light/dark button, when the story's CSS fixes the theme */\nbutton.squiffy-header-button[hidden]\n{\n display: none;\n}\n\n/* The Back button, when there's nothing to go back to */\nbutton.squiffy-header-button:disabled\n{\n cursor: default;\n opacity: 0.5;\n}\n\n/* Output block spacing */\ndiv.squiffy-output-block:not(:last-child),\ndiv.squiffy-output-passage:not(:last-child),\ndiv.squiffy-output-section:not(:last-child)\n{\n margin-bottom: 1em;\n border-bottom: 1px solid var(--squiffy-border);\n}\n\n/* ...but a block, passage or section that output no text (such as a passage that only does\n {{replace}}) gets no line, and nor does one followed only by those, so they don't add extra lines */\ndiv.squiffy-output-block:not(:has(> div:not(:empty))),\ndiv.squiffy-output-block:not(:has(~ div.squiffy-output-block > div:not(:empty), ~ div.squiffy-output-passage > div.squiffy-output-block > div:not(:empty))),\ndiv.squiffy-output-passage:not(:has(> div.squiffy-output-block > div:not(:empty))),\ndiv.squiffy-output-passage:not(:has(~ div.squiffy-output-block > div:not(:empty), ~ div.squiffy-output-passage > div.squiffy-output-block > div:not(:empty))),\ndiv.squiffy-output-section:not(:has(div.squiffy-output-block > div:not(:empty))),\ndiv.squiffy-output-section:not(:has(~ div.squiffy-output-section div.squiffy-output-block > div:not(:empty)))\n{\n margin-bottom: 0;\n border-bottom: none;\n}\n\n/* Fade animations */\n.fade-out {\n opacity: 0;\n transition: opacity 200ms;\n}\n\n.fade-in {\n opacity: 1;\n transition: opacity 200ms;\n}\n\n/* Continue animation - click to proceed */\n.squiffy-continue {\n color: var(--squiffy-link);\n text-decoration: underline;\n text-decoration-color: currentColor;\n text-decoration-thickness: from-font;\n text-underline-offset: 0.15em;\n cursor: pointer;\n}\n\n/* Style: pulse - fades in and out */\n.squiffy-continue-pulse {\n animation: squiffy-pulse 1.5s ease-in-out infinite;\n}\n\n@keyframes squiffy-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.4; }\n}\n\n/* Style: glow - pulsing glow effect */\n.squiffy-continue-glow {\n animation: squiffy-glow 1.5s ease-in-out infinite;\n}\n\n@keyframes squiffy-glow {\n 0%, 100% { text-shadow: 0 0 4px color-mix(in srgb, currentColor 50%, transparent); }\n 50% { text-shadow: 0 0 12px color-mix(in srgb, currentColor 80%, transparent), 0 0 20px color-mix(in srgb, currentColor 40%, transparent); }\n}\n\n/* Style: bounce - subtle vertical bounce */\n.squiffy-continue-bounce {\n display: inline-block;\n animation: squiffy-bounce 0.6s ease-in-out infinite;\n}\n\n@keyframes squiffy-bounce {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-4px); }\n}\n\n/* Style: wave - character spans need special handling for underline */\n.squiffy-continue-wave {\n text-decoration: none;\n border-bottom: 1px solid currentColor;\n}\n\n/* Respect the reader's reduced-motion setting */\n@media (prefers-reduced-motion: reduce)\n{\n .squiffy-continue-pulse,\n .squiffy-continue-glow,\n .squiffy-continue-bounce\n {\n animation: none;\n }\n}\n\n/* The Saved games dialog, opened by the page's Save button */\ndialog.squiffy-saves\n{\n width: min(28rem, calc(100vw - 2rem));\n max-height: calc(100vh - 2rem);\n box-sizing: border-box;\n padding: 1rem 1.25rem 1.25rem;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.75rem;\n background-color: var(--squiffy-background);\n color: var(--squiffy-text);\n font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n font-size: 0.9375rem;\n line-height: 1.4;\n box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);\n}\n\ndialog.squiffy-saves::backdrop\n{\n background-color: rgb(0 0 0 / 0.4);\n}\n\ndialog.squiffy-saves svg\n{\n width: 1.25em;\n height: 1.25em;\n flex: none;\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.squiffy-saves-header\n{\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.75rem;\n}\n\n.squiffy-saves-header h2\n{\n margin: 0;\n font-size: 1.125rem;\n}\n\n.squiffy-saves button\n{\n font: inherit;\n color: inherit;\n cursor: pointer;\n}\n\n.squiffy-saves button:focus-visible,\n.squiffy-saves input:focus-visible\n{\n outline: 2px solid var(--squiffy-link);\n outline-offset: 2px;\n}\n\n.squiffy-saves-button\n{\n flex: none;\n padding: 0.3em 0.8em;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.375em;\n background: none;\n}\n\n.squiffy-saves-button:hover\n{\n background-color: color-mix(in srgb, currentColor 8%, transparent);\n}\n\n.squiffy-saves .squiffy-saves-primary\n{\n border-color: var(--squiffy-link);\n background-color: var(--squiffy-link);\n color: var(--squiffy-background);\n}\n\n.squiffy-saves .squiffy-saves-danger-button\n{\n border-color: var(--squiffy-error);\n background-color: var(--squiffy-error);\n color: var(--squiffy-background);\n}\n\n.squiffy-saves-icon-button\n{\n display: inline-flex;\n padding: 0.3em;\n border: none;\n border-radius: 0.375em;\n background: none;\n color: var(--squiffy-muted) !important;\n}\n\n.squiffy-saves-icon-button:hover,\n.squiffy-saves-icon-button[aria-expanded=\"true\"]\n{\n color: var(--squiffy-text) !important;\n background-color: color-mix(in srgb, currentColor 10%, transparent);\n}\n\n.squiffy-saves-error\n{\n margin: 0 0 0.75rem;\n color: var(--squiffy-error);\n}\n\n.squiffy-saves-new\n{\n display: flex;\n gap: 0.5rem;\n}\n\n.squiffy-saves input[type=\"text\"]\n{\n flex: 1;\n min-width: 0;\n padding: 0.3em 0.6em;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.375em;\n background-color: var(--squiffy-background);\n color: inherit;\n font: inherit;\n}\n\n.squiffy-saves-list\n{\n list-style: none;\n margin: 0.75rem 0 0;\n padding: 0;\n max-height: 50vh;\n overflow-y: auto;\n}\n\n.squiffy-saves-empty\n{\n padding: 0.75rem 0;\n color: var(--squiffy-muted);\n}\n\n.squiffy-saves-row\n{\n padding: 0.5rem 0;\n border-top: 1px solid var(--squiffy-border);\n}\n\n.squiffy-saves-line\n{\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.squiffy-saves-info\n{\n flex: 1;\n min-width: 0;\n}\n\n.squiffy-saves-title\n{\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.squiffy-saves-meta\n{\n color: var(--squiffy-muted);\n font-size: 0.8125rem;\n}\n\n.squiffy-saves-options\n{\n position: relative;\n}\n\n.squiffy-saves-menu\n{\n position: absolute;\n right: 0;\n top: 100%;\n z-index: 1;\n display: flex;\n flex-direction: column;\n min-width: 10rem;\n margin-top: 0.25rem;\n padding: 0.25rem;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.5rem;\n background-color: var(--squiffy-background);\n box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.2);\n}\n\n.squiffy-saves-menu[hidden]\n{\n display: none;\n}\n\n/* In the top layer, placed by the script */\n.squiffy-saves-menu:popover-open\n{\n position: fixed;\n right: auto;\n bottom: auto;\n margin: 0;\n color: inherit;\n}\n\n.squiffy-saves-menu button\n{\n padding: 0.4em 0.75em;\n border: none;\n border-radius: 0.25em;\n background: none;\n text-align: left;\n}\n\n.squiffy-saves-menu button:hover,\n.squiffy-saves-menu button:focus-visible\n{\n background-color: color-mix(in srgb, currentColor 10%, transparent);\n}\n\n.squiffy-saves .squiffy-saves-danger\n{\n color: var(--squiffy-error);\n}\n\n.squiffy-saves-confirm\n{\n margin-top: 0.5rem;\n padding: 0.75rem;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.5rem;\n background-color: color-mix(in srgb, var(--squiffy-text) 5%, transparent);\n}\n\n.squiffy-saves-confirm p\n{\n margin: 0 0 0.5rem;\n}\n\n.squiffy-saves-confirm-buttons\n{\n display: flex;\n justify-content: flex-end;\n gap: 0.5rem;\n}\n\n.squiffy-saves-footer\n{\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem 1.25rem;\n margin-top: 0.75rem;\n padding-top: 0.75rem;\n border-top: 1px solid var(--squiffy-border);\n}\n\n.squiffy-saves-link\n{\n display: inline-flex;\n align-items: center;\n gap: 0.375em;\n padding: 0;\n border: none;\n background: none;\n color: var(--squiffy-link) !important;\n}\n\n.squiffy-saves-link:hover\n{\n text-decoration: underline;\n}\n\n/* Panels (squiffy.json's \"panels\"): passages always to hand, beside the story or in a dialog */\n:root\n{\n /* The width of a side panel */\n --squiffy-side-width: 16rem;\n}\n\n/* A panel's button in the header, when it has a label rather than an icon */\nbutton.squiffy-panel-text-button\n{\n padding: 0.375em 0.625em;\n line-height: 1.25;\n}\n\n/* Space between the panels' buttons and the page's own */\nbutton.squiffy-panel-button:not(:has(+ button.squiffy-panel-button))\n{\n margin-right: 0.5em;\n}\n\n/* The side panels. Like the header, they're smaller than the story text. */\naside.squiffy-panels-side\n{\n font-size: 0.9375rem;\n line-height: 1.5;\n}\n\naside.squiffy-panels-side[hidden],\naside.squiffy-panels-side > section.squiffy-panel[hidden]\n{\n display: none;\n}\n\naside.squiffy-panels-side > section.squiffy-panel + section.squiffy-panel\n{\n margin-top: 1rem;\n padding-top: 1rem;\n border-top: 1px solid var(--squiffy-border);\n}\n\n.squiffy-panel > :first-child\n{\n margin-top: 0;\n}\n\n.squiffy-panel > :last-child\n{\n margin-bottom: 0;\n}\n\n.squiffy-panel img\n{\n max-width: 100%;\n height: auto;\n}\n\n/* On a screen too narrow for the story and a side panel, the panel is a button in the header,\n which shows it in a dialog */\n@media (min-width: 64rem)\n{\n button.squiffy-panel-side-button\n {\n display: none;\n }\n}\n\n@media (max-width: 63.99rem)\n{\n aside.squiffy-panels-side\n {\n display: none;\n }\n}\n\n/* The dialog a panel's button opens */\ndialog.squiffy-panel-dialog\n{\n width: min(28rem, calc(100vw - 2rem));\n max-height: calc(100vh - 2rem);\n box-sizing: border-box;\n padding: 1rem 1.25rem 1.25rem;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.75rem;\n background-color: var(--squiffy-background);\n color: var(--squiffy-text);\n font-family: var(--squiffy-font-family, inherit);\n font-size: var(--squiffy-font-size, 1rem);\n line-height: var(--squiffy-line-height, 1.5);\n box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);\n}\n\ndialog.squiffy-panel-dialog::backdrop\n{\n background-color: rgb(0 0 0 / 0.4);\n}\n\n.squiffy-panel-dialog-header\n{\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n margin-bottom: 0.75rem;\n font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n}\n\n.squiffy-panel-dialog-header h2\n{\n margin: 0;\n font-size: 1.125rem;\n}\n\nbutton.squiffy-panel-dialog-close\n{\n display: inline-flex;\n padding: 0.25em;\n border: none;\n border-radius: 0.375em;\n background: none;\n color: var(--squiffy-muted);\n cursor: pointer;\n}\n\nbutton.squiffy-panel-dialog-close:hover\n{\n color: var(--squiffy-text);\n background-color: color-mix(in srgb, currentColor 10%, transparent);\n}\n\nbutton.squiffy-panel-dialog-close:focus-visible\n{\n outline: 2px solid var(--squiffy-link);\n outline-offset: 2px;\n}\n\nbutton.squiffy-panel-dialog-close svg\n{\n width: 1.25em;\n height: 1.25em;\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n/* Page layout styles for an exported story. See https://squiffystory.com/styling/ for how to customise these. */\n\n:root\n{\n /* The width of the story text */\n --squiffy-max-width: 42rem;\n /* The story's font. Charter, or Georgia if the reader doesn't have it */\n --squiffy-font-family: Charter, \"Bitstream Charter\", Georgia, serif;\n /* The size of the story text. The header's buttons are smaller, and don't change with it */\n --squiffy-font-size: 1.125rem;\n /* The space between lines of text */\n --squiffy-line-height: 1.6;\n}\n\n/* Follow the reader's light or dark system setting, or what they chose with the theme button.\n To keep a story light (or dark) whatever the setting, set \":root { color-scheme: light; }\"\n (or dark). These rules use :where() so that a :root rule like that overrides them, and the\n theme button is hidden. */\n:where(:root)\n{\n color-scheme: light dark;\n}\n\n:where(:root[data-squiffy-theme=\"light\"])\n{\n color-scheme: light;\n}\n\n:where(:root[data-squiffy-theme=\"dark\"])\n{\n color-scheme: dark;\n}\n\nbody\n{\n margin: 0;\n background-color: var(--squiffy-background);\n color: var(--squiffy-text);\n}\n\n/* Wraps the header and the story: sets the page width and font */\ndiv#squiffy-container\n{\n max-width: var(--squiffy-max-width);\n margin-left: auto;\n margin-right: auto;\n padding: 0 1.25rem 3rem;\n font-family: var(--squiffy-font-family);\n line-height: var(--squiffy-line-height);\n}\n\n/* The bar above the story containing the Back, Restart and light/dark buttons. It stays at the\n top of the window as the story scrolls under it. */\ndiv#squiffy-header\n{\n position: sticky;\n top: 0;\n z-index: 1;\n padding: 0.5rem 0;\n background-color: var(--squiffy-background);\n font-size: 0.875rem;\n text-align: right;\n white-space: nowrap;\n}\n\n/* A short fade under the header, so the story scrolls under it rather than being cut off */\ndiv#squiffy-header::after\n{\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n top: 100%;\n height: 0.75rem;\n background: linear-gradient(var(--squiffy-background), transparent);\n pointer-events: none;\n}\n\n/* Space between the Back, Restart and light/dark buttons */\nbutton.squiffy-header-button + button.squiffy-header-button\n{\n margin-left: 0.25em;\n}\n\n/* The button that switches between light and dark mode. It shows a moon in light mode and a sun\n in dark mode. */\nbutton#squiffy-theme:not([data-next=\"light\"]) .squiffy-icon-light,\nbutton#squiffy-theme[data-next=\"light\"] .squiffy-icon-dark\n{\n display: none;\n}\n\n/* The mute button (#444), for a story with music or sounds. It shows a speaker, crossed out\n when the story is muted. */\nbutton#squiffy-mute.squiffy-muted .squiffy-icon-sound,\nbutton#squiffy-mute:not(.squiffy-muted) .squiffy-icon-muted\n{\n display: none;\n}\n\n/* With a side panel (squiffy.json's \"panels\"), the page is wider, with the panel to the right of\n the story. It stays in view as the story scrolls, under the header. On a narrower screen, it's a\n button in the header instead. */\n@media (min-width: 64rem)\n{\n div#squiffy-container.squiffy-has-side\n {\n display: grid;\n grid-template-columns: minmax(0, 1fr) var(--squiffy-side-width);\n column-gap: 2.5rem;\n align-items: start;\n max-width: calc(var(--squiffy-max-width) + var(--squiffy-side-width) + 2.5rem);\n }\n\n div#squiffy-container.squiffy-has-side > div#squiffy-header\n {\n grid-column: 1 / -1;\n }\n\n div#squiffy-container.squiffy-has-side > aside.squiffy-panels-side\n {\n position: sticky;\n top: 3.5rem;\n padding-left: 1.25rem;\n border-left: 1px solid var(--squiffy-border);\n max-height: calc(100vh - 4.5rem);\n overflow-y: auto;\n }\n}\n\n/* The story text */\ndiv#squiffy\n{\n font-size: var(--squiffy-font-size);\n}\n\ndiv#squiffy :is(h1, h2, h3, h4, h5, h6)\n{\n line-height: 1.25;\n}\n\ndiv#squiffy p\n{\n text-wrap: pretty;\n}\n\n/* Stop images overflowing the page */\ndiv#squiffy img\n{\n max-width: 100%;\n height: auto;\n}\n\n/* The preview scrolls the story within the frame, with the text centred as on the exported page */\nhtml, body { height: 100%; }\ndiv#squiffy-container { max-width: none; height: 100%; padding: 0; }\n#squiffy, .squiffy-preview-story, .squiffy-preview-story > div { height: 100%; box-sizing: border-box; }\n.squiffy-preview-story > div { padding: 1em max(1.25rem, calc((100% - var(--squiffy-max-width)) / 2)); }\n/* The story's panels: their buttons above the story, and side panels to its right */\n#squiffy { display: flex; flex-direction: column; }\n.squiffy-preview-header { flex: none; padding: 0.5rem 0.75rem 0; font-family: system-ui, sans-serif; font-size: 0.875rem; text-align: right; }\n.squiffy-preview-header:empty { display: none; }\n.squiffy-preview-body { flex: 1; min-height: 0; display: flex; }\n#squiffy .squiffy-preview-body > .squiffy-preview-story { flex: 1; min-width: 0; height: 100%; }\n.squiffy-preview-body > aside.squiffy-panels-side { flex: none; width: var(--squiffy-side-width); box-sizing: border-box; overflow-y: auto; padding: 1em 1.25rem 1em 0; }\n</style>\n</head>\n<body>\n<div id=\"squiffy-container\"><div id=\"squiffy\"></div></div>\n<script>\n(function(){var Fa=Object.create,hr=Object.defineProperty,Va=Object.getOwnPropertyDescriptor,za=Object.getOwnPropertyNames,Ua=Object.getPrototypeOf,dn=Object.prototype.hasOwnProperty,fe=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),_s=(e,t)=>{let s={};for(var r in e)hr(s,r,{get:e[r],enumerable:!0});return t||hr(s,Symbol.toStringTag,{value:\"Module\"}),s},Wa=(e,t,s,r)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(var i=za(t),n=0,o=i.length,c;n<o;n++)c=i[n],!dn.call(e,c)&&c!==s&&hr(e,c,{get:(d=>t[d]).bind(null,c),enumerable:!(r=Va(t,c))||r.enumerable});return e},Ga=(e,t,s)=>(s=e!=null?Fa(Ua(e)):{},Wa(t||!e||!e.__esModule||!dn.call(e,\"default\")?hr(s,\"default\",{value:e,enumerable:!0}):s,e));function $s(e){\"@babel/helpers - typeof\";return $s=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(t){return typeof t}:function(t){return t&&typeof Symbol==\"function\"&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},$s(e)}function Xa(e,t){if($s(e)!=\"object\"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t||\"default\");if($s(r)!=\"object\")return r;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(t===\"string\"?String:Number)(e)}function ja(e){var t=Xa(e,\"string\");return $s(t)==\"symbol\"?t:t+\"\"}function De(e,t,s){return(t=ja(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function Ya(e,t){if(t.has(e))throw new TypeError(\"Cannot initialize the same private elements twice on an object\")}function Za(e,t){Ya(e,t),t.add(e)}function dr(e,t,s){if(typeof e==\"function\"?e===t:e.has(t))return arguments.length<3?t:s;throw new TypeError(\"Private element is not present on this object\")}var Ss,fr;function ii(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var rs=ii();function fn(e){rs=e}var is={exec:()=>null};function ns(e){let t=[];return s=>{let r=Math.max(0,Math.min(3,s-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function de(e,t=\"\"){let s=typeof e==\"string\"?e:e.source,r={replace:(i,n)=>{let o=typeof n==\"string\"?n:n.source;return o=o.replace(Je.caret,\"$1\"),s=s.replace(i,o),r},getRegex:()=>new RegExp(s,t)};return r}var pn=((e=\"\")=>{try{return!!new RegExp(\"(?<=1)(?<!1)\"+e)}catch{return!1}})(),Je={codeRemoveIndent:/^(?: {0,3}\\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]/,outputLinkReplace:/\\\\([\\[\\]])/g,indentCodeCompensation:/^(\\s+)(?:```)/,beginningSpace:/^\\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \\t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\\n/g,tabCharGlobal:/\\t/g,leadingSpaceTab:/^[ \\t]+/,multipleSpaceGlobal:/\\s+/g,blankLine:/^[ \\t]*$/,doubleBlankLine:/\\n[ \\t]*\\n[ \\t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\\n {0,3}((?:=+|-+)[ \\t]*)(?=\\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \\t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \\t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\\[[ xX]\\][ \\t]+\\S/,listReplaceTask:/^\\[[ xX]\\][ \\t]+/,listTaskCheckbox:/\\[[ xX]\\]/,anyLine:/\\n.*\\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\\||\\| *$/g,tableRowBlankLine:/\\n[ \\t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\\s|>)/i,endPreScriptTag:/^<\\/(pre|code|kbd|script)(\\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/,unicodeAlphaNumeric:/[\\p{L}\\p{N}]/u,numericCharacterReference:/&#(?:(\\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,escapeTest:/[&<>\"']/,escapeReplace:/[&<>\"']/g,escapeTestNoEncode:/[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/,escapeReplaceNoEncode:/[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,caret:/(^|[^\\[])\\^/g,percentDecode:/%25/g,findPipe:/\\|/g,splitPipe:/ \\|/,slashPipe:/\\\\\\|/g,carriageReturn:/\\r\\n|\\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\\S*/,endingNewline:/\\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\\\n]*)?(?:\\\\n|$))`),nextBulletRegex:ns(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \t][^\\\\n]*)?(?:\\\\n|$))`)),hrRegex:ns(e=>new RegExp(`^ {0,${e}}((?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\\\\*[ \t]*){3,})(?:\\\\n+|$)`)),fencesBeginRegex:ns(e=>new RegExp(`^ {0,${e}}(?:\\`\\`\\`|~~~)`)),headingBeginRegex:ns(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\\\s|$)`)),pedanticHeadingBeginRegex:ns(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:ns(e=>new RegExp(`^ {0,${e}}(?:</?(?:${qs})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)`,\"i\")),blockquoteBeginRegex:ns(e=>new RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\\d{1,9}[.)])[ \\t]+|>[ \\t]?))+/},Ja=/^(?:[ \\t]*(?:\\n|$))+/,Ka=/^((?: {4}| {0,3}\\t)[^\\n]+(?:\\n(?:[ \\t]*(?:\\n|$))*)?)+/,Qa=/^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}(?:(?=`)\\1`*|(?=~)\\1~*) *(?=\\n|$)|$)/,Hs=/^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,el=/^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,ni=/ {0,3}(?:[*+-]|\\d{1,9}[.)])/,gn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\\n(?!\\s*?\\n|bull |fences|blockquote|heading|hr|html|table))+?)\\n {0,3}(=+|-+)[ \\t]*(?:\\n+|$)/,mn=de(gn).replace(/bull/g,ni).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/\\|table/g,\"\").getRegex(),tl=de(gn).replace(/bull/g,ni).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/table/g,/ {0,3}\\|?(?:[:\\- ]*\\|)+[\\:\\- ]*\\n/).getRegex(),oi=/^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \\t]+\\n)[^\\n]+)*)/,sl=/^[^\\n]+/,ai=/(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\\\n]|\\n(?![ \\t]*\\n))+/,rl=de(/^ {0,3}\\[(label)\\]: *(?:\\n[ \\t]*)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n[ \\t]*)?| *\\n[ \\t]*)(title))? *(?:\\n+|$)/).replace(\"label\",ai).replace(\"title\",/(?:\"(?:\\\\[\\s\\S]|[^\"\\\\])*\"|'(?:\\\\[\\s\\S]|[^'\\\\\\n]|\\n(?!\\n))*'|\\((?:\\\\[\\s\\S]|[^()\\\\])*\\))/).getRegex(),il=de(/^(bull)([ \\t][^\\n]*?)?(?:\\n|$)/).replace(/bull/g,ni).getRegex(),qs=\"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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul\",li=/<!--(?:-?>|[\\s\\S]*?(?:-->|$))/,nl=de(\"^ {0,3}(?:<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n*|$)|comment[^\\\\n]*(\\\\n+|$)|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>[^\\\\n]*\\\\n*|$)|<![A-Z][\\\\s\\\\S]*?(?:>[^\\\\n]*\\\\n*|$)|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>[^\\\\n]*\\\\n*|$)|</?(tag)(?:[ \\\\t]+|\\\\n|/?>|$)[\\\\s\\\\S]*?(?:(?:\\\\n[ \t]*)+\\\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \t]*)+\\\\n|$)|</[a-z][a-z0-9-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \t]*)+\\\\n|$))\",\"i\").replace(\"comment\",li).replace(\"tag\",qs).replace(\"attribute\",/ +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/).getRegex(),vn=e=>de(oi).replace(\"hr\",Hs).replace(\"heading\",\" {0,3}#{1,6}(?:\\\\s|$)\").replace(\"|lheading\",\"\").replace(\"|table\",\"\").replace(\"blockquote\",\" {0,3}>\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)\").replace(\"list\",e).replace(\"html\",\" {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)\").replace(\"tag\",qs).getRegex(),ol=vn(/ {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]/),al=vn(/ {0,3}(?:[*+-]|\\d{1,9}[.)])(?:[ \\t]|\\n|$)/),ci={blockquote:de(/^( {0,3}> ?(?:(?![ \\t]*(?:\\n|$))(paragraph)|[^\\n]*)(?:\\n|$))+/).replace(\"paragraph\",al).getRegex(),code:Ka,def:rl,fences:Qa,heading:el,hr:Hs,html:nl,lheading:mn,list:il,newline:Ja,paragraph:ol,table:is,text:sl},yn=de(\"^ *([^\\\\n ].*)\\\\n {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)\").replace(\"hr\",Hs).replace(\"heading\",\" {0,3}#{1,6}(?:\\\\s|$)\").replace(\"blockquote\",\" {0,3}>\").replace(\"code\",\"(?: {4}| {0,3}\t)[^\\\\n]\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)])[ \\\\t]\").replace(\"html\",\" {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)\").replace(\"tag\",qs).getRegex(),ll={...ci,lheading:tl,table:yn,paragraph:de(oi).replace(\"hr\",Hs).replace(\"heading\",\" {0,3}#{1,6}(?:\\\\s|$)\").replace(\"|lheading\",\"\").replace(\"table\",yn).replace(\"blockquote\",\" {0,3}>\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)])[ \\\\t]+[^ \\\\t\\\\n]\").replace(\"html\",\" {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)\").replace(\"tag\",qs).getRegex()},cl={...ci,html:de(`^ *(?:comment(?: *\\\\n|\\\\s*$)|<(tag)[\\\\s\\\\S]+?</\\\\1>(?: *\\\\n{2,}|\\\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\\\s[^'\"/>\\\\s]*)*?/?>(?: *\\\\n{2,}|\\\\s*$))`).replace(\"comment\",li).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:/^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,heading:/^(#{1,6})(.*)(?:\\n+|$)/,fences:is,lheading:/^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,paragraph:de(oi).replace(\"hr\",Hs).replace(\"heading\",` *#{1,6} *[^\n]`).replace(\"lheading\",mn).replace(\"|table\",\"\").replace(\"blockquote\",\" {0,3}>\").replace(\"|fences\",\"\").replace(\"|list\",\"\").replace(\"|html\",\"\").replace(\"|tag\",\"\").getRegex()},ul=/^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,hl=/^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,bn=/^( {2,}|\\\\)\\n(?!\\s*$)[ \\t]*/,dl=/^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,Ot=/[\\p{P}\\p{S}]/u,ks=/[\\s\\p{P}\\p{S}]/u,Fs=/[^\\s\\p{P}\\p{S}]/u,fl=de(/^((?![*_])punctSpace)/,\"u\").replace(/punctSpace/g,ks).getRegex(),pl=/[\\p{Pi}\\p{Ps}\"']/u,_n=/(?!~)[\\p{P}\\p{S}]/u,gl=/(?!~)[\\s\\p{P}\\p{S}]/u,ml=/(?:[^\\s\\p{P}\\p{S}]|~)/u,vl=de(/link|precode-code|html/,\"g\").replace(\"link\",/\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)/).replace(\"precode-\",pn?\"(?<!`)()\":\"(^^|[^`])\").replace(\"code\",/(?<b>`+)[^`]+\\k<b>(?!`)/).replace(\"html\",/<(?! )[^<>]*?>/).getRegex(),Sn=/^(?:\\*+(?:((?!\\*)punct)|([^\\s*]))?)|^_+(?:((?!_)punct)|([^\\s_]))?/,yl=de(Sn,\"u\").replace(/punct/g,Ot).getRegex(),bl=de(Sn,\"u\").replace(/punct/g,_n).getRegex(),_l=de(/^(?:\\*+(?:((?!\\*)(?!openQuote)punct)|([^\\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\\s_]))?/,\"u\").replace(/openQuote/g,pl).replace(/punct/g,Ot).getRegex(),kn=\"^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)|(?!\\\\*)punctSpace(\\\\*+)(?=notPunctSpace)|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)|notPunctSpace(\\\\*+)(?=notPunctSpace)\",Sl=de(kn,\"gu\").replace(/notPunctSpace/g,Fs).replace(/punctSpace/g,ks).replace(/punct/g,Ot).getRegex(),kl=de(kn,\"gu\").replace(/notPunctSpace/g,ml).replace(/punctSpace/g,gl).replace(/punct/g,_n).getRegex(),wl=de(\"^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)|(?!\\\\*)[\\\\s](\\\\*+)(?=notPunctSpace)|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)|(?:(?!\\\\*)punct|notPunctSpace)(\\\\*+)(?!\\\\*)(?=notPunctSpace)\",\"gu\").replace(/notPunctSpace/g,Fs).replace(/punctSpace/g,ks).replace(/punct/g,Ot).getRegex(),xl=de(\"^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)\",\"gu\").replace(/notPunctSpace/g,Fs).replace(/punctSpace/g,ks).replace(/punct/g,Ot).getRegex(),Tl=de(\"^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\\\s](_+)(?=notPunctSpace)|[\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)\",\"gu\").replace(/notPunctSpace/g,Fs).replace(/punctSpace/g,ks).replace(/punct/g,Ot).getRegex(),Cl=de(/^~~?(?:((?!~)punct)|[^\\s~])/,\"u\").replace(/punct/g,Ot).getRegex(),Al=de(\"^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)\",\"gu\").replace(/notPunctSpace/g,Fs).replace(/punctSpace/g,ks).replace(/punct/g,Ot).getRegex(),Pl=de(/\\\\(punct)/,\"gu\").replace(/punct/g,Ot).getRegex(),El=de(/(`+)(?:[^`]|[^`][\\s\\S]*?[^`])\\1(?!`)|`+|\\\\(punct)/,\"gu\").replace(/punct/g,Ot).getRegex(),Ll=de(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/).replace(\"scheme\",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(\"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])?)+(?![-_])/).getRegex(),Rl=de(li).replace(\"(?:-->|$)\",\"-->\").getRegex(),Il=de(\"^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\\\s*/?>|^<\\\\?[\\\\s\\\\S]*?\\\\?>|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>\").replace(\"comment\",Rl).replace(\"attribute\",/\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/).getRegex(),wn=/\\[(?:\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]/,pr=de(/(?:\\[(?:brackets|\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\])|[^\\[\\]\\\\`])*?/).replace(\"brackets\",wn).getRegex(),Ml=de(/^!?\\[(label)\\]\\([ \\t\\n]*(href)(?:(?:[ \\t]+(?:\\n[ \\t]*)?|\\n[ \\t]*)(title))?[ \\t\\n]*\\)/).replace(\"label\",pr).replace(\"href\",/<(?:\\\\.|[^\\n<>\\\\])+>|[^ \\t\\n\\x00-\\x1f]+|(?=\\))/).replace(\"title\",/\"(?:\\\\[\\s\\S]|[^\"\\\\])*\"|'(?:\\\\[\\s\\S]|[^'\\\\])*'|\\((?:\\\\[\\s\\S]|[^)\\\\])*\\)/).getRegex(),Ol=de(/^!?\\[(label)\\]\\[(ref)\\]/).replace(\"label\",pr).replace(\"ref\",ai).getRegex(),Nl=de(/^!?\\[(ref)\\](?:\\[\\])?/).replace(\"ref\",ai).getRegex(),xn=/(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\]){1,999}/,Dl=de(/(?:[^\\[\\]\\\\`]*(?:\\[(?:brackets|\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\]))){0,999}?[^\\[\\]\\\\`]*?/).replace(\"brackets\",wn).getRegex(),Bl=de(\"reflink|nolink(?!\\\\()\",\"g\").replace(\"reflink\",de(/^!?\\[(label)\\]\\[(ref)\\]/).replace(\"label\",Dl).replace(\"ref\",xn).getRegex()).replace(\"nolink\",de(/^!?\\[(ref)\\](?:\\[\\])?/).replace(\"ref\",xn).getRegex()).getRegex(),Tn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,$l=de(/(?:mailto:email|xmpp:email(?:\\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\\w-])/).getRegex(),ui={_backpedal:is,anyPunctuation:Pl,anyPunctuationOutsideCode:El,autolink:Ll,blockSkip:vl,br:bn,code:hl,del:is,delLDelim:is,delRDelim:is,emStrongLDelim:yl,emStrongRDelimAst:Sl,emStrongRDelimUnd:xl,escape:ul,link:Ml,nolink:Nl,punctuation:fl,reflink:Ol,reflinkSearch:Bl,tag:Il,text:dl,url:is},Hl={...ui,emStrongLDelim:_l,emStrongRDelimAst:wl,emStrongRDelimUnd:Tl,link:de(/^!?\\[(label)\\]\\((.*?)\\)/).replace(\"label\",pr).getRegex(),reflink:de(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/).replace(\"label\",pr).getRegex()},hi={...ui,emStrongRDelimAst:kl,emStrongLDelim:bl,delLDelim:Cl,delRDelim:Al,url:de(/^emailProtocol|^((?:protocol):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/).replace(\"emailProtocol\",$l).replace(\"protocol\",Tn).replace(\"email\",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,del:/^(~~?)(?=[^\\s~])((?:\\\\[\\s\\S]|[^\\\\])*?(?:\\\\[\\s\\S]|[^\\s~\\\\]))\\1(?=[^~]|$)/,text:de(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|protocol:\\/\\/|wwwStart|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@))))/).replace(\"protocol\",Tn).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace(\"wwwStart\",pn?\"(?<![^\\\\s*_~(])www\\\\.\":\"www\\\\.\").getRegex()},ql={...hi,br:de(bn).replace(\"{2,}\",\"*\").getRegex(),text:de(hi.text).replace(\"\\\\b_\",\"\\\\b_| {2,}\\\\n\").replace(/\\{2,\\}/g,\"*\").getRegex()},gr={normal:ci,gfm:ll,pedantic:cl},Vs={normal:ui,gfm:hi,breaks:ql,pedantic:Hl},Fl={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"},Cn=e=>Fl[e];function mt(e,t){if(t){if(Je.escapeTest.test(e))return e.replace(Je.escapeReplace,Cn)}else if(Je.escapeTestNoEncode.test(e))return e.replace(Je.escapeReplaceNoEncode,Cn);return e}function Vl(e){return Je.numericCharacterReference.test(e)?e.replace(Je.numericCharacterReferenceOrAmpersand,(t,s,r)=>{if(s===void 0&&r===void 0)return\"&\";let i=s===void 0?Number.parseInt(r,16):Number.parseInt(s,10);return i===0||i>1114111||i>=55296&&i<=57343?\"�\":i===38?\"&\":String.fromCodePoint(i)}):e}function An(e){try{e=encodeURI(e).replace(Je.percentDecode,\"%\")}catch{return null}return e}function Pn(e,t){let s=e.replace(Je.findPipe,(i,n,o)=>{let c=!1,d=n;for(;--d>=0&&o[d]===\"\\\\\";)c=!c;return c?\"|\":\" |\"}).split(Je.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push(\"\");for(;r<s.length;r++)s[r]=s[r].trim().replace(Je.slashPipe,\"|\");return s}function $t(e,t,s){let r=e.length;if(r===0)return\"\";let i=0;for(;i<r;){let n=e.charAt(r-i-1);if(n===t&&!s)i++;else if(n!==t&&s)i++;else break}return e.slice(0,r-i)}function En(e){let t=e.split(`\n`),s=t.length-1;for(;s>=0&&Je.blankLine.test(t[s]);)s--;return t.length-s<=2?e:t.slice(0,s+1).join(`\n`)}function mr(e){return e.trim().replace(Je.multipleSpaceGlobal,\" \").toLowerCase().toUpperCase().toLowerCase()}function Ln(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let s=0;for(let r=0;r<e.length;r++)if(e[r]===\"\\\\\")r++;else if(e[r]===t[0])s++;else if(e[r]===t[1]&&(s--,s<0))return r;return s>0?-2:-1}var ws=new WeakMap;function di(e){let t={\"*\":-1,_:-1},s=-1,r=e.length;for(let i=0;i<r;i++){let n=e[i];if(n!==\"*\"&&n!==\"_\"&&n!==\"~\")continue;let o=i===0?`\n`:e[i-1],c=i+1;for(;c<r&&e[c]===n;)c++;o!==\" \"&&o!==\"\t\"&&o!==`\n`&&o!==\"\\r\"&&o!==\"\\f\"&&(n===\"~\"?s=i:t[n]=i),i=c-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:s}}function zl(e,t){let s=di(t),r=ws.get(e);r?r.push(s):ws.set(e,[s])}function Ul(e){let t=ws.get(e);t&&(t.pop(),t.length===0&&ws.delete(e))}function Wl(e,t,s){let r=ws.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[s]:di(t).lastPossibleEmStrongCloserIndex[s]}function Gl(e,t){let s=ws.get(e)?.at(-1);return s&&s.maskedSrc===t?s.lastPossibleDelCloserIndex:di(t).lastPossibleDelCloserIndex}function vr(e,t=0){let s=t,r=\"\";for(let i of e)if(i===\"\t\"){let n=4-s%4;r+=\" \".repeat(n),s+=n}else r+=i,s++;return r}function Rn(e,t,s,r,i){let n=t.href,o=t.title||null,c=e[1].replace(i.other.outputLinkReplace,\"$1\"),d=e[0].charAt(0)===\"!\",h=r.state.inLink,p=r.state.linkEmitted,a=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(c),l=r.state.linkEmitted;if(r.state.linkEmitted=p,r.state.inLink=h,!d){if(l){r.state.inRawBlock=a;return}r.state.linkEmitted=!0}return{type:d?\"image\":\"link\",raw:s,href:n,title:o,text:c,tokens:f}}function Xl(e,t,s){let r=e.match(s.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`\n`).map(n=>{let o=n.match(s.other.beginningSpace);if(o===null)return n;let[c]=o;return n.slice(Math.min(c.length,i.length))}).join(`\n`)}function In(e,t,s,r){if(!t.includes(\"<\"))return!1;for(let i=0;i<t.length;i++){if(t[i]===\"\\\\\"){i++;continue}if(t[i]===\"`\"){let c=r.inline.code.exec(t.slice(i));if(c){i+=c[0].length-1;continue}}if(t[i]!==\"<\")continue;let n=e.slice(s+i),o=r.inline.tag.exec(n)||r.inline.autolink.exec(n);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var xs=class{constructor(e){De(this,\"options\",void 0),De(this,\"rules\",void 0),De(this,\"lexer\",void 0),this.options=e||rs}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:\"space\",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let s=this.options.pedantic?t[0]:En(t[0]);return{type:\"code\",raw:s,codeBlockStyle:\"indented\",text:s.replace(this.rules.other.codeRemoveIndent,\"\")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let s=t[0],r=Xl(s,t[3]||\"\",this.rules);return{type:\"code\",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,\"$1\"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(this.rules.other.endingHash.test(s)){let r=$t(s,\"#\");(this.options.pedantic||!r||this.rules.other.endingSpaceTabChar.test(r))&&(s=r.trim())}return{type:\"heading\",raw:$t(t[0],`\n`),depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:\"hr\",raw:$t(t[0],`\n`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let s=$t(t[0],`\n`).split(`\n`),r=\"\",i=\"\",n=[];for(;s.length>0;){let o=!1,c=[],d=0;for(;d<s.length;d++)if(this.rules.other.blockquoteStart.test(s[d]))c.push(s[d]),o=!0;else if(!o)c.push(s[d]);else break;s=s.slice(d);let h=c.join(`\n`),p=h.replace(this.rules.other.blockquoteMarkerWhitespace,(l,g,m)=>g+vr(m,g.length)).replace(this.rules.other.blockquoteSetextReplace,`\n $1`).replace(this.rules.other.blockquoteSetextReplace2,\"\");r=r?`${r}\n${h}`:h,i=i?`${i}\n${p}`:p;let a=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,n,!0),this.lexer.state.top=a,s.length===0)break;let f=n.at(-1);if(f?.type===\"code\"||f?.type===\"heading\"||f?.type===\"hr\"||f?.type===\"html\"||f?.type===\"table\")break;if(f?.type===\"blockquote\"){let l=f,g=s.join(`\n`),m=l.raw+`\n`+g.replace(this.rules.other.blockquoteSetextReplace2,\"\"),y=this.blockquote(m);n[n.length-1]=y;let S=m.substring(y.raw.length).replace(/^\\n/,\"\"),k=S?S.split(`\n`).length:0,b=k?s.slice(0,-k):s;if(b.length>0&&(r=`${r}\n${b.join(`\n`)}`),i=i.substring(0,i.length-l.text.length)+y.text,s=s.slice(b.length),s.length>0&&this.rules.other.blockquoteStart.test(s[0]))continue;break}else if(f?.type===\"list\"){let l=f,g=l.raw+`\n`+s.join(`\n`),m=this.list(g);n[n.length-1]=m;let y=m.raw.length>l.raw.length?g.slice(l.raw.length+1,m.raw.length).split(`\n`).length:0;if(y>0){let S=s.slice(0,y).join(`\n`);r=`${r}\n${S}`,i=`${i}\n${S}`}s=s.slice(y);continue}}return{type:\"blockquote\",raw:r,tokens:n,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type===\"text\"&&!this.rules.other.listInterruptsParagraph.test(e))return;let s=e,r=()=>s.length-e.length,i=t[1].trim(),n=i.length>1,o={type:\"list\",raw:\"\",ordered:n,start:n?+i.slice(0,-1):\"\",loose:!1,items:[]};i=n?`\\\\d{1,9}\\\\${i.slice(-1)}`:`\\\\${i}`,this.options.pedantic&&(i=n?i:\"[*+-]\");let c=this.rules.other.listItemRegex(i),d=!1;for(;e;){let p=!1,a=\"\";if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;let f=r();e=e.substring(t[0].length);let l=t[2].split(`\n`,1)[0],g=t[1].length,m=this.options.pedantic?vr(l,g):l.replace(this.rules.other.leadingSpaceTab,u=>vr(u,g)),y=e.split(`\n`,1)[0],S=!m.trim(),k=0;if(this.options.pedantic?(k=2,a=m.trimStart()):S?k=g+1:(k=m.search(this.rules.other.nonSpaceChar),k=k>4?1:k,a=m.slice(k),k+=g),S&&this.rules.other.blankLine.test(y)&&(e=e.substring(y.length+1),p=!0),!p){let u=this.rules.other.nextBulletRegex(k),v=this.rules.other.hrRegex(k),_=this.rules.other.fencesBeginRegex(k),w=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(k):this.rules.other.headingBeginRegex(k),T=this.rules.other.htmlBeginRegex(k),R=this.rules.other.blockquoteBeginRegex(k),C=!1;for(;e;){let P=e.split(`\n`,1)[0],E;if(y=P,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting,\" \"),E=y):E=y.replace(this.rules.other.leadingSpaceTab,N=>vr(N)),_.test(y)||w.test(y)||T.test(y)||R.test(y)||u.test(y)||v.test(y))break;if(E.search(this.rules.other.nonSpaceChar)>=k||!y.trim())a+=`\n`+E.slice(k),C=!1;else{if(S||m.replace(this.rules.other.tabCharGlobal,\" \").search(this.rules.other.nonSpaceChar)>=4||_.test(m)||w.test(m)||T.test(m)||v.test(m))break;if(!this.options.pedantic&&!C){let D=m.replace(this.rules.other.nestedContainerMarkers,\"\");if(this.rules.block.fences.test(D)||this.rules.block.heading.test(D)||this.rules.block.hr.test(D))break}let N=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(y)&&this.rules.block.lheading.test(`${m}\n${y}`)?` ${E.replace(/^ {0,3}/,\"\")}`:y;a+=`\n`+N,C=!0}S=!y.trim(),e=e.substring(P.length+1),m=E.slice(k)}}let b=s.slice(f,r());o.loose||(d?o.loose=!0:this.rules.other.doubleBlankLine.test(b)&&(d=!0)),o.items.push({type:\"list_item\",raw:b,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let h=o.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;o.raw=s.slice(0,r()).trimEnd();for(let p of o.items)if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),!o.loose){let a=p.tokens.filter(f=>f.type===\"space\");o.loose=a.length>0&&a.some(f=>this.rules.other.anyLine.test(f.raw))}for(let p of o.items){let a=p.tokens[0];if(p.task&&(a?.type===\"text\"||a?.type===\"paragraph\")){p.text=p.text.replace(this.rules.other.listReplaceTask,\"\"),a.raw=a.raw.replace(this.rules.other.listReplaceTask,\"\"),a.text=a.text.replace(this.rules.other.listReplaceTask,\"\");for(let l=this.lexer.inlineQueue.length-1;l>=0;l--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[l].src)){this.lexer.inlineQueue[l].src=this.lexer.inlineQueue[l].src.replace(this.rules.other.listReplaceTask,\"\");break}let f=this.rules.other.listTaskCheckbox.exec(p.raw);if(f){let l={type:\"checkbox\",raw:f[0]+\" \",checked:f[0]!==\"[ ]\"};p.checked=l.checked,o.loose?p.tokens[0]&&[\"paragraph\",\"text\"].includes(p.tokens[0].type)&&\"tokens\"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=l.raw+p.tokens[0].raw,p.tokens[0].text=l.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(l)):p.tokens.unshift({type:\"paragraph\",raw:l.raw,text:l.raw,tokens:[l]}):p.tokens.unshift(l)}}else p.task&&(p.task=!1)}if(o.loose)for(let p of o.items){p.loose=!0;for(let a of p.tokens)a.type===\"text\"&&(a.type=\"paragraph\")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let s=En(t[0]);return{type:\"html\",block:!0,raw:s,pre:t[1]===\"pre\"||t[1]===\"script\"||t[1]===\"style\",text:s}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Ln(t[2],\"()\")!==-1)return;let s=mr(t[1]),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,\"$1\").replace(this.rules.inline.anyPunctuation,\"$1\"):\"\",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,\"$1\"):t[3];return{type:\"def\",tag:s,raw:$t(t[0],`\n`),href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let s=Pn(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,\"\").split(\"|\"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,\"\").split(`\n`):[],n={type:\"table\",raw:$t(t[0],`\n`),header:[],align:[],rows:[]};if(s.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?n.align.push(\"right\"):this.rules.other.tableAlignCenter.test(o)?n.align.push(\"center\"):this.rules.other.tableAlignLeft.test(o)?n.align.push(\"left\"):n.align.push(null);for(let o=0;o<s.length;o++)n.header.push({text:s[o],tokens:this.lexer.inline(s[o]),header:!0,align:n.align[o]});for(let o of i)n.rows.push(Pn(o,n.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:n.align[d]})));return n}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let s=t[1].trim();return{type:\"heading\",raw:$t(t[0],`\n`),depth:t[2].charAt(0)===\"=\"?1:2,text:s,tokens:this.lexer.inline(s)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let s=t[1].charAt(t[1].length-1)===`\n`?t[1].slice(0,-1):t[1];return{type:\"paragraph\",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:\"text\",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:\"escape\",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:\"html\",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let s=t[0].charAt(0)===\"!\"?2:1;if(!this.options.pedantic&&In(e,t[1],s,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let c=$t(r.slice(0,-1),\"\\\\\");if((r.length-c.length)%2===0)return}else{let c=Ln(t[2],\"()\");if(c===-2)return;if(c>-1){let d=(t[0].indexOf(\"!\")===0?5:4)+t[1].length+c;t[2]=t[2].substring(0,c),t[0]=t[0].substring(0,d).trim(),t[3]=\"\"}}let i=$t(t[0].slice(0,-1),\"\\\\\");if((t[0].length-i.length)%2===0)return;let n=t[2],o=\"\";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(n);c&&(n=c[1],o=c[3])}else o=t[3]?t[3].slice(1,-1):\"\";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),Rn(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,\"$1\"),title:o&&o.replace(this.rules.inline.anyPunctuation,\"$1\")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){let r=s[0].charAt(0)===\"!\"?2:1;if(!this.options.pedantic&&In(e,s[1],r,this.rules))return;let i=t[mr(s[2]||s[1])];if(!i){let n=s[0].charAt(0);return{type:\"text\",raw:n,text:n}}return Rn(s,i,s[0],this.lexer,this.rules)}}emStrong(e,t,s=\"\"){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],n=s===i,o=t.length-e.length,c=o;for(;!this.options.pedantic&&c>0&&t[c-1]===i;)c--;let d=[...t.slice(Math.max(0,c-2),c)].at(-1)??\"\",h=d===\"*\"||d===\"_\"||!!this.rules.inline.punctuation.exec(d);c<o&&(s=d);let p=c<o?h:s===\"*\"||s===\"_\"||!!this.rules.inline.punctuation.exec(s);if(r[4]&&s.match(this.rules.other.unicodeAlphaNumeric))return;let a=r[1]||r[3]||\"\";if(!a||!s||p){let f=[...r[0]].length-1,l,g,m=f,y=0,S=o-c+f,k=!this.options.pedantic&&!!d.trim()&&(!!a||i===\"*\"&&!h);if(i!==\"*\"&&i!==\"_\")return;let b=i===\"*\"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,u=Wl(this,t,i),v=t.length-e.length+f;if(u<v)return;t=t.slice(-1*e.length+f);let _=u-v;for(b.lastIndex=0;(r=b.exec(t))!==null&&!(r.index>_);){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(g=[...l].length,r[3]||r[4]){m+=g;continue}else if(r[5]||r[6]||k){if(n&&(r[5]||r[6]))break;if(S%3&&!((S+g)%3)){y+=g;continue}}if(m-=g,m>0)continue;g=Math.min(g,g+m+y);let w=[...r[0]][0].length,T=e.slice(0,f+r.index+w+g);if(Math.min(f,g)%2){let C=T.slice(1,-1);return{type:\"em\",raw:T,text:C,tokens:this.lexer.inlineTokens(C)}}let R=T.slice(2,-2);return{type:\"strong\",raw:T,text:R,tokens:this.lexer.inlineTokens(R)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal,\" \"),r=this.rules.other.nonSpaceChar.test(s),i=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return r&&i&&(s=s.substring(1,s.length-1)),{type:\"codespan\",raw:t[0],text:s}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:\"br\",raw:t[0]}}del(e,t,s=\"\"){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!s||this.rules.inline.punctuation.exec(s))){let i=[...r[0]].length-1,n,o,c=i,d=this.rules.inline.delRDelim,h=Gl(this,t),p=t.length-e.length+i;if(h<p)return;t=t.slice(-1*e.length+i);let a=h-p;for(d.lastIndex=0;(r=d.exec(t))!==null&&!(r.index>a);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(o=[...n].length,o!==i))continue;if(r[3]||r[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let f=[...r[0]][0].length,l=e.slice(0,i+r.index+f+o),g=l.slice(i,-i);return{type:\"del\",raw:l,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let s,r;return t[2]===\"@\"?(s=t[1],r=\"mailto:\"+s):(s=t[1],r=s),{type:\"link\",raw:t[0],text:s,href:r,autolink:!0,tokens:[{type:\"text\",raw:s,text:s}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let s,r;if(t[2]===\"@\")s=t[0],r=\"mailto:\"+s;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??\"\";while(i!==t[0]);s=t[0],t[1]===\"www.\"?r=\"http://\"+t[0]:r=t[0]}return{type:\"link\",raw:t[0],text:s,href:r,autolink:!0,tokens:[{type:\"text\",raw:s,text:s}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let s=this.lexer.state.inRawBlock;return{type:\"text\",raw:t[0],text:s?t[0]:Vl(t[0]),escaped:s}}}},At=(Ss=new WeakSet,class un{constructor(t){Za(this,Ss),De(this,\"tokens\",void 0),De(this,\"options\",void 0),De(this,\"state\",void 0),De(this,\"inlineQueue\",void 0),De(this,\"tokenizer\",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||rs,this.options.tokenizer=this.options.tokenizer||new xs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let s={other:Je,block:gr.normal,inline:Vs.normal};this.options.pedantic?(s.block=gr.pedantic,s.inline=Vs.pedantic):this.options.gfm&&(s.block=gr.gfm,this.options.breaks?s.inline=Vs.breaks:s.inline=Vs.gfm),this.tokenizer.rules=s}static get rules(){return{block:gr,inline:Vs}}static lex(t,s){return new un(s).lex(t)}static lexInline(t,s){return new un(s).inlineTokens(t)}lex(t){t=t.replace(Je.carriageReturn,`\n`),this.blockTokens(t,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let r=this.inlineQueue[s];this.state.inRawBlock=!1,this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,s=[],r=!1){this.tokenizer.lexer=this;let i=this.state.lastToken;this.options.pedantic&&(t=t.replace(Je.tabCharGlobal,\" \").replace(Je.spaceLine,\"\"));let n=1/0;for(;t;){if(t.length<n)n=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}this.state.lastToken=s.at(-1);let o;if(this.options.extensions?.block?.some(d=>(o=d.call({lexer:this},t,s))?(t=t.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let d=s.at(-1);o.raw.length===1&&d!==void 0?d.raw+=`\n`:s.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let d=s.at(-1);d?.type===\"paragraph\"||d?.type===\"text\"?(d.raw+=(d.raw.endsWith(`\n`)?\"\":`\n`)+o.raw,d.text+=`\n`+o.text,this.inlineQueue.at(-1).src=d.text):s.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let d=s.at(-1);d?.type===\"paragraph\"||d?.type===\"text\"?(d.raw+=(d.raw.endsWith(`\n`)?\"\":`\n`)+o.raw,d.text+=`\n`+o.raw,this.inlineQueue.at(-1).src=d.text):(this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title}),s.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),s.push(o);continue}let c=t;if(this.options.extensions?.startBlock){let d=1/0,h=t.slice(1),p;this.options.extensions.startBlock.forEach(a=>{p=a.call({lexer:this},h),typeof p==\"number\"&&p>=0&&(d=Math.min(d,p))}),d<1/0&&d>=0&&(c=t.substring(0,d+1))}if(this.state.top&&(o=this.tokenizer.paragraph(c))){let d=s.at(-1);r&&d?.type===\"paragraph\"?(d.raw+=(d.raw.endsWith(`\n`)?\"\":`\n`)+o.raw,d.text+=`\n`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):s.push(o),r=c.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let d=s.at(-1);d?.type===\"text\"?(d.raw+=(d.raw.endsWith(`\n`)?\"\":`\n`)+o.raw,d.text+=`\n`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):s.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=i,s}inline(t,s=[]){return this.inlineQueue.push({src:t,tokens:s}),s}linkInText(t){if(!t.includes(\"[\"))return!1;let s=this.tokenizer.rules.inline.link;for(let r of t.matchAll(this.tokenizer.rules.inline.blockSkip))if(s.test(r[0])&&t.charAt(r.index-1)!==\"!\")return!0;for(let r of t.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=r[0],n=i.lastIndexOf(\"[\");if(!(i.charAt(0)===\"!\"||!Object.hasOwn(this.tokens.links,mr(i.slice(n+1,-1))))&&!(n>1&&this.linkInText(i.slice(1,n-1))))return!0}return!1}inlineTokens(t,s=[]){this.tokenizer.lexer=this;let r=this.state.linkParenPossible;this.state.linkParenPossible=r&&t.includes(\")\");try{return dr(Ss,this,jl).call(this,t,s)}finally{this.state.linkParenPossible=r}}infiniteLoopError(t){let s=\"Infinite loop on byte: \"+t;if(this.options.silent)console.error(s);else throw new Error(s)}});function jl(e,t){let s=e.includes(\"*\")||e.includes(\"_\")||e.includes(\"~\")||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==xs.prototype.emStrong||this.tokenizer.del!==xs.prototype.del?dr(Ss,this,Jl).call(this,e):e;zl(this.tokenizer,s);try{return dr(Ss,this,Yl).call(this,e,s,t)}finally{Ul(this.tokenizer)}}function Yl(e,t,s){let r=!1,i=\"\",n=1/0;for(;e;){if(e.length<n)n=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=\"\"),r=!1;let o;if(this.options.extensions?.inline?.some(d=>(o=d.call({lexer:this},e,s))?(e=e.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let d=s.at(-1);o.type===\"text\"&&d?.type===\"text\"?(d.raw+=o.raw,d.text+=o.text):s.push(o);continue}if(o=this.tokenizer.emStrong(e,t,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.del(e,t,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),s.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),s.push(o);continue}let c=e;if(this.options.extensions?.startInline){let d=1/0,h=e.slice(1),p;this.options.extensions.startInline.forEach(a=>{p=a.call({lexer:this},h),typeof p==\"number\"&&p>=0&&(d=Math.min(d,p))}),d<1/0&&d>=0&&(c=e.substring(0,d+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!==\"_\"&&(i=o.raw.slice(-1)),r=!0;let d=s.at(-1);d?.type===\"text\"?(d.raw+=o.raw,d.text+=o.text):s.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return s}function Zl(e){let{blockSkip:t,tag:s,autolink:r}=this.tokenizer.rules.inline,i=\"\",n=0,o;for(t.lastIndex=0;o=t.exec(e);){let c=o.index+(o[2]?o[2].length:0),d=o.index+o[0].length;if(e.charAt(c)===\"<\"){let h=e.slice(c),p=s.exec(h)||r.exec(h);if(!p){t.lastIndex=c+1;continue}d=c+p[0].length,t.lastIndex=d}i+=e.slice(n,c)+\"[\"+\"a\".repeat(d-c-2)+\"]\",n=d}return i+e.slice(n)}function Jl(e){let t=e;if(this.tokens.links&&e.includes(\"[\")){let s=this.tokenizer.rules.inline.reflinkSearch,r=i=>{let n=i.lastIndexOf(\"[\");if(!Object.hasOwn(this.tokens.links,mr(i.slice(n+1,-1))))return i;if(n>1&&i.charAt(0)!==\"!\"){let o=i.slice(1,n-1);if(this.linkInText(o))return\"[\"+o.replace(s,r)+\"][\"+\"a\".repeat(i.length-n-2)+\"]\"}return\"[\"+\"a\".repeat(i.length-2)+\"]\"};t=t.replace(s,r)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(s,r,i)=>i?\"+\".repeat(s.length):r?r+s.slice(r.length,-r.length).replace(/`/g,\"+\")+r:s),t=dr(Ss,this,Zl).call(this,t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}var yr=class{constructor(e){De(this,\"options\",void 0),De(this,\"parser\",void 0),this.options=e||rs}space(e){return\"\"}code({text:e,lang:t,escaped:s}){let r=(t||\"\").match(Je.notSpaceStart)?.[0],i=e?e.replace(Je.endingNewline,\"\")+`\n`:\"\";return r?'<pre><code class=\"language-'+mt(r)+'\">'+(s?i:mt(i,!0))+`</code></pre>\n`:\"<pre><code>\"+(s?i:mt(i,!0))+`</code></pre>\n`}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return\"\"}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return`<hr>\n`}list(e){let t=e.ordered,s=e.start,r=\"\";for(let o=0;o<e.items.length;o++){let c=e.items[o];r+=this.listitem(c)}let i=t?\"ol\":\"ul\",n=t&&s!==1?' start=\"'+s+'\"':\"\";return\"<\"+i+n+`>\n`+r+\"</\"+i+`>\n`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return\"<input \"+(e?'checked=\"\" ':\"\")+'disabled=\"\" type=\"checkbox\"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t=\"\",s=\"\";for(let i=0;i<e.header.length;i++)s+=this.tablecell(e.header[i]);t+=this.tablerow({text:s});let r=\"\";for(let i=0;i<e.rows.length;i++){let n=e.rows[i];s=\"\";for(let o=0;o<n.length;o++)s+=this.tablecell(n[o]);r+=this.tablerow({text:s})}return r&&(r=`<tbody>${r}</tbody>`),`<table>\n<thead>\n`+t+`</thead>\n`+r+`</table>\n`}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),s=e.header?\"th\":\"td\";return(e.align?`<${s} align=\"${e.align}\">`:`<${s}>`)+t+`</${s}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${mt(e,!0)}</code>`}br(e){return\"<br>\"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:s,tokens:r,autolink:i}){let n=i?mt(s,!0):this.parser.parseInline(r),o=An(e);if(o===null)return n;e=mt(o,i);let c='<a href=\"'+e+'\"';return t&&(c+=' title=\"'+mt(t)+'\"'),c+=\">\"+n+\"</a>\",c}image({href:e,title:t,text:s,tokens:r}){r&&(s=this.parser.parseInline(r,this.parser.textRenderer));let i=An(e);if(i===null)return mt(s);e=i;let n=`<img src=\"${mt(e)}\" alt=\"${mt(s)}\"`;return t&&(n+=` title=\"${mt(t)}\"`),n+=\">\",n}text(e){return\"tokens\"in e&&e.tokens?this.parser.parseInline(e.tokens):\"escaped\"in e&&e.escaped?e.text:mt(e.text)}},fi=class{constructor(){De(this,\"parser\",void 0)}strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return`\n`}checkbox({raw:e}){return e}},Pt=class hn{constructor(t){De(this,\"options\",void 0),De(this,\"renderer\",void 0),De(this,\"textRenderer\",void 0),this.options=t||rs,this.options.renderer=this.options.renderer||new yr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new fi,this.textRenderer.parser=this}static parse(t,s){return new hn(s).parse(t)}static parseInline(t,s){return new hn(s).parseInline(t)}parse(t){this.renderer.parser=this;let s=\"\";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let o=i,c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||![\"space\",\"hr\",\"heading\",\"code\",\"table\",\"blockquote\",\"list\",\"checkbox\",\"html\",\"def\",\"paragraph\",\"text\"].includes(o.type)){s+=c===!1?\"\":c??\"\";continue}}let n=i;switch(n.type){case\"space\":s+=this.renderer.space(n);break;case\"hr\":s+=this.renderer.hr(n);break;case\"heading\":s+=this.renderer.heading(n);break;case\"code\":s+=this.renderer.code(n);break;case\"table\":s+=this.renderer.table(n);break;case\"blockquote\":s+=this.renderer.blockquote(n);break;case\"list\":s+=this.renderer.list(n);break;case\"checkbox\":s+=this.renderer.checkbox(n);break;case\"html\":s+=this.renderer.html(n);break;case\"def\":s+=this.renderer.def(n);break;case\"paragraph\":s+=this.renderer.paragraph(n);break;case\"text\":s+=this.renderer.text(n);break;default:{let o='Token with \"'+n.type+'\" type was not found.';if(this.options.silent)return console.error(o),\"\";throw new Error(o)}}}return s}parseInline(t,s=this.renderer){this.renderer.parser=this;let r=\"\";for(let i=0;i<t.length;i++){let n=t[i];if(this.options.extensions?.renderers?.[n.type]){let c=this.options.extensions.renderers[n.type].call({parser:this},n);if(c!==!1||![\"escape\",\"html\",\"link\",\"image\",\"checkbox\",\"strong\",\"em\",\"codespan\",\"br\",\"del\",\"text\"].includes(n.type)){r+=c===!1?\"\":c??\"\";continue}}let o=n;switch(o.type){case\"escape\":r+=s.text(o);break;case\"html\":r+=s.html(o);break;case\"link\":r+=s.link(o);break;case\"image\":r+=s.image(o);break;case\"checkbox\":r+=s.checkbox(o);break;case\"strong\":r+=s.strong(o);break;case\"em\":r+=s.em(o);break;case\"codespan\":r+=s.codespan(o);break;case\"br\":r+=s.br(o);break;case\"del\":r+=s.del(o);break;case\"text\":r+=s.text(o);break;default:{let c='Token with \"'+o.type+'\" type was not found.';if(this.options.silent)return console.error(c),\"\";throw new Error(c)}}}return r}},zs=(fr=class{constructor(e){De(this,\"options\",void 0),De(this,\"block\",void 0),this.options=e||rs}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?At.lex:At.lexInline}provideParser(e=this.block){return e?Pt.parse:Pt.parseInline}},De(fr,\"passThroughHooks\",new Set([\"preprocess\",\"postprocess\",\"processAllTokens\",\"emStrongMask\"])),De(fr,\"passThroughHooksRespectAsync\",new Set([\"preprocess\",\"postprocess\",\"processAllTokens\"])),fr);function Xt(e,t){if(Array.isArray(t))for(let s=0;s<t.length;s++)e.push(t[s]);else e.push(t)}var Kl=class{constructor(...e){De(this,\"defaults\",ii()),De(this,\"options\",this.setOptions),De(this,\"parse\",this.parseMarkdown(!0)),De(this,\"parseInline\",this.parseMarkdown(!1)),De(this,\"Parser\",Pt),De(this,\"Renderer\",yr),De(this,\"TextRenderer\",fi),De(this,\"Lexer\",At),De(this,\"Tokenizer\",xs),De(this,\"Hooks\",zs),this.use(...e)}walkTokens(e,t){let s=[];for(let r of e)switch(Xt(s,t.call(this,r)),r.type){case\"table\":{let i=r;for(let n of i.header)Xt(s,this.walkTokens(n.tokens,t));for(let n of i.rows)for(let o of n)Xt(s,this.walkTokens(o.tokens,t));break}case\"list\":{let i=r;Xt(s,this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(n=>{let o=i[n].flat(1/0);Xt(s,this.walkTokens(o,t))}):i.tokens&&Xt(s,this.walkTokens(i.tokens,t))}}return s}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(s=>{let r={...s};if(r.async=this.defaults.async||r.async||!1,s.extensions&&(s.extensions.forEach(i=>{if(!i.name)throw new Error(\"extension name required\");if(\"renderer\"in i){let n=t.renderers[i.name];n?t.renderers[i.name]=function(...o){let c=i.renderer.apply(this,o);return c===!1&&(c=n.apply(this,o)),c}:t.renderers[i.name]=i.renderer}if(\"tokenizer\"in i){if(!i.level||i.level!==\"block\"&&i.level!==\"inline\")throw new Error(\"extension level must be 'block' or 'inline'\");let n=t[i.level];n?n.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level===\"block\"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level===\"inline\"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}\"childTokens\"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),s.renderer){let i=this.defaults.renderer||new yr(this.defaults);for(let n in s.renderer){if(!(n in i))throw new Error(`renderer '${n}' does not exist`);if([\"options\",\"parser\"].includes(n))continue;let o=n,c=s.renderer[o],d=i[o];i[o]=(...h)=>{let p=c.apply(i,h);return p===!1&&(p=d.apply(i,h)),p===!1?\"\":p??\"\"}}r.renderer=i}if(s.tokenizer){let i=this.defaults.tokenizer||new xs(this.defaults);for(let n in s.tokenizer){if(!(n in i))throw new Error(`tokenizer '${n}' does not exist`);if([\"options\",\"rules\",\"lexer\"].includes(n))continue;let o=n,c=s.tokenizer[o],d=i[o];i[o]=(...h)=>{let p=c.apply(i,h);return p===!1&&(p=d.apply(i,h)),p}}r.tokenizer=i}if(s.hooks){let i=this.defaults.hooks||new zs;for(let n in s.hooks){if(!(n in i))throw new Error(`hook '${n}' does not exist`);if([\"options\",\"block\"].includes(n))continue;let o=n,c=s.hooks[o],d=i[o];zs.passThroughHooks.has(n)?i[o]=h=>{if(i.options.async&&zs.passThroughHooksRespectAsync.has(n))return(async()=>{let a=await c.call(i,h);return d.call(i,a)})();let p=c.call(i,h);return d.call(i,p)}:i[o]=(...h)=>{if(i.options.async)return(async()=>{let a=await c.apply(i,h);return a===!1&&(a=await d.apply(i,h)),a})();let p=c.apply(i,h);return p===!1&&(p=d.apply(i,h)),p}}r.hooks=i}if(s.walkTokens){let i=this.defaults.walkTokens,n=s.walkTokens;r.walkTokens=function(o){let c=[];return Xt(c,n.call(this,o)),i&&Xt(c,i.call(this,o)),c}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return At.lex(e,t??this.defaults)}parser(e,t){return Pt.parse(e,t??this.defaults)}parseMarkdown(e){return(t,s)=>{let r={...s},i={...this.defaults,...r},n=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return n(new Error(\"marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.\"));if(typeof t>\"u\"||t===null)return n(new Error(\"marked(): input parameter is undefined or null\"));if(typeof t!=\"string\")return n(new Error(\"marked(): input parameter is of type \"+Object.prototype.toString.call(t)+\", string expected\"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(t):t,c=await(i.hooks?await i.hooks.provideLexer(e):e?At.lex:At.lexInline)(o,i),d=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(d,i.walkTokens));let h=await(i.hooks?await i.hooks.provideParser(e):e?Pt.parse:Pt.parseInline)(d,i);return i.hooks?await i.hooks.postprocess(h):h})().catch(n);try{i.hooks&&(t=i.hooks.preprocess(t));let o=(i.hooks?i.hooks.provideLexer(e):e?At.lex:At.lexInline)(t,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let c=(i.hooks?i.hooks.provideParser(e):e?Pt.parse:Pt.parseInline)(o,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(o){return n(o)}}}onError(e,t){return s=>{if(s.message+=`\nPlease report this to https://github.com/markedjs/marked.`,e){let r=\"<p>An error occurred:</p><pre>\"+mt(s.message+\"\",!0)+\"</pre>\";return t?Promise.resolve(r):r}if(t)return Promise.reject(s);throw s}}},os=new Kl;function Be(e,t){return os.parse(e,t)}Be.options=Be.setOptions=function(e){return os.setOptions(e),Be.defaults=os.defaults,fn(Be.defaults),Be},Be.getDefaults=ii,Be.defaults=rs;function Ql(...e){return os.use(...e),Be.defaults=os.defaults,fn(Be.defaults),Be}Be.use=Ql,Be.walkTokens=function(e,t){return os.walkTokens(e,t)},Be.parseInline=os.parseInline,Be.Parser=Pt,Be.parser=Pt.parse,Be.Renderer=yr,Be.TextRenderer=fi,Be.Lexer=At,Be.lexer=At.lex,Be.Tokenizer=xs,Be.Hooks=zs,Be.parse=Be;var Yh=Be.options,Zh=Be.setOptions,Jh=Be.walkTokens,pi=Be.parseInline,gi=Be,Kh=Pt.parse,Qh=At.lex,lt=fe((e=>{e.__esModule=!0,e.extend=n,e.indexOf=h,e.escapeExpression=p,e.isEmpty=a,e.createFrame=f,e.blockParams=l,e.appendContextPath=g;var t={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\",\"`\":\"`\",\"=\":\"=\"},s=/[&<>\"'`=]/g,r=/[&<>\"'`=]/;function i(m){return t[m]}function n(m){for(var y=1;y<arguments.length;y++)for(var S in arguments[y])Object.prototype.hasOwnProperty.call(arguments[y],S)&&(m[S]=arguments[y][S]);return m}var o=Object.prototype.toString;e.toString=o;var c=function(y){return typeof y==\"function\"};c(/x/)&&(e.isFunction=c=function(m){return typeof m==\"function\"&&o.call(m)===\"[object Function]\"}),e.isFunction=c;var d=Array.isArray||function(m){return m&&typeof m==\"object\"?o.call(m)===\"[object Array]\":!1};e.isArray=d;function h(m,y){for(var S=0,k=m.length;S<k;S++)if(m[S]===y)return S;return-1}function p(m){if(typeof m!=\"string\"){if(m&&typeof m.toHTML==\"function\")return m.toHTML();if(m==null)return\"\";if(!m)return m+\"\";m=\"\"+m}return r.test(m)?m.replace(s,i):m}function a(m){return!m&&m!==0?!0:!!(d(m)&&m.length===0)}function f(m){var y=n({},m);return y._parent=m,y}function l(m,y){return m.path=y,m}function g(m,y){return(m?m+\".\":\"\")+y}})),Et=fe(((e,t)=>{e.__esModule=!0;var s=[\"description\",\"fileName\",\"lineNumber\",\"endLineNumber\",\"message\",\"name\",\"number\",\"stack\"];function r(i,n){var o=n&&n.loc,c=void 0,d=void 0,h=void 0,p=void 0;o&&o.start&&(c=o.start.line,h=o.start.column,o.end&&(d=o.end.line,p=o.end.column),i+=\" - \"+c+\":\"+h);for(var a=Error.prototype.constructor.call(this,i),f=0;f<s.length;f++)this[s[f]]=a[s[f]];Error.captureStackTrace&&Error.captureStackTrace(this,r);try{o&&(this.lineNumber=c,this.endLineNumber=d,Object.defineProperty?(Object.defineProperty(this,\"column\",{value:h,enumerable:!0}),Object.defineProperty(this,\"endColumn\",{value:p,enumerable:!0})):(this.column=h,this.endColumn=p))}catch{}}r.prototype=new Error,e.default=r,t.exports=e.default})),ec=fe(((e,t)=>{e.__esModule=!0;var s=lt();e.default=function(r){r.registerHelper(\"blockHelperMissing\",function(i,n){var o=n.inverse,c=n.fn;if(i===!0)return c(this);if(i===!1||i==null)return o(this);if(s.isArray(i))return i.length>0?(n.ids&&(n.ids=[n.name]),r.helpers.each(i,n)):o(this);if(n.data&&n.ids){var d=s.createFrame(n.data);d.contextPath=s.appendContextPath(n.data.contextPath,n.name),n={data:d}}return c(i,n)})},t.exports=e.default})),tc=fe(((e,t)=>{e.__esModule=!0;function s(o){return o&&o.__esModule?o:{default:o}}var r=lt(),i=s(Et());function n(o){try{var c=o.return;r.isFunction(c)&&c.call(o)}catch{}}e.default=function(o){o.registerHelper(\"each\",function(c,d){if(!d)throw new i.default(\"Must pass iterator to #each\");var h=d.fn,p=d.inverse,a=0,f=\"\",l=void 0,g=void 0;d.data&&d.ids&&(g=r.appendContextPath(d.data.contextPath,d.ids[0])+\".\"),r.isFunction(c)&&(c=c.call(this)),d.data&&(l=r.createFrame(d.data));function m(u,v,_,w){l&&(l.key=u,l.index=v,l.first=v===0,l.last=!!_,g&&(l.contextPath=g+u)),f=f+h(w,{data:l,blockParams:r.blockParams([w,u],[g+u,null])})}if(c&&typeof c==\"object\")if(r.isArray(c))for(var y=c.length;a<y;a++)a in c&&m(a,a,a===c.length-1,c[a]);else if(typeof Symbol==\"function\"&&c[Symbol.iterator])for(var S=c[Symbol.iterator](),k=S.next();!k.done;){var b=S.next();try{m(a,a,b.done,k.value)}catch(u){throw b.done||n(S),u}k=b,a++}else(function(){var u=void 0;Object.keys(c).forEach(function(v){u!==void 0&&m(u,a-1,!1,c[u]),u=v,a++}),u!==void 0&&m(u,a-1,!0,c[u])})();return a===0&&(f=p(this)),f})},t.exports=e.default})),sc=fe(((e,t)=>{e.__esModule=!0;function s(i){return i&&i.__esModule?i:{default:i}}var r=s(Et());e.default=function(i){i.registerHelper(\"helperMissing\",function(){if(arguments.length!==1)throw new r.default('Missing helper: \"'+arguments[arguments.length-1].name+'\"')})},t.exports=e.default})),rc=fe(((e,t)=>{e.__esModule=!0;function s(n){return n&&n.__esModule?n:{default:n}}var r=lt(),i=s(Et());e.default=function(n){n.registerHelper(\"if\",function(o,c){if(arguments.length!=2)throw new i.default(\"#if requires exactly one argument\");return r.isFunction(o)&&(o=o.call(this)),!c.hash.includeZero&&!o||r.isEmpty(o)?c.inverse(this):c.fn(this)}),n.registerHelper(\"unless\",function(o,c){if(arguments.length!=2)throw new i.default(\"#unless requires exactly one argument\");return n.helpers.if.call(this,o,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},t.exports=e.default})),ic=fe(((e,t)=>{e.__esModule=!0,e.default=function(s){s.registerHelper(\"log\",function(){for(var r=[void 0],i=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)r.push(arguments[n]);var o=1;i.hash.level!=null?o=i.hash.level:i.data&&i.data.level!=null&&(o=i.data.level),r[0]=o,s.log.apply(s,r)})},t.exports=e.default})),nc=fe(((e,t)=>{e.__esModule=!0,e.default=function(s){s.registerHelper(\"lookup\",function(r,i,n){return r&&n.lookupProperty(r,i)})},t.exports=e.default})),oc=fe(((e,t)=>{e.__esModule=!0;function s(n){return n&&n.__esModule?n:{default:n}}var r=lt(),i=s(Et());e.default=function(n){n.registerHelper(\"with\",function(o,c){if(arguments.length!=2)throw new i.default(\"#with requires exactly one argument\");r.isFunction(o)&&(o=o.call(this));var d=c.fn;if(r.isEmpty(o))return c.inverse(this);var h=c.data;return c.data&&c.ids&&(h=r.createFrame(c.data),h.contextPath=r.appendContextPath(c.data.contextPath,c.ids[0])),d(o,{data:h,blockParams:r.blockParams([o],[h&&h.contextPath])})})},t.exports=e.default})),Mn=fe((e=>{e.__esModule=!0,e.registerDefaultHelpers=h,e.moveHelperToHooks=p;function t(a){return a&&a.__esModule?a:{default:a}}var s=t(ec()),r=t(tc()),i=t(sc()),n=t(rc()),o=t(ic()),c=t(nc()),d=t(oc());function h(a){s.default(a),r.default(a),i.default(a),n.default(a),o.default(a),c.default(a),d.default(a)}function p(a,f,l){a.helpers[f]&&(a.hooks[f]=a.helpers[f],l||(a.helpers[f]=void 0))}})),ac=fe(((e,t)=>{e.__esModule=!0;var s=lt();e.default=function(r){r.registerDecorator(\"inline\",function(i,n,o,c){var d=i;return n.partials||(n.partials={},d=function(h,p){var a=o.partials;o.partials=s.extend({},a,n.partials);var f=i(h,p);return o.partials=a,f}),n.partials[c.args[0]]=c.fn,d})},t.exports=e.default})),lc=fe((e=>{e.__esModule=!0,e.registerDefaultDecorators=r;function t(i){return i&&i.__esModule?i:{default:i}}var s=t(ac());function r(i){s.default(i)}})),On=fe(((e,t)=>{e.__esModule=!0;var s=lt(),r={methodMap:[\"debug\",\"info\",\"warn\",\"error\"],level:\"info\",lookupLevel:function(n){if(typeof n==\"string\"){var o=s.indexOf(r.methodMap,n.toLowerCase());o>=0?n=o:n=parseInt(n,10)}return n},log:function(n){if(n=r.lookupLevel(n),typeof console<\"u\"&&r.lookupLevel(r.level)<=n){var o=r.methodMap[n];console[o]||(o=\"log\");for(var c=arguments.length,d=Array(c>1?c-1:0),h=1;h<c;h++)d[h-1]=arguments[h];console[o].apply(console,d)}}};e.default=r,t.exports=e.default})),Nn=fe((e=>{e.__esModule=!0,e.createProtoAccessControl=n,e.resultIsAllowed=o,e.isPrototypeConstructor=c,e.resetLoggedProperties=p;function t(a){return a&&a.__esModule?a:{default:a}}var s=lt(),r=t(On()),i=Object.create(null);function n(a){var f=Object.create(null);f.__proto__=!1,s.extend(f,a.allowedProtoProperties);var l=Object.create(null);return l.constructor=!1,l.__defineGetter__=!1,l.__defineSetter__=!1,l.__lookupGetter__=!1,l.__lookupSetter__=!1,s.extend(l,a.allowedProtoMethods),{properties:{whitelist:f,defaultValue:a.allowProtoPropertiesByDefault},methods:{whitelist:l,defaultValue:a.allowProtoMethodsByDefault}}}function o(a,f,l){return d(typeof a==\"function\"?f.methods:f.properties,l)}function c(a,f,l){return f===\"constructor\"&&typeof l==\"function\"&&a===l.prototype}function d(a,f){return a.whitelist[f]!==void 0?a.whitelist[f]===!0:a.defaultValue!==void 0?a.defaultValue:(h(f),!1)}function h(a){i[a]!==!0&&(i[a]=!0,r.default.log(\"error\",'Handlebars: Access has been denied to resolve the property \"'+a+`\" because it is not an \"own property\" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function p(){Object.keys(i).forEach(function(a){delete i[a]})}})),mi=fe((e=>{e.__esModule=!0,e.HandlebarsEnvironment=l;function t(m){return m&&m.__esModule?m:{default:m}}var s=lt(),r=t(Et()),i=Mn(),n=lc(),o=t(On()),c=Nn(),d=\"4.7.10\";e.VERSION=d;var h=8;e.COMPILER_REVISION=h;var p=7;e.LAST_COMPATIBLE_COMPILER_REVISION=p;var a={1:\"<= 1.0.rc.2\",2:\"== 1.0.0-rc.3\",3:\"== 1.0.0-rc.4\",4:\"== 1.x.x\",5:\"== 2.0.0-alpha.x\",6:\">= 2.0.0-beta.1\",7:\">= 4.0.0 <4.3.0\",8:\">= 4.3.0\"};e.REVISION_CHANGES=a;var f=\"[object Object]\";function l(m,y,S){this.helpers=m||{},this.partials=y||{},this.decorators=S||{},i.registerDefaultHelpers(this),n.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:o.default,log:o.default.log,registerHelper:function(y,S){if(s.toString.call(y)===f){if(S)throw new r.default(\"Arg not supported with multiple helpers\");s.extend(this.helpers,y)}else this.helpers[y]=S},unregisterHelper:function(y){delete this.helpers[y]},registerPartial:function(y,S){if(s.toString.call(y)===f)s.extend(this.partials,y);else{if(typeof S>\"u\")throw new r.default('Attempting to register a partial called \"'+y+'\" as undefined');this.partials[y]=S}},unregisterPartial:function(y){delete this.partials[y]},registerDecorator:function(y,S){if(s.toString.call(y)===f){if(S)throw new r.default(\"Arg not supported with multiple decorators\");s.extend(this.decorators,y)}else this.decorators[y]=S},unregisterDecorator:function(y){delete this.decorators[y]},resetLoggedPropertyAccesses:function(){c.resetLoggedProperties()}};var g=o.default.log;e.log=g,e.createFrame=s.createFrame,e.logger=o.default})),cc=fe(((e,t)=>{e.__esModule=!0;function s(r){this.string=r}s.prototype.toString=s.prototype.toHTML=function(){return\"\"+this.string},e.default=s,t.exports=e.default})),uc=fe((e=>{e.__esModule=!0,e.wrapHelper=t;function t(s,r){return typeof s!=\"function\"?s:function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=r(n),s.apply(this,arguments)}}})),hc=fe((e=>{e.__esModule=!0,e.checkRevision=h,e.template=p,e.wrapProgram=a,e.resolvePartial=f,e.invokePartial=l,e.noop=g;function t(u){return u&&u.__esModule?u:{default:u}}function s(u){if(u&&u.__esModule)return u;var v={};if(u!=null)for(var _ in u)Object.prototype.hasOwnProperty.call(u,_)&&(v[_]=u[_]);return v.default=u,v}var r=s(lt()),i=t(Et()),n=mi(),o=Mn(),c=uc(),d=Nn();function h(u){var v=u&&u[0]||1,_=n.COMPILER_REVISION;if(!(v>=n.LAST_COMPATIBLE_COMPILER_REVISION&&v<=n.COMPILER_REVISION))if(v<n.LAST_COMPATIBLE_COMPILER_REVISION){var w=n.REVISION_CHANGES[_],T=n.REVISION_CHANGES[v];throw new i.default(\"Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (\"+w+\") or downgrade your runtime to an older version (\"+T+\").\")}else throw new i.default(\"Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (\"+u[1]+\").\")}function p(u,v){if(!v)throw new i.default(\"No environment passed to template\");if(!u||!u.main)throw new i.default(\"Unknown template object: \"+typeof u);u.main.decorator=u.main_d,v.VM.checkRevision(u.compiler);var _=u.compiler&&u.compiler[0]===7;function w(C,P,E){E.hash&&(P=r.extend({},P,E.hash),E.ids&&(E.ids[0]=!0)),C=v.VM.resolvePartial.call(this,C,P,E),E.hooks=this.hooks,E.protoAccessControl=this.protoAccessControl;var N=v.VM.invokePartial.call(this,C,P,E);if(N==null&&r.isFunction(C))throw new i.default(\"The partial \"+E.name+\" returned no output: partials must return a string\");if(N==null&&v.compile){if(typeof C!=\"string\")throw new i.default(\"The partial \"+E.name+\" could not be compiled: partials must be strings or functions returning strings\");E.partials[E.name]=v.compile(C,u.compilerOptions,v),N=E.partials[E.name](P,E)}if(N!=null){if(E.indent){for(var D=N.split(`\n`),q=0,L=D.length;q<L&&!(!D[q]&&q+1===L);q++)D[q]=E.indent+D[q];N=D.join(`\n`)}return N}else throw new i.default(\"The partial \"+E.name+\" could not be compiled when running in runtime-only mode\")}var T={strict:function(P,E,N){if(!P||!(E in P))throw new i.default('\"'+E+'\" not defined in '+P,{loc:N});return T.lookupProperty(P,E)},lookupProperty:function(P,E){var N=P[E];if(N==null||Object.prototype.hasOwnProperty.call(P,E)&&!d.isPrototypeConstructor(P,E,N)||d.resultIsAllowed(N,T.protoAccessControl,E))return N},lookup:function(P,E){for(var N=P.length,D=0;D<N;D++){var q=P[D]&&T.lookupProperty(P[D],E);if(q!=null)return q}},lambda:function(P,E){return typeof P==\"function\"?P.call(E):P},escapeExpression:r.escapeExpression,invokePartial:w,fn:function(P){var E=u[P];return E.decorator=u[P+\"_d\"],E},programs:[],program:function(P,E,N,D,q){var L=this.programs[P],B=this.fn(P);return E||q||D||N?L=a(this,P,B,E,N,D,q):L||(L=this.programs[P]=a(this,P,B)),L},data:function(P,E){for(;P&&E--;)P=P._parent;return P},mergeIfNeeded:function(P,E){var N=P||E;return P&&E&&P!==E&&(N=r.extend({},E,P)),N},nullContext:Object.seal({}),noop:v.VM.noop,compilerInfo:u.compiler};function R(C){var P=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],E=P.data;R._setup(P),!P.partial&&u.useData&&(E=y(C,E));var N=void 0,D=u.useBlockParams?[]:void 0;u.useDepths&&(P.depths?N=C!=P.depths[0]?[C].concat(P.depths):P.depths:N=[C]);function q(L){return\"\"+u.main(T,L,T.helpers,T.partials,E,D,N)}return q=S(u.main,q,T,P.depths||[],E,D),q(C,P)}return R.isTop=!0,R._setup=function(C){if(C.partial)T.protoAccessControl=C.protoAccessControl,T.helpers=C.helpers,T.partials=C.partials,T.decorators=C.decorators,T.hooks=C.hooks;else{var P={};k(P,v.helpers,T),k(P,C.helpers,T),T.helpers=P,u.usePartial&&(T.partials=T.mergeIfNeeded(C.partials,v.partials)),(u.usePartial||u.useDecorators)&&(T.decorators=r.extend({},v.decorators,C.decorators)),T.hooks={},T.protoAccessControl=d.createProtoAccessControl(C);var E=C.allowCallsToHelperMissing||_;o.moveHelperToHooks(T,\"helperMissing\",E),o.moveHelperToHooks(T,\"blockHelperMissing\",E)}},R._child=function(C,P,E,N){if(u.useBlockParams&&!E)throw new i.default(\"must pass block params\");if(u.useDepths&&!N)throw new i.default(\"must pass parent depths\");return a(T,C,u[C],P,0,E,N)},R}function a(u,v,_,w,T,R,C){function P(E){var N=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],D=C;return C&&E!=C[0]&&!(E===u.nullContext&&C[0]===null)&&(D=[E].concat(C)),_(u,E,u.helpers,u.partials,N.data||w,R&&[N.blockParams].concat(R),D)}return P=S(_,P,u,C,w,R),P.program=v,P.depth=C?C.length:0,P.blockParams=T||0,P}function f(u,v,_){return u?typeof u!=\"function\"&&!_.name&&(_.name=u,u=m(_.partials,u)):_.name===\"@partial-block\"?u=m(_.data,\"partial-block\"):u=m(_.partials,_.name),u}function l(u,v,_){var w=m(_.data,\"partial-block\");_.partial=!0,_.ids&&(_.data.contextPath=_.ids[0]||_.data.contextPath);var T=void 0;if(_.fn&&_.fn!==g&&(function(){_.data=n.createFrame(_.data);var R=_.fn;T=_.data[\"partial-block\"]=function(P){var E=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return E.data=n.createFrame(E.data),E.data[\"partial-block\"]=w,R(P,E)},R.partials&&(_.partials=r.extend({},_.partials,R.partials))})(),u===void 0&&T&&(u=T),u===void 0)throw new i.default(\"The partial \"+_.name+\" could not be found\");if(u instanceof Function)return u(v,_)}function g(){return\"\"}function m(u,v){if(u&&Object.prototype.hasOwnProperty.call(u,v))return u[v]}function y(u,v){return(!v||!(\"root\"in v))&&(v=v?n.createFrame(v):{},v.root=u),v}function S(u,v,_,w,T,R){if(u.decorator){var C={};v=u.decorator(v,C,_,w&&w[0],T,R,w),r.extend(v,C)}return v}function k(u,v,_){v&&Object.keys(v).forEach(function(w){var T=v[w];u[w]=b(T,_)})}function b(u,v){var _=v.lookupProperty;return c.wrapHelper(u,function(w){return w.lookupProperty=_,w})}})),Dn=fe(((e,t)=>{e.__esModule=!0,e.default=function(s){(function(){typeof globalThis!=\"object\"&&(Object.prototype.__defineGetter__(\"__magic__\",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var r=globalThis.Handlebars;s.noConflict=function(){return globalThis.Handlebars===s&&(globalThis.Handlebars=r),s}},t.exports=e.default})),dc=fe(((e,t)=>{e.__esModule=!0;function s(f){return f&&f.__esModule?f:{default:f}}function r(f){if(f&&f.__esModule)return f;var l={};if(f!=null)for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(l[g]=f[g]);return l.default=f,l}var i=r(mi()),n=s(cc()),o=s(Et()),c=r(lt()),d=r(hc()),h=s(Dn());function p(){var f=new i.HandlebarsEnvironment;return c.extend(f,i),f.SafeString=n.default,f.Exception=o.default,f.Utils=c,f.escapeExpression=c.escapeExpression,f.VM=d,f.template=function(l){return d.template(l,f)},f}var a=p();a.create=p,h.default(a),a.default=a,e.default=a,t.exports=e.default})),Bn=fe(((e,t)=>{e.__esModule=!0;var s={helpers:{helperExpression:function(i){return i.type===\"SubExpression\"||(i.type===\"MustacheStatement\"||i.type===\"BlockStatement\")&&!!(i.params&&i.params.length||i.hash)},scopedId:function(i){return/^\\.|this\\b/.test(i.original)},simpleId:function(i){return i.parts.length===1&&!s.helpers.scopedId(i)&&!i.depth}}};e.default=s,t.exports=e.default})),fc=fe(((e,t)=>{e.__esModule=!0;var s=(function(){var r={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:\"error\",5:\"EOF\",14:\"COMMENT\",15:\"CONTENT\",18:\"END_RAW_BLOCK\",19:\"OPEN_RAW_BLOCK\",23:\"CLOSE_RAW_BLOCK\",29:\"OPEN_BLOCK\",33:\"CLOSE\",34:\"OPEN_INVERSE\",39:\"OPEN_INVERSE_CHAIN\",44:\"INVERSE\",47:\"OPEN_ENDBLOCK\",48:\"OPEN\",51:\"OPEN_UNESCAPED\",54:\"CLOSE_UNESCAPED\",55:\"OPEN_PARTIAL\",60:\"OPEN_PARTIAL_BLOCK\",65:\"OPEN_SEXPR\",68:\"CLOSE_SEXPR\",72:\"ID\",73:\"EQUALS\",75:\"OPEN_BLOCK_PARAMS\",77:\"CLOSE_BLOCK_PARAMS\",80:\"STRING\",81:\"NUMBER\",82:\"BOOLEAN\",83:\"UNDEFINED\",84:\"NULL\",85:\"DATA\",87:\"SEP\"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(o,c,d,h,p,a,f){var l=a.length-1;switch(p){case 1:return a[l-1];case 2:this.$=h.prepareProgram(a[l]);break;case 3:this.$=a[l];break;case 4:this.$=a[l];break;case 5:this.$=a[l];break;case 6:this.$=a[l];break;case 7:this.$=a[l];break;case 8:this.$=a[l];break;case 9:this.$={type:\"CommentStatement\",value:h.stripComment(a[l]),strip:h.stripFlags(a[l],a[l]),loc:h.locInfo(this._$)};break;case 10:this.$={type:\"ContentStatement\",original:a[l],value:a[l],loc:h.locInfo(this._$)};break;case 11:this.$=h.prepareRawBlock(a[l-2],a[l-1],a[l],this._$);break;case 12:this.$={path:a[l-3],params:a[l-2],hash:a[l-1]};break;case 13:this.$=h.prepareBlock(a[l-3],a[l-2],a[l-1],a[l],!1,this._$);break;case 14:this.$=h.prepareBlock(a[l-3],a[l-2],a[l-1],a[l],!0,this._$);break;case 15:this.$={open:a[l-5],path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:h.stripFlags(a[l-5],a[l])};break;case 16:this.$={path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:h.stripFlags(a[l-5],a[l])};break;case 17:this.$={path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:h.stripFlags(a[l-5],a[l])};break;case 18:this.$={strip:h.stripFlags(a[l-1],a[l-1]),program:a[l]};break;case 19:var g=h.prepareBlock(a[l-2],a[l-1],a[l],a[l],!1,this._$),m=h.prepareProgram([g],a[l-1].loc);m.chained=!0,this.$={strip:a[l-2].strip,program:m,chain:!0};break;case 20:this.$=a[l];break;case 21:this.$={path:a[l-1],strip:h.stripFlags(a[l-2],a[l])};break;case 22:this.$=h.prepareMustache(a[l-3],a[l-2],a[l-1],a[l-4],h.stripFlags(a[l-4],a[l]),this._$);break;case 23:this.$=h.prepareMustache(a[l-3],a[l-2],a[l-1],a[l-4],h.stripFlags(a[l-4],a[l]),this._$);break;case 24:this.$={type:\"PartialStatement\",name:a[l-3],params:a[l-2],hash:a[l-1],indent:\"\",strip:h.stripFlags(a[l-4],a[l]),loc:h.locInfo(this._$)};break;case 25:this.$=h.preparePartialBlock(a[l-2],a[l-1],a[l],this._$);break;case 26:this.$={path:a[l-3],params:a[l-2],hash:a[l-1],strip:h.stripFlags(a[l-4],a[l])};break;case 27:this.$=a[l];break;case 28:this.$=a[l];break;case 29:this.$={type:\"SubExpression\",path:a[l-3],params:a[l-2],hash:a[l-1],loc:h.locInfo(this._$)};break;case 30:this.$={type:\"Hash\",pairs:a[l],loc:h.locInfo(this._$)};break;case 31:this.$={type:\"HashPair\",key:h.id(a[l-2]),value:a[l],loc:h.locInfo(this._$)};break;case 32:this.$=h.id(a[l-1]);break;case 33:this.$=a[l];break;case 34:this.$=a[l];break;case 35:this.$={type:\"StringLiteral\",value:a[l],original:a[l],loc:h.locInfo(this._$)};break;case 36:this.$={type:\"NumberLiteral\",value:Number(a[l]),original:Number(a[l]),loc:h.locInfo(this._$)};break;case 37:this.$={type:\"BooleanLiteral\",value:a[l]===\"true\",original:a[l]===\"true\",loc:h.locInfo(this._$)};break;case 38:this.$={type:\"UndefinedLiteral\",original:void 0,value:void 0,loc:h.locInfo(this._$)};break;case 39:this.$={type:\"NullLiteral\",original:null,value:null,loc:h.locInfo(this._$)};break;case 40:this.$=a[l];break;case 41:this.$=a[l];break;case 42:this.$=h.preparePath(!0,a[l],this._$);break;case 43:this.$=h.preparePath(!1,a[l],this._$);break;case 44:a[l-2].push({part:h.id(a[l]),original:a[l],separator:a[l-1]}),this.$=a[l-2];break;case 45:this.$=[{part:h.id(a[l]),original:a[l]}];break;case 46:this.$=[];break;case 47:a[l-1].push(a[l]);break;case 48:this.$=[];break;case 49:a[l-1].push(a[l]);break;case 50:this.$=[];break;case 51:a[l-1].push(a[l]);break;case 58:this.$=[];break;case 59:a[l-1].push(a[l]);break;case 64:this.$=[];break;case 65:a[l-1].push(a[l]);break;case 70:this.$=[];break;case 71:a[l-1].push(a[l]);break;case 78:this.$=[];break;case 79:a[l-1].push(a[l]);break;case 82:this.$=[];break;case 83:a[l-1].push(a[l]);break;case 86:this.$=[];break;case 87:a[l-1].push(a[l]);break;case 90:this.$=[];break;case 91:a[l-1].push(a[l]);break;case 94:this.$=[];break;case 95:a[l-1].push(a[l]);break;case 98:this.$=[a[l]];break;case 99:a[l-1].push(a[l]);break;case 100:this.$=[a[l]];break;case 101:a[l-1].push(a[l])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(o,c){throw new Error(o)},parse:function(o){var c=this,d=[0],h=[null],p=[],a=this.table,f=\"\",l=0,g=0,m=0;this.lexer.setInput(o),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>\"u\"&&(this.lexer.yylloc={});var y=this.lexer.yylloc;p.push(y);var S=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError==\"function\"&&(this.parseError=this.yy.parseError);function k(){var D=c.lexer.lex()||1;return typeof D!=\"number\"&&(D=c.symbols_[D]||D),D}for(var b,u,v,_,w,T={},R,C,P,E;;){if(v=d[d.length-1],this.defaultActions[v]?_=this.defaultActions[v]:((b===null||typeof b>\"u\")&&(b=k()),_=a[v]&&a[v][b]),typeof _>\"u\"||!_.length||!_[0]){var N=\"\";if(!m){E=[];for(R in a[v])this.terminals_[R]&&R>2&&E.push(\"'\"+this.terminals_[R]+\"'\");this.lexer.showPosition?N=\"Parse error on line \"+(l+1)+`:\n`+this.lexer.showPosition()+`\nExpecting `+E.join(\", \")+\", got '\"+(this.terminals_[b]||b)+\"'\":N=\"Parse error on line \"+(l+1)+\": Unexpected \"+(b==1?\"end of input\":\"'\"+(this.terminals_[b]||b)+\"'\"),this.parseError(N,{text:this.lexer.match,token:this.terminals_[b]||b,line:this.lexer.yylineno,loc:y,expected:E})}}if(_[0]instanceof Array&&_.length>1)throw new Error(\"Parse Error: multiple actions possible at state: \"+v+\", token: \"+b);switch(_[0]){case 1:d.push(b),h.push(this.lexer.yytext),p.push(this.lexer.yylloc),d.push(_[1]),b=null,u?(b=u,u=null):(g=this.lexer.yyleng,f=this.lexer.yytext,l=this.lexer.yylineno,y=this.lexer.yylloc,m>0&&m--);break;case 2:if(C=this.productions_[_[1]][1],T.$=h[h.length-C],T._$={first_line:p[p.length-(C||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(C||1)].first_column,last_column:p[p.length-1].last_column},S&&(T._$.range=[p[p.length-(C||1)].range[0],p[p.length-1].range[1]]),w=this.performAction.call(T,f,g,l,this.yy,_[1],h,p),typeof w<\"u\")return w;C&&(d=d.slice(0,-1*C*2),h=h.slice(0,-1*C),p=p.slice(0,-1*C)),d.push(this.productions_[_[1]][0]),h.push(T.$),p.push(T._$),P=a[d[d.length-2]][d[d.length-1]],d.push(P);break;case 3:return!0}}return!0}};r.lexer=(function(){var n={EOF:1,parseError:function(c,d){if(this.yy.parser)this.yy.parser.parseError(c,d);else throw new Error(c)},setInput:function(c){return this._input=c,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=\"\",this.conditionStack=[\"INITIAL\"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var c=this._input[0];return this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c,c.match(/(?:\\r\\n?|\\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},unput:function(c){var d=c.length,h=c.split(/(?:\\r\\n?|\\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d-1),this.offset-=d;var p=this.match.split(/(?:\\r\\n?|\\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===p.length?this.yylloc.first_column:0)+p[p.length-h.length].length-h[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-d]),this},more:function(){return this._more=!0,this},less:function(c){this.unput(this.match.slice(c))},pastInput:function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?\"...\":\"\")+c.substr(-20).replace(/\\n/g,\"\")},upcomingInput:function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?\"...\":\"\")).replace(/\\n/g,\"\")},showPosition:function(){var c=this.pastInput(),d=new Array(c.length+1).join(\"-\");return c+this.upcomingInput()+`\n`+d+\"^\"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,d,h,p,a;this._more||(this.yytext=\"\",this.match=\"\");for(var f=this._currentRules(),l=0;l<f.length&&(h=this._input.match(this.rules[f[l]]),!(h&&(!d||h[0].length>d[0].length)&&(d=h,p=l,!this.options.flex)));l++);return d?(a=d[0].match(/(?:\\r\\n?|\\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\\r?\\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(d[0].length),this.matched+=d[0],c=this.performAction.call(this,this.yy,this,f[p],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c||void 0):this._input===\"\"?this.EOF:this.parseError(\"Lexical error on line \"+(this.yylineno+1)+`. Unrecognized text.\n`+this.showPosition(),{text:\"\",token:null,line:this.yylineno})},lex:function(){var c=this.next();return typeof c<\"u\"?c:this.lex()},begin:function(c){this.conditionStack.push(c)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(c){this.begin(c)}};return n.options={},n.performAction=function(c,d,h,p){function a(f,l){return d.yytext=d.yytext.substring(f,d.yyleng-l+f)}switch(h){case 0:if(d.yytext.slice(-2)===\"\\\\\\\\\"?(a(0,1),this.begin(\"mu\")):d.yytext.slice(-1)===\"\\\\\"?(a(0,1),this.begin(\"emu\")):this.begin(\"mu\"),d.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin(\"raw\"),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]===\"raw\"?15:(a(5,9),\"END_RAW_BLOCK\");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin(\"raw\"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(d.yytext),this.popState(),this.begin(\"com\");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return d.yytext=a(1,2).replace(/\\\\\"/g,'\"'),80;case 32:return d.yytext=a(1,2).replace(/\\\\'/g,\"'\"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return d.yytext=d.yytext.replace(/\\\\([\\\\\\]])/g,\"$1\"),72;case 43:return\"INVALID\";case 44:return 5}},n.rules=[/^(?:[^\\x00]*?(?=(\\{\\{)))/,/^(?:[^\\x00]+)/,/^(?:[^\\x00]{2,}?(?=(\\{\\{|\\\\\\{\\{|\\\\\\\\\\{\\{|$)))/,/^(?:\\{\\{\\{\\{(?=[^\\/]))/,/^(?:\\{\\{\\{\\{\\/[^\\s!\"#%-,\\.\\/;->@\\[-\\^`\\{-~]+(?=[=}\\s\\/.])\\}\\}\\}\\})/,/^(?:[^\\x00]+?(?=(\\{\\{\\{\\{)))/,/^(?:[\\s\\S]*?--(~)?\\}\\})/,/^(?:\\()/,/^(?:\\))/,/^(?:\\{\\{\\{\\{)/,/^(?:\\}\\}\\}\\})/,/^(?:\\{\\{(~)?>)/,/^(?:\\{\\{(~)?#>)/,/^(?:\\{\\{(~)?#\\*?)/,/^(?:\\{\\{(~)?\\/)/,/^(?:\\{\\{(~)?\\^\\s*(~)?\\}\\})/,/^(?:\\{\\{(~)?\\s*else\\s*(~)?\\}\\})/,/^(?:\\{\\{(~)?\\^)/,/^(?:\\{\\{(~)?\\s*else\\b)/,/^(?:\\{\\{(~)?\\{)/,/^(?:\\{\\{(~)?&)/,/^(?:\\{\\{(~)?!--)/,/^(?:\\{\\{(~)?![\\s\\S]*?\\}\\})/,/^(?:\\{\\{(~)?\\*?)/,/^(?:=)/,/^(?:\\.\\.)/,/^(?:\\.(?=([=~}\\s\\/.)|])))/,/^(?:[\\/.])/,/^(?:\\s+)/,/^(?:\\}(~)?\\}\\})/,/^(?:(~)?\\}\\})/,/^(?:\"(\\\\[\"]|[^\"])*\")/,/^(?:'(\\\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\\s)])))/,/^(?:false(?=([~}\\s)])))/,/^(?:undefined(?=([~}\\s)])))/,/^(?:null(?=([~}\\s)])))/,/^(?:-?[0-9]+(?:\\.[0-9]+)?(?=([~}\\s)])))/,/^(?:as\\s+\\|)/,/^(?:\\|)/,/^(?:([^\\s!\"#%-,\\.\\/;->@\\[-\\^`\\{-~]+(?=([=~}\\s\\/.)|]))))/,/^(?:\\[(\\\\\\]|[^\\]])*\\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n})();function i(){this.yy={}}return i.prototype=r,r.Parser=i,new i})();e.default=s,t.exports=e.default})),$n=fe((e=>{e.__esModule=!0;var t=[\"Program\",\"BlockStatement\",\"DecoratorBlock\",\"PartialStatement\",\"PartialBlockStatement\",\"Decorator\",\"MustacheStatement\",\"ContentStatement\",\"CommentStatement\",\"SubExpression\",\"PathExpression\",\"StringLiteral\",\"NumberLiteral\",\"BooleanLiteral\",\"UndefinedLiteral\",\"NullLiteral\",\"Hash\",\"HashPair\"];e.NODE_TYPES=t})),Hn=fe(((e,t)=>{e.__esModule=!0;function s(a){return a&&a.__esModule?a:{default:a}}var r=s(Et()),i=lt(),n=$n();function o(){this.parents=[]}function c(a,f){return i.indexOf(n.NODE_TYPES,f)!==-1||!(f in o.prototype)&&typeof a[f]==\"function\"}o.prototype={constructor:o,mutating:!1,acceptKey:function(f,l){var g=this.accept(f[l]);if(this.mutating){if(g&&!c(this,g.type))throw new r.default('Unexpected node type \"'+g.type+'\" found when accepting '+l+\" on \"+f.type);f[l]=g}},acceptRequired:function(f,l){if(this.acceptKey(f,l),!f[l])throw new r.default(f.type+\" requires \"+l)},acceptArray:function(f){for(var l=0,g=f.length;l<g;l++)this.acceptKey(f,l),f[l]||(f.splice(l,1),l--,g--)},accept:function(f){if(f){if(!c(this,f.type)||!this[f.type])throw new r.default(\"Unknown type: \"+f.type,f);this.current&&this.parents.unshift(this.current),this.current=f;var l=this[f.type](f);if(this.current=this.parents.shift(),!this.mutating||l)return l;if(l!==!1)return f}},Program:function(f){this.acceptArray(f.body)},MustacheStatement:d,Decorator:d,BlockStatement:h,DecoratorBlock:h,PartialStatement:p,PartialBlockStatement:function(f){p.call(this,f),this.acceptKey(f,\"program\")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:d,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(f){this.acceptArray(f.pairs)},HashPair:function(f){this.acceptRequired(f,\"value\")}};function d(a){this.acceptRequired(a,\"path\"),this.acceptArray(a.params),this.acceptKey(a,\"hash\")}function h(a){d.call(this,a),this.acceptKey(a,\"program\"),this.acceptKey(a,\"inverse\")}function p(a){this.acceptRequired(a,\"name\"),this.acceptArray(a.params),this.acceptKey(a,\"hash\")}e.default=o,t.exports=e.default})),pc=fe(((e,t)=>{e.__esModule=!0;function s(h){return h&&h.__esModule?h:{default:h}}var r=s(Hn());function i(){var h=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=h}i.prototype=new r.default,i.prototype.Program=function(h){var p=!this.options.ignoreStandalone,a=!this.isRootSeen;this.isRootSeen=!0;for(var f=h.body,l=0,g=f.length;l<g;l++){var m=f[l],y=this.accept(m);if(y){var S=n(f,l,a),k=o(f,l,a),b=y.openStandalone&&S,u=y.closeStandalone&&k,v=y.inlineStandalone&&S&&k;y.close&&c(f,l,!0),y.open&&d(f,l,!0),p&&v&&(c(f,l),d(f,l)&&m.type===\"PartialStatement\"&&(m.indent=/(?:^|[^ \\t])([ \\t]+)$/.exec(f[l-1].original)[1])),p&&b&&(c((m.program||m.inverse).body),d(f,l)),p&&u&&(c(f,l),d((m.inverse||m.program).body))}}return h},i.prototype.BlockStatement=i.prototype.DecoratorBlock=i.prototype.PartialBlockStatement=function(h){this.accept(h.program),this.accept(h.inverse);var p=h.program||h.inverse,a=h.program&&h.inverse,f=a,l=a;if(a&&a.chained)for(f=a.body[0].program;l.chained;)l=l.body[l.body.length-1].program;var g={open:h.openStrip.open,close:h.closeStrip.close,openStandalone:o(p.body),closeStandalone:n((f||p).body)};if(h.openStrip.close&&c(p.body,null,!0),a){var m=h.inverseStrip;m.open&&d(p.body,null,!0),m.close&&c(f.body,null,!0),h.closeStrip.open&&d(l.body,null,!0),!this.options.ignoreStandalone&&n(p.body)&&o(f.body)&&(d(p.body),c(f.body))}else h.closeStrip.open&&d(p.body,null,!0);return g},i.prototype.Decorator=i.prototype.MustacheStatement=function(h){return h.strip},i.prototype.PartialStatement=i.prototype.CommentStatement=function(h){var p=h.strip||{};return{inlineStandalone:!0,open:p.open,close:p.close}};function n(h,p,a){p===void 0&&(p=h.length);var f=h[p-1],l=h[p-2];if(!f)return a;if(f.type===\"ContentStatement\")return(l||!a?/(?:^|\\S)[^\\S\\n]*\\n\\s*$/:/^\\s*$|(?:^|\\S)[^\\S\\n]*\\n\\s*$/).test(f.original)}function o(h,p,a){p===void 0&&(p=-1);var f=h[p+1],l=h[p+2];if(!f)return a;if(f.type===\"ContentStatement\")return(l||!a?/^\\s*?\\r?\\n/:/^\\s*?(\\r?\\n|$)/).test(f.original)}function c(h,p,a){var f=h[p==null?0:p+1];if(!(!f||f.type!==\"ContentStatement\"||!a&&f.rightStripped)){var l=f.value;f.value=f.value.replace(a?/^\\s+/:/^[ \\t]*\\r?\\n?/,\"\"),f.rightStripped=f.value!==l}}function d(h,p,a){var f=h[p==null?h.length-1:p-1];if(!(!f||f.type!==\"ContentStatement\"||!a&&f.leftStripped)){var l=f.value;return f.value=f.value.replace(a?/(^|\\S)\\s+$/:/(^|[^ \\t])[ \\t]+$/,\"$1\"),f.leftStripped=f.value!==l,f.leftStripped}}e.default=i,t.exports=e.default})),gc=fe((e=>{e.__esModule=!0,e.SourceLocation=i,e.id=n,e.stripFlags=o,e.stripComment=c,e.preparePath=d,e.prepareMustache=h,e.prepareRawBlock=p,e.prepareBlock=a,e.prepareProgram=f,e.preparePartialBlock=l;function t(g){return g&&g.__esModule?g:{default:g}}var s=t(Et());function r(g,m){if(m=m.path?m.path.original:m,g.path.original!==m){var y={loc:g.path.loc};throw new s.default(g.path.original+\" doesn't match \"+m,y)}}function i(g,m){this.source=g,this.start={line:m.first_line,column:m.first_column},this.end={line:m.last_line,column:m.last_column}}function n(g){return/^\\[.*\\]$/.test(g)?g.substring(1,g.length-1):g}function o(g,m){return{open:g.charAt(2)===\"~\",close:m.charAt(m.length-3)===\"~\"}}function c(g){return g.replace(/^\\{\\{~?!-?-?/,\"\").replace(/-?-?~?\\}\\}$/,\"\")}function d(g,m,y){y=this.locInfo(y);for(var S=g?\"@\":\"\",k=[],b=0,u=0,v=m.length;u<v;u++){var _=m[u].part,w=m[u].original!==_;if(S+=(m[u].separator||\"\")+_,!w&&(_===\"..\"||_===\".\"||_===\"this\")){if(k.length>0)throw new s.default(\"Invalid path: \"+S,{loc:y});_===\"..\"&&b++}else k.push(_)}return{type:\"PathExpression\",data:g,depth:b,parts:k,original:S,loc:y}}function h(g,m,y,S,k,b){var u=S.charAt(3)||S.charAt(2),v=u!==\"{\"&&u!==\"&\";return{type:/\\*/.test(S)?\"Decorator\":\"MustacheStatement\",path:g,params:m,hash:y,escaped:v,strip:k,loc:this.locInfo(b)}}function p(g,m,y,S){r(g,y),S=this.locInfo(S);var k={type:\"Program\",body:m,strip:{},loc:S};return{type:\"BlockStatement\",path:g.path,params:g.params,hash:g.hash,program:k,openStrip:{},inverseStrip:{},closeStrip:{},loc:S}}function a(g,m,y,S,k,b){S&&S.path&&r(g,S);var u=/\\*/.test(g.open);m.blockParams=g.blockParams;var v=void 0,_=void 0;if(y){if(u)throw new s.default(\"Unexpected inverse block on decorator\",y);y.chain&&(y.program.body[0].closeStrip=S.strip),_=y.strip,v=y.program}return k&&(k=v,v=m,m=k),{type:u?\"DecoratorBlock\":\"BlockStatement\",path:g.path,params:g.params,hash:g.hash,program:m,inverse:v,openStrip:g.strip,inverseStrip:_,closeStrip:S&&S.strip,loc:this.locInfo(b)}}function f(g,m){if(!m&&g.length){var y=g[0].loc,S=g[g.length-1].loc;y&&S&&(m={source:y.source,start:{line:y.start.line,column:y.start.column},end:{line:S.end.line,column:S.end.column}})}return{type:\"Program\",body:g,strip:{},loc:m}}function l(g,m,y,S){return r(g,y),{type:\"PartialBlockStatement\",name:g.path,params:g.params,hash:g.hash,program:m,openStrip:g.strip,closeStrip:y&&y.strip,loc:this.locInfo(S)}}})),mc=fe((e=>{e.__esModule=!0,e.parseWithoutProcessing=d,e.parse=h;function t(p){if(p&&p.__esModule)return p;var a={};if(p!=null)for(var f in p)Object.prototype.hasOwnProperty.call(p,f)&&(a[f]=p[f]);return a.default=p,a}function s(p){return p&&p.__esModule?p:{default:p}}var r=s(fc()),i=s(pc()),n=t(gc()),o=lt();e.parser=r.default;var c={};o.extend(c,n);function d(p,a){return p.type===\"Program\"?p:(r.default.yy=c,c.locInfo=function(f){return new c.SourceLocation(a&&a.srcName,f)},r.default.parse(p))}function h(p,a){var f=d(p,a);return new i.default(a).accept(f)}})),vc=fe((e=>{e.__esModule=!0,e.Compiler=c,e.precompile=d,e.compile=h;function t(k){return k&&k.__esModule?k:{default:k}}var s=t(Et()),r=lt(),i=t(Bn()),n=$n(),o=[].slice;function c(){}c.prototype={compiler:c,equals:function(b){var u=this.opcodes.length;if(b.opcodes.length!==u)return!1;for(var v=0;v<u;v++){var _=this.opcodes[v],w=b.opcodes[v];if(_.opcode!==w.opcode||!y(_.args,w.args))return!1}u=this.children.length;for(var v=0;v<u;v++)if(!this.children[v].equals(b.children[v]))return!1;return!0},guid:0,compile:function(b,u){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=u,this.stringParams=u.stringParams,this.trackIds=u.trackIds,u.blockParams=u.blockParams||[],u.knownHelpers=r.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},u.knownHelpers),this.accept(b)},compileProgram:function(b){var u=new this.compiler().compile(b,this.options),v=this.guid++;return this.usePartial=this.usePartial||u.usePartial,this.children[v]=u,this.useDepths=this.useDepths||u.useDepths,v},accept:function(b){if(r.indexOf(n.NODE_TYPES,b.type)===-1||!this[b.type])throw new s.default(\"Unknown type: \"+b.type,b);this.sourceNode.unshift(b);var u=this[b.type](b);return this.sourceNode.shift(),u},Program:function(b){m(b),this.options.blockParams.unshift(b.blockParams);for(var u=b.body,v=u.length,_=0;_<v;_++)this.accept(u[_]);return this.options.blockParams.shift(),this.isSimple=v===1,this.blockParams=b.blockParams?b.blockParams.length:0,this},BlockStatement:function(b){S(b);var u=b.program,v=b.inverse;u=u&&this.compileProgram(u),v=v&&this.compileProgram(v);var _=this.classifySexpr(b);_===\"helper\"?this.helperSexpr(b,u,v):_===\"simple\"?(this.simpleSexpr(b),this.opcode(\"pushProgram\",u),this.opcode(\"pushProgram\",v),this.opcode(\"emptyHash\"),this.opcode(\"blockValue\",b.path.original)):(this.ambiguousSexpr(b,u,v),this.opcode(\"pushProgram\",u),this.opcode(\"pushProgram\",v),this.opcode(\"emptyHash\"),this.opcode(\"ambiguousBlockValue\")),this.opcode(\"append\")},DecoratorBlock:function(b){var u=b.program&&this.compileProgram(b.program),v=this.setupFullMustacheParams(b,u,void 0),_=b.path;this.useDecorators=!0,this.opcode(\"registerDecorator\",v.length,_.original)},PartialStatement:function(b){this.usePartial=!0;var u=b.program;u&&(u=this.compileProgram(b.program));var v=b.params;if(v.length>1)throw new s.default(\"Unsupported number of partial arguments: \"+v.length,b);v.length||(this.options.explicitPartialContext?this.opcode(\"pushLiteral\",\"undefined\"):v.push({type:\"PathExpression\",parts:[],depth:0}));var _=b.name.original,w=b.name.type===\"SubExpression\";w&&this.accept(b.name),this.setupFullMustacheParams(b,u,void 0,!0);var T=b.indent||\"\";this.options.preventIndent&&T&&(this.opcode(\"appendContent\",T),T=\"\"),this.opcode(\"invokePartial\",w,_,T),this.opcode(\"append\")},PartialBlockStatement:function(b){this.PartialStatement(b)},MustacheStatement:function(b){this.SubExpression(b),b.escaped&&!this.options.noEscape?this.opcode(\"appendEscaped\"):this.opcode(\"append\")},Decorator:function(b){this.DecoratorBlock(b)},ContentStatement:function(b){if(b.value!=null&&typeof b.value!=\"string\")throw p(b,\"value must be a string\");b.value&&this.opcode(\"appendContent\",b.value)},CommentStatement:function(){},SubExpression:function(b){S(b);var u=this.classifySexpr(b);u===\"simple\"?this.simpleSexpr(b):u===\"helper\"?this.helperSexpr(b):this.ambiguousSexpr(b)},ambiguousSexpr:function(b,u,v){var _=b.path,w=_.parts[0],T=u!=null||v!=null;this.opcode(\"getContext\",a(_)),this.opcode(\"pushProgram\",u),this.opcode(\"pushProgram\",v),_.strict=!0,this.accept(_),this.opcode(\"invokeAmbiguous\",w,T)},simpleSexpr:function(b){var u=b.path;u.strict=!0,this.accept(u),this.opcode(\"resolvePossibleLambda\")},helperSexpr:function(b,u,v){var _=this.setupFullMustacheParams(b,u,v),w=b.path,T=w.parts[0];if(this.options.knownHelpers[T])this.opcode(\"invokeKnownHelper\",_.length,T);else{if(this.options.knownHelpersOnly)throw new s.default(\"You specified knownHelpersOnly, but used the unknown helper \"+T,b);w.strict=!0,w.falsy=!0,this.accept(w),this.opcode(\"invokeHelper\",_.length,w.original,i.default.helpers.simpleId(w))}},PathExpression:function(b){var u=a(b),v=g(b);this.addDepth(u),this.opcode(\"getContext\",u);var _=v[0],w=i.default.helpers.scopedId(b),T=!u&&!w&&this.blockParamIndex(_);T?this.opcode(\"lookupBlockParam\",T,v):_?b.data?(this.options.data=!0,this.opcode(\"lookupData\",u,v,b.strict)):this.opcode(\"lookupOnContext\",v,b.falsy,b.strict,w):this.opcode(\"pushContext\")},StringLiteral:function(b){f(b),this.opcode(\"pushString\",b.value)},NumberLiteral:function(b){f(b),this.opcode(\"pushLiteral\",b.value)},BooleanLiteral:function(b){f(b),this.opcode(\"pushLiteral\",b.value)},UndefinedLiteral:function(){this.opcode(\"pushLiteral\",\"undefined\")},NullLiteral:function(){this.opcode(\"pushLiteral\",\"null\")},Hash:function(b){var u=b.pairs,v=0,_=void 0;if(!r.isArray(u))throw p(b,\"pairs must be an array\");_=u.length;for(var w=0;w<_;w++)if(!u[w]||typeof u[w].key!=\"string\")throw p(b,\"pair keys must be strings\");for(this.opcode(\"pushHash\");v<_;v++)this.pushParam(u[v].value);for(;v--;)this.opcode(\"assignToHash\",u[v].key);this.opcode(\"popHash\")},opcode:function(b){this.opcodes.push({opcode:b,args:o.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(b){b&&(this.useDepths=!0)},classifySexpr:function(b){g(b.path);var u=i.default.helpers.simpleId(b.path),v=u&&!!this.blockParamIndex(b.path.parts[0]),_=!v&&i.default.helpers.helperExpression(b),w=!v&&(_||u);if(w&&!_){var T=b.path.parts[0],R=this.options;R.knownHelpers[T]?_=!0:R.knownHelpersOnly&&(w=!1)}return _?\"helper\":w?\"ambiguous\":\"simple\"},pushParams:function(b){for(var u=0,v=b.length;u<v;u++)this.pushParam(b[u])},pushParam:function(b){f(b);var u=b.value!=null?b.value:b.original||\"\",v=a(b);if(this.stringParams)typeof u!=\"number\"&&typeof u!=\"boolean\"&&(u=String(u)),u.replace&&(u=u.replace(/^(\\.?\\.\\/)*/g,\"\").replace(/\\//g,\".\")),v&&this.addDepth(v),this.opcode(\"getContext\",v),this.opcode(\"pushStringParam\",u,b.type),b.type===\"SubExpression\"&&this.accept(b);else{if(this.trackIds){var _=void 0;if(b.parts&&!i.default.helpers.scopedId(b)&&!v&&(_=this.blockParamIndex(g(b)[0])),_){var w=b.parts.slice(1).join(\".\");this.opcode(\"pushId\",\"BlockParam\",_,w)}else u=b.original||u,u.replace&&(u=u.replace(/^this(?:\\.|$)/,\"\").replace(/^\\.\\//,\"\").replace(/^\\.$/,\"\")),this.opcode(\"pushId\",b.type,u)}this.accept(b)}},setupFullMustacheParams:function(b,u,v,_){var w=b.params;return this.pushParams(w),this.opcode(\"pushProgram\",u),this.opcode(\"pushProgram\",v),b.hash?this.accept(b.hash):this.opcode(\"emptyHash\",_),w},blockParamIndex:function(b){for(var u=0,v=this.options.blockParams.length;u<v;u++){var _=this.options.blockParams[u],w=_&&r.indexOf(_,b);if(_&&w>=0)return[u,w]}}};function d(k,b,u){if(k==null||typeof k!=\"string\"&&k.type!==\"Program\")throw new s.default(\"You must pass a string or Handlebars AST to Handlebars.precompile. You passed \"+k);b=b||{},\"data\"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var v=u.parse(k,b),_=new u.Compiler().compile(v,b);return new u.JavaScriptCompiler().compile(_,b)}function h(k,b,u){if(b===void 0&&(b={}),k==null||typeof k!=\"string\"&&k.type!==\"Program\")throw new s.default(\"You must pass a string or Handlebars AST to Handlebars.compile. You passed \"+k);b=r.extend({},b),\"data\"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var v=void 0;function _(){var T=u.parse(k,b),R=new u.Compiler().compile(T,b),C=new u.JavaScriptCompiler().compile(R,b,void 0,!0);return u.template(C)}function w(T,R){return v||(v=_()),v.call(this,T,R)}return w._setup=function(T){return v||(v=_()),v._setup(T)},w._child=function(T,R,C,P){return v||(v=_()),v._child(T,R,C,P)},w}function p(k,b){return new s.default(\"Invalid AST: \"+k.type+\" \"+b,k)}function a(k){var b=k.depth;if(b==null)return 0;if(typeof b!=\"number\"||!isFinite(b)||Math.floor(b)!==b||b<0)throw p(k,\"depth must be a non-negative integer\");return b}function f(k){var b=k.value;if(k.type===\"StringLiteral\"&&typeof b!=\"string\")throw p(k,\"value must be a string\");if(k.type===\"NumberLiteral\"&&typeof b!=\"number\")throw p(k,\"value must be a number\");if(k.type===\"BooleanLiteral\"&&typeof b!=\"boolean\")throw p(k,\"value must be a boolean\")}function l(k,b,u){if(!r.isArray(b))throw p(k,u+\" must be an array\");for(var v=0;v<b.length;v++)if(typeof b[v]!=\"string\")throw p(k,u+\" must only contain strings\");return b}function g(k){return l(k,k.parts,\"parts\")}function m(k){k.blockParams!=null&&l(k,k.blockParams,\"blockParams\")}function y(k,b){if(k===b)return!0;if(r.isArray(k)&&r.isArray(b)&&k.length===b.length){for(var u=0;u<k.length;u++)if(!y(k[u],b[u]))return!1;return!0}}function S(k){if(!k.path.parts){var b=k.path;k.path={type:\"PathExpression\",data:!1,depth:0,parts:[b.original+\"\"],original:b.original+\"\",loc:b.loc}}}})),yc=fe((e=>{var t=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\");e.encode=function(s){if(0<=s&&s<t.length)return t[s];throw new TypeError(\"Must be between 0 and 63: \"+s)},e.decode=function(s){var r=65,i=90,n=97,o=122,c=48,d=57,h=43,p=47,a=26,f=52;return r<=s&&s<=i?s-r:n<=s&&s<=o?s-n+a:c<=s&&s<=d?s-c+f:s==h?62:s==p?63:-1}})),qn=fe((e=>{var t=yc(),s=5,r=1<<s,i=r-1,n=r;function o(d){return d<0?(-d<<1)+1:(d<<1)+0}function c(d){var h=(d&1)===1,p=d>>1;return h?-p:p}e.encode=function(h){var p=\"\",a,f=o(h);do a=f&i,f>>>=s,f>0&&(a|=n),p+=t.encode(a);while(f>0);return p},e.decode=function(h,p,a){var f=h.length,l=0,g=0,m,y;do{if(p>=f)throw new Error(\"Expected more digits in base 64 VLQ value.\");if(y=t.decode(h.charCodeAt(p++)),y===-1)throw new Error(\"Invalid base64 digit: \"+h.charAt(p-1));m=!!(y&n),y&=i,l=l+(y<<g),g+=s}while(m);a.value=c(l),a.rest=p}})),Us=fe((e=>{function t(u,v,_){if(v in u)return u[v];if(arguments.length===3)return _;throw new Error('\"'+v+'\" is a required argument.')}e.getArg=t;var s=/^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/,r=/^data:.+\\,.+$/;function i(u){var v=u.match(s);return v?{scheme:v[1],auth:v[2],host:v[3],port:v[4],path:v[5]}:null}e.urlParse=i;function n(u){var v=\"\";return u.scheme&&(v+=u.scheme+\":\"),v+=\"//\",u.auth&&(v+=u.auth+\"@\"),u.host&&(v+=u.host),u.port&&(v+=\":\"+u.port),u.path&&(v+=u.path),v}e.urlGenerate=n;function o(u){var v=u,_=i(u);if(_){if(!_.path)return u;v=_.path}for(var w=e.isAbsolute(v),T=v.split(/\\/+/),R,C=0,P=T.length-1;P>=0;P--)R=T[P],R===\".\"?T.splice(P,1):R===\"..\"?C++:C>0&&(R===\"\"?(T.splice(P+1,C),C=0):(T.splice(P,2),C--));return v=T.join(\"/\"),v===\"\"&&(v=w?\"/\":\".\"),_?(_.path=v,n(_)):v}e.normalize=o;function c(u,v){u===\"\"&&(u=\".\"),v===\"\"&&(v=\".\");var _=i(v),w=i(u);if(w&&(u=w.path||\"/\"),_&&!_.scheme)return w&&(_.scheme=w.scheme),n(_);if(_||v.match(r))return v;if(w&&!w.host&&!w.path)return w.host=v,n(w);var T=v.charAt(0)===\"/\"?v:o(u.replace(/\\/+$/,\"\")+\"/\"+v);return w?(w.path=T,n(w)):T}e.join=c,e.isAbsolute=function(u){return u.charAt(0)===\"/\"||s.test(u)};function d(u,v){u===\"\"&&(u=\".\"),u=u.replace(/\\/$/,\"\");for(var _=0;v.indexOf(u+\"/\")!==0;){var w=u.lastIndexOf(\"/\");if(w<0||(u=u.slice(0,w),u.match(/^([^\\/]+:\\/)?\\/*$/)))return v;++_}return Array(_+1).join(\"../\")+v.substr(u.length+1)}e.relative=d;var h=(function(){return!(\"__proto__\"in Object.create(null))})();function p(u){return u}function a(u){return l(u)?\"$\"+u:u}e.toSetString=h?p:a;function f(u){return l(u)?u.slice(1):u}e.fromSetString=h?p:f;function l(u){if(!u)return!1;var v=u.length;if(v<9||u.charCodeAt(v-1)!==95||u.charCodeAt(v-2)!==95||u.charCodeAt(v-3)!==111||u.charCodeAt(v-4)!==116||u.charCodeAt(v-5)!==111||u.charCodeAt(v-6)!==114||u.charCodeAt(v-7)!==112||u.charCodeAt(v-8)!==95||u.charCodeAt(v-9)!==95)return!1;for(var _=v-10;_>=0;_--)if(u.charCodeAt(_)!==36)return!1;return!0}function g(u,v,_){var w=y(u.source,v.source);return w!==0||(w=u.originalLine-v.originalLine,w!==0)||(w=u.originalColumn-v.originalColumn,w!==0||_)||(w=u.generatedColumn-v.generatedColumn,w!==0)||(w=u.generatedLine-v.generatedLine,w!==0)?w:y(u.name,v.name)}e.compareByOriginalPositions=g;function m(u,v,_){var w=u.generatedLine-v.generatedLine;return w!==0||(w=u.generatedColumn-v.generatedColumn,w!==0||_)||(w=y(u.source,v.source),w!==0)||(w=u.originalLine-v.originalLine,w!==0)||(w=u.originalColumn-v.originalColumn,w!==0)?w:y(u.name,v.name)}e.compareByGeneratedPositionsDeflated=m;function y(u,v){return u===v?0:u===null?1:v===null?-1:u>v?1:-1}function S(u,v){var _=u.generatedLine-v.generatedLine;return _!==0||(_=u.generatedColumn-v.generatedColumn,_!==0)||(_=y(u.source,v.source),_!==0)||(_=u.originalLine-v.originalLine,_!==0)||(_=u.originalColumn-v.originalColumn,_!==0)?_:y(u.name,v.name)}e.compareByGeneratedPositionsInflated=S;function k(u){return JSON.parse(u.replace(/^\\)]}'[^\\n]*\\n/,\"\"))}e.parseSourceMapInput=k;function b(u,v,_){if(v=v||\"\",u&&(u[u.length-1]!==\"/\"&&v[0]!==\"/\"&&(u+=\"/\"),v=u+v),_){var w=i(_);if(!w)throw new Error(\"sourceMapURL could not be parsed\");if(w.path){var T=w.path.lastIndexOf(\"/\");T>=0&&(w.path=w.path.substring(0,T+1))}v=c(n(w),v)}return o(v)}e.computeSourceURL=b})),Fn=fe((e=>{var t=Us(),s=Object.prototype.hasOwnProperty,r=typeof Map<\"u\";function i(){this._array=[],this._set=r?new Map:Object.create(null)}i.fromArray=function(o,c){for(var d=new i,h=0,p=o.length;h<p;h++)d.add(o[h],c);return d},i.prototype.size=function(){return r?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(o,c){var d=r?o:t.toSetString(o),h=r?this.has(o):s.call(this._set,d),p=this._array.length;(!h||c)&&this._array.push(o),h||(r?this._set.set(o,p):this._set[d]=p)},i.prototype.has=function(o){if(r)return this._set.has(o);var c=t.toSetString(o);return s.call(this._set,c)},i.prototype.indexOf=function(o){if(r){var c=this._set.get(o);if(c>=0)return c}else{var d=t.toSetString(o);if(s.call(this._set,d))return this._set[d]}throw new Error('\"'+o+'\" is not in the set.')},i.prototype.at=function(o){if(o>=0&&o<this._array.length)return this._array[o];throw new Error(\"No element indexed by \"+o)},i.prototype.toArray=function(){return this._array.slice()},e.ArraySet=i})),bc=fe((e=>{var t=Us();function s(i,n){var o=i.generatedLine,c=n.generatedLine,d=i.generatedColumn,h=n.generatedColumn;return c>o||c==o&&h>=d||t.compareByGeneratedPositionsInflated(i,n)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(n,o){this._array.forEach(n,o)},r.prototype.add=function(n){s(this._last,n)?(this._last=n,this._array.push(n)):(this._sorted=!1,this._array.push(n))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(t.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},e.MappingList=r})),Vn=fe((e=>{var t=qn(),s=Us(),r=Fn().ArraySet,i=bc().MappingList;function n(o){o||(o={}),this._file=s.getArg(o,\"file\",null),this._sourceRoot=s.getArg(o,\"sourceRoot\",null),this._skipValidation=s.getArg(o,\"skipValidation\",!1),this._sources=new r,this._names=new r,this._mappings=new i,this._sourcesContents=null}n.prototype._version=3,n.fromSourceMap=function(c){var d=c.sourceRoot,h=new n({file:c.file,sourceRoot:d});return c.eachMapping(function(p){var a={generated:{line:p.generatedLine,column:p.generatedColumn}};p.source!=null&&(a.source=p.source,d!=null&&(a.source=s.relative(d,a.source)),a.original={line:p.originalLine,column:p.originalColumn},p.name!=null&&(a.name=p.name)),h.addMapping(a)}),c.sources.forEach(function(p){var a=p;d!==null&&(a=s.relative(d,p)),h._sources.has(a)||h._sources.add(a);var f=c.sourceContentFor(p);f!=null&&h.setSourceContent(p,f)}),h},n.prototype.addMapping=function(c){var d=s.getArg(c,\"generated\"),h=s.getArg(c,\"original\",null),p=s.getArg(c,\"source\",null),a=s.getArg(c,\"name\",null);this._skipValidation||this._validateMapping(d,h,p,a),p!=null&&(p=String(p),this._sources.has(p)||this._sources.add(p)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:d.line,generatedColumn:d.column,originalLine:h!=null&&h.line,originalColumn:h!=null&&h.column,source:p,name:a})},n.prototype.setSourceContent=function(c,d){var h=c;this._sourceRoot!=null&&(h=s.relative(this._sourceRoot,h)),d!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[s.toSetString(h)]=d):this._sourcesContents&&(delete this._sourcesContents[s.toSetString(h)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(c,d,h){var p=d;if(d==null){if(c.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's \"file\" property. Both were omitted.`);p=c.file}var a=this._sourceRoot;a!=null&&(p=s.relative(a,p));var f=new r,l=new r;this._mappings.unsortedForEach(function(g){if(g.source===p&&g.originalLine!=null){var m=c.originalPositionFor({line:g.originalLine,column:g.originalColumn});m.source!=null&&(g.source=m.source,h!=null&&(g.source=s.join(h,g.source)),a!=null&&(g.source=s.relative(a,g.source)),g.originalLine=m.line,g.originalColumn=m.column,m.name!=null&&(g.name=m.name))}var y=g.source;y!=null&&!f.has(y)&&f.add(y);var S=g.name;S!=null&&!l.has(S)&&l.add(S)},this),this._sources=f,this._names=l,c.sources.forEach(function(g){var m=c.sourceContentFor(g);m!=null&&(h!=null&&(g=s.join(h,g)),a!=null&&(g=s.relative(a,g)),this.setSourceContent(g,m))},this)},n.prototype._validateMapping=function(c,d,h,p){if(d&&typeof d.line!=\"number\"&&typeof d.column!=\"number\")throw new Error(\"original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.\");if(!(c&&\"line\"in c&&\"column\"in c&&c.line>0&&c.column>=0&&!d&&!h&&!p)){if(c&&\"line\"in c&&\"column\"in c&&d&&\"line\"in d&&\"column\"in d&&c.line>0&&c.column>=0&&d.line>0&&d.column>=0&&h)return;throw new Error(\"Invalid mapping: \"+JSON.stringify({generated:c,source:h,original:d,name:p}))}},n.prototype._serializeMappings=function(){for(var c=0,d=1,h=0,p=0,a=0,f=0,l=\"\",g,m,y,S,k=this._mappings.toArray(),b=0,u=k.length;b<u;b++){if(m=k[b],g=\"\",m.generatedLine!==d)for(c=0;m.generatedLine!==d;)g+=\";\",d++;else if(b>0){if(!s.compareByGeneratedPositionsInflated(m,k[b-1]))continue;g+=\",\"}g+=t.encode(m.generatedColumn-c),c=m.generatedColumn,m.source!=null&&(S=this._sources.indexOf(m.source),g+=t.encode(S-f),f=S,g+=t.encode(m.originalLine-1-p),p=m.originalLine-1,g+=t.encode(m.originalColumn-h),h=m.originalColumn,m.name!=null&&(y=this._names.indexOf(m.name),g+=t.encode(y-a),a=y)),l+=g}return l},n.prototype._generateSourcesContent=function(c,d){return c.map(function(h){if(!this._sourcesContents)return null;d!=null&&(h=s.relative(d,h));var p=s.toSetString(h);return Object.prototype.hasOwnProperty.call(this._sourcesContents,p)?this._sourcesContents[p]:null},this)},n.prototype.toJSON=function(){var c={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(c.file=this._file),this._sourceRoot!=null&&(c.sourceRoot=this._sourceRoot),this._sourcesContents&&(c.sourcesContent=this._generateSourcesContent(c.sources,c.sourceRoot)),c},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=n})),_c=fe((e=>{e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2;function t(s,r,i,n,o,c){var d=Math.floor((r-s)/2)+s,h=o(i,n[d],!0);return h===0?d:h>0?r-d>1?t(d,r,i,n,o,c):c==e.LEAST_UPPER_BOUND?r<n.length?r:-1:d:d-s>1?t(s,d,i,n,o,c):c==e.LEAST_UPPER_BOUND?d:s<0?-1:s}e.search=function(r,i,n,o){if(i.length===0)return-1;var c=t(-1,i.length,r,i,n,o||e.GREATEST_LOWER_BOUND);if(c<0)return-1;for(;c-1>=0&&n(i[c],i[c-1],!0)===0;)--c;return c}})),Sc=fe((e=>{function t(i,n,o){var c=i[n];i[n]=i[o],i[o]=c}function s(i,n){return Math.round(i+Math.random()*(n-i))}function r(i,n,o,c){if(o<c){var d=s(o,c),h=o-1;t(i,d,c);for(var p=i[c],a=o;a<c;a++)n(i[a],p)<=0&&(h+=1,t(i,h,a));t(i,h+1,a);var f=h+1;r(i,n,o,f-1),r(i,n,f+1,c)}}e.quickSort=function(i,n){r(i,n,0,i.length-1)}})),kc=fe((e=>{var t=Us(),s=_c(),r=Fn().ArraySet,i=qn(),n=Sc().quickSort;function o(p,a){var f=p;return typeof p==\"string\"&&(f=t.parseSourceMapInput(p)),f.sections!=null?new h(f,a):new c(f,a)}o.fromSourceMap=function(p,a){return c.fromSourceMap(p,a)},o.prototype._version=3,o.prototype.__generatedMappings=null,Object.defineProperty(o.prototype,\"_generatedMappings\",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),o.prototype.__originalMappings=null,Object.defineProperty(o.prototype,\"_originalMappings\",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),o.prototype._charIsMappingSeparator=function(a,f){var l=a.charAt(f);return l===\";\"||l===\",\"},o.prototype._parseMappings=function(a,f){throw new Error(\"Subclasses must implement _parseMappings\")},o.GENERATED_ORDER=1,o.ORIGINAL_ORDER=2,o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2,o.prototype.eachMapping=function(a,f,l){var g=f||null,m=l||o.GENERATED_ORDER,y;switch(m){case o.GENERATED_ORDER:y=this._generatedMappings;break;case o.ORIGINAL_ORDER:y=this._originalMappings;break;default:throw new Error(\"Unknown order of iteration.\")}var S=this.sourceRoot;y.map(function(k){var b=k.source===null?null:this._sources.at(k.source);return b=t.computeSourceURL(S,b,this._sourceMapURL),{source:b,generatedLine:k.generatedLine,generatedColumn:k.generatedColumn,originalLine:k.originalLine,originalColumn:k.originalColumn,name:k.name===null?null:this._names.at(k.name)}},this).forEach(a,g)},o.prototype.allGeneratedPositionsFor=function(a){var f=t.getArg(a,\"line\"),l={source:t.getArg(a,\"source\"),originalLine:f,originalColumn:t.getArg(a,\"column\",0)};if(l.source=this._findSourceIndex(l.source),l.source<0)return[];var g=[],m=this._findMapping(l,this._originalMappings,\"originalLine\",\"originalColumn\",t.compareByOriginalPositions,s.LEAST_UPPER_BOUND);if(m>=0){var y=this._originalMappings[m];if(a.column===void 0)for(var S=y.originalLine;y&&y.originalLine===S;)g.push({line:t.getArg(y,\"generatedLine\",null),column:t.getArg(y,\"generatedColumn\",null),lastColumn:t.getArg(y,\"lastGeneratedColumn\",null)}),y=this._originalMappings[++m];else for(var k=y.originalColumn;y&&y.originalLine===f&&y.originalColumn==k;)g.push({line:t.getArg(y,\"generatedLine\",null),column:t.getArg(y,\"generatedColumn\",null),lastColumn:t.getArg(y,\"lastGeneratedColumn\",null)}),y=this._originalMappings[++m]}return g},e.SourceMapConsumer=o;function c(p,a){var f=p;typeof p==\"string\"&&(f=t.parseSourceMapInput(p));var l=t.getArg(f,\"version\"),g=t.getArg(f,\"sources\"),m=t.getArg(f,\"names\",[]),y=t.getArg(f,\"sourceRoot\",null),S=t.getArg(f,\"sourcesContent\",null),k=t.getArg(f,\"mappings\"),b=t.getArg(f,\"file\",null);if(l!=this._version)throw new Error(\"Unsupported version: \"+l);y&&(y=t.normalize(y)),g=g.map(String).map(t.normalize).map(function(u){return y&&t.isAbsolute(y)&&t.isAbsolute(u)?t.relative(y,u):u}),this._names=r.fromArray(m.map(String),!0),this._sources=r.fromArray(g,!0),this._absoluteSources=this._sources.toArray().map(function(u){return t.computeSourceURL(y,u,a)}),this.sourceRoot=y,this.sourcesContent=S,this._mappings=k,this._sourceMapURL=a,this.file=b}c.prototype=Object.create(o.prototype),c.prototype.consumer=o,c.prototype._findSourceIndex=function(p){var a=p;if(this.sourceRoot!=null&&(a=t.relative(this.sourceRoot,a)),this._sources.has(a))return this._sources.indexOf(a);for(var f=0;f<this._absoluteSources.length;++f)if(this._absoluteSources[f]==p)return f;return-1},c.fromSourceMap=function(a,f){var l=Object.create(c.prototype),g=l._names=r.fromArray(a._names.toArray(),!0),m=l._sources=r.fromArray(a._sources.toArray(),!0);l.sourceRoot=a._sourceRoot,l.sourcesContent=a._generateSourcesContent(l._sources.toArray(),l.sourceRoot),l.file=a._file,l._sourceMapURL=f,l._absoluteSources=l._sources.toArray().map(function(w){return t.computeSourceURL(l.sourceRoot,w,f)});for(var y=a._mappings.toArray().slice(),S=l.__generatedMappings=[],k=l.__originalMappings=[],b=0,u=y.length;b<u;b++){var v=y[b],_=new d;_.generatedLine=v.generatedLine,_.generatedColumn=v.generatedColumn,v.source&&(_.source=m.indexOf(v.source),_.originalLine=v.originalLine,_.originalColumn=v.originalColumn,v.name&&(_.name=g.indexOf(v.name)),k.push(_)),S.push(_)}return n(l.__originalMappings,t.compareByOriginalPositions),l},c.prototype._version=3,Object.defineProperty(c.prototype,\"sources\",{get:function(){return this._absoluteSources.slice()}});function d(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}c.prototype._parseMappings=function(a,f){for(var l=1,g=0,m=0,y=0,S=0,k=0,b=a.length,u=0,v={},_={},w=[],T=[],R,C,P,E,N;u<b;)if(a.charAt(u)===\";\")l++,u++,g=0;else if(a.charAt(u)===\",\")u++;else{for(R=new d,R.generatedLine=l,E=u;E<b&&!this._charIsMappingSeparator(a,E);E++);if(C=a.slice(u,E),P=v[C],P)u+=C.length;else{for(P=[];u<E;)i.decode(a,u,_),N=_.value,u=_.rest,P.push(N);if(P.length===2)throw new Error(\"Found a source, but no line and column\");if(P.length===3)throw new Error(\"Found a source and line, but no column\");v[C]=P}R.generatedColumn=g+P[0],g=R.generatedColumn,P.length>1&&(R.source=S+P[1],S+=P[1],R.originalLine=m+P[2],m=R.originalLine,R.originalLine+=1,R.originalColumn=y+P[3],y=R.originalColumn,P.length>4&&(R.name=k+P[4],k+=P[4])),T.push(R),typeof R.originalLine==\"number\"&&w.push(R)}n(T,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=T,n(w,t.compareByOriginalPositions),this.__originalMappings=w},c.prototype._findMapping=function(a,f,l,g,m,y){if(a[l]<=0)throw new TypeError(\"Line must be greater than or equal to 1, got \"+a[l]);if(a[g]<0)throw new TypeError(\"Column must be greater than or equal to 0, got \"+a[g]);return s.search(a,f,m,y)},c.prototype.computeColumnSpans=function(){for(var a=0;a<this._generatedMappings.length;++a){var f=this._generatedMappings[a];if(a+1<this._generatedMappings.length){var l=this._generatedMappings[a+1];if(f.generatedLine===l.generatedLine){f.lastGeneratedColumn=l.generatedColumn-1;continue}}f.lastGeneratedColumn=1/0}},c.prototype.originalPositionFor=function(a){var f={generatedLine:t.getArg(a,\"line\"),generatedColumn:t.getArg(a,\"column\")},l=this._findMapping(f,this._generatedMappings,\"generatedLine\",\"generatedColumn\",t.compareByGeneratedPositionsDeflated,t.getArg(a,\"bias\",o.GREATEST_LOWER_BOUND));if(l>=0){var g=this._generatedMappings[l];if(g.generatedLine===f.generatedLine){var m=t.getArg(g,\"source\",null);m!==null&&(m=this._sources.at(m),m=t.computeSourceURL(this.sourceRoot,m,this._sourceMapURL));var y=t.getArg(g,\"name\",null);return y!==null&&(y=this._names.at(y)),{source:m,line:t.getArg(g,\"originalLine\",null),column:t.getArg(g,\"originalColumn\",null),name:y}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(a){return a==null}):!1},c.prototype.sourceContentFor=function(a,f){if(!this.sourcesContent)return null;var l=this._findSourceIndex(a);if(l>=0)return this.sourcesContent[l];var g=a;this.sourceRoot!=null&&(g=t.relative(this.sourceRoot,g));var m;if(this.sourceRoot!=null&&(m=t.urlParse(this.sourceRoot))){var y=g.replace(/^file:\\/\\//,\"\");if(m.scheme==\"file\"&&this._sources.has(y))return this.sourcesContent[this._sources.indexOf(y)];if((!m.path||m.path==\"/\")&&this._sources.has(\"/\"+g))return this.sourcesContent[this._sources.indexOf(\"/\"+g)]}if(f)return null;throw new Error('\"'+g+'\" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(a){var f=t.getArg(a,\"source\");if(f=this._findSourceIndex(f),f<0)return{line:null,column:null,lastColumn:null};var l={source:f,originalLine:t.getArg(a,\"line\"),originalColumn:t.getArg(a,\"column\")},g=this._findMapping(l,this._originalMappings,\"originalLine\",\"originalColumn\",t.compareByOriginalPositions,t.getArg(a,\"bias\",o.GREATEST_LOWER_BOUND));if(g>=0){var m=this._originalMappings[g];if(m.source===l.source)return{line:t.getArg(m,\"generatedLine\",null),column:t.getArg(m,\"generatedColumn\",null),lastColumn:t.getArg(m,\"lastGeneratedColumn\",null)}}return{line:null,column:null,lastColumn:null}},e.BasicSourceMapConsumer=c;function h(p,a){var f=p;typeof p==\"string\"&&(f=t.parseSourceMapInput(p));var l=t.getArg(f,\"version\"),g=t.getArg(f,\"sections\");if(l!=this._version)throw new Error(\"Unsupported version: \"+l);this._sources=new r,this._names=new r;var m={line:-1,column:0};this._sections=g.map(function(y){if(y.url)throw new Error(\"Support for url field in sections not implemented.\");var S=t.getArg(y,\"offset\"),k=t.getArg(S,\"line\"),b=t.getArg(S,\"column\");if(k<m.line||k===m.line&&b<m.column)throw new Error(\"Section offsets must be ordered and non-overlapping.\");return m=S,{generatedOffset:{generatedLine:k+1,generatedColumn:b+1},consumer:new o(t.getArg(y,\"map\"),a)}})}h.prototype=Object.create(o.prototype),h.prototype.constructor=o,h.prototype._version=3,Object.defineProperty(h.prototype,\"sources\",{get:function(){for(var p=[],a=0;a<this._sections.length;a++)for(var f=0;f<this._sections[a].consumer.sources.length;f++)p.push(this._sections[a].consumer.sources[f]);return p}}),h.prototype.originalPositionFor=function(a){var f={generatedLine:t.getArg(a,\"line\"),generatedColumn:t.getArg(a,\"column\")},l=s.search(f,this._sections,function(m,y){var S=m.generatedLine-y.generatedOffset.generatedLine;return S||m.generatedColumn-y.generatedOffset.generatedColumn}),g=this._sections[l];return g?g.consumer.originalPositionFor({line:f.generatedLine-(g.generatedOffset.generatedLine-1),column:f.generatedColumn-(g.generatedOffset.generatedLine===f.generatedLine?g.generatedOffset.generatedColumn-1:0),bias:a.bias}):{source:null,line:null,column:null,name:null}},h.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(a){return a.consumer.hasContentsOfAllSources()})},h.prototype.sourceContentFor=function(a,f){for(var l=0;l<this._sections.length;l++){var g=this._sections[l].consumer.sourceContentFor(a,!0);if(g)return g}if(f)return null;throw new Error('\"'+a+'\" is not in the SourceMap.')},h.prototype.generatedPositionFor=function(a){for(var f=0;f<this._sections.length;f++){var l=this._sections[f];if(l.consumer._findSourceIndex(t.getArg(a,\"source\"))!==-1){var g=l.consumer.generatedPositionFor(a);if(g)return{line:g.line+(l.generatedOffset.generatedLine-1),column:g.column+(l.generatedOffset.generatedLine===g.line?l.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},h.prototype._parseMappings=function(a,f){this.__generatedMappings=[],this.__originalMappings=[];for(var l=0;l<this._sections.length;l++)for(var g=this._sections[l],m=g.consumer._generatedMappings,y=0;y<m.length;y++){var S=m[y],k=g.consumer._sources.at(S.source);k=t.computeSourceURL(g.consumer.sourceRoot,k,this._sourceMapURL),this._sources.add(k),k=this._sources.indexOf(k);var b=null;S.name&&(b=g.consumer._names.at(S.name),this._names.add(b),b=this._names.indexOf(b));var u={source:k,generatedLine:S.generatedLine+(g.generatedOffset.generatedLine-1),generatedColumn:S.generatedColumn+(g.generatedOffset.generatedLine===S.generatedLine?g.generatedOffset.generatedColumn-1:0),originalLine:S.originalLine,originalColumn:S.originalColumn,name:b};this.__generatedMappings.push(u),typeof u.originalLine==\"number\"&&this.__originalMappings.push(u)}n(this.__generatedMappings,t.compareByGeneratedPositionsDeflated),n(this.__originalMappings,t.compareByOriginalPositions)},e.IndexedSourceMapConsumer=h})),wc=fe((e=>{var t=Vn().SourceMapGenerator,s=Us(),r=/(\\r?\\n)/,i=10,n=\"$$$isSourceNode$$$\";function o(c,d,h,p,a){this.children=[],this.sourceContents={},this.line=c??null,this.column=d??null,this.source=h??null,this.name=a??null,this[n]=!0,p!=null&&this.add(p)}o.fromStringWithSourceMap=function(d,h,p){var a=new o,f=d.split(r),l=0,g=function(){return b()+(b()||\"\");function b(){return l<f.length?f[l++]:void 0}},m=1,y=0,S=null;return h.eachMapping(function(b){if(S!==null)if(m<b.generatedLine)k(S,g()),m++,y=0;else{var u=f[l]||\"\",v=u.substr(0,b.generatedColumn-y);f[l]=u.substr(b.generatedColumn-y),y=b.generatedColumn,k(S,v),S=b;return}for(;m<b.generatedLine;)a.add(g()),m++;if(y<b.generatedColumn){var u=f[l]||\"\";a.add(u.substr(0,b.generatedColumn)),f[l]=u.substr(b.generatedColumn),y=b.generatedColumn}S=b},this),l<f.length&&(S&&k(S,g()),a.add(f.splice(l).join(\"\"))),h.sources.forEach(function(b){var u=h.sourceContentFor(b);u!=null&&(p!=null&&(b=s.join(p,b)),a.setSourceContent(b,u))}),a;function k(b,u){if(b===null||b.source===void 0)a.add(u);else{var v=p?s.join(p,b.source):b.source;a.add(new o(b.originalLine,b.originalColumn,v,u,b.name))}}},o.prototype.add=function(d){if(Array.isArray(d))d.forEach(function(h){this.add(h)},this);else if(d[n]||typeof d==\"string\")d&&this.children.push(d);else throw new TypeError(\"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \"+d);return this},o.prototype.prepend=function(d){if(Array.isArray(d))for(var h=d.length-1;h>=0;h--)this.prepend(d[h]);else if(d[n]||typeof d==\"string\")this.children.unshift(d);else throw new TypeError(\"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \"+d);return this},o.prototype.walk=function(d){for(var h,p=0,a=this.children.length;p<a;p++)h=this.children[p],h[n]?h.walk(d):h!==\"\"&&d(h,{source:this.source,line:this.line,column:this.column,name:this.name})},o.prototype.join=function(d){var h,p,a=this.children.length;if(a>0){for(h=[],p=0;p<a-1;p++)h.push(this.children[p]),h.push(d);h.push(this.children[p]),this.children=h}return this},o.prototype.replaceRight=function(d,h){var p=this.children[this.children.length-1];return p[n]?p.replaceRight(d,h):typeof p==\"string\"?this.children[this.children.length-1]=p.replace(d,h):this.children.push(\"\".replace(d,h)),this},o.prototype.setSourceContent=function(d,h){this.sourceContents[s.toSetString(d)]=h},o.prototype.walkSourceContents=function(d){for(var h=0,p=this.children.length;h<p;h++)this.children[h][n]&&this.children[h].walkSourceContents(d);for(var a=Object.keys(this.sourceContents),h=0,p=a.length;h<p;h++)d(s.fromSetString(a[h]),this.sourceContents[a[h]])},o.prototype.toString=function(){var d=\"\";return this.walk(function(h){d+=h}),d},o.prototype.toStringWithSourceMap=function(d){var h={code:\"\",line:1,column:0},p=new t(d),a=!1,f=null,l=null,g=null,m=null;return this.walk(function(y,S){h.code+=y,S.source!==null&&S.line!==null&&S.column!==null?((f!==S.source||l!==S.line||g!==S.column||m!==S.name)&&p.addMapping({source:S.source,original:{line:S.line,column:S.column},generated:{line:h.line,column:h.column},name:S.name}),f=S.source,l=S.line,g=S.column,m=S.name,a=!0):a&&(p.addMapping({generated:{line:h.line,column:h.column}}),f=null,a=!1);for(var k=0,b=y.length;k<b;k++)y.charCodeAt(k)===i?(h.line++,h.column=0,k+1===b?(f=null,a=!1):a&&p.addMapping({source:S.source,original:{line:S.line,column:S.column},generated:{line:h.line,column:h.column},name:S.name})):h.column++}),this.walkSourceContents(function(y,S){p.setSourceContent(y,S)}),{code:h.code,map:p}},e.SourceNode=o})),xc=fe((e=>{e.SourceMapGenerator=Vn().SourceMapGenerator,e.SourceMapConsumer=kc().SourceMapConsumer,e.SourceNode=wc().SourceNode})),Tc=fe((e=>{e.__esModule=!0,e.safeJsonLiteral=o;var t=lt(),s=/[\\x00-\\x1f\\\\\"\\u2028\\u2029<\\ud800-\\udfff]/,r=/<(?=!--|\\/?script)/gi;function i(p){return p.replace(r,\"\\\\u003C\")}function n(p){return\"\\\\u\"+p.charCodeAt(0).toString(16)}function o(p){return i(JSON.stringify(p).replace(/\\u2028/g,\"\\\\u2028\").replace(/\\u2029/g,\"\\\\u2029\").replace(/[\\ud800-\\udfff]/g,n))}var c=void 0;try{(typeof define!=\"function\"||!define.amd)&&(c=xc().SourceNode)}catch{}c||(c=function(p,a,f,l){this.src=\"\",l&&this.add(l)},c.prototype={add:function(a){t.isArray(a)&&(a=a.join(\"\")),this.src+=a},prepend:function(a){t.isArray(a)&&(a=a.join(\"\")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function d(p,a,f){if(t.isArray(p)){for(var l=[],g=0,m=p.length;g<m;g++)l.push(a.wrap(p[g],f));return l}else if(typeof p==\"boolean\"||typeof p==\"number\")return p+\"\";return p}function h(p){this.srcFile=p,this.source=[]}h.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,f){this.source.unshift(this.wrap(a,f))},push:function(a,f){this.source.push(this.wrap(a,f))},merge:function(){var a=this.empty();return this.each(function(f){a.add([\" \",f,`\n`])}),a},each:function(a){for(var f=0,l=this.source.length;f<l;f++)a(this.source[f])},empty:function(){var a=this.currentLocation||{start:{}};return new c(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var f=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return a instanceof c?a:(a=d(a,this,f),new c(f.start.line,f.start.column,this.srcFile,a))},functionCall:function(a,f,l){return l=this.generateList(l),this.wrap([a,f?\".\"+f+\"(\":\"(\",l,\")\"])},quotedString:function(a){return a=a+\"\",s.test(a)?o(a):'\"'+a+'\"'},objectLiteral:function(a){var f=this,l=[];Object.keys(a).forEach(function(m){var y=d(a[m],f);y!==\"undefined\"&&l.push([f.quotedString(m),\":\",y])});var g=this.generateList(l);return g.prepend(\"{\"),g.add(\"}\"),g},generateList:function(a){for(var f=this.empty(),l=0,g=a.length;l<g;l++)l&&f.add(\",\"),f.add(d(a[l],this));return f},generateArray:function(a){var f=this.generateList(a);return f.prepend(\"[\"),f.add(\"]\"),f}},e.default=h})),Cc=fe(((e,t)=>{e.__esModule=!0;function s(f){return f&&f.__esModule?f:{default:f}}var r=mi(),i=s(Et()),n=lt(),o=Tc(),c=s(o);function d(f){this.value=f}function h(){}h.prototype={nameLookup:function(l,g){return this.internalNameLookup(l,g)},depthedLookup:function(l){return[this.aliasable(\"container.lookup\"),\"(depths, \",this.quotedString(l),\")\"]},compilerInfo:function(){var l=r.COMPILER_REVISION;return[l,r.REVISION_CHANGES[l]]},appendToBuffer:function(l,g,m){return n.isArray(l)||(l=[l]),l=this.source.wrap(l,g),this.environment.isSimple?[\"return \",l,\";\"]:m?[\"buffer += \",l,\";\"]:(l.appendToBuffer=!0,l)},initializeBuffer:function(){return this.quotedString(\"\")},internalNameLookup:function(l,g){return this.lookupPropertyFunctionIsUsed=!0,[\"lookupProperty(\",l,\",\",this.quotedString(g),\")\"]},lookupPropertyFunctionIsUsed:!1,compile:function(l,g,m,y){this.environment=l,this.options=g,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!y,this.name=this.environment.name,this.isChild=!!m,this.context=m||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(l,g),this.useDepths=this.useDepths||l.useDepths||l.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||l.useBlockParams;var S=l.opcodes,k=void 0,b=void 0,u=void 0,v=void 0;for(u=0,v=S.length;u<v;u++)k=S[u],this.source.currentLocation=k.loc,b=b||k.loc,this[k.opcode].apply(this,k.args);if(this.source.currentLocation=b,this.pushSource(\"\"),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new i.default(\"Compile completed with content left on stack\");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend([\"var decorators = container.decorators, \",this.lookupPropertyFunctionVarDeclaration(),`;\n`]),this.decorators.push(\"return fn;\"),y?this.decorators=Function.apply(this,[\"fn\",\"props\",\"container\",\"depth0\",\"data\",\"blockParams\",\"depths\",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {\n`),this.decorators.push(`}\n`),this.decorators=this.decorators.merge()));var _=this.createFunctionContext(y);if(this.isChild)return _;var w={compiler:this.compilerInfo(),main:_};this.decorators&&(w.main_d=this.decorators,w.useDecorators=!0);var T=this.context,R=T.programs,C=T.decorators;for(u=0,v=R.length;u<v;u++)w[u]=R[u],C[u]&&(w[u+\"_d\"]=C[u],w.useDecorators=!0);return this.environment.usePartial&&(w.usePartial=!0),this.options.data&&(w.useData=!0),this.useDepths&&(w.useDepths=!0),this.useBlockParams&&(w.useBlockParams=!0),this.options.compat&&(w.compat=!0),y?w.compilerOptions=this.options:(w.compiler=JSON.stringify(w.compiler),this.source.currentLocation={start:{line:1,column:0}},w=this.objectLiteral(w),g.srcName?(w=w.toStringWithSourceMap({file:g.destName}),w.map=w.map&&w.map.toString()):w=w.toString()),w},preamble:function(){this.lastContext=0,this.source=new c.default(this.options.srcName),this.decorators=new c.default(this.options.srcName)},createFunctionContext:function(l){var g=this,m=\"\",y=this.stackVars.concat(this.registers.list);y.length>0&&(m+=\", \"+y.join(\", \"));var S=0;Object.keys(this.aliases).forEach(function(u){var v=g.aliases[u];v.children&&v.referenceCount>1&&(m+=\", alias\"+ ++S+\"=\"+u,v.children[0]=\"alias\"+S)}),this.lookupPropertyFunctionIsUsed&&(m+=\", \"+this.lookupPropertyFunctionVarDeclaration());var k=[\"container\",\"depth0\",\"helpers\",\"partials\",\"data\"];(this.useBlockParams||this.useDepths)&&k.push(\"blockParams\"),this.useDepths&&k.push(\"depths\");var b=this.mergeSource(m);return l?(k.push(b),Function.apply(this,k)):this.source.wrap([\"function(\",k.join(\",\"),`) {\n `,b,\"}\"])},mergeSource:function(l){var g=this.environment.isSimple,m=!this.forceBuffer,y=void 0,S=void 0,k=void 0,b=void 0;return this.source.each(function(u){u.appendToBuffer?(k?u.prepend(\" + \"):k=u,b=u):(k&&(S?k.prepend(\"buffer += \"):y=!0,b.add(\";\"),k=b=void 0),S=!0,g||(m=!1))}),m?k?(k.prepend(\"return \"),b.add(\";\")):S||this.source.push('return \"\";'):(l+=\", buffer = \"+(y?\"\":this.initializeBuffer()),k?(k.prepend(\"return buffer + \"),b.add(\";\")):this.source.push(\"return buffer;\")),l&&this.source.prepend(\"var \"+l.substring(2)+(y?\"\":`;\n`)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return`\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n `.trim()},blockValue:function(l){var g=this.aliasable(\"container.hooks.blockHelperMissing\"),m=[this.contextName(0)];this.setupHelperArgs(l,0,m);var y=this.popStack();m.splice(1,0,y),this.push(this.source.functionCall(g,\"call\",m))},ambiguousBlockValue:function(){var l=this.aliasable(\"container.hooks.blockHelperMissing\"),g=[this.contextName(0)];this.setupHelperArgs(\"\",0,g,!0),this.flushInline();var m=this.topStack();g.splice(1,0,m),this.pushSource([\"if (!\",this.lastHelper,\") { \",m,\" = \",this.source.functionCall(l,\"call\",g),\"}\"])},appendContent:function(l){this.pendingContent?l=this.pendingContent+l:this.pendingLocation=this.source.currentLocation,this.pendingContent=l},append:function(){if(this.isInline())this.replaceStack(function(g){return[\" != null ? \",g,' : \"\"']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var l=this.popStack();this.pushSource([\"if (\",l,\" != null) { \",this.appendToBuffer(l,void 0,!0),\" }\"]),this.environment.isSimple&&this.pushSource([\"else { \",this.appendToBuffer(\"''\",void 0,!0),\" }\"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable(\"container.escapeExpression\"),\"(\",this.popStack(),\")\"]))},getContext:function(l){this.lastContext=l},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(l,g,m,y){var S=0;!y&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(l[S++])):this.pushContext(),this.resolvePath(\"context\",l,S,g,m)},lookupBlockParam:function(l,g){this.useBlockParams=!0,this.push([\"blockParams[\",l[0],\"][\",l[1],\"]\"]),this.resolvePath(\"context\",g,1)},lookupData:function(l,g,m){l?this.pushStackLiteral(\"container.data(data, \"+l+\")\"):this.pushStackLiteral(\"data\"),this.resolvePath(\"data\",g,0,!0,m)},resolvePath:function(l,g,m,y,S){var k=this;if(this.options.strict||this.options.assumeObjects){this.push(a(this.options.strict&&S,this,g,m,l));return}for(var b=g.length,u=function(_){k.replaceStack(function(w){var T=k.nameLookup(w,g[_],l);return y?[\" && \",T]:[\" != null ? \",T,\" : \",w]})},v=m;v<b;v++)u(v)},resolvePossibleLambda:function(){this.push([this.aliasable(\"container.lambda\"),\"(\",this.popStack(),\", \",this.contextName(0),\")\"])},pushStringParam:function(l,g){this.pushContext(),this.pushString(g),g!==\"SubExpression\"&&(typeof l==\"string\"?this.pushString(l):this.pushStackLiteral(l))},emptyHash:function(l){this.trackIds&&this.push(\"{}\"),this.stringParams&&(this.push(\"{}\"),this.push(\"{}\")),this.pushStackLiteral(l?\"undefined\":\"{}\")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var l=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(l.ids)),this.stringParams&&(this.push(this.objectLiteral(l.contexts)),this.push(this.objectLiteral(l.types))),this.push(this.objectLiteral(l.values))},pushString:function(l){this.pushStackLiteral(this.quotedString(l))},pushLiteral:function(l){this.pushStackLiteral(l)},pushProgram:function(l){l!=null?this.pushStackLiteral(this.programExpression(l)):this.pushStackLiteral(null)},registerDecorator:function(l,g){var m=this.nameLookup(\"decorators\",g,\"decorator\"),y=this.setupHelperArgs(g,l);this.decorators.push([\"var decorator = \",m,\";\"]),this.decorators.push(['if (typeof decorator !== \"function\") { throw new Error(',this.quotedString('Missing decorator: \"'+g+'\"'),\"); }\"]),this.decorators.push([\"fn = \",this.decorators.functionCall(\"decorator\",\"\",[\"fn\",\"props\",\"container\",y]),\" || fn;\"])},invokeHelper:function(l,g,m){var y=this.popStack(),S=this.setupHelper(l,g),k=[];m&&k.push(S.name),k.push(y),this.options.strict||k.push(this.aliasable(\"container.hooks.helperMissing\"));var b=[\"(\",this.itemsSeparatedBy(k,\"||\"),\")\"],u=this.source.functionCall(b,\"call\",S.callParams);this.push(u)},itemsSeparatedBy:function(l,g){var m=[];m.push(l[0]);for(var y=1;y<l.length;y++)m.push(g,l[y]);return m},invokeKnownHelper:function(l,g){var m=this.setupHelper(l,g);this.push(this.source.functionCall(m.name,\"call\",m.callParams))},invokeAmbiguous:function(l,g){this.useRegister(\"helper\");var m=this.popStack();this.emptyHash();var y=this.setupHelper(0,l,g),S=[\"(\",\"(helper = \",this.lastHelper=this.nameLookup(\"helpers\",l,\"helper\"),\" || \",m,\")\"];this.options.strict||(S[0]=\"(helper = \",S.push(\" != null ? helper : \",this.aliasable(\"container.hooks.helperMissing\"))),this.push([\"(\",S,y.paramsInit?[\"),(\",y.paramsInit]:[],\"),\",\"(typeof helper === \",this.aliasable('\"function\"'),\" ? \",this.source.functionCall(\"helper\",\"call\",y.callParams),\" : helper))\"])},invokePartial:function(l,g,m){var y=[],S=this.setupParams(g,1,y);l&&(g=this.popStack(),delete S.name),m&&(S.indent=this.quotedString(m)),S.helpers=\"helpers\",S.partials=\"partials\",S.decorators=\"container.decorators\",l?y.unshift(g):y.unshift(this.nameLookup(\"partials\",g,\"partial\")),this.options.compat&&(S.depths=\"depths\"),S=this.objectLiteral(S),y.push(S),this.push(this.source.functionCall(\"container.invokePartial\",\"\",y))},assignToHash:function(l){var g=this.popStack(),m=void 0,y=void 0,S=void 0;this.trackIds&&(S=this.popStack()),this.stringParams&&(y=this.popStack(),m=this.popStack());var k=this.hash;m&&(k.contexts[l]=m),y&&(k.types[l]=y),S&&(k.ids[l]=S),k.values[l]=g},pushId:function(l,g,m){l===\"BlockParam\"?this.pushStackLiteral(\"blockParams[\"+g[0]+\"].path[\"+g[1]+\"]\"+(m?\" + \"+this.quotedString(\".\"+m):\"\")):l===\"PathExpression\"?this.pushString(g):l===\"SubExpression\"?this.pushStackLiteral(\"true\"):this.pushStackLiteral(\"null\")},compiler:h,compileChildren:function(l,g){for(var m=l.children,y=void 0,S=void 0,k=0,b=m.length;k<b;k++){y=m[k],S=new this.compiler;var u=this.matchExistingProgram(y);if(u==null){var v=this.context.programs.push(\"\")-1;y.index=v,y.name=\"program\"+v,this.context.programs[v]=S.compile(y,g,this.context,!this.precompile),this.context.decorators[v]=S.decorators,this.context.environments[v]=y,this.useDepths=this.useDepths||S.useDepths,this.useBlockParams=this.useBlockParams||S.useBlockParams,y.useDepths=this.useDepths,y.useBlockParams=this.useBlockParams}else y.index=u.index,y.name=\"program\"+u.index,this.useDepths=this.useDepths||u.useDepths,this.useBlockParams=this.useBlockParams||u.useBlockParams}},matchExistingProgram:function(l){for(var g=0,m=this.context.environments.length;g<m;g++){var y=this.context.environments[g];if(y&&y.equals(l))return y}},programExpression:function(l){var g=this.environment.children[l],m=[g.index,\"data\",g.blockParams];return(this.useBlockParams||this.useDepths)&&m.push(\"blockParams\"),this.useDepths&&m.push(\"depths\"),\"container.program(\"+m.join(\", \")+\")\"},useRegister:function(l){this.registers[l]||(this.registers[l]=!0,this.registers.list.push(l))},push:function(l){return l instanceof d||(l=this.source.wrap(l)),this.inlineStack.push(l),l},pushStackLiteral:function(l){this.push(new d(l))},pushSource:function(l){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),l&&this.source.push(l)},replaceStack:function(l){var g=[\"(\"],m=void 0,y=void 0,S=void 0;if(!this.isInline())throw new i.default(\"replaceStack on non-inline\");var k=this.popStack(!0);if(k instanceof d)m=[k.value],g=[\"(\",m],S=!0;else{y=!0;var b=this.incrStack();g=[\"((\",this.push(b),\" = \",k,\")\"],m=this.topStack()}var u=l.call(this,m);S||this.popStack(),y&&this.stackSlot--,this.push(g.concat(u,\")\"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push(\"stack\"+this.stackSlot),this.topStackName()},topStackName:function(){return\"stack\"+this.stackSlot},flushInline:function(){var l=this.inlineStack;this.inlineStack=[];for(var g=0,m=l.length;g<m;g++){var y=l[g];if(y instanceof d)this.compileStack.push(y);else{var S=this.incrStack();this.pushSource([S,\" = \",y,\";\"]),this.compileStack.push(S)}}},isInline:function(){return this.inlineStack.length},popStack:function(l){var g=this.isInline(),m=(g?this.inlineStack:this.compileStack).pop();if(!l&&m instanceof d)return m.value;if(!g){if(!this.stackSlot)throw new i.default(\"Invalid stack pop\");this.stackSlot--}return m},topStack:function(){var l=this.isInline()?this.inlineStack:this.compileStack,g=l[l.length-1];return g instanceof d?g.value:g},contextName:function(l){return this.useDepths&&l?\"depths[\"+l+\"]\":\"depth\"+l},quotedString:function(l){return this.source.quotedString(l)},objectLiteral:function(l){return this.source.objectLiteral(l)},aliasable:function(l){var g=this.aliases[l];return g?(g.referenceCount++,g):(g=this.aliases[l]=this.source.wrap(l),g.aliasable=!0,g.referenceCount=1,g)},setupHelper:function(l,g,m){var y=[];return{params:y,paramsInit:this.setupHelperArgs(g,l,y,m),name:this.nameLookup(\"helpers\",g,\"helper\"),callParams:[this.aliasable(this.contextName(0)+\" != null ? \"+this.contextName(0)+\" : (container.nullContext || {})\")].concat(y)}},setupParams:function(l,g,m){var y={},S=[],k=[],b=[],u=!m,v=void 0;u&&(m=[]),y.name=this.quotedString(l),y.hash=this.popStack(),this.trackIds&&(y.hashIds=this.popStack()),this.stringParams&&(y.hashTypes=this.popStack(),y.hashContexts=this.popStack());var _=this.popStack(),w=this.popStack();(w||_)&&(y.fn=w||\"container.noop\",y.inverse=_||\"container.noop\");for(var T=g;T--;)v=this.popStack(),m[T]=v,this.trackIds&&(b[T]=this.popStack()),this.stringParams&&(k[T]=this.popStack(),S[T]=this.popStack());return u&&(y.args=this.source.generateArray(m)),this.trackIds&&(y.ids=this.source.generateArray(b)),this.stringParams&&(y.types=this.source.generateArray(k),y.contexts=this.source.generateArray(S)),this.options.data&&(y.data=\"data\"),this.useBlockParams&&(y.blockParams=\"blockParams\"),y},setupHelperArgs:function(l,g,m,y){var S=this.setupParams(l,g,m);return S.loc=p(this),S=this.objectLiteral(S),y?(this.useRegister(\"options\"),m.push(\"options\"),[\"options=\",S]):m?(m.push(S),\"\"):S}},(function(){for(var f=\"break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false\".split(\" \"),l=h.RESERVED_WORDS={},g=0,m=f.length;g<m;g++)l[f[g]]=!0})(),h.isValidJavaScriptVariableName=function(f){return!h.RESERVED_WORDS[f]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(f)};function p(f){var l=f.source.currentLocation;return l?o.safeJsonLiteral(l):\"undefined\"}function a(f,l,g,m,y){var S=l.popStack(),k=g.length;f&&k--;for(var b=m;b<k;b++)S=l.nameLookup(S,g[b],y);return f?[l.aliasable(\"container.strict\"),\"(\",S,\", \",l.quotedString(g[k]),\", \",p(l),\" )\"]:S}e.default=h,t.exports=e.default})),Ac=fe(((e,t)=>{e.__esModule=!0;function s(l){return l&&l.__esModule?l:{default:l}}var r=s(dc()),i=s(Bn()),n=mc(),o=vc(),c=s(Cc()),d=s(Hn()),h=s(Dn()),p=r.default.create;function a(){var l=p();return l.compile=function(g,m){return o.compile(g,m,l)},l.precompile=function(g,m){return o.precompile(g,m,l)},l.AST=i.default,l.Compiler=o.Compiler,l.JavaScriptCompiler=c.default,l.Parser=n.parser,l.parse=n.parse,l.parseWithoutProcessing=n.parseWithoutProcessing,l}var f=a();f.create=a,h.default(f),f.Visitor=d.default,f.default=f,e.default=f,t.exports=e.default})),tt=Ga(Ac(),1),Pc=new Set([\"{\",\"}\",\":\",\",\",\"]\"]),vi={\"=\":\"eq\",\"==\":\"eq\",\"!=\":\"ne\",\">\":\"gt\",\"<\":\"lt\",\">=\":\"gte\",\"<=\":\"lte\",contains:\"__contains\"},Ec={\"+\":\"add\",\"-\":\"sub\",\"*\":\"mul\",\"/\":\"div\",\"%\":\"mod\"},Lc=[\"==\",\"!=\",\">=\",\"<=\",\"&&\",\"||\",\"=\",\">\",\"<\",\"!\",\"+\",\"*\",\"%\",\"-\",\"/\",\"?\"],Rc=[\"and\",\"or\",\"not\"],zn=[\"true\",\"false\",\"null\",\"undefined\"],Ic=new Set([...` \t\\r\n!\"'()<>=&|{}~+*%:,]?`]),yi=/^-?\\d+(\\.\\d+)?$/,He=class extends Error{};function Mc(e,t){const s=e.substring(t+1).trimStart();if(/^[\\]\"'{[(\\d-]/.test(s))return!0;const r=e.indexOf(\"]\",t);return r!==-1&&e.substring(t,r).includes(\",\")}function Oc(e){return e?.type===\"ident\"||e?.type===\"value\"||e?.type===\")\"||e?.type===\"]\"||e?.type===\"}\"}function Nc(e){const t=[];let s=0;for(;s<e.length;){const r=e[s];if(/\\s/.test(r)){s++;continue}if(r===\"(\"||r===\")\"||Pc.has(r)){t.push({type:r,text:r}),s++;continue}if(r==='\"'||r===\"'\"){let c=s+1;for(;c<e.length&&e[c]!==r;)e[c]===\"\\\\\"&&c++,c++;if(c>=e.length)throw new He(\"unterminated string\");t.push({type:\"value\",text:e.slice(s,c+1)}),s=c+1;continue}if(r===\"[\"&&/[\\w\\])]/.test(e[s-1]??\"\")){t.push({type:\"index\",text:r}),s++;continue}if(r===\"[\"&&Mc(e,s)){t.push({type:\"[\",text:r}),s++;continue}const i=Lc.find(c=>e.startsWith(c,s)&&!(c===\"-\"&&/\\d/.test(e[s+1]??\"\")));if(i){t.push({type:\"op\",text:i}),s+=i.length;continue}let n=s;for(;n<e.length&&!Ic.has(e[n])&&!(e[n]===\"[\"&&n>s&&e[n-1]!==\".\"&&e[n-1]!==\"/\");){if(e[n]===\"[\"){const c=e.indexOf(\"]\",n);if(c===-1)throw new He(\"missing ']'\");n=c}n++}if(n===s)throw new He(`unexpected '${r}'`);const o=e.slice(s,n);Rc.includes(o)||o===\"contains\"&&Oc(t[t.length-1])?t.push({type:\"op\",text:o}):zn.includes(o)||yi.test(o)?t.push({type:\"value\",text:o}):t.push({type:\"ident\",text:o}),s=n}return t}var Dc=class{constructor(e){this.tokens=e,this.pos=0,this.usedInfix=!1}peek(e=0){return this.tokens[this.pos+e]}next(){return this.tokens[this.pos++]}isOp(e,...t){return e?.type===\"op\"&&t.includes(e.text)}startsPrimary(e){return e?.type===\"ident\"||e?.type===\"value\"||e?.type===\"(\"||e?.type===\"[\"||e?.type===\"{\"}describe(e){return e?`'${e.text}'`:\"end of expression\"}parseExpression(){const e=this.parseConditional();if(this.peek())throw new He(`unexpected ${this.describe(this.peek())}`);return e}parseArguments(e){const t=[];for(let s=0;s<e;s++)t.push(this.parsePrimary());if(!this.peek())throw new He(\"expected a value\");return t.push(this.parseExpression()),t}parseEmbed(){const e=[this.parsePrimary()];for(;this.peek()?.type===\"ident\"&&this.isOp(this.peek(1),\"=\");){const t=this.next().text;if(this.next(),!this.peek())throw new He(`expected a value after '${t}='`);e.push({kind:\"raw\",text:`${t}=${jt(this.parseConditional())}`})}if(this.peek())throw new He(`unexpected ${this.describe(this.peek())}`);return e}parseCondition(){const e=[this.parseConditional()];for(;this.peek()?.type===\"ident\"&&this.isOp(this.peek(1),\"=\");)e.push(this.parseHashPair());if(this.peek())throw new He(`unexpected ${this.describe(this.peek())}`);return e}parseHashPair(){const e=this.next().text;return this.next(),{kind:\"raw\",text:`${e}=${jt(this.parsePrimary())}`}}parseConditional(){const e=this.parseOr();if(!this.isOp(this.peek(),\"?\"))return e;if(this.next(),!this.peek())throw new He(\"expected a value after '?'\");const t=this.parseConditional();if(this.expect(\":\"),!this.peek())throw new He(\"expected a value after ':'\");const s=this.parseConditional();return this.usedInfix=!0,{kind:\"call\",name:\"cond\",args:[e,t,s]}}parseOr(){return this.parseChain([\"or\",\"||\"],\"or\",()=>this.parseAnd())}parseAnd(){return this.parseChain([\"and\",\"&&\"],\"and\",()=>this.parseNot())}parseChain(e,t,s){const r=[s()];for(;this.isOp(this.peek(),...e);){const i=this.next().text;if(!this.peek())throw new He(`expected a value after '${i}'`);r.push(s())}return r.length===1?r[0]:(this.usedInfix=!0,{kind:\"call\",name:t,args:r})}parseNot(){if(this.isOp(this.peek(),\"not\",\"!\")){const e=this.next().text;if(!this.peek())throw new He(`expected a value after '${e}'`);return this.usedInfix=!0,{kind:\"call\",name:\"not\",args:[this.parseNot()]}}return this.parseComparison()}parseComparison(){const e=this.parseAdditive(),t=this.peek();if(t?.type!==\"op\"||!(t.text in vi))return e;if(this.next(),!this.peek())throw new He(`expected a value after '${t.text}'`);const s=this.parseAdditive(),r=this.peek();if(r?.type===\"op\"&&r.text in vi)throw new He(`comparisons can't be chained (at '${r.text}'), use \"and\" to combine them`);return this.usedInfix=!0,{kind:\"call\",name:vi[t.text],args:[e,s]}}parseAdditive(){return this.parseArithmetic([\"+\",\"-\"],()=>this.parseMultiplicative())}parseMultiplicative(){return this.parseArithmetic([\"*\",\"/\",\"%\"],()=>this.parseUnary())}parseArithmetic(e,t){let s=t();for(;;){let r;const i=this.peek();if(this.isOp(i,...e)){if(r=this.next().text,!this.peek())throw new He(`expected a value after '${r}'`)}else if(e.includes(\"-\")&&i?.type===\"value\"&&i.text.startsWith(\"-\")&&yi.test(i.text))r=\"-\",this.tokens[this.pos]={type:\"value\",text:i.text.slice(1)};else return s;this.usedInfix=!0,s={kind:\"call\",name:Ec[r],args:[s,t()]}}}parseUnary(){if(this.isOp(this.peek(),\"-\")){if(this.next(),!this.peek())throw new He(\"expected a value after '-'\");return this.usedInfix=!0,{kind:\"call\",name:\"sub\",args:[{kind:\"raw\",text:\"0\"},this.parseUnary()]}}return this.parsePrimary()}parsePrimary(){let e=this.parseAtom();for(;;){const t=this.peek();if(t?.type===\"index\"){this.next();const s=this.parseConditional();this.expect(\"]\"),this.usedInfix=!0,e={kind:\"call\",name:\"lookup\",args:[e,s]}}else if(t?.type===\"ident\"&&t.text.startsWith(\".\")&&this.tokens[this.pos-1]?.type===\"]\"){this.next();for(const s of t.text.substring(1).split(\".\")){const r=/^\\[(.*)\\]$/.exec(s)?.[1]??s;if(!r)throw new He(`unexpected '${t.text}'`);e={kind:\"call\",name:\"lookup\",args:[e,{kind:\"raw\",text:JSON.stringify(r)}]}}}else return e}}expect(e){if(this.peek()?.type!==e)throw new He(`expected '${e}' but found ${this.describe(this.peek())}`);this.next()}parseObject(){const e=[];for(;this.peek()?.type!==\"}\";){const t=this.next();if(!t)throw new He(\"expected '}' but found end of expression\");if((t.type===\"ident\"||t.type===\"value\")&&/^\\w+$/.test(t.text))e.push({kind:\"raw\",text:`\"${t.text}\"`});else if(t.type===\"value\"&&/^[\"']/.test(t.text))e.push({kind:\"raw\",text:t.text});else throw new He(`expected a name in the object, e.g. { hp: 10 }, but found '${t.text}'`);if(this.expect(\":\"),e.push(this.parseConditional()),this.peek()?.type!==\",\")break;this.next()}return this.expect(\"}\"),this.usedInfix=!0,{kind:\"call\",name:\"__object\",args:e}}parseList(){const e=[];for(;this.peek()?.type!==\"]\";){if(!this.peek())throw new He(\"expected ']' but found end of expression\");if(e.push(this.parseConditional()),this.peek()?.type!==\",\")break;this.next()}return this.expect(\"]\"),this.usedInfix=!0,{kind:\"call\",name:\"array\",args:e}}parseAtom(){const e=this.peek();if(e?.type===\"{\")return this.next(),this.parseObject();if(e?.type===\"[\")return this.next(),this.parseList();if(e?.type===\"ident\"||e?.type===\"value\")return this.next(),{kind:\"raw\",text:e.text};if(e?.type===\"(\"){this.next();const t=this.isHelperCall()?this.parseHelperCall():this.parseConditional();if(this.peek()?.type!==\")\")throw new He(`expected ')' but found ${this.describe(this.peek())}`);return this.next(),t}if(this.isOp(e,\"not\",\"!\")){const t=e?.text===\"!\"?\"!value\":\"not value\";throw new He(`'${e?.text}' must be inside parentheses here, e.g. (${t})`)}throw e?.type===\"op\"?new He(`expected a value before '${e.text}'`):new He(e?`unexpected ${this.describe(e)}`:\"expected a value\")}isHelperCall(){const e=this.peek(),t=this.peek(1);return this.isOp(e,\"and\",\"or\")?!0:e?.type===\"ident\"&&this.startsPrimary(t)}parseHelperCall(){const e=this.next().text,t=[];for(;this.peek()&&this.peek()?.type!==\")\";)this.peek()?.type===\"ident\"&&this.isOp(this.peek(1),\"=\")?t.push(this.parseHashPair()):t.push(this.parsePrimary());return{kind:\"call\",name:e,args:t}}};function jt(e){return e.kind===\"raw\"?e.text:`(${e.name} ${e.args.map(jt).join(\" \")})`}function Ws(e,t,s){const r=t===\"display\"||t===\"value\";let i=null,n=[];try{n=Nc(e)}catch(h){if(!r||!(h instanceof He))return null;i=h}const o=n.some(h=>h.type===\"op\"||h.type===\"index\"||h.type===\"[\"||h.type===\"{\"),c=new Dc(n);let d=[];if(!i)try{d=t===\"condition\"?c.parseCondition():t===\"arguments\"?c.parseArguments(1):t===\"embed\"?c.parseEmbed():[c.parseExpression()]}catch(h){if(!(h instanceof He)||!o&&!r)return null;i=h}if(i)throw new Error(`Invalid ${s} \"${e.trim()}\": ${i.message}`);return!c.usedInfix&&!r?null:d}function Bc(e){const t=Ws(e,\"condition\",\"condition\");return t&&t.map(jt).join(\" \")}function $c(e){const t=Ws(e,\"arguments\",\"expression\");return t&&t.map(jt).join(\" \")}function Hc(e){const t=Ws(e,\"embed\",\"embed\");return t&&t.map(jt).join(\" \")}function qc(e){const t=Ws(e,\"display\",\"expression\")[0];if(t.kind===\"call\")return`${t.name} ${t.args.map(jt).join(\" \")}`;if(zn.includes(t.text)||yi.test(t.text)||/^[\"']/.test(t.text))throw new Error(`Invalid expression \"${e.trim()}\": expected an attribute or a calculation`);return t.text}function Fc(e){return jt(Ws(e,\"value\",\"expression\")[0])}function Vc(e){const t=[];let s=0,r=null,i=0;for(let n=0;n<e.length;n++){const o=e[n];r?o===\"\\\\\"?n++:o===r&&(r=null):o==='\"'||o===\"'\"?r=o:o===\"(\"||o===\"[\"||o===\"{\"?s++:o===\")\"||o===\"]\"||o===\"}\"?s=Math.max(0,s-1):o===\",\"&&s===0&&(t.push(e.slice(i,n)),i=n+1)}return t.push(e.slice(i)),t.map(n=>n.trim()).filter(n=>n!==\"\")}var bi=/(\\\\*)\\{\\{(~?\\s*)(?:(#if|#unless|#each|#with|else\\s+if|else\\s+unless)(?=[\\s(!])|(set|inc|dec|append|prepend|remove)(?=\\s)|(=)|(#?embed)(?=\\s))/g;function zc(e,t){let s=null,r=0;for(let i=t;i<e.length;i++){const n=e[i];if(s)n===\"\\\\\"?i++:n===s&&(s=null);else if(n==='\"'||n===\"'\")s=n;else if(n===\"{\")r++;else if(n===\"}\"&&r>0)r--;else{if(e.startsWith(\"~}}\",i))return i;if(e.startsWith(\"}}\",i))return i}}return-1}function Un(e){if(!e.includes(\"{{\"))return e;let t=\"\",s=0;bi.lastIndex=0;let r;for(;(r=bi.exec(e))!==null;){if(r[1].length%2===1)continue;const i=r.index+r[0].length,n=zc(e,i);if(n===-1)break;const o=e.slice(i,n);if(r[5]){const c=r.index+r[1].length;t+=e.slice(s,c)+\"{{\"+r[2]+qc(o),s=n}else{const c=r[3]?Bc(o):r[6]?Hc(o):$c(o);c!==null&&(t+=e.slice(s,i)+\" \"+c,s=n)}bi.lastIndex=n}return t+e.slice(s)}var Ts=e=>e==null||e===!1||e===\"\",_i=e=>typeof e==\"number\"||Ts(e)||typeof e==\"string\"&&e.trim()!==\"\"&&!isNaN(Number(e));function St(e,t){if(!_i(t))throw new Error(`\"${e}\" needs numbers, but was given ${JSON.stringify(t)}`);return Ts(t)?0:Number(t)}var Uc=new Set([\"__proto__\",\"prototype\",\"constructor\"]);function br(e){if(Uc.has(e))throw new Error(`\"${e}\" can't be used as a name inside an object`)}function Cs(e){if(!e.includes(\".\")&&!e.includes(\"[\"))return[e];const t=/^[^.[\\]]+/.exec(e);if(!t)return[e];const s=[t[0]];let r=t[0].length;for(;r<e.length;)if(e[r]===\".\"){if(e[r+1]===\"[\"){r++;continue}const i=/^[^.[\\]]+/.exec(e.substring(r+1));if(!i)return[e];s.push(i[0]),r+=1+i[0].length}else if(e[r]===\"[\"){const i=e.indexOf(\"]\",r);if(i===-1)return[e];let n=e.substring(r+1,i).trim();const o=/^([\"'])(.*)\\1$/.exec(n);o&&(n=o[2]),s.push(n),r=i+1}else return[e];return s.forEach(br),s}var Si=e=>typeof e==\"object\"&&e!==null;function Wn(e,t){for(const s of t){if(!Si(e)||!Object.prototype.hasOwnProperty.call(e,s))return null;e=e[s]}return e??null}function Gn(e,t,s,r){const i=Si(e)?structuredClone(e):e==null?{}:null;if(i===null)throw new Error(`${s} isn't an object, so it has no ${t[0]}`);let n=i,o=s;return t.forEach((c,d)=>{if(br(c),d===t.length-1){n[c]=r;return}o+=\".\"+c;let h=Object.prototype.hasOwnProperty.call(n,c)?n[c]:void 0;if(h==null&&(h={},n[c]=h),!Si(h))throw new Error(`${o} isn't an object, so it has no ${t[d+1]}`);n=h}),i}function Xn(e){const t=/^\\s*(\\w+)/.exec(e);if(!t)return null;const s=[];let r=t[0].length;for(;;){const i=/^\\.(\\w+)/.exec(e.substring(r));if(i){s.push({name:i[1]}),r+=i[0].length;continue}if(e[r]!==\"[\")break;const n=Wc(e,r);if(n===-1)return null;s.push({index:e.substring(r+1,n)}),r=n+1}return{attribute:t[1],segments:s,rest:e.substring(r)}}function Wc(e,t){let s=0,r=null;for(let i=t;i<e.length;i++){const n=e[i];if(r)n===\"\\\\\"?i++:n===r&&(r=null);else if(n==='\"'||n===\"'\")r=n;else if(n===\"[\"||n===\"(\"||n===\"{\")s++;else if((n===\"]\"||n===\")\"||n===\"}\")&&(s--,s===0))return n===\"]\"?i:-1}return-1}var Gc=class{constructor(e,t,s){this.goto=null,this.deactivate=new Set,this.scopes=[],this.expressionCache=new Map,this.getStory=e,this.state=t,this.getCurrentSection=s,this.handlebars=tt.default.create();const r=this;this.handlebars.registerHelper(\"embed\",function(...u){const v=u.pop(),_=i(u[0]),w=r.embeddedText(_);if(w===void 0)return;const T=Object.create(null);for(const[P,E]of Object.entries(v.hash??{}))T[P]=i(E);const R=r.scopes,C=v.fn?()=>{const P=r.scopes;r.scopes=R;try{return v.fn(this,{data:v.data})}finally{r.scopes=P}}:void 0;r.scopes=[...R,{params:T,content:C}];try{return new tt.default.SafeString(r.process(w,!0))}finally{r.scopes=R}}),this.handlebars.registerHelper(\"content\",()=>{const u=this.scopes[this.scopes.length-1];return u?.content?new tt.default.SafeString(u.content()):this.hasAttribute(\"content\")?this.getAttribute(\"content\"):\"\"}),this.handlebars.registerHelper(\"seen\",u=>this.state.getSeen(u)),this.handlebars.registerHelper(\"visits\",u=>this.state.getVisits(u)),this.handlebars.registerHelper(\"get\",u=>this.getAttribute(u)),this.handlebars.registerHelper(\"at\",u=>{const v=this.getAttribute(\"_section\");return Array.isArray(u)?u.includes(v):v===u});const i=u=>u&&typeof u==\"object\"&&typeof u.toHTML==\"function\"?u.toString():u;this.handlebars.registerHelper(\"goto\",(...u)=>{const v=u.pop(),_=u.length?i(u[0]):void 0;if(typeof _!=\"string\"||!_||!(_ in this.getStory().sections))return new tt.default.SafeString(Yt(\"Error in {{goto}}:\",_===void 0?'expected a section name, e.g. {{goto \"cave\"}}':`there is no section called \"${_}\"`));let w=0;return v.hash.after!==void 0&&(w=Number(i(v.hash.after)),!Number.isFinite(w)||w<0)?new tt.default.SafeString(Yt(\"Error in {{goto}}:\",`after= should be a number of milliseconds, e.g. after=3000, not \"${v.hash.after}\"`)):(this.goto??(this.goto={section:_,after:w}),\"\")}),this.handlebars.registerHelper(\"deactivate\",(...u)=>{u.pop();const v=u.length?u.map(i):[this.getAttribute(\"_passage\")];for(const _ of v){if(typeof _!=\"string\"||!_)return new tt.default.SafeString(Yt(\"Error in {{deactivate}}:\",u.length?'expected a passage name, e.g. {{deactivate \"door\"}}':\"{{deactivate}} with no passage name only works in a passage\"));const w=this.getCurrentSection()?.passages,T=this.getStory().sections[\"\"]?.passages;if(!(w&&_ in w)&&!(T&&_ in T))return new tt.default.SafeString(Yt(\"Error in {{deactivate}}:\",`there is no passage called \"${_}\" in this section`));this.deactivate.add(_)}return\"\"}),this.handlebars.registerHelper(\"set\",(u,v)=>(this.setAttribute(u,i(v)),\"\")),this.handlebars.registerHelper(\"__value\",u=>(this.evaluated=i(u),\"\")),this.handlebars.registerHelper(\"unset\",u=>(this.setAttribute(u,!1),\"\"));const n=(u,v)=>{this.handlebars.registerHelper(u,(_,...w)=>{const T=w.length>1?St(u,i(w[0])):1,R=St(u,this.getAttribute(_));return this.setAttribute(_,R+v*T),\"\"})};n(\"inc\",1),n(\"dec\",-1),this.handlebars.registerHelper(\"and\",(...u)=>u.slice(0,-1).every(Boolean)),this.handlebars.registerHelper(\"or\",(...u)=>u.slice(0,-1).some(Boolean)),this.handlebars.registerHelper(\"not\",u=>!u),this.handlebars.registerHelper(\"eq\",(u,v)=>u==v),this.handlebars.registerHelper(\"ne\",(u,v)=>u!=v),this.handlebars.registerHelper(\"gt\",(u,v)=>u>v),this.handlebars.registerHelper(\"lt\",(u,v)=>u<v),this.handlebars.registerHelper(\"gte\",(u,v)=>u>=v),this.handlebars.registerHelper(\"lte\",(u,v)=>u<=v);const o=(u,v)=>{this.handlebars.registerHelper(u,(..._)=>{const w=_.slice(0,-1).map(i);if(w.length!==2)throw new Error(`\"${u}\" needs two values, but was given ${w.length}`);return v(St(u,w[0]),St(u,w[1]))})};this.handlebars.registerHelper(\"add\",(...u)=>{const v=u.slice(0,-1).map(i);if(v.length!==2)throw new Error(`\"add\" needs two values, but was given ${v.length}`);const[_,w]=v;if(_i(_)&&_i(w))return St(\"add\",_)+St(\"add\",w);const T=R=>{if(Ts(R))return\"\";if(typeof R==\"object\")throw new Error(`\"add\" can't add ${Array.isArray(R)?\"a list\":\"an object\"}`);return String(R)};return T(_)+T(w)}),o(\"sub\",(u,v)=>u-v),o(\"mul\",(u,v)=>u*v),o(\"div\",(u,v)=>{if(v===0)throw new Error(\"division by zero\");return u/v}),o(\"mod\",(u,v)=>{if(v===0)throw new Error(\"division by zero\");return u%v});const c=(u,v,_)=>{this.handlebars.registerHelper(u,(...w)=>{const T=w.slice(0,-1).map(i);if(T.length===0&&this.hasAttribute(u))return this.getAttribute(u);if(T.length!==1&&!(_&&T.length===2))throw new Error(`\"${u}\" needs ${_?\"one or two values\":\"one value\"}, but was given ${T.length}`);const R=St(u,T[0]);if(T.length===1)return v(R);const C=10**St(u,T[1]);return v(Number((R*C).toPrecision(15)))/C})};c(\"round\",Math.round,!0),c(\"floor\",Math.floor,!1),c(\"ceil\",Math.ceil,!1),c(\"abs\",Math.abs,!1);const d=(u,v)=>{this.handlebars.registerHelper(u,(..._)=>{let w=_.slice(0,-1).map(i);if(w.length===0&&this.hasAttribute(u))return this.getAttribute(u);if(w.length===1&&Array.isArray(w[0])&&(w=w[0].map(i)),w.length===0)throw new Error(`\"${u}\" needs at least one value`);return v(...w.map(T=>St(u,T)))})};d(\"min\",Math.min),d(\"max\",Math.max);const h=(u,v)=>{if(Ts(v))return\"\";if(typeof v==\"object\")throw new Error(`\"${u}\" needs text, but was given ${Array.isArray(v)?\"a list\":\"an object\"}`);return String(v)},p=(u,v)=>{this.handlebars.registerHelper(u,(..._)=>{const w=_.slice(0,-1).map(i);if(w.length===0&&this.hasAttribute(u))return this.getAttribute(u);if(w.length!==1)throw new Error(`\"${u}\" needs one value, but was given ${w.length}`);return v(h(u,w[0]))})};p(\"upper\",u=>u.toUpperCase()),p(\"lower\",u=>u.toLowerCase());const a=u=>u.charAt(0).toUpperCase()+u.substring(1);p(\"capitalise\",a),p(\"capitalize\",a),this.handlebars.registerHelper(\"cond\",(...u)=>{const v=u.slice(0,-1).map(i);if(v.length===0&&this.hasAttribute(\"cond\"))return this.getAttribute(\"cond\");if(v.length!==3)throw new Error(`\"cond\" needs three values, but was given ${v.length}`);return v[0]?v[1]:v[2]}),this.handlebars.registerHelper(\"__contains\",(u,v)=>(u=i(u),v=i(v),Array.isArray(u)?u.some(_=>i(_)===v):Ts(u)?!1:typeof u==\"object\"?Object.prototype.hasOwnProperty.call(u,String(v)):String(u).includes(h(\"contains\",v)))),this.handlebars.registerHelper(\"array\",function(...u){return u.pop(),u.map(i)}),this.handlebars.registerHelper(\"__object\",(...u)=>{u.pop();const v={};for(let _=0;_<u.length;_+=2){const w=String(i(u[_]));br(w),v[w]=i(u[_+1])}return v}),this.handlebars.registerHelper(\"append\",(u,v)=>{const _=this.getAttribute(u)||[],w=Array.isArray(_)?[..._]:[_],T=i(v);return Array.isArray(T)?w.push(...T.map(i)):w.push(T),this.setAttribute(u,w),\"\"}),this.handlebars.registerHelper(\"prepend\",(u,v)=>{const _=this.getAttribute(u)||[],w=Array.isArray(_)?[..._]:[_],T=i(v);return Array.isArray(T)?w.unshift(...T.map(i)):w.unshift(T),this.setAttribute(u,w),\"\"}),this.handlebars.registerHelper(\"pop\",u=>{const v=this.getAttribute(u)||[];if(!Array.isArray(v)||v.length===0)return\"\";const _=[...v],w=_.shift();return this.setAttribute(u,_),w}),this.handlebars.registerHelper(\"remove\",(u,v)=>{const _=this.getAttribute(u)||[];if(!Array.isArray(_))return\"\";const w=i(v),T=_.findIndex(R=>i(R)===w);if(T!==-1){const R=[..._];R.splice(T,1),this.setAttribute(u,R)}return\"\"}),this.handlebars.registerHelper(\"contains\",(u,v)=>{let _;if(typeof u==\"string\"){const T=this.getAttribute(u);_=Array.isArray(T)?T:[]}else if(Array.isArray(u))_=u;else return!1;const w=i(v);return _.some(T=>i(T)===w)}),this.handlebars.registerHelper(\"length\",u=>{let v;if(typeof u==\"string\"){const _=this.getAttribute(u);v=Array.isArray(_)?_:[]}else if(Array.isArray(u))v=u;else return 0;return v.length});const f=(u,v)=>{if(v=i(v),Array.isArray(v))return v.map(i);if(Ts(v))return[];throw typeof v==\"string\"?new Error(`\"${u}\" needs a list, but was given the text \"${v}\". To use an attribute's list, leave out the quotes: (${u} bag), not (${u} \"bag\")`):new Error(`\"${u}\" needs a list, but was given ${typeof v==\"object\"?\"an object\":String(v)}`)},l=(u,v,_,w)=>{this.handlebars.registerHelper(u,(...T)=>{const R=T.slice(0,-1).map(i);if(R.length===0&&this.hasAttribute(u))return this.getAttribute(u);if(R.length<v||R.length>_){const C=v===_?`${v} value${v===1?\"\":\"s\"}`:`${v} to ${_} values`;throw new Error(`\"${u}\" needs ${C}, but was given ${R.length}`)}return w(R)})},g=(u,v)=>Math.trunc(St(u,v));l(\"join\",1,3,([u,v,_])=>{const w=f(\"join\",u).map(R=>h(\"join\",R)),T=v===void 0?\", \":h(\"join\",v);return _===void 0||w.length<2?w.join(T):w.slice(0,-1).join(T)+h(\"join\",_)+w[w.length-1]});const m=new Intl.Collator(void 0,{numeric:!0,sensitivity:\"base\"});l(\"sort\",1,1,([u])=>f(\"sort\",u).sort((v,_)=>{const w=typeof v==\"number\",T=typeof _==\"number\";return w&&T?v-_:w!==T?w?-1:1:m.compare(h(\"sort\",v),h(\"sort\",_))})),l(\"shuffle\",1,1,([u])=>{const v=f(\"shuffle\",u);for(let _=v.length-1;_>0;_--){const w=Math.floor(Math.random()*(_+1));[v[_],v[w]]=[v[w],v[_]]}return v}),l(\"slice\",2,3,([u,v,_])=>{const w=g(\"slice\",v),T=_===void 0?void 0:g(\"slice\",_);return typeof u==\"string\"?u.slice(w,T):f(\"slice\",u).slice(w,T)}),l(\"first\",1,1,([u])=>f(\"first\",u)[0]??\"\"),l(\"last\",1,1,([u])=>f(\"last\",u).slice(-1)[0]??\"\"),l(\"indexof\",2,2,([u,v])=>typeof u==\"string\"?u.indexOf(h(\"indexof\",v)):f(\"indexof\",u).indexOf(v)),l(\"count\",2,2,([u,v])=>{if(typeof u==\"string\"){const _=h(\"count\",v);return _===\"\"?0:u.split(_).length-1}return f(\"count\",u).filter(_=>_===v).length}),l(\"range\",2,2,([u,v])=>{const _=g(\"range\",u),w=g(\"range\",v);if(Math.abs(w-_)>=1e4)throw new Error(`\"range\" can make a list of up to 10,000 numbers, but was asked for ${Math.abs(w-_)+1}`);const T=w>=_?1:-1,R=[];for(let C=_;C!==w+T;C+=T)R.push(C);return R});const y=u=>String(u).replace(/&/g,\"&\").replace(/\"/g,\""\"),S=new Map,k=(u,v,_,w)=>{if(typeof u!=\"string\"||!u.includes(\"{{\"))return u;const T=(w?\"h:\":\"t:\")+u;let R=S.get(T);return R||(R=this.handlebars.compile(Un(u),{compat:!0,noEscape:!w}),S.set(T,R)),R(v,{data:_.data})},b=(u,v)=>{let _=\"\";const w=k(v.hash.set||\"\",u,v,!1);if(w){const T=this.getStory().expressions?Vc(w):w.split(\",\").map(R=>R.trim());_+=` data-set=\"${y(JSON.stringify(T))}\"`}return _};this.handlebars.registerHelper(\"section\",function(u,v){const _=k(v.hash.text||u,this,v,!0);return new tt.default.SafeString(`<a class=\"squiffy-link link-section\" data-section=\"${y(u)}\"${b(this,v)} role=\"link\" tabindex=\"0\">${_}</a>`)}),this.handlebars.registerHelper(\"passage\",function(u,v){const _=k(v.hash.text||u,this,v,!0);return new tt.default.SafeString(`<a class=\"squiffy-link link-passage\" data-passage=\"${y(u)}\"${b(this,v)} role=\"link\" tabindex=\"0\">${_}</a>`)})}evaluate(e){let t=this.expressionCache.get(e);return t||(t=this.handlebars.compile(`{{__value ${Fc(e)}}}`),this.expressionCache.set(e,t)),this.evaluated=void 0,t(this.context()),this.evaluated}embeddedText(e){if(typeof e!=\"string\")return;const t=this.getCurrentSection();if(t.passages&&Object.prototype.hasOwnProperty.call(t.passages,e))return t.passages[e].text||\"\";const s=this.getStory();if(Object.prototype.hasOwnProperty.call(s.sections,e))return s.sections[e].text||\"\"}get params(){return this.scopes[this.scopes.length-1]?.params}isParam(e){const t=this.params;return!!t&&Object.prototype.hasOwnProperty.call(t,Cs(e)[0])}hasAttribute(e){return this.isParam(e)||this.state.has(e)}getAttribute(e){if(this.isParam(e)){const[t,...s]=Cs(e);return structuredClone(Wn(this.params[t],s))}return this.state.get(e)}setAttribute(e,t){if(this.isParam(e)){const[s,...r]=Cs(e);typeof t>\"u\"&&(t=!0),this.params[s]=r.length?Gn(this.params[s],r,s,t):structuredClone(t);return}this.state.set(e,t)}context(){const e=this.state.getStore(),t=this.params;if(!t||!Object.keys(t).length)return e;const s=r=>typeof r==\"string\"&&Object.prototype.hasOwnProperty.call(t,r);return new Proxy({},{get:(r,i)=>s(i)?structuredClone(t[i]):Reflect.get(e,i),has:(r,i)=>s(i)||Reflect.has(e,i),ownKeys:()=>[...new Set([...Object.keys(t),...Reflect.ownKeys(e)])],getOwnPropertyDescriptor:(r,i)=>s(i)?{enumerable:!0,configurable:!0,value:structuredClone(t[i])}:Reflect.getOwnPropertyDescriptor(e,i)})}process(e,t){try{return e=this.handlebars.compile(Un(e),{compat:!0})(this.context()),t?pi(e,{async:!1}).trim():gi(e,{async:!1}).trim()}catch(s){const r=s instanceof Error?s.message:String(s);return console.error(\"Squiffy template error:\",r),Yt(\"Template error:\",r)}}};function Yt(e,t){const s=r=>r.replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\");return`<div class=\"squiffy-error\" style=\"color: red; background: #ffe0e0; padding: 8px; border: 1px solid red; margin: 4px 0; font-family: monospace; white-space: pre-wrap;\"><strong>${s(e)}</strong> ${s(t)}</div>`}var Xc=class{constructor(){this.listeners=new Map}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}off(e,t){this.listeners.get(e)?.delete(t)}once(e,t){const s=this.on(e,r=>{s(),t(r)});return s}emit(e,t){this.listeners.get(e)?.forEach(s=>{try{s(t)}catch(r){console.error(`[Squiffy] handler for \"${String(e)}\" failed`,r)}})}},jc=class{constructor(e,t,s,r,i){this.store={},this.readOnly=!1,this.persist=e,this.storyId=t,this.onSet=s,this.emitter=r,this.onSetInternal=i}usePersistentStorage(){return this.persist&&window.localStorage&&this.storyId}set(e,t){this.setAt(Cs(e),t)}setAt(e,t){if(this.readOnly)return;const[s,...r]=e;if(!r.length){this.setInternal(s,t,!0);return}typeof t>\"u\"&&(t=!0);const i=this.has(s)?this.store[s]:null;this.setInternal(s,Gn(i,r,s,t),!0)}setInternal(e,t,s){typeof t>\"u\"&&(t=!0),s&&this.onSetInternal&&this.onSetInternal(e,this.getAt([e]),structuredClone(t)),this.store[e]=structuredClone(t),this.usePersistentStorage()&&(localStorage[this.storyId+\"-\"+e]=JSON.stringify(t)),s&&this.emitter.emit(\"set\",{attribute:e,value:t}),this.onSet(e,t)}has(e){return Object.prototype.hasOwnProperty.call(this.store,e)}get(e){return this.getAt(Cs(e))}getAt(e){const[t,...s]=e;if(!this.has(t))return null;const r=s.length?Wn(this.store[t],s):this.store[t];return structuredClone(r)}getStore(){return new Proxy({},{get:(e,t)=>typeof t==\"string\"&&(this.has(t)||!(t in e))?this.getAt([t]):Reflect.get(e,t),has:(e,t)=>this.has(String(t)),ownKeys:()=>Object.keys(this.store),getOwnPropertyDescriptor:(e,t)=>{const s=String(t);if(this.has(s))return{enumerable:!0,configurable:!0,value:this.getAt([s])}}})}load(){if(!this.usePersistentStorage())return;const e=Object.keys(localStorage);for(const t of e)if(t.startsWith(this.storyId+\"-\")){const s=t.substring(this.storyId.length+1);this.store[s]=JSON.parse(localStorage[t])}}reset(){if(this.store={},!this.usePersistentStorage())return;const e=Object.keys(localStorage);for(const t of e)t.startsWith(this.storyId)&&localStorage.removeItem(t)}setSeen(e){let t=this.get(\"_seen_sections\");t||(t=[]);const s=this.get(\"_visits\")||{};s[e]=this.getVisitsFrom(s,t,e)+1,this.set(\"_visits\",s),t.indexOf(e)==-1&&(t.push(e),this.set(\"_seen_sections\",t))}getSeen(e){const t=this.get(\"_seen_sections\");return t?t.indexOf(e)>-1:!1}getVisits(e){return this.getVisitsFrom(this.get(\"_visits\")||{},this.get(\"_seen_sections\")||[],e)}getVisitsFrom(e,t,s){return Object.prototype.hasOwnProperty.call(e,s)?e[s]:t.indexOf(s)>-1?1:0}};function jn(e,t){return!e&&!t?!0:!e||!t||e.length!==t.length?!1:e.every((s,r)=>s===t[r])}function Yc(e,t,s,r,i,n){function o(a){return a.replace(/'/g,\"\\\\'\")}function c(a){return s.querySelectorAll(`[data-source='[[${o(a)}]]']`)}function d(a,f){return s.querySelectorAll(`[data-source='[[${o(a)}]][${o(f)}]']`)}function h(a){const f=new Map;for(const l of a.querySelectorAll(\"a.link-passage[data-passage]\")){const g=l.getAttribute(\"data-passage\");f.has(g)||f.set(g,[]),f.get(g).push(l)}return f}function p(a,f){const l=h(a);a.innerHTML=f;const g=h(a);for(const[m,y]of l)y.forEach((S,k)=>{const b=g.get(m)?.[k];if(!(!b||!S.classList.contains(\"disabled\"))){i(b);for(const u of[\"data-clicked\",\"data-deactivated-by\"]){const v=S.getAttribute(u);v!==null&&b.setAttribute(u,v)}}})}for(const a of Object.keys(e.sections)){const f=c(a);if(f.length){const l=t.sections[a];if(l){const g=e.sections[a],m=!jn(g.attributes,l.attributes),y=l.text!=g.text;if(m&&n(l.attributes||[]),y||m)for(const S of f)p(S,r(l.text||\"\",l))}else for(const g of f)g.closest(\".squiffy-output-section\")?.remove()}if(e.sections[a].passages)for(const l of Object.keys(e.sections[a].passages)){const g=d(a,l);if(!g.length)continue;const m=t.sections[a]?.passages&&t.sections[a]?.passages[l];if(m){const y=e.sections[a].passages[l],S=!jn(y.attributes,m.attributes),k=m.text!=y.text;if(S&&n(m.attributes||[]),k||S)for(const b of g)p(b,r(m.text||\"\",t.sections[a]))}else for(const y of g)y.closest(\".squiffy-output-passage\")?.remove()}}}var Zc=class{constructor(e,t,s,r,i,n,o,c,d,h,p){this.plugins=[],this.outputElement=e,this.textProcessor=t,this.state=s,this.linkHandler=r,this.getSectionText=i,this.getPassageText=n,this.processText=o,this.addTransition=c,this.animation=d,this.emitter=h,this.resolveAssetsInHtml=p}add(e){const t=e.init({outputElement:this.outputElement,registerHelper:(s,r)=>{this.textProcessor.handlebars.registerHelper(s,r)},registerLinkHandler:(s,r)=>{this.linkHandler.registerLinkHandler(s,r)},get:s=>this.state.get(s),set:(s,r)=>this.state.set(s,r),getSectionText:this.getSectionText,getPassageText:this.getPassageText,processText:this.processText,resolveAssetsInHtml:this.resolveAssetsInHtml,addTransition:this.addTransition,animation:this.animation,on:(s,r)=>this.emitter.on(s,r),off:(s,r)=>this.emitter.off(s,r),once:(s,r)=>this.emitter.once(s,r)});return this.plugins.push(e),t}onWrite(e){this.plugins.forEach(t=>t.onWrite?.(e))}onLoad(){this.plugins.forEach(e=>e.onLoad?.())}};function Yn(e,t){return new Promise(s=>{e.addEventListener(\"transitionend\",function(){e.innerHTML=t,e.addEventListener(\"transitionend\",function(){e.classList.remove(\"fade-in\"),s()},{once:!0}),e.classList.remove(\"fade-out\"),e.classList.add(\"fade-in\")},{once:!0}),e.classList.add(\"fade-out\")})}function Jc(){return{name:\"replaceLabel\",init(e){e.registerHelper(\"label\",function(t,s){return new tt.default.SafeString(`<span class=\"squiffy-label-${t}\">${s.fn(this)}</span>`)}),e.registerHelper(\"replace\",function(t,s){const r=String(s.fn(this)),i=e.outputElement.querySelectorAll(`.squiffy-label-${t}`),n=i[i.length-1];if(n){const o=r.includes(`\n\n`)?gi(r,{async:!1}).trim():pi(r,{async:!1}).trim();e.addTransition(()=>Yn(n,o))}return\"\"})}}}function Kc(){const e=i=>i.replace(/&/g,\"&\").replace(/'/g,\"'\").replace(/\"/g,\""\").replace(/</g,\"<\").replace(/>/g,\">\"),t=(i,n,o,c)=>{const d=o.map(l=>l.toString()),h=r(d,null),p=c.hash.set||\"\";p&&i.set(p,h[0]);const a=e(JSON.stringify(h.slice(1))||\"\"),f=c.hash.show==\"next\"?h[1]:h[0];return new tt.default.SafeString(`<a class=\"squiffy-link\" data-handler=\"${n}\" data-value=\"${e(h[0])}\" data-show=\"${c.hash.show||\"\"}\" data-options='${a}' data-attribute=\"${p}\" role=\"link\">${f}</a>`)},s=(i,n,o)=>{const c={},d=JSON.parse(n.getAttribute(\"data-options\")??\"[]\")||[],h=r(d,o?n.getAttribute(\"data-value\"):\"\");n.innerHTML=n.getAttribute(\"data-show\")==\"next\"?h[1]:h[0],n.setAttribute(\"data-value\",h[0]),n.setAttribute(\"data-options\",JSON.stringify(h.slice(1))||\"\"),h[1]||(c.disableLink=!0);const p=n.getAttribute(\"data-attribute\");return p&&i.set(p,n.getAttribute(\"data-value\")),window.getSelection()?.removeAllRanges(),c},r=(i,n)=>{const o=i[0],c=i.slice(1);return n&&c.push(n),[o,...c]};return{name:\"rotateSequence\",init(i){i.registerHelper(\"rotate\",(n,o)=>t(i,\"rotate\",n,o)),i.registerHelper(\"sequence\",(n,o)=>t(i,\"sequence\",n,o)),i.registerLinkHandler(\"rotate\",n=>s(i,n,!0)),i.registerLinkHandler(\"sequence\",n=>s(i,n,!1))}}}function Qc(){return{name:\"random\",init(e){e.registerHelper(\"random\",(t,s)=>{const r=t.map(o=>o.toString()),i=r[Math.floor(Math.random()*r.length)],n=s.hash.set||\"\";return n&&e.set(n,i),new tt.default.SafeString(i)})}}}function eu(){let e;return{name:\"live\",init(t){e=t,e.registerHelper(\"live\",(r,i)=>{const n=i.hash.section||\"\";if(n)return new tt.default.SafeString(`<span class=\"squiffy-live\" data-attribute=\"${r}\" data-section=\"${n}\"></span>`);const o=i.hash.passage||\"\";return o?new tt.default.SafeString(`<span class=\"squiffy-live\" data-attribute=\"${r}\" data-passage=\"${o}\"></span>`):new tt.default.SafeString(`<span class=\"squiffy-live\" data-attribute=\"${r}\"></span>`)});const s=async r=>{const i=[],n=[...e.outputElement.querySelectorAll(\".squiffy-live[data-attribute]\")].filter(o=>Cs(o.dataset.attribute)[0]===r.attribute);for(const o of n){const c=o.innerHTML;let d=\"\";if(o.dataset.section){const h=e.getSectionText(o.dataset.section);h&&(d=e.processText(h,!0))}else if(o.dataset.passage){const h=e.getPassageText(o.dataset.passage);h&&(d=e.processText(h,!0))}else d=o.dataset.attribute==r.attribute?r.value:e.get(o.dataset.attribute);c!==d&&i.push(Yn(o,d))}await Promise.all(i)};e.on(\"set\",async r=>{await s(r)})},onWrite(t){e&&t.querySelectorAll(\".squiffy-live\").forEach(s=>{if(s.dataset.section){const r=e.getSectionText(s.dataset.section);r&&(s.innerHTML=e.processText(r,!0))}else if(s.dataset.passage){const r=e.getPassageText(s.dataset.passage);r&&(s.innerHTML=e.processText(r,!0))}else{const r=s.dataset.attribute;s.textContent=r?e.get(r):\"\"}})}}}function tu(){let e;const t=r=>{const i={};for(const[n,o]of Object.entries(r)){if(o==null){i[n]=o;continue}try{i[n]=JSON.parse(o)}catch{i[n]=o}}return i},s=r=>{for(const i of r.querySelectorAll(\".squiffy-animate\")){const n=t(i.dataset);if(!n.content)continue;const o=n.content.includes(`\n\n`)?gi(n.content,{async:!1}):pi(n.content,{async:!1});if(i.innerHTML=e.resolveAssetsInHtml(o.trim()),!n.name)continue;const c=i.innerHTML;let d=[];const h=()=>{for(const f of d)e.animation.removeLinkAnimation(f);d=[...i.querySelectorAll(\"a\")];for(const f of d)e.animation.addLinkAnimation(f,a)},p=()=>{if(n.trigger!==\"link\"){i.innerHTML=c;return}const f=d;i.innerHTML=c,h(),d.forEach((l,g)=>{const m=f[g];if(m){m.classList.contains(\"disabled\")&&l.classList.add(\"disabled\");for(const y of[\"tabindex\",\"data-clicked\",\"data-deactivated-by\"]){const S=m.getAttribute(y);S!==null&&l.setAttribute(y,S)}}})},a=()=>{n.loop?e.animation.runAnimation(n.name,i,n,()=>{},!0):(e.animation.isInitiallyHidden(n.name)&&(i.style.opacity=\"0\"),e.addTransition(()=>new Promise(f=>{i.style.opacity=\"\",e.animation.runAnimation(n.name,i,n,()=>{i.classList.remove(\"squiffy-animate\"),p(),f()},!1)})))};n.trigger===\"link\"?h():a()}};return{name:\"animate\",init(r){e=r,e.registerHelper(\"animate\",function(i,n){const o=n.fn(this),c={name:i,content:o,...n.hash},d=Object.entries(c).map(([p,a])=>` data-${tt.default.escapeExpression(p)}=\"${tt.default.escapeExpression(JSON.stringify(a))}\"`).join(\"\"),h=o.includes(`\n\n`)?\"div\":\"span\";return new tt.default.SafeString(`<${h} class=\"squiffy-animate\"${d}></${h}>`)})},onWrite(r){s(r)},onLoad(){s(e.outputElement)}}}var Gs={ReplaceLabel:Jc,RotateSequencePlugin:Kc,RandomPlugin:Qc,LivePlugin:eu,AnimatePlugin:tu},su=class{constructor(){this.linkHandlers={}}registerLinkHandler(e,t){this.linkHandlers[e]=t}handleLink(e){const t=e.getAttribute(\"data-handler\")||\"\",s=this.linkHandlers[t];return s?[!0,t,s(e)]:[!1,t,{}]}},Nt=typeof window<\"u\",ct=Nt?window:null,Z=Nt?document:null,Fe={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},ye={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},vt={NONE:0,AUTO:1,FORCE:2},Ke={replace:0,none:1,blend:2},Zn=Symbol(),as=Symbol(),ki=Symbol(),Xs=Symbol(),Jn=Symbol(),Ve=1e-11,Lt=1e12,ut=1e3,ed=\"var(\",_r=[],wi=(()=>{const e=new Map;return e.set(\"x\",\"translateX\"),e.set(\"y\",\"translateY\"),e.set(\"z\",\"translateZ\"),e})(),ls=[\"perspective\",\"translateX\",\"translateY\",\"translateZ\",\"rotate\",\"rotateX\",\"rotateY\",\"rotateZ\",\"scale\",\"scaleX\",\"scaleY\",\"scaleZ\",\"skew\",\"skewX\",\"skewY\"],Kn=ls.reduce((e,t)=>({...e,[t]:t+\"(\"}),{}),ie=()=>{},ru=e=>e,iu=/\\)\\s*[-.\\d]/,nu=/(^#([\\da-f]{3}){1,2}$)|(^#([\\da-f]{4}){1,2}$)/i,ou=/rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)/i,au=/rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)\\s*\\)/i,lu=/hsl\\(\\s*(-?\\d+|-?\\d*.\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*\\)/i,cu=/hsla\\(\\s*(-?\\d+|-?\\d*.\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)\\s*\\)/i,Qn=/[-+]?\\d*\\.?\\d+(?:e[-+]?\\d)?/gi,eo=/^([-+]?\\d*\\.?\\d+(?:e[-+]?\\d+)?)([a-z]+|%)$/i,uu=/([a-z])([A-Z])/g,to=/(\\*=|\\+=|-=)/,hu=/var\\(\\s*(--[\\w-]+)(?:\\s*,\\s*([^)]+))?\\s*\\)/,js={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:ut,delay:0,loopDelay:0,ease:\"out(2)\",composition:Ke.replace,modifier:ru,onBegin:ie,onBeforeUpdate:ie,onUpdate:ie,onLoop:ie,onPause:ie,onComplete:ie,onRender:ie},We={current:null,root:Z},U={defaults:js,precision:4,timeScale:1,tickThreshold:200,editor:null},so={version:\"4.5.0\",engine:null};Nt&&(ct.AnimeJS||(ct.AnimeJS=[]),ct.AnimeJS.push(so));var Sr=e=>e.replace(uu,\"$1-$2\").toLowerCase(),je=(e,t)=>e.indexOf(t)===0,Zt=Date.now,Qe=Array.isArray,Ye=e=>e&&e.constructor===Object,st=e=>typeof e==\"number\"&&!isNaN(e),Ze=e=>typeof e==\"string\",qe=e=>typeof e==\"function\",F=e=>typeof e>\"u\",cs=e=>F(e)||e===null,kr=e=>Nt&&e instanceof SVGElement,ro=e=>nu.test(e),io=e=>je(e,\"rgb\"),no=e=>je(e,\"hsl\"),du=e=>ro(e)||(io(e)||no(e))&&(e[e.length-1]===\")\"||!iu.test(e)),As=e=>!U.defaults.hasOwnProperty(e),fu=[\"opacity\",\"rotate\",\"overflow\",\"color\"],pu=(e,t)=>{if(fu.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===\"scale\"){const s=e.parentNode;return s&&s.tagName===\"filter\"}return!0}},us=e=>Ze(e)?parseFloat(e):e,hs=Math.pow,kt=Math.sqrt,xi=Math.sin,Ti=Math.cos,wt=Math.abs,wr=Math.exp,gu=Math.ceil,Ps=Math.floor,mu=Math.asin,oo=Math.max,xr=Math.atan2,Dt=Math.PI,Ci=Math.round,j=(e,t,s)=>e<t?t:e>s?s:e,z=(e,t)=>{if(t<0)return e;if(!t)return Ci(e);const s=10**t;return Ci(e*s)/s},ds=(e,t)=>Qe(t)?t.reduce((s,r)=>wt(r-e)<wt(s-e)?r:s):t?Ci(e/t)*t:e,Jt=(e,t,s)=>s===1?t:s===0?e:e+(t-e)*s,Tr=e=>e===1/0?Lt:e===-1/0?-Lt:e,Es=e=>e<=1e-11?Ve:Tr(z(e,11)),ot=e=>Qe(e)?[...e]:e,xt=(e,t)=>{const s={...e};for(let r in t){const i=e[r];s[r]=F(i)?t[r]:i}return s},Ce=(e,t,s,r=\"_prev\",i=\"_next\")=>{let n=e._head,o=i;for(s&&(n=e._tail,o=r);n;){const c=n[o];t(n),n=c}},Rt=(e,t,s=\"_prev\",r=\"_next\")=>{const i=t[s],n=t[r];i?i[r]=n:e._head=n,n?n[s]=i:e._tail=i,t[s]=null,t[r]=null},It=(e,t,s,r=\"_prev\",i=\"_next\")=>{let n=e._tail;for(;n&&s&&s(n,t);)n=n[r];const o=n?n[i]:e._head;n?n[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=n,t[i]=o},vu=(e,t,s)=>{const r=e.style.transform;if(r){const i=e[Xs];let n=0;const o=r.length;let c;for(;n<o;){for(;n<o&&r.charCodeAt(n)===32;)n++;if(n>=o)break;const h=n;for(;n<o&&r.charCodeAt(n)!==40;)n++;if(n>=o)break;const p=r.substring(h,n);let a=1;const f=n+1;let l=-1,g=-1;for(n++;n<o&&a>0;){const y=r.charCodeAt(n);y===40?a++:y===41?a--:y===44&&a===1&&(l===-1?l=n:g===-1&&(g=n)),n++}const m=n-1;p===\"translate\"||p===\"translate3d\"?(l===-1?i.translateX=r.substring(f,m).trim():(i.translateX=r.substring(f,l).trim(),g===-1?i.translateY=r.substring(l+1,m).trim():(i.translateY=r.substring(l+1,g).trim(),i.translateZ=r.substring(g+1,m).trim())),c=r.substring(f,m)):p===\"scale\"||p===\"scale3d\"?l===-1?i.scale=r.substring(f,m).trim():(i.scaleX=r.substring(f,l).trim(),g===-1?i.scaleY=r.substring(l+1,m).trim():(i.scaleY=r.substring(l+1,g).trim(),i.scaleZ=r.substring(g+1,m).trim())):i[p]=r.substring(f,m)}if(t===\"translate3d\"&&c)return s&&(s[t]=c),c;const d=i[t];if(!F(d))return s&&(s[t]=d),d}return t===\"translate3d\"?\"0px, 0px, 0px\":t===\"rotate3d\"?\"0, 0, 0, 0deg\":je(t,\"scale\")?\"1\":je(t,\"rotate\")||je(t,\"skew\")?\"0deg\":\"0px\"},ao=e=>{let t=\"\";for(let s=0,r=ls.length;s<r;s++){const i=ls[s],n=e[i];if(n!==void 0){if(i===\"translateX\"){const o=e.translateY;if(o!==void 0){const c=e.translateZ;c!==void 0?(t+=`translate3d(${n},${o},${c}) `,s+=2):(t+=`translate(${n},${o}) `,s+=1);continue}}if(i===\"scaleX\"&&e.scale===void 0){const o=e.scaleY;if(o!==void 0){const c=e.scaleZ;c!==void 0?(t+=`scale3d(${n},${o},${c}) `,s+=2):(t+=`scale(${n},${o}) `,s+=1);continue}}t+=`${Kn[i]}${n}) `}i===\"rotateZ\"&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},Ai=[];function lo(e,t){if(!e)return null;const s=Ai.length;e:for(let r=0;r<s;r++){const i=Ai[r];if(i.detect&&!i.detect(e))continue;const n=i.targetAdapters;for(let o=0,c=n.length;o<c;o++){const d=n[o];if(d.detect(e)){const h=d.props[t];if(h&&(!h.gate||h.gate(e)))return h;break e}}}for(let r=0;r<s;r++){const i=Ai[r];if(i.detect&&!i.detect(e))continue;const n=i.propertyResolvers;for(let o=0,c=n.length;o<c;o++){const d=n[o](e,t);if(d)return d}}return null}var yu=e=>{const t=ou.exec(e)||au.exec(e),s=F(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],s]},bu=e=>{const t=e.length,s=t===4||t===5;return[+(\"0x\"+e[1]+e[s?1:2]),+(\"0x\"+e[s?2:3]+e[s?2:4]),+(\"0x\"+e[s?3:5]+e[s?3:6]),t===5||t===9?+(+(\"0x\"+e[s?4:7]+e[s?4:8])/255).toFixed(3):1]},Pi=(e,t,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e),_u=e=>{const t=lu.exec(e)||cu.exec(e),s=+t[1]/360,r=+t[2]/100,i=+t[3]/100,n=F(t[4])?1:+t[4];let o,c,d;if(r===0)o=c=d=i;else{const h=i<.5?i*(1+r):i+r-i*r,p=2*i-h;o=z(Pi(p,h,s+1/3)*255,0),c=z(Pi(p,h,s)*255,0),d=z(Pi(p,h,s-1/3)*255,0)}return[o,c,d,n]},Su=e=>io(e)?yu(e):ro(e)?bu(e):no(e)?_u(e):[0,0,0,1],W=(e,t)=>F(e)?t:e,co=(e,t)=>{const s=e.match(hu),r=t[as]?t:document.documentElement;let i=getComputedStyle(r)?.getPropertyValue(s[1]);return(!i||i.trim()===\"\")&&s[2]&&(i=s[2].trim()),i||0},Xe=(e,t,s,r,i,n)=>{if(qe(e)){if(!i){const c=e(t,s,r,n);return isNaN(+c)?c||0:+c}const o=()=>{const c=e(t,s,r,n);return isNaN(+c)?c||0:+c};return i.func=o,o()}if(Ze(e)&&je(e,\"var(\")){if(!i)return co(e,t);const o=()=>co(e,t);return i.func=o,o()}return e},Ei=(e,t)=>e[as]?e[ki]&&pu(e,t)?Fe.ATTRIBUTE:ls.includes(t)||wi.get(t)?Fe.TRANSFORM:je(t,\"--\")?Fe.CSS_VAR:t in e.style?Fe.CSS:t in e?Fe.OBJECT:Fe.ATTRIBUTE:Fe.OBJECT,uo=(e,t,s)=>{const r=e.style[t];r&&s&&(s[t]=r);const i=r||getComputedStyle(e[Jn]||e).getPropertyValue(t);return i===\"auto\"?\"0\":i},fs=(e,t,s,r)=>{const i=F(s)?Ei(e,t):s,n=lo(e,t);if(n){const o=n.get(e);return o&&r&&(r[t]=o),o??0}if(i===Fe.OBJECT){const o=e[t];return o&&r&&(r[t]=o),o||0}if(i===Fe.ATTRIBUTE){const o=e.getAttribute(t);return o&&r&&(r[t]=o),o}return i===Fe.TRANSFORM?vu(e,t,r):i===Fe.CSS_VAR?uo(e,t,r).trimStart():uo(e,t,r)},ps=(e,t,s)=>s===\"-\"?e-t:s===\"+\"?e+t:e*t,Li=()=>({t:ye.NUMBER,n:0,u:null,o:null,d:null,s:null}),pt=(e,t)=>{if(t.t=ye.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;const s=+e;if(!isNaN(s))return t.n=s,t;let r=e;r[1]===\"=\"&&(t.o=r[0],r=r.slice(2));const i=r.includes(\" \")?!1:eo.exec(r);if(i)return t.t=ye.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(du(r))return t.t=ye.COLOR,t.d=Su(r),t;{const n=r.match(Qn);return t.t=ye.COMPLEX,t.d=n?n.map(Number):[],t.s=r.split(Qn)||[],t}},ho=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=ot(e._toNumbers),t.s=ot(e._strings),t),rt=Li(),fo=(e,t,s)=>{const r=e._modifier,i=e._fromNumbers,n=e._toNumbers,o=e._strings;let c=o[0];for(let d=0,h=n.length;d<h;d++){const p=r(z(Jt(i[d],n[d],t),s)),a=o[d+1];c+=`${a?p+a:p}`,e._numbers[d]=p}return c},Cr=(e,t,s,r,i)=>{const n=e.parent,o=e.duration,c=e.completed,d=e.iterationDuration,h=e.iterationCount,p=e._currentIteration,a=e._loopDelay,f=e._reversed,l=e._alternate,g=e._hasChildren,m=e._delay,y=e._currentTime,S=m+d,k=t-m,b=j(y,-m,o),u=j(k,-m,o),v=k-y,_=u>0,w=u>=o,T=o<=Ve,R=i===vt.FORCE;let C=0,P=k,E=0;if(h>1){const B=d+(w?0:a),M=~~(u/B);e._currentIteration=j(M,0,h),w&&e._currentIteration--,C=e._currentIteration%2,P=u-M*B||0}const N=f^(l&&C),D=e._ease;let q=w?N?0:o:N?d-P:P;D&&(q=d*D(q/d)||0);const L=(n?n.backwards:k<y)?!N:!!N;if(e._currentTime=k,e._iterationTime=q,e.backwards=L,_&&!e.began?(e.began=!0,!s&&!(n&&(L||!n.began))&&e.onBegin(e)):k<=0&&(e.began=!1),!s&&!g&&_&&e._currentIteration!==p&&e.onLoop(e),R||i===vt.AUTO&&(t>=(n&&m>0?0:m)&&t<=S||t<=m&&b>m||t>=S&&b!==o)||q>=S&&b!==o||q<=m&&b>0&&!w||t<=b&&b===o&&c||w&&!c&&T){if(_&&(e.computeDeltaTime(b),s||e.onBeforeUpdate(e)),!g){const B=R||(L?v*-1:v)>=U.tickThreshold,M=z(e._offset+(n?n._offset:0)+m+q,12);let I=e._head,V,X,Y,G,K=0;for(;I;){const oe=I._composition,ne=I._currentTime,we=I._changeDuration,me=I._absoluteStartTime+I._changeDuration,ue=I._nextRep,J=I._prevRep,re=oe!==Ke.none,Me=J?J._absoluteStartTime+J._changeDuration:0,Re=J&&J.parent!==I.parent,Ae=!ue||ue._isOverridden?me:ue.parent===I.parent?me+ue._delay:ue._absoluteStartTime<ue._absoluteUpdateStartTime?ue._absoluteStartTime:ue._absoluteUpdateStartTime;if((B||(ne!==we||M<=Ae||J&&!Re&&(!ue||ue.parent!==I.parent))&&(ne!==0||M>=I._absoluteStartTime||Re&&!I._hasFromValue&&!J._isOverridden&&M>=Me||ue&&!ue._isOverridden&&ue.parent===I.parent&&ue._currentTime!==0&&q<ue._startTime))&&(!J||Re||q>=I._startTime)&&(!re||!I._isOverridden&&(!I._isOverlapped||M<=me)&&(!ue||ue._isOverridden||M<=Ae)&&(!J||J._isOverridden||(Re?M>=I._absoluteStartTime||!I._hasFromValue&&M>=Me:M>=Me+I._delay)))){const $e=I._currentTime=j(q-I._startTime,0,we),be=I._ease($e/I._updateDuration),ke=I._modifier,Pe=I._valueType,Ee=I._tweenType,ae=Ee===Fe.OBJECT,le=Pe===ye.NUMBER,xe=le&&ae||be===0||be===1?-1:U.precision;let _e,Ie;if(le)_e=Ie=ke(z(Jt(I._fromNumber,I._toNumber,be),xe));else if(Pe===ye.UNIT)Ie=ke(z(Jt(I._fromNumber,I._toNumber,be),xe)),_e=`${Ie}${I._unit}`;else if(Pe===ye.COLOR){const $=I._numbers,ce=I._fromNumbers,ee=I._toNumbers,he=1-be,ze=ce[0],Oe=ce[1],ve=ce[2],Mt=ee[0],nt=ee[1],dt=ee[2];$[0]=ke(Math.sqrt(ze*ze*he+Mt*Mt*be)),$[1]=ke(Math.sqrt(Oe*Oe*he+nt*nt*be)),$[2]=ke(Math.sqrt(ve*ve*he+dt*dt*be)),$[3]=ke(Jt(ce[3],ee[3],be)),(!I._setter||r)&&(_e=`rgba(${z($[0],0)},${z($[1],0)},${z($[2],0)},${$[3]})`)}else Pe===ye.COMPLEX&&(_e=fo(I,be,xe));if(re&&(I._number=Ie),!r&&oe!==Ke.blend){const $=I.property;V=I.target,I._setter?I._setter(V,Ie,I):ae?V[$]=_e:Ee===Fe.ATTRIBUTE?V.setAttribute($,_e):(X=V.style,Ee===Fe.TRANSFORM?(V!==Y&&(Y=V,G=V[Xs]),G[$]=_e,K=1):Ee===Fe.CSS?X[$]=_e:Ee===Fe.CSS_VAR&&X.setProperty($,_e)),_&&(E=1)}else I._value=_e}else ne&&J&&!Re&&q<I._startTime&&(I._currentTime=0);K&&I._renderTransforms&&(X.transform=ao(G),K=0),I=I._next}!s&&E&&e.onRender(e)}!s&&_&&e.onUpdate(e)}return n&&T?!s&&(n.began&&!L&&k>0&&!c||L&&k<=1e-11&&c)&&(e.onComplete(e),e.completed=!L):_&&w?h===1/0?e._startTime+=e.duration:e._currentIteration>=h-1&&(e.paused=!0,!c&&!g&&(e.completed=!0,!s&&!(n&&(L||!n.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,E},gs=(e,t,s,r,i)=>{const n=e._currentIteration;if(Cr(e,t,s,r,i),e._hasChildren){const o=e,c=o.backwards,d=r?t:o._iterationTime,h=Zt();let p=0,a=!0;if(!r&&o._currentIteration!==n){const f=o.iterationDuration;Ce(o,l=>{if(!c)!l.completed&&!l.backwards&&l._currentTime<l.iterationDuration&&Cr(l,f,s,1,vt.FORCE),l.began=!1,l.completed=!1;else{const g=l.duration,m=l._offset+l._delay,y=m+g;!s&&g<=1e-11&&(!m||y===f)&&l.onComplete(l)}}),s||o.onLoop(o)}Ce(o,f=>{const l=z((d-f._offset)*f._speed,12);if(c&&l>f._delay+f.duration)return;const g=f._fps<o._fps?f.requestTick(h):i;p+=Cr(f,l,s,r,g),!f.completed&&a&&(a=!1)},c),!s&&p&&o.onRender(o),(a||c)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,s||(o.onComplete(o),o._resolve(o))))}},po={},Ri=(e,t,s)=>{if(s===Fe.TRANSFORM){const r=wi.get(e);return r||e}else if(s===Fe.CSS||s===Fe.ATTRIBUTE&&kr(t)&&e in t.style){const r=po[e];if(r)return r;{const i=e&&Sr(e);return po[e]=i,i}}else return e},Ar=(e,t=!1)=>{if(e._hasChildren)Ce(e,s=>Ar(s,t),!0);else{const s=e;s.pause(),Ce(s,r=>{const i=r.property,n=r.target,o=r._tweenType,c=r._inlineValue,d=cs(c)||c===\"\";if(r._setter){if(!t&&!d){if(pt(c,rt),rt.d){const h=rt.d,p=r._numbers;for(let a=0,f=h.length;a<f;a++)p[a]=h[a]}else r._number=rt.n;r._setter(r.target,r._number,r)}}else if(o===Fe.OBJECT)!t&&!d&&(n[i]=c);else if(n[as])if(o===Fe.ATTRIBUTE)t||(d?n.removeAttribute(i):n.setAttribute(i,c));else{const h=n.style;if(o===Fe.TRANSFORM){const p=n[Xs];d?delete p[i]:p[i]=c,r._renderTransforms&&(Object.keys(p).length?h.transform=ao(p):h.removeProperty(\"transform\"))}else d?h.removeProperty(Sr(i)):h[i]=c}n[as]&&s._tail===r&&s.targets.forEach(h=>{h.getAttribute&&h.getAttribute(\"style\")===\"\"&&h.removeAttribute(\"style\")})})}return e},go=e=>Ar(e,!0),mo=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=ut/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){const t=+e,s=t<1e-11?Ve:t,r=ut/s;s>js.frameRate&&(js.frameRate=s),this._fps=s,this._frameDuration=r}get speed(){return this._speed}set speed(e){const t=+e;this._speed=t<1e-11?Ve:t}requestTick(e){const t=this._frameDuration,s=e-this._lastTickTime,r=t*.25;return s+(r<4?r:4)<t?vt.NONE:(this._lastTickTime=s>=t?e-s%t:e,vt.AUTO)}computeDeltaTime(e){const t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Ls={animation:null,update:ie},ku=e=>{let t=Ls.animation;return t||(t={duration:Ve,computeDeltaTime:ie,_offset:0,_delay:0,_head:null,_tail:null},Ls.animation=t,Ls.update=()=>{e.forEach(s=>{for(let r in s){const i=s[r],n=i._head;if(n){const o=n._valueType,c=o===ye.COMPLEX||o===ye.COLOR?ot(n._fromNumbers):null;let d=n._fromNumber,h=i._tail;for(;h&&h!==n;){if(c)for(let p=0,a=h._numbers.length;p<a;p++)c[p]+=h._numbers[p];else d+=h._number;h=h._prevAdd}n._toNumber=d,n._toNumbers=c}}}),Cr(t,1,1,0,vt.FORCE)}),t},vo=Nt?requestAnimationFrame:setImmediate,wu=Nt?cancelAnimationFrame:clearImmediate,xu=class extends mo{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=js,this.paused=!0,this.reqId=0}update(){const e=this._currentTime=Zt();if(this.requestTick(e)){this.computeDeltaTime(e);const t=this._speed,s=this._fps;let r=this._head;for(;r;){const i=r._next;r.paused?(Rt(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):gs(r,(e-r._startTime)*r._speed*t,0,0,r._fps<s?r.requestTick(e):vt.AUTO),r=i}Ls.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Zt()),this.reqId=vo(yo)),this}pause(){if(this.reqId)return this.paused=!0,Tu()}resume(){if(this.paused)return this.paused=!1,Ce(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(U.timeScale===1?1:ut)}set speed(e){const t=e*U.timeScale;this._speed!==t&&(this._speed=t,Ce(this,s=>s.speed=s._speed))}get timeUnit(){return U.timeScale===1?\"ms\":\"s\"}set timeUnit(e){const s=e===\"s\",r=s?.001:1;if(U.timeScale!==r){U.timeScale=r,U.tickThreshold=200*r;const i=s?.001:ut;this.defaults.duration*=i,this._speed*=i}}get precision(){return U.precision}set precision(e){U.precision=e}},it=(()=>{const e=new xu(Zt());return Nt&&(so.engine=e,Z.addEventListener(\"visibilitychange\",()=>{e.pauseOnDocumentHidden&&(Z.hidden?e.pause():e.resume())})),e})(),yo=()=>{it._head?(it.reqId=vo(yo),it.update()):it.reqId=0},Tu=()=>(wu(it.reqId),it.reqId=0,it),Pr={_rep:new WeakMap,_add:new Map},Ii=(e,t,s=\"_rep\")=>{const r=Pr[s];let i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},Cu=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,Er=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=Ve,e._currentTime=Ve},bo=(e,t)=>{const s=e._composition;if(s===Ke.replace){const r=e._absoluteStartTime;It(t,e,Cu,\"_prevRep\",\"_nextRep\");const i=e._prevRep;if(i){const n=i.parent,o=i._absoluteEndTime;if(e.parent.id!==n.id&&n.iterationCount>1&&o+(n.duration-n.iterationDuration)>r){Er(i);let h=i._prevRep;for(;h&&h.parent.id===n.id;)Er(h),h=h._prevRep}const c=e._absoluteUpdateStartTime;if(o>c){const h=i._startTime,p=o-(h+i._updateDuration),a=z(c-p-h,12);i._changeDuration=a,i._currentTime=a,i._isOverlapped=1,a<1e-11&&Er(i)}const d=e.parent.parent;if(!d||d!==n.parent){let h=!0;if(Ce(n,p=>{p._isOverlapped||(h=!1)}),h){const p=n.parent;if(p){let a=!0;Ce(p,f=>{f!==n&&Ce(f,l=>{l._isOverlapped||(a=!1)})}),a&&p.cancel()}else n.cancel()}}}}else if(s===Ke.blend){const r=Ii(e.target,e.property,\"_add\"),i=ku(Pr._add);let n=r._head;n||(n={...e},n._composition=Ke.replace,n._updateDuration=Ve,n._startTime=0,n._numbers=ot(e._fromNumbers),n._number=0,n._next=null,n._prev=null,It(r,n),It(i,n));const o=e._toNumber;if(e._fromNumber=n._fromNumber-o,e._toNumber=0,e._numbers=ot(e._fromNumbers),e._number=0,n._fromNumber=o,e._toNumbers.length){const c=ot(e._toNumbers);c.forEach((d,h)=>{e._fromNumbers[h]=n._fromNumbers[h]-d,e._toNumbers[h]=0}),n._fromNumbers=c}It(r,e,null,\"_prevAdd\",\"_nextAdd\")}return e},_o=e=>{const t=e._composition;if(t!==Ke.none){const s=e.target,r=e.property,i=Pr._rep.get(s)[r];if(Rt(i,e,\"_prevRep\",\"_nextRep\"),t===Ke.blend){const n=Pr._add,o=n.get(s);if(!o)return;const c=o[r],d=Ls.animation;Rt(c,e,\"_prevAdd\",\"_nextAdd\");const h=c._head;if(h&&h===c._tail){Rt(c,h,\"_prevAdd\",\"_nextAdd\"),Rt(d,h);let p=!0;for(let a in o)if(o[a]._head){p=!1;break}p&&n.delete(s)}}}return e},So=(e,t,s)=>{let r=!1;return Ce(t,i=>{const n=i.target;if(e.includes(n)){const o=i.property,c=i._tweenType,d=Ri(s,n,c);(!d||d&&d===o)&&(i.parent._tail===i&&i._tweenType===Fe.TRANSFORM&&i._prev&&i._prev._tweenType===Fe.TRANSFORM&&(i._prev._renderTransforms=1),Rt(t,i),_o(i),r=!0)}},!0),r},Ht=(e,t,s)=>{const r=t||it;let i;if(r._hasChildren){let n=0;Ce(r,o=>{if(!o._hasChildren)if(i=So(e,o,s),i&&!o._head)o.cancel(),Rt(r,o);else{const c=o._offset+o._delay+o.duration;c>n&&(n=c)}o._head?Ht(e,o,s):o._hasChildren=!1},!0),F(r.iterationDuration)||(r.iterationDuration=n)}else i=So(e,r,s);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},ko=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),Mi=e=>(e._cancelled&&(e._hasChildren?Ce(e,Mi):Ce(e,t=>{t._composition!==Ke.none&&bo(t,Ii(t.target,t.property))}),e._cancelled=0),e),wo=0,Au=(e,t)=>e._priority>t._priority,yt=class extends mo{constructor(e={},t=null,s=0){super(0),++wo;const{id:r,delay:i,duration:n,reversed:o,alternate:c,loop:d,loopDelay:h,autoplay:p,frameRate:a,playbackRate:f,priority:l,onComplete:g,onLoop:m,onPause:y,onBegin:S,onBeforeUpdate:k,onUpdate:b}=e;We.current&&We.current.register(this);const u=t?0:it._lastTickTime,v=t?t.defaults:U.defaults,_=qe(i)||F(i)?v.delay:+i,w=qe(n)||F(n)?1/0:+n,T=W(d,v.loop),R=W(h,v.loopDelay);let C=T===!0||T===1/0||T<0?1/0:T+1,P=0;t?P=s:(it.reqId||it.requestTick(Zt()),P=(it._lastTickTime-it._startTime)*U.timeScale),this.id=F(r)?wo:r,this.parent=t,this.duration=Tr((w+R)*C-R)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=S||v.onBegin,this.onBeforeUpdate=k||v.onBeforeUpdate,this.onUpdate=b||v.onUpdate,this.onLoop=m||v.onLoop,this.onPause=y||v.onPause,this.onComplete=g||v.onComplete,this.iterationDuration=w,this.iterationCount=C,this._autoplay=t?!1:W(p,v.autoplay),this._offset=P,this._delay=_,this._loopDelay=R,this._iterationTime=0,this._currentIteration=0,this._resolve=ie,this._running=!1,this._reversed=+W(o,v.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=W(c,v.alternate),this._prev=null,this._next=null,this._lastTickTime=u,this._startTime=u,this._lastTime=u,this._fps=W(a,v.frameRate),this._speed=W(f,v.playbackRate),this._priority=+W(l,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return j(z(this._currentTime,U.precision),-this._delay,this.duration)}set currentTime(e){const t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return j(z(this._iterationTime,U.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return j(z(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return j(z(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){const t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*j(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return Mi(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,gs(this,0,1,~~e,vt.FORCE),ko(this),this._hasChildren&&Ce(this,ko),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&gs(this,this.duration,1,~~e,vt.FORCE),this.reset(e);const t=this._autoplay;return t===!0?this.resume():t&&!F(t.linked)&&t.link(this),this}resetTime(){const e=1/(this._speed*it._speed);return this._startTime=Zt()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?gs(this,Ve,0,0,vt.FORCE):(this._running||(It(it,this,Au),it._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,it.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,s=0){Mi(this),this.completed=!1;const r=this.paused;return this.paused=!0,gs(this,e+this._delay,~~t,~~s,vt.AUTO),r?this:this.resume()}alternate(){const e=this._reversed,t=this.iterationCount,s=this.iterationDuration,r=t===1/0?Ps(Lt/s):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(s*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?Ce(this,e=>e.cancel(),!0):Ce(this,_o),this._cancelled=1,this.pause()}stretch(e){const t=this.duration,s=Es(e);if(t===s)return this;const r=e/t,i=e<=Ve;return this.duration=i?Ve:s,this.iterationDuration=i?Ve:Es(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){gs(this,0,1,0,vt.AUTO);const e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=ie){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=ie};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},Pu=e=>new yt(e,null,0).init();function Oi(e){const t=Ze(e)?We.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function bt(e){if(cs(e))return[];if(!Nt)return Qe(e)&&e.flat(1/0)||[e];if(Qe(e)){const s=e.flat(1/0),r=[];for(let i=0,n=s.length;i<n;i++){const o=s[i];if(!cs(o)){const c=Oi(o);if(c)for(let d=0,h=c.length;d<h;d++){const p=c[d];if(!cs(p)){let a=!1;for(let f=0,l=r.length;f<l;f++)if(r[f]===p){a=!0;break}a||r.push(p)}}else{let d=!1;for(let h=0,p=r.length;h<p;h++)if(r[h]===o){d=!0;break}d||r.push(o)}}}return r}const t=Oi(e);return t?Array.from(t):[e]}function Kt(e){const t=bt(e),s=t.length;for(let r=0;r<s;r++){const i=t[r];if(!i[Zn]){i[Zn]=!0;const n=kr(i);(i.nodeType||n)&&(i[as]=!0,i[ki]=n,i[Xs]={})}}return t}var Ni={deg:1,rad:180/Dt,turn:360},xo={},Lr=(e,t,s,r=!1)=>{const i=t.u,n=t.n;if(t.t===ye.UNIT&&i===s)return t;const o=n+i+s,c=xo[o];if(!F(c)&&!r)t.n=c;else{let d;if(i in Ni)d=n*Ni[i]/Ni[s];else{const p=e.cloneNode(),a=e.parentNode,f=a&&a!==Z?a:Z.body;f.appendChild(p);const l=p.style;l.width=100+i;const g=p.offsetWidth||100;l.width=100+s;const m=g/(p.offsetWidth||100);f.removeChild(p),d=m*n}t.n=d,xo[o]=d}return t.t,ye.UNIT,t.u=s,t},_t=e=>e,Ys=(e=1.68)=>t=>hs(t,+e),Di={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},Eu=Dt/2,To=Dt*2,Co={\"\":Ys,Quad:Ys(2),Cubic:Ys(3),Quart:Ys(4),Quint:Ys(5),Sine:e=>1-Ti(e*Eu),Circ:e=>1-kt(1-e*e),Expo:e=>e?hs(2,10*e-10):0,Bounce:e=>{let t,s=4;for(;e<((t=hs(2,--s))-1)/11;);return 1/hs(4,3-s)-7.5625*hs((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{const s=j(+e,1,10),r=j(+t,Ve,2),i=r/To*mu(1/s),n=To/r;return o=>o===0||o===1?o:-s*hs(2,-10*(1-o))*xi((1-o-i)*n)}},qt=(()=>{const e={linear:_t,none:_t};for(let t in Di)for(let s in Co){const r=Co[s],i=Di[t];e[t+s]=s===\"\"||s===\"Back\"||s===\"Elastic\"?(n,o)=>i(r(n,o)):i(r)}return e})(),Rr={linear:_t,none:_t},Ao=e=>{if(Rr[e])return Rr[e];if(e.indexOf(\"(\")<=-1){const t=Di[e]||e.includes(\"Back\")||e.includes(\"Elastic\")?qt[e]():qt[e];return t?Rr[e]=t:_t}else{const t=e.slice(0,-1).split(\"(\"),s=qt[t[0]];return s?Rr[e]=s(...t[1].split(\",\")):_t}},Po=[\"steps(\",\"irregular(\",\"linear(\",\"cubicBezier(\"],Ft=e=>{if(Ze(e)){for(let t=0,s=Po.length;t<s;t++)if(je(e,Po[t]))return console.warn(`String syntax for \\`ease: \"${e}\"\\` has been removed from the core and replaced by importing and passing the easing function directly: \\`ease: ${e}\\``),_t}return qe(e)?e:Ze(e)?Ao(e):_t},se=Li(),ge=Li(),Rs={},Ir={func:null},Mr={func:null},Or=[null],Is=[null,null],Nr={to:null},Lu=0,Eo=0,Qt,Bt,Ru=(e,t)=>{const s={};if(Qe(e)){const r=[].concat(...e.map(i=>Object.keys(i))).filter(As);for(let i=0,n=r.length;i<n;i++){const o=r[i];s[o]=e.map(c=>{const d={};for(let h in c){const p=c[h];As(h)?h===o&&(d.to=p):d[h]=p}return d})}}else{const r=W(t.duration,U.defaults.duration);Object.keys(e).map(i=>({o:parseFloat(i)/100,p:e[i]})).sort((i,n)=>i.o-n.o).forEach(i=>{const n=i.o,o=i.p;for(let c in o)if(As(c)){let d=s[c];d||(d=s[c]=[]);const h=n*r;let p=d.length,a=d[p-1];const f={to:o[c]};let l=0;for(let g=0;g<p;g++)l+=d[g].duration;p===1&&(f.from=a.to),o.ease&&(f.ease=o.ease),f.duration=h-(p?l:0),d.push(f)}return i});for(let i in s){const n=s[i];let o;for(let c=0,d=n.length;c<d;c++){const h=n[c],p=h.ease;h.ease=o||void 0,o=p}n[0].duration||n.shift()}}return s},Vt=class extends yt{constructor(e,t,s,r,i=!1,n=0,o){super(t,s,r),this._head,this._tail,++Eo;const c=Kt(e),d=c.length,h=t.keyframes,p=h?xt(Ru(h,t),t):t,{id:a,delay:f,duration:l,ease:g,playbackEase:m,modifier:y,composition:S,onRender:k}=p,b=s?s.defaults:U.defaults,u=W(g,b.ease),v=W(m,b.playbackEase),_=v?Ft(v):null,w=!F(u.ease),T=w?u.ease:W(g,_?\"linear\":b.ease),R=w?u.settlingDuration:W(l,b.duration),C=W(f,b.delay),P=y||b.modifier,E=F(S)&&d>=1e3?Ke.none:F(S)?b.composition:S,N=this._offset+(s?s._offset:0);w&&(u.parent=this);let D=NaN,q=NaN,L=0,B=0;for(let M=0;M<d;M++){const I=c[M],V=n||M,X=o||c;let Y=NaN,G=NaN;for(let K in p)if(As(K)){const oe=Ei(I,K),ne=lo(I,K),we=Ri(K,I,oe);let me=p[K];const ue=Qe(me);if(i&&!ue&&(Is[0]=me,Is[1]=me,me=Is),ue){const $e=me.length,be=!Ye(me[0]);$e===2&&be?(Nr.to=me,Or[0]=Nr,Qt=Or):$e>2&&be?(Qt=[],me.forEach((ke,Pe)=>{Pe?Pe===1?(Is[1]=ke,Qt.push(Is)):Qt.push(ke):Is[0]=ke})):Qt=me}else Or[0]=me,Qt=Or;let J=null,re=null,Me=NaN,Re=0,Ae=0;for(let $e=Qt.length;Ae<$e;Ae++){const be=Qt[Ae];Ye(be)?Bt=be:(Nr.to=be,Bt=Nr),Ir.func=null,Mr.func=null;const ke=Xe(W(Bt.composition,E),I,V,X,null,null),Pe=st(ke)?ke:Ke[ke];!J&&Pe!==Ke.none&&(J=Ii(I,we));const Ee=J?J._tail:null,ae=s&&Ee&&Ee.parent.parent===s?Ee:re,le=Xe(Bt.to,I,V,X,Ir,ae);let xe;Ye(le)&&!F(le.to)?(Bt=le,xe=le.to):xe=le;const _e=Xe(Bt.from,I,V,X,Mr,ae),Ie=Bt.ease||T,$=Xe(Ie,I,V,X,null,ae),ce=qe($)||Ze($)?$:Ie,ee=!F(ce)&&!F(ce.ease),he=ee?ce.ease:ce,ze=ee?ce.settlingDuration:Xe(W(Bt.duration,$e>1?Xe(R,I,V,X,null,ae)/$e:R),I,V,X,null,ae),Oe=Xe(W(Bt.delay,Ae?0:C),I,V,X,null,ae),ve=Bt.modifier||P,Mt=!F(_e),nt=!F(xe),dt=Qe(xe),ms=dt||Mt&&nt,ln=re?Re:0,Ns=re?Re+Oe:Oe,Ds=z(N+Ns,12),Te=z(N+ln,12);!B&&(Mt||dt)&&(B=1);let Q=re;if(Pe!==Ke.none){let Se=J._head;for(;Se&&Se._absoluteStartTime<=Ds;)if(Se._isOverridden||(Q=Se),Se=Se._nextRep,Se&&Se._absoluteStartTime>=Ds)for(;Se;)Er(Se),Se=Se._nextRep}if(ms){pt(dt?Xe(xe[0],I,V,X,Mr,ae):_e,se),pt(dt?Xe(xe[1],I,V,X,Ir,ae):xe,ge);const Se=fs(I,we,oe,Rs);se.t===ye.NUMBER&&(Q?Q._valueType===ye.UNIT&&(se.t=ye.UNIT,se.u=Q._unit):(pt(Se,rt),rt.t===ye.UNIT&&(se.t=ye.UNIT,se.u=rt.u)))}else nt?pt(xe,ge):re?ho(re,ge):pt(s&&Q&&Q.parent.parent===s?Q._value:fs(I,we,oe,Rs),ge),Mt?pt(_e,se):re?ho(re,se):pt(s&&Q&&Q.parent.parent===s?Q._value:fs(I,we,oe,Rs),se);if(se.o&&(se.n=ps(Q?Q._toNumber:pt(fs(I,we,oe,Rs),rt).n,se.n,se.o)),ge.o&&(ge.n=ps(se.n,ge.n,ge.o)),se.t!==ge.t){if(se.t===ye.COMPLEX||ge.t===ye.COMPLEX){const Se=se.t===ye.COMPLEX?se:ge,Ue=se.t===ye.COMPLEX?ge:se;Ue.t=ye.COMPLEX,Ue.s=ot(Se.s),Ue.d=Se.d.map(()=>Ue.n)}else if(se.t===ye.UNIT||ge.t===ye.UNIT){const Se=se.t===ye.UNIT?se:ge,Ue=se.t===ye.UNIT?ge:se;Ue.t=ye.UNIT,Ue.u=Se.u}else if(se.t===ye.COLOR||ge.t===ye.COLOR){const Se=se.t===ye.COLOR?se:ge,Ue=se.t===ye.COLOR?ge:se;Ue.t=ye.COLOR,Ue.d=Se.d.map(()=>0)}}if(se.u!==ge.u){let Se=ge.u?se:ge;Se=Lr(I,Se,ge.u?ge.u:se.u,!1)}if(ge.d&&se.d&&ge.d.length!==se.d.length){const Se=se.d.length>ge.d.length?se:ge,Ue=Se===se?ge:se;Ue.d=Se.d.map((cn,Gt)=>F(Ue.d[Gt])?0:Ue.d[Gt]),Ue.s=ot(Se.s)}const Le=z(+ze||1e-11,12);let Ne=Rs[we];cs(Ne)||(Rs[we]=null);const ei=ne?ne.set:null;Re=z(Ns+Le,12);const Ut=se.d,Wt=ge.d,et=ge.s,at={parent:this,id:Lu++,property:we,target:I,_value:null,_toFunc:Ir.func,_fromFunc:Mr.func,_ease:Ft(he),_fromNumbers:Ut?ot(Ut):_r,_toNumbers:Wt?ot(Wt):_r,_strings:et?ot(et):_r,_fromNumber:se.n,_toNumber:ge.n,_numbers:Ut?ot(Ut):_r,_number:se.n,_unit:ge.u,_modifier:ve,_currentTime:0,_startTime:Ns,_delay:+Oe,_updateDuration:Le,_changeDuration:Le,_absoluteStartTime:Ds,_absoluteUpdateStartTime:Te,_absoluteEndTime:z(N+Re,12),_hasFromValue:Mt||dt?1:0,_tweenType:oe,_setter:ei,_valueType:ge.t,_composition:Pe,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:Ne,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};Pe!==Ke.none&&bo(at,J);const vs=at._valueType;if(vs===ye.COMPLEX)at._value=fo(at,1,-1);else if(vs===ye.UNIT)at._value=`${ve(at._toNumber)}${at._unit}`;else if(vs===ye.COLOR){const Se=ge.d;at._value=`rgba(${z(Se[0],0)},${z(Se[1],0)},${z(Se[2],0)},${Se[3]})`}else at._value=ve(at._toNumber);isNaN(Me)&&(Me=at._startTime),re=at,L++,It(this,at)}(isNaN(q)||Me<q)&&(q=Me),(isNaN(D)||Re>D)&&(D=Re),oe===Fe.TRANSFORM&&(Y=L-Ae,G=L)}if(!isNaN(Y)){let K=0;Ce(this,oe=>{K>=Y&&K<G&&(oe._renderTransforms=1,oe._composition===Ke.blend&&Ce(Ls.animation,ne=>{ne.id===oe.id&&(ne._renderTransforms=1)})),K++})}}d||console.warn(\"No target found. Make sure the element you're trying to animate is accessible before creating your animation.\"),q?(Ce(this,M=>{M._startTime-M._delay||(M._delay-=q),M._startTime-=q}),D-=q):q=0,D||(D=Ve,this.iterationCount=0),this.targets=c,this.id=F(a)?Eo:a,this.duration=D===1e-11?Ve:Tr((D+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=k||b.onRender,this._ease=_,this._delay=q,this.iterationDuration=D,!this._autoplay&&B&&this.onRender(this)}stretch(e){const t=this.duration;if(t===Es(e))return this;const s=e/t;return Ce(this,r=>{r._updateDuration=Es(r._updateDuration*s),r._changeDuration=Es(r._changeDuration*s),r._currentTime*=s,r._delay*=s,r._startTime*=s,r._absoluteStartTime*=s,r._absoluteUpdateStartTime*=s,r._absoluteEndTime*=s}),super.stretch(e)}refresh(){return Ce(this,e=>{const t=e._toFunc,s=e._fromFunc;(t||s)&&(s?(pt(s(),se),se.u!==e._unit&&e.target[as]&&Lr(e.target,se,e._unit,!0),e._fromNumbers=ot(se.d),e._fromNumber=se.n):t&&(pt(fs(e.target,e.property,e._tweenType),rt),e._fromNumbers=ot(rt.d),e._fromNumber=rt.n),t&&(pt(t(),ge),e._toNumbers=ot(ge.d),e._strings=ot(ge.s),e._toNumber=ge.o?ps(e._fromNumber,ge.n,ge.o):ge.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Ar(this)}then(e){return super.then(e)}},Zs=(e,t)=>U.editor?U.editor.addAnimation(e,t):new Vt(e,t,null,0,!1).init(),Iu=(e,t)=>{if(je(t,\"<\")){const s=t[1]===\"<\",r=e._tail,i=r?r._offset+r._delay:0;return s?i:i+r.duration}},Js=(e,t)=>{let s=e.iterationDuration;if(s===1e-11&&(s=0),F(t))return s;if(st(+t))return+t;const r=t,i=e?e.labels:null,n=!cs(i),o=Iu(e,r),c=!F(o),d=to.exec(r);if(d){const h=d[0],p=r.split(h),a=n&&p[0]?i[p[0]]:s,f=c?o:n?a:s,l=+p[1];return ps(f,l,h[0])}else return c?o:n?F(i[r])?s:i[r]:s};function Mu(e){return Tr((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function Bi(e,t,s,r,i,n){const o=st(e.duration)&&e.duration<=1e-11?s-Ve:s;t.composition&&gs(t,o,1,1,vt.AUTO);const c=r?new Vt(r,e,t,o,!1,i,n):new yt(e,t,o);return t.composition&&c.init(!0),It(t,c),Ce(t,d=>{const h=d._offset+d._delay+d.duration;h>t.iterationDuration&&(t.iterationDuration=h)}),t.duration=Mu(t),t}var Lo=0,Ro=class extends yt{constructor(e={}){super(e,null,0),++Lo,this.id=F(e.id)?Lo:e.id,this.duration=0,this.labels={};const t=e.defaults,s=U.defaults;this.defaults=t?xt(t,s):s,this.composition=W(e.composition,!0),this.onRender=e.onRender||s.onRender;const r=W(e.playbackEase,s.playbackEase);this._ease=r?Ft(r):null,this.iterationDuration=0}add(e,t,s){const r=Ye(t),i=Ye(e);if(r||i){if(this._hasChildren=!0,r){const n=t,o=U.editor&&U.editor.addTimelineChild,c=s&&s.type===\"Stagger\"&&U.editor,d=qe(s)?s:null;if(d||c){const h=bt(e),p=this.duration,a=this.iterationDuration,f=n.id;let l=0;const g=h.length,m=o?o(e,n,this.id,s,g):null,y=d||U.editor.resolveStagger(s.defaultValue);h.forEach(S=>{const k={...m||n};this.duration=p,this.iterationDuration=a,F(f)||(k.id=f+\"-\"+l);const b=Js(this,y(S,l,h,null,this));Bi(k,this,b,S,l,h),l++})}else{const h=o?o(e,n,this.id,s):n,p=s&&s.type?s.defaultValue:s;Bi(h,this,Js(this,p),e)}}else Bi(e,this,Js(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(F(e)||e&&F(e.pause))return this;e.pause();const s=+(e.effect?e.effect.getTiming().duration:e.duration);!F(e)&&!F(e.persist)&&(e.persist=!0);const r=U.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);const n=this.add(e,{currentTime:[0,s],duration:s,delay:0,ease:\"linear\",playbackEase:\"linear\"},t);return r&&(r.addTimelineChild=i),n}set(e,t,s){return F(t)?this:(t.duration=Ve,t.composition=Ke.replace,this.add(e,t,s))}call(e,t){return F(e)||e&&!qe(e)?this:(U.editor&&U.editor.addTimelineCall&&(t=U.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return F(e)||e&&!Ze(e)?this:(U.editor&&U.editor.addTimelineLabel&&(t=U.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=Js(this,t),this)}remove(e,t){return Ht(bt(e),this,t),this}stretch(e){const t=this.duration;if(t===Es(e))return this;const s=e/t,r=this.labels;Ce(this,i=>i.stretch(i.duration*s));for(let i in r)r[i]*=s;return super.stretch(e)}refresh(){return Ce(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),Ce(this,e=>e.revert,!0),Ar(this)}then(e){return super.then(e)}},Io=e=>U.editor?U.editor.addTimeline(e):new Ro(e).init(),$i=class{constructor(e,t){We.current&&We.current.register(this);const s=()=>{this.callbacks.completed&&this.callbacks.reset(),this.callbacks.play()},r=()=>{if(this.callbacks.completed)return;let c=!0;for(let d in this.animations)if(!this.animations[d].paused&&c){c=!1;break}c&&this.callbacks.complete()},i={onBegin:s,onComplete:r,onPause:r},n={v:1,autoplay:!1},o={};if(this.targets=[],this.animations={},this.callbacks=null,!(F(e)||F(t))){for(let c in t){const d=t[c];As(c)?o[c]=d:je(c,\"on\")?n[c]=d:i[c]=d}this.callbacks=new Vt({v:0},n);for(let c in o){const d=o[c],h=Ye(d);let p={},a=\"+=0\";if(h){const g=d.unit;Ze(g)&&(a+=g)}else p.duration=d;p[c]=h?xt({to:a},d):a;const f=xt(i,p);f.composition=Ke.replace,f.autoplay=!1;const l=this.animations[c]=new Vt(e,f,null,0,!1).init();this.targets.length||this.targets.push(...l.targets),this[c]=(g,m,y)=>{const S=l._head;if(F(g)&&S){const k=S._numbers;return k&&k.length?k:S._modifier(S._number)}else return Ce(l,k=>{if(Qe(g))for(let b=0,u=g.length;b<u;b++)F(k._numbers[b])||(k._fromNumbers[b]=k._modifier(k._numbers[b]),k._toNumbers[b]=g[b]);else k._fromNumber=k._modifier(k._number),k._toNumber=g;F(y)||(k._ease=Ft(y)),k._currentTime=0}),F(m)||l.stretch(m),l.reset(!0).resume(),this}}}}revert(){for(let e in this.animations)this[e]=ie,this.animations[e].revert();return this.animations={},this.targets.length=0,this.callbacks&&this.callbacks.revert(),this}},Ou=(e,t)=>new $i(e,t),Nu=_s({clamp:()=>j,damp:()=>Vu,degToRad:()=>qu,lerp:()=>Jt,mapRange:()=>Ks,padEnd:()=>$u,padStart:()=>Bu,radToDeg:()=>Fu,round:()=>z,roundPad:()=>Du,snap:()=>ds,wrap:()=>Hu}),Du=(e,t)=>(+e).toFixed(t),Bu=(e,t,s)=>`${e}`.padStart(t,s),$u=(e,t,s)=>`${e}`.padEnd(t,s),Hu=(e,t,s)=>((e-t)%(s-t)+(s-t))%(s-t)+t,Ks=(e,t,s,r,i)=>r+(e-t)/(s-t)*(i-r),qu=e=>e*Math.PI/180,Fu=e=>e*180/Math.PI,Vu=(e,t,s,r)=>r?r===1?t:Jt(e,t,1-Math.exp(-r*s*.1)):e,gt=ut*10,Dr=class{constructor(e={}){const t=!F(e.bounce)||!F(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/ut,this.maxIterations=this.maxDuration/this.timeStep/ut,this.bn=j(W(e.bounce,.5),-1,1),this.pd=j(W(e.duration,628),10*U.timeScale,gt*U.timeScale),this.m=j(W(e.mass,1),1,gt),this.s=j(W(e.stiffness,100),Ve,gt),this.d=j(W(e.damping,10),Ve,gt),this.v=j(W(e.velocity,0),-gt,gt),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=e.onComplete||ie,t&&this.calculateSDFromBD(),this.compute(),this.ease=s=>{const r=s*this.settlingDuration,i=this.completed,n=this.pd;return r>=n&&!i&&(this.completed=!0,this.onComplete(this.parent)),r<n&&i&&(this.completed=!1),s===0||s===1?s:this.solve(s*this.solverDuration)}}solve(e){const{zeta:t,w0:s,wd:r,b:i}=this;let n=e;return t<1?n=wr(-n*t*s)*(1*Ti(r*n)+i*xi(r*n)):t===1?n=(1+i*n)*wr(-n*s):n=((1+i)*wr((-t*s+r)*n)+(1-i)*wr((-t*s-r)*n))/2,1-n}calculateSDFromBD(){const e=U.timeScale===1?this.pd/ut:this.pd;this.m=1,this.v=0,this.s=hs(2*Dt/e,2),this.bn>=0?this.d=(1-this.bn)*4*Dt/e:this.d=4*Dt/(e*(1+this.bn)),this.s=z(j(this.s,Ve,gt),3),this.d=z(j(this.d,Ve,300),3)}calculateBDFromSD(){const e=2*Dt/kt(this.s);this.pd=e*(U.timeScale===1?ut:1),this.d/(2*kt(this.s))<=1?this.bn=1-this.d*e/(4*Dt):this.bn=4*Dt/(this.d*e)-1,this.bn=z(j(this.bn,-1,1),3),this.pd=z(j(this.pd,10*U.timeScale,gt*U.timeScale),3)}compute(){const{maxRestSteps:e,maxIterations:t,restThreshold:s,timeStep:r,m:i,d:n,s:o,v:c}=this,d=this.w0=j(kt(o/i),Ve,ut),h=this.zeta=n/(2*kt(o*i));h<1?(this.wd=d*kt(1-h*h),this.b=(h*d+-c)/this.wd):h===1?(this.wd=0,this.b=-c+d):(this.wd=d*kt(h*h-1),this.b=(h*d+-c)/this.wd);let p=0,a=0,f=0;for(;a<=e&&f<=t;)wt(1-this.solve(p))<s?a++:a=0,this.solverDuration=p,p+=r,f++;this.settlingDuration=z(this.solverDuration*ut,0)*U.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=j(W(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=j(W(e,1),10*U.timeScale,gt*U.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=j(W(e,100),Ve,gt),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=j(W(e,10),Ve,gt),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=j(W(e,1),1,gt),this.compute()}get velocity(){return this.v}set velocity(e){this.v=j(W(e,0),-gt,gt),this.compute()}},Br=e=>new Dr(e),Mo=e=>(console.warn(\"createSpring() is deprecated use spring() instead\"),new Dr(e)),Hi={_head:null,_tail:null},qi=(e,t,s)=>{let r=Hi._head,i;for(;r;){const n=r._next,o=r.$el===e,c=!t||r.property===t,d=!s||r.parent===s;if(o&&c&&d){i=r.animation;try{i.commitStyles()}catch{}i.cancel(),Rt(Hi,r);const h=r.parent;h&&(h._completed++,h.animations.length===h._completed&&(h.completed=!0,h.paused=!0,h.muteCallbacks||(h.onComplete(h),h._resolve(h))))}r=n}return i},Oo=(e,t,s,r,i)=>{const n=t.animate(r,i),o=i.delay+ +i.duration*i.iterations;n.playbackRate=e._speed,e.paused&&n.pause(),e.duration<o&&(e.duration=o,e.controlAnimation=n),e.animations.push(n),qi(t,s),It(Hi,{parent:e,animation:n,$el:t,property:s,_next:null,_prev:null});const c=()=>qi(t,s,e);return n.oncancel=c,n.onremove=c,e.persist||(n.onfinish=c),n};function es(e,t,s){const r=Kt(e);if(!r.length)return;const[i]=r,n=Ei(i,t),o=Ri(t,i,n);let c=fs(i,o);if(F(s))return c;if(pt(c,rt),rt.t===ye.NUMBER||rt.t===ye.UNIT){if(s===!1)return rt.n;{const d=Lr(i,rt,s,!1);return`${z(d.n,U.precision)}${d.u}`}}}var zt=(e,t)=>{if(!F(t))return U.editor&&U.editor.addSet?U.editor.addSet(e,t):(t.duration=Ve,t.composition=W(t.composition,Ke.none),new Vt(e,t,null,0,!0).resume())},No=(e,t,s)=>{const r=bt(e);for(let i=0,n=r.length;i<n;i++)qi(r[i],s,t&&t.controlAnimation&&t);return Ht(r,t,s),r},ts=e=>{e.cancelable&&e.preventDefault()},zu=class{constructor(e){this.el=e,this.zIndex=0,this.parentElement=null,this.classList={add:ie,remove:ie}}get x(){return this.el.x||0}set x(e){this.el.x=e}get y(){return this.el.y||0}set y(e){this.el.y=e}get width(){return this.el.width||0}set width(e){this.el.width=e}get height(){return this.el.height||0}set height(e){this.el.height=e}getBoundingClientRect(){return{top:this.y,right:this.x,bottom:this.y+this.height,left:this.x+this.width}}},Uu=class{constructor(e){this.$el=e,this.inlineTransforms=[],this.point=new DOMPoint,this.inversedMatrix=this.getMatrix().inverse()}normalizePoint(e,t){return this.point.x=e,this.point.y=t,this.point.matrixTransform(this.inversedMatrix)}traverseUp(e){let t=this.$el.parentElement,s=0;for(;t&&t!==Z;)e(t,s),t=t.parentElement,s++}getMatrix(){const e=new DOMMatrix;return this.traverseUp(t=>{const s=getComputedStyle(t).transform;if(s){const r=new DOMMatrix(s);e.preMultiplySelf(r)}}),e}remove(){this.traverseUp((e,t)=>{this.inlineTransforms[t]=e.style.transform,e.style.transform=\"none\"})}revert(){this.traverseUp((e,t)=>{const s=this.inlineTransforms[t];s===\"\"?e.style.removeProperty(\"transform\"):e.style.transform=s})}},ht=(e,t)=>e&&qe(e)?e(t):e,$r=0,Do=class{constructor(e,t={}){if(!e)return;We.current&&We.current.register(this);const s=t.x,r=t.y,i=t.trigger,n=t.modifier,o=t.releaseEase,c=o&&Ft(o),d=!F(o)&&!F(o.ease),h=Ye(s)&&!F(s.mapTo)?s.mapTo:\"translateX\",p=Ye(r)&&!F(r.mapTo)?r.mapTo:\"translateY\",a=ht(t.container,this);this.containerArray=Qe(a)?a:null,this.$container=a&&!this.containerArray?bt(a)[0]:Z.body,this.useWin=this.$container===Z.body,this.$scrollContainer=this.useWin?ct:this.$container,this.$target=Ye(e)?new zu(e):bt(e)[0],this.$trigger=bt(i||e)[0],this.fixed=es(this.$target,\"position\")===\"fixed\",this.isFinePointer=!0,this.containerPadding=[0,0,0,0],this.containerFriction=0,this.releaseContainerFriction=0,this.snapX=0,this.snapY=0,this.scrollSpeed=0,this.scrollThreshold=0,this.dragSpeed=0,this.dragThreshold=3,this.maxVelocity=0,this.minVelocity=0,this.velocityMultiplier=0,this.cursor=!1,this.releaseXSpring=d?o:Br({mass:W(t.releaseMass,1),stiffness:W(t.releaseStiffness,80),damping:W(t.releaseDamping,20)}),this.releaseYSpring=d?o:Br({mass:W(t.releaseMass,1),stiffness:W(t.releaseStiffness,80),damping:W(t.releaseDamping,20)}),this.releaseEase=c||qt.outQuint,this.hasReleaseSpring=d,this.onGrab=t.onGrab||ie,this.onDrag=t.onDrag||ie,this.onRelease=t.onRelease||ie,this.onUpdate=t.onUpdate||ie,this.onSettle=t.onSettle||ie,this.onSnap=t.onSnap||ie,this.onResize=t.onResize||ie,this.onAfterResize=t.onAfterResize||ie,this.disabled=[0,0];const f={};if(n&&(f.modifier=n),F(s)||s===!0)f[h]=0;else if(Ye(s)){const l=s,g={};l.modifier&&(g.modifier=l.modifier),l.composition&&(g.composition=l.composition),f[h]=g}else s===!1&&(f[h]=0,this.disabled[0]=1);if(F(r)||r===!0)f[p]=0;else if(Ye(r)){const l=r,g={};l.modifier&&(g.modifier=l.modifier),l.composition&&(g.composition=l.composition),f[p]=g}else r===!1&&(f[p]=0,this.disabled[1]=1);this.animate=new $i(this.$target,f),this.xProp=h,this.yProp=p,this.destX=0,this.destY=0,this.deltaX=0,this.deltaY=0,this.scroll={x:0,y:0},this.coords=[this.x,this.y,0,0],this.snapped=[0,0],this.pointer=[0,0,0,0,0,0,0,0],this.scrollView=[0,0],this.dragArea=[0,0,0,0],this.containerBounds=[-Lt,Lt,Lt,-Lt],this.scrollBounds=[0,0,0,0],this.targetBounds=[0,0,0,0],this.window=[0,0],this.velocityStack=[0,0,0],this.velocityStackIndex=0,this.velocityTime=Zt(),this.velocity=0,this.angle=0,this.cursorStyles=null,this.triggerStyles=null,this.bodyStyles=null,this.targetStyles=null,this.touchActionStyles=null,this.transforms=new Uu(this.$target),this.overshootCoords={x:0,y:0},this.overshootTicker=new yt({autoplay:!1,onUpdate:()=>{this.updated=!0,this.manual=!0,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,1),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,1)},onComplete:()=>{this.manual=!1,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,0),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,0)}},null,0).init(),this.updateTicker=new yt({autoplay:!1,onUpdate:()=>this.update()},null,0).init(),this.contained=!F(a),this.manual=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.enabled=!1,this.initialized=!1,this.activeProp=this.disabled[1]?h:p,this.animate.callbacks.onRender=()=>{const l=this.updated,g=!(this.grabbed&&l)&&this.released,m=this.x,y=this.y,S=m-this.coords[2],k=y-this.coords[3];this.deltaX=S,this.deltaY=k,this.coords[2]=m,this.coords[3]=y,l&&(S||k)&&this.onUpdate(this),g?(this.computeVelocity(S,k),this.angle=xr(k,S)):this.updated=!1},this.animate.callbacks.onComplete=()=>{!this.grabbed&&this.released&&(this.released=!1),this.manual||(this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.onSettle(this))},this.resizeTicker=new yt({autoplay:!1,duration:150*U.timeScale,onComplete:()=>{this.onResize(this),this.refresh(),this.onAfterResize(this)}}).init(),this.parameters=t,this.resizeObserver=new ResizeObserver(()=>{this.initialized?this.resizeTicker.restart():this.initialized=!0}),this.enable(),this.refresh(),this.resizeObserver.observe(this.$container),Ye(e)||this.resizeObserver.observe(this.$target)}computeVelocity(e,t){const s=this.velocityTime,r=Zt(),i=r-s;if(i<17)return this.velocity;this.velocityTime=r;const n=this.velocityStack,o=this.velocityMultiplier,c=this.minVelocity,d=this.maxVelocity,h=this.velocityStackIndex;n[h]=z(j(kt(e*e+t*t)/i*o,c,d),5);const p=oo(n[0],n[1],n[2]);return this.velocity=p,this.velocityStackIndex=(h+1)%3,p}setX(e,t=!1){if(this.disabled[0])return;const s=z(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destX=s,this.snapped[0]=ds(s,this.snapX),this.animate[this.xProp](s,0),this.manual=!1,this}setY(e,t=!1){if(this.disabled[1])return;const s=z(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destY=s,this.snapped[1]=ds(s,this.snapY),this.animate[this.yProp](s,0),this.manual=!1,this}get x(){return z(this.animate[this.xProp](),U.precision)}set x(e){this.setX(e,!1)}get y(){return z(this.animate[this.yProp](),U.precision)}set y(e){this.setY(e,!1)}get progressX(){return Ks(this.x,this.containerBounds[3],this.containerBounds[1],0,1)}set progressX(e){this.setX(Ks(e,0,1,this.containerBounds[3],this.containerBounds[1]),!1)}get progressY(){return Ks(this.y,this.containerBounds[0],this.containerBounds[2],0,1)}set progressY(e){this.setY(Ks(e,0,1,this.containerBounds[0],this.containerBounds[2]),!1)}updateScrollCoords(){const e=z(this.useWin?ct.scrollX:this.$container.scrollLeft,0),t=z(this.useWin?ct.scrollY:this.$container.scrollTop,0),[s,r,i,n]=this.containerPadding,o=this.scrollThreshold;this.scroll.x=e,this.scroll.y=t,this.scrollBounds[0]=t-this.targetBounds[0]+s-o,this.scrollBounds[1]=e-this.targetBounds[1]-r+o,this.scrollBounds[2]=t-this.targetBounds[2]-i+o,this.scrollBounds[3]=e-this.targetBounds[3]+n-o}updateBoundingValues(){const e=this.$container;if(!e)return;const t=this.x,s=this.y,r=this.coords[2],i=this.coords[3];this.coords[2]=0,this.coords[3]=0,this.setX(0,!0),this.setY(0,!0),this.transforms.remove();const n=this.window[0]=ct.innerWidth,o=this.window[1]=ct.innerHeight,c=this.useWin,d=e.scrollWidth,h=e.scrollHeight,p=this.fixed,a=e.getBoundingClientRect(),[f,l,g,m]=this.containerPadding;this.dragArea[0]=c?0:a.left,this.dragArea[1]=c?0:a.top,this.scrollView[0]=c?j(d,n,d):d,this.scrollView[1]=c?j(h,o,h):h,this.updateScrollCoords();const{width:y,height:S,left:k,top:b,right:u,bottom:v}=e.getBoundingClientRect();this.dragArea[2]=z(c?j(y,n,n):y,0),this.dragArea[3]=z(c?j(S,o,o):S,0);const _=es(e,\"overflow\"),w=_===\"visible\",T=_===\"hidden\";if(this.canScroll=p?!1:this.contained&&(e===Z.body&&w||!T&&!w)&&(d>this.dragArea[2]+m-l||h>this.dragArea[3]+f-g)&&(!this.containerArray||this.containerArray&&!Qe(this.containerArray)),this.contained){const R=this.scroll.x,C=this.scroll.y,P=this.canScroll,E=this.$target.getBoundingClientRect(),N=P?c?0:e.scrollLeft:0,D=P?c?0:e.scrollTop:0,q=P?this.scrollView[0]-N-y:0,L=P?this.scrollView[1]-D-S:0;this.targetBounds[0]=z(E.top+C-(c?0:b),0),this.targetBounds[1]=z(E.right+R-(c?n:u),0),this.targetBounds[2]=z(E.bottom+C-(c?o:v),0),this.targetBounds[3]=z(E.left+R-(c?0:k),0),this.containerArray?(this.containerBounds[0]=this.containerArray[0]+f,this.containerBounds[1]=this.containerArray[1]-l,this.containerBounds[2]=this.containerArray[2]-g,this.containerBounds[3]=this.containerArray[3]+m):(this.containerBounds[0]=-z(E.top-(p?j(b,0,o):b)+D-f,0),this.containerBounds[1]=-z(E.right-(p?j(u,0,n):u)-q+l,0),this.containerBounds[2]=-z(E.bottom-(p?j(v,0,o):v)-L+g,0),this.containerBounds[3]=-z(E.left-(p?j(k,0,n):k)+N-m,0))}this.transforms.revert(),this.coords[2]=r,this.coords[3]=i,this.setX(t,!0),this.setY(s,!0)}isOutOfBounds(e,t,s){if(!this.contained)return 0;const[r,i,n,o]=e,[c,d]=this.disabled,h=!c&&t<o||!c&&t>i,p=!d&&s<r||!d&&s>n;return h&&!p?1:!h&&p?2:h&&p?3:0}refresh(){const e=this.parameters,t=e.x,s=e.y,r=ht(e.container,this),i=ht(e.containerPadding,this)||0,n=Qe(i)?i:[i,i,i,i],o=this.x,c=this.y,d=ht(e.cursor,this),h={onHover:\"grab\",onGrab:\"grabbing\"};if(d){const{onHover:y,onGrab:S}=d;y&&(h.onHover=y),S&&(h.onGrab=S)}const p=ht(e.dragThreshold,this),a={mouse:3,touch:7};if(st(p))a.mouse=p,a.touch=p;else if(p){const{mouse:y,touch:S}=p;F(y)||(a.mouse=y),F(S)||(a.touch=S)}this.containerArray=Qe(r)?r:null,this.$container=r&&!this.containerArray?bt(r)[0]:Z.body,this.useWin=this.$container===Z.body,this.$scrollContainer=this.useWin?ct:this.$container,this.isFinePointer=matchMedia(\"(pointer:fine)\").matches,this.containerPadding=W(n,[0,0,0,0]),this.containerFriction=j(W(ht(e.containerFriction,this),.8),0,1),this.releaseContainerFriction=j(W(ht(e.releaseContainerFriction,this),this.containerFriction),0,1),this.snapX=ht(Ye(t)&&!F(t.snap)?t.snap:e.snap,this),this.snapY=ht(Ye(s)&&!F(s.snap)?s.snap:e.snap,this),this.scrollSpeed=W(ht(e.scrollSpeed,this),1.5),this.scrollThreshold=W(ht(e.scrollThreshold,this),20),this.dragSpeed=W(ht(e.dragSpeed,this),1),this.dragThreshold=this.isFinePointer?a.mouse:a.touch,this.minVelocity=W(ht(e.minVelocity,this),0),this.maxVelocity=W(ht(e.maxVelocity,this),50),this.velocityMultiplier=W(ht(e.velocityMultiplier,this),1),this.cursor=d===!1?!1:h,this.updateBoundingValues();const[f,l,g,m]=this.containerBounds;this.setX(j(o,m,l),!0),this.setY(j(c,f,g),!0)}update(){if(this.updateScrollCoords(),this.canScroll){const[S,k,b,u]=this.containerPadding,[v,_]=this.scrollView,w=this.dragArea[2],T=this.dragArea[3],R=this.scroll.x,C=this.scroll.y,P=this.$container.scrollWidth,E=this.$container.scrollHeight,N=this.useWin?j(P,this.window[0],P):P,D=this.useWin?j(E,this.window[1],E):E,q=v-N,L=_-D;this.dragged&&q>0&&(this.coords[0]-=q,this.scrollView[0]=N),this.dragged&&L>0&&(this.coords[1]-=L,this.scrollView[1]=D);const B=this.scrollSpeed*10,M=this.scrollThreshold,[I,V]=this.coords,[X,Y,G,K]=this.scrollBounds,oe=z(j((V-X+S)/M,-1,0)*B,0),ne=z(j((I-Y-k)/M,0,1)*B,0),we=z(j((V-G-b)/M,0,1)*B,0),me=z(j((I-K+u)/M,-1,0)*B,0);if(oe||we||me||ne){const[ue,J]=this.disabled;let re=R,Me=C;ue||(re=z(j(R+(me||ne),0,v-w),0),this.coords[0]-=R-re),J||(Me=z(j(C+(oe||we),0,_-T),0),this.coords[1]-=C-Me),this.useWin?this.$scrollContainer.scrollBy(-(R-re),-(C-Me)):this.$scrollContainer.scrollTo(re,Me)}}const[e,t,s,r]=this.containerBounds,[i,n,o,c,d,h]=this.pointer;this.coords[0]+=(i-d)*this.dragSpeed,this.coords[1]+=(n-h)*this.dragSpeed,this.pointer[4]=i,this.pointer[5]=n;const[p,a]=this.coords,[f,l]=this.snapped,g=(1-this.containerFriction)*this.dragSpeed;this.setX(p>t?t+(p-t)*g:p<r?r+(p-r)*g:p,!1),this.setY(a>s?s+(a-s)*g:a<e?e+(a-e)*g:a,!1),this.computeVelocity(i-d,n-h),this.angle=xr(n-c,i-o);const[m,y]=this.snapped;(m!==f&&this.snapX||y!==l&&this.snapY)&&this.onSnap(this)}stop(){this.updateTicker.pause(),this.overshootTicker.pause();for(let e in this.animate.animations)this.animate.animations[e].pause();return Ht([this],null,\"x\"),Ht([this],null,\"y\"),Ht([this],null,\"progressX\"),Ht([this],null,\"progressY\"),Ht([this.scroll]),Ht([this.overshootCoords]),this}scrollInView(e,t=0,s=qt.inOutQuad){this.updateScrollCoords();const r=this.destX,i=this.destY,n=this.scroll,o=this.scrollBounds,c=this.canScroll;if(!this.containerArray&&this.isOutOfBounds(o,r,i)){const[d,h,p,a]=o,f=z(j(i-d,-Lt,0),0),l=z(j(r-h,0,Lt),0),g=z(j(i-p,0,Lt),0),m=z(j(r-a,-Lt,0),0);new Vt(n,{x:z(n.x+(m?m-t:l?l+t:0),0),y:z(n.y+(f?f-t:g?g+t:0),0),duration:F(e)?350*U.timeScale:e,ease:s,onUpdate:()=>{this.canScroll=!1,this.$scrollContainer.scrollTo(n.x,n.y)}}).init().then(()=>{this.canScroll=c})}return this}handleHover(){this.isFinePointer&&this.cursor&&!this.cursorStyles&&(this.cursorStyles=zt(this.$trigger,{cursor:this.cursor.onHover}))}animateInView(e,t=0,s=qt.inOutQuad){this.stop(),this.updateBoundingValues();const r=this.x,i=this.y,[n,o,c,d]=this.containerPadding,h=this.scroll.y-this.targetBounds[0]+n+t,p=this.scroll.x-this.targetBounds[1]-o-t,a=this.scroll.y-this.targetBounds[2]-c-t,f=this.scroll.x-this.targetBounds[3]+d+t,l=this.isOutOfBounds([h,p,a,f],r,i);if(l){const[g,m]=this.disabled,y=j(ds(r,this.snapX),f,p),S=j(ds(i,this.snapY),h,a),k=F(e)?350*U.timeScale:e;!g&&(l===1||l===3)&&this.animate[this.xProp](y,k,s),!m&&(l===2||l===3)&&this.animate[this.yProp](S,k,s)}return this}handleDown(e){const t=e.target;if(this.grabbed||t.type===\"range\")return;e.stopPropagation(),this.grabbed=!0,this.released=!1,this.stop(),this.updateBoundingValues();const s=e.changedTouches,r=s?s[0].clientX:e.clientX,i=s?s[0].clientY:e.clientY,{x:n,y:o}=this.transforms.normalizePoint(r,i),[c,d,h,p]=this.containerBounds,a=(1-this.containerFriction)*this.dragSpeed,f=this.x,l=this.y;this.coords[0]=this.coords[2]=a?f>d?d+(f-d)/a:f<p?p+(f-p)/a:f:f,this.coords[1]=this.coords[3]=a?l>h?h+(l-h)/a:l<c?c+(l-c)/a:l:l,this.pointer[0]=n,this.pointer[1]=o,this.pointer[2]=n,this.pointer[3]=o,this.pointer[4]=n,this.pointer[5]=o,this.pointer[6]=n,this.pointer[7]=o,this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null);const g=es(this.$target,\"zIndex\",!1);$r=(g>$r?g:$r)+1,this.targetStyles=zt(this.$target,{zIndex:$r}),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.isFinePointer&&this.cursor&&(this.bodyStyles=zt(Z.body,{cursor:this.cursor.onGrab})),this.scrollInView(100,0,qt.out(3)),this.onGrab(this),Z.addEventListener(\"touchmove\",this),Z.addEventListener(\"touchend\",this),Z.addEventListener(\"touchcancel\",this),Z.addEventListener(\"mousemove\",this),Z.addEventListener(\"mouseup\",this),Z.addEventListener(\"selectstart\",this)}handleMove(e){if(!this.grabbed)return;const t=e.changedTouches,s=t?t[0].clientX:e.clientX,r=t?t[0].clientY:e.clientY,{x:i,y:n}=this.transforms.normalizePoint(s,r),o=i-this.pointer[6],c=n-this.pointer[7];let d=e.target,h=!1,p=!1,a=!1;for(;t&&d&&d!==this.$trigger;){const f=es(d,\"overflow-y\");if(f!==\"hidden\"&&f!==\"visible\"){const{scrollTop:l,scrollHeight:g,clientHeight:m}=d;if(g>m){a=!0,h=l<=3,p=l>=g-m-3;break}}d=d.parentElement}a&&(!h&&!p||h&&c<0||p&&c>0)?(this.pointer[0]=i,this.pointer[1]=n,this.pointer[2]=i,this.pointer[3]=n,this.pointer[4]=i,this.pointer[5]=n,this.pointer[6]=i,this.pointer[7]=n):(ts(e),this.triggerStyles||(this.triggerStyles=zt(this.$trigger,{pointerEvents:\"none\"})),this.$trigger.addEventListener(\"touchstart\",ts,{passive:!1}),this.$trigger.addEventListener(\"touchmove\",ts,{passive:!1}),this.$trigger.addEventListener(\"touchend\",ts),(this.dragged||!this.disabled[0]&&wt(o)>this.dragThreshold||!this.disabled[1]&&wt(c)>this.dragThreshold)&&(this.updateTicker.resume(),this.pointer[2]=this.pointer[0],this.pointer[3]=this.pointer[1],this.pointer[0]=i,this.pointer[1]=n,this.dragged=!0,this.released=!1,this.onDrag(this)))}handleUp(){if(!this.grabbed)return;this.updateTicker.pause(),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null);const[e,t]=this.disabled,[s,r,i,n,o,c]=this.pointer,[d,h,p,a]=this.containerBounds,[f,l]=this.snapped,g=this.releaseXSpring,m=this.releaseYSpring,y=this.releaseEase,S=this.hasReleaseSpring,k=this.overshootCoords,b=this.x,u=this.y,v=this.computeVelocity(s-o,r-c),_=this.angle=xr(r-n,s-i),w=v*150,T=(1-this.releaseContainerFriction)*this.dragSpeed,R=b+Ti(_)*w,C=u+xi(_)*w,P=R>h?h+(R-h)*T:R<a?a+(R-a)*T:R,E=C>p?p+(C-p)*T:C<d?d+(C-d)*T:C,N=this.destX=j(z(ds(P,this.snapX),5),a,h),D=this.destY=j(z(ds(E,this.snapY),5),d,p),q=this.isOutOfBounds(this.containerBounds,R,C);let L=0,B=0,M=y,I=y,V=0;if(k.x=b,k.y=u,!e){const Y=N===h?b>h?-1:1:b<a?-1:1,G=z(b-N,0);g.velocity=t&&S?G?w*Y/wt(G):0:v;const{ease:K,settlingDuration:oe,restDuration:ne}=g;L=b===N?0:S?oe:oe-ne*U.timeScale,S&&(M=K),L>V&&(V=L)}if(!t){const Y=D===p?u>p?-1:1:u<d?-1:1,G=z(u-D,0);m.velocity=e&&S?G?w*Y/wt(G):0:v;const{ease:K,settlingDuration:oe,restDuration:ne}=m;B=u===D?0:S?oe:oe-ne*U.timeScale,S&&(I=K),B>V&&(V=B)}if(!S&&q&&T&&(L||B)){const Y=Ke.blend;new Vt(k,{x:{to:P,duration:L*.65},y:{to:E,duration:B*.65},ease:y,composition:Y}).init(),new Vt(k,{x:{to:N,duration:L},y:{to:D,duration:B},ease:y,composition:Y}).init(),this.overshootTicker.stretch(oo(L,B)).restart()}else e||this.animate[this.xProp](N,L,M),t||this.animate[this.yProp](D,B,I);this.scrollInView(V,this.scrollThreshold,y);let X=!1;N!==f&&(this.snapped[0]=N,this.snapX&&(X=!0)),D!==l&&this.snapY&&(this.snapped[1]=D,this.snapY&&(X=!0)),X&&this.onSnap(this),this.grabbed=!1,this.dragged=!1,this.updated=!0,this.released=!0,this.onRelease(this),this.$trigger.removeEventListener(\"touchstart\",ts),this.$trigger.removeEventListener(\"touchmove\",ts),this.$trigger.removeEventListener(\"touchend\",ts),Z.removeEventListener(\"touchmove\",this),Z.removeEventListener(\"touchend\",this),Z.removeEventListener(\"touchcancel\",this),Z.removeEventListener(\"mousemove\",this),Z.removeEventListener(\"mouseup\",this),Z.removeEventListener(\"selectstart\",this)}reset(){return this.stop(),this.resizeTicker.pause(),this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.setX(0,!0),this.setY(0,!0),this.coords[0]=0,this.coords[1]=0,this.pointer[0]=0,this.pointer[1]=0,this.pointer[2]=0,this.pointer[3]=0,this.pointer[4]=0,this.pointer[5]=0,this.pointer[6]=0,this.pointer[7]=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this}enable(){return this.enabled||(this.enabled=!0,this.$target.classList.remove(\"is-disabled\"),this.touchActionStyles=zt(this.$trigger,{touchAction:this.disabled[0]?\"pan-x\":this.disabled[1]?\"pan-y\":\"none\"}),this.$trigger.addEventListener(\"touchstart\",this,{passive:!0}),this.$trigger.addEventListener(\"mousedown\",this,{passive:!0}),this.$trigger.addEventListener(\"mouseenter\",this)),this}disable(){return this.enabled=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.touchActionStyles.revert(),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null),this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null),this.$target.classList.add(\"is-disabled\"),this.$trigger.removeEventListener(\"touchstart\",this),this.$trigger.removeEventListener(\"mousedown\",this),this.$trigger.removeEventListener(\"mouseenter\",this),Z.removeEventListener(\"touchmove\",this),Z.removeEventListener(\"touchend\",this),Z.removeEventListener(\"touchcancel\",this),Z.removeEventListener(\"mousemove\",this),Z.removeEventListener(\"mouseup\",this),Z.removeEventListener(\"selectstart\",this),this}revert(){return this.reset(),this.disable(),this.$target.classList.remove(\"is-disabled\"),this.updateTicker.revert(),this.overshootTicker.revert(),this.resizeTicker.revert(),this.animate.revert(),this.resizeObserver.disconnect(),this}handleEvent(e){switch(e.type){case\"mousedown\":this.handleDown(e);break;case\"touchstart\":this.handleDown(e);break;case\"mousemove\":this.handleMove(e);break;case\"touchmove\":this.handleMove(e);break;case\"mouseup\":this.handleUp();break;case\"touchend\":this.handleUp();break;case\"touchcancel\":this.handleUp();break;case\"mouseenter\":this.handleHover();break;case\"selectstart\":ts(e)}}},Wu=(e,t)=>new Do(e,t),Fi=(e=ie)=>new yt({duration:1*U.timeScale,onComplete:e},null,0).resume(),Hr=e=>{let t;return((...s)=>{let r,i,n,o,c;t&&(r=t.currentIteration,i=t.iterationProgress,n=t.reversed,o=t._alternate,c=t._startTime,t.revert());const d=e(...s);return d&&!qe(d)&&d.revert&&(t=d),F(i)||(t.currentIteration=r,t.iterationProgress=(o&&r%2?!n:n)?1-i:i,t._startTime=c),d||ie})},Bo=class{constructor(e={}){We.current&&We.current.register(this);const t=e.root;let s=Z;t&&(s=t.current||t.nativeElement||bt(t)[0]||Z);const r=e.defaults,i=U.defaults,n=e.mediaQueries;if(this.defaults=r?xt(r,i):i,this.root=s,this.constructors=[],this.revertConstructors=[],this.revertibles=[],this.constructorsOnce=[],this.revertConstructorsOnce=[],this.revertiblesOnce=[],this.once=!1,this.onceIndex=0,this.methods={},this.matches={},this.mediaQueryLists={},this.data={},n)for(let o in n){const c=ct.matchMedia(n[o]);this.mediaQueryLists[o]=c,c.addEventListener(\"change\",this)}}register(e){(this.once?this.revertiblesOnce:this.revertibles).push(e)}execute(e){let t=We.current,s=We.root,r=U.defaults;We.current=this,We.root=this.root,U.defaults=this.defaults;const i=this.mediaQueryLists;for(let o in i)this.matches[o]=i[o].matches;const n=e(this);return We.current=t,We.root=s,U.defaults=r,n}refresh(){return this.onceIndex=0,this.execute(()=>{let e=this.revertibles.length,t=this.revertConstructors.length;for(;e--;)this.revertibles[e].revert();for(;t--;)this.revertConstructors[t](this);this.revertibles.length=0,this.revertConstructors.length=0,this.constructors.forEach(s=>{const r=s(this);qe(r)&&this.revertConstructors.push(r)})}),this}add(e,t){if(this.once=!1,qe(e)){const s=e;this.constructors.push(s),this.execute(()=>{const r=s(this);qe(r)&&this.revertConstructors.push(r)})}else this.methods[e]=(...s)=>this.execute(()=>t(...s));return this}addOnce(e){if(this.once=!0,qe(e)){const t=this.onceIndex++;if(this.constructorsOnce[t])return this;const s=e;this.constructorsOnce[t]=s,this.execute(()=>{const r=s(this);qe(r)&&this.revertConstructorsOnce.push(r)})}return this}keepTime(e){this.once=!0;const t=this.onceIndex++,s=this.constructorsOnce[t];if(qe(s))return s(this);const r=Hr(e);this.constructorsOnce[t]=r;let i;return this.execute(()=>{i=r(this)}),i}handleEvent(e){e.type===\"change\"&&this.refresh()}revert(){const e=this.revertibles,t=this.revertConstructors,s=this.revertiblesOnce,r=this.revertConstructorsOnce,i=this.mediaQueryLists;let n=e.length,o=t.length,c=s.length,d=r.length;for(;n--;)e[n].revert();for(;o--;)t[o](this);for(;c--;)s[c].revert();for(;d--;)r[d](this);for(let h in i)i[h].removeEventListener(\"change\",this);e.length=0,t.length=0,this.constructors.length=0,s.length=0,r.length=0,this.constructorsOnce.length=0,this.onceIndex=0,this.matches={},this.methods={},this.mediaQueryLists={},this.data={}}},Gu=e=>new Bo(e),Xu=()=>{const e=Z.createElement(\"div\");Z.body.appendChild(e),e.style.height=\"100lvh\";const t=e.offsetHeight;return Z.body.removeChild(e),t},qr=(e,t)=>e&&qe(e)?e(t):e,Fr=new Map,ju=class{constructor(e){this.element=e,this.useWin=this.element===Z.body,this.winWidth=0,this.winHeight=0,this.width=0,this.height=0,this.left=0,this.top=0,this.scale=1,this.zIndex=0,this.scrollX=0,this.scrollY=0,this.prevScrollX=0,this.prevScrollY=0,this.scrollWidth=0,this.scrollHeight=0,this.velocity=0,this.backwardX=!1,this.backwardY=!1,this.scrollTicker=new yt({autoplay:!1,onBegin:()=>this.dataTimer.resume(),onUpdate:()=>{const t=this.backwardX||this.backwardY;Ce(this,s=>s.handleScroll(),t)},onComplete:()=>this.dataTimer.pause()}).init(),this.dataTimer=new yt({autoplay:!1,frameRate:30,onUpdate:t=>{const s=t.deltaTime,r=this.prevScrollX,i=this.prevScrollY,n=this.scrollX,o=this.scrollY,c=r-n,d=i-o;this.prevScrollX=n,this.prevScrollY=o,c&&(this.backwardX=r>n),d&&(this.backwardY=i>o),this.velocity=z(s>0?Math.sqrt(c*c+d*d)/s:0,5)}}).init(),this.resizeTicker=new yt({autoplay:!1,duration:250*U.timeScale,onComplete:()=>{this.updateWindowBounds(),this.refreshScrollObservers(),this.handleScroll()}}).init(),this.wakeTicker=new yt({autoplay:!1,duration:500*U.timeScale,onBegin:()=>{this.scrollTicker.resume()},onComplete:()=>{this.scrollTicker.pause()}}).init(),this._head=null,this._tail=null,this.updateScrollCoords(),this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll(),this.resizeObserver=new ResizeObserver(()=>this.resizeTicker.restart()),this.resizeObserver.observe(this.element),(this.useWin?ct:this.element).addEventListener(\"scroll\",this,!1)}updateScrollCoords(){const e=this.useWin,t=this.element;this.scrollX=z(e?ct.scrollX:t.scrollLeft,0),this.scrollY=z(e?ct.scrollY:t.scrollTop,0)}updateWindowBounds(){this.winWidth=ct.innerWidth,this.winHeight=Xu()}updateBounds(){const e=getComputedStyle(this.element),t=this.element;this.scrollWidth=t.scrollWidth+parseFloat(e.marginLeft)+parseFloat(e.marginRight),this.scrollHeight=t.scrollHeight+parseFloat(e.marginTop)+parseFloat(e.marginBottom),this.updateWindowBounds();let s,r;if(this.useWin)s=this.winWidth,r=this.winHeight;else{const i=t.getBoundingClientRect();s=t.clientWidth,r=t.clientHeight,this.top=i.top,this.left=i.left,this.scale=i.width?s/i.width:i.height?r/i.height:1}this.width=s,this.height=r}refreshScrollObservers(){Ce(this,e=>{e.ready&&e._debug&&e.removeDebug()}),this.updateBounds(),Ce(this,e=>{e.ready&&(e.refresh(),e.onResize(e),e._debug&&e.debug())})}refresh(){this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll()}handleScroll(){this.updateScrollCoords(),this.wakeTicker.restart()}handleEvent(e){e.type===\"scroll\"&&this.handleScroll()}revert(){this.scrollTicker.cancel(),this.dataTimer.cancel(),this.resizeTicker.cancel(),this.wakeTicker.cancel(),this.resizeObserver.disconnect(),(this.useWin?ct:this.element).removeEventListener(\"scroll\",this),Fr.delete(this.element)}},Yu=e=>{const t=e&&bt(e)[0]||Z.body;let s=Fr.get(t);return s||(s=new ju(t),Fr.set(t,s)),s},Qs=(e,t,s,r,i)=>{const n=t===\"min\",o=t===\"max\",{n:c,u:d}=pt(t===\"top\"||t===\"left\"||t===\"start\"||n?0:t===\"bottom\"||t===\"right\"||t===\"end\"||o?\"100%\":t===\"center\"?\"50%\":t,rt);let h=c;return d===\"%\"?h=c/100*s:d&&(h=Lr(e,rt,\"px\",!0).n),o&&r<0&&(h+=r),n&&i>0&&(h+=i),h},Vr=(e,t,s,r,i)=>{let n;if(Ze(t)){const o=to.exec(t);if(o){const c=o[0],d=c[0],h=t.split(c),p=h[0]===\"min\",a=h[0]===\"max\",f=Qs(e,h[0],s,r,i),l=Qs(e,h[1],s,r,i);if(p){const g=ps(Qs(e,\"min\",s),l,d);n=g<f?f:g}else if(a){const g=ps(Qs(e,\"max\",s),l,d);n=g>f?f:g}else n=ps(f,l,d)}else n=Qs(e,t,s,r,i)}else n=t;return z(n,0)},$o=e=>{let t;const s=e.targets;for(let r=0,i=s.length;r<i;r++){const n=s[r];if(n[as]){t=n;break}}return t},Zu=0,Ho=[\"#FF4B4B\",\"#FF971B\",\"#FFC730\",\"#F9F640\",\"#7AFF5A\",\"#18FF74\",\"#17E09B\",\"#3CFFEC\",\"#05DBE9\",\"#33B3F1\",\"#638CF9\",\"#C563FE\",\"#FF4FCF\",\"#F93F8A\"],qo=class{constructor(e={}){We.current&&We.current.register(this);const t=W(e.sync,\"play pause\"),s=t?Ft(t):null,r=t&&(t===\"linear\"||t===_t),i=t&&!(s===_t&&!r),n=t&&(st(t)||t===!0||r),o=t&&Ze(t)&&!i&&!n,c=o?t.split(\" \").map(h=>()=>{const p=this.linked;return p&&p[h]?p[h]():null}):null,d=o&&c.length>2;this.index=Zu++,this.id=F(e.id)?this.index:e.id,this.container=Yu(e.container),this.target=null,this.linked=null,this.repeat=null,this.horizontal=null,this.enter=null,this.leave=null,this.sync=i||n||!!c,this.syncEase=i?s:null,this.syncSmooth=n?t===!0||r?1:t:null,this.onSyncEnter=c&&!d&&c[0]?c[0]:ie,this.onSyncLeave=c&&!d&&c[1]?c[1]:ie,this.onSyncEnterForward=c&&d&&c[0]?c[0]:ie,this.onSyncLeaveForward=c&&d&&c[1]?c[1]:ie,this.onSyncEnterBackward=c&&d&&c[2]?c[2]:ie,this.onSyncLeaveBackward=c&&d&&c[3]?c[3]:ie,this.onEnter=e.onEnter||ie,this.onLeave=e.onLeave||ie,this.onEnterForward=e.onEnterForward||ie,this.onLeaveForward=e.onLeaveForward||ie,this.onEnterBackward=e.onEnterBackward||ie,this.onLeaveBackward=e.onLeaveBackward||ie,this.onUpdate=e.onUpdate||ie,this.onResize=e.onResize||ie,this.onSyncComplete=e.onSyncComplete||ie,this.reverted=!1,this.ready=!1,this.completed=!1,this.began=!1,this.isInView=!1,this.forceEnter=!1,this.hasEntered=!1,this.offset=0,this.offsetStart=0,this.offsetEnd=0,this.distance=0,this.prevProgress=0,this.thresholds=[\"start\",\"end\",\"end\",\"start\"],this.coords=[0,0,0,0],this.debugStyles=null,this.$debug=null,this._params=e,this._debug=W(e.debug,!1),this._next=null,this._prev=null,It(this.container,this),Fi(()=>{if(!this.reverted){if(!this.target){const h=bt(e.target)[0];this.target=h||Z.body,this.refresh()}this._debug&&this.debug()}})}link(e){if(e&&(e.pause(),this.linked=e,!F(e)&&!F(e.persist)&&(e.persist=!0),!this._params.target)){let t;F(e.targets)?Ce(e,s=>{s.targets&&!t&&(t=$o(s))}):t=$o(e),this.target=t||Z.body,this.refresh()}return this}get velocity(){return this.container.velocity}get backward(){return this.horizontal?this.container.backwardX:this.container.backwardY}get scroll(){return this.horizontal?this.container.scrollX:this.container.scrollY}get progress(){const e=(this.scroll-this.offsetStart)/this.distance;return e===1/0||isNaN(e)?0:z(j(e,0,1),6)}refresh(){this.ready=!0,this.reverted=!1;const e=this._params;return this.repeat=W(qr(e.repeat,this),!0),this.horizontal=W(qr(e.axis,this),\"y\")===\"x\",this.enter=W(qr(e.enter,this),\"end start\"),this.leave=W(qr(e.leave,this),\"start end\"),this.updateBounds(),this.handleScroll(),this}removeDebug(){return this.$debug&&(this.$debug.parentNode.removeChild(this.$debug),this.$debug=null),this.debugStyles&&(this.debugStyles.revert(),this.$debug=null),this}debug(){this.removeDebug();const e=this.container,t=this.horizontal,s=e.element.querySelector(\":scope > .animejs-onscroll-debug\"),r=Z.createElement(\"div\"),i=Z.createElement(\"div\"),n=Z.createElement(\"div\"),o=Ho[this.index%Ho.length],c=e.useWin,d=c?e.winWidth:e.width,h=c?e.winHeight:e.height,p=e.scrollWidth,a=e.scrollHeight,f=this.container.width>360?320:260,l=t?0:10,g=t?10:0,m=t?24:f/2,y=t?m:15,S=t?60:m,k=t?S:y,b=t?\"repeat-x\":\"repeat-y\",u=T=>t?\"0px \"+T+\"px\":T+\"px 2px\",v=T=>`linear-gradient(${t?90:0}deg, ${T} 2px, transparent 1px)`,_=(T,R,C,P,E)=>`position:${T};left:${R}px;top:${C}px;width:${P}px;height:${E}px;`;r.style.cssText=`${_(\"absolute\",l,g,t?p:f,t?f:a)}\n pointer-events: none;\n z-index: ${this.container.zIndex++};\n display: flex;\n flex-direction: ${t?\"column\":\"row\"};\n filter: drop-shadow(0px 1px 0px rgba(0,0,0,.75));\n `,i.style.cssText=`${_(\"sticky\",0,0,t?d:m,t?m:h)}`,s||(i.style.cssText+=`background:\n ${v(\"#FFFF\")}${u(m-10)} / 100px 100px ${b},\n ${v(\"#FFF8\")}${u(m-10)} / 10px 10px ${b};\n `),n.style.cssText=`${_(\"relative\",0,0,t?p:m,t?m:a)}`,s||(n.style.cssText+=`background:\n ${v(\"#FFFF\")}${u(0)} / ${t?\"100px 10px\":\"10px 100px\"} ${b},\n ${v(\"#FFF8\")}${u(0)} / ${t?\"10px 0px\":\"0px 10px\"} ${b};\n `);const w=[\" enter: \",\" leave: \"];this.coords.forEach((T,R)=>{const C=R>1,P=(C?0:this.offset)+T,E=R%2,N=P<k,D=P>(C?t?d:h:t?p:a)-k,q=(C?E&&!N:!E&&!N)||D,L=Z.createElement(\"div\"),B=Z.createElement(\"div\"),M=t?q?\"right\":\"left\":q?\"bottom\":\"top\",I=q?(t?S:y)+(C?t?-1:D?0:-2:t?-1:-2):t?1:0;B.innerHTML=`${this.id}${w[E]}${this.thresholds[R]}`,L.style.cssText=`${_(\"absolute\",0,0,S,y)}\n display: flex;\n flex-direction: ${t?\"column\":\"row\"};\n justify-content: flex-${C?\"start\":\"end\"};\n align-items: flex-${q?\"end\":\"start\"};\n border-${M}: 2px solid ${o};\n `,B.style.cssText=`\n overflow: hidden;\n max-width: ${f/2-10}px;\n height: ${y};\n margin-${t?q?\"right\":\"left\":q?\"bottom\":\"top\"}: -2px;\n padding: 1px;\n font-family: ui-monospace, monospace;\n font-size: 10px;\n letter-spacing: -.025em;\n line-height: 9px;\n font-weight: 600;\n text-align: ${t&&q||!t&&!C?\"right\":\"left\"};\n white-space: pre;\n text-overflow: ellipsis;\n color: ${E?o:\"rgba(0,0,0,.75)\"};\n background-color: ${E?\"rgba(0,0,0,.65)\":o};\n border: 2px solid ${E?o:\"transparent\"};\n border-${t?q?\"top-left\":\"top-right\":q?\"top-left\":\"bottom-left\"}-radius: 5px;\n border-${t?q?\"bottom-left\":\"bottom-right\":q?\"top-right\":\"bottom-right\"}-radius: 5px;\n `,L.appendChild(B);let V=P-I+(t?1:0);L.style[t?\"left\":\"top\"]=`${V}px`,(C?i:n).appendChild(L)}),r.appendChild(i),r.appendChild(n),e.element.appendChild(r),s||r.classList.add(\"animejs-onscroll-debug\"),this.$debug=r,es(e.element,\"position\")===\"static\"&&(this.debugStyles=zt(e.element,{position:\"relative \"}))}updateBounds(){this._debug&&this.removeDebug();let e;const t=this.target,s=this.container,r=this.horizontal,i=this.linked;let n,o=t;for(i&&(n=i.currentTime,i.seek(0,!0));o&&o!==s.element&&o!==Z.body;){const E=es(o,\"position\")===\"sticky\"?zt(o,{position:\"static\"}):!1;o=o.parentElement,E&&(e||(e=[]),e.push(E))}const c=t.getBoundingClientRect(),d=s.scale,h=(r?c.left+s.scrollX-s.left:c.top+s.scrollY-s.top)*d,p=(r?c.width:c.height)*d,a=r?s.width:s.height,f=(r?s.scrollWidth:s.scrollHeight)-a,l=this.enter,g=this.leave;let m=\"start\",y=\"end\",S=\"end\",k=\"start\";if(Ze(l)){const E=l.split(\" \");S=E[0],m=E.length>1?E[1]:m}else if(Ye(l)){const E=l;F(E.container)||(S=E.container),F(E.target)||(m=E.target)}else st(l)&&(S=l);if(Ze(g)){const E=g.split(\" \");k=E[0],y=E.length>1?E[1]:y}else if(Ye(g)){const E=g;F(E.container)||(k=E.container),F(E.target)||(y=E.target)}else st(g)&&(k=g);const b=Vr(t,m,p),u=Vr(t,y,p),v=b+h-a,_=u+h-f,w=Vr(t,S,a,v,_),T=Vr(t,k,a,v,_),R=b+h-w,C=u+h-T,P=C-R;this.offset=h,this.offsetStart=R,this.offsetEnd=C,this.distance=P<=0?0:P,this.thresholds=[m,y,S,k],this.coords=[b,u,w,T],e&&e.forEach(E=>E.revert()),i&&i.seek(n,!0),this._debug&&this.debug()}handleScroll(){if(!this.ready)return;const e=this.linked,t=this.sync,s=this.syncEase,r=this.syncSmooth,i=e&&(s||r),n=this.horizontal,o=this.container,c=this.scroll,d=c<=this.offsetStart,h=c>=this.offsetEnd,p=!d&&!h,a=c===this.offsetStart||c===this.offsetEnd,f=!this.hasEntered&&a,l=this._debug&&this.$debug;let g=!1,m=!1,y=this.progress;if(d&&this.began&&(this.began=!1),y>0&&!this.began&&(this.began=!0),i){const S=e.progress;if(r&&st(r)){if(r<1){const k=S<y&&y===1?1e-4:S>y&&!y?-1e-4:0;y=z(Jt(S,y,Jt(.01,.2,r))+k,6)}}else s&&(y=s(y));g=y!==this.prevProgress,m=S===1,g&&!m&&r&&S&&o.wakeTicker.restart()}if(l){const S=n?o.scrollY:o.scrollX;l.style[n?\"top\":\"left\"]=S+10+\"px\"}(p&&!this.isInView||f&&!this.forceEnter&&!this.hasEntered)&&(p&&(this.isInView=!0),!this.forceEnter||!this.hasEntered?(l&&p&&(l.style.zIndex=`${this.container.zIndex++}`),this.onSyncEnter(this),this.onEnter(this),this.backward?(this.onSyncEnterBackward(this),this.onEnterBackward(this)):(this.onSyncEnterForward(this),this.onEnterForward(this)),this.hasEntered=!0,f&&(this.forceEnter=!0)):p&&(this.forceEnter=!1)),(p||!p&&this.isInView)&&(g=!0),g&&(i&&e.seek(e.duration*y),this.onUpdate(this)),!p&&this.isInView&&(this.isInView=!1,this.onSyncLeave(this),this.onLeave(this),this.backward?(this.onSyncLeaveBackward(this),this.onLeaveBackward(this)):(this.onSyncLeaveForward(this),this.onLeaveForward(this)),t&&!r&&(m=!0)),y>=1&&this.began&&!this.completed&&(t&&m||!t)&&(t&&this.onSyncComplete(this),this.completed=!0,(!this.repeat&&!e||!this.repeat&&e&&e.completed)&&this.revert()),y<1&&this.completed&&(this.completed=!1),this.prevProgress=y}revert(){if(this.reverted)return;const e=this.container;return Rt(e,this),e._head||e.revert(),this._debug&&this.removeDebug(),this.reverted=!0,this.ready=!1,this}},Ju=(e={})=>new qo(e),Fo=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,Ku=(e,t,s)=>{let r=0,i=1,n,o,c=0;do o=r+(i-r)/2,n=Fo(o,t,s)-e,n>0?i=o:r=o;while(wt(n)>1e-7&&++c<100);return o},Vo=(e=.5,t=0,s=.5,r=1)=>e===t&&s===r?_t:i=>i===0||i===1?i:Fo(Ku(i,e,s),t,r),zo=(e=10,t)=>{const s=t?gu:Ps;return r=>s(j(r,0,1)*e)*(1/e)},Vi=(...e)=>{const t=e.length;if(!t)return _t;const s=t-1,r=e[0],i=e[s],n=[0],o=[us(r)];for(let c=1;c<s;c++){const d=e[c],h=Ze(d)?d.trim().split(\" \"):[d],p=h[0],a=h[1];n.push(F(a)?c/s:us(a)/100),o.push(us(p))}return o.push(us(i)),n.push(1),function(d){for(let h=1,p=n.length;h<p;h++){const a=n[h];if(d<=a){const f=n[h-1],l=o[h-1];return l+(o[h]-l)*(d-f)/(a-f)}}return o[o.length-1]}},Uo=(e=10,t=1)=>{const s=[0],r=e-1;for(let i=1;i<r;i++){const n=s[i-1],o=i/r,c=o+((i+1)/r-o)*Math.random(),d=o*(1-t)+c*t;s.push(j(d,n,1))}return s.push(1),Vi(...s)},Qu=_s({Spring:()=>Dr,createSpring:()=>Mo,cubicBezier:()=>Vo,eases:()=>qt,irregular:()=>Uo,linear:()=>Vi,spring:()=>Br,steps:()=>zo}),zr=(e,t=100)=>{const s=[];for(let r=0;r<=t;r++)s.push(z(e(r/t),4));return`linear(${s.join(\", \")})`},Wo={},Go=e=>{let t=Wo[e];if(t)return t;if(t=\"linear\",Ze(e)){if(je(e,\"linear\")||je(e,\"cubic-\")||je(e,\"steps\")||je(e,\"ease\"))t=e;else if(je(e,\"cubicB\"))t=Sr(e);else{const s=Ao(e);qe(s)&&(t=s===_t?\"linear\":zr(s))}Wo[e]=t}else if(qe(e)){const s=zr(e);s&&(t=s)}else e.ease&&(t=zr(e.ease));return t},Xo=[\"x\",\"y\",\"z\"],eh=[\"perspective\",\"width\",\"height\",\"margin\",\"padding\",\"top\",\"right\",\"bottom\",\"left\",\"borderWidth\",\"fontSize\",\"borderRadius\",...Xo],th=[...Xo,...ls.filter(e=>[\"X\",\"Y\",\"Z\"].some(t=>e.endsWith(t)))],zi=null,er=(e,t,s,r,i)=>{let n=Ze(t)?t:Xe(t,s,r,i,null,null);return st(n)?eh.includes(e)||je(e,\"translate\")?`${n}px`:je(e,\"rotate\")||je(e,\"skew\")?`${n}deg`:`${n}`:n},jo=(e,t,s,r,i,n)=>{let o=\"0\";const c=F(r)?getComputedStyle(e)[t]:er(t,r,e,i,n);return F(s)?o=Qe(r)?r.map(d=>er(t,d,e,i,n)):c:o=[er(t,s,e,i,n),c],o},Yo=class{constructor(e,t){We.current&&We.current.register(this),cs(zi)&&(Nt&&(F(CSS)||!Object.hasOwnProperty.call(CSS,\"registerProperty\"))?zi=!1:(ls.forEach(f=>{const l=je(f,\"skew\"),g=je(f,\"scale\"),m=je(f,\"rotate\"),y=je(f,\"translate\"),S=m||l,k=S?\"<angle>\":g?\"<number>\":y?\"<length-percentage>\":\"*\";try{CSS.registerProperty({name:\"--\"+f,syntax:k,inherits:!1,initialValue:y?\"0px\":S?\"0deg\":g?\"1\":\"0\"})}catch{}}),zi=!0));const s=Kt(e);s.length||console.warn(\"No target found. Make sure the element you're trying to animate is accessible before creating your animation.\");const r=W(t.autoplay,U.defaults.autoplay),i=r&&r.link?r:!1,n=t.alternate&&t.alternate===!0,o=t.reversed&&t.reversed===!0,c=W(t.loop,U.defaults.loop),d=c===!0||c===1/0?1/0:st(c)?c+1:1,h=n?o?\"alternate-reverse\":\"alternate\":o?\"reverse\":\"normal\",p=\"both\",a=U.timeScale===1?1:ut;this.targets=s,this.animations=[],this.controlAnimation=null,this.onComplete=t.onComplete||U.defaults.onComplete,this.duration=0,this.muteCallbacks=!1,this.completed=!1,this.paused=!r||i!==!1,this.reversed=o,this.persist=W(t.persist,U.defaults.persist),this.autoplay=r,this._speed=W(t.playbackRate,U.defaults.playbackRate),this._resolve=ie,this._completed=0,this._inlineStyles=[],s.forEach((f,l)=>{const g=f[Xs],m=th.some(C=>t.hasOwnProperty(C)),y=f.style,S=this._inlineStyles[l]={},k=W(t.ease,U.defaults.ease),b=Xe(k,f,l,s,null,null),u=qe(b)||Ze(b)?b:k,v=k.ease&&k,_=Go(u),w=(v?v.settlingDuration:Xe(W(t.duration,U.defaults.duration),f,l,s,null,null))*a,T=Xe(W(t.delay,U.defaults.delay),f,l,s,null,null)*a,R=W(t.composition,\"replace\");for(let C in t){if(!As(C))continue;const P={},E={iterations:d,direction:h,fill:p,easing:_,duration:w,delay:T,composite:R},N=t[C],D=m?ls.includes(C)?C:wi.get(C):!1,q=D?\"transform\":C;S[q]||(S[q]=y[q]);let L;if(Ye(N)){const B=N,M=W(B.ease,_),I=M.ease&&M,V=B.to,X=B.from;if(E.duration=(I?I.settlingDuration:Xe(W(B.duration,w),f,l,s,null,null))*a,E.delay=Xe(W(B.delay,T),f,l,s,null,null)*a,E.composite=W(B.composition,R),E.easing=Go(M),L=jo(f,C,X,V,l,s),D?(P[`--${D}`]=L,g[D]=L):P[C]=jo(f,C,X,V,l,s),Oo(this,f,C,P,E),!F(X))if(!D)y[C]=P[C][0];else{const Y=`--${D}`;y.setProperty(Y,P[Y][0])}}else L=Qe(N)?N.map(B=>er(C,B,f,l,s)):er(C,N,f,l,s),D?(P[`--${D}`]=L,g[D]=L):P[C]=L,Oo(this,f,C,P,E)}if(m){let C=\"\";for(let P in g)C+=`${Kn[P]}var(--${P})) `;y.transform=C}}),i&&this.autoplay.link(this)}forEach(e){try{const t=Ze(e)?s=>s[e]():e;this.animations.forEach(t)}catch{}return this}get speed(){return this._speed}set speed(e){this._speed=+e,this.forEach(t=>t.playbackRate=e)}get currentTime(){const e=this.controlAnimation,t=U.timeScale;return this.completed?this.duration:e?+e.currentTime*(t===1?1:t):0}set currentTime(e){const t=e*(U.timeScale===1?1:ut);this.forEach(s=>{!this.persist&&t>=this.duration&&s.play(),s.currentTime=t})}get progress(){return this.currentTime/this.duration}set progress(e){this.forEach(t=>t.currentTime=e*this.duration||0)}resume(){return this.paused?(this.paused=!1,this.forEach(\"play\")):this}pause(){return this.paused?this:(this.paused=!0,this.forEach(\"pause\"))}alternate(){return this.reversed=!this.reversed,this.forEach(\"reverse\"),this.paused&&this.forEach(\"pause\"),this}play(){return this.reversed&&this.alternate(),this.resume()}reverse(){return this.reversed||this.alternate(),this.resume()}seek(e,t=!1){return t&&(this.muteCallbacks=!0),e<this.duration&&(this.completed=!1),this.currentTime=e,this.muteCallbacks=!1,this.paused&&this.pause(),this}restart(){return this.completed=!1,this.seek(0,!0).resume()}commitStyles(){return this.forEach(\"commitStyles\")}complete(){return this.seek(this.duration)}cancel(){return this.muteCallbacks=!0,this.commitStyles().forEach(\"cancel\"),this.animations.length=0,requestAnimationFrame(()=>{this.targets.forEach(e=>{e.style.transform===\"none\"&&e.style.removeProperty(\"transform\")})}),this}revert(){return this.cancel().targets.forEach((e,t)=>{const s=e.style,r=this._inlineStyles[t];for(let i in r){const n=r[i];F(n)||n===\"\"?s.removeProperty(Sr(i)):e.style[i]=n}e.getAttribute(\"style\")===\"\"&&e.removeAttribute(\"style\")}),this}then(e=ie){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=ie};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},Zo={animate:(e,t)=>new Yo(e,t),convertEase:zr},sh=0,rh=0,Ur=(e,t)=>!e||!t?!1:e===t||e.contains(t),Ms=e=>{if(!e)return null;const t=e.style,s=t.transition||\"\";return t.setProperty(\"transition\",\"none\",\"important\"),s},Wr=(e,t)=>{if(!e)return;const s=e.style;t?s.transition=t:s.removeProperty(\"transition\")},ih=e=>{const t=e.layout.transitionMuteStore,s=e.$el,r=e.$measure;s&&!t.has(s)&&t.set(s,Ms(s)),r&&!t.has(r)&&t.set(r,Ms(r))},Gr=e=>{e.forEach((t,s)=>Wr(s,t)),e.clear()},nh={display:\"none\",visibility:\"hidden\",opacity:\"0\",transform:\"none\",position:\"static\"},oh=e=>{if(!e)return;const t=e.parentNode;t&&(t._head===e&&(t._head=e._next),t._tail===e&&(t._tail=e._prev),e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e._prev=null,e._next=null,e.parentNode=null)},Jo=(e,t,s,r)=>{let i=e.dataset.layoutId;i||(i=e.dataset.layoutId=`node-${rh++}`);const n=r||{};return n.$el=e,n.$measure=e,n.id=i,n.index=0,n.targets=null,n.delay=0,n.duration=0,n.ease=null,n.state=s,n.layout=s.layout,n.parentNode=t||null,n.isTarget=!1,n.isEntering=!1,n.isLeaving=!1,n.isInlined=!1,n.hasTransform=!1,n.inlineStyles=[],n.inlineTransforms=null,n.inlineTransition=null,n.branchAdded=!1,n.branchRemoved=!1,n.branchNotRendered=!1,n.sizeChanged=!1,n.hasVisibilitySwap=!1,n.hasDisplayNone=!1,n.hasVisibilityHidden=!1,n.measuredInlineTransform=null,n.measuredInlineTransition=null,n.measuredDisplay=null,n.measuredVisibility=null,n.measuredPosition=null,n.measuredHasDisplayNone=!1,n.measuredHasVisibilityHidden=!1,n.measuredIsVisible=!1,n.measuredIsRemoved=!1,n.measuredIsInsideRoot=!1,n.properties={transform:\"none\",x:0,y:0,left:0,top:0,clientLeft:0,clientTop:0,width:0,height:0},n.layout.properties.forEach(o=>n.properties[o]=0),n._head=null,n._tail=null,n._prev=null,n._next=null,n},Ko=(e,t,s,r)=>{const i=e.$el,n=e.layout.root,o=n===i,c=e.properties,d=e.state.rootNode,h=e.parentNode,p=s.transform,a=i.style.transform,f=h?h.measuredIsRemoved:!1,l=s.position;o&&(e.layout.absoluteCoords=l===\"fixed\"||l===\"absolute\"),e.$measure=t,e.inlineTransforms=a,e.hasTransform=p&&p!==\"none\",e.measuredIsInsideRoot=Ur(n,t),e.measuredInlineTransform=null,e.measuredDisplay=s.display,e.measuredVisibility=s.visibility,e.measuredPosition=l,e.measuredHasDisplayNone=s.display===\"none\",e.measuredHasVisibilityHidden=s.visibility===\"hidden\",e.measuredIsVisible=!(e.measuredHasDisplayNone||e.measuredHasVisibilityHidden),e.measuredIsRemoved=e.measuredHasDisplayNone||e.measuredHasVisibilityHidden||f;let g=!1,m=i.previousSibling;for(;m&&(m.nodeType===Node.COMMENT_NODE||m.nodeType===Node.TEXT_NODE&&!m.textContent.trim());)m=m.previousSibling;if(m&&m.nodeType===Node.TEXT_NODE)g=!0;else{for(m=i.nextSibling;m&&(m.nodeType===Node.COMMENT_NODE||m.nodeType===Node.TEXT_NODE&&!m.textContent.trim());)m=m.nextSibling;g=m!==null&&m.nodeType===Node.TEXT_NODE}if(e.isInlined=g,e.hasTransform&&!r){const _=e.layout.transitionMuteStore;_.get(i)||(e.inlineTransition=Ms(i)),t===i?i.style.transform=\"none\":(_.get(t)||(e.measuredInlineTransition=Ms(t)),e.measuredInlineTransform=t.style.transform,t.style.transform=\"none\")}let y=0,S=0,k=0,b=0;if(!r){const _=t.getBoundingClientRect();y=_.left,S=_.top,k=_.width,b=_.height}for(let _ in c){const w=_===\"transform\"?p:s[_]||s.getPropertyValue&&s.getPropertyValue(_);F(w)||(c[_]=w)}c.left=y,c.top=S,c.clientLeft=r?0:t.clientLeft,c.clientTop=r?0:t.clientTop;let u,v;if(o)e.layout.absoluteCoords?(u=y,v=S):(u=0,v=0);else{const _=h||d,w=_.properties.left,T=_.properties.top,R=_.properties.clientLeft,C=_.properties.clientTop;if(e.layout.absoluteCoords)u=y-w-R,v=S-T-C;else if(_===d){const P=d.properties.left,E=d.properties.top,N=d.properties.clientLeft,D=d.properties.clientTop;u=y-P-N,v=S-E-D}else u=y-w-R,v=S-T-C}return c.x=u,c.y=v,c.width=k,c.height=b,e},Qo=(e,t)=>{if(t)for(let s in t)e.properties[s]=t[s]},tr=(e,t)=>{const s=Xe(t.ease,e.$el,e.index,e.targets,null,null),r=qe(s)?s:t.ease,i=!F(r)&&!F(r.ease);e.ease=i?r.ease:r,e.duration=i?r.settlingDuration:Xe(t.duration,e.$el,e.index,e.targets,null,null),e.delay=Xe(t.delay,e.$el,e.index,e.targets,null,null)},ah=e=>{const t=e.$el.style,s=e.inlineStyles;s.length=0,e.layout.recordedProperties.forEach(r=>{s.push(r,t[r]||\"\")})},ea=e=>{const t=e.$el.style,s=e.inlineStyles;for(let r=0,i=s.length;r<i;r+=2){const n=s[r],o=s[r+1];o&&o!==\"\"?t[n]=o:(t[n]=\"\",t.removeProperty(n))}},lh=e=>{const t=e.inlineTransforms,s=e.$el.style;!e.hasTransform||!t||e.hasTransform&&s.transform===\"none\"||t&&t===\"none\"?s.removeProperty(\"transform\"):t&&(s.transform=t);const r=e.$measure;if(e.hasTransform&&r!==e.$el){const i=r.style,n=e.measuredInlineTransform;n&&n!==\"\"?i.transform=n:i.removeProperty(\"transform\")}e.measuredInlineTransform=null,e.inlineTransition!==null&&(Wr(e.$el,e.inlineTransition),e.inlineTransition=null),r!==e.$el&&e.measuredInlineTransition!==null&&(Wr(r,e.measuredInlineTransition),e.measuredInlineTransition=null)},ta=e=>{(e.measuredIsRemoved||e.hasVisibilitySwap)&&(e.$el.style.removeProperty(\"display\"),e.$el.style.removeProperty(\"visibility\"),e.hasVisibilitySwap&&(e.$measure.style.removeProperty(\"display\"),e.$measure.style.removeProperty(\"visibility\"))),e.layout.pendingRemoval.delete(e.$el)},Ui=(e,t,s)=>(t.properties={...e.properties},t.state=s,t.isTarget=e.isTarget,t.hasTransform=e.hasTransform,t.inlineTransforms=e.inlineTransforms,t.measuredIsVisible=e.measuredIsVisible,t.measuredDisplay=e.measuredDisplay,t.measuredIsRemoved=e.measuredIsRemoved,t.measuredHasDisplayNone=e.measuredHasDisplayNone,t.measuredHasVisibilityHidden=e.measuredHasVisibilityHidden,t.hasDisplayNone=e.hasDisplayNone,t.isInlined=e.isInlined,t.hasVisibilityHidden=e.hasVisibilityHidden,t),sa=class{constructor(e){this.layout=e,this.rootNode=null,this.rootNodes=new Set,this.nodes=new Map,this.scrollX=0,this.scrollY=0}revert(){return this.forEachNode(e=>{this.layout.pendingRemoval.delete(e.$el),e.$el.removeAttribute(\"data-layout-id\"),e.$measure.removeAttribute(\"data-layout-id\")}),this.rootNode=null,this.rootNodes.clear(),this.nodes.clear(),this}getNode(e){if(!(!e||!e.dataset))return this.nodes.get(e.dataset.layoutId)}getComputedValue(e,t){const s=this.getNode(e);if(s)return s.properties[t]}forEach(e,t){let s=e,r=0;for(;s;)if(t(s,r++),s._head)s=s._head;else if(s._next)s=s._next;else{for(;s&&!s._next;)s=s.parentNode;s&&(s=s._next)}}forEachRootNode(e){this.forEach(this.rootNode,e)}forEachNode(e){for(const t of this.rootNodes)this.forEach(t,e)}registerElement(e,t){if(!e||e.nodeType!==1)return null;this.layout.transitionMuteStore.has(e)||this.layout.transitionMuteStore.set(e,Ms(e));const s=[e,t],r=this.layout.root;let i=null;for(;s.length;){const n=s.pop(),o=s.pop();if(!o||o.nodeType!==1||kr(o))continue;const c=n?n.measuredIsRemoved:!1,d=c?nh:getComputedStyle(o),h=c?!0:d.display===\"none\",p=c?!0:d.visibility===\"hidden\",a=!h&&!p,f=o.dataset.layoutId,l=Ur(r,o);let g=f?this.nodes.get(f):null;if(g&&g.$el!==o){const y=Ur(r,g.$el),S=g.measuredIsVisible,k=!y&&(l||!l&&!S&&a),b=y&&!S&&a;if(k)oh(g),g=Jo(o,n,this,g);else if(b){Ko(g,o,d,c);let u=o.lastElementChild;for(;u;)s.push(u,g),u=u.previousElementSibling;i||(i=g);continue}else{let u=o.lastElementChild;for(;u;)s.push(u,n),u=u.previousElementSibling;i||(i=g);continue}}else g=Jo(o,n,this,g);g.branchAdded=!1,g.branchRemoved=!1,g.branchNotRendered=!1,g.isTarget=!1,g.sizeChanged=!1,g.hasVisibilityHidden=p,g.hasDisplayNone=h,g.hasVisibilitySwap=p&&!g.measuredHasVisibilityHidden||h&&!g.measuredHasDisplayNone,this.nodes.set(g.id,g),g.parentNode=n||null,g._prev=null,g._next=null,n?(this.rootNodes.delete(g),n._head?(n._tail._next=g,g._prev=n._tail,n._tail=g):(n._head=g,n._tail=g)):this.rootNodes.add(g),Ko(g,g.$el,d,c);let m=o.lastElementChild;for(;m;)s.push(m,g),m=m.previousElementSibling;i||(i=g)}return i}ensureDetachedNode(e,t){if(!e||e===this.layout.root)return null;const s=e.dataset.layoutId,r=s?this.nodes.get(s):null;if(r&&r.$el===e)return r;let i=null,n=e.parentElement;for(;n&&n!==this.layout.root;){if(t.has(n)){i=this.ensureDetachedNode(n,t);break}n=n.parentElement}return this.registerElement(e,i)}record(){const e=this.layout,t=e.children,s=e.root,r=Qe(t)?t:[t],i=[],n=t===\"*\"?s:We.root,o=[];let c=s.parentElement;for(;c&&c.nodeType===1;){const m=getComputedStyle(c);if(m.transform&&m.transform!==\"none\"){const y=c.style.transform||\"\",S=Ms(c);o.push(c,y,S),c.style.transform=\"none\"}c=c.parentElement}for(let m=0,y=r.length;m<y;m++){const S=r[m];i[m]=Ze(S)?n.querySelectorAll(S):S}const d=Kt(i);this.nodes.clear(),this.rootNodes.clear();const h=this.registerElement(s,null);h.isTarget=!0,this.rootNode=h;const p=new Set;let a=0;const f=[];this.nodes.forEach(m=>{f.push(m.$el)}),this.nodes.forEach((m,y)=>{m.index=a++,m.targets=f,m&&m.measuredIsInsideRoot&&p.add(y)});const l=new Set,g=[];for(let m=0,y=d.length;m<y;m++){const S=d[m];if(!(!S||S.nodeType!==1||S===s)){if(!Ur(s,S)){const k=S.dataset.layoutId;if(!k||!p.has(k))continue}l.has(S)||(l.add(S),g.push(S))}}for(let m=0,y=g.length;m<y;m++)this.ensureDetachedNode(g[m],l);for(let m=0,y=d.length;m<y;m++){const S=d[m],k=this.getNode(S);if(k){let b=k;for(;b&&!b.isTarget;)b.isTarget=!0,b=b.parentNode}}this.scrollX=window.scrollX,this.scrollY=window.scrollY,this.forEachNode(lh);for(let m=0,y=o.length;m<y;m+=3){const S=o[m],k=o[m+1],b=o[m+2];k&&k!==\"\"?S.style.transform=k:S.style.removeProperty(\"transform\"),Wr(S,b)}return this}};function Os(e){const t={},s={};for(let r in e){const i=e[r],n=r===\"ease\";r===\"duration\"||r===\"delay\"||n?s[r]=i:t[r]=i}return[t,s]}var ra=class{constructor(e,t={}){We.current&&We.current.register(this);const s=Os(t.swapAt),r=Os(t.enterFrom),i=Os(t.leaveTo),n=t.properties;if(t.duration=W(t.duration,350),t.delay=W(t.delay,0),t.ease=W(t.ease,\"inOut(3.5)\"),this.params=t,this.root=Kt(e)[0],this.id=t.id||sh++,this.children=t.children||\"*\",this.absoluteCoords=!1,this.swapAtParams=xt(t.swapAt||{opacity:0},{ease:\"inOut(1.75)\"}),this.enterFromParams=t.enterFrom||{opacity:0},this.leaveToParams=t.leaveTo||{opacity:0},this.properties=new Set([\"opacity\",\"fontSize\",\"color\",\"backgroundColor\",\"borderRadius\",\"border\",\"filter\",\"clipPath\"]),s[0])for(let o in s[0])this.properties.add(o);if(r[0])for(let o in r[0])this.properties.add(o);if(i[0])for(let o in i[0])this.properties.add(o);if(n)for(let o=0,c=n.length;o<c;o++)this.properties.add(n[o]);this.recordedProperties=new Set([\"display\",\"visibility\",\"translate\",\"position\",\"left\",\"top\",\"marginLeft\",\"marginTop\",\"width\",\"height\",\"maxWidth\",\"maxHeight\",\"minWidth\",\"minHeight\"]),this.properties.forEach(o=>this.recordedProperties.add(o)),this.pendingRemoval=new WeakSet,this.transitionMuteStore=new Map,this.oldState=new sa(this),this.newState=new sa(this),this.timeline=null,this.transformAnimation=null,this.animating=[],this.swapping=[],this.leaving=[],this.entering=[],this.oldState.record(),Gr(this.transitionMuteStore)}revert(){return this.root.classList.remove(\"is-animated\"),this.timeline&&(this.timeline.complete(),this.timeline=null),this.transformAnimation&&(this.transformAnimation.complete(),this.transformAnimation=null),this.animating.length=this.swapping.length=this.leaving.length=this.entering.length=0,this.oldState.revert(),this.newState.revert(),requestAnimationFrame(()=>Gr(this.transitionMuteStore)),this}record(){return this.transformAnimation&&(this.transformAnimation.cancel(),this.transformAnimation=null),this.oldState.record(),this.timeline&&(this.timeline.cancel(),this.timeline=null),this.newState.forEachRootNode(ea),this}animate(e={}){const t={ease:W(e.ease,this.params.ease),delay:W(e.delay,this.params.delay),duration:W(e.duration,this.params.duration)},s={id:this.id},r=W(e.onComplete,this.params.onComplete),i=W(e.onPause,this.params.onPause);for(let L in js)L!==\"ease\"&&L!==\"duration\"&&L!==\"delay\"&&(F(e[L])?F(this.params[L])||(s[L]=this.params[L]):s[L]=e[L]);s.onComplete=()=>{const L=e.autoplay,B=U.editor;if(L&&L.linked||B&&B.showPanel){r&&r(this.timeline);return}this.transformAnimation&&this.transformAnimation.cancel(),m.forEachRootNode(M=>{ta(M),ea(M)});for(let M=0,I=w.length;M<I;M++){const V=w[M];V.style.transform=m.getComputedValue(V,\"transform\")}this.root.classList.contains(\"is-animated\")&&(this.root.classList.remove(\"is-animated\"),r&&r(this.timeline)),requestAnimationFrame(()=>{this.root.classList.contains(\"is-animated\")||Gr(this.transitionMuteStore)})},s.onPause=()=>{const L=e.autoplay;if(L&&L.linked){r&&r(this.timeline),i&&i(this.timeline);return}this.root.classList.contains(\"is-animated\")&&(this.transformAnimation&&this.transformAnimation.cancel(),m.forEachRootNode(ta),this.root.classList.remove(\"is-animated\"),r&&r(this.timeline),i&&i(this.timeline))},s.composition=!1;const n=xt(xt(e.swapAt||{},this.swapAtParams),t),o=xt(xt(e.enterFrom||{},this.enterFromParams),t),c=xt(xt(e.leaveTo||{},this.leaveToParams),t),[d,h]=Os(n),[p,a]=Os(o),[f,l]=Os(c),g=this.oldState,m=this.newState,y=this.animating,S=this.swapping,k=this.entering,b=this.leaving,u=this.pendingRemoval;y.length=S.length=k.length=b.length=0,g.forEachRootNode(ih),m.record(),m.forEachRootNode(ah);const v=[],_=[],w=[],T=[],R=m.rootNode,C=R.$el;m.forEachRootNode(L=>{const B=L.$el,M=L.id,I=L.parentNode,V=I?I.branchAdded:!1,X=I?I.branchRemoved:!1,Y=I?I.branchNotRendered:!1;let G=g.nodes.get(M);const K=!G;K?(G=Ui(L,{},g),g.nodes.set(M,G),G.measuredIsRemoved=!0):G.measuredIsRemoved&&!L.measuredIsRemoved&&(Ui(L,G,g),G.measuredIsRemoved=!0);const oe=G.parentNode,ne=(oe?oe.id:null)!==(I?I.id:null),we=G.$el!==L.$el,me=G.measuredIsRemoved,ue=L.measuredIsRemoved;if(!G.measuredIsRemoved&&!ue&&!K&&(ne||we)){const ke=G.properties.left,Pe=G.properties.top,Ee=I||m.rootNode,ae=Ee.id?g.nodes.get(Ee.id):null,le=ae?ae.properties.left:Ee.properties.left,xe=ae?ae.properties.top:Ee.properties.top,_e=ae?ae.properties.clientLeft:Ee.properties.clientLeft,Ie=ae?ae.properties.clientTop:Ee.properties.clientTop;G.properties.x=ke-le-_e,G.properties.y=Pe-xe-Ie}L.hasVisibilitySwap&&(L.hasVisibilityHidden&&(L.$el.style.visibility=\"visible\",L.$measure.style.visibility=\"hidden\"),L.hasDisplayNone&&(L.$el.style.display=G.measuredDisplay||L.measuredDisplay||\"\",L.$measure.style.visibility=\"hidden\"));const J=u.has(B),re=G.measuredIsVisible,Me=L.measuredIsVisible,Re=!re&&Me&&!Y,Ae=!ue&&(me||J)&&!V,$e=ue&&!me&&!X,be=$e||ue&&J&&!X;L.branchAdded=V||Ae,L.branchRemoved=X||be,L.branchNotRendered=Y||ue,ue&&re&&(L.$el.style.display=G.measuredDisplay,L.$el.style.visibility=\"visible\",Ui(G,L,m)),$e?(L.isTarget&&(b.push(B),L.isLeaving=!0),u.add(B)):!ue&&J&&u.delete(B),Ae&&!Y||Re?(Qo(G,p),L.isTarget&&(k.push(B),L.isEntering=!0)):be&&!Y&&Qo(L,f),L!==R&&L.isTarget&&!L.isEntering&&!L.isLeaving&&y.push(B),v.push(B)});let P=0,E=0,N=0;m.forEachRootNode(L=>{const B=L.$el,M=L.parentNode,I=g.nodes.get(L.id),V=L.properties,X=I.properties;let Y=M!==R&&M;for(;Y&&!Y.isTarget&&Y!==R;)Y=Y.parentNode;L===R?(L.index=0,L.targets=y,tr(L,t)):L.isEntering?(L.index=Y?Y.index:P,L.targets=Y?y:k,tr(L,a),P++):L.isLeaving?(L.index=Y?Y.index:E,L.targets=Y?y:b,E++,tr(L,l)):L.isTarget?(L.index=N++,L.targets=y,tr(L,t)):(L.index=Y?Y.index:0,L.targets=y,tr(L,h)),I.index=L.index,I.targets=L.targets;for(let ne in V)V[ne]=Xe(V[ne],B,L.index,L.targets,null,null),X[ne]=Xe(X[ne],B,I.index,I.targets,null,null);const G=1,K=Math.abs(V.width-X.width)>G,oe=Math.abs(V.height-X.height)>G;if(L.sizeChanged=K||oe,L.isTarget&&(!L.measuredIsRemoved&&I.measuredIsVisible||L.measuredIsRemoved&&L.measuredIsVisible)){(V.transform!==\"none\"||X.transform!==\"none\")&&(L.hasTransform=!0,w.push(B));for(let ne in V)if(ne!==\"transform\"&&V[ne]!==X[ne]){_.push(B);break}}L.isTarget||(S.push(B),L.sizeChanged&&M&&M.isTarget&&M.sizeChanged&&(d.transform&&(L.hasTransform=!0,w.push(B)),T.push(B)))});const D={delay:L=>m.getNode(L).delay,duration:L=>m.getNode(L).duration,ease:L=>m.getNode(L).ease};if(s.defaults=D,this.timeline=Io(s),!_.length&&!w.length&&!S.length)return Gr(this.transitionMuteStore),this.timeline.complete();if(v.length){this.root.classList.add(\"is-animated\");for(let L=0,B=v.length;L<B;L++){const M=v[L],I=M.dataset.layoutId,V=g.nodes.get(I),X=m.nodes.get(I),Y=V.properties;X.isInlined||((V.measuredDisplay===\"grid\"||X.measuredDisplay===\"grid\")&&M.style.setProperty(\"display\",\"block\",\"important\"),(M!==C||this.absoluteCoords)&&(M.style.position=this.absoluteCoords?\"fixed\":\"absolute\",M.style.left=\"0px\",M.style.top=\"0px\",M.style.marginLeft=\"0px\",M.style.marginTop=\"0px\",M.style.translate=`${Y.x}px ${Y.y}px`),M===C&&X.measuredPosition===\"static\"&&(M.style.position=\"relative\",M.style.left=\"0px\",M.style.top=\"0px\")),M.style.width=`${Y.width}px`,M.style.height=`${Y.height}px`,M.style.minWidth=\"auto\",M.style.minHeight=\"auto\",M.style.maxWidth=\"none\",M.style.maxHeight=\"none\"}(g.scrollX!==window.scrollX||g.scrollY!==window.scrollY)&&requestAnimationFrame(()=>window.scrollTo(g.scrollX,g.scrollY));for(let L=0,B=_.length;L<B;L++){const M=_[L],I=M.dataset.layoutId,V=g.nodes.get(I),X=m.nodes.get(I),Y=V.properties,G=X.properties;let K=!1;const oe={composition:\"none\"};Y.width!==G.width&&(oe.width=[Y.width,G.width],K=!0),Y.height!==G.height&&(oe.height=[Y.height,G.height],K=!0),!X.hasTransform&&!X.isInlined&&(oe.translate=[`${Y.x}px ${Y.y}px`,`${G.x}px ${G.y}px`],K=!0),this.properties.forEach(ne=>{const we=Y[ne],me=G[ne];ne!==\"transform\"&&we!==me&&(oe[ne]=[we,me],K=!0)}),K&&this.timeline.add(M,oe,0)}}if(S.length){for(let L=0,B=S.length;L<B;L++){const M=S[L],I=g.getNode(M),V=I.properties;M.style.width=`${V.width}px`,M.style.height=`${V.height}px`,M.style.minWidth=\"auto\",M.style.minHeight=\"auto\",M.style.maxWidth=\"none\",M.style.maxHeight=\"none\",I.isInlined||(M.style.translate=`${V.x}px ${V.y}px`),this.properties.forEach(X=>{X!==\"transform\"&&(M.style[X]=`${g.getComputedValue(M,X)}`)})}for(let L=0,B=S.length;L<B;L++){const M=S[L],I=m.getNode(M),V=I.properties;this.timeline.call(()=>{M.style.width=`${V.width}px`,M.style.height=`${V.height}px`,M.style.minWidth=\"auto\",M.style.minHeight=\"auto\",M.style.maxWidth=\"none\",M.style.maxHeight=\"none\",I.isInlined||(M.style.translate=`${V.x}px ${V.y}px`),this.properties.forEach(X=>{X!==\"transform\"&&(M.style[X]=`${m.getComputedValue(M,X)}`)})},I.delay+I.duration/2)}if(T.length){const L=Ft(m.nodes.get(T[0].dataset.layoutId).ease),B=I=>1-L(1-I),M={};if(d)for(let I in d)I!==\"transform\"&&(M[I]=[{from:V=>g.getComputedValue(V,I),to:d[I]},{from:d[I],to:V=>m.getComputedValue(V,I),ease:B}]);this.timeline.add(T,M,0)}}const q=w.length;if(q){for(let L=0;L<q;L++){const B=w[L],M=m.getNode(B);M.isInlined||(B.style.translate=`${g.getComputedValue(B,\"x\")}px ${g.getComputedValue(B,\"y\")}px`),B.style.transform=g.getComputedValue(B,\"transform\"),T.includes(B)&&(M.ease=Xe(n.ease,B,M.index,M.targets,null,null),M.duration=Xe(n.duration,B,M.index,M.targets,null,null))}this.transformAnimation=Zo.animate(w,{translate:L=>m.getNode(L).isInlined?\"0px 0px\":`${m.getComputedValue(L,\"x\")}px ${m.getComputedValue(L,\"y\")}px`,transform:L=>{const B=m.getComputedValue(L,\"transform\");if(!T.includes(L))return B;const M=g.getComputedValue(L,\"transform\"),I=m.getNode(L);return[M,Xe(d.transform,L,I.index,I.targets,null,null),B]},autoplay:!1,...D}),this.timeline.sync(this.transformAnimation,0)}return this.timeline.init()}update(e,t={}){return this.record(),e(this),this.animate(t)}},ch=(e,t)=>new ra(e,t),Tt=Nu,Xr={},uh=(e,t=0)=>(...s)=>t?r=>e(...s,r):r=>e(r,...s),ia=e=>(...t)=>{const s=e(...t);return new Proxy(ie,{apply:(r,i,[n])=>s(n),get:(r,i)=>{if(Xr[i])return ia((...n)=>{const o=Xr[i](...n);return c=>o(s(c))})}})},Ct=(e,t,s=0)=>{const r=(...i)=>(i.length<t.length?ia(uh(t,s)):t)(...i);return Xr[e]||(Xr[e]=r),r},na=Ct(\"roundPad\",Tt.roundPad),oa=Ct(\"padStart\",Tt.padStart),aa=Ct(\"padEnd\",Tt.padEnd),la=Ct(\"wrap\",Tt.wrap),ca=Ct(\"mapRange\",Tt.mapRange),ua=Ct(\"degToRad\",Tt.degToRad),ha=Ct(\"radToDeg\",Tt.radToDeg),da=Ct(\"snap\",Tt.snap),fa=Ct(\"clamp\",Tt.clamp),pa=Ct(\"round\",Tt.round),ga=Ct(\"lerp\",Tt.lerp,1),ma=Ct(\"damp\",Tt.damp,1),sr=(e=0,t=1,s=0)=>{const r=10**s;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},hh=0,rr=(e,t=0,s=1,r=0)=>{let i=e===void 0?hh++:e;return(n=t,o=s,c=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);const d=10**c;return Math.floor((((i^i>>>14)>>>0)/4294967296*(o-n+1/d)+n)*d)/d}},va=e=>e[sr(0,e.length-1)],Wi=(e,t=sr)=>{let s=e.length,r,i;for(;s;)i=t(0,--s),r=e[s],e[s]=e[i],e[i]=r;return e},ir=(e,t={})=>{let s=[],r=0,i,n=null;const o=t.from,c=t.reversed,d=t.ease,h=!F(d),p=h&&!F(d.ease)?d.ease:h?Ft(d):null,a=t.grid,f=a===!0,l=t.axis,g=t.total,m=F(o)||o===0||o===\"first\",y=o===\"center\",S=o===\"last\",k=o===\"random\",b=Qe(o),u=Qe(e),v=t.use,_=us(u?e[0]:e),w=u?us(e[1]):0,T=eo.exec((u?e[1]:e)+\"\"),R=t.start||0+(u?_:0),C=t.seed,P=!F(C)&&C!==!1?rr(C===!0?0:C):sr,E=t.jitter,N=!F(E),D=Qe(E),q=D?E[0]:E||0,L=D?E[1]:E||0;let B=m?0:st(o)?o:0;return(M,I,V,X,Y)=>{const[G]=Kt(M),K=F(g)?V.length:g,oe=F(v)?!1:qe(v)?v(G,I,K):fs(G,v),ne=st(oe)||Ze(oe)&&st(+oe)?+oe:I,we=ne>=0&&ne<K?ne:I;if(y&&(B=(K-1)/2),S&&(B=K-1),!s.length){if(f){let J=!0,re=!1,Me=1/0,Re=1/0,Ae=1/0,$e=-1/0,be=-1/0,ke=-1/0;const Pe=[],Ee=[],ae=[];for(let le=0;le<K;le++){const xe=V[le];let _e=0,Ie=0,$=0,ce=!1;if(xe&&qe(xe.getBoundingClientRect)){const ee=xe.getBoundingClientRect();_e=ee.left+ee.width/2,Ie=ee.top+ee.height/2,ce=!0}else{const ee=xe;ee&&st(ee.x)&&st(ee.y)&&(_e=ee.x,Ie=ee.y,st(ee.z)&&($=ee.z,re=!0),ce=!0)}if(!ce){J=!1;break}Pe.push(_e),Ee.push(Ie),ae.push($),_e<Me&&(Me=_e),Ie<Re&&(Re=Ie),$<Ae&&(Ae=$),_e>$e&&($e=_e),Ie>be&&(be=Ie),$>ke&&(ke=$)}if(J){let le=Pe[0],xe=Ee[0],_e=ae[0];b?(le=Me+o[0]*($e-Me),xe=Re+o[1]*(be-Re),_e=re?Ae+(o.length>=3?o[2]:.5)*(ke-Ae):0):y?(le=(Me+$e)/2,xe=(Re+be)/2,_e=(Ae+ke)/2):S?(le=Pe[K-1],xe=Ee[K-1],_e=ae[K-1]):st(o)&&(le=Pe[o],xe=Ee[o],_e=ae[o]);for(let $=0;$<K;$++){const ce=le-Pe[$],ee=xe-Ee[$],he=_e-ae[$];let ze=kt(ce*ce+ee*ee+(re?he*he:0));l===\"x\"&&(ze=-ce),l===\"y\"&&(ze=-ee),l===\"z\"&&(ze=-he),s.push(ze)}let Ie=1/0;for(let $=0;$<K;$++){const ce=wt(s[$]);ce>0&&ce<Ie&&(Ie=ce)}if(Ie>0&&Ie<1/0)for(let $=0;$<K;$++)s[$]=s[$]/Ie}else for(let le=0;le<K;le++)s.push(wt(B-le))}else for(let J=0;J<K;J++)if(!a)s.push(wt(B-J));else{const re=a.length,Me=a[0]*a[1];let Re,Ae,$e;b?(Re=o[0]*(a[0]-1),Ae=o[1]*(a[1]-1),$e=re===3?(o.length>=3?o[2]:.5)*(a[2]-1):0):y?(Re=(a[0]-1)/2,Ae=(a[1]-1)/2,$e=re===3?(a[2]-1)/2:0):(Re=B%a[0],Ae=Ps(B/a[0])%a[1],$e=re===3?Ps(B/Me):0);const be=J%a[0],ke=Ps(J/a[0])%a[1],Pe=re===3?Ps(J/Me):0,Ee=Re-be,ae=Ae-ke,le=$e-Pe;let xe=kt(Ee*Ee+ae*ae+(re===3?le*le:0));l===\"x\"&&(xe=-Ee),l===\"y\"&&(xe=-ae),l===\"z\"&&(xe=-le),s.push(xe)}r=s[0];for(let J=1;J<K;J++)s[J]>r&&(r=s[J]);if(p||c)for(let J=0;J<K;J++){let re=s[J];p&&(re=p(re/r)*r),c&&(re=l?-re:wt(r-re)),s[J]=re}if(N){n=new Array(K);for(let J=0;J<K;J++)n[J]=P(-1,1,4)}k&&(s=Wi(s,P))}const me=u?(w-_)/r:_;F(i)&&(i=Y?Js(Y,F(t.start)?Y.iterationDuration:R):R);let ue=i+(me*z(s[we],2)||0);if(N){const J=r?s[we]/r:0,re=q+(L-q)*J;ue=ue+n[we]*re}return t.modifier&&(ue=t.modifier(ue)),T&&(ue=`${ue}${T[2]}`),ue}},dh=_s({$:()=>Kt,addChild:()=>It,clamp:()=>fa,cleanInlineStyles:()=>go,createSeededRandom:()=>rr,damp:()=>ma,degToRad:()=>ua,forEachChildren:()=>Ce,get:()=>es,keepTime:()=>Hr,lerp:()=>ga,mapRange:()=>ca,padEnd:()=>aa,padStart:()=>oa,radToDeg:()=>ha,random:()=>sr,randomPick:()=>va,remove:()=>No,removeChild:()=>Rt,round:()=>pa,roundPad:()=>na,set:()=>zt,shuffle:()=>Wi,snap:()=>da,stagger:()=>ir,sync:()=>Fi,wrap:()=>la}),ya=e=>{const t=bt(e)[0];return!t||!kr(t)?console.warn(`${e} is not a valid SVGGeometryElement`):t},Gi=(e,t,s,r,i)=>{const n=s+r,o=i?Math.max(0,Math.min(n,t)):(n%t+t)%t;return e.getPointAtLength(o)},Xi=(e,t,s=0)=>r=>{const i=+e.getTotalLength(),n=r[ki],o=e.getCTM(),c=s===0;return{from:0,to:i,modifier:d=>{const h=d+s*i;if(t===\"a\"){const p=Gi(e,i,h,-1,c),a=Gi(e,i,h,1,c);return xr(a.y-p.y,a.x-p.x)*180/Dt}else{const p=Gi(e,i,h,0,c);return t===\"x\"?n||!o?p.x:p.x*o.a+p.y*o.c+o.e:n||!o?p.y:p.x*o.b+p.y*o.d+o.f}}}},ba=(e,t=0)=>{const s=ya(e);if(s)return{translateX:Xi(s,\"x\",t),translateY:Xi(s,\"y\",t),rotate:Xi(s,\"a\",t)}},fh=e=>{let t=1;if(e&&e.getCTM){const s=e.getCTM();s&&(t=(kt(s.a*s.a+s.b*s.b)+kt(s.c*s.c+s.d*s.d))/2)}return t},ph=(e,t,s)=>{const r=ut,i=getComputedStyle(e),n=i.strokeLinecap,o=i.vectorEffect===\"non-scaling-stroke\"?e:null;let c=n;const d=new Proxy(e,{get(h,p){const a=h[p];return p===Jn?h:p===\"setAttribute\"?(...f)=>{if(f[0]===\"draw\"){const l=f[1].split(\" \"),g=+l[0],m=+l[1],y=fh(o),S=g*-r*y,k=m*r*y+S,b=r*y+(g===0&&m===1||g===1&&m===0?0:10*y)-k;if(n!==\"butt\"){const u=g===m?\"butt\":n;c!==u&&(h.style.strokeLinecap=`${u}`,c=u)}h.setAttribute(\"stroke-dashoffset\",`${S}`),h.setAttribute(\"stroke-dasharray\",`${k} ${b}`)}return Reflect.apply(a,h,f)}:qe(a)?(...f)=>Reflect.apply(a,h,f):a}});return e.getAttribute(\"pathLength\")!==`${r}`&&(e.setAttribute(\"pathLength\",`${r}`),d.setAttribute(\"draw\",`${t} ${s}`)),d},_a=(e,t=0,s=0)=>bt(e).map(r=>ph(r,t,s)),Sa=(e,t=.33)=>(s,r,i,n)=>{if(!(s.tagName||\"\").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can't morph a <${s.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const o=ya(e);if(!o)throw new Error(\"Can't morph to an invalid target. 'path2' must resolve to an existing <path>, <polygon> or <polyline> SVG element.\");if(!(o.tagName||\"\").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can't morph a <${o.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const c=s.tagName===\"path\",d=c?\" \":\",\",h=n?n._value:null;h&&s.setAttribute(c?\"d\":\"points\",h);let p=\"\",a=\"\";if(!t)p=s.getAttribute(c?\"d\":\"points\"),a=o.getAttribute(c?\"d\":\"points\");else{const f=s.getTotalLength(),l=o.getTotalLength(),g=Math.max(Math.ceil(f*t),Math.ceil(l*t));for(let m=0;m<g;m++){const y=m/(g-1),S=s.getPointAtLength(f*y),k=o.getPointAtLength(l*y),b=c?m===0?\"M\":\"L\":\"\";p+=b+z(S.x,3)+d+S.y+\" \",a+=b+z(k.x,3)+d+k.y+\" \"}}return[p,a]},gh=_s({createDrawable:()=>_a,createMotionPath:()=>ba,morphTo:()=>Sa}),jr=typeof Intl<\"u\"&&Intl.Segmenter,mh=/\\{value\\}/g,vh=/\\{i\\}/g,ji=/(\\s+)/,Yi=/^\\s+$/,Zi=\"line\",nr=\"word\",or=\"char\",ar=\"data-line\",Ji=null,Ki=null,Yr=null,ka=e=>e.isWordLike||e.segment===\" \"||st(+e.segment),Qi=e=>e.setAttribute(\"aria-hidden\",\"true\"),Zr=(e,t)=>[...e.querySelectorAll(`[data-${t}]:not([data-${t}] [data-${t}])`)],yh={line:\"#00D672\",word:\"#FF4B4B\",char:\"#5A87FF\"},wa=e=>{if(!e.childElementCount&&!e.textContent.trim()){const t=e.parentElement;e.remove(),t&&wa(t)}},xa=(e,t,s)=>{const r=e.getAttribute(ar);if(r!==null&&+r!==t||e.tagName===\"BR\"){s.add(e);const n=e.previousSibling,o=e.nextSibling;n&&n.nodeType===3&&Yi.test(n.textContent)&&s.add(n),o&&o.nodeType===3&&Yi.test(o.textContent)&&s.add(o)}let i=e.childElementCount;for(;i--;)xa(e.children[i],t,s);return s},en=(e,t={})=>{let s=\"\";t||(t={});const r=Ze(t.class)?` class=\"${t.class}\"`:\"\",i=W(t.clone,!1),n=W(t.wrap,!1),o=n?n===!0?\"clip\":n:i?\"clip\":!1;if(n&&(s+=`<span${o?` style=\"overflow:${o};\"`:\"\"}>`),s+=`<span${r}${i?' style=\"position:relative;\"':\"\"} data-${e}=\"{i}\">`,i){const c=i===\"left\"?\"-100%\":i===\"right\"?\"100%\":\"0\",d=i===\"top\"?\"-100%\":i===\"bottom\"?\"100%\":\"0\";s+=\"<span>{value}</span>\",s+=`<span inert style=\"position:absolute;top:${d};left:${c};white-space:nowrap;\">{value}</span>`}else s+=\"{value}\";return s+=\"</span>\",n&&(s+=\"</span>\"),s},tn=(e,t,s,r,i,n,o,c,d)=>{const h=i===Zi,p=i===or,a=`_${i}_`,f=qe(e)?e(s):e,l=h?\"block\":\"inline-block\";Yr.innerHTML=f.replace(mh,`<i class=\"${a}\"></i>`).replace(vh,`${p?d:h?o:c}`);const g=Yr.content,m=g.firstElementChild,y=g.querySelector(`[data-${i}]`)||m,S=g.querySelectorAll(`i.${a}`),k=S.length;if(k){m.style.display=l,y.style.display=l,y.setAttribute(ar,`${o}`),h||(y.setAttribute(\"data-word\",`${c}`),p&&y.setAttribute(\"data-char\",`${d}`));let b=k;for(;b--;){const u=S[b],v=u.parentElement;v.style.display=l,h?v.innerHTML=s.innerHTML:v.replaceChild(s.cloneNode(!0),u)}t.push(y),r.appendChild(g)}else console.warn('The expression \"{value}\" is missing from the provided template.');return n&&(m.style.outline=`1px dotted ${yh[i]}`),m},Jr=class{constructor(e,t={}){Ji||(Ji=jr?new jr([],{granularity:nr}):{segment:l=>{const g=[],m=l.split(ji);for(let y=0,S=m.length;y<S;y++){const k=m[y];g.push({segment:k,isWordLike:!Yi.test(k)})}return g}}),Ki||(Ki=jr?new jr([],{granularity:\"grapheme\"}):{segment:l=>[...l].map(g=>({segment:g}))}),!Yr&&Nt&&(Yr=Z.createElement(\"template\")),We.current&&We.current.register(this);const{words:s,chars:r,lines:i,accessible:n,includeSpaces:o,debug:c}=t,d=(e=Qe(e)?e[0]:e)&&e.nodeType?e:(Oi(e)||[])[0],h=i===!0?{}:i,p=s===!0||F(s)?{}:s,a=r===!0?{}:r;this.debug=W(c,!1),this.includeSpaces=W(o,!1),this.accessible=W(n,!0),this.linesOnly=h&&!p&&!a,this.lineTemplate=Ye(h)?en(Zi,h):h,this.wordTemplate=Ye(p)||this.linesOnly?en(nr,p):p,this.charTemplate=Ye(a)?en(or,a):a,this.$target=d,this.html=d&&d.innerHTML,this.lines=[],this.words=[],this.chars=[],this.effects=[],this.effectsCleanups=[],this.cache=null,this.ready=!1,this.width=0,this.resizeTimeout=null;const f=()=>this.html&&(h||p||a)&&this.split();this.resizeObserver=new ResizeObserver(()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{const l=d.offsetWidth;l!==this.width&&(this.width=l,f())},150)}),this.lineTemplate&&!this.ready?Z.fonts.ready.then(f):f(),d?this.resizeObserver.observe(d):console.warn(\"No Text Splitter target found.\")}addEffect(e){if(!qe(e))return console.warn(\"Effect must return a function.\"),this;const t=Hr(e);return this.effects.push(t),this.ready&&(this.effectsCleanups[this.effects.length-1]=t(this)),this}revert(){return clearTimeout(this.resizeTimeout),this.lines.length=this.words.length=this.chars.length=0,this.resizeObserver.disconnect(),this.effectsCleanups.forEach(e=>qe(e)?e(this):e.revert&&e.revert()),this.$target.innerHTML=this.html,this}splitNode(e){const t=this.wordTemplate,s=this.charTemplate,r=this.includeSpaces,i=this.debug,n=e.nodeType;if(n===3){const o=e.nodeValue;if(o.trim()){const c=[],d=this.words,h=this.chars,p=Ji.segment(o),a=Z.createDocumentFragment();let f=null;for(const l of p){const g=l.segment,m=ka(l);if(!f||m&&f&&ka(f))c.push(g);else{const y=c.length-1,S=c[y];!ji.test(S)&&!ji.test(g)?c[y]+=g:c.push(g)}f=l}for(let l=0,g=c.length;l<g;l++){const m=c[l];if(m.trim()){const y=c[l+1],S=r&&y&&!y.trim(),k=m,b=s?Ki.segment(k):null,u=s?Z.createDocumentFragment():Z.createTextNode(S?m+\" \":m);if(s){const v=[...b];for(let _=0,w=v.length;_<w;_++){const T=v[_],R=_===w-1&&S?T.segment+\" \":T.segment,C=Z.createTextNode(R);tn(s,h,C,u,or,i,-1,d.length,h.length)}}t?tn(t,d,u,a,nr,i,-1,d.length,h.length):s?a.appendChild(u):a.appendChild(Z.createTextNode(m)),S&&l++}else{if(l&&r)continue;a.appendChild(Z.createTextNode(m))}}e.parentNode.replaceChild(a,e)}}else if(n===1){const o=[...e.childNodes];for(let c=0,d=o.length;c<d;c++)this.splitNode(o[c])}}split(e=!1){const t=this.$target,s=!!this.cache&&!e,r=this.lineTemplate,i=this.wordTemplate,n=this.charTemplate,o=Z.fonts.status!==\"loading\",c=r&&o;this.ready=!r||o,(c||e)&&this.effectsCleanups.forEach(a=>qe(a)&&a(this)),s||(e&&(t.innerHTML=this.html,this.words.length=this.chars.length=0),this.splitNode(t),this.cache=t.innerHTML),c&&(s&&(t.innerHTML=this.cache),this.lines.length=0,i&&(this.words=Zr(t,nr))),n&&(c||i)&&(this.chars=Zr(t,or));const d=this.words.length?this.words:this.chars;let h,p=0;for(let a=0,f=d.length;a<f;a++){const l=d[a],{top:g,height:m}=l.getBoundingClientRect();!F(h)&&g-h>m*.5&&p++,l.setAttribute(ar,`${p}`);const y=l.querySelectorAll(`[${ar}]`);let S=y.length;for(;S--;)y[S].setAttribute(ar,`${p}`);h=g}if(c){const a=Z.createDocumentFragment(),f=new Set,l=[];for(let g=0;g<p+1;g++){const m=t.cloneNode(!0);xa(m,g,new Set).forEach(y=>{const S=y.parentNode;S&&(y.nodeType===1&&f.add(S),S.removeChild(y))}),l.push(m)}f.forEach(wa);for(let g=0,m=l.length;g<m;g++)tn(r,this.lines,l[g],a,Zi,this.debug,g);t.innerHTML=\"\",t.appendChild(a),i&&(this.words=Zr(t,nr)),n&&(this.chars=Zr(t,or))}if(this.linesOnly){const a=this.words;let f=a.length;for(;f--;){const l=a[f];l.replaceWith(l.textContent)}a.length=0}if(this.accessible&&(c||!s)){const a=Z.createElement(\"span\");a.style.cssText=\"position:absolute;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;\",a.innerHTML=this.html,t.insertBefore(a,t.firstChild),this.lines.forEach(Qi),this.words.forEach(Qi),this.chars.forEach(Qi)}return this.width=t.offsetWidth,(c||e)&&this.effects.forEach((a,f)=>this.effectsCleanups[f]=a(this)),this}refresh(){this.split(!0)}},lr=(e,t)=>new Jr(e,t),Ta=(e,t)=>(console.warn(\"text.split() is deprecated, import splitText() directly, or text.splitText()\"),new Jr(e,t)),Ca=e=>{let t=\"\";for(let s=0,r=e.length;s<r;s++)if(s+2<r&&e[s+1]===\"-\"&&e.charCodeAt(s)<e.charCodeAt(s+2)){const i=e.charCodeAt(s),n=e.charCodeAt(s+2);for(let o=i;o<=n;o++)t+=String.fromCharCode(o);s+=2}else t+=e[s];return t},Aa={lowercase:\"a-z\",uppercase:\"A-Z\",numbers:\"0-9\",symbols:\"!%#_|*+=\",braille:\"⠀-⣿\",blocks:\"▀-▟\",shades:\"░-▓\"},sn=new WeakMap,Pa=(e={})=>{e||(e={});const t=e.chars,s=Ft(e.ease||\"linear\"),r=e.text,i=e.from,n=e.reversed||!1,o=e.perturbation||0,c=e.cursor,d=c===!0?\"_\":typeof c==\"number\"?String.fromCharCode(c):typeof c==\"string\"?c:\"\",h=d.length,p=e.seed||0,a=e.override!==void 0?e.override:!0,f=e.revealRate||60,l=1e3*U.timeScale/f,g=e.settleDuration||300*U.timeScale,m=e.settleRate||30,y=e.duration,S=e.revealDelay,k=e.delay,b=e.onChange||ie;return(u,v,_,w)=>{const T=typeof t==\"function\"?t(u,v,_):t||\"a-zA-Z0-9!%#_\",R=Ca(Aa[T]||T),C=R.length-1,P=typeof y==\"function\"?y(u,v,_):y,E=typeof S==\"function\"?S(u,v,_):S||0,N=typeof k==\"function\"?k(u,v,_):k||0,D=p?rr(p):rr();sn.has(u)||sn.set(u,u.textContent);const q=w?w._value:u.textContent,L=r!==void 0?typeof r==\"function\"?r(u,v,_):r:w?w._value:sn.get(u),B=L===\" \"||L===\" \"?\" \":L,M=q===\" \"?0:q.length,I=B.length,V=a===!0?R:typeof a==\"string\"&&a.length>0?Ca(Aa[a]||a):null,X=V?V.length-1:0,Y=a===\" \"?\" \":null,G=a===\"\"?I:Math.max(M,I),K=P>0?P:(G-1)*l+g,oe=z((K+E)/U.timeScale,0)*U.timeScale,ne=E>0?z(E/oe,12):0,we=i===void 0||i===\"auto\"?I<M?\"right\":\"left\":i,me=new Int32Array(G);if(we===\"random\"){for(let $=0;$<G;$++)me[$]=$;for(let $=G-1;$>0;$--){const ce=D(0,$),ee=me[$];me[$]=me[ce],me[ce]=ee}}else{const $=we===\"right\"?(a===\"\"||!M?G:M)-1:we===\"center\"?((a===\"\"||!M?G:M)-1)/2:typeof we==\"number\"?we:0,ce=Math.abs,ee=new Array(G);for(let he=0;he<G;he++)ee[he]=he;ee.sort((he,ze)=>ce(he-$)-ce(ze-$));for(let he=0;he<G;he++)me[ee[he]]=he}if(n){const $=G-1;for(let ce=0;ce<G;ce++)me[ce]=$-me[ce]}const ue=z(g/K,12),J=z((1-ue)/G,12),re=h*J,Me=z(1e3*U.timeScale/(m*oe),12),Re=new Float32Array(G),Ae=new Float32Array(G),$e=o>0?o*ue:0;for(let $=0;$<G;$++){const ce=$e>0?(D(0,2e3)-1e3)/1e3*$e:0,ee=$e>0?(D(0,2e3)-1e3)/1e3*$e:0;Re[$]=me[$]*J+ce,Ae[$]=Math.ceil((Re[$]+ue+ee)/Me)*Me}if(I<G&&we!==\"left\"&&we!==\"right\"&&we!==\"random\"){let $=0;for(let he=I;he<G;he++)Ae[he]>$&&($=Ae[he]);const ce=new Array(I);for(let he=0;he<I;he++)ce[he]=he;ce.sort((he,ze)=>me[he]-me[ze]);const ee=(1-$)/I;for(let he=0;he<I;he++){const ze=$+he*ee;ze>Ae[ce[he]]&&(Ae[ce[he]]=ze)}}const be=new Array(G);for(let $=0;$<G;$++)be[$]=R[D(0,C)];const ke=V?V===R?be:new Array(G):null;if(ke&&ke!==be)for(let $=0;$<G;$++)ke[$]=Y||V[D(0,V.length-1)];let Pe=q;if(!w){if(a===\"\")Pe=\"\";else if(V){Pe=\"\";for(let $=0;$<M;$++)Pe+=q[$]===\" \"?\" \":ke[$]}}let Ee=-1,ae=-1,le=\"\";const xe=a!==\"\",_e=!!V,Ie=h>0;return{from:0,to:1,duration:oe,delay:N,ease:\"linear\",modifier:$=>{if($===Ee)return le;if(Ee=$,N>0&&$<=0)return le=q,q;if($<=0)return le=Pe,Pe;if($>=1)return le=B,B;le=\"\";const ce=$/Me|0,ee=ce!==ae;ee&&(ae=ce);const he=ne>0?($-ne)/(1-ne):$,ze=he>0?s(he):0;for(let Oe=0;Oe<G;Oe++){const ve=Re[Oe];if(ze>=Ae[Oe]){Oe<I&&(le+=B[Oe]);continue}if(ze<=0||ze<ve){xe&&Oe<M&&(_e?q[Oe]===\" \"?le+=\" \":(ee&&(ke[Oe]=Y||V[D(0,X)]),le+=ke[Oe]):le+=q[Oe]);continue}Oe<I&&B[Oe]===\" \"||Oe<M&&q[Oe]===\" \"?le+=\" \":Ie&&ze-ve<re?le+=d[h-1-((ze-ve)/J|0)]:(ee&&(be[Oe]=R[D(0,C)]),le+=be[Oe])}return ee&&b(le,ze),le}}}},bh=_s({TextSplitter:()=>Jr,scrambleText:()=>Pa,split:()=>Ta,splitText:()=>lr}),_h=_s({$:()=>Kt,Animatable:()=>$i,AutoLayout:()=>ra,Draggable:()=>Do,JSAnimation:()=>Vt,Scope:()=>Bo,ScrollObserver:()=>qo,Spring:()=>Dr,TextSplitter:()=>Jr,Timeline:()=>Ro,Timer:()=>yt,WAAPIAnimation:()=>Yo,addChild:()=>It,animate:()=>Zs,clamp:()=>fa,cleanInlineStyles:()=>go,createAnimatable:()=>Ou,createDraggable:()=>Wu,createDrawable:()=>_a,createLayout:()=>ch,createMotionPath:()=>ba,createScope:()=>Gu,createSeededRandom:()=>rr,createSpring:()=>Mo,createTimeline:()=>Io,createTimer:()=>Pu,cubicBezier:()=>Vo,damp:()=>ma,degToRad:()=>ua,eases:()=>qt,easings:()=>Qu,engine:()=>it,forEachChildren:()=>Ce,get:()=>es,globals:()=>U,irregular:()=>Uo,keepTime:()=>Hr,lerp:()=>ga,linear:()=>Vi,mapRange:()=>ca,morphTo:()=>Sa,onScroll:()=>Ju,padEnd:()=>aa,padStart:()=>oa,radToDeg:()=>ha,random:()=>sr,randomPick:()=>va,remove:()=>No,removeChild:()=>Rt,round:()=>pa,roundPad:()=>na,scrambleText:()=>Pa,scrollContainers:()=>Fr,set:()=>zt,shuffle:()=>Wi,snap:()=>da,split:()=>Ta,splitText:()=>lr,spring:()=>Br,stagger:()=>ir,steps:()=>zo,svg:()=>gh,sync:()=>Fi,text:()=>bh,utils:()=>dh,waapi:()=>Zo,wrap:()=>la}),Sh=class{registerAnimation(e,t,s={}){this.animations[e]={handler:t,options:s}}isInitiallyHidden(e){return this.animations[e]?.options.initiallyHidden??!1}runAnimation(e,t,s,r,i){const n=this.animations[e];n?n.handler(t,s,r,i):(console.warn(`No animation registered with name: ${e}`),r())}addLinkAnimation(e,t){this.linkAnimations.set(e,t)}removeLinkAnimation(e){this.linkAnimations.delete(e)}runLinkAnimation(e){const t=this.linkAnimations.get(e);t&&t()}constructor(){this.animations={},this.linkAnimations=new Map,this.registerAnimation(\"typewriter\",function(e,t,s,r){const{chars:i}=lr(e,{words:!1,chars:!0}),n=t.fadeDuration||100,o=t.interval||100;Zs(i,{opacity:[0,1],easing:\"linear\",duration:n,delay:ir(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation(\"toast\",function(e,t,s,r){const{words:i}=lr(e,{words:!0,chars:!1}),n=t.fadeDuration||100,o=t.interval||200;Zs(i,{opacity:[0,1],y:[{to:[\"100%\",\"0%\"]}],easing:\"linear\",duration:n,delay:ir(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation(\"fadeIn\",function(e,t,s,r){const i=t.duration||500;Zs(e,{opacity:[0,1],easing:t.easing||\"easeOutQuad\",duration:i,delay:t.start||0,loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation(\"continue\",function(e,t,s){e.classList.add(\"squiffy-continue\");const r=t.style||\"pulse\";let i=null,n=null;r===\"wave\"?(e.classList.add(\"squiffy-continue-wave\"),n=lr(e,{words:!1,chars:!0}).chars,i=Zs(n,{opacity:[1,.3,1],easing:\"easeInOutSine\",duration:1200,delay:ir(80),loop:!0})):e.classList.add(`squiffy-continue-${r}`);const o=()=>{if(e.classList.remove(\"squiffy-continue\",\"squiffy-continue-wave\",`squiffy-continue-${r}`),e.removeEventListener(\"click\",o),i&&(i.pause(),n))for(const c of n)c.style.opacity=\"1\";s()};e.addEventListener(\"click\",o)})}},kh={animejs:_h},Ea=\"input:not([disabled]), textarea:not([disabled]), select:not([disabled])\",wh=\"a.squiffy-link[data-section], a.squiffy-link[data-passage]\";function La(e){if(!e)return!0;const t=e.querySelectorAll(Ea);for(const s of t)if(!s.checkValidity())return!1;return!0}function rn(e){if(!e)return;const t=La(e),s=e.querySelectorAll(wh);for(const r of s)t?(r.classList.remove(\"validation-disabled\"),r.removeAttribute(\"aria-disabled\")):(r.classList.add(\"validation-disabled\"),r.setAttribute(\"aria-disabled\",\"true\"))}function cr(e){if(!e)return;const t=e.querySelectorAll(Ea);for(const s of t)s.addEventListener(\"input\",()=>rn(e)),s.addEventListener(\"change\",()=>rn(e)),s.addEventListener(\"invalid\",r=>{r.preventDefault(),s.classList.add(\"squiffy-invalid\")}),s.addEventListener(\"input\",()=>{s.checkValidity()&&s.classList.remove(\"squiffy-invalid\")});rn(e)}var Ra=[\"src\",\"poster\"],xh=\"data-squiffy-asset-\",Th=[...Ra,\"srcset\",\"style\"].map(e=>`[${e}]`).join(\",\"),Ia=e=>/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith(\"//\")||e.startsWith(\"#\"),nn=(e,t)=>{const s=e.trim();if(!s||Ia(s))return e;let r=s;try{r=decodeURI(s)}catch{}return t(r)},Ch=(e,t)=>e.split(\",\").map(s=>{const r=s.match(/^(\\s*)(\\S+)(.*)$/s);return r?r[1]+nn(r[2],t)+r[3]:s}).join(\",\"),Ah=(e,t)=>e.replace(/url\\(\\s*(['\"]?)(.*?)\\1\\s*\\)/gi,(s,r,i)=>{const n=nn(i,t);return n===i?s:`url(\"${n.replace(/[\"\\\\\\n]/g,o=>\"\\\\\"+(o===`\n`?\"a \":o))}\")`}),Ph=(e,t,s)=>{const r=xh+t,i=e.getAttribute(r)??e.getAttribute(t);if(i===null)return;let n;t===\"srcset\"?n=Ch(i,s):t===\"style\"?n=Ah(i,s):n=nn(i,s),n===i?e.removeAttribute(r):e.setAttribute(r,i),e.setAttribute(t,n)},Eh=e=>t=>{if(!e||!/\\b(src|srcset|poster|style)\\s*=/i.test(t))return t;const s=document.createElement(\"template\");s.innerHTML=t;for(const r of s.content.querySelectorAll(Th))for(const i of[...Ra,\"srcset\",\"style\"])r.hasAttribute(i)&&Ph(r,i,e);return s.innerHTML},td=1,Ma=50,Lh=class{constructor(e){this.options=e,this.music=null,this.effects=new Set,this.preloaded=new Map,this.muted=!1,this.waitingForGesture=!1,this.disposed=!1,this.onGesture=()=>{this.removeGestureListeners();const t=this.music;t&&t.audio.paused&&(t.audio.volume=1,this.playTrack(t,0))},this.muted=this.readMuted()}preload(e){if(!(typeof Audio>\"u\"))for(const t of e){if(this.preloaded.has(t))continue;const s=new Audio;s.preload=\"auto\",s.src=this.options.resolveUrl(t),this.preloaded.set(t,s)}}sync(e=1){if(this.disposed)return;const t=this.options.getMusic()||null;t!==(this.music?.file??null)&&(this.stopMusic(e),t&&this.startMusic(t,e))}play(e,t=1){if(this.disposed||typeof Audio>\"u\")return;const s=this.newAudio(e);s.volume=Oa(t),this.effects.add(s);const r=()=>this.effects.delete(s);s.addEventListener(\"ended\",r),s.addEventListener(\"error\",r),this.options.onPlay?.(),s.play()?.catch(r)}stopSounds(){for(const e of this.effects)e.pause();this.effects.clear()}isMuted(){return this.muted}setMuted(e){this.muted=e,this.music&&(this.music.audio.muted=e);for(const t of this.effects)t.muted=e;this.writeMuted()}dispose(){this.disposed=!0,this.stopMusic(0),this.stopSounds(),this.removeGestureListeners()}newAudio(e){const t=new Audio(this.options.resolveUrl(e));return t.muted=this.muted,t}startMusic(e,t){if(typeof Audio>\"u\")return;const s=this.newAudio(e);s.loop=!0;const r={file:e,audio:s};this.music=r,this.options.onPlay?.(),s.volume=t>0?0:1,this.playTrack(r,t)}playTrack(e,t){const s=e.audio.play();t>0&&this.fade(e,1,t),s?.catch(r=>{e===this.music&&r?.name==\"NotAllowedError\"&&this.waitForGesture()})}stopMusic(e){const t=this.music;t&&(this.music=null,e>0&&!t.audio.paused?this.fade(t,0,e,()=>t.audio.pause()):(clearInterval(t.fadeTimer),t.audio.pause()))}fade(e,t,s,r){clearInterval(e.fadeTimer);const i=e.audio.volume,n=Math.max(1,Math.round(s*1e3/Ma));let o=0;e.fadeTimer=setInterval(()=>{o++,e.audio.volume=Oa(i+(t-i)*o/n),o>=n&&(clearInterval(e.fadeTimer),e.fadeTimer=void 0,r?.())},Ma)}waitForGesture(){this.waitingForGesture||typeof document>\"u\"||(this.waitingForGesture=!0,document.addEventListener(\"pointerdown\",this.onGesture,!0),document.addEventListener(\"keydown\",this.onGesture,!0))}removeGestureListeners(){this.waitingForGesture&&(this.waitingForGesture=!1,document.removeEventListener(\"pointerdown\",this.onGesture,!0),document.removeEventListener(\"keydown\",this.onGesture,!0))}readMuted(){if(!this.options.mutedKey)return!1;try{return localStorage.getItem(this.options.mutedKey)==\"true\"}catch{return!1}}writeMuted(){if(this.options.mutedKey)try{this.muted?localStorage.setItem(this.options.mutedKey,\"true\"):localStorage.removeItem(this.options.mutedKey)}catch{}}},Oa=e=>Math.min(1,Math.max(0,Number.isFinite(e)?e:1)),Rh=[\"bag\",\"person\",\"map\",\"help\",\"info\",\"list\",\"book\",\"star\",\"heart\"],Ih='<path d=\"M18 6 6 18M6 6l12 12\"/>',Mh={bag:'<path d=\"M4 10a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z\"/><path d=\"M8 10h8\"/><path d=\"M8 18h8\"/><path d=\"M8 22v-6a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v6\"/><path d=\"M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2\"/>',person:'<path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\"/><circle cx=\"12\" cy=\"7\" r=\"4\"/>',map:'<path d=\"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z\"/><path d=\"M15 5.764v15\"/><path d=\"M9 3.236v15\"/>',help:'<circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\"/><path d=\"M12 17h.01\"/>',info:'<circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"M12 16v-4\"/><path d=\"M12 8h.01\"/>',list:'<path d=\"M3 6h.01M3 12h.01M3 18h.01M8 6h13M8 12h13M8 18h13\"/>',book:'<path d=\"M12 7v14\"/><path d=\"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z\"/>',star:'<path d=\"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\"/>',heart:'<path d=\"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z\"/>'},Na=e=>`<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">${e}</svg>`,Oh=0;function Nh(e,t){const s=typeof t.strings?.close==\"string\"?t.strings.close:\"Close\",r=`squiffy-panel-${++Oh}`,i=[],n=document.createElement(\"dialog\");n.className=\"squiffy-panel-dialog\",n.setAttribute(\"aria-labelledby\",`${r}-heading`),n.innerHTML=`\n <div class=\"squiffy-panel-dialog-header\">\n <h2 id=\"${r}-heading\"></h2>\n <button type=\"button\" class=\"squiffy-panel-dialog-close\">${Na(Ih)}</button>\n </div>\n <div class=\"squiffy-panel squiffy-panel-dialog-content\"></div>`;const o=n.querySelector(\"h2\"),c=n.querySelector(\".squiffy-panel-dialog-close\");c.title=s,c.setAttribute(\"aria-label\",s),c.addEventListener(\"click\",()=>n.close());const d=n.querySelector(\".squiffy-panel-dialog-content\");n.addEventListener(\"click\",u=>{u.target===n&&n.close()}),(t.container??document.body).appendChild(n),i.push(()=>n.remove());let h=null;const p=t.panels.filter(u=>u&&typeof u.passage==\"string\"),a=t.side?p.filter(u=>u.position==\"side\"):[],f=new Map;let l=null;if(a.length&&t.side){l=document.createElement(\"aside\"),l.className=\"squiffy-panels-side\";for(const v of a){const _=document.createElement(\"section\");_.className=\"squiffy-panel\",_.dataset.passage=v.passage,_.setAttribute(\"aria-label\",v.label||v.passage),l.appendChild(_),f.set(v,_)}const u=t.side;u.appendChild(l),u.classList.add(\"squiffy-has-side\"),i.push(()=>{l.remove(),u.classList.remove(\"squiffy-has-side\")})}const g=t.buttons.firstChild;for(const u of p){const v=u.label||u.passage,_=document.createElement(\"button\");_.type=\"button\",_.className=\"squiffy-header-button squiffy-panel-button\",u.position==\"side\"&&f.has(u)&&_.classList.add(\"squiffy-panel-side-button\"),_.dataset.passage=u.passage,_.setAttribute(\"aria-haspopup\",\"dialog\");const w=u.icon&&Rh.includes(u.icon)?Mh[u.icon]:null;w?(_.innerHTML=Na(w),_.title=v,_.setAttribute(\"aria-label\",v)):(_.classList.add(\"squiffy-panel-text-button\"),_.textContent=v),_.addEventListener(\"click\",()=>m(u)),t.buttons.insertBefore(_,g),i.push(()=>_.remove())}function m(u){h=u,o.textContent=u.label||u.passage,d.innerHTML=e.renderPassage(u.passage),n.open||n.showModal()}function y(){for(const[u,v]of f)v.innerHTML=e.renderPassage(u.passage),v.hidden=!v.textContent?.trim()&&!v.querySelector(\"img, svg, video, canvas, iframe\");l&&(l.hidden=[...f.values()].every(u=>u.hidden)),n.open&&h&&(d.innerHTML=e.renderPassage(h.passage))}let S=!1;const k=()=>{S||(S=!0,queueMicrotask(()=>{S=!1,b||y()}))};for(const u of[\"set\",\"navigated\",\"storyUpdated\"])i.push(e.on(u,k));n.addEventListener(\"close\",()=>{h=null});let b=!1;return y(),{refresh:y,open(u){const v=p.find(_=>_.passage==u);v&&m(v)},dispose(){b=!0,n.open&&n.close();for(const u of i.splice(0))u()}}}var Dh=async e=>{let t,s,r,i,n,o=0,c=!1;const d=[],h=new Xc,p=[];let a=!1,f,l=0;const g=100;async function m(x){if(a||x.closest(\".squiffy-output-section\")!==r||x.classList.contains(\"disabled\")||!La(r))return!1;const A=x.getAttribute(\"data-passage\"),O=x.getAttribute(\"data-section\");if((A!==null||O!==null)&&(l=0,Le(\"turns\",(Q(\"turns\")||0)+1)),A!==null){let Ge;return S(A)||(k(x),Ge=u(x),Le(\"_turncount\",Q(\"_turncount\")+1)),await E(x),A&&(n=null,await G(A,Ge)),h.emit(\"linkClick\",{linkType:\"passage\"}),!0}if(O!==null)return await E(x),O&&await M(O),h.emit(\"linkClick\",{linkType:\"section\"}),!0;const[H,te,pe]=$a.handleLink(x);return H?(pe?.disableLink&&k(x),ne(),h.emit(\"linkClick\",{linkType:te}),!0):!1}async function y(x){const A=x.target;A.classList.contains(\"squiffy-link\")&&await m(A)}function S(x){if(!x)return!1;const A=s?.passages;if(A&&x in A)return!!A[x].repeat;const O=t.sections[\"\"]?.passages;return!!(O&&x in O&&O[x].repeat)}function k(x){x.classList.add(\"disabled\"),x.setAttribute(\"tabindex\",\"-1\")}function b(x){x.classList.remove(\"disabled\"),x.removeAttribute(\"tabindex\")}function u(x){let A=0;for(const H of ve.querySelectorAll(\"[data-clicked]\"))A=Math.max(A,Number(H.getAttribute(\"data-clicked\"))||0);const O=String(A+1);return x.setAttribute(\"data-clicked\",O),O}async function v(x){if(x&&x.section in t.sections){await M(x.section),x.passage!==void 0&&Q(\"_section\")==x.section&&await G(x.passage);return}if(!we()){await M(t.start);return}await _()}async function _(){const x=i??r,A=x?.getAttribute(\"data-goto\");A&&A in t.sections&&await P({section:A,after:Number(x.getAttribute(\"data-goto-after\")||0)})}function w(){clearTimeout(f),f=void 0,Ne.goto=null,Ne.deactivate.clear()}function T(x){const A=Ne.deactivate;if(A.size==0)return;const O=String((Q(\"_deactivations\")||0)+1);Le(\"_deactivations\",Number(O)),x.setAttribute(\"data-deactivates\",O);for(const H of r.querySelectorAll(\"a.squiffy-link[data-passage]\"))A.has(H.getAttribute(\"data-passage\"))&&!H.classList.contains(\"disabled\")&&(k(H),H.setAttribute(\"data-deactivated-by\",O));A.clear()}function R(x){const A=x.getAttribute(\"data-deactivates\");if(A)for(const O of r.querySelectorAll(`a.squiffy-link[data-deactivated-by=\"${A}\"]`))b(O),O.removeAttribute(\"data-deactivated-by\")}function C(x){const A=Ne.goto;return Ne.goto=null,A&&(x.setAttribute(\"data-goto\",A.section),A.after&&x.setAttribute(\"data-goto-after\",String(A.after))),A}async function P(x){if(x){if(x.after>0){f=setTimeout(()=>{f=void 0,l=0,M(x.section)},x.after);return}if(++l>g){l=0;const A=i??r;A.removeAttribute(\"data-goto\");const O=`stopped after ${g} in a row without the player clicking anything, going to \"${x.section}\". Is there a loop?`;console.error(\"Squiffy error in {{goto}}:\",O),A.insertAdjacentHTML(\"beforeend\",Yt(\"Error in {{goto}}:\",O)),ne();return}await M(x.section)}}async function E(x){ri.runLinkAnimation(x),await Y();const A=x.getAttribute(\"data-set\");if(A){const O=JSON.parse(A);for(const H of O)N(H)}}function N(x){try{t.expressions?L(x):B(x)}catch(A){const O=A instanceof Error?A.message:String(A);console.error(`Squiffy error in \"${x}\":`,O),d.push(Yt(`Error in \"${x}\":`,O))}}function D(x,A,O){const H=A+\"=\",te=St(H,O),pe=typeof x==\"string\"?[x]:x;let Ge=St(H,Te.getAt(pe));A==\"+\"&&(Ge+=te),A==\"-\"&&(Ge-=te),A==\"*\"&&(Ge*=te),A==\"/\"&&(Ge/=te),Te.setAt(pe,Ge)}function q(x){return[x.attribute,...x.segments.map(A=>{if(\"name\"in A)return A.name;const O=Ne.evaluate(A.index);if(typeof O!=\"string\"&&typeof O!=\"number\")throw new Error(`[${A.index.trim()}] should be a number or text, to say which value to set`);const H=String(O);return br(H),H})]}function L(x){const A=Xn(x),O=A&&/^\\s*:=(.*)$/.exec(A.rest);if(A&&O){Te.setAt(q(A),ae.processText(O[1],!0));return}const H=A&&/^\\s*([+\\-*/]?)=(?!=)(.*)$/.exec(A.rest);if(A&&H){const[,Ge,ys]=H,bs=q(A),ur=Ne.evaluate(ys);Ge?D(bs,Ge,ur):Te.setAt(bs,ur);return}const te=/^\\s*not\\s+/.exec(x),pe=Xn(te?x.substring(te[0].length):x);if(!pe||pe.rest.trim())throw new Error(\"expected an attribute name, e.g. gold = 10, gold += 5, has_key or not has_key\");Te.setAt(q(pe),!te)}function B(x){x=x.replace(/^(\\w*\\s*):=(.*)$/,(O,H,te)=>H+\"=\"+ae.processText(te,!0));const A=/^([\\w]*)\\s*=\\s*(.*)$/.exec(x);if(A){const O=A[1];let H=A[2];H===\"true\"?Le(O,!0):H===\"false\"?Le(O,!1):isNaN(H)?(H.startsWith(\"@\")&&(H=Q(H.substring(1))),Le(O,H)):Le(O,parseFloat(H))}else{const O=/^([\\w]*)\\s*([+\\-*/])=\\s*(.*)$/.exec(x);if(O){const H=O[1],te=O[2],pe=O[3].trim();D(H,te,pe.startsWith(\"@\")?Q(pe.substring(1)):pe)}else{let H=!0;x.startsWith(\"not \")&&(x=x.substring(4),H=!1),Le(x,H)}}}async function M(x){w();const A=ee();if(s=t.sections[x],!s)return;const O=Q(\"_section\");O!==null&&(Le(\"previous\",Q(\"_passage\")??O),Le(\"previous_section\",O)),Q(\"_passage\")!==null&&Le(\"_passage\",null),Le(\"_section\",x),Q(\"turns\")===null&&Te.setInternal(\"turns\",0,!1),Te.setSeen(x);const H=t.sections[\"\"];Da([...H?.classes??[],...s.classes??[]]),(H?.clear||s.clear)&&Pe(),$e(x);const te=r;if(H&&(await X(H,\"[[]]\"),Q(\"_section\")!==x)){te.remove();return}if(await X(s,`[[${x}]]`),Q(\"_section\")!==x){te.remove();return}cr(r),Le(\"_turncount\",0),T(r);const pe=C(r);Ns(),ne();const Ge=ee();Ge!=A&&h.emit(\"canGoBackChanged\",{canGoBack:Ge}),h.emit(\"navigated\",{section:x}),await P(pe)}let I=!1;function V(x,A=null,O){const H={get:Q,set:Le,ui:{transition:Ha,write:ae.write,scrollToEnd:ae.scrollToEnd,afterWrite:te=>{if(!O)throw new Error(\"squiffy.ui.afterWrite can only be used in a section or passage's JavaScript\");O.push(te)}},story:{go:te=>I?(Ne.goto??(Ne.goto={section:te,after:0}),Promise.resolve()):M(te),seen:te=>Te.getSeen(te),visits:te=>Te.getVisits(te)},element:Oe,import:kh,...A};t.js[x](H,Q,Le)}async function X(x,A){x.attributes&&await K(x.attributes),x.music!==void 0&&Le(\"_music\",x.music);for(const H of x.sounds??[])H==\"stop\"?et.stopSounds():et.play(H);const O=[];if(x.jsIndex!==void 0){const H=Q(\"_section\");if(V(x.jsIndex,null,O),Q(\"_section\")!==H)return}ae.write(x.text||\"\",A),I=!0;try{for(const H of O)H()}finally{I=!1}await Y()}async function Y(){a=!0,r.classList.add(\"links-disabled\");for(const x of p)await x();p.length=0,a=!1,r.classList.remove(\"links-disabled\")}async function G(x,A){w();const O=ee();let H=s.passages&&s.passages[x];const te=t.sections[\"\"];if(!H&&te&&te.passages&&(H=te.passages[x]),!H)throw`No passage named ${x} in the current section or master section`;Le(\"previous\",Q(\"_passage\")??Q(\"_section\")),Le(\"_passage\",x),Te.setSeen(x);const pe=[],Ge=[];if(te&&te.passages){const ft=te.passages[\"\"];ft&&(pe.push(ft),Ge.push(()=>X(ft,\"[[]][]\")))}const ys=s.passages&&s.passages[\"\"];ys&&(pe.push(ys),Ge.push(()=>X(ys,`[[${Q(\"_section\")}]][]`))),pe.push(H),Ge.push(()=>X(H,`[[${Q(\"_section\")}]][${x}]`));const bs=\"@\"+Q(\"_turncount\");if(s.passages&&!H.repeat){if(bs in s.passages){const ft=s.passages[bs];pe.push(ft),Ge.push(()=>X(ft,`[[${Q(\"_section\")}]][${bs}]`))}if(\"@last\"in s.passages&&Q(\"_turncount\")>=(s.passageCount||0)){const ft=s.passages[\"@last\"];pe.push(ft),Ge.push(()=>X(ft,`[[${Q(\"_section\")}]][${bs}]`))}}const ur=pe.flatMap(ft=>ft.classes??[]);ur.length&&Da([...ti(),...ur]),pe.some(ft=>ft.clear)&&(Pe(),be()),i=document.createElement(\"div\"),i.classList.add(\"squiffy-output-passage\"),i.setAttribute(\"data-passage\",`${x}`),A&&i.setAttribute(\"data-clicked-link\",A),r.appendChild(i);for(const ft of Ge)await ft();cr(r),T(i);const jh=C(i);Ns(),ne();const qa=ee();qa!=O&&h.emit(\"canGoBackChanged\",{canGoBack:qa}),h.emit(\"navigated\",{section:Q(\"_section\"),passage:x}),await P(jh)}async function K(x){for(const A of x)N(A)}function oe(){w(),Te.reset(),et.sync(),Bs(),nt.scroll===\"element\"||nt.scroll===\"none\"?(ve.innerHTML=\"\",v()):location.reload()}function ne(){Le(\"_output\",ve.innerHTML)}function we(){const x=()=>{t.uiJsIndex!==void 0&&V(t.uiJsIndex,{registerAnimation:ri.registerAnimation.bind(ri),registerHelper:Ne.handlebars.registerHelper.bind(Ne.handlebars),SafeString:Ne.handlebars.SafeString})};Te.load(),et.sync(),Bs();const A=Q(\"_output\");return A?(me(A),x(),ss.onLoad(),cr(r),!0):(x(),!1)}function me(x){ve.innerHTML=Mt(x),_e(),Ie(),n=ve.querySelector(\".squiffy-output-block:last-child\"),s=t.sections[Q(\"_section\")]}function ue(){return{format:\"squiffy-save\",version:1,storyId:t.projectId??null,section:Q(\"_section\"),passage:Q(\"_passage\"),summary:J(),savedAt:new Date().toISOString(),state:structuredClone(Te.store)}}function J(){const A=r?.querySelectorAll(\".squiffy-output-block\")??[];for(const O of A){const H=re(O);if(!H)continue;const te=[...O.querySelectorAll(\"h1, h2, h3, h4, h5, h6, p, li\")].find(ys=>re(ys));if(te&&/^H[1-6]$/.test(te.tagName)&&re(O).startsWith(re(te)))return re(te).substring(0,100);if(H.length<=100)return H;const pe=H.substring(0,100),Ge=pe.lastIndexOf(\" \");return(Ge>100/2?pe.substring(0,Ge):pe)+\"…\"}return\"\"}function re(x){const A=x.cloneNode(!0);return A.querySelectorAll(\"p, h1, h2, h3, h4, h5, h6, li, div, br, tr, blockquote\").forEach(O=>O.after(\" \")),(A.textContent??\"\").replace(/\\s+/g,\" \").trim()}function Me(x){if(!x||typeof x!=\"object\")return!1;const A=x;return A.format===\"squiffy-save\"&&A.version===1&&!!A.state&&typeof A.state==\"object\"&&!Array.isArray(A.state)&&typeof A.state._output==\"string\"}async function Re(x){if(!Me(x))return{success:!1,error:\"notASave\"};if(x.storyId&&t.projectId&&x.storyId!==t.projectId)return{success:!1,error:\"wrongStory\"};for(;a;)await new Promise(O=>setTimeout(O,50));w(),d.length=0,Te.reset();for(const[O,H]of Object.entries(x.state))Te.setInternal(O,H,!1);if(et.sync(),Bs(),ms={},o=0,c=!1,me(x.state._output),!s)return ve.innerHTML=\"\",await M(t.start),h.emit(\"canGoBackChanged\",{canGoBack:ee()}),{success:!0};ss.onLoad(),cr(r),h.emit(\"canGoBackChanged\",{canGoBack:ee()});const A=Q(\"_passage\");return h.emit(\"navigated\",A?{section:Q(\"_section\"),passage:A}:{section:Q(\"_section\")}),await _(),{success:!0}}function Ae(){n=document.createElement(\"div\"),n.classList.add(\"squiffy-output-block\"),(i||r)?.appendChild(n)}function $e(x){r&&(r.querySelectorAll(\"input, textarea, select\").forEach(A=>{const O=A,H=O.getAttribute(\"data-attribute\")||O.id;H&&Le(H,O.value),O.disabled||(O.disabled=!0,O.setAttribute(\"data-squiffy-disabled\",\"\"))}),r.querySelectorAll(\"[contenteditable]\").forEach(A=>{const O=A.getAttribute(\"data-attribute\")||A.id;O&&Le(O,A.innerHTML),A.getAttribute(\"contenteditable\")!==\"false\"&&(A.setAttribute(\"contenteditable\",\"false\"),A.setAttribute(\"data-squiffy-disabled\",\"\"))})),i=null,be(x),Ae()}function be(x){r=document.createElement(\"div\"),r.classList.add(\"squiffy-output-section\"),r.setAttribute(\"data-section\",x??Q(\"_section\")),x||r.setAttribute(\"data-clear\",\"true\"),ve.appendChild(r)}function ke(){return ve.querySelector(\".squiffy-clear-stack\")}function Pe(){let x=ke();x||(x=document.createElement(\"div\"),x.classList.add(\"squiffy-clear-stack\"),x.style.display=\"none\",ve.prepend(x));const A=document.createElement(\"div\");x.appendChild(A),c=!0;for(const O of[...ve.children])O!==x&&A.appendChild(O)}function Ee(){const x=ke();if(!x)return;for(const O of[...ve.children])O!==x&&O.remove();const A=x.children[x.children.length-1];for(const O of[...A.children])ve.appendChild(O);A.remove()}const ae={write:(x,A)=>{o=ve.scrollHeight;const O=d.splice(0).join(\"\")+ae.renderHtml(x,!1).trim();n||Ae();const H=document.createElement(\"div\");A&&H.setAttribute(\"data-source\",A),H.innerHTML=O,ss.onWrite(H),n.appendChild(H),cr(r),ae.scrollToEnd()},clearScreen:()=>{Pe(),be()},scrollToEnd:()=>{if(nt.scroll!==\"none\")if(c)if(c=!1,nt.scroll===\"element\")r.scrollIntoView({block:\"start\",inline:\"nearest\",behavior:\"smooth\"});else{const x=Math.max(document.body.scrollTop,document.documentElement.scrollTop),A=ve.getBoundingClientRect().top+x;A<x&&window.scrollTo({top:A,behavior:\"smooth\"})}else if(nt.scroll===\"element\")ve.lastElementChild?.scrollIntoView({block:\"end\",inline:\"nearest\",behavior:\"smooth\"});else{let x=o;const A=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(x>A){const O=document.documentElement.scrollHeight-window.innerHeight;x>O&&(x=O),window.scrollTo({top:x,behavior:\"smooth\"})}}},processText:(x,A)=>Ne.process(x,A),renderHtml:(x,A)=>Mt(ae.processText(x,A))};function le(x){if(x.start!=t.start){t=x,Te.reset(),et.sync(),Bs(),et.preload(t.audio??[]),ve.innerHTML=\"\",M(t.start);return}const A=t;t=x,et.preload(t.audio??[]),Yc(A,x,ve,(H,te)=>{const pe=s;s=te,Ut=!0;try{return ae.renderHtml(H,!1)}finally{s=pe,Ut=!1}},k,H=>K(H)),_e(),Ie(),h.emit(\"storyUpdated\",{})}function xe(x){const A=t.sections[\"\"]?.passages?.[x];if(!A)return Yt(\"Error in panel:\",`there is no passage called \"${x}\" in the master section [[]]`);const O=Ne.goto,H=[...Ne.deactivate];Te.readOnly=!0;let te;try{te=ae.renderHtml(A.text||\"\",!1)}finally{Te.readOnly=!1,Ne.goto=O,Ne.deactivate=new Set(H)}const pe=document.createElement(\"template\");return pe.innerHTML=te,pe.content.querySelectorAll(\"a.squiffy-link\").forEach(k),pe.innerHTML}function _e(){const x=ve.querySelectorAll(\".squiffy-output-section:last-child\");r=x[x.length-1];const A=r.getAttribute(\"data-section\");s=t.sections[A]}function Ie(){i=r.querySelector(\".squiffy-output-passage:last-child\")}function $(){const x=ke(),A=ve.querySelectorAll(\".squiffy-output-section\").length+ve.querySelectorAll(\".squiffy-output-passage\").length;return x?A+x.children.length:A}function ce(x){x.querySelectorAll(\"[data-squiffy-disabled]\").forEach(A=>{A.hasAttribute(\"contenteditable\")?A.setAttribute(\"contenteditable\",\"true\"):A.disabled=!1,A.removeAttribute(\"data-squiffy-disabled\")})}function ee(){const x=i??r,A=[...ve.querySelectorAll(\"[data-goto]\")].filter(O=>O!==x).length;return $()-A>1}function he(){if(a||!ee())return;w();do ze();while((i??r).hasAttribute(\"data-goto\")&&$()>1);et.sync(),Bs(),ne(),ee()||h.emit(\"canGoBackChanged\",{canGoBack:!1});const x=i?.getAttribute(\"data-passage\");h.emit(\"navigated\",x?{section:Q(\"_section\"),passage:x}:{section:Q(\"_section\")})}function ze(){const x=ke();if(i){const A=i.getAttribute(\"data-passage\"),O=i.getAttribute(\"data-clicked-link\");Ds(i.getAttribute(\"data-undo\")),R(i),i.remove();let H=!1,te=!1;for(const pe of ve.children)if(pe!==x){if(pe.getAttribute(\"data-clear\")==\"true\"&&pe.children.length==0){H=!0;continue}te=!0;break}if(H&&!te&&(Ee(),_e()),O)for(const pe of r.querySelectorAll(`a.squiffy-link[data-clicked=\"${O}\"]`))b(pe),pe.removeAttribute(\"data-clicked\");else if(A&&!S(A))for(const pe of r.querySelectorAll(\"a.squiffy-link[data-passage]\"))pe.getAttribute(\"data-passage\")==A&&b(pe);Ie()}else{Ds(r.getAttribute(\"data-undo\")),r.remove();let A=!1;for(const O of[...ve.children])if(O!==x){A=!0;break}A||Ee(),_e(),Ie(),ce(r)}}const Oe=e.element,ve=document.createElement(\"div\");Oe.appendChild(ve),t=e.story;const Mt=Eh(e.resolveAssetUrl),nt={scroll:e.scroll||\"body\",persist:e.persist===void 0?!0:e.persist,onSet:e.onSet||(()=>{})};let dt=\"\";nt.persist&&(e.storyId!==void 0?dt=e.storyId:window.location.protocol===\"file:\"?dt=t.id||\"\":dt=window.location.pathname,dt||(console.warn(\"Persist is set to true in Squiffy runtime options, but no storage key could be determined. Persist will be disabled.\"),nt.persist=!1)),nt.scroll===\"element\"&&(ve.style.overflowY=\"auto\"),ve.addEventListener(\"click\",y),ve.addEventListener(\"keypress\",async function(x){x.key===\"Enter\"&&await y(x)});let ms={};const ln=function(x,A){x!=\"_output\"&&(x in ms||(ms[x]=A))},Ns=function(){(i??r).setAttribute(\"data-undo\",JSON.stringify(ms)),ms={}},Ds=function(x){if(!x)return;const A=JSON.parse(x);if(A)for(const O of Object.keys(A))Te.setInternal(O,A[O],!1)},Te=new jc(nt.persist,dt,nt.onSet,h,ln),Q=Te.get.bind(Te),Le=Te.set.bind(Te),Ne=new Gc(()=>t,Te,()=>s);let ei=!1,Ut=!1,Wt=1;const et=new Lh({resolveUrl:x=>Ia(x)||!e.resolveAssetUrl?x:e.resolveAssetUrl(x.replace(/^(\\.\\/)+/,\"\")),getMusic:()=>Q(\"_music\"),mutedKey:nt.persist?\"squiffy-muted:\"+dt:void 0,onPlay:()=>{ei=!0,h.emit(\"sound\",{})}});et.preload(t.audio??[]),h.on(\"set\",({attribute:x})=>{if(x!=\"_music\")return;const A=Wt;Wt=1,et.sync(A)});const at=x=>{const A=Number(x?.hash?.fade);return x?.hash&&\"fade\"in x.hash&&Number.isFinite(A)&&A>=0?A:1},vs=x=>typeof x==\"object\"&&x!==null&&\"hash\"in x;Ne.handlebars.registerHelper(\"music\",(x,A)=>vs(x)?Q(\"music\"):(Te.readOnly||typeof x!=\"string\"||(Wt=at(A),Le(\"_music\",x||null),Wt=1),\"\")),Ne.handlebars.registerHelper(\"stopmusic\",x=>(Te.readOnly||(Wt=at(x),Le(\"_music\",null),Wt=1),\"\")),Ne.handlebars.registerHelper(\"sound\",(x,A)=>{if(vs(x))return Q(\"sound\");if(Te.readOnly||Ut||typeof x!=\"string\"||!x)return\"\";const O=Number(A?.hash?.volume??1);return et.play(x,O),\"\"}),Ne.handlebars.registerHelper(\"stopsounds\",()=>(!Te.readOnly&&!Ut&&et.stopSounds(),\"\"));const Se=\"_sectionclasses\",Ue=\"_classes\";let cn=[];const Gt=x=>{const A=Q(x);return Array.isArray(A)?A.filter(O=>typeof O==\"string\"&&O.length>0):[]},ti=()=>Gt(Se),si=x=>x.filter(A=>!vs(A)).flatMap(A=>String(A??\"\").split(/\\s+/)).filter(A=>A.length>0);function Da(x){const A=[...new Set(x)],O=ti();A.length==O.length&&A.every((H,te)=>H==O[te])||Le(Se,A)}function Ba(x){for(const A of cn)x.includes(A)||Oe.classList.remove(A);for(const A of x)Oe.classList.add(A);cn=x}function Bs(){Ba([...new Set([...ti(),...Gt(Ue)])])}h.on(\"set\",({attribute:x})=>{(x==Se||x==Ue)&&Bs()}),Ne.handlebars.registerHelper(\"addclass\",(...x)=>{if(Te.readOnly)return\"\";const A=Gt(Ue),O=si(x).filter(H=>!A.includes(H));return O.length&&Le(Ue,[...A,...O]),\"\"}),Ne.handlebars.registerHelper(\"removeclass\",(...x)=>{if(Te.readOnly)return\"\";const A=si(x),O=Gt(Ue);return O.some(H=>A.includes(H))&&Le(Ue,O.filter(H=>!A.includes(H))),\"\"}),Ne.handlebars.registerHelper(\"toggleclass\",(...x)=>{if(Te.readOnly)return\"\";let A=Gt(Ue);for(const O of new Set(si(x)))A=A.includes(O)?A.filter(H=>H!=O):[...A,O];return Le(Ue,A),\"\"}),Ne.handlebars.registerHelper(\"hasclass\",(...x)=>{const A=si(x),O=[...ti(),...Gt(Ue)];return A.length>0&&A.every(H=>O.includes(H))});const $a=new su,Gh=x=>x in t.sections&&t.sections[x].text||null,Xh=x=>s.passages&&x in s.passages?s.passages[x].text||null:\"passages\"in t.sections[\"\"]&&t.sections[\"\"].passages&&x in t.sections[\"\"].passages&&t.sections[\"\"].passages[x].text||null,Ha=x=>{p.push(x)},ri=new Sh,ss=new Zc(ve,Ne,Te,$a,Gh,Xh,ae.renderHtml,Ha,ri,h,Mt);return ss.add(Gs.ReplaceLabel()),ss.add(Gs.RotateSequencePlugin()),ss.add(Gs.RandomPlugin()),ss.add(Gs.LivePlugin()),ss.add(Gs.AnimatePlugin()),{begin:v,restart:oe,get:Q,set:Le,clickLink:m,update:le,goBack:he,canGoBack:ee,getSave:ue,loadSave:Re,renderPassage:xe,isMuted:()=>et.isMuted(),setMuted:x=>et.setMuted(x),usesSound:()=>ei||!!t.audio?.length,dispose:()=>{w(),et.dispose(),Ba([])},on:(x,A)=>h.on(x,A),off:(x,A)=>h.off(x,A),once:(x,A)=>h.once(x,A)}},Bh={png:\"image/png\",jpg:\"image/jpeg\",jpeg:\"image/jpeg\",gif:\"image/gif\",webp:\"image/webp\",avif:\"image/avif\",svg:\"image/svg+xml\",ico:\"image/x-icon\",bmp:\"image/bmp\",mp3:\"audio/mpeg\",ogg:\"audio/ogg\",oga:\"audio/ogg\",wav:\"audio/wav\",m4a:\"audio/mp4\",flac:\"audio/flac\",mp4:\"video/mp4\",webm:\"video/webm\",ogv:\"video/ogg\",woff:\"font/woff\",woff2:\"font/woff2\",ttf:\"font/ttf\",otf:\"font/otf\",pdf:\"application/pdf\",vtt:\"text/vtt\"},$h=e=>Bh[e.substring(e.lastIndexOf(\".\")+1).toLowerCase()]??\"\",Kr=e=>e.replace(/^(\\.\\/)+/,\"\"),Hh=/url\\(\\s*(?:\"((?:[^\"\\\\\\n]|\\\\.)*)\"|'((?:[^'\\\\\\n]|\\\\.)*)'|([^)\"'\\s]*))\\s*\\)/gi,qh=e=>e!=\"\"&&!/^(?:[a-z][a-z\\d+.-]*:|\\/|#)/i.test(e);async function Fh(e){const t=URL.createObjectURL(new Blob([e],{type:\"text/javascript\"}));try{return await import(t)}finally{URL.revokeObjectURL(t)}}function on(e){return e instanceof Error?{type:\"runtimeError\",message:e.message,...e.stack?{stack:e.stack}:{}}:{type:\"runtimeError\",message:String(e)}}function Vh(e){const t=e.loadModule??Fh;let s,r,i=\"\",n,o,c=!1,d=!1,h=0;const p=new Map,a=[];let f=[],l=[],g=[];const m=document.createElement(\"style\");document.head.appendChild(m);const y=C=>{try{e.send(C)}catch{C.type==\"attributeSet\"&&e.send({...C,value:String(C.value)})}};function S(){const C=m.textContent,P=N=>(m.textContent=`:root { color-scheme: ${N}; }`,getComputedStyle(document.documentElement).getPropertyValue(\"color-scheme\")),E=P(\"light\")==P(\"dark\");return m.textContent=C,E}const k=C=>p.get(Kr(C))??C;function b(C){for(const P of a.splice(0))URL.revokeObjectURL(P);p.clear();for(const[P,E]of Object.entries(C.urls??{}))p.set(Kr(P),E);for(const[P,E]of Object.entries(C.files??{})){const N=E instanceof Blob?E:new Blob([E],{type:$h(P)}),D=URL.createObjectURL(N);a.push(D),p.set(Kr(P),D)}f.forEach((P,E)=>{P.textContent=u(l[E])})}const u=C=>C.replace(Hh,(P,E,N,D)=>{const q=(E??N??D??\"\").trim(),L=qh(q)?p.get(Kr(q)):void 0;return L?`url(\"${L}\")`:P});function v(C){if(C.length==l.length&&C.every((N,D)=>l[D]==N))return!1;const P=f[0]??g[0]??null,E=C.map(N=>{const D=document.createElement(\"style\");return D.textContent=u(N),document.head.insertBefore(D,P),D});for(const N of f)N.remove();return f=E,l=[...C],!0}async function _(C){for(const P of[...f,...g])P.remove();f=[],l=[],g=[],v(C.css??[]);for(const P of C.scripts??[]){const E=document.createElement(\"script\"),N=URL.createObjectURL(new Blob([P],{type:\"text/javascript\"}));await new Promise(D=>{E.onload=E.onerror=()=>D(),E.src=N,document.head.appendChild(E)}),URL.revokeObjectURL(N),g.push(E)}}async function w(C){const P=++h;s?.dispose(),s=void 0,e.element.innerHTML=\"\",await _(C.story);const{story:E}=await t(C.story.js);if(P!=h)return;y({type:\"themeFixed\",fixed:S()}),r?.dispose(),r=void 0,i=\"\",n=document.createElement(\"div\"),n.className=\"squiffy-preview-header\",o=document.createElement(\"div\"),o.className=\"squiffy-preview-body\";const N=document.createElement(\"div\");N.className=\"squiffy-preview-story\",o.appendChild(N),e.element.append(n,o);const D=await Dh({element:N,story:E,persist:!1,scroll:\"element\",resolveAssetUrl:k,onSet:(q,L)=>{P==h&&!q.startsWith(\"_\")&&y({type:\"attributeSet\",name:q,value:L})}});D.on(\"canGoBackChanged\",q=>{P==h&&y({type:\"canGoBackChanged\",canGoBack:q.canGoBack})}),D.on(\"navigated\",q=>{P==h&&y({type:\"navigated\",...q})}),D.on(\"sound\",()=>{P==h&&!d&&(d=!0,y({type:\"usesSound\",usesSound:d}))}),D.setMuted(c),d=D.usesSound(),y({type:\"usesSound\",usesSound:d}),s=D,T(E.panels),y({type:\"canGoBackChanged\",canGoBack:!1}),await D.begin(C.startAt),P==h&&y({type:\"loaded\"})}function T(C){const P=JSON.stringify(C??[]);!s||!n||P==i||(i=P,r?.dispose(),r=C?.length?Nh(s,{panels:C,buttons:n,side:o}):void 0)}async function R(C){try{switch(C.type){case\"load\":await w(C);break;case\"update\":if(!s)break;C.css&&v(C.css)&&y({type:\"themeFixed\",fixed:S()});{const{story:P}=await t(C.js);s.update(P),T(P.panels)}break;case\"restart\":s?.restart();break;case\"back\":s?.goBack();break;case\"assets\":b(C.assets);break;case\"muted\":c=C.muted,s?.setMuted(c);break;case\"theme\":m.textContent=C.theme==\"system\"?\"\":`:root { color-scheme: ${C.theme}; }`}}catch(P){y(on(P))}}return{receive:R}}var zh=\"squiffy-preview\",Uh=e=>typeof e==\"object\"&&e!==null&&e.channel===\"squiffy-preview\"&&typeof e.type==\"string\",an=typeof acquireVsCodeApi==\"function\"?acquireVsCodeApi():void 0,Qr=e=>{const t={channel:zh,...e};an?an.postMessage(t):window.parent.postMessage(t,\"*\")},Wh=Vh({element:document.getElementById(\"squiffy\"),send:Qr});window.addEventListener(\"message\",e=>{!an&&e.source!==window.parent||Uh(e.data)&&Wh.receive(e.data)}),window.addEventListener(\"error\",e=>Qr(on(e.error??e.message))),window.addEventListener(\"unhandledrejection\",e=>Qr(on(e.reason))),Qr({type:\"ready\"})})();\n\n</script>\n</body>\n</html>\n";
|
|
2
|
+
export const previewHtml = "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>Squiffy preview</title>\n<style>\n/* Core Squiffy Runtime Styles. See https://squiffystory.com/styling/ for how to customise these. */\n\n/* Colours. Each has a light and a dark value, and light-dark() picks one from the page's\n color-scheme. This file doesn't set color-scheme itself, so a story embedded in a page stays\n light unless the page opts in to dark mode. The exported story's page (squiffy.page.css) sets\n \"color-scheme: light dark\", so it follows the reader's system setting. */\n:root\n{\n --squiffy-text: light-dark(#1f2328, #e4e4e7);\n --squiffy-background: light-dark(#ffffff, #18181b);\n /* Secondary text: the header buttons, and links waiting for valid input */\n --squiffy-muted: light-dark(#6b6f76, #9a9ca3);\n /* The lines between sections */\n --squiffy-border: light-dark(#e2e2e6, #34343a);\n --squiffy-link: light-dark(#1d5fd6, #7aa7ff);\n --squiffy-link-hover: light-dark(#0f3f99, #b0cbff);\n --squiffy-error: light-dark(#c62828, #ff7b72);\n --squiffy-success: light-dark(#2e7d32, #6cc070);\n}\n\n/* Link styles */\na.squiffy-link\n{\n color: var(--squiffy-link);\n text-decoration: underline;\n text-decoration-color: currentColor;\n text-decoration-thickness: from-font;\n text-underline-offset: 0.15em;\n cursor: pointer;\n transition: color 0.4s ease-in-out, text-decoration-color 0.4s ease-in-out;\n}\n\na.squiffy-link:hover\n{\n color: var(--squiffy-link-hover);\n}\n\na.squiffy-link:focus-visible,\nbutton.squiffy-header-button:focus-visible,\n.squiffy-continue:focus-visible\n{\n outline: 2px solid var(--squiffy-link);\n outline-offset: 2px;\n border-radius: 2px;\n}\n\n/* Rotate/sequence links - visually distinct as they update in-place rather than advancing the story */\na.squiffy-link[data-handler=\"rotate\"],\na.squiffy-link[data-handler=\"sequence\"] {\n text-decoration-style: dotted;\n}\n\n/* Disabled link states */\na.squiffy-link.disabled,\ndiv.squiffy-output-section:not(:last-child) a.squiffy-link,\ndiv.squiffy-output-section.links-disabled a.squiffy-link\n{\n text-decoration: inherit;\n text-decoration-color: transparent;\n color: inherit !important;\n cursor: inherit;\n pointer-events: none;\n}\n\n/* Links disabled due to input validation */\na.squiffy-link.validation-disabled\n{\n text-decoration: inherit;\n text-decoration-color: transparent;\n color: var(--squiffy-muted) !important;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n/* Invalid input field states */\ninput.squiffy-invalid,\ntextarea.squiffy-invalid,\nselect.squiffy-invalid\n{\n border-color: var(--squiffy-error) !important;\n box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--squiffy-error) 25%, transparent);\n}\n\n/* Valid input field states (optional, provides positive feedback) */\ninput:not([disabled]):valid,\ntextarea:not([disabled]):valid,\nselect:not([disabled]):valid\n{\n border-color: var(--squiffy-success);\n}\n\n/* Focus state for invalid inputs */\ninput.squiffy-invalid:focus,\ntextarea.squiffy-invalid:focus,\nselect.squiffy-invalid:focus\n{\n outline: none;\n border-color: var(--squiffy-error) !important;\n box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--squiffy-error) 50%, transparent);\n}\n\n/* Header button styles: the Back, Restart and light/dark buttons, which are icons */\nbutton.squiffy-header-button\n{\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--squiffy-muted);\n cursor: pointer;\n background: none;\n border: none;\n border-radius: 0.375em;\n padding: 0.375em;\n font: inherit;\n vertical-align: middle;\n transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;\n}\n\nbutton.squiffy-header-button:hover:not(:disabled)\n{\n color: var(--squiffy-text);\n background-color: color-mix(in srgb, currentColor 10%, transparent);\n}\n\nbutton.squiffy-header-button svg\n{\n width: 1.25em;\n height: 1.25em;\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n/* The light/dark button, when the story's CSS fixes the theme */\nbutton.squiffy-header-button[hidden]\n{\n display: none;\n}\n\n/* The Back button, when there's nothing to go back to */\nbutton.squiffy-header-button:disabled\n{\n cursor: default;\n opacity: 0.5;\n}\n\n/* Output block spacing */\ndiv.squiffy-output-block:not(:last-child),\ndiv.squiffy-output-passage:not(:last-child),\ndiv.squiffy-output-section:not(:last-child)\n{\n margin-bottom: 1em;\n border-bottom: 1px solid var(--squiffy-border);\n}\n\n/* ...but a block, passage or section that output no text (such as a passage that only does\n {{replace}}) gets no line, and nor does one followed only by those, so they don't add extra lines */\ndiv.squiffy-output-block:not(:has(> div:not(:empty))),\ndiv.squiffy-output-block:not(:has(~ div.squiffy-output-block > div:not(:empty), ~ div.squiffy-output-passage > div.squiffy-output-block > div:not(:empty))),\ndiv.squiffy-output-passage:not(:has(> div.squiffy-output-block > div:not(:empty))),\ndiv.squiffy-output-passage:not(:has(~ div.squiffy-output-block > div:not(:empty), ~ div.squiffy-output-passage > div.squiffy-output-block > div:not(:empty))),\ndiv.squiffy-output-section:not(:has(div.squiffy-output-block > div:not(:empty))),\ndiv.squiffy-output-section:not(:has(~ div.squiffy-output-section div.squiffy-output-block > div:not(:empty)))\n{\n margin-bottom: 0;\n border-bottom: none;\n}\n\n/* Fade animations */\n.fade-out {\n opacity: 0;\n transition: opacity 200ms;\n}\n\n.fade-in {\n opacity: 1;\n transition: opacity 200ms;\n}\n\n/* Continue animation - click to proceed */\n.squiffy-continue {\n color: var(--squiffy-link);\n text-decoration: underline;\n text-decoration-color: currentColor;\n text-decoration-thickness: from-font;\n text-underline-offset: 0.15em;\n cursor: pointer;\n}\n\n/* Style: pulse - fades in and out */\n.squiffy-continue-pulse {\n animation: squiffy-pulse 1.5s ease-in-out infinite;\n}\n\n@keyframes squiffy-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.4; }\n}\n\n/* Style: glow - pulsing glow effect */\n.squiffy-continue-glow {\n animation: squiffy-glow 1.5s ease-in-out infinite;\n}\n\n@keyframes squiffy-glow {\n 0%, 100% { text-shadow: 0 0 4px color-mix(in srgb, currentColor 50%, transparent); }\n 50% { text-shadow: 0 0 12px color-mix(in srgb, currentColor 80%, transparent), 0 0 20px color-mix(in srgb, currentColor 40%, transparent); }\n}\n\n/* Style: bounce - subtle vertical bounce */\n.squiffy-continue-bounce {\n display: inline-block;\n animation: squiffy-bounce 0.6s ease-in-out infinite;\n}\n\n@keyframes squiffy-bounce {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-4px); }\n}\n\n/* Style: wave - character spans need special handling for underline */\n.squiffy-continue-wave {\n text-decoration: none;\n border-bottom: 1px solid currentColor;\n}\n\n/* Text effects for {{#style}} (#453), e.g. {{#style \"shudder\"}}...{{/style}} */\nspan.squiffy-style:is(.shake, .shudder, .rumble, .sway, .buoy, .mirror, .upside-down) {\n /* Transforms don't apply to inline elements */\n display: inline-block;\n}\n\n.squiffy-style.shake {\n animation: squiffy-shake 0.4s ease-in-out infinite;\n}\n\n@keyframes squiffy-shake {\n 0%, 100% { transform: translateX(0); }\n 25% { transform: translateX(-3px); }\n 75% { transform: translateX(3px); }\n}\n\n.squiffy-style.shudder {\n animation: squiffy-shudder 0.1s linear infinite alternate;\n}\n\n@keyframes squiffy-shudder {\n from { transform: translateX(-1px); }\n to { transform: translateX(1px); }\n}\n\n.squiffy-style.rumble {\n animation: squiffy-rumble 0.1s linear infinite alternate;\n}\n\n@keyframes squiffy-rumble {\n from { transform: translateY(-1px); }\n to { transform: translateY(1px); }\n}\n\n.squiffy-style.sway {\n animation: squiffy-sway 2.5s ease-in-out infinite;\n}\n\n@keyframes squiffy-sway {\n 0%, 100% { transform: rotate(-3deg); }\n 50% { transform: rotate(3deg); }\n}\n\n.squiffy-style.buoy {\n animation: squiffy-buoy 2.5s ease-in-out infinite;\n}\n\n@keyframes squiffy-buoy {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-0.25em); }\n}\n\n.squiffy-style.pulse {\n animation: squiffy-pulse 1.5s ease-in-out infinite;\n}\n\n.squiffy-style.fade-in-out {\n animation: squiffy-fade-in-out 3s ease-in-out infinite;\n}\n\n@keyframes squiffy-fade-in-out {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0; }\n}\n\n.squiffy-style.blink {\n animation: squiffy-blink 1s step-end infinite;\n}\n\n@keyframes squiffy-blink {\n 50% { opacity: 0; }\n}\n\n.squiffy-style.flicker {\n animation: squiffy-flicker 3s linear infinite;\n}\n\n@keyframes squiffy-flicker {\n 0%, 19%, 21%, 23%, 54%, 56%, 100% { opacity: 1; }\n 20%, 22%, 55% { opacity: 0.2; }\n}\n\n.squiffy-style.blur {\n filter: blur(1px);\n}\n\n.squiffy-style.blurrier {\n filter: blur(3px);\n}\n\n.squiffy-style.smear {\n text-shadow: 0.15em 0 0.1em color-mix(in srgb, currentColor 50%, transparent), 0.3em 0 0.15em color-mix(in srgb, currentColor 25%, transparent);\n}\n\n.squiffy-style.mirror {\n transform: scaleX(-1);\n}\n\n.squiffy-style.upside-down {\n transform: scaleY(-1);\n}\n\n/* Transitions for how a section or passage appears (#489), from @transition. The element has\n squiffy-transition and the transition's name as classes while it plays, and @transition's\n time in --squiffy-transition-time. @leave plays them backwards, with squiffy-leave too, except\n the slides, which leave the way they're named. A story's stylesheet can add its own, e.g.\n .squiffy-transition.swirl { animation-name: swirl; } */\n.squiffy-transition {\n animation-duration: var(--squiffy-transition-time, 0.5s);\n animation-timing-function: ease-out;\n animation-fill-mode: both;\n}\n\n.squiffy-transition:is(.fade, .dissolve) {\n animation-name: squiffy-transition-fade;\n}\n\n@keyframes squiffy-transition-fade {\n from { opacity: 0; }\n}\n\n/* The slides move by --squiffy-slide-distance, e.g. 100% to slide all the way off and on */\n@keyframes squiffy-transition-from-below {\n from { opacity: 0; transform: translateY(var(--squiffy-slide-distance, 2em)); }\n}\n\n@keyframes squiffy-transition-from-above {\n from { opacity: 0; transform: translateY(calc(-1 * var(--squiffy-slide-distance, 2em))); }\n}\n\n@keyframes squiffy-transition-from-right {\n from { opacity: 0; transform: translateX(var(--squiffy-slide-distance, 3em)); }\n}\n\n@keyframes squiffy-transition-from-left {\n from { opacity: 0; transform: translateX(calc(-1 * var(--squiffy-slide-distance, 3em))); }\n}\n\n/* A slide moves the way it's named: slide-left comes in from the right, and leaves to the left */\n.squiffy-transition.slide-up {\n animation-name: squiffy-transition-from-below;\n}\n\n.squiffy-transition.slide-down {\n animation-name: squiffy-transition-from-above;\n}\n\n.squiffy-transition.slide-left {\n animation-name: squiffy-transition-from-right;\n}\n\n.squiffy-transition.slide-right {\n animation-name: squiffy-transition-from-left;\n}\n\n/* @leave plays the animations backwards, as the old text goes before the screen is cleared. So\n that a slide leaves the way it's named, it plays the opposite slide backwards. */\n.squiffy-transition.squiffy-leave {\n animation-direction: reverse;\n}\n\n.squiffy-transition.squiffy-leave.slide-up {\n animation-name: squiffy-transition-from-above;\n}\n\n.squiffy-transition.squiffy-leave.slide-down {\n animation-name: squiffy-transition-from-below;\n}\n\n.squiffy-transition.squiffy-leave.slide-left {\n animation-name: squiffy-transition-from-left;\n}\n\n.squiffy-transition.squiffy-leave.slide-right {\n animation-name: squiffy-transition-from-right;\n}\n\n/* So a transition, a story's own too, doesn't make the page scroll sideways, or a slide make it\n longer */\n:has(> .squiffy-transition) {\n overflow-x: clip;\n}\n\n:has(> .squiffy-transition:is(.slide-up, .slide-down)) {\n overflow-y: clip;\n}\n\n.squiffy-transition.zoom {\n animation-name: squiffy-transition-zoom;\n}\n\n@keyframes squiffy-transition-zoom {\n from { opacity: 0; transform: scale(0.9); }\n}\n\n.squiffy-transition.blur {\n animation-name: squiffy-transition-blur;\n}\n\n@keyframes squiffy-transition-blur {\n from { opacity: 0; filter: blur(8px); }\n}\n\n.squiffy-transition.pulse {\n animation-name: squiffy-transition-pulse;\n}\n\n@keyframes squiffy-transition-pulse {\n from { opacity: 0; transform: scale(0.95); }\n 60% { opacity: 1; transform: scale(1.02); }\n}\n\n.squiffy-transition.rumble {\n animation-name: squiffy-transition-rumble;\n}\n\n@keyframes squiffy-transition-rumble {\n from { opacity: 0; }\n 10%, 30%, 50%, 70% { transform: translateY(-2px); }\n 20%, 40%, 60%, 80% { transform: translateY(2px); }\n 50% { opacity: 1; }\n}\n\n.squiffy-transition.shudder {\n animation-name: squiffy-transition-shudder;\n}\n\n@keyframes squiffy-transition-shudder {\n from { opacity: 0; }\n 10%, 30%, 50%, 70% { transform: translateX(-2px); }\n 20%, 40%, 60%, 80% { transform: translateX(2px); }\n 50% { opacity: 1; }\n}\n\n.squiffy-transition.flicker {\n animation-name: squiffy-transition-flicker;\n}\n\n@keyframes squiffy-transition-flicker {\n from, 15%, 35%, 55% { opacity: 0; }\n 10%, 25%, 45% { opacity: 0.6; }\n}\n\n/* Respect the reader's reduced-motion setting */\n@media (prefers-reduced-motion: reduce)\n{\n /* Every transition, a story's own too, is a plain fade */\n .squiffy-transition {\n animation-name: squiffy-transition-fade !important;\n }\n\n .squiffy-continue-pulse,\n .squiffy-continue-glow,\n .squiffy-continue-bounce,\n .squiffy-style:is(.shake, .shudder, .rumble, .sway, .buoy, .pulse, .fade-in-out, .blink, .flicker)\n {\n animation: none;\n }\n}\n\n/* The Saved games dialog, opened by the page's Save button */\ndialog.squiffy-saves\n{\n width: min(28rem, calc(100vw - 2rem));\n max-height: calc(100vh - 2rem);\n box-sizing: border-box;\n padding: 1rem 1.25rem 1.25rem;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.75rem;\n background-color: var(--squiffy-background);\n color: var(--squiffy-text);\n font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n font-size: 0.9375rem;\n line-height: 1.4;\n box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);\n}\n\ndialog.squiffy-saves::backdrop\n{\n background-color: rgb(0 0 0 / 0.4);\n}\n\ndialog.squiffy-saves svg\n{\n width: 1.25em;\n height: 1.25em;\n flex: none;\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.squiffy-saves-header\n{\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.75rem;\n}\n\n.squiffy-saves-header h2\n{\n margin: 0;\n font-size: 1.125rem;\n}\n\n.squiffy-saves button\n{\n font: inherit;\n color: inherit;\n cursor: pointer;\n}\n\n.squiffy-saves button:focus-visible,\n.squiffy-saves input:focus-visible\n{\n outline: 2px solid var(--squiffy-link);\n outline-offset: 2px;\n}\n\n.squiffy-saves-button\n{\n flex: none;\n padding: 0.3em 0.8em;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.375em;\n background: none;\n}\n\n.squiffy-saves-button:hover\n{\n background-color: color-mix(in srgb, currentColor 8%, transparent);\n}\n\n.squiffy-saves .squiffy-saves-primary\n{\n border-color: var(--squiffy-link);\n background-color: var(--squiffy-link);\n color: var(--squiffy-background);\n}\n\n.squiffy-saves .squiffy-saves-danger-button\n{\n border-color: var(--squiffy-error);\n background-color: var(--squiffy-error);\n color: var(--squiffy-background);\n}\n\n.squiffy-saves-icon-button\n{\n display: inline-flex;\n padding: 0.3em;\n border: none;\n border-radius: 0.375em;\n background: none;\n color: var(--squiffy-muted) !important;\n}\n\n.squiffy-saves-icon-button:hover,\n.squiffy-saves-icon-button[aria-expanded=\"true\"]\n{\n color: var(--squiffy-text) !important;\n background-color: color-mix(in srgb, currentColor 10%, transparent);\n}\n\n.squiffy-saves-error\n{\n margin: 0 0 0.75rem;\n color: var(--squiffy-error);\n}\n\n.squiffy-saves-new\n{\n display: flex;\n gap: 0.5rem;\n}\n\n.squiffy-saves input[type=\"text\"]\n{\n flex: 1;\n min-width: 0;\n padding: 0.3em 0.6em;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.375em;\n background-color: var(--squiffy-background);\n color: inherit;\n font: inherit;\n}\n\n.squiffy-saves-list\n{\n list-style: none;\n margin: 0.75rem 0 0;\n padding: 0;\n max-height: 50vh;\n overflow-y: auto;\n}\n\n.squiffy-saves-empty\n{\n padding: 0.75rem 0;\n color: var(--squiffy-muted);\n}\n\n.squiffy-saves-row\n{\n padding: 0.5rem 0;\n border-top: 1px solid var(--squiffy-border);\n}\n\n.squiffy-saves-line\n{\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.squiffy-saves-info\n{\n flex: 1;\n min-width: 0;\n}\n\n.squiffy-saves-title\n{\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.squiffy-saves-meta\n{\n color: var(--squiffy-muted);\n font-size: 0.8125rem;\n}\n\n.squiffy-saves-options\n{\n position: relative;\n}\n\n.squiffy-saves-menu\n{\n position: absolute;\n right: 0;\n top: 100%;\n z-index: 1;\n display: flex;\n flex-direction: column;\n min-width: 10rem;\n margin-top: 0.25rem;\n padding: 0.25rem;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.5rem;\n background-color: var(--squiffy-background);\n box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.2);\n}\n\n.squiffy-saves-menu[hidden]\n{\n display: none;\n}\n\n/* In the top layer, placed by the script */\n.squiffy-saves-menu:popover-open\n{\n position: fixed;\n right: auto;\n bottom: auto;\n margin: 0;\n color: inherit;\n}\n\n.squiffy-saves-menu button\n{\n padding: 0.4em 0.75em;\n border: none;\n border-radius: 0.25em;\n background: none;\n text-align: left;\n}\n\n.squiffy-saves-menu button:hover,\n.squiffy-saves-menu button:focus-visible\n{\n background-color: color-mix(in srgb, currentColor 10%, transparent);\n}\n\n.squiffy-saves .squiffy-saves-danger\n{\n color: var(--squiffy-error);\n}\n\n.squiffy-saves-confirm\n{\n margin-top: 0.5rem;\n padding: 0.75rem;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.5rem;\n background-color: color-mix(in srgb, var(--squiffy-text) 5%, transparent);\n}\n\n.squiffy-saves-confirm p\n{\n margin: 0 0 0.5rem;\n}\n\n.squiffy-saves-confirm-buttons\n{\n display: flex;\n justify-content: flex-end;\n gap: 0.5rem;\n}\n\n.squiffy-saves-footer\n{\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem 1.25rem;\n margin-top: 0.75rem;\n padding-top: 0.75rem;\n border-top: 1px solid var(--squiffy-border);\n}\n\n.squiffy-saves-link\n{\n display: inline-flex;\n align-items: center;\n gap: 0.375em;\n padding: 0;\n border: none;\n background: none;\n color: var(--squiffy-link) !important;\n}\n\n.squiffy-saves-link:hover\n{\n text-decoration: underline;\n}\n\n/* A question for the player, such as whether to restart, in place of the browser's confirm() */\ndialog.squiffy-confirm\n{\n width: min(24rem, calc(100vw - 2rem));\n box-sizing: border-box;\n padding: 1.25rem;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.75rem;\n background-color: var(--squiffy-background);\n color: var(--squiffy-text);\n font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n font-size: 0.9375rem;\n line-height: 1.4;\n box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);\n}\n\ndialog.squiffy-confirm::backdrop\n{\n background-color: rgb(0 0 0 / 0.4);\n}\n\n.squiffy-confirm p\n{\n margin: 0 0 1rem;\n}\n\n.squiffy-confirm-buttons\n{\n display: flex;\n justify-content: flex-end;\n gap: 0.5rem;\n}\n\n.squiffy-confirm-button\n{\n padding: 0.3em 0.8em;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.375em;\n background: none;\n font: inherit;\n color: inherit;\n cursor: pointer;\n}\n\n.squiffy-confirm-button:hover\n{\n background-color: color-mix(in srgb, currentColor 8%, transparent);\n}\n\n.squiffy-confirm-button:focus-visible\n{\n outline: 2px solid var(--squiffy-link);\n outline-offset: 2px;\n}\n\n.squiffy-confirm .squiffy-confirm-primary\n{\n border-color: var(--squiffy-link);\n background-color: var(--squiffy-link);\n color: var(--squiffy-background);\n}\n\n.squiffy-confirm .squiffy-confirm-danger\n{\n border-color: var(--squiffy-error);\n background-color: var(--squiffy-error);\n color: var(--squiffy-background);\n}\n\n.squiffy-confirm .squiffy-confirm-primary:hover,\n.squiffy-confirm .squiffy-confirm-danger:hover\n{\n filter: brightness(1.1);\n}\n\n/* The Settings dialog (#452), for a story with \"settings\" in its squiffy.json */\ndialog.squiffy-settings\n{\n width: min(28rem, calc(100vw - 2rem));\n max-height: calc(100vh - 2rem);\n box-sizing: border-box;\n padding: 1rem 1.25rem 1.25rem;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.75rem;\n background-color: var(--squiffy-background);\n color: var(--squiffy-text);\n font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n font-size: 0.9375rem;\n line-height: 1.4;\n box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);\n}\n\ndialog.squiffy-settings::backdrop\n{\n background-color: rgb(0 0 0 / 0.4);\n}\n\n.squiffy-settings-header\n{\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n}\n\n.squiffy-settings-header h2\n{\n margin: 0;\n font-size: 1.125rem;\n}\n\n.squiffy-settings button,\n.squiffy-settings select\n{\n font: inherit;\n color: inherit;\n cursor: pointer;\n}\n\n.squiffy-settings button:focus-visible,\n.squiffy-settings input:focus-visible,\n.squiffy-settings select:focus-visible\n{\n outline: 2px solid var(--squiffy-link);\n outline-offset: 2px;\n}\n\nbutton.squiffy-settings-close\n{\n display: inline-flex;\n padding: 0.25em;\n border: none;\n border-radius: 0.375em;\n background: none;\n color: var(--squiffy-muted);\n}\n\nbutton.squiffy-settings-close:hover\n{\n color: var(--squiffy-text);\n background-color: color-mix(in srgb, currentColor 10%, transparent);\n}\n\nbutton.squiffy-settings-close svg\n{\n width: 1.25em;\n height: 1.25em;\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.squiffy-setting\n{\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.75rem 0;\n border-bottom: 1px solid var(--squiffy-border);\n}\n\n.squiffy-setting-text\n{\n min-width: 0;\n}\n\n.squiffy-setting-text label\n{\n display: block;\n}\n\n.squiffy-setting-text p\n{\n margin: 0.125rem 0 0;\n color: var(--squiffy-muted);\n font-size: 0.875em;\n}\n\n.squiffy-setting select\n{\n flex: none;\n max-width: 50%;\n padding: 0.25em 0.5em;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.375em;\n background-color: var(--squiffy-background);\n}\n\n/* A toggle is a switch */\n.squiffy-setting input[type=checkbox]\n{\n appearance: none;\n flex: none;\n position: relative;\n width: 2.5em;\n height: 1.5em;\n margin: 0;\n border-radius: 0.75em;\n background-color: color-mix(in srgb, var(--squiffy-text) 25%, transparent);\n cursor: pointer;\n transition: background-color 0.15s;\n}\n\n.squiffy-setting input[type=checkbox]::before\n{\n content: \"\";\n position: absolute;\n top: 0.1875em;\n left: 0.1875em;\n width: 1.125em;\n height: 1.125em;\n border-radius: 50%;\n background-color: var(--squiffy-background);\n transition: transform 0.15s;\n}\n\n.squiffy-setting input[type=checkbox]:checked\n{\n background-color: var(--squiffy-link);\n}\n\n.squiffy-setting input[type=checkbox]:checked::before\n{\n transform: translateX(1em);\n}\n\n.squiffy-setting-slider\n{\n display: flex;\n flex: none;\n align-items: center;\n gap: 0.5rem;\n width: 45%;\n}\n\n.squiffy-setting-slider input\n{\n flex: 1;\n min-width: 0;\n accent-color: var(--squiffy-link);\n}\n\n.squiffy-setting-slider output\n{\n min-width: 2ch;\n text-align: end;\n font-variant-numeric: tabular-nums;\n}\n\n.squiffy-settings-footer\n{\n display: flex;\n justify-content: flex-end;\n margin-top: 1rem;\n}\n\nbutton.squiffy-settings-reset\n{\n padding: 0.3em 0.8em;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.375em;\n background: none;\n}\n\nbutton.squiffy-settings-reset:hover\n{\n background-color: color-mix(in srgb, currentColor 8%, transparent);\n}\n\n@media (prefers-reduced-motion: reduce)\n{\n .squiffy-setting input[type=checkbox],\n .squiffy-setting input[type=checkbox]::before\n {\n transition: none;\n }\n}\n\n/* Panels (squiffy.json's \"panels\"): passages always to hand, beside the story or in a dialog */\n:root\n{\n /* The width of a side panel */\n --squiffy-side-width: 16rem;\n}\n\n/* A panel's button in the header, when it has a label rather than an icon */\nbutton.squiffy-panel-text-button\n{\n padding: 0.375em 0.625em;\n line-height: 1.25;\n}\n\n/* Space between the panels' buttons and the page's own */\nbutton.squiffy-panel-button:not(:has(+ button.squiffy-panel-button))\n{\n margin-right: 0.5em;\n}\n\n/* The side panels. Like the header, they're smaller than the story text. */\naside.squiffy-panels-side\n{\n font-size: 0.9375rem;\n line-height: 1.5;\n}\n\naside.squiffy-panels-side[hidden],\naside.squiffy-panels-side > section.squiffy-panel[hidden]\n{\n display: none;\n}\n\naside.squiffy-panels-side > section.squiffy-panel + section.squiffy-panel\n{\n margin-top: 1rem;\n padding-top: 1rem;\n border-top: 1px solid var(--squiffy-border);\n}\n\n.squiffy-panel > :first-child\n{\n margin-top: 0;\n}\n\n.squiffy-panel > :last-child\n{\n margin-bottom: 0;\n}\n\n.squiffy-panel img\n{\n max-width: 100%;\n height: auto;\n}\n\n/* On a screen too narrow for the story and a side panel, the panel is a button in the header,\n which shows it in a dialog */\n@media (min-width: 64rem)\n{\n button.squiffy-panel-side-button\n {\n display: none;\n }\n}\n\n@media (max-width: 63.99rem)\n{\n aside.squiffy-panels-side\n {\n display: none;\n }\n}\n\n/* The dialog a panel's button opens */\ndialog.squiffy-panel-dialog\n{\n width: min(28rem, calc(100vw - 2rem));\n max-height: calc(100vh - 2rem);\n box-sizing: border-box;\n padding: 1rem 1.25rem 1.25rem;\n border: 1px solid var(--squiffy-border);\n border-radius: 0.75rem;\n background-color: var(--squiffy-background);\n color: var(--squiffy-text);\n font-family: var(--squiffy-font-family, inherit);\n font-size: var(--squiffy-font-size, 1rem);\n line-height: var(--squiffy-line-height, 1.5);\n box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);\n}\n\ndialog.squiffy-panel-dialog::backdrop\n{\n background-color: rgb(0 0 0 / 0.4);\n}\n\n.squiffy-panel-dialog-header\n{\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n margin-bottom: 0.75rem;\n font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n}\n\n.squiffy-panel-dialog-header h2\n{\n margin: 0;\n font-size: 1.125rem;\n}\n\nbutton.squiffy-panel-dialog-close\n{\n display: inline-flex;\n padding: 0.25em;\n border: none;\n border-radius: 0.375em;\n background: none;\n color: var(--squiffy-muted);\n cursor: pointer;\n}\n\nbutton.squiffy-panel-dialog-close:hover\n{\n color: var(--squiffy-text);\n background-color: color-mix(in srgb, currentColor 10%, transparent);\n}\n\nbutton.squiffy-panel-dialog-close:focus-visible\n{\n outline: 2px solid var(--squiffy-link);\n outline-offset: 2px;\n}\n\nbutton.squiffy-panel-dialog-close svg\n{\n width: 1.25em;\n height: 1.25em;\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n/* Page layout styles for an exported story. See https://squiffystory.com/styling/ for how to customise these. */\n\n:root\n{\n /* The width of the story text */\n --squiffy-max-width: 42rem;\n /* The story's font. Charter, or Georgia if the reader doesn't have it */\n --squiffy-font-family: Charter, \"Bitstream Charter\", Georgia, serif;\n /* The size of the story text. The header's buttons are smaller, and don't change with it */\n --squiffy-font-size: 1.125rem;\n /* The space between lines of text */\n --squiffy-line-height: 1.6;\n}\n\n/* Follow the reader's light or dark system setting, or what they chose with the theme button.\n To keep a story light (or dark) whatever the setting, set \":root { color-scheme: light; }\"\n (or dark). These rules use :where() so that a :root rule like that overrides them, and the\n theme button is hidden. */\n:where(:root)\n{\n color-scheme: light dark;\n}\n\n:where(:root[data-squiffy-theme=\"light\"])\n{\n color-scheme: light;\n}\n\n:where(:root[data-squiffy-theme=\"dark\"])\n{\n color-scheme: dark;\n}\n\nbody\n{\n margin: 0;\n background-color: var(--squiffy-background);\n color: var(--squiffy-text);\n}\n\n/* Wraps the header and the story: sets the page width and font */\ndiv#squiffy-container\n{\n max-width: var(--squiffy-max-width);\n margin-left: auto;\n margin-right: auto;\n padding: 0 1.25rem 3rem;\n font-family: var(--squiffy-font-family);\n line-height: var(--squiffy-line-height);\n}\n\n/* The bar above the story containing the Back, Restart and light/dark buttons. It stays at the\n top of the window as the story scrolls under it. */\ndiv#squiffy-header\n{\n position: sticky;\n top: 0;\n z-index: 1;\n padding: 0.5rem 0;\n background-color: var(--squiffy-background);\n font-size: 0.875rem;\n text-align: right;\n white-space: nowrap;\n}\n\n/* A short fade under the header, so the story scrolls under it rather than being cut off */\ndiv#squiffy-header::after\n{\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n top: 100%;\n height: 0.75rem;\n background: linear-gradient(var(--squiffy-background), transparent);\n pointer-events: none;\n}\n\n/* Space between the Back, Restart and light/dark buttons */\nbutton.squiffy-header-button + button.squiffy-header-button\n{\n margin-left: 0.25em;\n}\n\n/* The button that switches between light and dark mode. It shows a moon in light mode and a sun\n in dark mode. */\nbutton#squiffy-theme:not([data-next=\"light\"]) .squiffy-icon-light,\nbutton#squiffy-theme[data-next=\"light\"] .squiffy-icon-dark\n{\n display: none;\n}\n\n/* The mute button (#444), for a story with music or sounds. It shows a speaker, crossed out\n when the story is muted. */\nbutton#squiffy-mute.squiffy-muted .squiffy-icon-sound,\nbutton#squiffy-mute:not(.squiffy-muted) .squiffy-icon-muted\n{\n display: none;\n}\n\n/* With a side panel (squiffy.json's \"panels\"), the page is wider, with the panel to the right of\n the story. It stays in view as the story scrolls, under the header. On a narrower screen, it's a\n button in the header instead. */\n@media (min-width: 64rem)\n{\n div#squiffy-container.squiffy-has-side\n {\n display: grid;\n grid-template-columns: minmax(0, 1fr) var(--squiffy-side-width);\n column-gap: 2.5rem;\n align-items: start;\n max-width: calc(var(--squiffy-max-width) + var(--squiffy-side-width) + 2.5rem);\n }\n\n div#squiffy-container.squiffy-has-side > div#squiffy-header\n {\n grid-column: 1 / -1;\n }\n\n /* :where() takes the container's id out of the selector's specificity, so a story's own\n aside.squiffy-panels-side { ... } rule, which comes after this, changes the border and the\n padding too */\n :where(div#squiffy-container.squiffy-has-side) > aside.squiffy-panels-side\n {\n position: sticky;\n top: 3.5rem;\n padding-left: 1.25rem;\n border-left: 1px solid var(--squiffy-border);\n max-height: calc(100vh - 4.5rem);\n overflow-y: auto;\n }\n}\n\n/* The story text */\ndiv#squiffy\n{\n font-size: var(--squiffy-font-size);\n}\n\ndiv#squiffy :is(h1, h2, h3, h4, h5, h6)\n{\n line-height: 1.25;\n}\n\ndiv#squiffy p\n{\n text-wrap: pretty;\n}\n\n/* Stop images overflowing the page */\ndiv#squiffy img\n{\n max-width: 100%;\n height: auto;\n}\n\n/* The preview scrolls the story within the frame, with the text centred as on the exported page */\nhtml, body { height: 100%; }\ndiv#squiffy-container { max-width: none; height: 100%; padding: 0; }\n#squiffy, .squiffy-preview-story, .squiffy-preview-story > div { height: 100%; box-sizing: border-box; }\n.squiffy-preview-story > div { padding: 1em max(1.25rem, calc((100% - var(--squiffy-max-width)) / 2)); }\n/* The story's panels: their buttons above the story, and side panels to its right */\n#squiffy { display: flex; flex-direction: column; }\n.squiffy-preview-header { flex: none; padding: 0.5rem 0.75rem 0; font-family: system-ui, sans-serif; font-size: 0.875rem; text-align: right; }\n.squiffy-preview-header:empty { display: none; }\n.squiffy-preview-body { flex: 1; min-height: 0; display: flex; }\n#squiffy .squiffy-preview-body > .squiffy-preview-story { flex: 1; min-width: 0; height: 100%; }\n.squiffy-preview-body > aside.squiffy-panels-side { flex: none; width: var(--squiffy-side-width); box-sizing: border-box; overflow-y: auto; padding: 1em 1.25rem 1em 0; }\n</style>\n</head>\n<body>\n<div id=\"squiffy-container\"><div id=\"squiffy\"></div></div>\n<script>\n(function(){var xl=Object.create,xr=Object.defineProperty,Tl=Object.getOwnPropertyDescriptor,Cl=Object.getOwnPropertyNames,El=Object.getPrototypeOf,Fn=Object.prototype.hasOwnProperty,de=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),Ps=(e,t)=>{let s={};for(var r in e)xr(s,r,{get:e[r],enumerable:!0});return t||xr(s,Symbol.toStringTag,{value:\"Module\"}),s},Al=(e,t,s,r)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(var i=Cl(t),n=0,o=i.length,c;n<o;n++)c=i[n],!Fn.call(e,c)&&c!==s&&xr(e,c,{get:(h=>t[h]).bind(null,c),enumerable:!(r=Tl(t,c))||r.enumerable});return e},Pl=(e,t,s)=>(s=e!=null?xl(El(e)):{},Al(t||!e||!e.__esModule||!Fn.call(e,\"default\")?xr(s,\"default\",{value:e,enumerable:!0}):s,e));function Ys(e){\"@babel/helpers - typeof\";return Ys=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(t){return typeof t}:function(t){return t&&typeof Symbol==\"function\"&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},Ys(e)}function Ll(e,t){if(Ys(e)!=\"object\"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t||\"default\");if(Ys(r)!=\"object\")return r;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(t===\"string\"?String:Number)(e)}function Rl(e){var t=Ll(e,\"string\");return Ys(t)==\"symbol\"?t:t+\"\"}function $e(e,t,s){return(t=Rl(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function Il(e,t){if(t.has(e))throw new TypeError(\"Cannot initialize the same private elements twice on an object\")}function Ol(e,t){Il(e,t),t.add(e)}function Tr(e,t,s){if(typeof e==\"function\"?e===t:e.has(t))return arguments.length<3?t:s;throw new TypeError(\"Private element is not present on this object\")}var Ls,Cr;function wi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var gs=wi();function Vn(e){gs=e}var ms={exec:()=>null};function vs(e){let t=[];return s=>{let r=Math.max(0,Math.min(3,s-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function ue(e,t=\"\"){let s=typeof e==\"string\"?e:e.source,r={replace:(i,n)=>{let o=typeof n==\"string\"?n:n.source;return o=o.replace(Ke.caret,\"$1\"),s=s.replace(i,o),r},getRegex:()=>new RegExp(s,t)};return r}var zn=((e=\"\")=>{try{return!!new RegExp(\"(?<=1)(?<!1)\"+e)}catch{return!1}})(),Ke={codeRemoveIndent:/^(?: {0,3}\\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]/,outputLinkReplace:/\\\\([\\[\\]])/g,indentCodeCompensation:/^(\\s+)(?:```)/,beginningSpace:/^\\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \\t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\\n/g,tabCharGlobal:/\\t/g,leadingSpaceTab:/^[ \\t]+/,multipleSpaceGlobal:/\\s+/g,blankLine:/^[ \\t]*$/,doubleBlankLine:/\\n[ \\t]*\\n[ \\t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\\n {0,3}((?:=+|-+)[ \\t]*)(?=\\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \\t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \\t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\\[[ xX]\\][ \\t]+\\S/,listReplaceTask:/^\\[[ xX]\\][ \\t]+/,listTaskCheckbox:/\\[[ xX]\\]/,anyLine:/\\n.*\\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\\||\\| *$/g,tableRowBlankLine:/\\n[ \\t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\\s|>)/i,endPreScriptTag:/^<\\/(pre|code|kbd|script)(\\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/,unicodeAlphaNumeric:/[\\p{L}\\p{N}]/u,numericCharacterReference:/&#(?:(\\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,escapeTest:/[&<>\"']/,escapeReplace:/[&<>\"']/g,escapeTestNoEncode:/[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/,escapeReplaceNoEncode:/[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,caret:/(^|[^\\[])\\^/g,percentDecode:/%25/g,findPipe:/\\|/g,splitPipe:/ \\|/,slashPipe:/\\\\\\|/g,carriageReturn:/\\r\\n|\\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\\S*/,endingNewline:/\\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\\\n]*)?(?:\\\\n|$))`),nextBulletRegex:vs(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \t][^\\\\n]*)?(?:\\\\n|$))`)),hrRegex:vs(e=>new RegExp(`^ {0,${e}}((?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\\\\*[ \t]*){3,})(?:\\\\n+|$)`)),fencesBeginRegex:vs(e=>new RegExp(`^ {0,${e}}(?:\\`\\`\\`|~~~)`)),headingBeginRegex:vs(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\\\s|$)`)),pedanticHeadingBeginRegex:vs(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:vs(e=>new RegExp(`^ {0,${e}}(?:</?(?:${Js})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)`,\"i\")),blockquoteBeginRegex:vs(e=>new RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\\d{1,9}[.)])[ \\t]+|>[ \\t]?))+/},Ml=/^(?:[ \\t]*(?:\\n|$))+/,Nl=/^((?: {4}| {0,3}\\t)[^\\n]+(?:\\n(?:[ \\t]*(?:\\n|$))*)?)+/,Dl=/^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}(?:(?=`)\\1`*|(?=~)\\1~*) *(?=\\n|$)|$)/,Zs=/^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,$l=/^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,ki=/ {0,3}(?:[*+-]|\\d{1,9}[.)])/,Un=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\\n(?!\\s*?\\n|bull |fences|blockquote|heading|hr|html|table))+?)\\n {0,3}(=+|-+)[ \\t]*(?:\\n+|$)/,Wn=ue(Un).replace(/bull/g,ki).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/\\|table/g,\"\").getRegex(),ql=ue(Un).replace(/bull/g,ki).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/table/g,/ {0,3}\\|?(?:[:\\- ]*\\|)+[\\:\\- ]*\\n/).getRegex(),xi=/^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \\t]+\\n)[^\\n]+)*)/,Bl=/^[^\\n]+/,Ti=/(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\\\n]|\\n(?![ \\t]*\\n))+/,Hl=ue(/^ {0,3}\\[(label)\\]: *(?:\\n[ \\t]*)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n[ \\t]*)?| *\\n[ \\t]*)(title))? *(?:\\n+|$)/).replace(\"label\",Ti).replace(\"title\",/(?:\"(?:\\\\[\\s\\S]|[^\"\\\\])*\"|'(?:\\\\[\\s\\S]|[^'\\\\\\n]|\\n(?!\\n))*'|\\((?:\\\\[\\s\\S]|[^()\\\\])*\\))/).getRegex(),Fl=ue(/^(bull)([ \\t][^\\n]*?)?(?:\\n|$)/).replace(/bull/g,ki).getRegex(),Js=\"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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul\",Ci=/<!--(?:-?>|[\\s\\S]*?(?:-->|$))/,Vl=ue(\"^ {0,3}(?:<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n*|$)|comment[^\\\\n]*(\\\\n+|$)|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>[^\\\\n]*\\\\n*|$)|<![A-Z][\\\\s\\\\S]*?(?:>[^\\\\n]*\\\\n*|$)|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>[^\\\\n]*\\\\n*|$)|</?(tag)(?:[ \\\\t]+|\\\\n|/?>|$)[\\\\s\\\\S]*?(?:(?:\\\\n[ \t]*)+\\\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \t]*)+\\\\n|$)|</[a-z][a-z0-9-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \t]*)+\\\\n|$))\",\"i\").replace(\"comment\",Ci).replace(\"tag\",Js).replace(\"attribute\",/ +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/).getRegex(),Gn=e=>ue(xi).replace(\"hr\",Zs).replace(\"heading\",\" {0,3}#{1,6}(?:\\\\s|$)\").replace(\"|lheading\",\"\").replace(\"|table\",\"\").replace(\"blockquote\",\" {0,3}>\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)\").replace(\"list\",e).replace(\"html\",\" {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)\").replace(\"tag\",Js).getRegex(),zl=Gn(/ {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]/),Ul=Gn(/ {0,3}(?:[*+-]|\\d{1,9}[.)])(?:[ \\t]|\\n|$)/),Ei={blockquote:ue(/^( {0,3}> ?(?:(?![ \\t]*(?:\\n|$))(paragraph)|[^\\n]*)(?:\\n|$))+/).replace(\"paragraph\",Ul).getRegex(),code:Nl,def:Hl,fences:Dl,heading:$l,hr:Zs,html:Vl,lheading:Wn,list:Fl,newline:Ml,paragraph:zl,table:ms,text:Bl},Xn=ue(\"^ *([^\\\\n ].*)\\\\n {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)\").replace(\"hr\",Zs).replace(\"heading\",\" {0,3}#{1,6}(?:\\\\s|$)\").replace(\"blockquote\",\" {0,3}>\").replace(\"code\",\"(?: {4}| {0,3}\t)[^\\\\n]\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)])[ \\\\t]\").replace(\"html\",\" {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)\").replace(\"tag\",Js).getRegex(),Wl={...Ei,lheading:ql,table:Xn,paragraph:ue(xi).replace(\"hr\",Zs).replace(\"heading\",\" {0,3}#{1,6}(?:\\\\s|$)\").replace(\"|lheading\",\"\").replace(\"table\",Xn).replace(\"blockquote\",\" {0,3}>\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)])[ \\\\t]+[^ \\\\t\\\\n]\").replace(\"html\",\" {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)\").replace(\"tag\",Js).getRegex()},Gl={...Ei,html:ue(`^ *(?:comment(?: *\\\\n|\\\\s*$)|<(tag)[\\\\s\\\\S]+?</\\\\1>(?: *\\\\n{2,}|\\\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\\\s[^'\"/>\\\\s]*)*?/?>(?: *\\\\n{2,}|\\\\s*$))`).replace(\"comment\",Ci).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:/^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,heading:/^(#{1,6})(.*)(?:\\n+|$)/,fences:ms,lheading:/^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,paragraph:ue(xi).replace(\"hr\",Zs).replace(\"heading\",` *#{1,6} *[^\n]`).replace(\"lheading\",Wn).replace(\"|table\",\"\").replace(\"blockquote\",\" {0,3}>\").replace(\"|fences\",\"\").replace(\"|list\",\"\").replace(\"|html\",\"\").replace(\"|tag\",\"\").getRegex()},Xl=/^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,jl=/^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,jn=/^( {2,}|\\\\)\\n(?!\\s*$)[ \\t]*/,Yl=/^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,Vt=/[\\p{P}\\p{S}]/u,Rs=/[\\s\\p{P}\\p{S}]/u,Ks=/[^\\s\\p{P}\\p{S}]/u,Zl=ue(/^((?![*_])punctSpace)/,\"u\").replace(/punctSpace/g,Rs).getRegex(),Jl=/[\\p{Pi}\\p{Ps}\"']/u,Yn=/(?!~)[\\p{P}\\p{S}]/u,Kl=/(?!~)[\\s\\p{P}\\p{S}]/u,Ql=/(?:[^\\s\\p{P}\\p{S}]|~)/u,ec=ue(/link|precode-code|html/,\"g\").replace(\"link\",/\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)/).replace(\"precode-\",zn?\"(?<!`)()\":\"(^^|[^`])\").replace(\"code\",/(?<b>`+)[^`]+\\k<b>(?!`)/).replace(\"html\",/<(?! )[^<>]*?>/).getRegex(),Zn=/^(?:\\*+(?:((?!\\*)punct)|([^\\s*]))?)|^_+(?:((?!_)punct)|([^\\s_]))?/,tc=ue(Zn,\"u\").replace(/punct/g,Vt).getRegex(),sc=ue(Zn,\"u\").replace(/punct/g,Yn).getRegex(),rc=ue(/^(?:\\*+(?:((?!\\*)(?!openQuote)punct)|([^\\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\\s_]))?/,\"u\").replace(/openQuote/g,Jl).replace(/punct/g,Vt).getRegex(),Jn=\"^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)|(?!\\\\*)punctSpace(\\\\*+)(?=notPunctSpace)|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)|notPunctSpace(\\\\*+)(?=notPunctSpace)\",ic=ue(Jn,\"gu\").replace(/notPunctSpace/g,Ks).replace(/punctSpace/g,Rs).replace(/punct/g,Vt).getRegex(),nc=ue(Jn,\"gu\").replace(/notPunctSpace/g,Ql).replace(/punctSpace/g,Kl).replace(/punct/g,Yn).getRegex(),oc=ue(\"^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)|(?!\\\\*)[\\\\s](\\\\*+)(?=notPunctSpace)|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)|(?:(?!\\\\*)punct|notPunctSpace)(\\\\*+)(?!\\\\*)(?=notPunctSpace)\",\"gu\").replace(/notPunctSpace/g,Ks).replace(/punctSpace/g,Rs).replace(/punct/g,Vt).getRegex(),ac=ue(\"^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)\",\"gu\").replace(/notPunctSpace/g,Ks).replace(/punctSpace/g,Rs).replace(/punct/g,Vt).getRegex(),lc=ue(\"^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\\\s](_+)(?=notPunctSpace)|[\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)\",\"gu\").replace(/notPunctSpace/g,Ks).replace(/punctSpace/g,Rs).replace(/punct/g,Vt).getRegex(),cc=ue(/^~~?(?:((?!~)punct)|[^\\s~])/,\"u\").replace(/punct/g,Vt).getRegex(),uc=ue(\"^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)\",\"gu\").replace(/notPunctSpace/g,Ks).replace(/punctSpace/g,Rs).replace(/punct/g,Vt).getRegex(),hc=ue(/\\\\(punct)/,\"gu\").replace(/punct/g,Vt).getRegex(),dc=ue(/(`+)(?:[^`]|[^`][\\s\\S]*?[^`])\\1(?!`)|`+|\\\\(punct)/,\"gu\").replace(/punct/g,Vt).getRegex(),fc=ue(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/).replace(\"scheme\",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(\"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])?)+(?![-_])/).getRegex(),pc=ue(Ci).replace(\"(?:-->|$)\",\"-->\").getRegex(),gc=ue(\"^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\\\s*/?>|^<\\\\?[\\\\s\\\\S]*?\\\\?>|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>\").replace(\"comment\",pc).replace(\"attribute\",/\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/).getRegex(),Kn=/\\[(?:\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]/,Er=ue(/(?:\\[(?:brackets|\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\])|[^\\[\\]\\\\`])*?/).replace(\"brackets\",Kn).getRegex(),mc=ue(/^!?\\[(label)\\]\\([ \\t\\n]*(href)(?:(?:[ \\t]+(?:\\n[ \\t]*)?|\\n[ \\t]*)(title))?[ \\t\\n]*\\)/).replace(\"label\",Er).replace(\"href\",/<(?:\\\\.|[^\\n<>\\\\])+>|[^ \\t\\n\\x00-\\x1f]+|(?=\\))/).replace(\"title\",/\"(?:\\\\[\\s\\S]|[^\"\\\\])*\"|'(?:\\\\[\\s\\S]|[^'\\\\])*'|\\((?:\\\\[\\s\\S]|[^)\\\\])*\\)/).getRegex(),vc=ue(/^!?\\[(label)\\]\\[(ref)\\]/).replace(\"label\",Er).replace(\"ref\",Ti).getRegex(),yc=ue(/^!?\\[(ref)\\](?:\\[\\])?/).replace(\"ref\",Ti).getRegex(),Qn=/(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\]){1,999}/,bc=ue(/(?:[^\\[\\]\\\\`]*(?:\\[(?:brackets|\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\]))){0,999}?[^\\[\\]\\\\`]*?/).replace(\"brackets\",Kn).getRegex(),Sc=ue(\"reflink|nolink(?!\\\\()\",\"g\").replace(\"reflink\",ue(/^!?\\[(label)\\]\\[(ref)\\]/).replace(\"label\",bc).replace(\"ref\",Qn).getRegex()).replace(\"nolink\",ue(/^!?\\[(ref)\\](?:\\[\\])?/).replace(\"ref\",Qn).getRegex()).getRegex(),eo=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,_c=ue(/(?:mailto:email|xmpp:email(?:\\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\\w-])/).getRegex(),Ai={_backpedal:ms,anyPunctuation:hc,anyPunctuationOutsideCode:dc,autolink:fc,blockSkip:ec,br:jn,code:jl,del:ms,delLDelim:ms,delRDelim:ms,emStrongLDelim:tc,emStrongRDelimAst:ic,emStrongRDelimUnd:ac,escape:Xl,link:mc,nolink:yc,punctuation:Zl,reflink:vc,reflinkSearch:Sc,tag:gc,text:Yl,url:ms},wc={...Ai,emStrongLDelim:rc,emStrongRDelimAst:oc,emStrongRDelimUnd:lc,link:ue(/^!?\\[(label)\\]\\((.*?)\\)/).replace(\"label\",Er).getRegex(),reflink:ue(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/).replace(\"label\",Er).getRegex()},Pi={...Ai,emStrongRDelimAst:nc,emStrongLDelim:sc,delLDelim:cc,delRDelim:uc,url:ue(/^emailProtocol|^((?:protocol):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/).replace(\"emailProtocol\",_c).replace(\"protocol\",eo).replace(\"email\",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,del:/^(~~?)(?=[^\\s~])((?:\\\\[\\s\\S]|[^\\\\])*?(?:\\\\[\\s\\S]|[^\\s~\\\\]))\\1(?=[^~]|$)/,text:ue(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|protocol:\\/\\/|wwwStart|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@))))/).replace(\"protocol\",eo).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace(\"wwwStart\",zn?\"(?<![^\\\\s*_~(])www\\\\.\":\"www\\\\.\").getRegex()},kc={...Pi,br:ue(jn).replace(\"{2,}\",\"*\").getRegex(),text:ue(Pi.text).replace(\"\\\\b_\",\"\\\\b_| {2,}\\\\n\").replace(/\\{2,\\}/g,\"*\").getRegex()},Ar={normal:Ei,gfm:Wl,pedantic:Gl},Qs={normal:Ai,gfm:Pi,breaks:kc,pedantic:wc},xc={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"},to=e=>xc[e];function bt(e,t){if(t){if(Ke.escapeTest.test(e))return e.replace(Ke.escapeReplace,to)}else if(Ke.escapeTestNoEncode.test(e))return e.replace(Ke.escapeReplaceNoEncode,to);return e}function Tc(e){return Ke.numericCharacterReference.test(e)?e.replace(Ke.numericCharacterReferenceOrAmpersand,(t,s,r)=>{if(s===void 0&&r===void 0)return\"&\";let i=s===void 0?Number.parseInt(r,16):Number.parseInt(s,10);return i===0||i>1114111||i>=55296&&i<=57343?\"�\":i===38?\"&\":String.fromCodePoint(i)}):e}function so(e){try{e=encodeURI(e).replace(Ke.percentDecode,\"%\")}catch{return null}return e}function ro(e,t){let s=e.replace(Ke.findPipe,(i,n,o)=>{let c=!1,h=n;for(;--h>=0&&o[h]===\"\\\\\";)c=!c;return c?\"|\":\" |\"}).split(Ke.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push(\"\");for(;r<s.length;r++)s[r]=s[r].trim().replace(Ke.slashPipe,\"|\");return s}function Yt(e,t,s){let r=e.length;if(r===0)return\"\";let i=0;for(;i<r;){let n=e.charAt(r-i-1);if(n===t&&!s)i++;else if(n!==t&&s)i++;else break}return e.slice(0,r-i)}function io(e){let t=e.split(`\n`),s=t.length-1;for(;s>=0&&Ke.blankLine.test(t[s]);)s--;return t.length-s<=2?e:t.slice(0,s+1).join(`\n`)}function Pr(e){return e.trim().replace(Ke.multipleSpaceGlobal,\" \").toLowerCase().toUpperCase().toLowerCase()}function no(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let s=0;for(let r=0;r<e.length;r++)if(e[r]===\"\\\\\")r++;else if(e[r]===t[0])s++;else if(e[r]===t[1]&&(s--,s<0))return r;return s>0?-2:-1}var Is=new WeakMap;function Li(e){let t={\"*\":-1,_:-1},s=-1,r=e.length;for(let i=0;i<r;i++){let n=e[i];if(n!==\"*\"&&n!==\"_\"&&n!==\"~\")continue;let o=i===0?`\n`:e[i-1],c=i+1;for(;c<r&&e[c]===n;)c++;o!==\" \"&&o!==\"\t\"&&o!==`\n`&&o!==\"\\r\"&&o!==\"\\f\"&&(n===\"~\"?s=i:t[n]=i),i=c-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:s}}function Cc(e,t){let s=Li(t),r=Is.get(e);r?r.push(s):Is.set(e,[s])}function Ec(e){let t=Is.get(e);t&&(t.pop(),t.length===0&&Is.delete(e))}function Ac(e,t,s){let r=Is.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[s]:Li(t).lastPossibleEmStrongCloserIndex[s]}function Pc(e,t){let s=Is.get(e)?.at(-1);return s&&s.maskedSrc===t?s.lastPossibleDelCloserIndex:Li(t).lastPossibleDelCloserIndex}function Lr(e,t=0){let s=t,r=\"\";for(let i of e)if(i===\"\t\"){let n=4-s%4;r+=\" \".repeat(n),s+=n}else r+=i,s++;return r}function oo(e,t,s,r,i){let n=t.href,o=t.title||null,c=e[1].replace(i.other.outputLinkReplace,\"$1\"),h=e[0].charAt(0)===\"!\",u=r.state.inLink,f=r.state.linkEmitted,a=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let d=r.inlineTokens(c),l=r.state.linkEmitted;if(r.state.linkEmitted=f,r.state.inLink=u,!h){if(l){r.state.inRawBlock=a;return}r.state.linkEmitted=!0}return{type:h?\"image\":\"link\",raw:s,href:n,title:o,text:c,tokens:d}}function Lc(e,t,s){let r=e.match(s.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`\n`).map(n=>{let o=n.match(s.other.beginningSpace);if(o===null)return n;let[c]=o;return n.slice(Math.min(c.length,i.length))}).join(`\n`)}function ao(e,t,s,r){if(!t.includes(\"<\"))return!1;for(let i=0;i<t.length;i++){if(t[i]===\"\\\\\"){i++;continue}if(t[i]===\"`\"){let c=r.inline.code.exec(t.slice(i));if(c){i+=c[0].length-1;continue}}if(t[i]!==\"<\")continue;let n=e.slice(s+i),o=r.inline.tag.exec(n)||r.inline.autolink.exec(n);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var Os=class{constructor(e){$e(this,\"options\",void 0),$e(this,\"rules\",void 0),$e(this,\"lexer\",void 0),this.options=e||gs}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:\"space\",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let s=this.options.pedantic?t[0]:io(t[0]);return{type:\"code\",raw:s,codeBlockStyle:\"indented\",text:s.replace(this.rules.other.codeRemoveIndent,\"\")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let s=t[0],r=Lc(s,t[3]||\"\",this.rules);return{type:\"code\",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,\"$1\"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(this.rules.other.endingHash.test(s)){let r=Yt(s,\"#\");(this.options.pedantic||!r||this.rules.other.endingSpaceTabChar.test(r))&&(s=r.trim())}return{type:\"heading\",raw:Yt(t[0],`\n`),depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:\"hr\",raw:Yt(t[0],`\n`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let s=Yt(t[0],`\n`).split(`\n`),r=\"\",i=\"\",n=[];for(;s.length>0;){let o=!1,c=[],h=0;for(;h<s.length;h++)if(this.rules.other.blockquoteStart.test(s[h]))c.push(s[h]),o=!0;else if(!o)c.push(s[h]);else break;s=s.slice(h);let u=c.join(`\n`),f=u.replace(this.rules.other.blockquoteMarkerWhitespace,(l,g,m)=>g+Lr(m,g.length)).replace(this.rules.other.blockquoteSetextReplace,`\n $1`).replace(this.rules.other.blockquoteSetextReplace2,\"\");r=r?`${r}\n${u}`:u,i=i?`${i}\n${f}`:f;let a=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,n,!0),this.lexer.state.top=a,s.length===0)break;let d=n.at(-1);if(d?.type===\"code\"||d?.type===\"heading\"||d?.type===\"hr\"||d?.type===\"html\"||d?.type===\"table\")break;if(d?.type===\"blockquote\"){let l=d,g=s.join(`\n`),m=l.raw+`\n`+g.replace(this.rules.other.blockquoteSetextReplace2,\"\"),y=this.blockquote(m);n[n.length-1]=y;let _=m.substring(y.raw.length).replace(/^\\n/,\"\"),w=_?_.split(`\n`).length:0,S=w?s.slice(0,-w):s;if(S.length>0&&(r=`${r}\n${S.join(`\n`)}`),i=i.substring(0,i.length-l.text.length)+y.text,s=s.slice(S.length),s.length>0&&this.rules.other.blockquoteStart.test(s[0]))continue;break}else if(d?.type===\"list\"){let l=d,g=l.raw+`\n`+s.join(`\n`),m=this.list(g);n[n.length-1]=m;let y=m.raw.length>l.raw.length?g.slice(l.raw.length+1,m.raw.length).split(`\n`).length:0;if(y>0){let _=s.slice(0,y).join(`\n`);r=`${r}\n${_}`,i=`${i}\n${_}`}s=s.slice(y);continue}}return{type:\"blockquote\",raw:r,tokens:n,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type===\"text\"&&!this.rules.other.listInterruptsParagraph.test(e))return;let s=e,r=()=>s.length-e.length,i=t[1].trim(),n=i.length>1,o={type:\"list\",raw:\"\",ordered:n,start:n?+i.slice(0,-1):\"\",loose:!1,items:[]};i=n?`\\\\d{1,9}\\\\${i.slice(-1)}`:`\\\\${i}`,this.options.pedantic&&(i=n?i:\"[*+-]\");let c=this.rules.other.listItemRegex(i),h=!1;for(;e;){let f=!1,a=\"\";if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;let d=r();e=e.substring(t[0].length);let l=t[2].split(`\n`,1)[0],g=t[1].length,m=this.options.pedantic?Lr(l,g):l.replace(this.rules.other.leadingSpaceTab,v=>Lr(v,g)),y=e.split(`\n`,1)[0],_=!m.trim(),w=0;if(this.options.pedantic?(w=2,a=m.trimStart()):_?w=g+1:(w=m.search(this.rules.other.nonSpaceChar),w=w>4?1:w,a=m.slice(w),w+=g),_&&this.rules.other.blankLine.test(y)&&(e=e.substring(y.length+1),f=!0),!f){let v=this.rules.other.nextBulletRegex(w),p=this.rules.other.hrRegex(w),b=this.rules.other.fencesBeginRegex(w),k=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(w):this.rules.other.headingBeginRegex(w),T=this.rules.other.htmlBeginRegex(w),R=this.rules.other.blockquoteBeginRegex(w),P=!1;for(;e;){let O=e.split(`\n`,1)[0],I;if(y=O,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting,\" \"),I=y):I=y.replace(this.rules.other.leadingSpaceTab,q=>Lr(q)),b.test(y)||k.test(y)||T.test(y)||R.test(y)||v.test(y)||p.test(y))break;if(I.search(this.rules.other.nonSpaceChar)>=w||!y.trim())a+=`\n`+I.slice(w),P=!1;else{if(_||m.replace(this.rules.other.tabCharGlobal,\" \").search(this.rules.other.nonSpaceChar)>=4||b.test(m)||k.test(m)||T.test(m)||p.test(m))break;if(!this.options.pedantic&&!P){let B=m.replace(this.rules.other.nestedContainerMarkers,\"\");if(this.rules.block.fences.test(B)||this.rules.block.heading.test(B)||this.rules.block.hr.test(B))break}let q=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(y)&&this.rules.block.lheading.test(`${m}\n${y}`)?` ${I.replace(/^ {0,3}/,\"\")}`:y;a+=`\n`+q,P=!0}_=!y.trim(),e=e.substring(O.length+1),m=I.slice(w)}}let S=s.slice(d,r());o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(S)&&(h=!0)),o.items.push({type:\"list_item\",raw:S,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let u=o.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;o.raw=s.slice(0,r()).trimEnd();for(let f of o.items)if(this.lexer.state.top=!1,f.tokens=this.lexer.blockTokens(f.text,[]),!o.loose){let a=f.tokens.filter(d=>d.type===\"space\");o.loose=a.length>0&&a.some(d=>this.rules.other.anyLine.test(d.raw))}for(let f of o.items){let a=f.tokens[0];if(f.task&&(a?.type===\"text\"||a?.type===\"paragraph\")){f.text=f.text.replace(this.rules.other.listReplaceTask,\"\"),a.raw=a.raw.replace(this.rules.other.listReplaceTask,\"\"),a.text=a.text.replace(this.rules.other.listReplaceTask,\"\");for(let l=this.lexer.inlineQueue.length-1;l>=0;l--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[l].src)){this.lexer.inlineQueue[l].src=this.lexer.inlineQueue[l].src.replace(this.rules.other.listReplaceTask,\"\");break}let d=this.rules.other.listTaskCheckbox.exec(f.raw);if(d){let l={type:\"checkbox\",raw:d[0]+\" \",checked:d[0]!==\"[ ]\"};f.checked=l.checked,o.loose?f.tokens[0]&&[\"paragraph\",\"text\"].includes(f.tokens[0].type)&&\"tokens\"in f.tokens[0]&&f.tokens[0].tokens?(f.tokens[0].raw=l.raw+f.tokens[0].raw,f.tokens[0].text=l.raw+f.tokens[0].text,f.tokens[0].tokens.unshift(l)):f.tokens.unshift({type:\"paragraph\",raw:l.raw,text:l.raw,tokens:[l]}):f.tokens.unshift(l)}}else f.task&&(f.task=!1)}if(o.loose)for(let f of o.items){f.loose=!0;for(let a of f.tokens)a.type===\"text\"&&(a.type=\"paragraph\")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let s=io(t[0]);return{type:\"html\",block:!0,raw:s,pre:t[1]===\"pre\"||t[1]===\"script\"||t[1]===\"style\",text:s}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&no(t[2],\"()\")!==-1)return;let s=Pr(t[1]),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,\"$1\").replace(this.rules.inline.anyPunctuation,\"$1\"):\"\",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,\"$1\"):t[3];return{type:\"def\",tag:s,raw:Yt(t[0],`\n`),href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let s=ro(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,\"\").split(\"|\"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,\"\").split(`\n`):[],n={type:\"table\",raw:Yt(t[0],`\n`),header:[],align:[],rows:[]};if(s.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?n.align.push(\"right\"):this.rules.other.tableAlignCenter.test(o)?n.align.push(\"center\"):this.rules.other.tableAlignLeft.test(o)?n.align.push(\"left\"):n.align.push(null);for(let o=0;o<s.length;o++)n.header.push({text:s[o],tokens:this.lexer.inline(s[o]),header:!0,align:n.align[o]});for(let o of i)n.rows.push(ro(o,n.header.length).map((c,h)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:n.align[h]})));return n}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let s=t[1].trim();return{type:\"heading\",raw:Yt(t[0],`\n`),depth:t[2].charAt(0)===\"=\"?1:2,text:s,tokens:this.lexer.inline(s)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let s=t[1].charAt(t[1].length-1)===`\n`?t[1].slice(0,-1):t[1];return{type:\"paragraph\",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:\"text\",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:\"escape\",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:\"html\",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let s=t[0].charAt(0)===\"!\"?2:1;if(!this.options.pedantic&&ao(e,t[1],s,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let c=Yt(r.slice(0,-1),\"\\\\\");if((r.length-c.length)%2===0)return}else{let c=no(t[2],\"()\");if(c===-2)return;if(c>-1){let h=(t[0].indexOf(\"!\")===0?5:4)+t[1].length+c;t[2]=t[2].substring(0,c),t[0]=t[0].substring(0,h).trim(),t[3]=\"\"}}let i=Yt(t[0].slice(0,-1),\"\\\\\");if((t[0].length-i.length)%2===0)return;let n=t[2],o=\"\";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(n);c&&(n=c[1],o=c[3])}else o=t[3]?t[3].slice(1,-1):\"\";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),oo(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,\"$1\"),title:o&&o.replace(this.rules.inline.anyPunctuation,\"$1\")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){let r=s[0].charAt(0)===\"!\"?2:1;if(!this.options.pedantic&&ao(e,s[1],r,this.rules))return;let i=t[Pr(s[2]||s[1])];if(!i){let n=s[0].charAt(0);return{type:\"text\",raw:n,text:n}}return oo(s,i,s[0],this.lexer,this.rules)}}emStrong(e,t,s=\"\"){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],n=s===i,o=t.length-e.length,c=o;for(;!this.options.pedantic&&c>0&&t[c-1]===i;)c--;let h=[...t.slice(Math.max(0,c-2),c)].at(-1)??\"\",u=h===\"*\"||h===\"_\"||!!this.rules.inline.punctuation.exec(h);c<o&&(s=h);let f=c<o?u:s===\"*\"||s===\"_\"||!!this.rules.inline.punctuation.exec(s);if(r[4]&&s.match(this.rules.other.unicodeAlphaNumeric))return;let a=r[1]||r[3]||\"\";if(!a||!s||f){let d=[...r[0]].length-1,l,g,m=d,y=0,_=o-c+d,w=!this.options.pedantic&&!!h.trim()&&(!!a||i===\"*\"&&!u);if(i!==\"*\"&&i!==\"_\")return;let S=i===\"*\"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,v=Ac(this,t,i),p=t.length-e.length+d;if(v<p)return;t=t.slice(-1*e.length+d);let b=v-p;for(S.lastIndex=0;(r=S.exec(t))!==null&&!(r.index>b);){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(g=[...l].length,r[3]||r[4]){m+=g;continue}else if(r[5]||r[6]||w){if(n&&(r[5]||r[6]))break;if(_%3&&!((_+g)%3)){y+=g;continue}}if(m-=g,m>0)continue;g=Math.min(g,g+m+y);let k=[...r[0]][0].length,T=e.slice(0,d+r.index+k+g);if(Math.min(d,g)%2){let P=T.slice(1,-1);return{type:\"em\",raw:T,text:P,tokens:this.lexer.inlineTokens(P)}}let R=T.slice(2,-2);return{type:\"strong\",raw:T,text:R,tokens:this.lexer.inlineTokens(R)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal,\" \"),r=this.rules.other.nonSpaceChar.test(s),i=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return r&&i&&(s=s.substring(1,s.length-1)),{type:\"codespan\",raw:t[0],text:s}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:\"br\",raw:t[0]}}del(e,t,s=\"\"){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!s||this.rules.inline.punctuation.exec(s))){let i=[...r[0]].length-1,n,o,c=i,h=this.rules.inline.delRDelim,u=Pc(this,t),f=t.length-e.length+i;if(u<f)return;t=t.slice(-1*e.length+i);let a=u-f;for(h.lastIndex=0;(r=h.exec(t))!==null&&!(r.index>a);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(o=[...n].length,o!==i))continue;if(r[3]||r[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let d=[...r[0]][0].length,l=e.slice(0,i+r.index+d+o),g=l.slice(i,-i);return{type:\"del\",raw:l,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let s,r;return t[2]===\"@\"?(s=t[1],r=\"mailto:\"+s):(s=t[1],r=s),{type:\"link\",raw:t[0],text:s,href:r,autolink:!0,tokens:[{type:\"text\",raw:s,text:s}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let s,r;if(t[2]===\"@\")s=t[0],r=\"mailto:\"+s;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??\"\";while(i!==t[0]);s=t[0],t[1]===\"www.\"?r=\"http://\"+t[0]:r=t[0]}return{type:\"link\",raw:t[0],text:s,href:r,autolink:!0,tokens:[{type:\"text\",raw:s,text:s}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let s=this.lexer.state.inRawBlock;return{type:\"text\",raw:t[0],text:s?t[0]:Tc(t[0]),escaped:s}}}},Ot=(Ls=new WeakSet,class Bn{constructor(t){Ol(this,Ls),$e(this,\"tokens\",void 0),$e(this,\"options\",void 0),$e(this,\"state\",void 0),$e(this,\"inlineQueue\",void 0),$e(this,\"tokenizer\",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||gs,this.options.tokenizer=this.options.tokenizer||new Os,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let s={other:Ke,block:Ar.normal,inline:Qs.normal};this.options.pedantic?(s.block=Ar.pedantic,s.inline=Qs.pedantic):this.options.gfm&&(s.block=Ar.gfm,this.options.breaks?s.inline=Qs.breaks:s.inline=Qs.gfm),this.tokenizer.rules=s}static get rules(){return{block:Ar,inline:Qs}}static lex(t,s){return new Bn(s).lex(t)}static lexInline(t,s){return new Bn(s).inlineTokens(t)}lex(t){t=t.replace(Ke.carriageReturn,`\n`),this.blockTokens(t,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let r=this.inlineQueue[s];this.state.inRawBlock=!1,this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,s=[],r=!1){this.tokenizer.lexer=this;let i=this.state.lastToken;this.options.pedantic&&(t=t.replace(Ke.tabCharGlobal,\" \").replace(Ke.spaceLine,\"\"));let n=1/0;for(;t;){if(t.length<n)n=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}this.state.lastToken=s.at(-1);let o;if(this.options.extensions?.block?.some(h=>(o=h.call({lexer:this},t,s))?(t=t.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let h=s.at(-1);o.raw.length===1&&h!==void 0?h.raw+=`\n`:s.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let h=s.at(-1);h?.type===\"paragraph\"||h?.type===\"text\"?(h.raw+=(h.raw.endsWith(`\n`)?\"\":`\n`)+o.raw,h.text+=`\n`+o.text,this.inlineQueue.at(-1).src=h.text):s.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let h=s.at(-1);h?.type===\"paragraph\"||h?.type===\"text\"?(h.raw+=(h.raw.endsWith(`\n`)?\"\":`\n`)+o.raw,h.text+=`\n`+o.raw,this.inlineQueue.at(-1).src=h.text):(this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title}),s.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),s.push(o);continue}let c=t;if(this.options.extensions?.startBlock){let h=1/0,u=t.slice(1),f;this.options.extensions.startBlock.forEach(a=>{f=a.call({lexer:this},u),typeof f==\"number\"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(this.state.top&&(o=this.tokenizer.paragraph(c))){let h=s.at(-1);r&&h?.type===\"paragraph\"?(h.raw+=(h.raw.endsWith(`\n`)?\"\":`\n`)+o.raw,h.text+=`\n`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):s.push(o),r=c.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let h=s.at(-1);h?.type===\"text\"?(h.raw+=(h.raw.endsWith(`\n`)?\"\":`\n`)+o.raw,h.text+=`\n`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):s.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=i,s}inline(t,s=[]){return this.inlineQueue.push({src:t,tokens:s}),s}linkInText(t){if(!t.includes(\"[\"))return!1;let s=this.tokenizer.rules.inline.link;for(let r of t.matchAll(this.tokenizer.rules.inline.blockSkip))if(s.test(r[0])&&t.charAt(r.index-1)!==\"!\")return!0;for(let r of t.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=r[0],n=i.lastIndexOf(\"[\");if(!(i.charAt(0)===\"!\"||!Object.hasOwn(this.tokens.links,Pr(i.slice(n+1,-1))))&&!(n>1&&this.linkInText(i.slice(1,n-1))))return!0}return!1}inlineTokens(t,s=[]){this.tokenizer.lexer=this;let r=this.state.linkParenPossible;this.state.linkParenPossible=r&&t.includes(\")\");try{return Tr(Ls,this,Rc).call(this,t,s)}finally{this.state.linkParenPossible=r}}infiniteLoopError(t){let s=\"Infinite loop on byte: \"+t;if(this.options.silent)console.error(s);else throw new Error(s)}});function Rc(e,t){let s=e.includes(\"*\")||e.includes(\"_\")||e.includes(\"~\")||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==Os.prototype.emStrong||this.tokenizer.del!==Os.prototype.del?Tr(Ls,this,Mc).call(this,e):e;Cc(this.tokenizer,s);try{return Tr(Ls,this,Ic).call(this,e,s,t)}finally{Ec(this.tokenizer)}}function Ic(e,t,s){let r=!1,i=\"\",n=1/0;for(;e;){if(e.length<n)n=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=\"\"),r=!1;let o;if(this.options.extensions?.inline?.some(h=>(o=h.call({lexer:this},e,s))?(e=e.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let h=s.at(-1);o.type===\"text\"&&h?.type===\"text\"?(h.raw+=o.raw,h.text+=o.text):s.push(o);continue}if(o=this.tokenizer.emStrong(e,t,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.del(e,t,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),s.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),s.push(o);continue}let c=e;if(this.options.extensions?.startInline){let h=1/0,u=e.slice(1),f;this.options.extensions.startInline.forEach(a=>{f=a.call({lexer:this},u),typeof f==\"number\"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(c=e.substring(0,h+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!==\"_\"&&(i=o.raw.slice(-1)),r=!0;let h=s.at(-1);h?.type===\"text\"?(h.raw+=o.raw,h.text+=o.text):s.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return s}function Oc(e){let{blockSkip:t,tag:s,autolink:r}=this.tokenizer.rules.inline,i=\"\",n=0,o;for(t.lastIndex=0;o=t.exec(e);){let c=o.index+(o[2]?o[2].length:0),h=o.index+o[0].length;if(e.charAt(c)===\"<\"){let u=e.slice(c),f=s.exec(u)||r.exec(u);if(!f){t.lastIndex=c+1;continue}h=c+f[0].length,t.lastIndex=h}i+=e.slice(n,c)+\"[\"+\"a\".repeat(h-c-2)+\"]\",n=h}return i+e.slice(n)}function Mc(e){let t=e;if(this.tokens.links&&e.includes(\"[\")){let s=this.tokenizer.rules.inline.reflinkSearch,r=i=>{let n=i.lastIndexOf(\"[\");if(!Object.hasOwn(this.tokens.links,Pr(i.slice(n+1,-1))))return i;if(n>1&&i.charAt(0)!==\"!\"){let o=i.slice(1,n-1);if(this.linkInText(o))return\"[\"+o.replace(s,r)+\"][\"+\"a\".repeat(i.length-n-2)+\"]\"}return\"[\"+\"a\".repeat(i.length-2)+\"]\"};t=t.replace(s,r)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(s,r,i)=>i?\"+\".repeat(s.length):r?r+s.slice(r.length,-r.length).replace(/`/g,\"+\")+r:s),t=Tr(Ls,this,Oc).call(this,t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}var Rr=class{constructor(e){$e(this,\"options\",void 0),$e(this,\"parser\",void 0),this.options=e||gs}space(e){return\"\"}code({text:e,lang:t,escaped:s}){let r=(t||\"\").match(Ke.notSpaceStart)?.[0],i=e?e.replace(Ke.endingNewline,\"\")+`\n`:\"\";return r?'<pre><code class=\"language-'+bt(r)+'\">'+(s?i:bt(i,!0))+`</code></pre>\n`:\"<pre><code>\"+(s?i:bt(i,!0))+`</code></pre>\n`}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return\"\"}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return`<hr>\n`}list(e){let t=e.ordered,s=e.start,r=\"\";for(let o=0;o<e.items.length;o++){let c=e.items[o];r+=this.listitem(c)}let i=t?\"ol\":\"ul\",n=t&&s!==1?' start=\"'+s+'\"':\"\";return\"<\"+i+n+`>\n`+r+\"</\"+i+`>\n`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return\"<input \"+(e?'checked=\"\" ':\"\")+'disabled=\"\" type=\"checkbox\"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t=\"\",s=\"\";for(let i=0;i<e.header.length;i++)s+=this.tablecell(e.header[i]);t+=this.tablerow({text:s});let r=\"\";for(let i=0;i<e.rows.length;i++){let n=e.rows[i];s=\"\";for(let o=0;o<n.length;o++)s+=this.tablecell(n[o]);r+=this.tablerow({text:s})}return r&&(r=`<tbody>${r}</tbody>`),`<table>\n<thead>\n`+t+`</thead>\n`+r+`</table>\n`}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),s=e.header?\"th\":\"td\";return(e.align?`<${s} align=\"${e.align}\">`:`<${s}>`)+t+`</${s}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${bt(e,!0)}</code>`}br(e){return\"<br>\"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:s,tokens:r,autolink:i}){let n=i?bt(s,!0):this.parser.parseInline(r),o=so(e);if(o===null)return n;e=bt(o,i);let c='<a href=\"'+e+'\"';return t&&(c+=' title=\"'+bt(t)+'\"'),c+=\">\"+n+\"</a>\",c}image({href:e,title:t,text:s,tokens:r}){r&&(s=this.parser.parseInline(r,this.parser.textRenderer));let i=so(e);if(i===null)return bt(s);e=i;let n=`<img src=\"${bt(e)}\" alt=\"${bt(s)}\"`;return t&&(n+=` title=\"${bt(t)}\"`),n+=\">\",n}text(e){return\"tokens\"in e&&e.tokens?this.parser.parseInline(e.tokens):\"escaped\"in e&&e.escaped?e.text:bt(e.text)}},Ri=class{constructor(){$e(this,\"parser\",void 0)}strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return`\n`}checkbox({raw:e}){return e}},Mt=class Hn{constructor(t){$e(this,\"options\",void 0),$e(this,\"renderer\",void 0),$e(this,\"textRenderer\",void 0),this.options=t||gs,this.options.renderer=this.options.renderer||new Rr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ri,this.textRenderer.parser=this}static parse(t,s){return new Hn(s).parse(t)}static parseInline(t,s){return new Hn(s).parseInline(t)}parse(t){this.renderer.parser=this;let s=\"\";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let o=i,c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||![\"space\",\"hr\",\"heading\",\"code\",\"table\",\"blockquote\",\"list\",\"checkbox\",\"html\",\"def\",\"paragraph\",\"text\"].includes(o.type)){s+=c===!1?\"\":c??\"\";continue}}let n=i;switch(n.type){case\"space\":s+=this.renderer.space(n);break;case\"hr\":s+=this.renderer.hr(n);break;case\"heading\":s+=this.renderer.heading(n);break;case\"code\":s+=this.renderer.code(n);break;case\"table\":s+=this.renderer.table(n);break;case\"blockquote\":s+=this.renderer.blockquote(n);break;case\"list\":s+=this.renderer.list(n);break;case\"checkbox\":s+=this.renderer.checkbox(n);break;case\"html\":s+=this.renderer.html(n);break;case\"def\":s+=this.renderer.def(n);break;case\"paragraph\":s+=this.renderer.paragraph(n);break;case\"text\":s+=this.renderer.text(n);break;default:{let o='Token with \"'+n.type+'\" type was not found.';if(this.options.silent)return console.error(o),\"\";throw new Error(o)}}}return s}parseInline(t,s=this.renderer){this.renderer.parser=this;let r=\"\";for(let i=0;i<t.length;i++){let n=t[i];if(this.options.extensions?.renderers?.[n.type]){let c=this.options.extensions.renderers[n.type].call({parser:this},n);if(c!==!1||![\"escape\",\"html\",\"link\",\"image\",\"checkbox\",\"strong\",\"em\",\"codespan\",\"br\",\"del\",\"text\"].includes(n.type)){r+=c===!1?\"\":c??\"\";continue}}let o=n;switch(o.type){case\"escape\":r+=s.text(o);break;case\"html\":r+=s.html(o);break;case\"link\":r+=s.link(o);break;case\"image\":r+=s.image(o);break;case\"checkbox\":r+=s.checkbox(o);break;case\"strong\":r+=s.strong(o);break;case\"em\":r+=s.em(o);break;case\"codespan\":r+=s.codespan(o);break;case\"br\":r+=s.br(o);break;case\"del\":r+=s.del(o);break;case\"text\":r+=s.text(o);break;default:{let c='Token with \"'+o.type+'\" type was not found.';if(this.options.silent)return console.error(c),\"\";throw new Error(c)}}}return r}},er=(Cr=class{constructor(e){$e(this,\"options\",void 0),$e(this,\"block\",void 0),this.options=e||gs}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Ot.lex:Ot.lexInline}provideParser(e=this.block){return e?Mt.parse:Mt.parseInline}},$e(Cr,\"passThroughHooks\",new Set([\"preprocess\",\"postprocess\",\"processAllTokens\",\"emStrongMask\"])),$e(Cr,\"passThroughHooksRespectAsync\",new Set([\"preprocess\",\"postprocess\",\"processAllTokens\"])),Cr);function is(e,t){if(Array.isArray(t))for(let s=0;s<t.length;s++)e.push(t[s]);else e.push(t)}var Nc=class{constructor(...e){$e(this,\"defaults\",wi()),$e(this,\"options\",this.setOptions),$e(this,\"parse\",this.parseMarkdown(!0)),$e(this,\"parseInline\",this.parseMarkdown(!1)),$e(this,\"Parser\",Mt),$e(this,\"Renderer\",Rr),$e(this,\"TextRenderer\",Ri),$e(this,\"Lexer\",Ot),$e(this,\"Tokenizer\",Os),$e(this,\"Hooks\",er),this.use(...e)}walkTokens(e,t){let s=[];for(let r of e)switch(is(s,t.call(this,r)),r.type){case\"table\":{let i=r;for(let n of i.header)is(s,this.walkTokens(n.tokens,t));for(let n of i.rows)for(let o of n)is(s,this.walkTokens(o.tokens,t));break}case\"list\":{let i=r;is(s,this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(n=>{let o=i[n].flat(1/0);is(s,this.walkTokens(o,t))}):i.tokens&&is(s,this.walkTokens(i.tokens,t))}}return s}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(s=>{let r={...s};if(r.async=this.defaults.async||r.async||!1,s.extensions&&(s.extensions.forEach(i=>{if(!i.name)throw new Error(\"extension name required\");if(\"renderer\"in i){let n=t.renderers[i.name];n?t.renderers[i.name]=function(...o){let c=i.renderer.apply(this,o);return c===!1&&(c=n.apply(this,o)),c}:t.renderers[i.name]=i.renderer}if(\"tokenizer\"in i){if(!i.level||i.level!==\"block\"&&i.level!==\"inline\")throw new Error(\"extension level must be 'block' or 'inline'\");let n=t[i.level];n?n.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level===\"block\"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level===\"inline\"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}\"childTokens\"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),s.renderer){let i=this.defaults.renderer||new Rr(this.defaults);for(let n in s.renderer){if(!(n in i))throw new Error(`renderer '${n}' does not exist`);if([\"options\",\"parser\"].includes(n))continue;let o=n,c=s.renderer[o],h=i[o];i[o]=(...u)=>{let f=c.apply(i,u);return f===!1&&(f=h.apply(i,u)),f===!1?\"\":f??\"\"}}r.renderer=i}if(s.tokenizer){let i=this.defaults.tokenizer||new Os(this.defaults);for(let n in s.tokenizer){if(!(n in i))throw new Error(`tokenizer '${n}' does not exist`);if([\"options\",\"rules\",\"lexer\"].includes(n))continue;let o=n,c=s.tokenizer[o],h=i[o];i[o]=(...u)=>{let f=c.apply(i,u);return f===!1&&(f=h.apply(i,u)),f}}r.tokenizer=i}if(s.hooks){let i=this.defaults.hooks||new er;for(let n in s.hooks){if(!(n in i))throw new Error(`hook '${n}' does not exist`);if([\"options\",\"block\"].includes(n))continue;let o=n,c=s.hooks[o],h=i[o];er.passThroughHooks.has(n)?i[o]=u=>{if(i.options.async&&er.passThroughHooksRespectAsync.has(n))return(async()=>{let a=await c.call(i,u);return h.call(i,a)})();let f=c.call(i,u);return h.call(i,f)}:i[o]=(...u)=>{if(i.options.async)return(async()=>{let a=await c.apply(i,u);return a===!1&&(a=await h.apply(i,u)),a})();let f=c.apply(i,u);return f===!1&&(f=h.apply(i,u)),f}}r.hooks=i}if(s.walkTokens){let i=this.defaults.walkTokens,n=s.walkTokens;r.walkTokens=function(o){let c=[];return is(c,n.call(this,o)),i&&is(c,i.call(this,o)),c}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ot.lex(e,t??this.defaults)}parser(e,t){return Mt.parse(e,t??this.defaults)}parseMarkdown(e){return(t,s)=>{let r={...s},i={...this.defaults,...r},n=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return n(new Error(\"marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.\"));if(typeof t>\"u\"||t===null)return n(new Error(\"marked(): input parameter is undefined or null\"));if(typeof t!=\"string\")return n(new Error(\"marked(): input parameter is of type \"+Object.prototype.toString.call(t)+\", string expected\"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(t):t,c=await(i.hooks?await i.hooks.provideLexer(e):e?Ot.lex:Ot.lexInline)(o,i),h=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(h,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser(e):e?Mt.parse:Mt.parseInline)(h,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(n);try{i.hooks&&(t=i.hooks.preprocess(t));let o=(i.hooks?i.hooks.provideLexer(e):e?Ot.lex:Ot.lexInline)(t,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let c=(i.hooks?i.hooks.provideParser(e):e?Mt.parse:Mt.parseInline)(o,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(o){return n(o)}}}onError(e,t){return s=>{if(s.message+=`\nPlease report this to https://github.com/markedjs/marked.`,e){let r=\"<p>An error occurred:</p><pre>\"+bt(s.message+\"\",!0)+\"</pre>\";return t?Promise.resolve(r):r}if(t)return Promise.reject(s);throw s}}},ys=new Nc;function qe(e,t){return ys.parse(e,t)}qe.options=qe.setOptions=function(e){return ys.setOptions(e),qe.defaults=ys.defaults,Vn(qe.defaults),qe},qe.getDefaults=wi,qe.defaults=gs;function Dc(...e){return ys.use(...e),qe.defaults=ys.defaults,Vn(qe.defaults),qe}qe.use=Dc,qe.walkTokens=function(e,t){return ys.walkTokens(e,t)},qe.parseInline=ys.parseInline,qe.Parser=Mt,qe.parser=Mt.parse,qe.Renderer=Rr,qe.TextRenderer=Ri,qe.Lexer=Ot,qe.lexer=Ot.lex,qe.Tokenizer=Os,qe.Hooks=er,qe.parse=qe;var tf=qe.options,sf=qe.setOptions,rf=qe.walkTokens,Ii=qe.parseInline,Oi=qe,nf=Mt.parse,of=Ot.lex,ht=de((e=>{e.__esModule=!0,e.extend=n,e.indexOf=u,e.escapeExpression=f,e.isEmpty=a,e.createFrame=d,e.blockParams=l,e.appendContextPath=g;var t={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\",\"`\":\"`\",\"=\":\"=\"},s=/[&<>\"'`=]/g,r=/[&<>\"'`=]/;function i(m){return t[m]}function n(m){for(var y=1;y<arguments.length;y++)for(var _ in arguments[y])Object.prototype.hasOwnProperty.call(arguments[y],_)&&(m[_]=arguments[y][_]);return m}var o=Object.prototype.toString;e.toString=o;var c=function(y){return typeof y==\"function\"};c(/x/)&&(e.isFunction=c=function(m){return typeof m==\"function\"&&o.call(m)===\"[object Function]\"}),e.isFunction=c;var h=Array.isArray||function(m){return m&&typeof m==\"object\"?o.call(m)===\"[object Array]\":!1};e.isArray=h;function u(m,y){for(var _=0,w=m.length;_<w;_++)if(m[_]===y)return _;return-1}function f(m){if(typeof m!=\"string\"){if(m&&typeof m.toHTML==\"function\")return m.toHTML();if(m==null)return\"\";if(!m)return m+\"\";m=\"\"+m}return r.test(m)?m.replace(s,i):m}function a(m){return!m&&m!==0?!0:!!(h(m)&&m.length===0)}function d(m){var y=n({},m);return y._parent=m,y}function l(m,y){return m.path=y,m}function g(m,y){return(m?m+\".\":\"\")+y}})),Nt=de(((e,t)=>{e.__esModule=!0;var s=[\"description\",\"fileName\",\"lineNumber\",\"endLineNumber\",\"message\",\"name\",\"number\",\"stack\"];function r(i,n){var o=n&&n.loc,c=void 0,h=void 0,u=void 0,f=void 0;o&&o.start&&(c=o.start.line,u=o.start.column,o.end&&(h=o.end.line,f=o.end.column),i+=\" - \"+c+\":\"+u);for(var a=Error.prototype.constructor.call(this,i),d=0;d<s.length;d++)this[s[d]]=a[s[d]];Error.captureStackTrace&&Error.captureStackTrace(this,r);try{o&&(this.lineNumber=c,this.endLineNumber=h,Object.defineProperty?(Object.defineProperty(this,\"column\",{value:u,enumerable:!0}),Object.defineProperty(this,\"endColumn\",{value:f,enumerable:!0})):(this.column=u,this.endColumn=f))}catch{}}r.prototype=new Error,e.default=r,t.exports=e.default})),$c=de(((e,t)=>{e.__esModule=!0;var s=ht();e.default=function(r){r.registerHelper(\"blockHelperMissing\",function(i,n){var o=n.inverse,c=n.fn;if(i===!0)return c(this);if(i===!1||i==null)return o(this);if(s.isArray(i))return i.length>0?(n.ids&&(n.ids=[n.name]),r.helpers.each(i,n)):o(this);if(n.data&&n.ids){var h=s.createFrame(n.data);h.contextPath=s.appendContextPath(n.data.contextPath,n.name),n={data:h}}return c(i,n)})},t.exports=e.default})),qc=de(((e,t)=>{e.__esModule=!0;function s(o){return o&&o.__esModule?o:{default:o}}var r=ht(),i=s(Nt());function n(o){try{var c=o.return;r.isFunction(c)&&c.call(o)}catch{}}e.default=function(o){o.registerHelper(\"each\",function(c,h){if(!h)throw new i.default(\"Must pass iterator to #each\");var u=h.fn,f=h.inverse,a=0,d=\"\",l=void 0,g=void 0;h.data&&h.ids&&(g=r.appendContextPath(h.data.contextPath,h.ids[0])+\".\"),r.isFunction(c)&&(c=c.call(this)),h.data&&(l=r.createFrame(h.data));function m(v,p,b,k){l&&(l.key=v,l.index=p,l.first=p===0,l.last=!!b,g&&(l.contextPath=g+v)),d=d+u(k,{data:l,blockParams:r.blockParams([k,v],[g+v,null])})}if(c&&typeof c==\"object\")if(r.isArray(c))for(var y=c.length;a<y;a++)a in c&&m(a,a,a===c.length-1,c[a]);else if(typeof Symbol==\"function\"&&c[Symbol.iterator])for(var _=c[Symbol.iterator](),w=_.next();!w.done;){var S=_.next();try{m(a,a,S.done,w.value)}catch(v){throw S.done||n(_),v}w=S,a++}else(function(){var v=void 0;Object.keys(c).forEach(function(p){v!==void 0&&m(v,a-1,!1,c[v]),v=p,a++}),v!==void 0&&m(v,a-1,!0,c[v])})();return a===0&&(d=f(this)),d})},t.exports=e.default})),Bc=de(((e,t)=>{e.__esModule=!0;function s(i){return i&&i.__esModule?i:{default:i}}var r=s(Nt());e.default=function(i){i.registerHelper(\"helperMissing\",function(){if(arguments.length!==1)throw new r.default('Missing helper: \"'+arguments[arguments.length-1].name+'\"')})},t.exports=e.default})),Hc=de(((e,t)=>{e.__esModule=!0;function s(n){return n&&n.__esModule?n:{default:n}}var r=ht(),i=s(Nt());e.default=function(n){n.registerHelper(\"if\",function(o,c){if(arguments.length!=2)throw new i.default(\"#if requires exactly one argument\");return r.isFunction(o)&&(o=o.call(this)),!c.hash.includeZero&&!o||r.isEmpty(o)?c.inverse(this):c.fn(this)}),n.registerHelper(\"unless\",function(o,c){if(arguments.length!=2)throw new i.default(\"#unless requires exactly one argument\");return n.helpers.if.call(this,o,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},t.exports=e.default})),Fc=de(((e,t)=>{e.__esModule=!0,e.default=function(s){s.registerHelper(\"log\",function(){for(var r=[void 0],i=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)r.push(arguments[n]);var o=1;i.hash.level!=null?o=i.hash.level:i.data&&i.data.level!=null&&(o=i.data.level),r[0]=o,s.log.apply(s,r)})},t.exports=e.default})),Vc=de(((e,t)=>{e.__esModule=!0,e.default=function(s){s.registerHelper(\"lookup\",function(r,i,n){return r&&n.lookupProperty(r,i)})},t.exports=e.default})),zc=de(((e,t)=>{e.__esModule=!0;function s(n){return n&&n.__esModule?n:{default:n}}var r=ht(),i=s(Nt());e.default=function(n){n.registerHelper(\"with\",function(o,c){if(arguments.length!=2)throw new i.default(\"#with requires exactly one argument\");r.isFunction(o)&&(o=o.call(this));var h=c.fn;if(r.isEmpty(o))return c.inverse(this);var u=c.data;return c.data&&c.ids&&(u=r.createFrame(c.data),u.contextPath=r.appendContextPath(c.data.contextPath,c.ids[0])),h(o,{data:u,blockParams:r.blockParams([o],[u&&u.contextPath])})})},t.exports=e.default})),lo=de((e=>{e.__esModule=!0,e.registerDefaultHelpers=u,e.moveHelperToHooks=f;function t(a){return a&&a.__esModule?a:{default:a}}var s=t($c()),r=t(qc()),i=t(Bc()),n=t(Hc()),o=t(Fc()),c=t(Vc()),h=t(zc());function u(a){s.default(a),r.default(a),i.default(a),n.default(a),o.default(a),c.default(a),h.default(a)}function f(a,d,l){a.helpers[d]&&(a.hooks[d]=a.helpers[d],l||(a.helpers[d]=void 0))}})),Uc=de(((e,t)=>{e.__esModule=!0;var s=ht();e.default=function(r){r.registerDecorator(\"inline\",function(i,n,o,c){var h=i;return n.partials||(n.partials={},h=function(u,f){var a=o.partials;o.partials=s.extend({},a,n.partials);var d=i(u,f);return o.partials=a,d}),n.partials[c.args[0]]=c.fn,h})},t.exports=e.default})),Wc=de((e=>{e.__esModule=!0,e.registerDefaultDecorators=r;function t(i){return i&&i.__esModule?i:{default:i}}var s=t(Uc());function r(i){s.default(i)}})),co=de(((e,t)=>{e.__esModule=!0;var s=ht(),r={methodMap:[\"debug\",\"info\",\"warn\",\"error\"],level:\"info\",lookupLevel:function(n){if(typeof n==\"string\"){var o=s.indexOf(r.methodMap,n.toLowerCase());o>=0?n=o:n=parseInt(n,10)}return n},log:function(n){if(n=r.lookupLevel(n),typeof console<\"u\"&&r.lookupLevel(r.level)<=n){var o=r.methodMap[n];console[o]||(o=\"log\");for(var c=arguments.length,h=Array(c>1?c-1:0),u=1;u<c;u++)h[u-1]=arguments[u];console[o].apply(console,h)}}};e.default=r,t.exports=e.default})),uo=de((e=>{e.__esModule=!0,e.createProtoAccessControl=n,e.resultIsAllowed=o,e.isPrototypeConstructor=c,e.resetLoggedProperties=f;function t(a){return a&&a.__esModule?a:{default:a}}var s=ht(),r=t(co()),i=Object.create(null);function n(a){var d=Object.create(null);d.__proto__=!1,s.extend(d,a.allowedProtoProperties);var l=Object.create(null);return l.constructor=!1,l.__defineGetter__=!1,l.__defineSetter__=!1,l.__lookupGetter__=!1,l.__lookupSetter__=!1,s.extend(l,a.allowedProtoMethods),{properties:{whitelist:d,defaultValue:a.allowProtoPropertiesByDefault},methods:{whitelist:l,defaultValue:a.allowProtoMethodsByDefault}}}function o(a,d,l){return h(typeof a==\"function\"?d.methods:d.properties,l)}function c(a,d,l){return d===\"constructor\"&&typeof l==\"function\"&&a===l.prototype}function h(a,d){return a.whitelist[d]!==void 0?a.whitelist[d]===!0:a.defaultValue!==void 0?a.defaultValue:(u(d),!1)}function u(a){i[a]!==!0&&(i[a]=!0,r.default.log(\"error\",'Handlebars: Access has been denied to resolve the property \"'+a+`\" because it is not an \"own property\" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function f(){Object.keys(i).forEach(function(a){delete i[a]})}})),Mi=de((e=>{e.__esModule=!0,e.HandlebarsEnvironment=l;function t(m){return m&&m.__esModule?m:{default:m}}var s=ht(),r=t(Nt()),i=lo(),n=Wc(),o=t(co()),c=uo(),h=\"4.7.10\";e.VERSION=h;var u=8;e.COMPILER_REVISION=u;var f=7;e.LAST_COMPATIBLE_COMPILER_REVISION=f;var a={1:\"<= 1.0.rc.2\",2:\"== 1.0.0-rc.3\",3:\"== 1.0.0-rc.4\",4:\"== 1.x.x\",5:\"== 2.0.0-alpha.x\",6:\">= 2.0.0-beta.1\",7:\">= 4.0.0 <4.3.0\",8:\">= 4.3.0\"};e.REVISION_CHANGES=a;var d=\"[object Object]\";function l(m,y,_){this.helpers=m||{},this.partials=y||{},this.decorators=_||{},i.registerDefaultHelpers(this),n.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:o.default,log:o.default.log,registerHelper:function(y,_){if(s.toString.call(y)===d){if(_)throw new r.default(\"Arg not supported with multiple helpers\");s.extend(this.helpers,y)}else this.helpers[y]=_},unregisterHelper:function(y){delete this.helpers[y]},registerPartial:function(y,_){if(s.toString.call(y)===d)s.extend(this.partials,y);else{if(typeof _>\"u\")throw new r.default('Attempting to register a partial called \"'+y+'\" as undefined');this.partials[y]=_}},unregisterPartial:function(y){delete this.partials[y]},registerDecorator:function(y,_){if(s.toString.call(y)===d){if(_)throw new r.default(\"Arg not supported with multiple decorators\");s.extend(this.decorators,y)}else this.decorators[y]=_},unregisterDecorator:function(y){delete this.decorators[y]},resetLoggedPropertyAccesses:function(){c.resetLoggedProperties()}};var g=o.default.log;e.log=g,e.createFrame=s.createFrame,e.logger=o.default})),Gc=de(((e,t)=>{e.__esModule=!0;function s(r){this.string=r}s.prototype.toString=s.prototype.toHTML=function(){return\"\"+this.string},e.default=s,t.exports=e.default})),Xc=de((e=>{e.__esModule=!0,e.wrapHelper=t;function t(s,r){return typeof s!=\"function\"?s:function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=r(n),s.apply(this,arguments)}}})),jc=de((e=>{e.__esModule=!0,e.checkRevision=u,e.template=f,e.wrapProgram=a,e.resolvePartial=d,e.invokePartial=l,e.noop=g;function t(v){return v&&v.__esModule?v:{default:v}}function s(v){if(v&&v.__esModule)return v;var p={};if(v!=null)for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(p[b]=v[b]);return p.default=v,p}var r=s(ht()),i=t(Nt()),n=Mi(),o=lo(),c=Xc(),h=uo();function u(v){var p=v&&v[0]||1,b=n.COMPILER_REVISION;if(!(p>=n.LAST_COMPATIBLE_COMPILER_REVISION&&p<=n.COMPILER_REVISION))if(p<n.LAST_COMPATIBLE_COMPILER_REVISION){var k=n.REVISION_CHANGES[b],T=n.REVISION_CHANGES[p];throw new i.default(\"Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (\"+k+\") or downgrade your runtime to an older version (\"+T+\").\")}else throw new i.default(\"Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (\"+v[1]+\").\")}function f(v,p){if(!p)throw new i.default(\"No environment passed to template\");if(!v||!v.main)throw new i.default(\"Unknown template object: \"+typeof v);v.main.decorator=v.main_d,p.VM.checkRevision(v.compiler);var b=v.compiler&&v.compiler[0]===7;function k(P,O,I){I.hash&&(O=r.extend({},O,I.hash),I.ids&&(I.ids[0]=!0)),P=p.VM.resolvePartial.call(this,P,O,I),I.hooks=this.hooks,I.protoAccessControl=this.protoAccessControl;var q=p.VM.invokePartial.call(this,P,O,I);if(q==null&&r.isFunction(P))throw new i.default(\"The partial \"+I.name+\" returned no output: partials must return a string\");if(q==null&&p.compile){if(typeof P!=\"string\")throw new i.default(\"The partial \"+I.name+\" could not be compiled: partials must be strings or functions returning strings\");I.partials[I.name]=p.compile(P,v.compilerOptions,p),q=I.partials[I.name](O,I)}if(q!=null){if(I.indent){for(var B=q.split(`\n`),W=0,E=B.length;W<E&&!(!B[W]&&W+1===E);W++)B[W]=I.indent+B[W];q=B.join(`\n`)}return q}else throw new i.default(\"The partial \"+I.name+\" could not be compiled when running in runtime-only mode\")}var T={strict:function(O,I,q){if(!O||!(I in O))throw new i.default('\"'+I+'\" not defined in '+O,{loc:q});return T.lookupProperty(O,I)},lookupProperty:function(O,I){var q=O[I];if(q==null||Object.prototype.hasOwnProperty.call(O,I)&&!h.isPrototypeConstructor(O,I,q)||h.resultIsAllowed(q,T.protoAccessControl,I))return q},lookup:function(O,I){for(var q=O.length,B=0;B<q;B++){var W=O[B]&&T.lookupProperty(O[B],I);if(W!=null)return W}},lambda:function(O,I){return typeof O==\"function\"?O.call(I):O},escapeExpression:r.escapeExpression,invokePartial:k,fn:function(O){var I=v[O];return I.decorator=v[O+\"_d\"],I},programs:[],program:function(O,I,q,B,W){var E=this.programs[O],N=this.fn(O);return I||W||B||q?E=a(this,O,N,I,q,B,W):E||(E=this.programs[O]=a(this,O,N)),E},data:function(O,I){for(;O&&I--;)O=O._parent;return O},mergeIfNeeded:function(O,I){var q=O||I;return O&&I&&O!==I&&(q=r.extend({},I,O)),q},nullContext:Object.seal({}),noop:p.VM.noop,compilerInfo:v.compiler};function R(P){var O=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],I=O.data;R._setup(O),!O.partial&&v.useData&&(I=y(P,I));var q=void 0,B=v.useBlockParams?[]:void 0;v.useDepths&&(O.depths?q=P!=O.depths[0]?[P].concat(O.depths):O.depths:q=[P]);function W(E){return\"\"+v.main(T,E,T.helpers,T.partials,I,B,q)}return W=_(v.main,W,T,O.depths||[],I,B),W(P,O)}return R.isTop=!0,R._setup=function(P){if(P.partial)T.protoAccessControl=P.protoAccessControl,T.helpers=P.helpers,T.partials=P.partials,T.decorators=P.decorators,T.hooks=P.hooks;else{var O={};w(O,p.helpers,T),w(O,P.helpers,T),T.helpers=O,v.usePartial&&(T.partials=T.mergeIfNeeded(P.partials,p.partials)),(v.usePartial||v.useDecorators)&&(T.decorators=r.extend({},p.decorators,P.decorators)),T.hooks={},T.protoAccessControl=h.createProtoAccessControl(P);var I=P.allowCallsToHelperMissing||b;o.moveHelperToHooks(T,\"helperMissing\",I),o.moveHelperToHooks(T,\"blockHelperMissing\",I)}},R._child=function(P,O,I,q){if(v.useBlockParams&&!I)throw new i.default(\"must pass block params\");if(v.useDepths&&!q)throw new i.default(\"must pass parent depths\");return a(T,P,v[P],O,0,I,q)},R}function a(v,p,b,k,T,R,P){function O(I){var q=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],B=P;return P&&I!=P[0]&&!(I===v.nullContext&&P[0]===null)&&(B=[I].concat(P)),b(v,I,v.helpers,v.partials,q.data||k,R&&[q.blockParams].concat(R),B)}return O=_(b,O,v,P,k,R),O.program=p,O.depth=P?P.length:0,O.blockParams=T||0,O}function d(v,p,b){return v?typeof v!=\"function\"&&!b.name&&(b.name=v,v=m(b.partials,v)):b.name===\"@partial-block\"?v=m(b.data,\"partial-block\"):v=m(b.partials,b.name),v}function l(v,p,b){var k=m(b.data,\"partial-block\");b.partial=!0,b.ids&&(b.data.contextPath=b.ids[0]||b.data.contextPath);var T=void 0;if(b.fn&&b.fn!==g&&(function(){b.data=n.createFrame(b.data);var R=b.fn;T=b.data[\"partial-block\"]=function(O){var I=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return I.data=n.createFrame(I.data),I.data[\"partial-block\"]=k,R(O,I)},R.partials&&(b.partials=r.extend({},b.partials,R.partials))})(),v===void 0&&T&&(v=T),v===void 0)throw new i.default(\"The partial \"+b.name+\" could not be found\");if(v instanceof Function)return v(p,b)}function g(){return\"\"}function m(v,p){if(v&&Object.prototype.hasOwnProperty.call(v,p))return v[p]}function y(v,p){return(!p||!(\"root\"in p))&&(p=p?n.createFrame(p):{},p.root=v),p}function _(v,p,b,k,T,R){if(v.decorator){var P={};p=v.decorator(p,P,b,k&&k[0],T,R,k),r.extend(p,P)}return p}function w(v,p,b){p&&Object.keys(p).forEach(function(k){var T=p[k];v[k]=S(T,b)})}function S(v,p){var b=p.lookupProperty;return c.wrapHelper(v,function(k){return k.lookupProperty=b,k})}})),ho=de(((e,t)=>{e.__esModule=!0,e.default=function(s){(function(){typeof globalThis!=\"object\"&&(Object.prototype.__defineGetter__(\"__magic__\",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var r=globalThis.Handlebars;s.noConflict=function(){return globalThis.Handlebars===s&&(globalThis.Handlebars=r),s}},t.exports=e.default})),Yc=de(((e,t)=>{e.__esModule=!0;function s(d){return d&&d.__esModule?d:{default:d}}function r(d){if(d&&d.__esModule)return d;var l={};if(d!=null)for(var g in d)Object.prototype.hasOwnProperty.call(d,g)&&(l[g]=d[g]);return l.default=d,l}var i=r(Mi()),n=s(Gc()),o=s(Nt()),c=r(ht()),h=r(jc()),u=s(ho());function f(){var d=new i.HandlebarsEnvironment;return c.extend(d,i),d.SafeString=n.default,d.Exception=o.default,d.Utils=c,d.escapeExpression=c.escapeExpression,d.VM=h,d.template=function(l){return h.template(l,d)},d}var a=f();a.create=f,u.default(a),a.default=a,e.default=a,t.exports=e.default})),fo=de(((e,t)=>{e.__esModule=!0;var s={helpers:{helperExpression:function(i){return i.type===\"SubExpression\"||(i.type===\"MustacheStatement\"||i.type===\"BlockStatement\")&&!!(i.params&&i.params.length||i.hash)},scopedId:function(i){return/^\\.|this\\b/.test(i.original)},simpleId:function(i){return i.parts.length===1&&!s.helpers.scopedId(i)&&!i.depth}}};e.default=s,t.exports=e.default})),Zc=de(((e,t)=>{e.__esModule=!0;var s=(function(){var r={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:\"error\",5:\"EOF\",14:\"COMMENT\",15:\"CONTENT\",18:\"END_RAW_BLOCK\",19:\"OPEN_RAW_BLOCK\",23:\"CLOSE_RAW_BLOCK\",29:\"OPEN_BLOCK\",33:\"CLOSE\",34:\"OPEN_INVERSE\",39:\"OPEN_INVERSE_CHAIN\",44:\"INVERSE\",47:\"OPEN_ENDBLOCK\",48:\"OPEN\",51:\"OPEN_UNESCAPED\",54:\"CLOSE_UNESCAPED\",55:\"OPEN_PARTIAL\",60:\"OPEN_PARTIAL_BLOCK\",65:\"OPEN_SEXPR\",68:\"CLOSE_SEXPR\",72:\"ID\",73:\"EQUALS\",75:\"OPEN_BLOCK_PARAMS\",77:\"CLOSE_BLOCK_PARAMS\",80:\"STRING\",81:\"NUMBER\",82:\"BOOLEAN\",83:\"UNDEFINED\",84:\"NULL\",85:\"DATA\",87:\"SEP\"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(o,c,h,u,f,a,d){var l=a.length-1;switch(f){case 1:return a[l-1];case 2:this.$=u.prepareProgram(a[l]);break;case 3:this.$=a[l];break;case 4:this.$=a[l];break;case 5:this.$=a[l];break;case 6:this.$=a[l];break;case 7:this.$=a[l];break;case 8:this.$=a[l];break;case 9:this.$={type:\"CommentStatement\",value:u.stripComment(a[l]),strip:u.stripFlags(a[l],a[l]),loc:u.locInfo(this._$)};break;case 10:this.$={type:\"ContentStatement\",original:a[l],value:a[l],loc:u.locInfo(this._$)};break;case 11:this.$=u.prepareRawBlock(a[l-2],a[l-1],a[l],this._$);break;case 12:this.$={path:a[l-3],params:a[l-2],hash:a[l-1]};break;case 13:this.$=u.prepareBlock(a[l-3],a[l-2],a[l-1],a[l],!1,this._$);break;case 14:this.$=u.prepareBlock(a[l-3],a[l-2],a[l-1],a[l],!0,this._$);break;case 15:this.$={open:a[l-5],path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:u.stripFlags(a[l-5],a[l])};break;case 16:this.$={path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:u.stripFlags(a[l-5],a[l])};break;case 17:this.$={path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:u.stripFlags(a[l-5],a[l])};break;case 18:this.$={strip:u.stripFlags(a[l-1],a[l-1]),program:a[l]};break;case 19:var g=u.prepareBlock(a[l-2],a[l-1],a[l],a[l],!1,this._$),m=u.prepareProgram([g],a[l-1].loc);m.chained=!0,this.$={strip:a[l-2].strip,program:m,chain:!0};break;case 20:this.$=a[l];break;case 21:this.$={path:a[l-1],strip:u.stripFlags(a[l-2],a[l])};break;case 22:this.$=u.prepareMustache(a[l-3],a[l-2],a[l-1],a[l-4],u.stripFlags(a[l-4],a[l]),this._$);break;case 23:this.$=u.prepareMustache(a[l-3],a[l-2],a[l-1],a[l-4],u.stripFlags(a[l-4],a[l]),this._$);break;case 24:this.$={type:\"PartialStatement\",name:a[l-3],params:a[l-2],hash:a[l-1],indent:\"\",strip:u.stripFlags(a[l-4],a[l]),loc:u.locInfo(this._$)};break;case 25:this.$=u.preparePartialBlock(a[l-2],a[l-1],a[l],this._$);break;case 26:this.$={path:a[l-3],params:a[l-2],hash:a[l-1],strip:u.stripFlags(a[l-4],a[l])};break;case 27:this.$=a[l];break;case 28:this.$=a[l];break;case 29:this.$={type:\"SubExpression\",path:a[l-3],params:a[l-2],hash:a[l-1],loc:u.locInfo(this._$)};break;case 30:this.$={type:\"Hash\",pairs:a[l],loc:u.locInfo(this._$)};break;case 31:this.$={type:\"HashPair\",key:u.id(a[l-2]),value:a[l],loc:u.locInfo(this._$)};break;case 32:this.$=u.id(a[l-1]);break;case 33:this.$=a[l];break;case 34:this.$=a[l];break;case 35:this.$={type:\"StringLiteral\",value:a[l],original:a[l],loc:u.locInfo(this._$)};break;case 36:this.$={type:\"NumberLiteral\",value:Number(a[l]),original:Number(a[l]),loc:u.locInfo(this._$)};break;case 37:this.$={type:\"BooleanLiteral\",value:a[l]===\"true\",original:a[l]===\"true\",loc:u.locInfo(this._$)};break;case 38:this.$={type:\"UndefinedLiteral\",original:void 0,value:void 0,loc:u.locInfo(this._$)};break;case 39:this.$={type:\"NullLiteral\",original:null,value:null,loc:u.locInfo(this._$)};break;case 40:this.$=a[l];break;case 41:this.$=a[l];break;case 42:this.$=u.preparePath(!0,a[l],this._$);break;case 43:this.$=u.preparePath(!1,a[l],this._$);break;case 44:a[l-2].push({part:u.id(a[l]),original:a[l],separator:a[l-1]}),this.$=a[l-2];break;case 45:this.$=[{part:u.id(a[l]),original:a[l]}];break;case 46:this.$=[];break;case 47:a[l-1].push(a[l]);break;case 48:this.$=[];break;case 49:a[l-1].push(a[l]);break;case 50:this.$=[];break;case 51:a[l-1].push(a[l]);break;case 58:this.$=[];break;case 59:a[l-1].push(a[l]);break;case 64:this.$=[];break;case 65:a[l-1].push(a[l]);break;case 70:this.$=[];break;case 71:a[l-1].push(a[l]);break;case 78:this.$=[];break;case 79:a[l-1].push(a[l]);break;case 82:this.$=[];break;case 83:a[l-1].push(a[l]);break;case 86:this.$=[];break;case 87:a[l-1].push(a[l]);break;case 90:this.$=[];break;case 91:a[l-1].push(a[l]);break;case 94:this.$=[];break;case 95:a[l-1].push(a[l]);break;case 98:this.$=[a[l]];break;case 99:a[l-1].push(a[l]);break;case 100:this.$=[a[l]];break;case 101:a[l-1].push(a[l])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(o,c){throw new Error(o)},parse:function(o){var c=this,h=[0],u=[null],f=[],a=this.table,d=\"\",l=0,g=0,m=0;this.lexer.setInput(o),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>\"u\"&&(this.lexer.yylloc={});var y=this.lexer.yylloc;f.push(y);var _=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError==\"function\"&&(this.parseError=this.yy.parseError);function w(){var B=c.lexer.lex()||1;return typeof B!=\"number\"&&(B=c.symbols_[B]||B),B}for(var S,v,p,b,k,T={},R,P,O,I;;){if(p=h[h.length-1],this.defaultActions[p]?b=this.defaultActions[p]:((S===null||typeof S>\"u\")&&(S=w()),b=a[p]&&a[p][S]),typeof b>\"u\"||!b.length||!b[0]){var q=\"\";if(!m){I=[];for(R in a[p])this.terminals_[R]&&R>2&&I.push(\"'\"+this.terminals_[R]+\"'\");this.lexer.showPosition?q=\"Parse error on line \"+(l+1)+`:\n`+this.lexer.showPosition()+`\nExpecting `+I.join(\", \")+\", got '\"+(this.terminals_[S]||S)+\"'\":q=\"Parse error on line \"+(l+1)+\": Unexpected \"+(S==1?\"end of input\":\"'\"+(this.terminals_[S]||S)+\"'\"),this.parseError(q,{text:this.lexer.match,token:this.terminals_[S]||S,line:this.lexer.yylineno,loc:y,expected:I})}}if(b[0]instanceof Array&&b.length>1)throw new Error(\"Parse Error: multiple actions possible at state: \"+p+\", token: \"+S);switch(b[0]){case 1:h.push(S),u.push(this.lexer.yytext),f.push(this.lexer.yylloc),h.push(b[1]),S=null,v?(S=v,v=null):(g=this.lexer.yyleng,d=this.lexer.yytext,l=this.lexer.yylineno,y=this.lexer.yylloc,m>0&&m--);break;case 2:if(P=this.productions_[b[1]][1],T.$=u[u.length-P],T._$={first_line:f[f.length-(P||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(P||1)].first_column,last_column:f[f.length-1].last_column},_&&(T._$.range=[f[f.length-(P||1)].range[0],f[f.length-1].range[1]]),k=this.performAction.call(T,d,g,l,this.yy,b[1],u,f),typeof k<\"u\")return k;P&&(h=h.slice(0,-1*P*2),u=u.slice(0,-1*P),f=f.slice(0,-1*P)),h.push(this.productions_[b[1]][0]),u.push(T.$),f.push(T._$),O=a[h[h.length-2]][h[h.length-1]],h.push(O);break;case 3:return!0}}return!0}};r.lexer=(function(){var n={EOF:1,parseError:function(c,h){if(this.yy.parser)this.yy.parser.parseError(c,h);else throw new Error(c)},setInput:function(c){return this._input=c,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=\"\",this.conditionStack=[\"INITIAL\"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var c=this._input[0];return this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c,c.match(/(?:\\r\\n?|\\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},unput:function(c){var h=c.length,u=c.split(/(?:\\r\\n?|\\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h-1),this.offset-=h;var f=this.match.split(/(?:\\r\\n?|\\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===f.length?this.yylloc.first_column:0)+f[f.length-u.length].length-u[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-h]),this},more:function(){return this._more=!0,this},less:function(c){this.unput(this.match.slice(c))},pastInput:function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?\"...\":\"\")+c.substr(-20).replace(/\\n/g,\"\")},upcomingInput:function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?\"...\":\"\")).replace(/\\n/g,\"\")},showPosition:function(){var c=this.pastInput(),h=new Array(c.length+1).join(\"-\");return c+this.upcomingInput()+`\n`+h+\"^\"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,h,u,f,a;this._more||(this.yytext=\"\",this.match=\"\");for(var d=this._currentRules(),l=0;l<d.length&&(u=this._input.match(this.rules[d[l]]),!(u&&(!h||u[0].length>h[0].length)&&(h=u,f=l,!this.options.flex)));l++);return h?(a=h[0].match(/(?:\\r\\n?|\\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\\r?\\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(h[0].length),this.matched+=h[0],c=this.performAction.call(this,this.yy,this,d[f],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c||void 0):this._input===\"\"?this.EOF:this.parseError(\"Lexical error on line \"+(this.yylineno+1)+`. Unrecognized text.\n`+this.showPosition(),{text:\"\",token:null,line:this.yylineno})},lex:function(){var c=this.next();return typeof c<\"u\"?c:this.lex()},begin:function(c){this.conditionStack.push(c)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(c){this.begin(c)}};return n.options={},n.performAction=function(c,h,u,f){function a(d,l){return h.yytext=h.yytext.substring(d,h.yyleng-l+d)}switch(u){case 0:if(h.yytext.slice(-2)===\"\\\\\\\\\"?(a(0,1),this.begin(\"mu\")):h.yytext.slice(-1)===\"\\\\\"?(a(0,1),this.begin(\"emu\")):this.begin(\"mu\"),h.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin(\"raw\"),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]===\"raw\"?15:(a(5,9),\"END_RAW_BLOCK\");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin(\"raw\"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(h.yytext),this.popState(),this.begin(\"com\");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return h.yytext=a(1,2).replace(/\\\\\"/g,'\"'),80;case 32:return h.yytext=a(1,2).replace(/\\\\'/g,\"'\"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return h.yytext=h.yytext.replace(/\\\\([\\\\\\]])/g,\"$1\"),72;case 43:return\"INVALID\";case 44:return 5}},n.rules=[/^(?:[^\\x00]*?(?=(\\{\\{)))/,/^(?:[^\\x00]+)/,/^(?:[^\\x00]{2,}?(?=(\\{\\{|\\\\\\{\\{|\\\\\\\\\\{\\{|$)))/,/^(?:\\{\\{\\{\\{(?=[^\\/]))/,/^(?:\\{\\{\\{\\{\\/[^\\s!\"#%-,\\.\\/;->@\\[-\\^`\\{-~]+(?=[=}\\s\\/.])\\}\\}\\}\\})/,/^(?:[^\\x00]+?(?=(\\{\\{\\{\\{)))/,/^(?:[\\s\\S]*?--(~)?\\}\\})/,/^(?:\\()/,/^(?:\\))/,/^(?:\\{\\{\\{\\{)/,/^(?:\\}\\}\\}\\})/,/^(?:\\{\\{(~)?>)/,/^(?:\\{\\{(~)?#>)/,/^(?:\\{\\{(~)?#\\*?)/,/^(?:\\{\\{(~)?\\/)/,/^(?:\\{\\{(~)?\\^\\s*(~)?\\}\\})/,/^(?:\\{\\{(~)?\\s*else\\s*(~)?\\}\\})/,/^(?:\\{\\{(~)?\\^)/,/^(?:\\{\\{(~)?\\s*else\\b)/,/^(?:\\{\\{(~)?\\{)/,/^(?:\\{\\{(~)?&)/,/^(?:\\{\\{(~)?!--)/,/^(?:\\{\\{(~)?![\\s\\S]*?\\}\\})/,/^(?:\\{\\{(~)?\\*?)/,/^(?:=)/,/^(?:\\.\\.)/,/^(?:\\.(?=([=~}\\s\\/.)|])))/,/^(?:[\\/.])/,/^(?:\\s+)/,/^(?:\\}(~)?\\}\\})/,/^(?:(~)?\\}\\})/,/^(?:\"(\\\\[\"]|[^\"])*\")/,/^(?:'(\\\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\\s)])))/,/^(?:false(?=([~}\\s)])))/,/^(?:undefined(?=([~}\\s)])))/,/^(?:null(?=([~}\\s)])))/,/^(?:-?[0-9]+(?:\\.[0-9]+)?(?=([~}\\s)])))/,/^(?:as\\s+\\|)/,/^(?:\\|)/,/^(?:([^\\s!\"#%-,\\.\\/;->@\\[-\\^`\\{-~]+(?=([=~}\\s\\/.)|]))))/,/^(?:\\[(\\\\\\]|[^\\]])*\\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n})();function i(){this.yy={}}return i.prototype=r,r.Parser=i,new i})();e.default=s,t.exports=e.default})),po=de((e=>{e.__esModule=!0;var t=[\"Program\",\"BlockStatement\",\"DecoratorBlock\",\"PartialStatement\",\"PartialBlockStatement\",\"Decorator\",\"MustacheStatement\",\"ContentStatement\",\"CommentStatement\",\"SubExpression\",\"PathExpression\",\"StringLiteral\",\"NumberLiteral\",\"BooleanLiteral\",\"UndefinedLiteral\",\"NullLiteral\",\"Hash\",\"HashPair\"];e.NODE_TYPES=t})),go=de(((e,t)=>{e.__esModule=!0;function s(a){return a&&a.__esModule?a:{default:a}}var r=s(Nt()),i=ht(),n=po();function o(){this.parents=[]}function c(a,d){return i.indexOf(n.NODE_TYPES,d)!==-1||!(d in o.prototype)&&typeof a[d]==\"function\"}o.prototype={constructor:o,mutating:!1,acceptKey:function(d,l){var g=this.accept(d[l]);if(this.mutating){if(g&&!c(this,g.type))throw new r.default('Unexpected node type \"'+g.type+'\" found when accepting '+l+\" on \"+d.type);d[l]=g}},acceptRequired:function(d,l){if(this.acceptKey(d,l),!d[l])throw new r.default(d.type+\" requires \"+l)},acceptArray:function(d){for(var l=0,g=d.length;l<g;l++)this.acceptKey(d,l),d[l]||(d.splice(l,1),l--,g--)},accept:function(d){if(d){if(!c(this,d.type)||!this[d.type])throw new r.default(\"Unknown type: \"+d.type,d);this.current&&this.parents.unshift(this.current),this.current=d;var l=this[d.type](d);if(this.current=this.parents.shift(),!this.mutating||l)return l;if(l!==!1)return d}},Program:function(d){this.acceptArray(d.body)},MustacheStatement:h,Decorator:h,BlockStatement:u,DecoratorBlock:u,PartialStatement:f,PartialBlockStatement:function(d){f.call(this,d),this.acceptKey(d,\"program\")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:h,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(d){this.acceptArray(d.pairs)},HashPair:function(d){this.acceptRequired(d,\"value\")}};function h(a){this.acceptRequired(a,\"path\"),this.acceptArray(a.params),this.acceptKey(a,\"hash\")}function u(a){h.call(this,a),this.acceptKey(a,\"program\"),this.acceptKey(a,\"inverse\")}function f(a){this.acceptRequired(a,\"name\"),this.acceptArray(a.params),this.acceptKey(a,\"hash\")}e.default=o,t.exports=e.default})),Jc=de(((e,t)=>{e.__esModule=!0;function s(u){return u&&u.__esModule?u:{default:u}}var r=s(go());function i(){var u=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=u}i.prototype=new r.default,i.prototype.Program=function(u){var f=!this.options.ignoreStandalone,a=!this.isRootSeen;this.isRootSeen=!0;for(var d=u.body,l=0,g=d.length;l<g;l++){var m=d[l],y=this.accept(m);if(y){var _=n(d,l,a),w=o(d,l,a),S=y.openStandalone&&_,v=y.closeStandalone&&w,p=y.inlineStandalone&&_&&w;y.close&&c(d,l,!0),y.open&&h(d,l,!0),f&&p&&(c(d,l),h(d,l)&&m.type===\"PartialStatement\"&&(m.indent=/(?:^|[^ \\t])([ \\t]+)$/.exec(d[l-1].original)[1])),f&&S&&(c((m.program||m.inverse).body),h(d,l)),f&&v&&(c(d,l),h((m.inverse||m.program).body))}}return u},i.prototype.BlockStatement=i.prototype.DecoratorBlock=i.prototype.PartialBlockStatement=function(u){this.accept(u.program),this.accept(u.inverse);var f=u.program||u.inverse,a=u.program&&u.inverse,d=a,l=a;if(a&&a.chained)for(d=a.body[0].program;l.chained;)l=l.body[l.body.length-1].program;var g={open:u.openStrip.open,close:u.closeStrip.close,openStandalone:o(f.body),closeStandalone:n((d||f).body)};if(u.openStrip.close&&c(f.body,null,!0),a){var m=u.inverseStrip;m.open&&h(f.body,null,!0),m.close&&c(d.body,null,!0),u.closeStrip.open&&h(l.body,null,!0),!this.options.ignoreStandalone&&n(f.body)&&o(d.body)&&(h(f.body),c(d.body))}else u.closeStrip.open&&h(f.body,null,!0);return g},i.prototype.Decorator=i.prototype.MustacheStatement=function(u){return u.strip},i.prototype.PartialStatement=i.prototype.CommentStatement=function(u){var f=u.strip||{};return{inlineStandalone:!0,open:f.open,close:f.close}};function n(u,f,a){f===void 0&&(f=u.length);var d=u[f-1],l=u[f-2];if(!d)return a;if(d.type===\"ContentStatement\")return(l||!a?/(?:^|\\S)[^\\S\\n]*\\n\\s*$/:/^\\s*$|(?:^|\\S)[^\\S\\n]*\\n\\s*$/).test(d.original)}function o(u,f,a){f===void 0&&(f=-1);var d=u[f+1],l=u[f+2];if(!d)return a;if(d.type===\"ContentStatement\")return(l||!a?/^\\s*?\\r?\\n/:/^\\s*?(\\r?\\n|$)/).test(d.original)}function c(u,f,a){var d=u[f==null?0:f+1];if(!(!d||d.type!==\"ContentStatement\"||!a&&d.rightStripped)){var l=d.value;d.value=d.value.replace(a?/^\\s+/:/^[ \\t]*\\r?\\n?/,\"\"),d.rightStripped=d.value!==l}}function h(u,f,a){var d=u[f==null?u.length-1:f-1];if(!(!d||d.type!==\"ContentStatement\"||!a&&d.leftStripped)){var l=d.value;return d.value=d.value.replace(a?/(^|\\S)\\s+$/:/(^|[^ \\t])[ \\t]+$/,\"$1\"),d.leftStripped=d.value!==l,d.leftStripped}}e.default=i,t.exports=e.default})),Kc=de((e=>{e.__esModule=!0,e.SourceLocation=i,e.id=n,e.stripFlags=o,e.stripComment=c,e.preparePath=h,e.prepareMustache=u,e.prepareRawBlock=f,e.prepareBlock=a,e.prepareProgram=d,e.preparePartialBlock=l;function t(g){return g&&g.__esModule?g:{default:g}}var s=t(Nt());function r(g,m){if(m=m.path?m.path.original:m,g.path.original!==m){var y={loc:g.path.loc};throw new s.default(g.path.original+\" doesn't match \"+m,y)}}function i(g,m){this.source=g,this.start={line:m.first_line,column:m.first_column},this.end={line:m.last_line,column:m.last_column}}function n(g){return/^\\[.*\\]$/.test(g)?g.substring(1,g.length-1):g}function o(g,m){return{open:g.charAt(2)===\"~\",close:m.charAt(m.length-3)===\"~\"}}function c(g){return g.replace(/^\\{\\{~?!-?-?/,\"\").replace(/-?-?~?\\}\\}$/,\"\")}function h(g,m,y){y=this.locInfo(y);for(var _=g?\"@\":\"\",w=[],S=0,v=0,p=m.length;v<p;v++){var b=m[v].part,k=m[v].original!==b;if(_+=(m[v].separator||\"\")+b,!k&&(b===\"..\"||b===\".\"||b===\"this\")){if(w.length>0)throw new s.default(\"Invalid path: \"+_,{loc:y});b===\"..\"&&S++}else w.push(b)}return{type:\"PathExpression\",data:g,depth:S,parts:w,original:_,loc:y}}function u(g,m,y,_,w,S){var v=_.charAt(3)||_.charAt(2),p=v!==\"{\"&&v!==\"&\";return{type:/\\*/.test(_)?\"Decorator\":\"MustacheStatement\",path:g,params:m,hash:y,escaped:p,strip:w,loc:this.locInfo(S)}}function f(g,m,y,_){r(g,y),_=this.locInfo(_);var w={type:\"Program\",body:m,strip:{},loc:_};return{type:\"BlockStatement\",path:g.path,params:g.params,hash:g.hash,program:w,openStrip:{},inverseStrip:{},closeStrip:{},loc:_}}function a(g,m,y,_,w,S){_&&_.path&&r(g,_);var v=/\\*/.test(g.open);m.blockParams=g.blockParams;var p=void 0,b=void 0;if(y){if(v)throw new s.default(\"Unexpected inverse block on decorator\",y);y.chain&&(y.program.body[0].closeStrip=_.strip),b=y.strip,p=y.program}return w&&(w=p,p=m,m=w),{type:v?\"DecoratorBlock\":\"BlockStatement\",path:g.path,params:g.params,hash:g.hash,program:m,inverse:p,openStrip:g.strip,inverseStrip:b,closeStrip:_&&_.strip,loc:this.locInfo(S)}}function d(g,m){if(!m&&g.length){var y=g[0].loc,_=g[g.length-1].loc;y&&_&&(m={source:y.source,start:{line:y.start.line,column:y.start.column},end:{line:_.end.line,column:_.end.column}})}return{type:\"Program\",body:g,strip:{},loc:m}}function l(g,m,y,_){return r(g,y),{type:\"PartialBlockStatement\",name:g.path,params:g.params,hash:g.hash,program:m,openStrip:g.strip,closeStrip:y&&y.strip,loc:this.locInfo(_)}}})),Qc=de((e=>{e.__esModule=!0,e.parseWithoutProcessing=h,e.parse=u;function t(f){if(f&&f.__esModule)return f;var a={};if(f!=null)for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(a[d]=f[d]);return a.default=f,a}function s(f){return f&&f.__esModule?f:{default:f}}var r=s(Zc()),i=s(Jc()),n=t(Kc()),o=ht();e.parser=r.default;var c={};o.extend(c,n);function h(f,a){return f.type===\"Program\"?f:(r.default.yy=c,c.locInfo=function(d){return new c.SourceLocation(a&&a.srcName,d)},r.default.parse(f))}function u(f,a){var d=h(f,a);return new i.default(a).accept(d)}})),eu=de((e=>{e.__esModule=!0,e.Compiler=c,e.precompile=h,e.compile=u;function t(w){return w&&w.__esModule?w:{default:w}}var s=t(Nt()),r=ht(),i=t(fo()),n=po(),o=[].slice;function c(){}c.prototype={compiler:c,equals:function(S){var v=this.opcodes.length;if(S.opcodes.length!==v)return!1;for(var p=0;p<v;p++){var b=this.opcodes[p],k=S.opcodes[p];if(b.opcode!==k.opcode||!y(b.args,k.args))return!1}v=this.children.length;for(var p=0;p<v;p++)if(!this.children[p].equals(S.children[p]))return!1;return!0},guid:0,compile:function(S,v){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=v,this.stringParams=v.stringParams,this.trackIds=v.trackIds,v.blockParams=v.blockParams||[],v.knownHelpers=r.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},v.knownHelpers),this.accept(S)},compileProgram:function(S){var v=new this.compiler().compile(S,this.options),p=this.guid++;return this.usePartial=this.usePartial||v.usePartial,this.children[p]=v,this.useDepths=this.useDepths||v.useDepths,p},accept:function(S){if(r.indexOf(n.NODE_TYPES,S.type)===-1||!this[S.type])throw new s.default(\"Unknown type: \"+S.type,S);this.sourceNode.unshift(S);var v=this[S.type](S);return this.sourceNode.shift(),v},Program:function(S){m(S),this.options.blockParams.unshift(S.blockParams);for(var v=S.body,p=v.length,b=0;b<p;b++)this.accept(v[b]);return this.options.blockParams.shift(),this.isSimple=p===1,this.blockParams=S.blockParams?S.blockParams.length:0,this},BlockStatement:function(S){_(S);var v=S.program,p=S.inverse;v=v&&this.compileProgram(v),p=p&&this.compileProgram(p);var b=this.classifySexpr(S);b===\"helper\"?this.helperSexpr(S,v,p):b===\"simple\"?(this.simpleSexpr(S),this.opcode(\"pushProgram\",v),this.opcode(\"pushProgram\",p),this.opcode(\"emptyHash\"),this.opcode(\"blockValue\",S.path.original)):(this.ambiguousSexpr(S,v,p),this.opcode(\"pushProgram\",v),this.opcode(\"pushProgram\",p),this.opcode(\"emptyHash\"),this.opcode(\"ambiguousBlockValue\")),this.opcode(\"append\")},DecoratorBlock:function(S){var v=S.program&&this.compileProgram(S.program),p=this.setupFullMustacheParams(S,v,void 0),b=S.path;this.useDecorators=!0,this.opcode(\"registerDecorator\",p.length,b.original)},PartialStatement:function(S){this.usePartial=!0;var v=S.program;v&&(v=this.compileProgram(S.program));var p=S.params;if(p.length>1)throw new s.default(\"Unsupported number of partial arguments: \"+p.length,S);p.length||(this.options.explicitPartialContext?this.opcode(\"pushLiteral\",\"undefined\"):p.push({type:\"PathExpression\",parts:[],depth:0}));var b=S.name.original,k=S.name.type===\"SubExpression\";k&&this.accept(S.name),this.setupFullMustacheParams(S,v,void 0,!0);var T=S.indent||\"\";this.options.preventIndent&&T&&(this.opcode(\"appendContent\",T),T=\"\"),this.opcode(\"invokePartial\",k,b,T),this.opcode(\"append\")},PartialBlockStatement:function(S){this.PartialStatement(S)},MustacheStatement:function(S){this.SubExpression(S),S.escaped&&!this.options.noEscape?this.opcode(\"appendEscaped\"):this.opcode(\"append\")},Decorator:function(S){this.DecoratorBlock(S)},ContentStatement:function(S){if(S.value!=null&&typeof S.value!=\"string\")throw f(S,\"value must be a string\");S.value&&this.opcode(\"appendContent\",S.value)},CommentStatement:function(){},SubExpression:function(S){_(S);var v=this.classifySexpr(S);v===\"simple\"?this.simpleSexpr(S):v===\"helper\"?this.helperSexpr(S):this.ambiguousSexpr(S)},ambiguousSexpr:function(S,v,p){var b=S.path,k=b.parts[0],T=v!=null||p!=null;this.opcode(\"getContext\",a(b)),this.opcode(\"pushProgram\",v),this.opcode(\"pushProgram\",p),b.strict=!0,this.accept(b),this.opcode(\"invokeAmbiguous\",k,T)},simpleSexpr:function(S){var v=S.path;v.strict=!0,this.accept(v),this.opcode(\"resolvePossibleLambda\")},helperSexpr:function(S,v,p){var b=this.setupFullMustacheParams(S,v,p),k=S.path,T=k.parts[0];if(this.options.knownHelpers[T])this.opcode(\"invokeKnownHelper\",b.length,T);else{if(this.options.knownHelpersOnly)throw new s.default(\"You specified knownHelpersOnly, but used the unknown helper \"+T,S);k.strict=!0,k.falsy=!0,this.accept(k),this.opcode(\"invokeHelper\",b.length,k.original,i.default.helpers.simpleId(k))}},PathExpression:function(S){var v=a(S),p=g(S);this.addDepth(v),this.opcode(\"getContext\",v);var b=p[0],k=i.default.helpers.scopedId(S),T=!v&&!k&&this.blockParamIndex(b);T?this.opcode(\"lookupBlockParam\",T,p):b?S.data?(this.options.data=!0,this.opcode(\"lookupData\",v,p,S.strict)):this.opcode(\"lookupOnContext\",p,S.falsy,S.strict,k):this.opcode(\"pushContext\")},StringLiteral:function(S){d(S),this.opcode(\"pushString\",S.value)},NumberLiteral:function(S){d(S),this.opcode(\"pushLiteral\",S.value)},BooleanLiteral:function(S){d(S),this.opcode(\"pushLiteral\",S.value)},UndefinedLiteral:function(){this.opcode(\"pushLiteral\",\"undefined\")},NullLiteral:function(){this.opcode(\"pushLiteral\",\"null\")},Hash:function(S){var v=S.pairs,p=0,b=void 0;if(!r.isArray(v))throw f(S,\"pairs must be an array\");b=v.length;for(var k=0;k<b;k++)if(!v[k]||typeof v[k].key!=\"string\")throw f(S,\"pair keys must be strings\");for(this.opcode(\"pushHash\");p<b;p++)this.pushParam(v[p].value);for(;p--;)this.opcode(\"assignToHash\",v[p].key);this.opcode(\"popHash\")},opcode:function(S){this.opcodes.push({opcode:S,args:o.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(S){S&&(this.useDepths=!0)},classifySexpr:function(S){g(S.path);var v=i.default.helpers.simpleId(S.path),p=v&&!!this.blockParamIndex(S.path.parts[0]),b=!p&&i.default.helpers.helperExpression(S),k=!p&&(b||v);if(k&&!b){var T=S.path.parts[0],R=this.options;R.knownHelpers[T]?b=!0:R.knownHelpersOnly&&(k=!1)}return b?\"helper\":k?\"ambiguous\":\"simple\"},pushParams:function(S){for(var v=0,p=S.length;v<p;v++)this.pushParam(S[v])},pushParam:function(S){d(S);var v=S.value!=null?S.value:S.original||\"\",p=a(S);if(this.stringParams)typeof v!=\"number\"&&typeof v!=\"boolean\"&&(v=String(v)),v.replace&&(v=v.replace(/^(\\.?\\.\\/)*/g,\"\").replace(/\\//g,\".\")),p&&this.addDepth(p),this.opcode(\"getContext\",p),this.opcode(\"pushStringParam\",v,S.type),S.type===\"SubExpression\"&&this.accept(S);else{if(this.trackIds){var b=void 0;if(S.parts&&!i.default.helpers.scopedId(S)&&!p&&(b=this.blockParamIndex(g(S)[0])),b){var k=S.parts.slice(1).join(\".\");this.opcode(\"pushId\",\"BlockParam\",b,k)}else v=S.original||v,v.replace&&(v=v.replace(/^this(?:\\.|$)/,\"\").replace(/^\\.\\//,\"\").replace(/^\\.$/,\"\")),this.opcode(\"pushId\",S.type,v)}this.accept(S)}},setupFullMustacheParams:function(S,v,p,b){var k=S.params;return this.pushParams(k),this.opcode(\"pushProgram\",v),this.opcode(\"pushProgram\",p),S.hash?this.accept(S.hash):this.opcode(\"emptyHash\",b),k},blockParamIndex:function(S){for(var v=0,p=this.options.blockParams.length;v<p;v++){var b=this.options.blockParams[v],k=b&&r.indexOf(b,S);if(b&&k>=0)return[v,k]}}};function h(w,S,v){if(w==null||typeof w!=\"string\"&&w.type!==\"Program\")throw new s.default(\"You must pass a string or Handlebars AST to Handlebars.precompile. You passed \"+w);S=S||{},\"data\"in S||(S.data=!0),S.compat&&(S.useDepths=!0);var p=v.parse(w,S),b=new v.Compiler().compile(p,S);return new v.JavaScriptCompiler().compile(b,S)}function u(w,S,v){if(S===void 0&&(S={}),w==null||typeof w!=\"string\"&&w.type!==\"Program\")throw new s.default(\"You must pass a string or Handlebars AST to Handlebars.compile. You passed \"+w);S=r.extend({},S),\"data\"in S||(S.data=!0),S.compat&&(S.useDepths=!0);var p=void 0;function b(){var T=v.parse(w,S),R=new v.Compiler().compile(T,S),P=new v.JavaScriptCompiler().compile(R,S,void 0,!0);return v.template(P)}function k(T,R){return p||(p=b()),p.call(this,T,R)}return k._setup=function(T){return p||(p=b()),p._setup(T)},k._child=function(T,R,P,O){return p||(p=b()),p._child(T,R,P,O)},k}function f(w,S){return new s.default(\"Invalid AST: \"+w.type+\" \"+S,w)}function a(w){var S=w.depth;if(S==null)return 0;if(typeof S!=\"number\"||!isFinite(S)||Math.floor(S)!==S||S<0)throw f(w,\"depth must be a non-negative integer\");return S}function d(w){var S=w.value;if(w.type===\"StringLiteral\"&&typeof S!=\"string\")throw f(w,\"value must be a string\");if(w.type===\"NumberLiteral\"&&typeof S!=\"number\")throw f(w,\"value must be a number\");if(w.type===\"BooleanLiteral\"&&typeof S!=\"boolean\")throw f(w,\"value must be a boolean\")}function l(w,S,v){if(!r.isArray(S))throw f(w,v+\" must be an array\");for(var p=0;p<S.length;p++)if(typeof S[p]!=\"string\")throw f(w,v+\" must only contain strings\");return S}function g(w){return l(w,w.parts,\"parts\")}function m(w){w.blockParams!=null&&l(w,w.blockParams,\"blockParams\")}function y(w,S){if(w===S)return!0;if(r.isArray(w)&&r.isArray(S)&&w.length===S.length){for(var v=0;v<w.length;v++)if(!y(w[v],S[v]))return!1;return!0}}function _(w){if(!w.path.parts){var S=w.path;w.path={type:\"PathExpression\",data:!1,depth:0,parts:[S.original+\"\"],original:S.original+\"\",loc:S.loc}}}})),tu=de((e=>{var t=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\");e.encode=function(s){if(0<=s&&s<t.length)return t[s];throw new TypeError(\"Must be between 0 and 63: \"+s)},e.decode=function(s){var r=65,i=90,n=97,o=122,c=48,h=57,u=43,f=47,a=26,d=52;return r<=s&&s<=i?s-r:n<=s&&s<=o?s-n+a:c<=s&&s<=h?s-c+d:s==u?62:s==f?63:-1}})),mo=de((e=>{var t=tu(),s=5,r=1<<s,i=r-1,n=r;function o(h){return h<0?(-h<<1)+1:(h<<1)+0}function c(h){var u=(h&1)===1,f=h>>1;return u?-f:f}e.encode=function(u){var f=\"\",a,d=o(u);do a=d&i,d>>>=s,d>0&&(a|=n),f+=t.encode(a);while(d>0);return f},e.decode=function(u,f,a){var d=u.length,l=0,g=0,m,y;do{if(f>=d)throw new Error(\"Expected more digits in base 64 VLQ value.\");if(y=t.decode(u.charCodeAt(f++)),y===-1)throw new Error(\"Invalid base64 digit: \"+u.charAt(f-1));m=!!(y&n),y&=i,l=l+(y<<g),g+=s}while(m);a.value=c(l),a.rest=f}})),tr=de((e=>{function t(v,p,b){if(p in v)return v[p];if(arguments.length===3)return b;throw new Error('\"'+p+'\" is a required argument.')}e.getArg=t;var s=/^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/,r=/^data:.+\\,.+$/;function i(v){var p=v.match(s);return p?{scheme:p[1],auth:p[2],host:p[3],port:p[4],path:p[5]}:null}e.urlParse=i;function n(v){var p=\"\";return v.scheme&&(p+=v.scheme+\":\"),p+=\"//\",v.auth&&(p+=v.auth+\"@\"),v.host&&(p+=v.host),v.port&&(p+=\":\"+v.port),v.path&&(p+=v.path),p}e.urlGenerate=n;function o(v){var p=v,b=i(v);if(b){if(!b.path)return v;p=b.path}for(var k=e.isAbsolute(p),T=p.split(/\\/+/),R,P=0,O=T.length-1;O>=0;O--)R=T[O],R===\".\"?T.splice(O,1):R===\"..\"?P++:P>0&&(R===\"\"?(T.splice(O+1,P),P=0):(T.splice(O,2),P--));return p=T.join(\"/\"),p===\"\"&&(p=k?\"/\":\".\"),b?(b.path=p,n(b)):p}e.normalize=o;function c(v,p){v===\"\"&&(v=\".\"),p===\"\"&&(p=\".\");var b=i(p),k=i(v);if(k&&(v=k.path||\"/\"),b&&!b.scheme)return k&&(b.scheme=k.scheme),n(b);if(b||p.match(r))return p;if(k&&!k.host&&!k.path)return k.host=p,n(k);var T=p.charAt(0)===\"/\"?p:o(v.replace(/\\/+$/,\"\")+\"/\"+p);return k?(k.path=T,n(k)):T}e.join=c,e.isAbsolute=function(v){return v.charAt(0)===\"/\"||s.test(v)};function h(v,p){v===\"\"&&(v=\".\"),v=v.replace(/\\/$/,\"\");for(var b=0;p.indexOf(v+\"/\")!==0;){var k=v.lastIndexOf(\"/\");if(k<0||(v=v.slice(0,k),v.match(/^([^\\/]+:\\/)?\\/*$/)))return p;++b}return Array(b+1).join(\"../\")+p.substr(v.length+1)}e.relative=h;var u=(function(){return!(\"__proto__\"in Object.create(null))})();function f(v){return v}function a(v){return l(v)?\"$\"+v:v}e.toSetString=u?f:a;function d(v){return l(v)?v.slice(1):v}e.fromSetString=u?f:d;function l(v){if(!v)return!1;var p=v.length;if(p<9||v.charCodeAt(p-1)!==95||v.charCodeAt(p-2)!==95||v.charCodeAt(p-3)!==111||v.charCodeAt(p-4)!==116||v.charCodeAt(p-5)!==111||v.charCodeAt(p-6)!==114||v.charCodeAt(p-7)!==112||v.charCodeAt(p-8)!==95||v.charCodeAt(p-9)!==95)return!1;for(var b=p-10;b>=0;b--)if(v.charCodeAt(b)!==36)return!1;return!0}function g(v,p,b){var k=y(v.source,p.source);return k!==0||(k=v.originalLine-p.originalLine,k!==0)||(k=v.originalColumn-p.originalColumn,k!==0||b)||(k=v.generatedColumn-p.generatedColumn,k!==0)||(k=v.generatedLine-p.generatedLine,k!==0)?k:y(v.name,p.name)}e.compareByOriginalPositions=g;function m(v,p,b){var k=v.generatedLine-p.generatedLine;return k!==0||(k=v.generatedColumn-p.generatedColumn,k!==0||b)||(k=y(v.source,p.source),k!==0)||(k=v.originalLine-p.originalLine,k!==0)||(k=v.originalColumn-p.originalColumn,k!==0)?k:y(v.name,p.name)}e.compareByGeneratedPositionsDeflated=m;function y(v,p){return v===p?0:v===null?1:p===null?-1:v>p?1:-1}function _(v,p){var b=v.generatedLine-p.generatedLine;return b!==0||(b=v.generatedColumn-p.generatedColumn,b!==0)||(b=y(v.source,p.source),b!==0)||(b=v.originalLine-p.originalLine,b!==0)||(b=v.originalColumn-p.originalColumn,b!==0)?b:y(v.name,p.name)}e.compareByGeneratedPositionsInflated=_;function w(v){return JSON.parse(v.replace(/^\\)]}'[^\\n]*\\n/,\"\"))}e.parseSourceMapInput=w;function S(v,p,b){if(p=p||\"\",v&&(v[v.length-1]!==\"/\"&&p[0]!==\"/\"&&(v+=\"/\"),p=v+p),b){var k=i(b);if(!k)throw new Error(\"sourceMapURL could not be parsed\");if(k.path){var T=k.path.lastIndexOf(\"/\");T>=0&&(k.path=k.path.substring(0,T+1))}p=c(n(k),p)}return o(p)}e.computeSourceURL=S})),vo=de((e=>{var t=tr(),s=Object.prototype.hasOwnProperty,r=typeof Map<\"u\";function i(){this._array=[],this._set=r?new Map:Object.create(null)}i.fromArray=function(o,c){for(var h=new i,u=0,f=o.length;u<f;u++)h.add(o[u],c);return h},i.prototype.size=function(){return r?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(o,c){var h=r?o:t.toSetString(o),u=r?this.has(o):s.call(this._set,h),f=this._array.length;(!u||c)&&this._array.push(o),u||(r?this._set.set(o,f):this._set[h]=f)},i.prototype.has=function(o){if(r)return this._set.has(o);var c=t.toSetString(o);return s.call(this._set,c)},i.prototype.indexOf=function(o){if(r){var c=this._set.get(o);if(c>=0)return c}else{var h=t.toSetString(o);if(s.call(this._set,h))return this._set[h]}throw new Error('\"'+o+'\" is not in the set.')},i.prototype.at=function(o){if(o>=0&&o<this._array.length)return this._array[o];throw new Error(\"No element indexed by \"+o)},i.prototype.toArray=function(){return this._array.slice()},e.ArraySet=i})),su=de((e=>{var t=tr();function s(i,n){var o=i.generatedLine,c=n.generatedLine,h=i.generatedColumn,u=n.generatedColumn;return c>o||c==o&&u>=h||t.compareByGeneratedPositionsInflated(i,n)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(n,o){this._array.forEach(n,o)},r.prototype.add=function(n){s(this._last,n)?(this._last=n,this._array.push(n)):(this._sorted=!1,this._array.push(n))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(t.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},e.MappingList=r})),yo=de((e=>{var t=mo(),s=tr(),r=vo().ArraySet,i=su().MappingList;function n(o){o||(o={}),this._file=s.getArg(o,\"file\",null),this._sourceRoot=s.getArg(o,\"sourceRoot\",null),this._skipValidation=s.getArg(o,\"skipValidation\",!1),this._sources=new r,this._names=new r,this._mappings=new i,this._sourcesContents=null}n.prototype._version=3,n.fromSourceMap=function(c){var h=c.sourceRoot,u=new n({file:c.file,sourceRoot:h});return c.eachMapping(function(f){var a={generated:{line:f.generatedLine,column:f.generatedColumn}};f.source!=null&&(a.source=f.source,h!=null&&(a.source=s.relative(h,a.source)),a.original={line:f.originalLine,column:f.originalColumn},f.name!=null&&(a.name=f.name)),u.addMapping(a)}),c.sources.forEach(function(f){var a=f;h!==null&&(a=s.relative(h,f)),u._sources.has(a)||u._sources.add(a);var d=c.sourceContentFor(f);d!=null&&u.setSourceContent(f,d)}),u},n.prototype.addMapping=function(c){var h=s.getArg(c,\"generated\"),u=s.getArg(c,\"original\",null),f=s.getArg(c,\"source\",null),a=s.getArg(c,\"name\",null);this._skipValidation||this._validateMapping(h,u,f,a),f!=null&&(f=String(f),this._sources.has(f)||this._sources.add(f)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:h.line,generatedColumn:h.column,originalLine:u!=null&&u.line,originalColumn:u!=null&&u.column,source:f,name:a})},n.prototype.setSourceContent=function(c,h){var u=c;this._sourceRoot!=null&&(u=s.relative(this._sourceRoot,u)),h!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[s.toSetString(u)]=h):this._sourcesContents&&(delete this._sourcesContents[s.toSetString(u)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(c,h,u){var f=h;if(h==null){if(c.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's \"file\" property. Both were omitted.`);f=c.file}var a=this._sourceRoot;a!=null&&(f=s.relative(a,f));var d=new r,l=new r;this._mappings.unsortedForEach(function(g){if(g.source===f&&g.originalLine!=null){var m=c.originalPositionFor({line:g.originalLine,column:g.originalColumn});m.source!=null&&(g.source=m.source,u!=null&&(g.source=s.join(u,g.source)),a!=null&&(g.source=s.relative(a,g.source)),g.originalLine=m.line,g.originalColumn=m.column,m.name!=null&&(g.name=m.name))}var y=g.source;y!=null&&!d.has(y)&&d.add(y);var _=g.name;_!=null&&!l.has(_)&&l.add(_)},this),this._sources=d,this._names=l,c.sources.forEach(function(g){var m=c.sourceContentFor(g);m!=null&&(u!=null&&(g=s.join(u,g)),a!=null&&(g=s.relative(a,g)),this.setSourceContent(g,m))},this)},n.prototype._validateMapping=function(c,h,u,f){if(h&&typeof h.line!=\"number\"&&typeof h.column!=\"number\")throw new Error(\"original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.\");if(!(c&&\"line\"in c&&\"column\"in c&&c.line>0&&c.column>=0&&!h&&!u&&!f)){if(c&&\"line\"in c&&\"column\"in c&&h&&\"line\"in h&&\"column\"in h&&c.line>0&&c.column>=0&&h.line>0&&h.column>=0&&u)return;throw new Error(\"Invalid mapping: \"+JSON.stringify({generated:c,source:u,original:h,name:f}))}},n.prototype._serializeMappings=function(){for(var c=0,h=1,u=0,f=0,a=0,d=0,l=\"\",g,m,y,_,w=this._mappings.toArray(),S=0,v=w.length;S<v;S++){if(m=w[S],g=\"\",m.generatedLine!==h)for(c=0;m.generatedLine!==h;)g+=\";\",h++;else if(S>0){if(!s.compareByGeneratedPositionsInflated(m,w[S-1]))continue;g+=\",\"}g+=t.encode(m.generatedColumn-c),c=m.generatedColumn,m.source!=null&&(_=this._sources.indexOf(m.source),g+=t.encode(_-d),d=_,g+=t.encode(m.originalLine-1-f),f=m.originalLine-1,g+=t.encode(m.originalColumn-u),u=m.originalColumn,m.name!=null&&(y=this._names.indexOf(m.name),g+=t.encode(y-a),a=y)),l+=g}return l},n.prototype._generateSourcesContent=function(c,h){return c.map(function(u){if(!this._sourcesContents)return null;h!=null&&(u=s.relative(h,u));var f=s.toSetString(u);return Object.prototype.hasOwnProperty.call(this._sourcesContents,f)?this._sourcesContents[f]:null},this)},n.prototype.toJSON=function(){var c={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(c.file=this._file),this._sourceRoot!=null&&(c.sourceRoot=this._sourceRoot),this._sourcesContents&&(c.sourcesContent=this._generateSourcesContent(c.sources,c.sourceRoot)),c},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=n})),ru=de((e=>{e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2;function t(s,r,i,n,o,c){var h=Math.floor((r-s)/2)+s,u=o(i,n[h],!0);return u===0?h:u>0?r-h>1?t(h,r,i,n,o,c):c==e.LEAST_UPPER_BOUND?r<n.length?r:-1:h:h-s>1?t(s,h,i,n,o,c):c==e.LEAST_UPPER_BOUND?h:s<0?-1:s}e.search=function(r,i,n,o){if(i.length===0)return-1;var c=t(-1,i.length,r,i,n,o||e.GREATEST_LOWER_BOUND);if(c<0)return-1;for(;c-1>=0&&n(i[c],i[c-1],!0)===0;)--c;return c}})),iu=de((e=>{function t(i,n,o){var c=i[n];i[n]=i[o],i[o]=c}function s(i,n){return Math.round(i+Math.random()*(n-i))}function r(i,n,o,c){if(o<c){var h=s(o,c),u=o-1;t(i,h,c);for(var f=i[c],a=o;a<c;a++)n(i[a],f)<=0&&(u+=1,t(i,u,a));t(i,u+1,a);var d=u+1;r(i,n,o,d-1),r(i,n,d+1,c)}}e.quickSort=function(i,n){r(i,n,0,i.length-1)}})),nu=de((e=>{var t=tr(),s=ru(),r=vo().ArraySet,i=mo(),n=iu().quickSort;function o(f,a){var d=f;return typeof f==\"string\"&&(d=t.parseSourceMapInput(f)),d.sections!=null?new u(d,a):new c(d,a)}o.fromSourceMap=function(f,a){return c.fromSourceMap(f,a)},o.prototype._version=3,o.prototype.__generatedMappings=null,Object.defineProperty(o.prototype,\"_generatedMappings\",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),o.prototype.__originalMappings=null,Object.defineProperty(o.prototype,\"_originalMappings\",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),o.prototype._charIsMappingSeparator=function(a,d){var l=a.charAt(d);return l===\";\"||l===\",\"},o.prototype._parseMappings=function(a,d){throw new Error(\"Subclasses must implement _parseMappings\")},o.GENERATED_ORDER=1,o.ORIGINAL_ORDER=2,o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2,o.prototype.eachMapping=function(a,d,l){var g=d||null,m=l||o.GENERATED_ORDER,y;switch(m){case o.GENERATED_ORDER:y=this._generatedMappings;break;case o.ORIGINAL_ORDER:y=this._originalMappings;break;default:throw new Error(\"Unknown order of iteration.\")}var _=this.sourceRoot;y.map(function(w){var S=w.source===null?null:this._sources.at(w.source);return S=t.computeSourceURL(_,S,this._sourceMapURL),{source:S,generatedLine:w.generatedLine,generatedColumn:w.generatedColumn,originalLine:w.originalLine,originalColumn:w.originalColumn,name:w.name===null?null:this._names.at(w.name)}},this).forEach(a,g)},o.prototype.allGeneratedPositionsFor=function(a){var d=t.getArg(a,\"line\"),l={source:t.getArg(a,\"source\"),originalLine:d,originalColumn:t.getArg(a,\"column\",0)};if(l.source=this._findSourceIndex(l.source),l.source<0)return[];var g=[],m=this._findMapping(l,this._originalMappings,\"originalLine\",\"originalColumn\",t.compareByOriginalPositions,s.LEAST_UPPER_BOUND);if(m>=0){var y=this._originalMappings[m];if(a.column===void 0)for(var _=y.originalLine;y&&y.originalLine===_;)g.push({line:t.getArg(y,\"generatedLine\",null),column:t.getArg(y,\"generatedColumn\",null),lastColumn:t.getArg(y,\"lastGeneratedColumn\",null)}),y=this._originalMappings[++m];else for(var w=y.originalColumn;y&&y.originalLine===d&&y.originalColumn==w;)g.push({line:t.getArg(y,\"generatedLine\",null),column:t.getArg(y,\"generatedColumn\",null),lastColumn:t.getArg(y,\"lastGeneratedColumn\",null)}),y=this._originalMappings[++m]}return g},e.SourceMapConsumer=o;function c(f,a){var d=f;typeof f==\"string\"&&(d=t.parseSourceMapInput(f));var l=t.getArg(d,\"version\"),g=t.getArg(d,\"sources\"),m=t.getArg(d,\"names\",[]),y=t.getArg(d,\"sourceRoot\",null),_=t.getArg(d,\"sourcesContent\",null),w=t.getArg(d,\"mappings\"),S=t.getArg(d,\"file\",null);if(l!=this._version)throw new Error(\"Unsupported version: \"+l);y&&(y=t.normalize(y)),g=g.map(String).map(t.normalize).map(function(v){return y&&t.isAbsolute(y)&&t.isAbsolute(v)?t.relative(y,v):v}),this._names=r.fromArray(m.map(String),!0),this._sources=r.fromArray(g,!0),this._absoluteSources=this._sources.toArray().map(function(v){return t.computeSourceURL(y,v,a)}),this.sourceRoot=y,this.sourcesContent=_,this._mappings=w,this._sourceMapURL=a,this.file=S}c.prototype=Object.create(o.prototype),c.prototype.consumer=o,c.prototype._findSourceIndex=function(f){var a=f;if(this.sourceRoot!=null&&(a=t.relative(this.sourceRoot,a)),this._sources.has(a))return this._sources.indexOf(a);for(var d=0;d<this._absoluteSources.length;++d)if(this._absoluteSources[d]==f)return d;return-1},c.fromSourceMap=function(a,d){var l=Object.create(c.prototype),g=l._names=r.fromArray(a._names.toArray(),!0),m=l._sources=r.fromArray(a._sources.toArray(),!0);l.sourceRoot=a._sourceRoot,l.sourcesContent=a._generateSourcesContent(l._sources.toArray(),l.sourceRoot),l.file=a._file,l._sourceMapURL=d,l._absoluteSources=l._sources.toArray().map(function(k){return t.computeSourceURL(l.sourceRoot,k,d)});for(var y=a._mappings.toArray().slice(),_=l.__generatedMappings=[],w=l.__originalMappings=[],S=0,v=y.length;S<v;S++){var p=y[S],b=new h;b.generatedLine=p.generatedLine,b.generatedColumn=p.generatedColumn,p.source&&(b.source=m.indexOf(p.source),b.originalLine=p.originalLine,b.originalColumn=p.originalColumn,p.name&&(b.name=g.indexOf(p.name)),w.push(b)),_.push(b)}return n(l.__originalMappings,t.compareByOriginalPositions),l},c.prototype._version=3,Object.defineProperty(c.prototype,\"sources\",{get:function(){return this._absoluteSources.slice()}});function h(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}c.prototype._parseMappings=function(a,d){for(var l=1,g=0,m=0,y=0,_=0,w=0,S=a.length,v=0,p={},b={},k=[],T=[],R,P,O,I,q;v<S;)if(a.charAt(v)===\";\")l++,v++,g=0;else if(a.charAt(v)===\",\")v++;else{for(R=new h,R.generatedLine=l,I=v;I<S&&!this._charIsMappingSeparator(a,I);I++);if(P=a.slice(v,I),O=p[P],O)v+=P.length;else{for(O=[];v<I;)i.decode(a,v,b),q=b.value,v=b.rest,O.push(q);if(O.length===2)throw new Error(\"Found a source, but no line and column\");if(O.length===3)throw new Error(\"Found a source and line, but no column\");p[P]=O}R.generatedColumn=g+O[0],g=R.generatedColumn,O.length>1&&(R.source=_+O[1],_+=O[1],R.originalLine=m+O[2],m=R.originalLine,R.originalLine+=1,R.originalColumn=y+O[3],y=R.originalColumn,O.length>4&&(R.name=w+O[4],w+=O[4])),T.push(R),typeof R.originalLine==\"number\"&&k.push(R)}n(T,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=T,n(k,t.compareByOriginalPositions),this.__originalMappings=k},c.prototype._findMapping=function(a,d,l,g,m,y){if(a[l]<=0)throw new TypeError(\"Line must be greater than or equal to 1, got \"+a[l]);if(a[g]<0)throw new TypeError(\"Column must be greater than or equal to 0, got \"+a[g]);return s.search(a,d,m,y)},c.prototype.computeColumnSpans=function(){for(var a=0;a<this._generatedMappings.length;++a){var d=this._generatedMappings[a];if(a+1<this._generatedMappings.length){var l=this._generatedMappings[a+1];if(d.generatedLine===l.generatedLine){d.lastGeneratedColumn=l.generatedColumn-1;continue}}d.lastGeneratedColumn=1/0}},c.prototype.originalPositionFor=function(a){var d={generatedLine:t.getArg(a,\"line\"),generatedColumn:t.getArg(a,\"column\")},l=this._findMapping(d,this._generatedMappings,\"generatedLine\",\"generatedColumn\",t.compareByGeneratedPositionsDeflated,t.getArg(a,\"bias\",o.GREATEST_LOWER_BOUND));if(l>=0){var g=this._generatedMappings[l];if(g.generatedLine===d.generatedLine){var m=t.getArg(g,\"source\",null);m!==null&&(m=this._sources.at(m),m=t.computeSourceURL(this.sourceRoot,m,this._sourceMapURL));var y=t.getArg(g,\"name\",null);return y!==null&&(y=this._names.at(y)),{source:m,line:t.getArg(g,\"originalLine\",null),column:t.getArg(g,\"originalColumn\",null),name:y}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(a){return a==null}):!1},c.prototype.sourceContentFor=function(a,d){if(!this.sourcesContent)return null;var l=this._findSourceIndex(a);if(l>=0)return this.sourcesContent[l];var g=a;this.sourceRoot!=null&&(g=t.relative(this.sourceRoot,g));var m;if(this.sourceRoot!=null&&(m=t.urlParse(this.sourceRoot))){var y=g.replace(/^file:\\/\\//,\"\");if(m.scheme==\"file\"&&this._sources.has(y))return this.sourcesContent[this._sources.indexOf(y)];if((!m.path||m.path==\"/\")&&this._sources.has(\"/\"+g))return this.sourcesContent[this._sources.indexOf(\"/\"+g)]}if(d)return null;throw new Error('\"'+g+'\" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(a){var d=t.getArg(a,\"source\");if(d=this._findSourceIndex(d),d<0)return{line:null,column:null,lastColumn:null};var l={source:d,originalLine:t.getArg(a,\"line\"),originalColumn:t.getArg(a,\"column\")},g=this._findMapping(l,this._originalMappings,\"originalLine\",\"originalColumn\",t.compareByOriginalPositions,t.getArg(a,\"bias\",o.GREATEST_LOWER_BOUND));if(g>=0){var m=this._originalMappings[g];if(m.source===l.source)return{line:t.getArg(m,\"generatedLine\",null),column:t.getArg(m,\"generatedColumn\",null),lastColumn:t.getArg(m,\"lastGeneratedColumn\",null)}}return{line:null,column:null,lastColumn:null}},e.BasicSourceMapConsumer=c;function u(f,a){var d=f;typeof f==\"string\"&&(d=t.parseSourceMapInput(f));var l=t.getArg(d,\"version\"),g=t.getArg(d,\"sections\");if(l!=this._version)throw new Error(\"Unsupported version: \"+l);this._sources=new r,this._names=new r;var m={line:-1,column:0};this._sections=g.map(function(y){if(y.url)throw new Error(\"Support for url field in sections not implemented.\");var _=t.getArg(y,\"offset\"),w=t.getArg(_,\"line\"),S=t.getArg(_,\"column\");if(w<m.line||w===m.line&&S<m.column)throw new Error(\"Section offsets must be ordered and non-overlapping.\");return m=_,{generatedOffset:{generatedLine:w+1,generatedColumn:S+1},consumer:new o(t.getArg(y,\"map\"),a)}})}u.prototype=Object.create(o.prototype),u.prototype.constructor=o,u.prototype._version=3,Object.defineProperty(u.prototype,\"sources\",{get:function(){for(var f=[],a=0;a<this._sections.length;a++)for(var d=0;d<this._sections[a].consumer.sources.length;d++)f.push(this._sections[a].consumer.sources[d]);return f}}),u.prototype.originalPositionFor=function(a){var d={generatedLine:t.getArg(a,\"line\"),generatedColumn:t.getArg(a,\"column\")},l=s.search(d,this._sections,function(m,y){var _=m.generatedLine-y.generatedOffset.generatedLine;return _||m.generatedColumn-y.generatedOffset.generatedColumn}),g=this._sections[l];return g?g.consumer.originalPositionFor({line:d.generatedLine-(g.generatedOffset.generatedLine-1),column:d.generatedColumn-(g.generatedOffset.generatedLine===d.generatedLine?g.generatedOffset.generatedColumn-1:0),bias:a.bias}):{source:null,line:null,column:null,name:null}},u.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(a){return a.consumer.hasContentsOfAllSources()})},u.prototype.sourceContentFor=function(a,d){for(var l=0;l<this._sections.length;l++){var g=this._sections[l].consumer.sourceContentFor(a,!0);if(g)return g}if(d)return null;throw new Error('\"'+a+'\" is not in the SourceMap.')},u.prototype.generatedPositionFor=function(a){for(var d=0;d<this._sections.length;d++){var l=this._sections[d];if(l.consumer._findSourceIndex(t.getArg(a,\"source\"))!==-1){var g=l.consumer.generatedPositionFor(a);if(g)return{line:g.line+(l.generatedOffset.generatedLine-1),column:g.column+(l.generatedOffset.generatedLine===g.line?l.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},u.prototype._parseMappings=function(a,d){this.__generatedMappings=[],this.__originalMappings=[];for(var l=0;l<this._sections.length;l++)for(var g=this._sections[l],m=g.consumer._generatedMappings,y=0;y<m.length;y++){var _=m[y],w=g.consumer._sources.at(_.source);w=t.computeSourceURL(g.consumer.sourceRoot,w,this._sourceMapURL),this._sources.add(w),w=this._sources.indexOf(w);var S=null;_.name&&(S=g.consumer._names.at(_.name),this._names.add(S),S=this._names.indexOf(S));var v={source:w,generatedLine:_.generatedLine+(g.generatedOffset.generatedLine-1),generatedColumn:_.generatedColumn+(g.generatedOffset.generatedLine===_.generatedLine?g.generatedOffset.generatedColumn-1:0),originalLine:_.originalLine,originalColumn:_.originalColumn,name:S};this.__generatedMappings.push(v),typeof v.originalLine==\"number\"&&this.__originalMappings.push(v)}n(this.__generatedMappings,t.compareByGeneratedPositionsDeflated),n(this.__originalMappings,t.compareByOriginalPositions)},e.IndexedSourceMapConsumer=u})),ou=de((e=>{var t=yo().SourceMapGenerator,s=tr(),r=/(\\r?\\n)/,i=10,n=\"$$$isSourceNode$$$\";function o(c,h,u,f,a){this.children=[],this.sourceContents={},this.line=c??null,this.column=h??null,this.source=u??null,this.name=a??null,this[n]=!0,f!=null&&this.add(f)}o.fromStringWithSourceMap=function(h,u,f){var a=new o,d=h.split(r),l=0,g=function(){return S()+(S()||\"\");function S(){return l<d.length?d[l++]:void 0}},m=1,y=0,_=null;return u.eachMapping(function(S){if(_!==null)if(m<S.generatedLine)w(_,g()),m++,y=0;else{var v=d[l]||\"\",p=v.substr(0,S.generatedColumn-y);d[l]=v.substr(S.generatedColumn-y),y=S.generatedColumn,w(_,p),_=S;return}for(;m<S.generatedLine;)a.add(g()),m++;if(y<S.generatedColumn){var v=d[l]||\"\";a.add(v.substr(0,S.generatedColumn)),d[l]=v.substr(S.generatedColumn),y=S.generatedColumn}_=S},this),l<d.length&&(_&&w(_,g()),a.add(d.splice(l).join(\"\"))),u.sources.forEach(function(S){var v=u.sourceContentFor(S);v!=null&&(f!=null&&(S=s.join(f,S)),a.setSourceContent(S,v))}),a;function w(S,v){if(S===null||S.source===void 0)a.add(v);else{var p=f?s.join(f,S.source):S.source;a.add(new o(S.originalLine,S.originalColumn,p,v,S.name))}}},o.prototype.add=function(h){if(Array.isArray(h))h.forEach(function(u){this.add(u)},this);else if(h[n]||typeof h==\"string\")h&&this.children.push(h);else throw new TypeError(\"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \"+h);return this},o.prototype.prepend=function(h){if(Array.isArray(h))for(var u=h.length-1;u>=0;u--)this.prepend(h[u]);else if(h[n]||typeof h==\"string\")this.children.unshift(h);else throw new TypeError(\"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \"+h);return this},o.prototype.walk=function(h){for(var u,f=0,a=this.children.length;f<a;f++)u=this.children[f],u[n]?u.walk(h):u!==\"\"&&h(u,{source:this.source,line:this.line,column:this.column,name:this.name})},o.prototype.join=function(h){var u,f,a=this.children.length;if(a>0){for(u=[],f=0;f<a-1;f++)u.push(this.children[f]),u.push(h);u.push(this.children[f]),this.children=u}return this},o.prototype.replaceRight=function(h,u){var f=this.children[this.children.length-1];return f[n]?f.replaceRight(h,u):typeof f==\"string\"?this.children[this.children.length-1]=f.replace(h,u):this.children.push(\"\".replace(h,u)),this},o.prototype.setSourceContent=function(h,u){this.sourceContents[s.toSetString(h)]=u},o.prototype.walkSourceContents=function(h){for(var u=0,f=this.children.length;u<f;u++)this.children[u][n]&&this.children[u].walkSourceContents(h);for(var a=Object.keys(this.sourceContents),u=0,f=a.length;u<f;u++)h(s.fromSetString(a[u]),this.sourceContents[a[u]])},o.prototype.toString=function(){var h=\"\";return this.walk(function(u){h+=u}),h},o.prototype.toStringWithSourceMap=function(h){var u={code:\"\",line:1,column:0},f=new t(h),a=!1,d=null,l=null,g=null,m=null;return this.walk(function(y,_){u.code+=y,_.source!==null&&_.line!==null&&_.column!==null?((d!==_.source||l!==_.line||g!==_.column||m!==_.name)&&f.addMapping({source:_.source,original:{line:_.line,column:_.column},generated:{line:u.line,column:u.column},name:_.name}),d=_.source,l=_.line,g=_.column,m=_.name,a=!0):a&&(f.addMapping({generated:{line:u.line,column:u.column}}),d=null,a=!1);for(var w=0,S=y.length;w<S;w++)y.charCodeAt(w)===i?(u.line++,u.column=0,w+1===S?(d=null,a=!1):a&&f.addMapping({source:_.source,original:{line:_.line,column:_.column},generated:{line:u.line,column:u.column},name:_.name})):u.column++}),this.walkSourceContents(function(y,_){f.setSourceContent(y,_)}),{code:u.code,map:f}},e.SourceNode=o})),au=de((e=>{e.SourceMapGenerator=yo().SourceMapGenerator,e.SourceMapConsumer=nu().SourceMapConsumer,e.SourceNode=ou().SourceNode})),lu=de((e=>{e.__esModule=!0,e.safeJsonLiteral=o;var t=ht(),s=/[\\x00-\\x1f\\\\\"\\u2028\\u2029<\\ud800-\\udfff]/,r=/<(?=!--|\\/?script)/gi;function i(f){return f.replace(r,\"\\\\u003C\")}function n(f){return\"\\\\u\"+f.charCodeAt(0).toString(16)}function o(f){return i(JSON.stringify(f).replace(/\\u2028/g,\"\\\\u2028\").replace(/\\u2029/g,\"\\\\u2029\").replace(/[\\ud800-\\udfff]/g,n))}var c=void 0;try{(typeof define!=\"function\"||!define.amd)&&(c=au().SourceNode)}catch{}c||(c=function(f,a,d,l){this.src=\"\",l&&this.add(l)},c.prototype={add:function(a){t.isArray(a)&&(a=a.join(\"\")),this.src+=a},prepend:function(a){t.isArray(a)&&(a=a.join(\"\")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function h(f,a,d){if(t.isArray(f)){for(var l=[],g=0,m=f.length;g<m;g++)l.push(a.wrap(f[g],d));return l}else if(typeof f==\"boolean\"||typeof f==\"number\")return f+\"\";return f}function u(f){this.srcFile=f,this.source=[]}u.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,d){this.source.unshift(this.wrap(a,d))},push:function(a,d){this.source.push(this.wrap(a,d))},merge:function(){var a=this.empty();return this.each(function(d){a.add([\" \",d,`\n`])}),a},each:function(a){for(var d=0,l=this.source.length;d<l;d++)a(this.source[d])},empty:function(){var a=this.currentLocation||{start:{}};return new c(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var d=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return a instanceof c?a:(a=h(a,this,d),new c(d.start.line,d.start.column,this.srcFile,a))},functionCall:function(a,d,l){return l=this.generateList(l),this.wrap([a,d?\".\"+d+\"(\":\"(\",l,\")\"])},quotedString:function(a){return a=a+\"\",s.test(a)?o(a):'\"'+a+'\"'},objectLiteral:function(a){var d=this,l=[];Object.keys(a).forEach(function(m){var y=h(a[m],d);y!==\"undefined\"&&l.push([d.quotedString(m),\":\",y])});var g=this.generateList(l);return g.prepend(\"{\"),g.add(\"}\"),g},generateList:function(a){for(var d=this.empty(),l=0,g=a.length;l<g;l++)l&&d.add(\",\"),d.add(h(a[l],this));return d},generateArray:function(a){var d=this.generateList(a);return d.prepend(\"[\"),d.add(\"]\"),d}},e.default=u})),cu=de(((e,t)=>{e.__esModule=!0;function s(d){return d&&d.__esModule?d:{default:d}}var r=Mi(),i=s(Nt()),n=ht(),o=lu(),c=s(o);function h(d){this.value=d}function u(){}u.prototype={nameLookup:function(l,g){return this.internalNameLookup(l,g)},depthedLookup:function(l){return[this.aliasable(\"container.lookup\"),\"(depths, \",this.quotedString(l),\")\"]},compilerInfo:function(){var l=r.COMPILER_REVISION;return[l,r.REVISION_CHANGES[l]]},appendToBuffer:function(l,g,m){return n.isArray(l)||(l=[l]),l=this.source.wrap(l,g),this.environment.isSimple?[\"return \",l,\";\"]:m?[\"buffer += \",l,\";\"]:(l.appendToBuffer=!0,l)},initializeBuffer:function(){return this.quotedString(\"\")},internalNameLookup:function(l,g){return this.lookupPropertyFunctionIsUsed=!0,[\"lookupProperty(\",l,\",\",this.quotedString(g),\")\"]},lookupPropertyFunctionIsUsed:!1,compile:function(l,g,m,y){this.environment=l,this.options=g,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!y,this.name=this.environment.name,this.isChild=!!m,this.context=m||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(l,g),this.useDepths=this.useDepths||l.useDepths||l.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||l.useBlockParams;var _=l.opcodes,w=void 0,S=void 0,v=void 0,p=void 0;for(v=0,p=_.length;v<p;v++)w=_[v],this.source.currentLocation=w.loc,S=S||w.loc,this[w.opcode].apply(this,w.args);if(this.source.currentLocation=S,this.pushSource(\"\"),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new i.default(\"Compile completed with content left on stack\");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend([\"var decorators = container.decorators, \",this.lookupPropertyFunctionVarDeclaration(),`;\n`]),this.decorators.push(\"return fn;\"),y?this.decorators=Function.apply(this,[\"fn\",\"props\",\"container\",\"depth0\",\"data\",\"blockParams\",\"depths\",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {\n`),this.decorators.push(`}\n`),this.decorators=this.decorators.merge()));var b=this.createFunctionContext(y);if(this.isChild)return b;var k={compiler:this.compilerInfo(),main:b};this.decorators&&(k.main_d=this.decorators,k.useDecorators=!0);var T=this.context,R=T.programs,P=T.decorators;for(v=0,p=R.length;v<p;v++)k[v]=R[v],P[v]&&(k[v+\"_d\"]=P[v],k.useDecorators=!0);return this.environment.usePartial&&(k.usePartial=!0),this.options.data&&(k.useData=!0),this.useDepths&&(k.useDepths=!0),this.useBlockParams&&(k.useBlockParams=!0),this.options.compat&&(k.compat=!0),y?k.compilerOptions=this.options:(k.compiler=JSON.stringify(k.compiler),this.source.currentLocation={start:{line:1,column:0}},k=this.objectLiteral(k),g.srcName?(k=k.toStringWithSourceMap({file:g.destName}),k.map=k.map&&k.map.toString()):k=k.toString()),k},preamble:function(){this.lastContext=0,this.source=new c.default(this.options.srcName),this.decorators=new c.default(this.options.srcName)},createFunctionContext:function(l){var g=this,m=\"\",y=this.stackVars.concat(this.registers.list);y.length>0&&(m+=\", \"+y.join(\", \"));var _=0;Object.keys(this.aliases).forEach(function(v){var p=g.aliases[v];p.children&&p.referenceCount>1&&(m+=\", alias\"+ ++_+\"=\"+v,p.children[0]=\"alias\"+_)}),this.lookupPropertyFunctionIsUsed&&(m+=\", \"+this.lookupPropertyFunctionVarDeclaration());var w=[\"container\",\"depth0\",\"helpers\",\"partials\",\"data\"];(this.useBlockParams||this.useDepths)&&w.push(\"blockParams\"),this.useDepths&&w.push(\"depths\");var S=this.mergeSource(m);return l?(w.push(S),Function.apply(this,w)):this.source.wrap([\"function(\",w.join(\",\"),`) {\n `,S,\"}\"])},mergeSource:function(l){var g=this.environment.isSimple,m=!this.forceBuffer,y=void 0,_=void 0,w=void 0,S=void 0;return this.source.each(function(v){v.appendToBuffer?(w?v.prepend(\" + \"):w=v,S=v):(w&&(_?w.prepend(\"buffer += \"):y=!0,S.add(\";\"),w=S=void 0),_=!0,g||(m=!1))}),m?w?(w.prepend(\"return \"),S.add(\";\")):_||this.source.push('return \"\";'):(l+=\", buffer = \"+(y?\"\":this.initializeBuffer()),w?(w.prepend(\"return buffer + \"),S.add(\";\")):this.source.push(\"return buffer;\")),l&&this.source.prepend(\"var \"+l.substring(2)+(y?\"\":`;\n`)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return`\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n `.trim()},blockValue:function(l){var g=this.aliasable(\"container.hooks.blockHelperMissing\"),m=[this.contextName(0)];this.setupHelperArgs(l,0,m);var y=this.popStack();m.splice(1,0,y),this.push(this.source.functionCall(g,\"call\",m))},ambiguousBlockValue:function(){var l=this.aliasable(\"container.hooks.blockHelperMissing\"),g=[this.contextName(0)];this.setupHelperArgs(\"\",0,g,!0),this.flushInline();var m=this.topStack();g.splice(1,0,m),this.pushSource([\"if (!\",this.lastHelper,\") { \",m,\" = \",this.source.functionCall(l,\"call\",g),\"}\"])},appendContent:function(l){this.pendingContent?l=this.pendingContent+l:this.pendingLocation=this.source.currentLocation,this.pendingContent=l},append:function(){if(this.isInline())this.replaceStack(function(g){return[\" != null ? \",g,' : \"\"']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var l=this.popStack();this.pushSource([\"if (\",l,\" != null) { \",this.appendToBuffer(l,void 0,!0),\" }\"]),this.environment.isSimple&&this.pushSource([\"else { \",this.appendToBuffer(\"''\",void 0,!0),\" }\"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable(\"container.escapeExpression\"),\"(\",this.popStack(),\")\"]))},getContext:function(l){this.lastContext=l},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(l,g,m,y){var _=0;!y&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(l[_++])):this.pushContext(),this.resolvePath(\"context\",l,_,g,m)},lookupBlockParam:function(l,g){this.useBlockParams=!0,this.push([\"blockParams[\",l[0],\"][\",l[1],\"]\"]),this.resolvePath(\"context\",g,1)},lookupData:function(l,g,m){l?this.pushStackLiteral(\"container.data(data, \"+l+\")\"):this.pushStackLiteral(\"data\"),this.resolvePath(\"data\",g,0,!0,m)},resolvePath:function(l,g,m,y,_){var w=this;if(this.options.strict||this.options.assumeObjects){this.push(a(this.options.strict&&_,this,g,m,l));return}for(var S=g.length,v=function(b){w.replaceStack(function(k){var T=w.nameLookup(k,g[b],l);return y?[\" && \",T]:[\" != null ? \",T,\" : \",k]})},p=m;p<S;p++)v(p)},resolvePossibleLambda:function(){this.push([this.aliasable(\"container.lambda\"),\"(\",this.popStack(),\", \",this.contextName(0),\")\"])},pushStringParam:function(l,g){this.pushContext(),this.pushString(g),g!==\"SubExpression\"&&(typeof l==\"string\"?this.pushString(l):this.pushStackLiteral(l))},emptyHash:function(l){this.trackIds&&this.push(\"{}\"),this.stringParams&&(this.push(\"{}\"),this.push(\"{}\")),this.pushStackLiteral(l?\"undefined\":\"{}\")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var l=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(l.ids)),this.stringParams&&(this.push(this.objectLiteral(l.contexts)),this.push(this.objectLiteral(l.types))),this.push(this.objectLiteral(l.values))},pushString:function(l){this.pushStackLiteral(this.quotedString(l))},pushLiteral:function(l){this.pushStackLiteral(l)},pushProgram:function(l){l!=null?this.pushStackLiteral(this.programExpression(l)):this.pushStackLiteral(null)},registerDecorator:function(l,g){var m=this.nameLookup(\"decorators\",g,\"decorator\"),y=this.setupHelperArgs(g,l);this.decorators.push([\"var decorator = \",m,\";\"]),this.decorators.push(['if (typeof decorator !== \"function\") { throw new Error(',this.quotedString('Missing decorator: \"'+g+'\"'),\"); }\"]),this.decorators.push([\"fn = \",this.decorators.functionCall(\"decorator\",\"\",[\"fn\",\"props\",\"container\",y]),\" || fn;\"])},invokeHelper:function(l,g,m){var y=this.popStack(),_=this.setupHelper(l,g),w=[];m&&w.push(_.name),w.push(y),this.options.strict||w.push(this.aliasable(\"container.hooks.helperMissing\"));var S=[\"(\",this.itemsSeparatedBy(w,\"||\"),\")\"],v=this.source.functionCall(S,\"call\",_.callParams);this.push(v)},itemsSeparatedBy:function(l,g){var m=[];m.push(l[0]);for(var y=1;y<l.length;y++)m.push(g,l[y]);return m},invokeKnownHelper:function(l,g){var m=this.setupHelper(l,g);this.push(this.source.functionCall(m.name,\"call\",m.callParams))},invokeAmbiguous:function(l,g){this.useRegister(\"helper\");var m=this.popStack();this.emptyHash();var y=this.setupHelper(0,l,g),_=[\"(\",\"(helper = \",this.lastHelper=this.nameLookup(\"helpers\",l,\"helper\"),\" || \",m,\")\"];this.options.strict||(_[0]=\"(helper = \",_.push(\" != null ? helper : \",this.aliasable(\"container.hooks.helperMissing\"))),this.push([\"(\",_,y.paramsInit?[\"),(\",y.paramsInit]:[],\"),\",\"(typeof helper === \",this.aliasable('\"function\"'),\" ? \",this.source.functionCall(\"helper\",\"call\",y.callParams),\" : helper))\"])},invokePartial:function(l,g,m){var y=[],_=this.setupParams(g,1,y);l&&(g=this.popStack(),delete _.name),m&&(_.indent=this.quotedString(m)),_.helpers=\"helpers\",_.partials=\"partials\",_.decorators=\"container.decorators\",l?y.unshift(g):y.unshift(this.nameLookup(\"partials\",g,\"partial\")),this.options.compat&&(_.depths=\"depths\"),_=this.objectLiteral(_),y.push(_),this.push(this.source.functionCall(\"container.invokePartial\",\"\",y))},assignToHash:function(l){var g=this.popStack(),m=void 0,y=void 0,_=void 0;this.trackIds&&(_=this.popStack()),this.stringParams&&(y=this.popStack(),m=this.popStack());var w=this.hash;m&&(w.contexts[l]=m),y&&(w.types[l]=y),_&&(w.ids[l]=_),w.values[l]=g},pushId:function(l,g,m){l===\"BlockParam\"?this.pushStackLiteral(\"blockParams[\"+g[0]+\"].path[\"+g[1]+\"]\"+(m?\" + \"+this.quotedString(\".\"+m):\"\")):l===\"PathExpression\"?this.pushString(g):l===\"SubExpression\"?this.pushStackLiteral(\"true\"):this.pushStackLiteral(\"null\")},compiler:u,compileChildren:function(l,g){for(var m=l.children,y=void 0,_=void 0,w=0,S=m.length;w<S;w++){y=m[w],_=new this.compiler;var v=this.matchExistingProgram(y);if(v==null){var p=this.context.programs.push(\"\")-1;y.index=p,y.name=\"program\"+p,this.context.programs[p]=_.compile(y,g,this.context,!this.precompile),this.context.decorators[p]=_.decorators,this.context.environments[p]=y,this.useDepths=this.useDepths||_.useDepths,this.useBlockParams=this.useBlockParams||_.useBlockParams,y.useDepths=this.useDepths,y.useBlockParams=this.useBlockParams}else y.index=v.index,y.name=\"program\"+v.index,this.useDepths=this.useDepths||v.useDepths,this.useBlockParams=this.useBlockParams||v.useBlockParams}},matchExistingProgram:function(l){for(var g=0,m=this.context.environments.length;g<m;g++){var y=this.context.environments[g];if(y&&y.equals(l))return y}},programExpression:function(l){var g=this.environment.children[l],m=[g.index,\"data\",g.blockParams];return(this.useBlockParams||this.useDepths)&&m.push(\"blockParams\"),this.useDepths&&m.push(\"depths\"),\"container.program(\"+m.join(\", \")+\")\"},useRegister:function(l){this.registers[l]||(this.registers[l]=!0,this.registers.list.push(l))},push:function(l){return l instanceof h||(l=this.source.wrap(l)),this.inlineStack.push(l),l},pushStackLiteral:function(l){this.push(new h(l))},pushSource:function(l){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),l&&this.source.push(l)},replaceStack:function(l){var g=[\"(\"],m=void 0,y=void 0,_=void 0;if(!this.isInline())throw new i.default(\"replaceStack on non-inline\");var w=this.popStack(!0);if(w instanceof h)m=[w.value],g=[\"(\",m],_=!0;else{y=!0;var S=this.incrStack();g=[\"((\",this.push(S),\" = \",w,\")\"],m=this.topStack()}var v=l.call(this,m);_||this.popStack(),y&&this.stackSlot--,this.push(g.concat(v,\")\"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push(\"stack\"+this.stackSlot),this.topStackName()},topStackName:function(){return\"stack\"+this.stackSlot},flushInline:function(){var l=this.inlineStack;this.inlineStack=[];for(var g=0,m=l.length;g<m;g++){var y=l[g];if(y instanceof h)this.compileStack.push(y);else{var _=this.incrStack();this.pushSource([_,\" = \",y,\";\"]),this.compileStack.push(_)}}},isInline:function(){return this.inlineStack.length},popStack:function(l){var g=this.isInline(),m=(g?this.inlineStack:this.compileStack).pop();if(!l&&m instanceof h)return m.value;if(!g){if(!this.stackSlot)throw new i.default(\"Invalid stack pop\");this.stackSlot--}return m},topStack:function(){var l=this.isInline()?this.inlineStack:this.compileStack,g=l[l.length-1];return g instanceof h?g.value:g},contextName:function(l){return this.useDepths&&l?\"depths[\"+l+\"]\":\"depth\"+l},quotedString:function(l){return this.source.quotedString(l)},objectLiteral:function(l){return this.source.objectLiteral(l)},aliasable:function(l){var g=this.aliases[l];return g?(g.referenceCount++,g):(g=this.aliases[l]=this.source.wrap(l),g.aliasable=!0,g.referenceCount=1,g)},setupHelper:function(l,g,m){var y=[];return{params:y,paramsInit:this.setupHelperArgs(g,l,y,m),name:this.nameLookup(\"helpers\",g,\"helper\"),callParams:[this.aliasable(this.contextName(0)+\" != null ? \"+this.contextName(0)+\" : (container.nullContext || {})\")].concat(y)}},setupParams:function(l,g,m){var y={},_=[],w=[],S=[],v=!m,p=void 0;v&&(m=[]),y.name=this.quotedString(l),y.hash=this.popStack(),this.trackIds&&(y.hashIds=this.popStack()),this.stringParams&&(y.hashTypes=this.popStack(),y.hashContexts=this.popStack());var b=this.popStack(),k=this.popStack();(k||b)&&(y.fn=k||\"container.noop\",y.inverse=b||\"container.noop\");for(var T=g;T--;)p=this.popStack(),m[T]=p,this.trackIds&&(S[T]=this.popStack()),this.stringParams&&(w[T]=this.popStack(),_[T]=this.popStack());return v&&(y.args=this.source.generateArray(m)),this.trackIds&&(y.ids=this.source.generateArray(S)),this.stringParams&&(y.types=this.source.generateArray(w),y.contexts=this.source.generateArray(_)),this.options.data&&(y.data=\"data\"),this.useBlockParams&&(y.blockParams=\"blockParams\"),y},setupHelperArgs:function(l,g,m,y){var _=this.setupParams(l,g,m);return _.loc=f(this),_=this.objectLiteral(_),y?(this.useRegister(\"options\"),m.push(\"options\"),[\"options=\",_]):m?(m.push(_),\"\"):_}},(function(){for(var d=\"break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false\".split(\" \"),l=u.RESERVED_WORDS={},g=0,m=d.length;g<m;g++)l[d[g]]=!0})(),u.isValidJavaScriptVariableName=function(d){return!u.RESERVED_WORDS[d]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(d)};function f(d){var l=d.source.currentLocation;return l?o.safeJsonLiteral(l):\"undefined\"}function a(d,l,g,m,y){var _=l.popStack(),w=g.length;d&&w--;for(var S=m;S<w;S++)_=l.nameLookup(_,g[S],y);return d?[l.aliasable(\"container.strict\"),\"(\",_,\", \",l.quotedString(g[w]),\", \",f(l),\" )\"]:_}e.default=u,t.exports=e.default})),uu=de(((e,t)=>{e.__esModule=!0;function s(l){return l&&l.__esModule?l:{default:l}}var r=s(Yc()),i=s(fo()),n=Qc(),o=eu(),c=s(cu()),h=s(go()),u=s(ho()),f=r.default.create;function a(){var l=f();return l.compile=function(g,m){return o.compile(g,m,l)},l.precompile=function(g,m){return o.precompile(g,m,l)},l.AST=i.default,l.Compiler=o.Compiler,l.JavaScriptCompiler=c.default,l.Parser=n.parser,l.parse=n.parse,l.parseWithoutProcessing=n.parseWithoutProcessing,l}var d=a();d.create=a,u.default(d),d.Visitor=h.default,d.default=d,e.default=d,t.exports=e.default})),We=Pl(uu(),1),hu=new Set([\"{\",\"}\",\":\",\",\",\"]\"]),Ni={\"=\":\"eq\",\"==\":\"eq\",\"!=\":\"ne\",\">\":\"gt\",\"<\":\"lt\",\">=\":\"gte\",\"<=\":\"lte\",contains:\"__contains\"},du={\"+\":\"add\",\"-\":\"sub\",\"*\":\"mul\",\"/\":\"div\",\"%\":\"mod\"},fu=[\"==\",\"!=\",\">=\",\"<=\",\"&&\",\"||\",\"=\",\">\",\"<\",\"!\",\"+\",\"*\",\"%\",\"-\",\"/\",\"?\"],pu=[\"and\",\"or\",\"not\"],bo=[\"true\",\"false\",\"null\",\"undefined\"],gu=new Set([...` \t\\r\n!\"'()<>=&|{}~+*%:,]?`]),Di=/^-?\\d+(\\.\\d+)?$/,He=class extends Error{};function mu(e,t){const s=e.substring(t+1).trimStart();if(/^[\\]\"'{[(\\d-]/.test(s))return!0;const r=e.indexOf(\"]\",t);return r!==-1&&e.substring(t,r).includes(\",\")}function vu(e){return e?.type===\"ident\"||e?.type===\"value\"||e?.type===\")\"||e?.type===\"]\"||e?.type===\"}\"}function yu(e){const t=[];let s=0;for(;s<e.length;){const r=e[s];if(/\\s/.test(r)){s++;continue}if(r===\"(\"||r===\")\"||hu.has(r)){t.push({type:r,text:r}),s++;continue}if(r==='\"'||r===\"'\"){let c=s+1;for(;c<e.length&&e[c]!==r;)e[c]===\"\\\\\"&&c++,c++;if(c>=e.length)throw new He(\"unterminated string\");t.push({type:\"value\",text:e.slice(s,c+1)}),s=c+1;continue}if(r===\"[\"&&/[\\w\\])]/.test(e[s-1]??\"\")){t.push({type:\"index\",text:r}),s++;continue}if(r===\"[\"&&mu(e,s)){t.push({type:\"[\",text:r}),s++;continue}const i=fu.find(c=>e.startsWith(c,s)&&!(c===\"-\"&&/\\d/.test(e[s+1]??\"\")));if(i){t.push({type:\"op\",text:i}),s+=i.length;continue}let n=s;for(;n<e.length&&!gu.has(e[n])&&!(e[n]===\"[\"&&n>s&&e[n-1]!==\".\"&&e[n-1]!==\"/\");){if(e[n]===\"[\"){const c=e.indexOf(\"]\",n);if(c===-1)throw new He(\"missing ']'\");n=c}n++}if(n===s)throw new He(`unexpected '${r}'`);const o=e.slice(s,n);pu.includes(o)||o===\"contains\"&&vu(t[t.length-1])?t.push({type:\"op\",text:o}):bo.includes(o)||Di.test(o)?t.push({type:\"value\",text:o}):t.push({type:\"ident\",text:o}),s=n}return t}var bu=class{constructor(e){Object.defineProperty(this,\"tokens\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"pos\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"usedInfix\",{enumerable:!0,configurable:!0,writable:!0,value:!1})}peek(e=0){return this.tokens[this.pos+e]}next(){return this.tokens[this.pos++]}isOp(e,...t){return e?.type===\"op\"&&t.includes(e.text)}startsPrimary(e){return e?.type===\"ident\"||e?.type===\"value\"||e?.type===\"(\"||e?.type===\"[\"||e?.type===\"{\"}describe(e){return e?`'${e.text}'`:\"end of expression\"}parseExpression(){const e=this.parseConditional();if(this.peek())throw new He(`unexpected ${this.describe(this.peek())}`);return e}parseArguments(e){const t=[];for(let s=0;s<e;s++)t.push(this.parsePrimary());if(!this.peek())throw new He(\"expected a value\");return t.push(this.parseExpression()),t}parseEmbed(){const e=[this.parsePrimary()];for(;this.peek()?.type===\"ident\"&&this.isOp(this.peek(1),\"=\");){const t=this.next().text;if(this.next(),!this.peek())throw new He(`expected a value after '${t}='`);e.push({kind:\"raw\",text:`${t}=${ns(this.parseConditional())}`})}if(this.peek())throw new He(`unexpected ${this.describe(this.peek())}`);return e}parseCondition(){const e=[this.parseConditional()];for(;this.peek()?.type===\"ident\"&&this.isOp(this.peek(1),\"=\");)e.push(this.parseHashPair());if(this.peek())throw new He(`unexpected ${this.describe(this.peek())}`);return e}parseHashPair(){const e=this.next().text;return this.next(),{kind:\"raw\",text:`${e}=${ns(this.parsePrimary())}`}}parseConditional(){const e=this.parseOr();if(!this.isOp(this.peek(),\"?\"))return e;if(this.next(),!this.peek())throw new He(\"expected a value after '?'\");const t=this.parseConditional();if(this.expect(\":\"),!this.peek())throw new He(\"expected a value after ':'\");const s=this.parseConditional();return this.usedInfix=!0,{kind:\"call\",name:\"cond\",args:[e,t,s]}}parseOr(){return this.parseChain([\"or\",\"||\"],\"or\",()=>this.parseAnd())}parseAnd(){return this.parseChain([\"and\",\"&&\"],\"and\",()=>this.parseNot())}parseChain(e,t,s){const r=[s()];for(;this.isOp(this.peek(),...e);){const i=this.next().text;if(!this.peek())throw new He(`expected a value after '${i}'`);r.push(s())}return r.length===1?r[0]:(this.usedInfix=!0,{kind:\"call\",name:t,args:r})}parseNot(){if(this.isOp(this.peek(),\"not\",\"!\")){const e=this.next().text;if(!this.peek())throw new He(`expected a value after '${e}'`);return this.usedInfix=!0,{kind:\"call\",name:\"not\",args:[this.parseNot()]}}return this.parseComparison()}parseComparison(){const e=this.parseAdditive(),t=this.peek();if(t?.type!==\"op\"||!(t.text in Ni))return e;if(this.next(),!this.peek())throw new He(`expected a value after '${t.text}'`);const s=this.parseAdditive(),r=this.peek();if(r?.type===\"op\"&&r.text in Ni)throw new He(`comparisons can't be chained (at '${r.text}'), use \"and\" to combine them`);return this.usedInfix=!0,{kind:\"call\",name:Ni[t.text],args:[e,s]}}parseAdditive(){return this.parseArithmetic([\"+\",\"-\"],()=>this.parseMultiplicative())}parseMultiplicative(){return this.parseArithmetic([\"*\",\"/\",\"%\"],()=>this.parseUnary())}parseArithmetic(e,t){let s=t();for(;;){let r;const i=this.peek();if(this.isOp(i,...e)){if(r=this.next().text,!this.peek())throw new He(`expected a value after '${r}'`)}else if(e.includes(\"-\")&&i?.type===\"value\"&&i.text.startsWith(\"-\")&&Di.test(i.text))r=\"-\",this.tokens[this.pos]={type:\"value\",text:i.text.slice(1)};else return s;this.usedInfix=!0,s={kind:\"call\",name:du[r],args:[s,t()]}}}parseUnary(){if(this.isOp(this.peek(),\"-\")){if(this.next(),!this.peek())throw new He(\"expected a value after '-'\");return this.usedInfix=!0,{kind:\"call\",name:\"sub\",args:[{kind:\"raw\",text:\"0\"},this.parseUnary()]}}return this.parsePrimary()}parsePrimary(){let e=this.parseAtom();for(;;){const t=this.peek();if(t?.type===\"index\"){this.next();const s=this.parseConditional();this.expect(\"]\"),this.usedInfix=!0,e={kind:\"call\",name:\"lookup\",args:[e,s]}}else if(t?.type===\"ident\"&&t.text.startsWith(\".\")&&this.tokens[this.pos-1]?.type===\"]\"){this.next();for(const s of t.text.substring(1).split(\".\")){const r=/^\\[(.*)\\]$/.exec(s)?.[1]??s;if(!r)throw new He(`unexpected '${t.text}'`);e={kind:\"call\",name:\"lookup\",args:[e,{kind:\"raw\",text:JSON.stringify(r)}]}}}else return e}}expect(e){if(this.peek()?.type!==e)throw new He(`expected '${e}' but found ${this.describe(this.peek())}`);this.next()}parseObject(){const e=[];for(;this.peek()?.type!==\"}\";){const t=this.next();if(!t)throw new He(\"expected '}' but found end of expression\");if((t.type===\"ident\"||t.type===\"value\")&&/^\\w+$/.test(t.text))e.push({kind:\"raw\",text:`\"${t.text}\"`});else if(t.type===\"value\"&&/^[\"']/.test(t.text))e.push({kind:\"raw\",text:t.text});else throw new He(`expected a name in the object, e.g. { hp: 10 }, but found '${t.text}'`);if(this.expect(\":\"),e.push(this.parseConditional()),this.peek()?.type!==\",\")break;this.next()}return this.expect(\"}\"),this.usedInfix=!0,{kind:\"call\",name:\"__object\",args:e}}parseList(){const e=[];for(;this.peek()?.type!==\"]\";){if(!this.peek())throw new He(\"expected ']' but found end of expression\");if(e.push(this.parseConditional()),this.peek()?.type!==\",\")break;this.next()}return this.expect(\"]\"),this.usedInfix=!0,{kind:\"call\",name:\"array\",args:e}}parseAtom(){const e=this.peek();if(e?.type===\"{\")return this.next(),this.parseObject();if(e?.type===\"[\")return this.next(),this.parseList();if(e?.type===\"ident\"||e?.type===\"value\")return this.next(),{kind:\"raw\",text:e.text};if(e?.type===\"(\"){this.next();const t=this.isHelperCall()?this.parseHelperCall():this.parseConditional();if(this.peek()?.type!==\")\")throw new He(`expected ')' but found ${this.describe(this.peek())}`);return this.next(),t}if(this.isOp(e,\"not\",\"!\")){const t=e?.text===\"!\"?\"!value\":\"not value\";throw new He(`'${e?.text}' must be inside parentheses here, e.g. (${t})`)}throw e?.type===\"op\"?new He(`expected a value before '${e.text}'`):new He(e?`unexpected ${this.describe(e)}`:\"expected a value\")}isHelperCall(){const e=this.peek(),t=this.peek(1);return this.isOp(e,\"and\",\"or\")?!0:e?.type===\"ident\"&&this.startsPrimary(t)}parseHelperCall(){const e=this.next().text,t=[];for(;this.peek()&&this.peek()?.type!==\")\";)this.peek()?.type===\"ident\"&&this.isOp(this.peek(1),\"=\")?t.push(this.parseHashPair()):t.push(this.parsePrimary());return{kind:\"call\",name:e,args:t}}};function ns(e){return e.kind===\"raw\"?e.text:`(${e.name} ${e.args.map(ns).join(\" \")})`}function sr(e,t,s){const r=t===\"display\"||t===\"value\";let i=null,n=[];try{n=yu(e)}catch(u){if(!r||!(u instanceof He))return null;i=u}const o=n.some(u=>u.type===\"op\"||u.type===\"index\"||u.type===\"[\"||u.type===\"{\"),c=new bu(n);let h=[];if(!i)try{h=t===\"condition\"?c.parseCondition():t===\"arguments\"?c.parseArguments(1):t===\"embed\"?c.parseEmbed():[c.parseExpression()]}catch(u){if(!(u instanceof He)||!o&&!r)return null;i=u}if(i)throw new Error(`Invalid ${s} \"${e.trim()}\": ${i.message}`);return!c.usedInfix&&!r?null:h}function Su(e){const t=sr(e,\"condition\",\"condition\");return t&&t.map(ns).join(\" \")}function _u(e){const t=sr(e,\"arguments\",\"expression\");return t&&t.map(ns).join(\" \")}function wu(e,t=\"embed\"){const s=sr(e,\"embed\",t);return s&&s.map(ns).join(\" \")}function ku(e){const t=sr(e,\"display\",\"expression\")[0];if(t.kind===\"call\")return`${t.name} ${t.args.map(ns).join(\" \")}`;if(bo.includes(t.text)||Di.test(t.text)||/^[\"']/.test(t.text))throw new Error(`Invalid expression \"${e.trim()}\": expected an attribute or a calculation`);return t.text}function xu(e){return ns(sr(e,\"value\",\"expression\")[0])}function Tu(e){const t=[];let s=0,r=null,i=0;for(let n=0;n<e.length;n++){const o=e[n];r?o===\"\\\\\"?n++:o===r&&(r=null):o==='\"'||o===\"'\"?r=o:o===\"(\"||o===\"[\"||o===\"{\"?s++:o===\")\"||o===\"]\"||o===\"}\"?s=Math.max(0,s-1):o===\",\"&&s===0&&(t.push(e.slice(i,n)),i=n+1)}return t.push(e.slice(i)),t.map(n=>n.trim()).filter(n=>n!==\"\")}var $i=/(\\\\*)\\{\\{(~?\\s*)(?:(#if|#unless|#each|#with|#every|else\\s+if|else\\s+unless)(?=[\\s(!])|(set|inc|dec|append|prepend|remove)(?=\\s)|(=)|(#?embed|goto|#animate)(?=\\s))/g;function So(e,t){let s=null,r=0;for(let i=t;i<e.length;i++){const n=e[i];if(s)n===\"\\\\\"?i++:n===s&&(s=null);else if(n==='\"'||n===\"'\")s=n;else if(n===\"{\")r++;else if(n===\"}\"&&r>0)r--;else{if(e.startsWith(\"~}}\",i))return i;if(e.startsWith(\"}}\",i))return i}}return-1}var Cu=class extends Error{constructor(e,t,s){super(e),Object.defineProperty(this,\"start\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"end\",{enumerable:!0,configurable:!0,writable:!0,value:s})}};function _o(e,t){if(!e.includes(\"{{\"))return e;let s=\"\",r=0;$i.lastIndex=0;let i;for(;(i=$i.exec(e))!==null;){if(i[1].length%2===1)continue;const n=i.index+i[0].length,o=So(e,n);if(o===-1)break;try{const c=e.slice(n,o);if(i[5]){const h=i.index+i[1].length,u=\"{{\"+i[2]+ku(c);s+=e.slice(r,h),t?.push({start:h,end:o,length:u.length}),s+=u,r=o}else{const h=i[3]?Su(c):i[6]?wu(c,i[6].replace(\"#\",\"\")):_u(c);h!==null&&(s+=e.slice(r,n),t?.push({start:n,end:o,length:h.length+1}),s+=\" \"+h,r=o)}}catch(c){throw c instanceof Error?new Cu(c.message,i.index+i[1].length,o):c}$i.lastIndex=o}return s+e.slice(r)}var Ms=e=>e==null||e===!1||e===\"\",qi=e=>typeof e==\"number\"||Ms(e)||typeof e==\"string\"&&e.trim()!==\"\"&&!isNaN(Number(e));function Ct(e,t){if(!qi(t))throw new Error(`\"${e}\" needs numbers, but was given ${JSON.stringify(t)}`);return Ms(t)?0:Number(t)}var Eu=new Set([\"__proto__\",\"prototype\",\"constructor\"]);function Ir(e){if(Eu.has(e))throw new Error(`\"${e}\" can't be used as a name inside an object`)}function Ns(e){if(!e.includes(\".\")&&!e.includes(\"[\"))return[e];const t=/^[^.[\\]]+/.exec(e);if(!t)return[e];const s=[t[0]];let r=t[0].length;for(;r<e.length;)if(e[r]===\".\"){if(e[r+1]===\"[\"){r++;continue}const i=/^[^.[\\]]+/.exec(e.substring(r+1));if(!i)return[e];s.push(i[0]),r+=1+i[0].length}else if(e[r]===\"[\"){const i=e.indexOf(\"]\",r);if(i===-1)return[e];let n=e.substring(r+1,i).trim();const o=/^([\"'])(.*)\\1$/.exec(n);o&&(n=o[2]),s.push(n),r=i+1}else return[e];return s.forEach(Ir),s}var Bi=e=>typeof e==\"object\"&&e!==null;function Hi(e,t){for(const s of t){if(!Bi(e)||!Object.prototype.hasOwnProperty.call(e,s))return null;e=e[s]}return e??null}function wo(e,t,s,r){const i=Bi(e)?structuredClone(e):e==null?{}:null;if(i===null)throw new Error(`${s} isn't an object, so it has no ${t[0]}`);let n=i,o=s;return t.forEach((c,h)=>{if(Ir(c),h===t.length-1){n[c]=r;return}o+=\".\"+c;let u=Object.prototype.hasOwnProperty.call(n,c)?n[c]:void 0;if(u==null&&(u={},n[c]=u),!Bi(u))throw new Error(`${o} isn't an object, so it has no ${t[h+1]}`);n=u}),i}function ko(e){const t=/^\\s*(\\w+)/.exec(e);if(!t)return null;const s=[];let r=t[0].length;for(;;){const i=/^\\.(\\w+)/.exec(e.substring(r));if(i){s.push({name:i[1]}),r+=i[0].length;continue}if(e[r]!==\"[\")break;const n=Au(e,r);if(n===-1)return null;s.push({index:e.substring(r+1,n)}),r=n+1}return{attribute:t[1],segments:s,rest:e.substring(r)}}function Au(e,t){let s=0,r=null;for(let i=t;i<e.length;i++){const n=e[i];if(r)n===\"\\\\\"?i++:n===r&&(r=null);else if(n==='\"'||n===\"'\")r=n;else if(n===\"[\"||n===\"(\"||n===\"{\")s++;else if((n===\"]\"||n===\")\"||n===\"}\")&&(s--,s===0))return n===\"]\"?i:-1}return-1}async function xo(e,t){const s=To(e);e.classList.add(\"fade-out\"),await s,e.innerHTML=t;const r=To(e);e.classList.remove(\"fade-out\"),e.classList.add(\"fade-in\"),await r,e.classList.remove(\"fade-in\")}function To(e,t=1e3){return new Promise(s=>{const r=()=>{e.removeEventListener(\"transitionend\",i),e.removeEventListener(\"transitioncancel\",i),clearTimeout(n),s()},i=o=>{o.target===e&&r()};e.addEventListener(\"transitionend\",i),e.addEventListener(\"transitioncancel\",i);const n=setTimeout(r,t)})}function Fi(e){if(typeof e==\"number\")return Number.isFinite(e)&&e>=0?e:null;if(typeof e!=\"string\")return null;const t=/^\\s*(\\d+(?:\\.\\d+)?|\\.\\d+)\\s*(ms|s)?\\s*$/i.exec(e);if(!t)return null;const s=Number(t[1]);return t[2]?.toLowerCase()==\"s\"?s*1e3:s}var Vi=/(\\\\*)\\{\\{~?\\s*(?:(#every)(?=[\\s}~])|(\\/every)\\s*~?\\}\\})/g;function Pu(e){if(!e.includes(\"#every\"))return e;const t=[],s=[];Vi.lastIndex=0;let r;for(;(r=Vi.exec(e))!==null;)if(r[1].length%2!==1)if(r[2]){const i=So(e,r.index+r[0].length);if(i===-1)break;const n=e.indexOf(\"}}\",i)+2,o=e.slice(r.index+r[0].length,i).trim()!==\"\";s.push({tagEnd:o?i:-1,bodyStart:n}),Vi.lastIndex=n}else{const i=s.pop();if(!i||i.tagEnd===-1)continue;const n=e.slice(i.bodyStart,r.index+r[1].length);t.push({at:i.tagEnd,text:` __body=\"${encodeURIComponent(n)}\"`})}t.sort((i,n)=>n.at-i.at);for(const{at:i,text:n}of t)e=e.slice(0,i)+n+e.slice(i);return e}var Lu=\".squiffy-every:not([data-every-stopped])\",Ru=\"squiffyEvery\",Iu=class{constructor(e,t){this.getRoot=e,this.tick=t,this.timers=new Map}sync(){const e=this.getRoot(),t=new Set(e?.isConnected?e.querySelectorAll(Lu):[]);for(const[s,r]of this.timers)t.has(s)||(clearTimeout(r),this.timers.delete(s));for(const s of t)this.timers.has(s)||this.schedule(s,Number(s.getAttribute(\"data-every-delay\"))||0)}stopAll(){for(const e of this.timers.values())clearTimeout(e);this.timers.clear()}schedule(e,t){const s=()=>{if(this.timers.delete(e),!this.tick(e)){this.schedule(e,50);return}this.sync()};s[Ru]=!0,this.timers.set(e,setTimeout(s,t))}},Ou=new Set([\"shake\",\"shudder\",\"rumble\",\"sway\",\"buoy\",\"pulse\",\"fade-in-out\",\"blink\",\"flicker\",\"blur\",\"blurrier\",\"smear\",\"mirror\",\"upside-down\"]),Mu=class{constructor(e,t,s){this.strings={restart:\"Restart\",saves:\"Saved games\",settings:\"Settings\"},this.goto=null,this.deactivate=new Set,this.stopEvery=!1,this.scopes=[],this.processing=[],this.expressionCache=new Map,this.getStory=e,this.state=t,this.getCurrentSection=s,this.handlebars=We.default.create();const r=this;this.handlebars.registerHelper(\"embed\",function(...p){const b=p.pop(),k=i(p[0]),T=r.embeddedText(k);if(T===void 0)return;const R=Object.create(null);for(const[I,q]of Object.entries(b.hash??{}))R[I]=i(q);const P=r.scopes,O=b.fn?()=>{const I=r.scopes;r.scopes=P;try{return b.fn(this,{data:b.data})}finally{r.scopes=I}}:void 0;r.scopes=[...P,{params:R,content:O}];try{return new We.default.SafeString(r.process(T,!0))}finally{r.scopes=P}}),this.handlebars.registerHelper(\"content\",()=>{const p=this.scopes[this.scopes.length-1];return p?.content?new We.default.SafeString(p.content()):this.hasAttribute(\"content\")?this.getAttribute(\"content\"):\"\"}),this.handlebars.registerHelper(\"seen\",p=>this.state.getSeen(p)),this.handlebars.registerHelper(\"visits\",p=>this.state.getVisits(p)),this.handlebars.registerHelper(\"get\",p=>this.getAttribute(p)),this.handlebars.registerHelper(\"at\",p=>{const b=this.getAttribute(\"_section\");return Array.isArray(p)?p.includes(b):b===p});const i=p=>p&&typeof p==\"object\"&&typeof p.toHTML==\"function\"?p.toString():p;this.handlebars.registerHelper(\"goto\",(...p)=>{const b=p.pop(),k=p.length?i(p[0]):void 0;if(typeof k!=\"string\"||!k||!(k in this.getStory().sections))return new We.default.SafeString(zt(\"Error in {{goto}}:\",k===void 0?'expected a section name, e.g. {{goto \"cave\"}}':`there is no section called \"${k}\"`));let T=0;if(b.hash.after!==void 0){const R=Fi(i(b.hash.after));if(R===null)return new We.default.SafeString(zt(\"Error in {{goto}}:\",`after= should be a number of milliseconds or a time, e.g. after=3000 or after=\"3s\", not \"${b.hash.after}\"`));T=R}return this.goto??(this.goto={section:k,after:T}),\"\"}),this.handlebars.registerHelper(\"every\",(...p)=>{const b=p.pop(),k=I=>new We.default.SafeString(zt(\"Error in {{#every}}:\",I)),T=p.length?Fi(i(p[0])):null;if(T===null||T<=0)return k(`expected how often to show the text, as a number of milliseconds or a time, e.g. {{#every 1000}} or {{#every \"1s\"}}${p.length?`, not \"${p[0]}\"`:\"\"}`);const R=b.hash.__body;if(typeof b.fn!=\"function\"||typeof R!=\"string\")return k(\"it needs some text to show, e.g. {{#every 1000}}Tick.{{/every}}\");let P=` data-every=\"${R}\" data-every-delay=\"${T}\" data-every-count=\"0\"`;if(b.hash.times!==void 0){const I=Number(i(b.hash.times));if(!Number.isInteger(I)||I<1)return k(`times= should be a whole number of times, e.g. times=10, not \"${b.hash.times}\"`);P+=` data-every-times=\"${I}\"`}b.hash.append&&(P+=' data-every-append=\"\"');const O=decodeURIComponent(R).includes(`\n\n`)?\"div\":\"span\";return new We.default.SafeString(`<${O} class=\"squiffy-every\"${P}></${O}>`)}),this.handlebars.registerHelper(\"stop\",()=>(this.stopEvery=!0,\"\")),this.handlebars.registerHelper(\"deactivate\",(...p)=>{p.pop();const b=p.length?p.map(i):[this.getAttribute(\"_passage\")];for(const k of b){if(typeof k!=\"string\"||!k)return new We.default.SafeString(zt(\"Error in {{deactivate}}:\",p.length?'expected a passage name, e.g. {{deactivate \"door\"}}':\"{{deactivate}} with no passage name only works in a passage\"));const T=this.getCurrentSection()?.passages,R=this.getStory().sections[\"\"]?.passages;if(!(T&&k in T)&&!(R&&k in R))return new We.default.SafeString(zt(\"Error in {{deactivate}}:\",`there is no passage called \"${k}\" in this section`));this.deactivate.add(k)}return\"\"}),this.handlebars.registerHelper(\"set\",(p,b)=>(this.setAttribute(p,i(b)),\"\")),this.handlebars.registerHelper(\"__value\",p=>(this.evaluated=i(p),\"\")),this.handlebars.registerHelper(\"unset\",p=>(this.setAttribute(p,!1),\"\"));const n=(p,b)=>{this.handlebars.registerHelper(p,(k,...T)=>{const R=T.length>1?Ct(p,i(T[0])):1,P=Ct(p,this.getAttribute(k));return this.setAttribute(k,P+b*R),\"\"})};n(\"inc\",1),n(\"dec\",-1),this.handlebars.registerHelper(\"and\",(...p)=>p.slice(0,-1).every(Boolean)),this.handlebars.registerHelper(\"or\",(...p)=>p.slice(0,-1).some(Boolean)),this.handlebars.registerHelper(\"not\",p=>!p),this.handlebars.registerHelper(\"eq\",(p,b)=>p==b),this.handlebars.registerHelper(\"ne\",(p,b)=>p!=b),this.handlebars.registerHelper(\"gt\",(p,b)=>p>b),this.handlebars.registerHelper(\"lt\",(p,b)=>p<b),this.handlebars.registerHelper(\"gte\",(p,b)=>p>=b),this.handlebars.registerHelper(\"lte\",(p,b)=>p<=b);const o=(p,b)=>{this.handlebars.registerHelper(p,(...k)=>{const T=k.slice(0,-1).map(i);if(T.length!==2)throw new Error(`\"${p}\" needs two values, but was given ${T.length}`);return b(Ct(p,T[0]),Ct(p,T[1]))})};this.handlebars.registerHelper(\"add\",(...p)=>{const b=p.slice(0,-1).map(i);if(b.length!==2)throw new Error(`\"add\" needs two values, but was given ${b.length}`);const[k,T]=b;if(qi(k)&&qi(T))return Ct(\"add\",k)+Ct(\"add\",T);const R=P=>{if(Ms(P))return\"\";if(typeof P==\"object\")throw new Error(`\"add\" can't add ${Array.isArray(P)?\"a list\":\"an object\"}`);return String(P)};return R(k)+R(T)}),o(\"sub\",(p,b)=>p-b),o(\"mul\",(p,b)=>p*b),o(\"div\",(p,b)=>{if(b===0)throw new Error(\"division by zero\");return p/b}),o(\"mod\",(p,b)=>{if(b===0)throw new Error(\"division by zero\");return p%b});const c=(p,b,k)=>{this.handlebars.registerHelper(p,(...T)=>{const R=T.slice(0,-1).map(i);if(R.length===0&&this.hasAttribute(p))return this.getAttribute(p);if(R.length!==1&&!(k&&R.length===2))throw new Error(`\"${p}\" needs ${k?\"one or two values\":\"one value\"}, but was given ${R.length}`);const P=Ct(p,R[0]);if(R.length===1)return b(P);const O=10**Ct(p,R[1]);return b(Number((P*O).toPrecision(15)))/O})};c(\"round\",Math.round,!0),c(\"floor\",Math.floor,!1),c(\"ceil\",Math.ceil,!1),c(\"abs\",Math.abs,!1);const h=(p,b)=>{this.handlebars.registerHelper(p,(...k)=>{let T=k.slice(0,-1).map(i);if(T.length===0&&this.hasAttribute(p))return this.getAttribute(p);if(T.length===1&&Array.isArray(T[0])&&(T=T[0].map(i)),T.length===0)throw new Error(`\"${p}\" needs at least one value`);return b(...T.map(R=>Ct(p,R)))})};h(\"min\",Math.min),h(\"max\",Math.max);const u=(p,b)=>{if(Ms(b))return\"\";if(typeof b==\"object\")throw new Error(`\"${p}\" needs text, but was given ${Array.isArray(b)?\"a list\":\"an object\"}`);return String(b)},f=(p,b)=>{this.handlebars.registerHelper(p,(...k)=>{const T=k.slice(0,-1).map(i);if(T.length===0&&this.hasAttribute(p))return this.getAttribute(p);if(T.length!==1)throw new Error(`\"${p}\" needs one value, but was given ${T.length}`);return b(u(p,T[0]))})};f(\"upper\",p=>p.toUpperCase()),f(\"lower\",p=>p.toLowerCase());const a=p=>p.charAt(0).toUpperCase()+p.substring(1);f(\"capitalise\",a),f(\"capitalize\",a);const d=function(...p){const b=p.pop();if(typeof b?.fn!=\"function\")throw new Error(\"once wraps the text to show the first time: {{#once}}...{{/once}}\");const k=p.length?i(p[0]):void 0;if(p.length&&(typeof k!=\"string\"||!k))throw new Error('the name of a {{#once}} is text, such as {{#once \"warning\"}}');const T=k??r.positionKey(b.loc),R=r.state.get(\"_once\")||[];return R.includes(T)?b.inverse(this):(r.state.set(\"_once\",[...R,T]),b.fn(this))};this.handlebars.registerHelper(\"once\",d),this.handlebars.registerHelper(\"firsttime\",d),this.handlebars.registerHelper(\"cond\",(...p)=>{const b=p.slice(0,-1).map(i);if(b.length===0&&this.hasAttribute(\"cond\"))return this.getAttribute(\"cond\");if(b.length!==3)throw new Error(`\"cond\" needs three values, but was given ${b.length}`);return b[0]?b[1]:b[2]}),this.handlebars.registerHelper(\"__contains\",(p,b)=>(p=i(p),b=i(b),Array.isArray(p)?p.some(k=>i(k)===b):Ms(p)?!1:typeof p==\"object\"?Object.prototype.hasOwnProperty.call(p,String(b)):String(p).includes(u(\"contains\",b)))),this.handlebars.registerHelper(\"array\",function(...p){return p.pop(),p.map(i)}),this.handlebars.registerHelper(\"__object\",(...p)=>{p.pop();const b={};for(let k=0;k<p.length;k+=2){const T=String(i(p[k]));Ir(T),b[T]=i(p[k+1])}return b}),this.handlebars.registerHelper(\"append\",(p,b)=>{const k=this.getAttribute(p)||[],T=Array.isArray(k)?[...k]:[k],R=i(b);return Array.isArray(R)?T.push(...R.map(i)):T.push(R),this.setAttribute(p,T),\"\"}),this.handlebars.registerHelper(\"prepend\",(p,b)=>{const k=this.getAttribute(p)||[],T=Array.isArray(k)?[...k]:[k],R=i(b);return Array.isArray(R)?T.unshift(...R.map(i)):T.unshift(R),this.setAttribute(p,T),\"\"}),this.handlebars.registerHelper(\"pop\",p=>{const b=this.getAttribute(p)||[];if(!Array.isArray(b)||b.length===0)return\"\";const k=[...b],T=k.shift();return this.setAttribute(p,k),T}),this.handlebars.registerHelper(\"remove\",(p,b)=>{const k=this.getAttribute(p)||[];if(!Array.isArray(k))return\"\";const T=i(b),R=k.findIndex(P=>i(P)===T);if(R!==-1){const P=[...k];P.splice(R,1),this.setAttribute(p,P)}return\"\"}),this.handlebars.registerHelper(\"contains\",(p,b)=>{let k;if(typeof p==\"string\"){const R=this.getAttribute(p);k=Array.isArray(R)?R:[]}else if(Array.isArray(p))k=p;else return!1;const T=i(b);return k.some(R=>i(R)===T)}),this.handlebars.registerHelper(\"length\",p=>{let b;if(typeof p==\"string\"){const k=this.getAttribute(p);b=Array.isArray(k)?k:[]}else if(Array.isArray(p))b=p;else return 0;return b.length});const l=(p,b)=>{if(b=i(b),Array.isArray(b))return b.map(i);if(Ms(b))return[];throw typeof b==\"string\"?new Error(`\"${p}\" needs a list, but was given the text \"${b}\". To use an attribute's list, leave out the quotes: (${p} bag), not (${p} \"bag\")`):new Error(`\"${p}\" needs a list, but was given ${typeof b==\"object\"?\"an object\":String(b)}`)},g=(p,b,k,T)=>{this.handlebars.registerHelper(p,(...R)=>{const P=R.slice(0,-1).map(i);if(P.length===0&&this.hasAttribute(p))return this.getAttribute(p);if(P.length<b||P.length>k){const O=b===k?`${b} value${b===1?\"\":\"s\"}`:`${b} to ${k} values`;throw new Error(`\"${p}\" needs ${O}, but was given ${P.length}`)}return T(P)})},m=(p,b)=>Math.trunc(Ct(p,b));g(\"join\",1,3,([p,b,k])=>{const T=l(\"join\",p).map(P=>u(\"join\",P)),R=b===void 0?\", \":u(\"join\",b);return k===void 0||T.length<2?T.join(R):T.slice(0,-1).join(R)+u(\"join\",k)+T[T.length-1]});const y=new Intl.Collator(void 0,{numeric:!0,sensitivity:\"base\"});g(\"sort\",1,1,([p])=>l(\"sort\",p).sort((b,k)=>{const T=typeof b==\"number\",R=typeof k==\"number\";return T&&R?b-k:T!==R?T?-1:1:y.compare(u(\"sort\",b),u(\"sort\",k))})),g(\"shuffle\",1,1,([p])=>{const b=l(\"shuffle\",p);for(let k=b.length-1;k>0;k--){const T=Math.floor(Math.random()*(k+1));[b[k],b[T]]=[b[T],b[k]]}return b}),g(\"slice\",2,3,([p,b,k])=>{const T=m(\"slice\",b),R=k===void 0?void 0:m(\"slice\",k);return typeof p==\"string\"?p.slice(T,R):l(\"slice\",p).slice(T,R)}),g(\"first\",1,1,([p])=>l(\"first\",p)[0]??\"\"),g(\"last\",1,1,([p])=>l(\"last\",p).slice(-1)[0]??\"\"),g(\"indexof\",2,2,([p,b])=>typeof p==\"string\"?p.indexOf(u(\"indexof\",b)):l(\"indexof\",p).indexOf(b)),g(\"count\",2,2,([p,b])=>{if(typeof p==\"string\"){const k=u(\"count\",b);return k===\"\"?0:p.split(k).length-1}return l(\"count\",p).filter(k=>k===b).length}),g(\"range\",2,2,([p,b])=>{const k=m(\"range\",p),T=m(\"range\",b);if(Math.abs(T-k)>=1e4)throw new Error(`\"range\" can make a list of up to 10,000 numbers, but was asked for ${Math.abs(T-k)+1}`);const R=T>=k?1:-1,P=[];for(let O=k;O!==T+R;O+=R)P.push(O);return P});const _=p=>String(p).replace(/&/g,\"&\").replace(/\"/g,\""\"),w=new Map,S=(p,b,k,T)=>{if(typeof p!=\"string\"||!p.includes(\"{{\"))return p;const R=(T?\"h:\":\"t:\")+p;let P=w.get(R);return P||(P=this.handlebars.compile(_o(p),{compat:!0,noEscape:!T}),w.set(R,P)),P(b,{data:k.data})},v=(p,b)=>{let k=\"\";const T=S(b.hash.set||\"\",p,b,!1);if(T){const R=this.getStory().expressions?Tu(T):T.split(\",\").map(P=>P.trim());k+=` data-set=\"${_(JSON.stringify(R))}\"`}return k};this.handlebars.registerHelper(\"section\",function(p,b){const k=S(b.hash.text||p,this,b,!0);return new We.default.SafeString(`<a class=\"squiffy-link link-section\" data-section=\"${_(p)}\"${v(this,b)} role=\"link\" tabindex=\"0\">${k}</a>`)}),this.handlebars.registerHelper(\"passage\",function(p,b){const k=S(b.hash.text||p,this,b,!0);return new We.default.SafeString(`<a class=\"squiffy-link link-passage\" data-passage=\"${_(p)}\"${v(this,b)} role=\"link\" tabindex=\"0\">${k}</a>`)}),this.handlebars.registerHelper(\"restart\",function(p){const b=S(p.hash.text||r.strings.restart,this,p,!0),k=p.hash.confirm===!1||p.hash.confirm===\"false\"?' data-confirm=\"false\"':\"\";return new We.default.SafeString(`<a class=\"squiffy-link link-restart\" data-handler=\"restart\"${k} role=\"link\" tabindex=\"0\">${b}</a>`)}),this.handlebars.registerHelper(\"saves\",function(p){const b=S(p.hash.text||r.strings.saves,this,p,!0);return new We.default.SafeString(`<a class=\"squiffy-link link-saves\" data-handler=\"saves\" role=\"link\" tabindex=\"0\">${b}</a>`)}),this.handlebars.registerHelper(\"settings\",function(p){const b=S(p.hash.text||r.strings.settings,this,p,!0);return new We.default.SafeString(`<a class=\"squiffy-link link-settings\" data-handler=\"settings\" role=\"link\" tabindex=\"0\">${b}</a>`)}),this.handlebars.registerHelper(\"style\",function(...p){const b=p.pop(),k=typeof b?.fn==\"function\"?String(b.fn(this)):\"\",T=p.flatMap(B=>String(i(B)??\"\").split(/\\s+/)).filter(B=>B.length>0),R=T.filter(B=>Ou.has(B)).slice(1),P=T.filter(B=>!R.includes(B)),O=k.includes(`\n\n`),I=O?\"div\":\"span\";let q=O?`\n\n${k.trim()}\n\n`:k;for(const B of[...R].reverse())q=`<${I} class=\"squiffy-style ${_(B)}\">${q}</${I}>`;return new We.default.SafeString(`<${I} class=\"${_([\"squiffy-style\",...P].join(\" \"))}\">${q}</${I}>`)})}evaluate(e){let t=this.expressionCache.get(e);return t||(t=this.handlebars.compile(`{{__value ${xu(e)}}}`),this.expressionCache.set(e,t)),this.evaluated=void 0,t(this.context()),this.evaluated}embeddedText(e){if(typeof e!=\"string\")return;const t=this.getCurrentSection();if(t.passages&&Object.prototype.hasOwnProperty.call(t.passages,e))return t.passages[e].text||\"\";const s=this.getStory();if(Object.prototype.hasOwnProperty.call(s.sections,e))return s.sections[e].text||\"\"}get params(){return this.scopes[this.scopes.length-1]?.params}isParam(e){const t=this.params;return!!t&&Object.prototype.hasOwnProperty.call(t,Ns(e)[0])}hasAttribute(e){return this.isParam(e)||this.state.has(e)}getAttribute(e){if(this.isParam(e)){const[t,...s]=Ns(e);return structuredClone(Hi(this.params[t],s))}return this.state.get(e)}setAttribute(e,t){if(this.isParam(e)){const[s,...r]=Ns(e);typeof t>\"u\"&&(t=!0),this.params[s]=r.length?wo(this.params[s],r,s,t):structuredClone(t);return}this.state.set(e,t)}context(){const e=this.state.getStore(),t=this.params;if(!t||!Object.keys(t).length)return e;const s=r=>typeof r==\"string\"&&Object.prototype.hasOwnProperty.call(t,r);return new Proxy({},{get:(r,i)=>s(i)?structuredClone(t[i]):Reflect.get(e,i),has:(r,i)=>s(i)||Reflect.has(e,i),ownKeys:()=>[...new Set([...Object.keys(t),...Reflect.ownKeys(e)])],getOwnPropertyDescriptor:(r,i)=>s(i)?{enumerable:!0,configurable:!0,value:structuredClone(t[i])}:Reflect.getOwnPropertyDescriptor(e,i)})}positionKey(e){const t=this.processing[this.processing.length-1]??\"\";let s=5381;for(let r=0;r<t.length;r++)s=(s*33^t.charCodeAt(r))>>>0;return` ${s.toString(36)}:${e?.start.line??0}:${e?.start.column??0}`}process(e,t){this.processing.push(e);try{return e=this.handlebars.compile(_o(Pu(e)),{compat:!0})(this.context()),t?Ii(e,{async:!1}).trim():Oi(e,{async:!1}).trim()}catch(s){const r=s instanceof Error?s.message:String(s);return console.error(\"Squiffy template error:\",r),zt(\"Template error:\",r)}finally{this.processing.pop()}}};function zt(e,t){const s=r=>r.replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\");return`<div class=\"squiffy-error\" style=\"color: red; background: #ffe0e0; padding: 8px; border: 1px solid red; margin: 4px 0; font-family: monospace; white-space: pre-wrap;\"><strong>${s(e)}</strong> ${s(t)}</div>`}var Nu=class{constructor(){this.listeners=new Map}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}off(e,t){this.listeners.get(e)?.delete(t)}once(e,t){const s=this.on(e,r=>{s(),t(r)});return s}has(e){return(this.listeners.get(e)?.size??0)>0}emit(e,t){this.listeners.get(e)?.forEach(s=>{try{s(t)}catch(r){console.error(`[Squiffy] handler for \"${String(e)}\" failed`,r)}})}},Or=\"settings\",Du=class{constructor(e,t,s,r,i){this.store={},this.playerSettings=()=>null,this.readOnly=!1,this.persist=e,this.storyId=t,this.onSet=s,this.emitter=r,this.onSetInternal=i}usePersistentStorage(){return this.persist&&window.localStorage&&this.storyId}set(e,t){this.setAt(Ns(e),t)}setAt(e,t){if(this.readOnly)return;const[s,...r]=e;if(s==Or&&this.playerSettings()){console.warn(\"Squiffy: the story can't change the player's settings.\");return}if(!r.length){this.setInternal(s,t,!0);return}typeof t>\"u\"&&(t=!0);const i=this.has(s)?this.store[s]:null;this.setInternal(s,wo(i,r,s,t),!0)}setInternal(e,t,s){typeof t>\"u\"&&(t=!0),s&&this.onSetInternal&&this.onSetInternal(e,this.getAt([e]),structuredClone(t)),this.store[e]=structuredClone(t),this.usePersistentStorage()&&(localStorage[this.storyId+\"-\"+e]=JSON.stringify(t)),s&&this.emitter.emit(\"set\",{attribute:e,value:t}),this.onSet(e,t)}has(e){return e==Or&&this.playerSettings()?!0:Object.prototype.hasOwnProperty.call(this.store,e)}get(e){return this.getAt(Ns(e))}getAt(e){const[t,...s]=e;if(!this.has(t))return null;const r=t==Or?this.playerSettings():null;if(r)return s.length?structuredClone(Hi(r,s)):{...r};const i=s.length?Hi(this.store[t],s):this.store[t];return structuredClone(i)}getStore(){return new Proxy({},{get:(e,t)=>typeof t==\"string\"&&(this.has(t)||!(t in e))?this.getAt([t]):Reflect.get(e,t),has:(e,t)=>this.has(String(t)),ownKeys:()=>[...new Set([...Object.keys(this.store),...this.playerSettings()?[Or]:[]])],getOwnPropertyDescriptor:(e,t)=>{const s=String(t);if(this.has(s))return{enumerable:!0,configurable:!0,value:this.getAt([s])}}})}load(){if(!this.usePersistentStorage())return;const e=Object.keys(localStorage);for(const t of e)if(t.startsWith(this.storyId+\"-\")){const s=t.substring(this.storyId.length+1);this.store[s]=JSON.parse(localStorage[t])}}reset(){if(this.store={},!this.usePersistentStorage())return;const e=Object.keys(localStorage);for(const t of e)t.startsWith(this.storyId)&&localStorage.removeItem(t)}setSeen(e){let t=this.get(\"_seen_sections\");t||(t=[]);const s=this.get(\"_visits\")||{};s[e]=this.getVisitsFrom(s,t,e)+1,this.set(\"_visits\",s),t.indexOf(e)==-1&&(t.push(e),this.set(\"_seen_sections\",t))}getSeen(e){const t=this.get(\"_seen_sections\");return t?t.indexOf(e)>-1:!1}getVisits(e){return this.getVisitsFrom(this.get(\"_visits\")||{},this.get(\"_seen_sections\")||[],e)}getVisitsFrom(e,t,s){return Object.prototype.hasOwnProperty.call(e,s)?e[s]:t.indexOf(s)>-1?1:0}};function Co(e,t){return!e&&!t?!0:!e||!t||e.length!==t.length?!1:e.every((s,r)=>s===t[r])}function $u(e,t,s,r,i,n){function o(a){return a.replace(/'/g,\"\\\\'\")}function c(a){return s.querySelectorAll(`[data-source='[[${o(a)}]]']`)}function h(a,d){return s.querySelectorAll(`[data-source='[[${o(a)}]][${o(d)}]']`)}function u(a){const d=new Map;for(const l of a.querySelectorAll(\"a.link-passage[data-passage]\")){const g=l.getAttribute(\"data-passage\");d.has(g)||d.set(g,[]),d.get(g).push(l)}return d}function f(a,d){const l=u(a);a.innerHTML=d;const g=u(a);for(const[m,y]of l)y.forEach((_,w)=>{const S=g.get(m)?.[w];if(!(!S||!_.classList.contains(\"disabled\"))){i(S);for(const v of[\"data-clicked\",\"data-deactivated-by\"]){const p=_.getAttribute(v);p!==null&&S.setAttribute(v,p)}}})}for(const a of Object.keys(e.sections)){const d=c(a);if(d.length){const l=t.sections[a];if(l){const g=e.sections[a],m=!Co(g.attributes,l.attributes),y=l.text!=g.text;if(m&&n(l.attributes||[]),y||m)for(const _ of d)f(_,r(l.text||\"\",l))}else for(const g of d)g.closest(\".squiffy-output-section\")?.remove()}if(e.sections[a].passages)for(const l of Object.keys(e.sections[a].passages)){const g=h(a,l);if(!g.length)continue;const m=t.sections[a]?.passages&&t.sections[a]?.passages[l];if(m){const y=e.sections[a].passages[l],_=!Co(y.attributes,m.attributes),w=m.text!=y.text;if(_&&n(m.attributes||[]),w||_)for(const S of g)f(S,r(m.text||\"\",t.sections[a]))}else for(const y of g)y.closest(\".squiffy-output-passage\")?.remove()}}}var qu=class{constructor(e,t,s,r,i,n,o,c,h,u,f){this.plugins=[],this.outputElement=e,this.textProcessor=t,this.state=s,this.linkHandler=r,this.getSectionText=i,this.getPassageText=n,this.processText=o,this.addTransition=c,this.animation=h,this.emitter=u,this.resolveAssetsInHtml=f}add(e){const t=e.init({outputElement:this.outputElement,registerHelper:(s,r)=>{this.textProcessor.handlebars.registerHelper(s,r)},registerLinkHandler:(s,r)=>{this.linkHandler.registerLinkHandler(s,r)},get:s=>this.state.get(s),set:(s,r)=>this.state.set(s,r),getSectionText:this.getSectionText,getPassageText:this.getPassageText,processText:this.processText,resolveAssetsInHtml:this.resolveAssetsInHtml,addTransition:this.addTransition,animation:this.animation,on:(s,r)=>this.emitter.on(s,r),off:(s,r)=>this.emitter.off(s,r),once:(s,r)=>this.emitter.once(s,r)});return this.plugins.push(e),t}onWrite(e){this.plugins.forEach(t=>t.onWrite?.(e))}onLoad(){this.plugins.forEach(e=>e.onLoad?.())}};function Bu(){return{name:\"replaceLabel\",init(e){e.registerHelper(\"label\",function(t,s){return new We.default.SafeString(`<span class=\"squiffy-label-${t}\">${s.fn(this)}</span>`)}),e.registerHelper(\"replace\",function(t,s){const r=String(s.fn(this)),i=e.outputElement.querySelectorAll(`.squiffy-label-${t}`),n=i[i.length-1];if(n){const o=r.includes(`\n\n`)?Oi(r,{async:!1}).trim():Ii(r,{async:!1}).trim();e.addTransition(()=>xo(n,o))}return\"\"})}}}function Hu(){const e=i=>i.replace(/&/g,\"&\").replace(/'/g,\"'\").replace(/\"/g,\""\").replace(/</g,\"<\").replace(/>/g,\">\"),t=(i,n,o,c)=>{const h=o.map(l=>l.toString()),u=r(h,null),f=c.hash.set||\"\";f&&i.set(f,u[0]);const a=e(JSON.stringify(u.slice(1))||\"\"),d=c.hash.show==\"next\"?u[1]:u[0];return new We.default.SafeString(`<a class=\"squiffy-link\" data-handler=\"${n}\" data-value=\"${e(u[0])}\" data-show=\"${c.hash.show||\"\"}\" data-options='${a}' data-attribute=\"${f}\" role=\"link\">${d}</a>`)},s=(i,n,o)=>{const c={},h=JSON.parse(n.getAttribute(\"data-options\")??\"[]\")||[],u=r(h,o?n.getAttribute(\"data-value\"):\"\");n.innerHTML=n.getAttribute(\"data-show\")==\"next\"?u[1]:u[0],n.setAttribute(\"data-value\",u[0]),n.setAttribute(\"data-options\",JSON.stringify(u.slice(1))||\"\"),u[1]||(c.disableLink=!0);const f=n.getAttribute(\"data-attribute\");return f&&i.set(f,n.getAttribute(\"data-value\")),window.getSelection()?.removeAllRanges(),c},r=(i,n)=>{const o=i[0],c=i.slice(1);return n&&c.push(n),[o,...c]};return{name:\"rotateSequence\",init(i){i.registerHelper(\"rotate\",(n,o)=>t(i,\"rotate\",n,o)),i.registerHelper(\"sequence\",(n,o)=>t(i,\"sequence\",n,o)),i.registerLinkHandler(\"rotate\",n=>s(i,n,!0)),i.registerLinkHandler(\"sequence\",n=>s(i,n,!1))}}}function Fu(){return{name:\"random\",init(e){e.registerHelper(\"random\",(t,s)=>{const r=t.map(o=>o.toString()),i=r[Math.floor(Math.random()*r.length)],n=s.hash.set||\"\";return n&&e.set(n,i),new We.default.SafeString(i)})}}}function Vu(){let e;return{name:\"live\",init(t){e=t,e.registerHelper(\"live\",(r,i)=>{const n=i.hash.section||\"\";if(n)return new We.default.SafeString(`<span class=\"squiffy-live\" data-attribute=\"${r}\" data-section=\"${n}\"></span>`);const o=i.hash.passage||\"\";return o?new We.default.SafeString(`<span class=\"squiffy-live\" data-attribute=\"${r}\" data-passage=\"${o}\"></span>`):new We.default.SafeString(`<span class=\"squiffy-live\" data-attribute=\"${r}\"></span>`)});const s=async r=>{const i=[],n=[...e.outputElement.querySelectorAll(\".squiffy-live[data-attribute]\")].filter(o=>Ns(o.dataset.attribute)[0]===r.attribute);for(const o of n){const c=o.innerHTML;let h=\"\";if(o.dataset.section){const u=e.getSectionText(o.dataset.section);u&&(h=e.processText(u,!0))}else if(o.dataset.passage){const u=e.getPassageText(o.dataset.passage);u&&(h=e.processText(u,!0))}else h=o.dataset.attribute==r.attribute?r.value:e.get(o.dataset.attribute);c!==String(h)&&i.push(xo(o,h))}await Promise.all(i)};e.on(\"set\",async r=>{await s(r)})},onWrite(t){e&&t.querySelectorAll(\".squiffy-live\").forEach(s=>{if(s.dataset.section){const r=e.getSectionText(s.dataset.section);r&&(s.innerHTML=e.processText(r,!0))}else if(s.dataset.passage){const r=e.getPassageText(s.dataset.passage);r&&(s.innerHTML=e.processText(r,!0))}else{const r=s.dataset.attribute;s.textContent=r?e.get(r):\"\"}})}}}var zu=[\"start\",\"interval\",\"duration\",\"fadeDuration\"];function Uu(){let e;const t=r=>{const i={};for(const[n,o]of Object.entries(r)){if(o==null){i[n]=o;continue}try{i[n]=JSON.parse(o)}catch{i[n]=o}}return i},s=r=>{for(const i of r.querySelectorAll(\".squiffy-animate\")){const n=t(i.dataset);if(!n.content)continue;const o=n.content.includes(`\n\n`)?Oi(n.content,{async:!1}):Ii(n.content,{async:!1});if(i.innerHTML=e.resolveAssetsInHtml(o.trim()),!n.name)continue;const c=i.innerHTML;let h=[];const u=()=>{for(const d of h)e.animation.removeLinkAnimation(d);h=[...i.querySelectorAll(\"a\")];for(const d of h)e.animation.addLinkAnimation(d,a)},f=()=>{if(n.trigger!==\"link\"){i.innerHTML=c;return}const d=h;i.innerHTML=c,u(),h.forEach((l,g)=>{const m=d[g];if(m){m.classList.contains(\"disabled\")&&l.classList.add(\"disabled\");for(const y of[\"tabindex\",\"data-clicked\",\"data-deactivated-by\"]){const _=m.getAttribute(y);_!==null&&l.setAttribute(y,_)}}})},a=()=>{n.loop?e.animation.runAnimation(n.name,i,n,()=>{},!0):(e.animation.isInitiallyHidden(n.name)&&(i.style.opacity=\"0\"),e.addTransition(()=>new Promise(d=>{i.style.opacity=\"\",e.animation.runAnimation(n.name,i,n,()=>{i.classList.remove(\"squiffy-animate\"),f(),d()},!1)})))};n.trigger===\"link\"?u():a()}};return{name:\"animate\",init(r){e=r,e.registerHelper(\"animate\",function(i,n){const o=n.fn(this),c={name:i,content:o,...n.hash};for(const f of zu){const a=Fi(c[f]);a!==null&&(c[f]=a)}const h=Object.entries(c).map(([f,a])=>` data-${We.default.escapeExpression(f)}=\"${We.default.escapeExpression(JSON.stringify(a))}\"`).join(\"\"),u=o.includes(`\n\n`)?\"div\":\"span\";return new We.default.SafeString(`<${u} class=\"squiffy-animate\"${h}></${u}>`)})},onWrite(r){s(r)},onLoad(){s(e.outputElement)}}}var rr={ReplaceLabel:Bu,RotateSequencePlugin:Hu,RandomPlugin:Fu,LivePlugin:Vu,AnimatePlugin:Uu},Wu=class{constructor(){this.linkHandlers={}}registerLinkHandler(e,t){this.linkHandlers[e]=t}handleLink(e){const t=e.getAttribute(\"data-handler\")||\"\",s=this.linkHandlers[t];return s?[!0,t,s(e)]:[!1,t,{}]}},Ut=typeof window<\"u\",dt=Ut?window:null,ee=Ut?document:null,ze={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},ve={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},St={NONE:0,AUTO:1,FORCE:2},Qe={replace:0,none:1,blend:2},Eo=Symbol(),bs=Symbol(),zi=Symbol(),ir=Symbol(),Ao=Symbol(),Ue=1e-11,Dt=1e12,ft=1e3,af=\"var(\",Mr=[],Ui=(()=>{const e=new Map;return e.set(\"x\",\"translateX\"),e.set(\"y\",\"translateY\"),e.set(\"z\",\"translateZ\"),e})(),Ss=[\"perspective\",\"translateX\",\"translateY\",\"translateZ\",\"rotate\",\"rotateX\",\"rotateY\",\"rotateZ\",\"scale\",\"scaleX\",\"scaleY\",\"scaleZ\",\"skew\",\"skewX\",\"skewY\"],Po=Ss.reduce((e,t)=>({...e,[t]:t+\"(\"}),{}),ne=()=>{},Gu=e=>e,Xu=/\\)\\s*[-.\\d]/,ju=/(^#([\\da-f]{3}){1,2}$)|(^#([\\da-f]{4}){1,2}$)/i,Yu=/rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)/i,Zu=/rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)\\s*\\)/i,Ju=/hsl\\(\\s*(-?\\d+|-?\\d*.\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*\\)/i,Ku=/hsla\\(\\s*(-?\\d+|-?\\d*.\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)\\s*\\)/i,Lo=/[-+]?\\d*\\.?\\d+(?:e[-+]?\\d)?/gi,Ro=/^([-+]?\\d*\\.?\\d+(?:e[-+]?\\d+)?)([a-z]+|%)$/i,Qu=/([a-z])([A-Z])/g,Io=/(\\*=|\\+=|-=)/,eh=/var\\(\\s*(--[\\w-]+)(?:\\s*,\\s*([^)]+))?\\s*\\)/,nr={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:ft,delay:0,loopDelay:0,ease:\"out(2)\",composition:Qe.replace,modifier:Gu,onBegin:ne,onBeforeUpdate:ne,onUpdate:ne,onLoop:ne,onPause:ne,onComplete:ne,onRender:ne},Ge={current:null,root:ee},X={defaults:nr,precision:4,timeScale:1,tickThreshold:200,editor:null},Oo={version:\"4.5.0\",engine:null};Ut&&(dt.AnimeJS||(dt.AnimeJS=[]),dt.AnimeJS.push(Oo));var Nr=e=>e.replace(Qu,\"$1-$2\").toLowerCase(),Ye=(e,t)=>e.indexOf(t)===0,os=Date.now,et=Array.isArray,Ze=e=>e&&e.constructor===Object,tt=e=>typeof e==\"number\"&&!isNaN(e),Je=e=>typeof e==\"string\",Fe=e=>typeof e==\"function\",U=e=>typeof e>\"u\",_s=e=>U(e)||e===null,Dr=e=>Ut&&e instanceof SVGElement,Mo=e=>ju.test(e),No=e=>Ye(e,\"rgb\"),Do=e=>Ye(e,\"hsl\"),th=e=>Mo(e)||(No(e)||Do(e))&&(e[e.length-1]===\")\"||!Xu.test(e)),Ds=e=>!X.defaults.hasOwnProperty(e),sh=[\"opacity\",\"rotate\",\"overflow\",\"color\"],rh=(e,t)=>{if(sh.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===\"scale\"){const s=e.parentNode;return s&&s.tagName===\"filter\"}return!0}},ws=e=>Je(e)?parseFloat(e):e,ks=Math.pow,Et=Math.sqrt,Wi=Math.sin,Gi=Math.cos,At=Math.abs,$r=Math.exp,ih=Math.ceil,$s=Math.floor,nh=Math.asin,$o=Math.max,qr=Math.atan2,Wt=Math.PI,Xi=Math.round,J=(e,t,s)=>e<t?t:e>s?s:e,G=(e,t)=>{if(t<0)return e;if(!t)return Xi(e);const s=10**t;return Xi(e*s)/s},xs=(e,t)=>et(t)?t.reduce((s,r)=>At(r-e)<At(s-e)?r:s):t?Xi(e/t)*t:e,as=(e,t,s)=>s===1?t:s===0?e:e+(t-e)*s,Br=e=>e===1/0?Dt:e===-1/0?-Dt:e,qs=e=>e<=1e-11?Ue:Br(G(e,11)),lt=e=>et(e)?[...e]:e,Pt=(e,t)=>{const s={...e};for(let r in t){const i=e[r];s[r]=U(i)?t[r]:i}return s},Pe=(e,t,s,r=\"_prev\",i=\"_next\")=>{let n=e._head,o=i;for(s&&(n=e._tail,o=r);n;){const c=n[o];t(n),n=c}},$t=(e,t,s=\"_prev\",r=\"_next\")=>{const i=t[s],n=t[r];i?i[r]=n:e._head=n,n?n[s]=i:e._tail=i,t[s]=null,t[r]=null},qt=(e,t,s,r=\"_prev\",i=\"_next\")=>{let n=e._tail;for(;n&&s&&s(n,t);)n=n[r];const o=n?n[i]:e._head;n?n[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=n,t[i]=o},oh=(e,t,s)=>{const r=e.style.transform;if(r){const i=e[ir];let n=0;const o=r.length;let c;for(;n<o;){for(;n<o&&r.charCodeAt(n)===32;)n++;if(n>=o)break;const u=n;for(;n<o&&r.charCodeAt(n)!==40;)n++;if(n>=o)break;const f=r.substring(u,n);let a=1;const d=n+1;let l=-1,g=-1;for(n++;n<o&&a>0;){const y=r.charCodeAt(n);y===40?a++:y===41?a--:y===44&&a===1&&(l===-1?l=n:g===-1&&(g=n)),n++}const m=n-1;f===\"translate\"||f===\"translate3d\"?(l===-1?i.translateX=r.substring(d,m).trim():(i.translateX=r.substring(d,l).trim(),g===-1?i.translateY=r.substring(l+1,m).trim():(i.translateY=r.substring(l+1,g).trim(),i.translateZ=r.substring(g+1,m).trim())),c=r.substring(d,m)):f===\"scale\"||f===\"scale3d\"?l===-1?i.scale=r.substring(d,m).trim():(i.scaleX=r.substring(d,l).trim(),g===-1?i.scaleY=r.substring(l+1,m).trim():(i.scaleY=r.substring(l+1,g).trim(),i.scaleZ=r.substring(g+1,m).trim())):i[f]=r.substring(d,m)}if(t===\"translate3d\"&&c)return s&&(s[t]=c),c;const h=i[t];if(!U(h))return s&&(s[t]=h),h}return t===\"translate3d\"?\"0px, 0px, 0px\":t===\"rotate3d\"?\"0, 0, 0, 0deg\":Ye(t,\"scale\")?\"1\":Ye(t,\"rotate\")||Ye(t,\"skew\")?\"0deg\":\"0px\"},qo=e=>{let t=\"\";for(let s=0,r=Ss.length;s<r;s++){const i=Ss[s],n=e[i];if(n!==void 0){if(i===\"translateX\"){const o=e.translateY;if(o!==void 0){const c=e.translateZ;c!==void 0?(t+=`translate3d(${n},${o},${c}) `,s+=2):(t+=`translate(${n},${o}) `,s+=1);continue}}if(i===\"scaleX\"&&e.scale===void 0){const o=e.scaleY;if(o!==void 0){const c=e.scaleZ;c!==void 0?(t+=`scale3d(${n},${o},${c}) `,s+=2):(t+=`scale(${n},${o}) `,s+=1);continue}}t+=`${Po[i]}${n}) `}i===\"rotateZ\"&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},ji=[];function Bo(e,t){if(!e)return null;const s=ji.length;e:for(let r=0;r<s;r++){const i=ji[r];if(i.detect&&!i.detect(e))continue;const n=i.targetAdapters;for(let o=0,c=n.length;o<c;o++){const h=n[o];if(h.detect(e)){const u=h.props[t];if(u&&(!u.gate||u.gate(e)))return u;break e}}}for(let r=0;r<s;r++){const i=ji[r];if(i.detect&&!i.detect(e))continue;const n=i.propertyResolvers;for(let o=0,c=n.length;o<c;o++){const h=n[o](e,t);if(h)return h}}return null}var ah=e=>{const t=Yu.exec(e)||Zu.exec(e),s=U(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],s]},lh=e=>{const t=e.length,s=t===4||t===5;return[+(\"0x\"+e[1]+e[s?1:2]),+(\"0x\"+e[s?2:3]+e[s?2:4]),+(\"0x\"+e[s?3:5]+e[s?3:6]),t===5||t===9?+(+(\"0x\"+e[s?4:7]+e[s?4:8])/255).toFixed(3):1]},Yi=(e,t,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e),ch=e=>{const t=Ju.exec(e)||Ku.exec(e),s=+t[1]/360,r=+t[2]/100,i=+t[3]/100,n=U(t[4])?1:+t[4];let o,c,h;if(r===0)o=c=h=i;else{const u=i<.5?i*(1+r):i+r-i*r,f=2*i-u;o=G(Yi(f,u,s+1/3)*255,0),c=G(Yi(f,u,s)*255,0),h=G(Yi(f,u,s-1/3)*255,0)}return[o,c,h,n]},uh=e=>No(e)?ah(e):Mo(e)?lh(e):Do(e)?ch(e):[0,0,0,1],j=(e,t)=>U(e)?t:e,Ho=(e,t)=>{const s=e.match(eh),r=t[bs]?t:document.documentElement;let i=getComputedStyle(r)?.getPropertyValue(s[1]);return(!i||i.trim()===\"\")&&s[2]&&(i=s[2].trim()),i||0},je=(e,t,s,r,i,n)=>{if(Fe(e)){if(!i){const c=e(t,s,r,n);return isNaN(+c)?c||0:+c}const o=()=>{const c=e(t,s,r,n);return isNaN(+c)?c||0:+c};return i.func=o,o()}if(Je(e)&&Ye(e,\"var(\")){if(!i)return Ho(e,t);const o=()=>Ho(e,t);return i.func=o,o()}return e},Zi=(e,t)=>e[bs]?e[zi]&&rh(e,t)?ze.ATTRIBUTE:Ss.includes(t)||Ui.get(t)?ze.TRANSFORM:Ye(t,\"--\")?ze.CSS_VAR:t in e.style?ze.CSS:t in e?ze.OBJECT:ze.ATTRIBUTE:ze.OBJECT,Fo=(e,t,s)=>{const r=e.style[t];r&&s&&(s[t]=r);const i=r||getComputedStyle(e[Ao]||e).getPropertyValue(t);return i===\"auto\"?\"0\":i},Ts=(e,t,s,r)=>{const i=U(s)?Zi(e,t):s,n=Bo(e,t);if(n){const o=n.get(e);return o&&r&&(r[t]=o),o??0}if(i===ze.OBJECT){const o=e[t];return o&&r&&(r[t]=o),o||0}if(i===ze.ATTRIBUTE){const o=e.getAttribute(t);return o&&r&&(r[t]=o),o}return i===ze.TRANSFORM?oh(e,t,r):i===ze.CSS_VAR?Fo(e,t,r).trimStart():Fo(e,t,r)},Cs=(e,t,s)=>s===\"-\"?e-t:s===\"+\"?e+t:e*t,Ji=()=>({t:ve.NUMBER,n:0,u:null,o:null,d:null,s:null}),mt=(e,t)=>{if(t.t=ve.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;const s=+e;if(!isNaN(s))return t.n=s,t;let r=e;r[1]===\"=\"&&(t.o=r[0],r=r.slice(2));const i=r.includes(\" \")?!1:Ro.exec(r);if(i)return t.t=ve.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(th(r))return t.t=ve.COLOR,t.d=uh(r),t;{const n=r.match(Lo);return t.t=ve.COMPLEX,t.d=n?n.map(Number):[],t.s=r.split(Lo)||[],t}},Vo=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=lt(e._toNumbers),t.s=lt(e._strings),t),st=Ji(),zo=(e,t,s)=>{const r=e._modifier,i=e._fromNumbers,n=e._toNumbers,o=e._strings;let c=o[0];for(let h=0,u=n.length;h<u;h++){const f=r(G(as(i[h],n[h],t),s)),a=o[h+1];c+=`${a?f+a:f}`,e._numbers[h]=f}return c},Hr=(e,t,s,r,i)=>{const n=e.parent,o=e.duration,c=e.completed,h=e.iterationDuration,u=e.iterationCount,f=e._currentIteration,a=e._loopDelay,d=e._reversed,l=e._alternate,g=e._hasChildren,m=e._delay,y=e._currentTime,_=m+h,w=t-m,S=J(y,-m,o),v=J(w,-m,o),p=w-y,b=v>0,k=v>=o,T=o<=Ue,R=i===St.FORCE;let P=0,O=w,I=0;if(u>1){const N=h+(k?0:a),A=~~(v/N);e._currentIteration=J(A,0,u),k&&e._currentIteration--,P=e._currentIteration%2,O=v-A*N||0}const q=d^(l&&P),B=e._ease;let W=k?q?0:o:q?h-O:O;B&&(W=h*B(W/h)||0);const E=(n?n.backwards:w<y)?!q:!!q;if(e._currentTime=w,e._iterationTime=W,e.backwards=E,b&&!e.began?(e.began=!0,!s&&!(n&&(E||!n.began))&&e.onBegin(e)):w<=0&&(e.began=!1),!s&&!g&&b&&e._currentIteration!==f&&e.onLoop(e),R||i===St.AUTO&&(t>=(n&&m>0?0:m)&&t<=_||t<=m&&S>m||t>=_&&S!==o)||W>=_&&S!==o||W<=m&&S>0&&!k||t<=S&&S===o&&c||k&&!c&&T){if(b&&(e.computeDeltaTime(S),s||e.onBeforeUpdate(e)),!g){const N=R||(E?p*-1:p)>=X.tickThreshold,A=G(e._offset+(n?n._offset:0)+m+W,12);let L=e._head,D,H,F,V,Y=0;for(;L;){const te=L._composition,se=L._currentTime,me=L._changeDuration,ge=L._absoluteStartTime+L._changeDuration,oe=L._nextRep,K=L._prevRep,ae=te!==Qe.none,Ce=K?K._absoluteStartTime+K._changeDuration:0,Re=K&&K.parent!==L.parent,Le=!oe||oe._isOverridden?ge:oe.parent===L.parent?ge+oe._delay:oe._absoluteStartTime<oe._absoluteUpdateStartTime?oe._absoluteStartTime:oe._absoluteUpdateStartTime;if((N||(se!==me||A<=Le||K&&!Re&&(!oe||oe.parent!==L.parent))&&(se!==0||A>=L._absoluteStartTime||Re&&!L._hasFromValue&&!K._isOverridden&&A>=Ce||oe&&!oe._isOverridden&&oe.parent===L.parent&&oe._currentTime!==0&&W<oe._startTime))&&(!K||Re||W>=L._startTime)&&(!ae||!L._isOverridden&&(!L._isOverlapped||A<=ge)&&(!oe||oe._isOverridden||A<=Le)&&(!K||K._isOverridden||(Re?A>=L._absoluteStartTime||!L._hasFromValue&&A>=Ce:A>=Ce+L._delay)))){const Be=L._currentTime=J(W-L._startTime,0,me),ke=L._ease(Be/L._updateDuration),be=L._modifier,Oe=L._valueType,Ie=L._tweenType,Se=Ie===ze.OBJECT,le=Oe===ve.NUMBER,_e=le&&Se||ke===0||ke===1?-1:X.precision;let ye,Me;if(le)ye=Me=be(G(as(L._fromNumber,L._toNumber,ke),_e));else if(Oe===ve.UNIT)Me=be(G(as(L._fromNumber,L._toNumber,ke),_e)),ye=`${Me}${L._unit}`;else if(Oe===ve.COLOR){const z=L._numbers,ie=L._fromNumbers,fe=L._toNumbers,ce=1-ke,Ne=ie[0],Ve=ie[1],Xe=ie[2],ts=fe[0],As=fe[1],xt=fe[2];z[0]=be(Math.sqrt(Ne*Ne*ce+ts*ts*ke)),z[1]=be(Math.sqrt(Ve*Ve*ce+As*As*ke)),z[2]=be(Math.sqrt(Xe*Xe*ce+xt*xt*ke)),z[3]=be(as(ie[3],fe[3],ke)),(!L._setter||r)&&(ye=`rgba(${G(z[0],0)},${G(z[1],0)},${G(z[2],0)},${z[3]})`)}else Oe===ve.COMPLEX&&(ye=zo(L,ke,_e));if(ae&&(L._number=Me),!r&&te!==Qe.blend){const z=L.property;D=L.target,L._setter?L._setter(D,Me,L):Se?D[z]=ye:Ie===ze.ATTRIBUTE?D.setAttribute(z,ye):(H=D.style,Ie===ze.TRANSFORM?(D!==F&&(F=D,V=D[ir]),V[z]=ye,Y=1):Ie===ze.CSS?H[z]=ye:Ie===ze.CSS_VAR&&H.setProperty(z,ye)),b&&(I=1)}else L._value=ye}else se&&K&&!Re&&W<L._startTime&&(L._currentTime=0);Y&&L._renderTransforms&&(H.transform=qo(V),Y=0),L=L._next}!s&&I&&e.onRender(e)}!s&&b&&e.onUpdate(e)}return n&&T?!s&&(n.began&&!E&&w>0&&!c||E&&w<=1e-11&&c)&&(e.onComplete(e),e.completed=!E):b&&k?u===1/0?e._startTime+=e.duration:e._currentIteration>=u-1&&(e.paused=!0,!c&&!g&&(e.completed=!0,!s&&!(n&&(E||!n.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,I},Es=(e,t,s,r,i)=>{const n=e._currentIteration;if(Hr(e,t,s,r,i),e._hasChildren){const o=e,c=o.backwards,h=r?t:o._iterationTime,u=os();let f=0,a=!0;if(!r&&o._currentIteration!==n){const d=o.iterationDuration;Pe(o,l=>{if(!c)!l.completed&&!l.backwards&&l._currentTime<l.iterationDuration&&Hr(l,d,s,1,St.FORCE),l.began=!1,l.completed=!1;else{const g=l.duration,m=l._offset+l._delay,y=m+g;!s&&g<=1e-11&&(!m||y===d)&&l.onComplete(l)}}),s||o.onLoop(o)}Pe(o,d=>{const l=G((h-d._offset)*d._speed,12);if(c&&l>d._delay+d.duration)return;const g=d._fps<o._fps?d.requestTick(u):i;f+=Hr(d,l,s,r,g),!d.completed&&a&&(a=!1)},c),!s&&f&&o.onRender(o),(a||c)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,s||(o.onComplete(o),o._resolve(o))))}},Uo={},Ki=(e,t,s)=>{if(s===ze.TRANSFORM){const r=Ui.get(e);return r||e}else if(s===ze.CSS||s===ze.ATTRIBUTE&&Dr(t)&&e in t.style){const r=Uo[e];if(r)return r;{const i=e&&Nr(e);return Uo[e]=i,i}}else return e},Fr=(e,t=!1)=>{if(e._hasChildren)Pe(e,s=>Fr(s,t),!0);else{const s=e;s.pause(),Pe(s,r=>{const i=r.property,n=r.target,o=r._tweenType,c=r._inlineValue,h=_s(c)||c===\"\";if(r._setter){if(!t&&!h){if(mt(c,st),st.d){const u=st.d,f=r._numbers;for(let a=0,d=u.length;a<d;a++)f[a]=u[a]}else r._number=st.n;r._setter(r.target,r._number,r)}}else if(o===ze.OBJECT)!t&&!h&&(n[i]=c);else if(n[bs])if(o===ze.ATTRIBUTE)t||(h?n.removeAttribute(i):n.setAttribute(i,c));else{const u=n.style;if(o===ze.TRANSFORM){const f=n[ir];h?delete f[i]:f[i]=c,r._renderTransforms&&(Object.keys(f).length?u.transform=qo(f):u.removeProperty(\"transform\"))}else h?u.removeProperty(Nr(i)):u[i]=c}n[bs]&&s._tail===r&&s.targets.forEach(u=>{u.getAttribute&&u.getAttribute(\"style\")===\"\"&&u.removeAttribute(\"style\")})})}return e},Wo=e=>Fr(e,!0),Go=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=ft/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){const t=+e,s=t<1e-11?Ue:t,r=ft/s;s>nr.frameRate&&(nr.frameRate=s),this._fps=s,this._frameDuration=r}get speed(){return this._speed}set speed(e){const t=+e;this._speed=t<1e-11?Ue:t}requestTick(e){const t=this._frameDuration,s=e-this._lastTickTime,r=t*.25;return s+(r<4?r:4)<t?St.NONE:(this._lastTickTime=s>=t?e-s%t:e,St.AUTO)}computeDeltaTime(e){const t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Bs={animation:null,update:ne},hh=e=>{let t=Bs.animation;return t||(t={duration:Ue,computeDeltaTime:ne,_offset:0,_delay:0,_head:null,_tail:null},Bs.animation=t,Bs.update=()=>{e.forEach(s=>{for(let r in s){const i=s[r],n=i._head;if(n){const o=n._valueType,c=o===ve.COMPLEX||o===ve.COLOR?lt(n._fromNumbers):null;let h=n._fromNumber,u=i._tail;for(;u&&u!==n;){if(c)for(let f=0,a=u._numbers.length;f<a;f++)c[f]+=u._numbers[f];else h+=u._number;u=u._prevAdd}n._toNumber=h,n._toNumbers=c}}}),Hr(t,1,1,0,St.FORCE)}),t},Xo=Ut?requestAnimationFrame:setImmediate,dh=Ut?cancelAnimationFrame:clearImmediate,fh=class extends Go{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=nr,this.paused=!0,this.reqId=0}update(){const e=this._currentTime=os();if(this.requestTick(e)){this.computeDeltaTime(e);const t=this._speed,s=this._fps;let r=this._head;for(;r;){const i=r._next;r.paused?($t(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Es(r,(e-r._startTime)*r._speed*t,0,0,r._fps<s?r.requestTick(e):St.AUTO),r=i}Bs.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(os()),this.reqId=Xo(jo)),this}pause(){if(this.reqId)return this.paused=!0,ph()}resume(){if(this.paused)return this.paused=!1,Pe(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(X.timeScale===1?1:ft)}set speed(e){const t=e*X.timeScale;this._speed!==t&&(this._speed=t,Pe(this,s=>s.speed=s._speed))}get timeUnit(){return X.timeScale===1?\"ms\":\"s\"}set timeUnit(e){const s=e===\"s\",r=s?.001:1;if(X.timeScale!==r){X.timeScale=r,X.tickThreshold=200*r;const i=s?.001:ft;this.defaults.duration*=i,this._speed*=i}}get precision(){return X.precision}set precision(e){X.precision=e}},rt=(()=>{const e=new fh(os());return Ut&&(Oo.engine=e,ee.addEventListener(\"visibilitychange\",()=>{e.pauseOnDocumentHidden&&(ee.hidden?e.pause():e.resume())})),e})(),jo=()=>{rt._head?(rt.reqId=Xo(jo),rt.update()):rt.reqId=0},ph=()=>(dh(rt.reqId),rt.reqId=0,rt),Vr={_rep:new WeakMap,_add:new Map},Qi=(e,t,s=\"_rep\")=>{const r=Vr[s];let i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},gh=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,zr=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=Ue,e._currentTime=Ue},Yo=(e,t)=>{const s=e._composition;if(s===Qe.replace){const r=e._absoluteStartTime;qt(t,e,gh,\"_prevRep\",\"_nextRep\");const i=e._prevRep;if(i){const n=i.parent,o=i._absoluteEndTime;if(e.parent.id!==n.id&&n.iterationCount>1&&o+(n.duration-n.iterationDuration)>r){zr(i);let u=i._prevRep;for(;u&&u.parent.id===n.id;)zr(u),u=u._prevRep}const c=e._absoluteUpdateStartTime;if(o>c){const u=i._startTime,f=o-(u+i._updateDuration),a=G(c-f-u,12);i._changeDuration=a,i._currentTime=a,i._isOverlapped=1,a<1e-11&&zr(i)}const h=e.parent.parent;if(!h||h!==n.parent){let u=!0;if(Pe(n,f=>{f._isOverlapped||(u=!1)}),u){const f=n.parent;if(f){let a=!0;Pe(f,d=>{d!==n&&Pe(d,l=>{l._isOverlapped||(a=!1)})}),a&&f.cancel()}else n.cancel()}}}}else if(s===Qe.blend){const r=Qi(e.target,e.property,\"_add\"),i=hh(Vr._add);let n=r._head;n||(n={...e},n._composition=Qe.replace,n._updateDuration=Ue,n._startTime=0,n._numbers=lt(e._fromNumbers),n._number=0,n._next=null,n._prev=null,qt(r,n),qt(i,n));const o=e._toNumber;if(e._fromNumber=n._fromNumber-o,e._toNumber=0,e._numbers=lt(e._fromNumbers),e._number=0,n._fromNumber=o,e._toNumbers.length){const c=lt(e._toNumbers);c.forEach((h,u)=>{e._fromNumbers[u]=n._fromNumbers[u]-h,e._toNumbers[u]=0}),n._fromNumbers=c}qt(r,e,null,\"_prevAdd\",\"_nextAdd\")}return e},Zo=e=>{const t=e._composition;if(t!==Qe.none){const s=e.target,r=e.property,i=Vr._rep.get(s)[r];if($t(i,e,\"_prevRep\",\"_nextRep\"),t===Qe.blend){const n=Vr._add,o=n.get(s);if(!o)return;const c=o[r],h=Bs.animation;$t(c,e,\"_prevAdd\",\"_nextAdd\");const u=c._head;if(u&&u===c._tail){$t(c,u,\"_prevAdd\",\"_nextAdd\"),$t(h,u);let f=!0;for(let a in o)if(o[a]._head){f=!1;break}f&&n.delete(s)}}}return e},Jo=(e,t,s)=>{let r=!1;return Pe(t,i=>{const n=i.target;if(e.includes(n)){const o=i.property,c=i._tweenType,h=Ki(s,n,c);(!h||h&&h===o)&&(i.parent._tail===i&&i._tweenType===ze.TRANSFORM&&i._prev&&i._prev._tweenType===ze.TRANSFORM&&(i._prev._renderTransforms=1),$t(t,i),Zo(i),r=!0)}},!0),r},Zt=(e,t,s)=>{const r=t||rt;let i;if(r._hasChildren){let n=0;Pe(r,o=>{if(!o._hasChildren)if(i=Jo(e,o,s),i&&!o._head)o.cancel(),$t(r,o);else{const c=o._offset+o._delay+o.duration;c>n&&(n=c)}o._head?Zt(e,o,s):o._hasChildren=!1},!0),U(r.iterationDuration)||(r.iterationDuration=n)}else i=Jo(e,r,s);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},Ko=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),en=e=>(e._cancelled&&(e._hasChildren?Pe(e,en):Pe(e,t=>{t._composition!==Qe.none&&Yo(t,Qi(t.target,t.property))}),e._cancelled=0),e),Qo=0,mh=(e,t)=>e._priority>t._priority,_t=class extends Go{constructor(e={},t=null,s=0){super(0),++Qo;const{id:r,delay:i,duration:n,reversed:o,alternate:c,loop:h,loopDelay:u,autoplay:f,frameRate:a,playbackRate:d,priority:l,onComplete:g,onLoop:m,onPause:y,onBegin:_,onBeforeUpdate:w,onUpdate:S}=e;Ge.current&&Ge.current.register(this);const v=t?0:rt._lastTickTime,p=t?t.defaults:X.defaults,b=Fe(i)||U(i)?p.delay:+i,k=Fe(n)||U(n)?1/0:+n,T=j(h,p.loop),R=j(u,p.loopDelay);let P=T===!0||T===1/0||T<0?1/0:T+1,O=0;t?O=s:(rt.reqId||rt.requestTick(os()),O=(rt._lastTickTime-rt._startTime)*X.timeScale),this.id=U(r)?Qo:r,this.parent=t,this.duration=Br((k+R)*P-R)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||p.onBegin,this.onBeforeUpdate=w||p.onBeforeUpdate,this.onUpdate=S||p.onUpdate,this.onLoop=m||p.onLoop,this.onPause=y||p.onPause,this.onComplete=g||p.onComplete,this.iterationDuration=k,this.iterationCount=P,this._autoplay=t?!1:j(f,p.autoplay),this._offset=O,this._delay=b,this._loopDelay=R,this._iterationTime=0,this._currentIteration=0,this._resolve=ne,this._running=!1,this._reversed=+j(o,p.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=j(c,p.alternate),this._prev=null,this._next=null,this._lastTickTime=v,this._startTime=v,this._lastTime=v,this._fps=j(a,p.frameRate),this._speed=j(d,p.playbackRate),this._priority=+j(l,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return J(G(this._currentTime,X.precision),-this._delay,this.duration)}set currentTime(e){const t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return J(G(this._iterationTime,X.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return J(G(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return J(G(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){const t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*J(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return en(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Es(this,0,1,~~e,St.FORCE),Ko(this),this._hasChildren&&Pe(this,Ko),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Es(this,this.duration,1,~~e,St.FORCE),this.reset(e);const t=this._autoplay;return t===!0?this.resume():t&&!U(t.linked)&&t.link(this),this}resetTime(){const e=1/(this._speed*rt._speed);return this._startTime=os()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?Es(this,Ue,0,0,St.FORCE):(this._running||(qt(rt,this,mh),rt._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,rt.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,s=0){en(this),this.completed=!1;const r=this.paused;return this.paused=!0,Es(this,e+this._delay,~~t,~~s,St.AUTO),r?this:this.resume()}alternate(){const e=this._reversed,t=this.iterationCount,s=this.iterationDuration,r=t===1/0?$s(Dt/s):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(s*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?Pe(this,e=>e.cancel(),!0):Pe(this,Zo),this._cancelled=1,this.pause()}stretch(e){const t=this.duration,s=qs(e);if(t===s)return this;const r=e/t,i=e<=Ue;return this.duration=i?Ue:s,this.iterationDuration=i?Ue:qs(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Es(this,0,1,0,St.AUTO);const e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=ne){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=ne};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},vh=e=>new _t(e,null,0).init();function tn(e){const t=Je(e)?Ge.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function wt(e){if(_s(e))return[];if(!Ut)return et(e)&&e.flat(1/0)||[e];if(et(e)){const s=e.flat(1/0),r=[];for(let i=0,n=s.length;i<n;i++){const o=s[i];if(!_s(o)){const c=tn(o);if(c)for(let h=0,u=c.length;h<u;h++){const f=c[h];if(!_s(f)){let a=!1;for(let d=0,l=r.length;d<l;d++)if(r[d]===f){a=!0;break}a||r.push(f)}}else{let h=!1;for(let u=0,f=r.length;u<f;u++)if(r[u]===o){h=!0;break}h||r.push(o)}}}return r}const t=tn(e);return t?Array.from(t):[e]}function ls(e){const t=wt(e),s=t.length;for(let r=0;r<s;r++){const i=t[r];if(!i[Eo]){i[Eo]=!0;const n=Dr(i);(i.nodeType||n)&&(i[bs]=!0,i[zi]=n,i[ir]={})}}return t}var sn={deg:1,rad:180/Wt,turn:360},ea={},Ur=(e,t,s,r=!1)=>{const i=t.u,n=t.n;if(t.t===ve.UNIT&&i===s)return t;const o=n+i+s,c=ea[o];if(!U(c)&&!r)t.n=c;else{let h;if(i in sn)h=n*sn[i]/sn[s];else{const f=e.cloneNode(),a=e.parentNode,d=a&&a!==ee?a:ee.body;d.appendChild(f);const l=f.style;l.width=100+i;const g=f.offsetWidth||100;l.width=100+s;const m=g/(f.offsetWidth||100);d.removeChild(f),h=m*n}t.n=h,ea[o]=h}return t.t,ve.UNIT,t.u=s,t},kt=e=>e,or=(e=1.68)=>t=>ks(t,+e),rn={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},yh=Wt/2,ta=Wt*2,sa={\"\":or,Quad:or(2),Cubic:or(3),Quart:or(4),Quint:or(5),Sine:e=>1-Gi(e*yh),Circ:e=>1-Et(1-e*e),Expo:e=>e?ks(2,10*e-10):0,Bounce:e=>{let t,s=4;for(;e<((t=ks(2,--s))-1)/11;);return 1/ks(4,3-s)-7.5625*ks((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{const s=J(+e,1,10),r=J(+t,Ue,2),i=r/ta*nh(1/s),n=ta/r;return o=>o===0||o===1?o:-s*ks(2,-10*(1-o))*Wi((1-o-i)*n)}},Jt=(()=>{const e={linear:kt,none:kt};for(let t in rn)for(let s in sa){const r=sa[s],i=rn[t];e[t+s]=s===\"\"||s===\"Back\"||s===\"Elastic\"?(n,o)=>i(r(n,o)):i(r)}return e})(),Wr={linear:kt,none:kt},ra=e=>{if(Wr[e])return Wr[e];if(e.indexOf(\"(\")<=-1){const t=rn[e]||e.includes(\"Back\")||e.includes(\"Elastic\")?Jt[e]():Jt[e];return t?Wr[e]=t:kt}else{const t=e.slice(0,-1).split(\"(\"),s=Jt[t[0]];return s?Wr[e]=s(...t[1].split(\",\")):kt}},ia=[\"steps(\",\"irregular(\",\"linear(\",\"cubicBezier(\"],Kt=e=>{if(Je(e)){for(let t=0,s=ia.length;t<s;t++)if(Ye(e,ia[t]))return console.warn(`String syntax for \\`ease: \"${e}\"\\` has been removed from the core and replaced by importing and passing the easing function directly: \\`ease: ${e}\\``),kt}return Fe(e)?e:Je(e)?ra(e):kt},re=Ji(),pe=Ji(),Hs={},Gr={func:null},Xr={func:null},jr=[null],Fs=[null,null],Yr={to:null},bh=0,na=0,cs,Gt,Sh=(e,t)=>{const s={};if(et(e)){const r=[].concat(...e.map(i=>Object.keys(i))).filter(Ds);for(let i=0,n=r.length;i<n;i++){const o=r[i];s[o]=e.map(c=>{const h={};for(let u in c){const f=c[u];Ds(u)?u===o&&(h.to=f):h[u]=f}return h})}}else{const r=j(t.duration,X.defaults.duration);Object.keys(e).map(i=>({o:parseFloat(i)/100,p:e[i]})).sort((i,n)=>i.o-n.o).forEach(i=>{const n=i.o,o=i.p;for(let c in o)if(Ds(c)){let h=s[c];h||(h=s[c]=[]);const u=n*r;let f=h.length,a=h[f-1];const d={to:o[c]};let l=0;for(let g=0;g<f;g++)l+=h[g].duration;f===1&&(d.from=a.to),o.ease&&(d.ease=o.ease),d.duration=u-(f?l:0),h.push(d)}return i});for(let i in s){const n=s[i];let o;for(let c=0,h=n.length;c<h;c++){const u=n[c],f=u.ease;u.ease=o||void 0,o=f}n[0].duration||n.shift()}}return s},Qt=class extends _t{constructor(e,t,s,r,i=!1,n=0,o){super(t,s,r),this._head,this._tail,++na;const c=ls(e),h=c.length,u=t.keyframes,f=u?Pt(Sh(u,t),t):t,{id:a,delay:d,duration:l,ease:g,playbackEase:m,modifier:y,composition:_,onRender:w}=f,S=s?s.defaults:X.defaults,v=j(g,S.ease),p=j(m,S.playbackEase),b=p?Kt(p):null,k=!U(v.ease),T=k?v.ease:j(g,b?\"linear\":S.ease),R=k?v.settlingDuration:j(l,S.duration),P=j(d,S.delay),O=y||S.modifier,I=U(_)&&h>=1e3?Qe.none:U(_)?S.composition:_,q=this._offset+(s?s._offset:0);k&&(v.parent=this);let B=NaN,W=NaN,E=0,N=0;for(let A=0;A<h;A++){const L=c[A],D=n||A,H=o||c;let F=NaN,V=NaN;for(let Y in f)if(Ds(Y)){const te=Zi(L,Y),se=Bo(L,Y),me=Ki(Y,L,te);let ge=f[Y];const oe=et(ge);if(i&&!oe&&(Fs[0]=ge,Fs[1]=ge,ge=Fs),oe){const Be=ge.length,ke=!Ze(ge[0]);Be===2&&ke?(Yr.to=ge,jr[0]=Yr,cs=jr):Be>2&&ke?(cs=[],ge.forEach((be,Oe)=>{Oe?Oe===1?(Fs[1]=be,cs.push(Fs)):cs.push(be):Fs[0]=be})):cs=ge}else jr[0]=ge,cs=jr;let K=null,ae=null,Ce=NaN,Re=0,Le=0;for(let Be=cs.length;Le<Be;Le++){const ke=cs[Le];Ze(ke)?Gt=ke:(Yr.to=ke,Gt=Yr),Gr.func=null,Xr.func=null;const be=je(j(Gt.composition,I),L,D,H,null,null),Oe=tt(be)?be:Qe[be];!K&&Oe!==Qe.none&&(K=Qi(L,me));const Ie=K?K._tail:null,Se=s&&Ie&&Ie.parent.parent===s?Ie:ae,le=je(Gt.to,L,D,H,Gr,Se);let _e;Ze(le)&&!U(le.to)?(Gt=le,_e=le.to):_e=le;const ye=je(Gt.from,L,D,H,Xr,Se),Me=Gt.ease||T,z=je(Me,L,D,H,null,Se),ie=Fe(z)||Je(z)?z:Me,fe=!U(ie)&&!U(ie.ease),ce=fe?ie.ease:ie,Ne=fe?ie.settlingDuration:je(j(Gt.duration,Be>1?je(R,L,D,H,null,Se)/Be:R),L,D,H,null,Se),Ve=je(j(Gt.delay,Le?0:P),L,D,H,null,Se),Xe=Gt.modifier||O,ts=!U(ye),As=!U(_e),xt=et(_e),Us=xt||ts&&As,gi=ae?Re:0,_r=ae?Re+Ve:Ve,Tt=G(q+_r,12),Mn=G(q+gi,12);!N&&(ts||xt)&&(N=1);let yt=ae;if(Oe!==Qe.none){let xe=K._head;for(;xe&&xe._absoluteStartTime<=Tt;)if(xe._isOverridden||(yt=xe),xe=xe._nextRep,xe&&xe._absoluteStartTime>=Tt)for(;xe;)zr(xe),xe=xe._nextRep}if(Us){mt(xt?je(_e[0],L,D,H,Xr,Se):ye,re),mt(xt?je(_e[1],L,D,H,Gr,Se):_e,pe);const xe=Ts(L,me,te,Hs);re.t===ve.NUMBER&&(yt?yt._valueType===ve.UNIT&&(re.t=ve.UNIT,re.u=yt._unit):(mt(xe,st),st.t===ve.UNIT&&(re.t=ve.UNIT,re.u=st.u)))}else As?mt(_e,pe):ae?Vo(ae,pe):mt(s&&yt&&yt.parent.parent===s?yt._value:Ts(L,me,te,Hs),pe),ts?mt(ye,re):ae?Vo(ae,re):mt(s&&yt&&yt.parent.parent===s?yt._value:Ts(L,me,te,Hs),re);if(re.o&&(re.n=Cs(yt?yt._toNumber:mt(Ts(L,me,te,Hs),st).n,re.n,re.o)),pe.o&&(pe.n=Cs(re.n,pe.n,pe.o)),re.t!==pe.t){if(re.t===ve.COMPLEX||pe.t===ve.COMPLEX){const xe=re.t===ve.COMPLEX?re:pe,at=re.t===ve.COMPLEX?pe:re;at.t=ve.COMPLEX,at.s=lt(xe.s),at.d=xe.d.map(()=>at.n)}else if(re.t===ve.UNIT||pe.t===ve.UNIT){const xe=re.t===ve.UNIT?re:pe,at=re.t===ve.UNIT?pe:re;at.t=ve.UNIT,at.u=xe.u}else if(re.t===ve.COLOR||pe.t===ve.COLOR){const xe=re.t===ve.COLOR?re:pe,at=re.t===ve.COLOR?pe:re;at.t=ve.COLOR,at.d=xe.d.map(()=>0)}}if(re.u!==pe.u){let xe=pe.u?re:pe;xe=Ur(L,xe,pe.u?pe.u:re.u,!1)}if(pe.d&&re.d&&pe.d.length!==re.d.length){const xe=re.d.length>pe.d.length?re:pe,at=xe===re?pe:re;at.d=xe.d.map((Nn,we)=>U(at.d[we])?0:at.d[we]),at.s=lt(xe.s)}const ds=G(+Ne||1e-11,12);let Ee=Hs[me];_s(Ee)||(Hs[me]=null);const wr=se?se.set:null;Re=G(_r+ds,12);const ot=re.d,Xt=pe.d,jt=pe.s,gt={parent:this,id:bh++,property:me,target:L,_value:null,_toFunc:Gr.func,_fromFunc:Xr.func,_ease:Kt(ce),_fromNumbers:ot?lt(ot):Mr,_toNumbers:Xt?lt(Xt):Mr,_strings:jt?lt(jt):Mr,_fromNumber:re.n,_toNumber:pe.n,_numbers:ot?lt(ot):Mr,_number:re.n,_unit:pe.u,_modifier:Xe,_currentTime:0,_startTime:_r,_delay:+Ve,_updateDuration:ds,_changeDuration:ds,_absoluteStartTime:Tt,_absoluteUpdateStartTime:Mn,_absoluteEndTime:G(q+Re,12),_hasFromValue:ts||xt?1:0,_tweenType:te,_setter:wr,_valueType:pe.t,_composition:Oe,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:Ee,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};Oe!==Qe.none&&Yo(gt,K);const Ws=gt._valueType;if(Ws===ve.COMPLEX)gt._value=zo(gt,1,-1);else if(Ws===ve.UNIT)gt._value=`${Xe(gt._toNumber)}${gt._unit}`;else if(Ws===ve.COLOR){const xe=pe.d;gt._value=`rgba(${G(xe[0],0)},${G(xe[1],0)},${G(xe[2],0)},${xe[3]})`}else gt._value=Xe(gt._toNumber);isNaN(Ce)&&(Ce=gt._startTime),ae=gt,E++,qt(this,gt)}(isNaN(W)||Ce<W)&&(W=Ce),(isNaN(B)||Re>B)&&(B=Re),te===ze.TRANSFORM&&(F=E-Le,V=E)}if(!isNaN(F)){let Y=0;Pe(this,te=>{Y>=F&&Y<V&&(te._renderTransforms=1,te._composition===Qe.blend&&Pe(Bs.animation,se=>{se.id===te.id&&(se._renderTransforms=1)})),Y++})}}h||console.warn(\"No target found. Make sure the element you're trying to animate is accessible before creating your animation.\"),W?(Pe(this,A=>{A._startTime-A._delay||(A._delay-=W),A._startTime-=W}),B-=W):W=0,B||(B=Ue,this.iterationCount=0),this.targets=c,this.id=U(a)?na:a,this.duration=B===1e-11?Ue:Br((B+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=w||S.onRender,this._ease=b,this._delay=W,this.iterationDuration=B,!this._autoplay&&N&&this.onRender(this)}stretch(e){const t=this.duration;if(t===qs(e))return this;const s=e/t;return Pe(this,r=>{r._updateDuration=qs(r._updateDuration*s),r._changeDuration=qs(r._changeDuration*s),r._currentTime*=s,r._delay*=s,r._startTime*=s,r._absoluteStartTime*=s,r._absoluteUpdateStartTime*=s,r._absoluteEndTime*=s}),super.stretch(e)}refresh(){return Pe(this,e=>{const t=e._toFunc,s=e._fromFunc;(t||s)&&(s?(mt(s(),re),re.u!==e._unit&&e.target[bs]&&Ur(e.target,re,e._unit,!0),e._fromNumbers=lt(re.d),e._fromNumber=re.n):t&&(mt(Ts(e.target,e.property,e._tweenType),st),e._fromNumbers=lt(st.d),e._fromNumber=st.n),t&&(mt(t(),pe),e._toNumbers=lt(pe.d),e._strings=lt(pe.s),e._toNumber=pe.o?Cs(e._fromNumber,pe.n,pe.o):pe.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Fr(this)}then(e){return super.then(e)}},ar=(e,t)=>X.editor?X.editor.addAnimation(e,t):new Qt(e,t,null,0,!1).init(),_h=(e,t)=>{if(Ye(t,\"<\")){const s=t[1]===\"<\",r=e._tail,i=r?r._offset+r._delay:0;return s?i:i+r.duration}},lr=(e,t)=>{let s=e.iterationDuration;if(s===1e-11&&(s=0),U(t))return s;if(tt(+t))return+t;const r=t,i=e?e.labels:null,n=!_s(i),o=_h(e,r),c=!U(o),h=Io.exec(r);if(h){const u=h[0],f=r.split(u),a=n&&f[0]?i[f[0]]:s,d=c?o:n?a:s,l=+f[1];return Cs(d,l,u[0])}else return c?o:n?U(i[r])?s:i[r]:s};function wh(e){return Br((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function nn(e,t,s,r,i,n){const o=tt(e.duration)&&e.duration<=1e-11?s-Ue:s;t.composition&&Es(t,o,1,1,St.AUTO);const c=r?new Qt(r,e,t,o,!1,i,n):new _t(e,t,o);return t.composition&&c.init(!0),qt(t,c),Pe(t,h=>{const u=h._offset+h._delay+h.duration;u>t.iterationDuration&&(t.iterationDuration=u)}),t.duration=wh(t),t}var oa=0,aa=class extends _t{constructor(e={}){super(e,null,0),++oa,this.id=U(e.id)?oa:e.id,this.duration=0,this.labels={};const t=e.defaults,s=X.defaults;this.defaults=t?Pt(t,s):s,this.composition=j(e.composition,!0),this.onRender=e.onRender||s.onRender;const r=j(e.playbackEase,s.playbackEase);this._ease=r?Kt(r):null,this.iterationDuration=0}add(e,t,s){const r=Ze(t),i=Ze(e);if(r||i){if(this._hasChildren=!0,r){const n=t,o=X.editor&&X.editor.addTimelineChild,c=s&&s.type===\"Stagger\"&&X.editor,h=Fe(s)?s:null;if(h||c){const u=wt(e),f=this.duration,a=this.iterationDuration,d=n.id;let l=0;const g=u.length,m=o?o(e,n,this.id,s,g):null,y=h||X.editor.resolveStagger(s.defaultValue);u.forEach(_=>{const w={...m||n};this.duration=f,this.iterationDuration=a,U(d)||(w.id=d+\"-\"+l);const S=lr(this,y(_,l,u,null,this));nn(w,this,S,_,l,u),l++})}else{const u=o?o(e,n,this.id,s):n,f=s&&s.type?s.defaultValue:s;nn(u,this,lr(this,f),e)}}else nn(e,this,lr(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(U(e)||e&&U(e.pause))return this;e.pause();const s=+(e.effect?e.effect.getTiming().duration:e.duration);!U(e)&&!U(e.persist)&&(e.persist=!0);const r=X.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);const n=this.add(e,{currentTime:[0,s],duration:s,delay:0,ease:\"linear\",playbackEase:\"linear\"},t);return r&&(r.addTimelineChild=i),n}set(e,t,s){return U(t)?this:(t.duration=Ue,t.composition=Qe.replace,this.add(e,t,s))}call(e,t){return U(e)||e&&!Fe(e)?this:(X.editor&&X.editor.addTimelineCall&&(t=X.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return U(e)||e&&!Je(e)?this:(X.editor&&X.editor.addTimelineLabel&&(t=X.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=lr(this,t),this)}remove(e,t){return Zt(wt(e),this,t),this}stretch(e){const t=this.duration;if(t===qs(e))return this;const s=e/t,r=this.labels;Pe(this,i=>i.stretch(i.duration*s));for(let i in r)r[i]*=s;return super.stretch(e)}refresh(){return Pe(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),Pe(this,e=>e.revert,!0),Fr(this)}then(e){return super.then(e)}},la=e=>X.editor?X.editor.addTimeline(e):new aa(e).init(),on=class{constructor(e,t){Ge.current&&Ge.current.register(this);const s=()=>{this.callbacks.completed&&this.callbacks.reset(),this.callbacks.play()},r=()=>{if(this.callbacks.completed)return;let c=!0;for(let h in this.animations)if(!this.animations[h].paused&&c){c=!1;break}c&&this.callbacks.complete()},i={onBegin:s,onComplete:r,onPause:r},n={v:1,autoplay:!1},o={};if(this.targets=[],this.animations={},this.callbacks=null,!(U(e)||U(t))){for(let c in t){const h=t[c];Ds(c)?o[c]=h:Ye(c,\"on\")?n[c]=h:i[c]=h}this.callbacks=new Qt({v:0},n);for(let c in o){const h=o[c],u=Ze(h);let f={},a=\"+=0\";if(u){const g=h.unit;Je(g)&&(a+=g)}else f.duration=h;f[c]=u?Pt({to:a},h):a;const d=Pt(i,f);d.composition=Qe.replace,d.autoplay=!1;const l=this.animations[c]=new Qt(e,d,null,0,!1).init();this.targets.length||this.targets.push(...l.targets),this[c]=(g,m,y)=>{const _=l._head;if(U(g)&&_){const w=_._numbers;return w&&w.length?w:_._modifier(_._number)}else return Pe(l,w=>{if(et(g))for(let S=0,v=g.length;S<v;S++)U(w._numbers[S])||(w._fromNumbers[S]=w._modifier(w._numbers[S]),w._toNumbers[S]=g[S]);else w._fromNumber=w._modifier(w._number),w._toNumber=g;U(y)||(w._ease=Kt(y)),w._currentTime=0}),U(m)||l.stretch(m),l.reset(!0).resume(),this}}}}revert(){for(let e in this.animations)this[e]=ne,this.animations[e].revert();return this.animations={},this.targets.length=0,this.callbacks&&this.callbacks.revert(),this}},kh=(e,t)=>new on(e,t),xh=Ps({clamp:()=>J,damp:()=>Rh,degToRad:()=>Ph,lerp:()=>as,mapRange:()=>cr,padEnd:()=>Eh,padStart:()=>Ch,radToDeg:()=>Lh,round:()=>G,roundPad:()=>Th,snap:()=>xs,wrap:()=>Ah}),Th=(e,t)=>(+e).toFixed(t),Ch=(e,t,s)=>`${e}`.padStart(t,s),Eh=(e,t,s)=>`${e}`.padEnd(t,s),Ah=(e,t,s)=>((e-t)%(s-t)+(s-t))%(s-t)+t,cr=(e,t,s,r,i)=>r+(e-t)/(s-t)*(i-r),Ph=e=>e*Math.PI/180,Lh=e=>e*180/Math.PI,Rh=(e,t,s,r)=>r?r===1?t:as(e,t,1-Math.exp(-r*s*.1)):e,vt=ft*10,Zr=class{constructor(e={}){const t=!U(e.bounce)||!U(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/ft,this.maxIterations=this.maxDuration/this.timeStep/ft,this.bn=J(j(e.bounce,.5),-1,1),this.pd=J(j(e.duration,628),10*X.timeScale,vt*X.timeScale),this.m=J(j(e.mass,1),1,vt),this.s=J(j(e.stiffness,100),Ue,vt),this.d=J(j(e.damping,10),Ue,vt),this.v=J(j(e.velocity,0),-vt,vt),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=e.onComplete||ne,t&&this.calculateSDFromBD(),this.compute(),this.ease=s=>{const r=s*this.settlingDuration,i=this.completed,n=this.pd;return r>=n&&!i&&(this.completed=!0,this.onComplete(this.parent)),r<n&&i&&(this.completed=!1),s===0||s===1?s:this.solve(s*this.solverDuration)}}solve(e){const{zeta:t,w0:s,wd:r,b:i}=this;let n=e;return t<1?n=$r(-n*t*s)*(1*Gi(r*n)+i*Wi(r*n)):t===1?n=(1+i*n)*$r(-n*s):n=((1+i)*$r((-t*s+r)*n)+(1-i)*$r((-t*s-r)*n))/2,1-n}calculateSDFromBD(){const e=X.timeScale===1?this.pd/ft:this.pd;this.m=1,this.v=0,this.s=ks(2*Wt/e,2),this.bn>=0?this.d=(1-this.bn)*4*Wt/e:this.d=4*Wt/(e*(1+this.bn)),this.s=G(J(this.s,Ue,vt),3),this.d=G(J(this.d,Ue,300),3)}calculateBDFromSD(){const e=2*Wt/Et(this.s);this.pd=e*(X.timeScale===1?ft:1),this.d/(2*Et(this.s))<=1?this.bn=1-this.d*e/(4*Wt):this.bn=4*Wt/(this.d*e)-1,this.bn=G(J(this.bn,-1,1),3),this.pd=G(J(this.pd,10*X.timeScale,vt*X.timeScale),3)}compute(){const{maxRestSteps:e,maxIterations:t,restThreshold:s,timeStep:r,m:i,d:n,s:o,v:c}=this,h=this.w0=J(Et(o/i),Ue,ft),u=this.zeta=n/(2*Et(o*i));u<1?(this.wd=h*Et(1-u*u),this.b=(u*h+-c)/this.wd):u===1?(this.wd=0,this.b=-c+h):(this.wd=h*Et(u*u-1),this.b=(u*h+-c)/this.wd);let f=0,a=0,d=0;for(;a<=e&&d<=t;)At(1-this.solve(f))<s?a++:a=0,this.solverDuration=f,f+=r,d++;this.settlingDuration=G(this.solverDuration*ft,0)*X.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=J(j(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=J(j(e,1),10*X.timeScale,vt*X.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=J(j(e,100),Ue,vt),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=J(j(e,10),Ue,vt),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=J(j(e,1),1,vt),this.compute()}get velocity(){return this.v}set velocity(e){this.v=J(j(e,0),-vt,vt),this.compute()}},Jr=e=>new Zr(e),ca=e=>(console.warn(\"createSpring() is deprecated use spring() instead\"),new Zr(e)),an={_head:null,_tail:null},ln=(e,t,s)=>{let r=an._head,i;for(;r;){const n=r._next,o=r.$el===e,c=!t||r.property===t,h=!s||r.parent===s;if(o&&c&&h){i=r.animation;try{i.commitStyles()}catch{}i.cancel(),$t(an,r);const u=r.parent;u&&(u._completed++,u.animations.length===u._completed&&(u.completed=!0,u.paused=!0,u.muteCallbacks||(u.onComplete(u),u._resolve(u))))}r=n}return i},ua=(e,t,s,r,i)=>{const n=t.animate(r,i),o=i.delay+ +i.duration*i.iterations;n.playbackRate=e._speed,e.paused&&n.pause(),e.duration<o&&(e.duration=o,e.controlAnimation=n),e.animations.push(n),ln(t,s),qt(an,{parent:e,animation:n,$el:t,property:s,_next:null,_prev:null});const c=()=>ln(t,s,e);return n.oncancel=c,n.onremove=c,e.persist||(n.onfinish=c),n};function us(e,t,s){const r=ls(e);if(!r.length)return;const[i]=r,n=Zi(i,t),o=Ki(t,i,n);let c=Ts(i,o);if(U(s))return c;if(mt(c,st),st.t===ve.NUMBER||st.t===ve.UNIT){if(s===!1)return st.n;{const h=Ur(i,st,s,!1);return`${G(h.n,X.precision)}${h.u}`}}}var es=(e,t)=>{if(!U(t))return X.editor&&X.editor.addSet?X.editor.addSet(e,t):(t.duration=Ue,t.composition=j(t.composition,Qe.none),new Qt(e,t,null,0,!0).resume())},ha=(e,t,s)=>{const r=wt(e);for(let i=0,n=r.length;i<n;i++)ln(r[i],s,t&&t.controlAnimation&&t);return Zt(r,t,s),r},hs=e=>{e.cancelable&&e.preventDefault()},Ih=class{constructor(e){this.el=e,this.zIndex=0,this.parentElement=null,this.classList={add:ne,remove:ne}}get x(){return this.el.x||0}set x(e){this.el.x=e}get y(){return this.el.y||0}set y(e){this.el.y=e}get width(){return this.el.width||0}set width(e){this.el.width=e}get height(){return this.el.height||0}set height(e){this.el.height=e}getBoundingClientRect(){return{top:this.y,right:this.x,bottom:this.y+this.height,left:this.x+this.width}}},Oh=class{constructor(e){this.$el=e,this.inlineTransforms=[],this.point=new DOMPoint,this.inversedMatrix=this.getMatrix().inverse()}normalizePoint(e,t){return this.point.x=e,this.point.y=t,this.point.matrixTransform(this.inversedMatrix)}traverseUp(e){let t=this.$el.parentElement,s=0;for(;t&&t!==ee;)e(t,s),t=t.parentElement,s++}getMatrix(){const e=new DOMMatrix;return this.traverseUp(t=>{const s=getComputedStyle(t).transform;if(s){const r=new DOMMatrix(s);e.preMultiplySelf(r)}}),e}remove(){this.traverseUp((e,t)=>{this.inlineTransforms[t]=e.style.transform,e.style.transform=\"none\"})}revert(){this.traverseUp((e,t)=>{const s=this.inlineTransforms[t];s===\"\"?e.style.removeProperty(\"transform\"):e.style.transform=s})}},pt=(e,t)=>e&&Fe(e)?e(t):e,Kr=0,da=class{constructor(e,t={}){if(!e)return;Ge.current&&Ge.current.register(this);const s=t.x,r=t.y,i=t.trigger,n=t.modifier,o=t.releaseEase,c=o&&Kt(o),h=!U(o)&&!U(o.ease),u=Ze(s)&&!U(s.mapTo)?s.mapTo:\"translateX\",f=Ze(r)&&!U(r.mapTo)?r.mapTo:\"translateY\",a=pt(t.container,this);this.containerArray=et(a)?a:null,this.$container=a&&!this.containerArray?wt(a)[0]:ee.body,this.useWin=this.$container===ee.body,this.$scrollContainer=this.useWin?dt:this.$container,this.$target=Ze(e)?new Ih(e):wt(e)[0],this.$trigger=wt(i||e)[0],this.fixed=us(this.$target,\"position\")===\"fixed\",this.isFinePointer=!0,this.containerPadding=[0,0,0,0],this.containerFriction=0,this.releaseContainerFriction=0,this.snapX=0,this.snapY=0,this.scrollSpeed=0,this.scrollThreshold=0,this.dragSpeed=0,this.dragThreshold=3,this.maxVelocity=0,this.minVelocity=0,this.velocityMultiplier=0,this.cursor=!1,this.releaseXSpring=h?o:Jr({mass:j(t.releaseMass,1),stiffness:j(t.releaseStiffness,80),damping:j(t.releaseDamping,20)}),this.releaseYSpring=h?o:Jr({mass:j(t.releaseMass,1),stiffness:j(t.releaseStiffness,80),damping:j(t.releaseDamping,20)}),this.releaseEase=c||Jt.outQuint,this.hasReleaseSpring=h,this.onGrab=t.onGrab||ne,this.onDrag=t.onDrag||ne,this.onRelease=t.onRelease||ne,this.onUpdate=t.onUpdate||ne,this.onSettle=t.onSettle||ne,this.onSnap=t.onSnap||ne,this.onResize=t.onResize||ne,this.onAfterResize=t.onAfterResize||ne,this.disabled=[0,0];const d={};if(n&&(d.modifier=n),U(s)||s===!0)d[u]=0;else if(Ze(s)){const l=s,g={};l.modifier&&(g.modifier=l.modifier),l.composition&&(g.composition=l.composition),d[u]=g}else s===!1&&(d[u]=0,this.disabled[0]=1);if(U(r)||r===!0)d[f]=0;else if(Ze(r)){const l=r,g={};l.modifier&&(g.modifier=l.modifier),l.composition&&(g.composition=l.composition),d[f]=g}else r===!1&&(d[f]=0,this.disabled[1]=1);this.animate=new on(this.$target,d),this.xProp=u,this.yProp=f,this.destX=0,this.destY=0,this.deltaX=0,this.deltaY=0,this.scroll={x:0,y:0},this.coords=[this.x,this.y,0,0],this.snapped=[0,0],this.pointer=[0,0,0,0,0,0,0,0],this.scrollView=[0,0],this.dragArea=[0,0,0,0],this.containerBounds=[-Dt,Dt,Dt,-Dt],this.scrollBounds=[0,0,0,0],this.targetBounds=[0,0,0,0],this.window=[0,0],this.velocityStack=[0,0,0],this.velocityStackIndex=0,this.velocityTime=os(),this.velocity=0,this.angle=0,this.cursorStyles=null,this.triggerStyles=null,this.bodyStyles=null,this.targetStyles=null,this.touchActionStyles=null,this.transforms=new Oh(this.$target),this.overshootCoords={x:0,y:0},this.overshootTicker=new _t({autoplay:!1,onUpdate:()=>{this.updated=!0,this.manual=!0,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,1),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,1)},onComplete:()=>{this.manual=!1,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,0),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,0)}},null,0).init(),this.updateTicker=new _t({autoplay:!1,onUpdate:()=>this.update()},null,0).init(),this.contained=!U(a),this.manual=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.enabled=!1,this.initialized=!1,this.activeProp=this.disabled[1]?u:f,this.animate.callbacks.onRender=()=>{const l=this.updated,g=!(this.grabbed&&l)&&this.released,m=this.x,y=this.y,_=m-this.coords[2],w=y-this.coords[3];this.deltaX=_,this.deltaY=w,this.coords[2]=m,this.coords[3]=y,l&&(_||w)&&this.onUpdate(this),g?(this.computeVelocity(_,w),this.angle=qr(w,_)):this.updated=!1},this.animate.callbacks.onComplete=()=>{!this.grabbed&&this.released&&(this.released=!1),this.manual||(this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.onSettle(this))},this.resizeTicker=new _t({autoplay:!1,duration:150*X.timeScale,onComplete:()=>{this.onResize(this),this.refresh(),this.onAfterResize(this)}}).init(),this.parameters=t,this.resizeObserver=new ResizeObserver(()=>{this.initialized?this.resizeTicker.restart():this.initialized=!0}),this.enable(),this.refresh(),this.resizeObserver.observe(this.$container),Ze(e)||this.resizeObserver.observe(this.$target)}computeVelocity(e,t){const s=this.velocityTime,r=os(),i=r-s;if(i<17)return this.velocity;this.velocityTime=r;const n=this.velocityStack,o=this.velocityMultiplier,c=this.minVelocity,h=this.maxVelocity,u=this.velocityStackIndex;n[u]=G(J(Et(e*e+t*t)/i*o,c,h),5);const f=$o(n[0],n[1],n[2]);return this.velocity=f,this.velocityStackIndex=(u+1)%3,f}setX(e,t=!1){if(this.disabled[0])return;const s=G(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destX=s,this.snapped[0]=xs(s,this.snapX),this.animate[this.xProp](s,0),this.manual=!1,this}setY(e,t=!1){if(this.disabled[1])return;const s=G(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destY=s,this.snapped[1]=xs(s,this.snapY),this.animate[this.yProp](s,0),this.manual=!1,this}get x(){return G(this.animate[this.xProp](),X.precision)}set x(e){this.setX(e,!1)}get y(){return G(this.animate[this.yProp](),X.precision)}set y(e){this.setY(e,!1)}get progressX(){return cr(this.x,this.containerBounds[3],this.containerBounds[1],0,1)}set progressX(e){this.setX(cr(e,0,1,this.containerBounds[3],this.containerBounds[1]),!1)}get progressY(){return cr(this.y,this.containerBounds[0],this.containerBounds[2],0,1)}set progressY(e){this.setY(cr(e,0,1,this.containerBounds[0],this.containerBounds[2]),!1)}updateScrollCoords(){const e=G(this.useWin?dt.scrollX:this.$container.scrollLeft,0),t=G(this.useWin?dt.scrollY:this.$container.scrollTop,0),[s,r,i,n]=this.containerPadding,o=this.scrollThreshold;this.scroll.x=e,this.scroll.y=t,this.scrollBounds[0]=t-this.targetBounds[0]+s-o,this.scrollBounds[1]=e-this.targetBounds[1]-r+o,this.scrollBounds[2]=t-this.targetBounds[2]-i+o,this.scrollBounds[3]=e-this.targetBounds[3]+n-o}updateBoundingValues(){const e=this.$container;if(!e)return;const t=this.x,s=this.y,r=this.coords[2],i=this.coords[3];this.coords[2]=0,this.coords[3]=0,this.setX(0,!0),this.setY(0,!0),this.transforms.remove();const n=this.window[0]=dt.innerWidth,o=this.window[1]=dt.innerHeight,c=this.useWin,h=e.scrollWidth,u=e.scrollHeight,f=this.fixed,a=e.getBoundingClientRect(),[d,l,g,m]=this.containerPadding;this.dragArea[0]=c?0:a.left,this.dragArea[1]=c?0:a.top,this.scrollView[0]=c?J(h,n,h):h,this.scrollView[1]=c?J(u,o,u):u,this.updateScrollCoords();const{width:y,height:_,left:w,top:S,right:v,bottom:p}=e.getBoundingClientRect();this.dragArea[2]=G(c?J(y,n,n):y,0),this.dragArea[3]=G(c?J(_,o,o):_,0);const b=us(e,\"overflow\"),k=b===\"visible\",T=b===\"hidden\";if(this.canScroll=f?!1:this.contained&&(e===ee.body&&k||!T&&!k)&&(h>this.dragArea[2]+m-l||u>this.dragArea[3]+d-g)&&(!this.containerArray||this.containerArray&&!et(this.containerArray)),this.contained){const R=this.scroll.x,P=this.scroll.y,O=this.canScroll,I=this.$target.getBoundingClientRect(),q=O?c?0:e.scrollLeft:0,B=O?c?0:e.scrollTop:0,W=O?this.scrollView[0]-q-y:0,E=O?this.scrollView[1]-B-_:0;this.targetBounds[0]=G(I.top+P-(c?0:S),0),this.targetBounds[1]=G(I.right+R-(c?n:v),0),this.targetBounds[2]=G(I.bottom+P-(c?o:p),0),this.targetBounds[3]=G(I.left+R-(c?0:w),0),this.containerArray?(this.containerBounds[0]=this.containerArray[0]+d,this.containerBounds[1]=this.containerArray[1]-l,this.containerBounds[2]=this.containerArray[2]-g,this.containerBounds[3]=this.containerArray[3]+m):(this.containerBounds[0]=-G(I.top-(f?J(S,0,o):S)+B-d,0),this.containerBounds[1]=-G(I.right-(f?J(v,0,n):v)-W+l,0),this.containerBounds[2]=-G(I.bottom-(f?J(p,0,o):p)-E+g,0),this.containerBounds[3]=-G(I.left-(f?J(w,0,n):w)+q-m,0))}this.transforms.revert(),this.coords[2]=r,this.coords[3]=i,this.setX(t,!0),this.setY(s,!0)}isOutOfBounds(e,t,s){if(!this.contained)return 0;const[r,i,n,o]=e,[c,h]=this.disabled,u=!c&&t<o||!c&&t>i,f=!h&&s<r||!h&&s>n;return u&&!f?1:!u&&f?2:u&&f?3:0}refresh(){const e=this.parameters,t=e.x,s=e.y,r=pt(e.container,this),i=pt(e.containerPadding,this)||0,n=et(i)?i:[i,i,i,i],o=this.x,c=this.y,h=pt(e.cursor,this),u={onHover:\"grab\",onGrab:\"grabbing\"};if(h){const{onHover:y,onGrab:_}=h;y&&(u.onHover=y),_&&(u.onGrab=_)}const f=pt(e.dragThreshold,this),a={mouse:3,touch:7};if(tt(f))a.mouse=f,a.touch=f;else if(f){const{mouse:y,touch:_}=f;U(y)||(a.mouse=y),U(_)||(a.touch=_)}this.containerArray=et(r)?r:null,this.$container=r&&!this.containerArray?wt(r)[0]:ee.body,this.useWin=this.$container===ee.body,this.$scrollContainer=this.useWin?dt:this.$container,this.isFinePointer=matchMedia(\"(pointer:fine)\").matches,this.containerPadding=j(n,[0,0,0,0]),this.containerFriction=J(j(pt(e.containerFriction,this),.8),0,1),this.releaseContainerFriction=J(j(pt(e.releaseContainerFriction,this),this.containerFriction),0,1),this.snapX=pt(Ze(t)&&!U(t.snap)?t.snap:e.snap,this),this.snapY=pt(Ze(s)&&!U(s.snap)?s.snap:e.snap,this),this.scrollSpeed=j(pt(e.scrollSpeed,this),1.5),this.scrollThreshold=j(pt(e.scrollThreshold,this),20),this.dragSpeed=j(pt(e.dragSpeed,this),1),this.dragThreshold=this.isFinePointer?a.mouse:a.touch,this.minVelocity=j(pt(e.minVelocity,this),0),this.maxVelocity=j(pt(e.maxVelocity,this),50),this.velocityMultiplier=j(pt(e.velocityMultiplier,this),1),this.cursor=h===!1?!1:u,this.updateBoundingValues();const[d,l,g,m]=this.containerBounds;this.setX(J(o,m,l),!0),this.setY(J(c,d,g),!0)}update(){if(this.updateScrollCoords(),this.canScroll){const[_,w,S,v]=this.containerPadding,[p,b]=this.scrollView,k=this.dragArea[2],T=this.dragArea[3],R=this.scroll.x,P=this.scroll.y,O=this.$container.scrollWidth,I=this.$container.scrollHeight,q=this.useWin?J(O,this.window[0],O):O,B=this.useWin?J(I,this.window[1],I):I,W=p-q,E=b-B;this.dragged&&W>0&&(this.coords[0]-=W,this.scrollView[0]=q),this.dragged&&E>0&&(this.coords[1]-=E,this.scrollView[1]=B);const N=this.scrollSpeed*10,A=this.scrollThreshold,[L,D]=this.coords,[H,F,V,Y]=this.scrollBounds,te=G(J((D-H+_)/A,-1,0)*N,0),se=G(J((L-F-w)/A,0,1)*N,0),me=G(J((D-V-S)/A,0,1)*N,0),ge=G(J((L-Y+v)/A,-1,0)*N,0);if(te||me||ge||se){const[oe,K]=this.disabled;let ae=R,Ce=P;oe||(ae=G(J(R+(ge||se),0,p-k),0),this.coords[0]-=R-ae),K||(Ce=G(J(P+(te||me),0,b-T),0),this.coords[1]-=P-Ce),this.useWin?this.$scrollContainer.scrollBy(-(R-ae),-(P-Ce)):this.$scrollContainer.scrollTo(ae,Ce)}}const[e,t,s,r]=this.containerBounds,[i,n,o,c,h,u]=this.pointer;this.coords[0]+=(i-h)*this.dragSpeed,this.coords[1]+=(n-u)*this.dragSpeed,this.pointer[4]=i,this.pointer[5]=n;const[f,a]=this.coords,[d,l]=this.snapped,g=(1-this.containerFriction)*this.dragSpeed;this.setX(f>t?t+(f-t)*g:f<r?r+(f-r)*g:f,!1),this.setY(a>s?s+(a-s)*g:a<e?e+(a-e)*g:a,!1),this.computeVelocity(i-h,n-u),this.angle=qr(n-c,i-o);const[m,y]=this.snapped;(m!==d&&this.snapX||y!==l&&this.snapY)&&this.onSnap(this)}stop(){this.updateTicker.pause(),this.overshootTicker.pause();for(let e in this.animate.animations)this.animate.animations[e].pause();return Zt([this],null,\"x\"),Zt([this],null,\"y\"),Zt([this],null,\"progressX\"),Zt([this],null,\"progressY\"),Zt([this.scroll]),Zt([this.overshootCoords]),this}scrollInView(e,t=0,s=Jt.inOutQuad){this.updateScrollCoords();const r=this.destX,i=this.destY,n=this.scroll,o=this.scrollBounds,c=this.canScroll;if(!this.containerArray&&this.isOutOfBounds(o,r,i)){const[h,u,f,a]=o,d=G(J(i-h,-Dt,0),0),l=G(J(r-u,0,Dt),0),g=G(J(i-f,0,Dt),0),m=G(J(r-a,-Dt,0),0);new Qt(n,{x:G(n.x+(m?m-t:l?l+t:0),0),y:G(n.y+(d?d-t:g?g+t:0),0),duration:U(e)?350*X.timeScale:e,ease:s,onUpdate:()=>{this.canScroll=!1,this.$scrollContainer.scrollTo(n.x,n.y)}}).init().then(()=>{this.canScroll=c})}return this}handleHover(){this.isFinePointer&&this.cursor&&!this.cursorStyles&&(this.cursorStyles=es(this.$trigger,{cursor:this.cursor.onHover}))}animateInView(e,t=0,s=Jt.inOutQuad){this.stop(),this.updateBoundingValues();const r=this.x,i=this.y,[n,o,c,h]=this.containerPadding,u=this.scroll.y-this.targetBounds[0]+n+t,f=this.scroll.x-this.targetBounds[1]-o-t,a=this.scroll.y-this.targetBounds[2]-c-t,d=this.scroll.x-this.targetBounds[3]+h+t,l=this.isOutOfBounds([u,f,a,d],r,i);if(l){const[g,m]=this.disabled,y=J(xs(r,this.snapX),d,f),_=J(xs(i,this.snapY),u,a),w=U(e)?350*X.timeScale:e;!g&&(l===1||l===3)&&this.animate[this.xProp](y,w,s),!m&&(l===2||l===3)&&this.animate[this.yProp](_,w,s)}return this}handleDown(e){const t=e.target;if(this.grabbed||t.type===\"range\")return;e.stopPropagation(),this.grabbed=!0,this.released=!1,this.stop(),this.updateBoundingValues();const s=e.changedTouches,r=s?s[0].clientX:e.clientX,i=s?s[0].clientY:e.clientY,{x:n,y:o}=this.transforms.normalizePoint(r,i),[c,h,u,f]=this.containerBounds,a=(1-this.containerFriction)*this.dragSpeed,d=this.x,l=this.y;this.coords[0]=this.coords[2]=a?d>h?h+(d-h)/a:d<f?f+(d-f)/a:d:d,this.coords[1]=this.coords[3]=a?l>u?u+(l-u)/a:l<c?c+(l-c)/a:l:l,this.pointer[0]=n,this.pointer[1]=o,this.pointer[2]=n,this.pointer[3]=o,this.pointer[4]=n,this.pointer[5]=o,this.pointer[6]=n,this.pointer[7]=o,this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null);const g=us(this.$target,\"zIndex\",!1);Kr=(g>Kr?g:Kr)+1,this.targetStyles=es(this.$target,{zIndex:Kr}),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.isFinePointer&&this.cursor&&(this.bodyStyles=es(ee.body,{cursor:this.cursor.onGrab})),this.scrollInView(100,0,Jt.out(3)),this.onGrab(this),ee.addEventListener(\"touchmove\",this),ee.addEventListener(\"touchend\",this),ee.addEventListener(\"touchcancel\",this),ee.addEventListener(\"mousemove\",this),ee.addEventListener(\"mouseup\",this),ee.addEventListener(\"selectstart\",this)}handleMove(e){if(!this.grabbed)return;const t=e.changedTouches,s=t?t[0].clientX:e.clientX,r=t?t[0].clientY:e.clientY,{x:i,y:n}=this.transforms.normalizePoint(s,r),o=i-this.pointer[6],c=n-this.pointer[7];let h=e.target,u=!1,f=!1,a=!1;for(;t&&h&&h!==this.$trigger;){const d=us(h,\"overflow-y\");if(d!==\"hidden\"&&d!==\"visible\"){const{scrollTop:l,scrollHeight:g,clientHeight:m}=h;if(g>m){a=!0,u=l<=3,f=l>=g-m-3;break}}h=h.parentElement}a&&(!u&&!f||u&&c<0||f&&c>0)?(this.pointer[0]=i,this.pointer[1]=n,this.pointer[2]=i,this.pointer[3]=n,this.pointer[4]=i,this.pointer[5]=n,this.pointer[6]=i,this.pointer[7]=n):(hs(e),this.triggerStyles||(this.triggerStyles=es(this.$trigger,{pointerEvents:\"none\"})),this.$trigger.addEventListener(\"touchstart\",hs,{passive:!1}),this.$trigger.addEventListener(\"touchmove\",hs,{passive:!1}),this.$trigger.addEventListener(\"touchend\",hs),(this.dragged||!this.disabled[0]&&At(o)>this.dragThreshold||!this.disabled[1]&&At(c)>this.dragThreshold)&&(this.updateTicker.resume(),this.pointer[2]=this.pointer[0],this.pointer[3]=this.pointer[1],this.pointer[0]=i,this.pointer[1]=n,this.dragged=!0,this.released=!1,this.onDrag(this)))}handleUp(){if(!this.grabbed)return;this.updateTicker.pause(),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null);const[e,t]=this.disabled,[s,r,i,n,o,c]=this.pointer,[h,u,f,a]=this.containerBounds,[d,l]=this.snapped,g=this.releaseXSpring,m=this.releaseYSpring,y=this.releaseEase,_=this.hasReleaseSpring,w=this.overshootCoords,S=this.x,v=this.y,p=this.computeVelocity(s-o,r-c),b=this.angle=qr(r-n,s-i),k=p*150,T=(1-this.releaseContainerFriction)*this.dragSpeed,R=S+Gi(b)*k,P=v+Wi(b)*k,O=R>u?u+(R-u)*T:R<a?a+(R-a)*T:R,I=P>f?f+(P-f)*T:P<h?h+(P-h)*T:P,q=this.destX=J(G(xs(O,this.snapX),5),a,u),B=this.destY=J(G(xs(I,this.snapY),5),h,f),W=this.isOutOfBounds(this.containerBounds,R,P);let E=0,N=0,A=y,L=y,D=0;if(w.x=S,w.y=v,!e){const F=q===u?S>u?-1:1:S<a?-1:1,V=G(S-q,0);g.velocity=t&&_?V?k*F/At(V):0:p;const{ease:Y,settlingDuration:te,restDuration:se}=g;E=S===q?0:_?te:te-se*X.timeScale,_&&(A=Y),E>D&&(D=E)}if(!t){const F=B===f?v>f?-1:1:v<h?-1:1,V=G(v-B,0);m.velocity=e&&_?V?k*F/At(V):0:p;const{ease:Y,settlingDuration:te,restDuration:se}=m;N=v===B?0:_?te:te-se*X.timeScale,_&&(L=Y),N>D&&(D=N)}if(!_&&W&&T&&(E||N)){const F=Qe.blend;new Qt(w,{x:{to:O,duration:E*.65},y:{to:I,duration:N*.65},ease:y,composition:F}).init(),new Qt(w,{x:{to:q,duration:E},y:{to:B,duration:N},ease:y,composition:F}).init(),this.overshootTicker.stretch($o(E,N)).restart()}else e||this.animate[this.xProp](q,E,A),t||this.animate[this.yProp](B,N,L);this.scrollInView(D,this.scrollThreshold,y);let H=!1;q!==d&&(this.snapped[0]=q,this.snapX&&(H=!0)),B!==l&&this.snapY&&(this.snapped[1]=B,this.snapY&&(H=!0)),H&&this.onSnap(this),this.grabbed=!1,this.dragged=!1,this.updated=!0,this.released=!0,this.onRelease(this),this.$trigger.removeEventListener(\"touchstart\",hs),this.$trigger.removeEventListener(\"touchmove\",hs),this.$trigger.removeEventListener(\"touchend\",hs),ee.removeEventListener(\"touchmove\",this),ee.removeEventListener(\"touchend\",this),ee.removeEventListener(\"touchcancel\",this),ee.removeEventListener(\"mousemove\",this),ee.removeEventListener(\"mouseup\",this),ee.removeEventListener(\"selectstart\",this)}reset(){return this.stop(),this.resizeTicker.pause(),this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.setX(0,!0),this.setY(0,!0),this.coords[0]=0,this.coords[1]=0,this.pointer[0]=0,this.pointer[1]=0,this.pointer[2]=0,this.pointer[3]=0,this.pointer[4]=0,this.pointer[5]=0,this.pointer[6]=0,this.pointer[7]=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this}enable(){return this.enabled||(this.enabled=!0,this.$target.classList.remove(\"is-disabled\"),this.touchActionStyles=es(this.$trigger,{touchAction:this.disabled[0]?\"pan-x\":this.disabled[1]?\"pan-y\":\"none\"}),this.$trigger.addEventListener(\"touchstart\",this,{passive:!0}),this.$trigger.addEventListener(\"mousedown\",this,{passive:!0}),this.$trigger.addEventListener(\"mouseenter\",this)),this}disable(){return this.enabled=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.touchActionStyles.revert(),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null),this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null),this.$target.classList.add(\"is-disabled\"),this.$trigger.removeEventListener(\"touchstart\",this),this.$trigger.removeEventListener(\"mousedown\",this),this.$trigger.removeEventListener(\"mouseenter\",this),ee.removeEventListener(\"touchmove\",this),ee.removeEventListener(\"touchend\",this),ee.removeEventListener(\"touchcancel\",this),ee.removeEventListener(\"mousemove\",this),ee.removeEventListener(\"mouseup\",this),ee.removeEventListener(\"selectstart\",this),this}revert(){return this.reset(),this.disable(),this.$target.classList.remove(\"is-disabled\"),this.updateTicker.revert(),this.overshootTicker.revert(),this.resizeTicker.revert(),this.animate.revert(),this.resizeObserver.disconnect(),this}handleEvent(e){switch(e.type){case\"mousedown\":this.handleDown(e);break;case\"touchstart\":this.handleDown(e);break;case\"mousemove\":this.handleMove(e);break;case\"touchmove\":this.handleMove(e);break;case\"mouseup\":this.handleUp();break;case\"touchend\":this.handleUp();break;case\"touchcancel\":this.handleUp();break;case\"mouseenter\":this.handleHover();break;case\"selectstart\":hs(e)}}},Mh=(e,t)=>new da(e,t),cn=(e=ne)=>new _t({duration:1*X.timeScale,onComplete:e},null,0).resume(),Qr=e=>{let t;return((...s)=>{let r,i,n,o,c;t&&(r=t.currentIteration,i=t.iterationProgress,n=t.reversed,o=t._alternate,c=t._startTime,t.revert());const h=e(...s);return h&&!Fe(h)&&h.revert&&(t=h),U(i)||(t.currentIteration=r,t.iterationProgress=(o&&r%2?!n:n)?1-i:i,t._startTime=c),h||ne})},fa=class{constructor(e={}){Ge.current&&Ge.current.register(this);const t=e.root;let s=ee;t&&(s=t.current||t.nativeElement||wt(t)[0]||ee);const r=e.defaults,i=X.defaults,n=e.mediaQueries;if(this.defaults=r?Pt(r,i):i,this.root=s,this.constructors=[],this.revertConstructors=[],this.revertibles=[],this.constructorsOnce=[],this.revertConstructorsOnce=[],this.revertiblesOnce=[],this.once=!1,this.onceIndex=0,this.methods={},this.matches={},this.mediaQueryLists={},this.data={},n)for(let o in n){const c=dt.matchMedia(n[o]);this.mediaQueryLists[o]=c,c.addEventListener(\"change\",this)}}register(e){(this.once?this.revertiblesOnce:this.revertibles).push(e)}execute(e){let t=Ge.current,s=Ge.root,r=X.defaults;Ge.current=this,Ge.root=this.root,X.defaults=this.defaults;const i=this.mediaQueryLists;for(let o in i)this.matches[o]=i[o].matches;const n=e(this);return Ge.current=t,Ge.root=s,X.defaults=r,n}refresh(){return this.onceIndex=0,this.execute(()=>{let e=this.revertibles.length,t=this.revertConstructors.length;for(;e--;)this.revertibles[e].revert();for(;t--;)this.revertConstructors[t](this);this.revertibles.length=0,this.revertConstructors.length=0,this.constructors.forEach(s=>{const r=s(this);Fe(r)&&this.revertConstructors.push(r)})}),this}add(e,t){if(this.once=!1,Fe(e)){const s=e;this.constructors.push(s),this.execute(()=>{const r=s(this);Fe(r)&&this.revertConstructors.push(r)})}else this.methods[e]=(...s)=>this.execute(()=>t(...s));return this}addOnce(e){if(this.once=!0,Fe(e)){const t=this.onceIndex++;if(this.constructorsOnce[t])return this;const s=e;this.constructorsOnce[t]=s,this.execute(()=>{const r=s(this);Fe(r)&&this.revertConstructorsOnce.push(r)})}return this}keepTime(e){this.once=!0;const t=this.onceIndex++,s=this.constructorsOnce[t];if(Fe(s))return s(this);const r=Qr(e);this.constructorsOnce[t]=r;let i;return this.execute(()=>{i=r(this)}),i}handleEvent(e){e.type===\"change\"&&this.refresh()}revert(){const e=this.revertibles,t=this.revertConstructors,s=this.revertiblesOnce,r=this.revertConstructorsOnce,i=this.mediaQueryLists;let n=e.length,o=t.length,c=s.length,h=r.length;for(;n--;)e[n].revert();for(;o--;)t[o](this);for(;c--;)s[c].revert();for(;h--;)r[h](this);for(let u in i)i[u].removeEventListener(\"change\",this);e.length=0,t.length=0,this.constructors.length=0,s.length=0,r.length=0,this.constructorsOnce.length=0,this.onceIndex=0,this.matches={},this.methods={},this.mediaQueryLists={},this.data={}}},Nh=e=>new fa(e),Dh=()=>{const e=ee.createElement(\"div\");ee.body.appendChild(e),e.style.height=\"100lvh\";const t=e.offsetHeight;return ee.body.removeChild(e),t},ei=(e,t)=>e&&Fe(e)?e(t):e,ti=new Map,$h=class{constructor(e){this.element=e,this.useWin=this.element===ee.body,this.winWidth=0,this.winHeight=0,this.width=0,this.height=0,this.left=0,this.top=0,this.scale=1,this.zIndex=0,this.scrollX=0,this.scrollY=0,this.prevScrollX=0,this.prevScrollY=0,this.scrollWidth=0,this.scrollHeight=0,this.velocity=0,this.backwardX=!1,this.backwardY=!1,this.scrollTicker=new _t({autoplay:!1,onBegin:()=>this.dataTimer.resume(),onUpdate:()=>{const t=this.backwardX||this.backwardY;Pe(this,s=>s.handleScroll(),t)},onComplete:()=>this.dataTimer.pause()}).init(),this.dataTimer=new _t({autoplay:!1,frameRate:30,onUpdate:t=>{const s=t.deltaTime,r=this.prevScrollX,i=this.prevScrollY,n=this.scrollX,o=this.scrollY,c=r-n,h=i-o;this.prevScrollX=n,this.prevScrollY=o,c&&(this.backwardX=r>n),h&&(this.backwardY=i>o),this.velocity=G(s>0?Math.sqrt(c*c+h*h)/s:0,5)}}).init(),this.resizeTicker=new _t({autoplay:!1,duration:250*X.timeScale,onComplete:()=>{this.updateWindowBounds(),this.refreshScrollObservers(),this.handleScroll()}}).init(),this.wakeTicker=new _t({autoplay:!1,duration:500*X.timeScale,onBegin:()=>{this.scrollTicker.resume()},onComplete:()=>{this.scrollTicker.pause()}}).init(),this._head=null,this._tail=null,this.updateScrollCoords(),this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll(),this.resizeObserver=new ResizeObserver(()=>this.resizeTicker.restart()),this.resizeObserver.observe(this.element),(this.useWin?dt:this.element).addEventListener(\"scroll\",this,!1)}updateScrollCoords(){const e=this.useWin,t=this.element;this.scrollX=G(e?dt.scrollX:t.scrollLeft,0),this.scrollY=G(e?dt.scrollY:t.scrollTop,0)}updateWindowBounds(){this.winWidth=dt.innerWidth,this.winHeight=Dh()}updateBounds(){const e=getComputedStyle(this.element),t=this.element;this.scrollWidth=t.scrollWidth+parseFloat(e.marginLeft)+parseFloat(e.marginRight),this.scrollHeight=t.scrollHeight+parseFloat(e.marginTop)+parseFloat(e.marginBottom),this.updateWindowBounds();let s,r;if(this.useWin)s=this.winWidth,r=this.winHeight;else{const i=t.getBoundingClientRect();s=t.clientWidth,r=t.clientHeight,this.top=i.top,this.left=i.left,this.scale=i.width?s/i.width:i.height?r/i.height:1}this.width=s,this.height=r}refreshScrollObservers(){Pe(this,e=>{e.ready&&e._debug&&e.removeDebug()}),this.updateBounds(),Pe(this,e=>{e.ready&&(e.refresh(),e.onResize(e),e._debug&&e.debug())})}refresh(){this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll()}handleScroll(){this.updateScrollCoords(),this.wakeTicker.restart()}handleEvent(e){e.type===\"scroll\"&&this.handleScroll()}revert(){this.scrollTicker.cancel(),this.dataTimer.cancel(),this.resizeTicker.cancel(),this.wakeTicker.cancel(),this.resizeObserver.disconnect(),(this.useWin?dt:this.element).removeEventListener(\"scroll\",this),ti.delete(this.element)}},qh=e=>{const t=e&&wt(e)[0]||ee.body;let s=ti.get(t);return s||(s=new $h(t),ti.set(t,s)),s},ur=(e,t,s,r,i)=>{const n=t===\"min\",o=t===\"max\",{n:c,u:h}=mt(t===\"top\"||t===\"left\"||t===\"start\"||n?0:t===\"bottom\"||t===\"right\"||t===\"end\"||o?\"100%\":t===\"center\"?\"50%\":t,st);let u=c;return h===\"%\"?u=c/100*s:h&&(u=Ur(e,st,\"px\",!0).n),o&&r<0&&(u+=r),n&&i>0&&(u+=i),u},si=(e,t,s,r,i)=>{let n;if(Je(t)){const o=Io.exec(t);if(o){const c=o[0],h=c[0],u=t.split(c),f=u[0]===\"min\",a=u[0]===\"max\",d=ur(e,u[0],s,r,i),l=ur(e,u[1],s,r,i);if(f){const g=Cs(ur(e,\"min\",s),l,h);n=g<d?d:g}else if(a){const g=Cs(ur(e,\"max\",s),l,h);n=g>d?d:g}else n=Cs(d,l,h)}else n=ur(e,t,s,r,i)}else n=t;return G(n,0)},pa=e=>{let t;const s=e.targets;for(let r=0,i=s.length;r<i;r++){const n=s[r];if(n[bs]){t=n;break}}return t},Bh=0,ga=[\"#FF4B4B\",\"#FF971B\",\"#FFC730\",\"#F9F640\",\"#7AFF5A\",\"#18FF74\",\"#17E09B\",\"#3CFFEC\",\"#05DBE9\",\"#33B3F1\",\"#638CF9\",\"#C563FE\",\"#FF4FCF\",\"#F93F8A\"],ma=class{constructor(e={}){Ge.current&&Ge.current.register(this);const t=j(e.sync,\"play pause\"),s=t?Kt(t):null,r=t&&(t===\"linear\"||t===kt),i=t&&!(s===kt&&!r),n=t&&(tt(t)||t===!0||r),o=t&&Je(t)&&!i&&!n,c=o?t.split(\" \").map(u=>()=>{const f=this.linked;return f&&f[u]?f[u]():null}):null,h=o&&c.length>2;this.index=Bh++,this.id=U(e.id)?this.index:e.id,this.container=qh(e.container),this.target=null,this.linked=null,this.repeat=null,this.horizontal=null,this.enter=null,this.leave=null,this.sync=i||n||!!c,this.syncEase=i?s:null,this.syncSmooth=n?t===!0||r?1:t:null,this.onSyncEnter=c&&!h&&c[0]?c[0]:ne,this.onSyncLeave=c&&!h&&c[1]?c[1]:ne,this.onSyncEnterForward=c&&h&&c[0]?c[0]:ne,this.onSyncLeaveForward=c&&h&&c[1]?c[1]:ne,this.onSyncEnterBackward=c&&h&&c[2]?c[2]:ne,this.onSyncLeaveBackward=c&&h&&c[3]?c[3]:ne,this.onEnter=e.onEnter||ne,this.onLeave=e.onLeave||ne,this.onEnterForward=e.onEnterForward||ne,this.onLeaveForward=e.onLeaveForward||ne,this.onEnterBackward=e.onEnterBackward||ne,this.onLeaveBackward=e.onLeaveBackward||ne,this.onUpdate=e.onUpdate||ne,this.onResize=e.onResize||ne,this.onSyncComplete=e.onSyncComplete||ne,this.reverted=!1,this.ready=!1,this.completed=!1,this.began=!1,this.isInView=!1,this.forceEnter=!1,this.hasEntered=!1,this.offset=0,this.offsetStart=0,this.offsetEnd=0,this.distance=0,this.prevProgress=0,this.thresholds=[\"start\",\"end\",\"end\",\"start\"],this.coords=[0,0,0,0],this.debugStyles=null,this.$debug=null,this._params=e,this._debug=j(e.debug,!1),this._next=null,this._prev=null,qt(this.container,this),cn(()=>{if(!this.reverted){if(!this.target){const u=wt(e.target)[0];this.target=u||ee.body,this.refresh()}this._debug&&this.debug()}})}link(e){if(e&&(e.pause(),this.linked=e,!U(e)&&!U(e.persist)&&(e.persist=!0),!this._params.target)){let t;U(e.targets)?Pe(e,s=>{s.targets&&!t&&(t=pa(s))}):t=pa(e),this.target=t||ee.body,this.refresh()}return this}get velocity(){return this.container.velocity}get backward(){return this.horizontal?this.container.backwardX:this.container.backwardY}get scroll(){return this.horizontal?this.container.scrollX:this.container.scrollY}get progress(){const e=(this.scroll-this.offsetStart)/this.distance;return e===1/0||isNaN(e)?0:G(J(e,0,1),6)}refresh(){this.ready=!0,this.reverted=!1;const e=this._params;return this.repeat=j(ei(e.repeat,this),!0),this.horizontal=j(ei(e.axis,this),\"y\")===\"x\",this.enter=j(ei(e.enter,this),\"end start\"),this.leave=j(ei(e.leave,this),\"start end\"),this.updateBounds(),this.handleScroll(),this}removeDebug(){return this.$debug&&(this.$debug.parentNode.removeChild(this.$debug),this.$debug=null),this.debugStyles&&(this.debugStyles.revert(),this.$debug=null),this}debug(){this.removeDebug();const e=this.container,t=this.horizontal,s=e.element.querySelector(\":scope > .animejs-onscroll-debug\"),r=ee.createElement(\"div\"),i=ee.createElement(\"div\"),n=ee.createElement(\"div\"),o=ga[this.index%ga.length],c=e.useWin,h=c?e.winWidth:e.width,u=c?e.winHeight:e.height,f=e.scrollWidth,a=e.scrollHeight,d=this.container.width>360?320:260,l=t?0:10,g=t?10:0,m=t?24:d/2,y=t?m:15,_=t?60:m,w=t?_:y,S=t?\"repeat-x\":\"repeat-y\",v=T=>t?\"0px \"+T+\"px\":T+\"px 2px\",p=T=>`linear-gradient(${t?90:0}deg, ${T} 2px, transparent 1px)`,b=(T,R,P,O,I)=>`position:${T};left:${R}px;top:${P}px;width:${O}px;height:${I}px;`;r.style.cssText=`${b(\"absolute\",l,g,t?f:d,t?d:a)}\n pointer-events: none;\n z-index: ${this.container.zIndex++};\n display: flex;\n flex-direction: ${t?\"column\":\"row\"};\n filter: drop-shadow(0px 1px 0px rgba(0,0,0,.75));\n `,i.style.cssText=`${b(\"sticky\",0,0,t?h:m,t?m:u)}`,s||(i.style.cssText+=`background:\n ${p(\"#FFFF\")}${v(m-10)} / 100px 100px ${S},\n ${p(\"#FFF8\")}${v(m-10)} / 10px 10px ${S};\n `),n.style.cssText=`${b(\"relative\",0,0,t?f:m,t?m:a)}`,s||(n.style.cssText+=`background:\n ${p(\"#FFFF\")}${v(0)} / ${t?\"100px 10px\":\"10px 100px\"} ${S},\n ${p(\"#FFF8\")}${v(0)} / ${t?\"10px 0px\":\"0px 10px\"} ${S};\n `);const k=[\" enter: \",\" leave: \"];this.coords.forEach((T,R)=>{const P=R>1,O=(P?0:this.offset)+T,I=R%2,q=O<w,B=O>(P?t?h:u:t?f:a)-w,W=(P?I&&!q:!I&&!q)||B,E=ee.createElement(\"div\"),N=ee.createElement(\"div\"),A=t?W?\"right\":\"left\":W?\"bottom\":\"top\",L=W?(t?_:y)+(P?t?-1:B?0:-2:t?-1:-2):t?1:0;N.innerHTML=`${this.id}${k[I]}${this.thresholds[R]}`,E.style.cssText=`${b(\"absolute\",0,0,_,y)}\n display: flex;\n flex-direction: ${t?\"column\":\"row\"};\n justify-content: flex-${P?\"start\":\"end\"};\n align-items: flex-${W?\"end\":\"start\"};\n border-${A}: 2px solid ${o};\n `,N.style.cssText=`\n overflow: hidden;\n max-width: ${d/2-10}px;\n height: ${y};\n margin-${t?W?\"right\":\"left\":W?\"bottom\":\"top\"}: -2px;\n padding: 1px;\n font-family: ui-monospace, monospace;\n font-size: 10px;\n letter-spacing: -.025em;\n line-height: 9px;\n font-weight: 600;\n text-align: ${t&&W||!t&&!P?\"right\":\"left\"};\n white-space: pre;\n text-overflow: ellipsis;\n color: ${I?o:\"rgba(0,0,0,.75)\"};\n background-color: ${I?\"rgba(0,0,0,.65)\":o};\n border: 2px solid ${I?o:\"transparent\"};\n border-${t?W?\"top-left\":\"top-right\":W?\"top-left\":\"bottom-left\"}-radius: 5px;\n border-${t?W?\"bottom-left\":\"bottom-right\":W?\"top-right\":\"bottom-right\"}-radius: 5px;\n `,E.appendChild(N);let D=O-L+(t?1:0);E.style[t?\"left\":\"top\"]=`${D}px`,(P?i:n).appendChild(E)}),r.appendChild(i),r.appendChild(n),e.element.appendChild(r),s||r.classList.add(\"animejs-onscroll-debug\"),this.$debug=r,us(e.element,\"position\")===\"static\"&&(this.debugStyles=es(e.element,{position:\"relative \"}))}updateBounds(){this._debug&&this.removeDebug();let e;const t=this.target,s=this.container,r=this.horizontal,i=this.linked;let n,o=t;for(i&&(n=i.currentTime,i.seek(0,!0));o&&o!==s.element&&o!==ee.body;){const I=us(o,\"position\")===\"sticky\"?es(o,{position:\"static\"}):!1;o=o.parentElement,I&&(e||(e=[]),e.push(I))}const c=t.getBoundingClientRect(),h=s.scale,u=(r?c.left+s.scrollX-s.left:c.top+s.scrollY-s.top)*h,f=(r?c.width:c.height)*h,a=r?s.width:s.height,d=(r?s.scrollWidth:s.scrollHeight)-a,l=this.enter,g=this.leave;let m=\"start\",y=\"end\",_=\"end\",w=\"start\";if(Je(l)){const I=l.split(\" \");_=I[0],m=I.length>1?I[1]:m}else if(Ze(l)){const I=l;U(I.container)||(_=I.container),U(I.target)||(m=I.target)}else tt(l)&&(_=l);if(Je(g)){const I=g.split(\" \");w=I[0],y=I.length>1?I[1]:y}else if(Ze(g)){const I=g;U(I.container)||(w=I.container),U(I.target)||(y=I.target)}else tt(g)&&(w=g);const S=si(t,m,f),v=si(t,y,f),p=S+u-a,b=v+u-d,k=si(t,_,a,p,b),T=si(t,w,a,p,b),R=S+u-k,P=v+u-T,O=P-R;this.offset=u,this.offsetStart=R,this.offsetEnd=P,this.distance=O<=0?0:O,this.thresholds=[m,y,_,w],this.coords=[S,v,k,T],e&&e.forEach(I=>I.revert()),i&&i.seek(n,!0),this._debug&&this.debug()}handleScroll(){if(!this.ready)return;const e=this.linked,t=this.sync,s=this.syncEase,r=this.syncSmooth,i=e&&(s||r),n=this.horizontal,o=this.container,c=this.scroll,h=c<=this.offsetStart,u=c>=this.offsetEnd,f=!h&&!u,a=c===this.offsetStart||c===this.offsetEnd,d=!this.hasEntered&&a,l=this._debug&&this.$debug;let g=!1,m=!1,y=this.progress;if(h&&this.began&&(this.began=!1),y>0&&!this.began&&(this.began=!0),i){const _=e.progress;if(r&&tt(r)){if(r<1){const w=_<y&&y===1?1e-4:_>y&&!y?-1e-4:0;y=G(as(_,y,as(.01,.2,r))+w,6)}}else s&&(y=s(y));g=y!==this.prevProgress,m=_===1,g&&!m&&r&&_&&o.wakeTicker.restart()}if(l){const _=n?o.scrollY:o.scrollX;l.style[n?\"top\":\"left\"]=_+10+\"px\"}(f&&!this.isInView||d&&!this.forceEnter&&!this.hasEntered)&&(f&&(this.isInView=!0),!this.forceEnter||!this.hasEntered?(l&&f&&(l.style.zIndex=`${this.container.zIndex++}`),this.onSyncEnter(this),this.onEnter(this),this.backward?(this.onSyncEnterBackward(this),this.onEnterBackward(this)):(this.onSyncEnterForward(this),this.onEnterForward(this)),this.hasEntered=!0,d&&(this.forceEnter=!0)):f&&(this.forceEnter=!1)),(f||!f&&this.isInView)&&(g=!0),g&&(i&&e.seek(e.duration*y),this.onUpdate(this)),!f&&this.isInView&&(this.isInView=!1,this.onSyncLeave(this),this.onLeave(this),this.backward?(this.onSyncLeaveBackward(this),this.onLeaveBackward(this)):(this.onSyncLeaveForward(this),this.onLeaveForward(this)),t&&!r&&(m=!0)),y>=1&&this.began&&!this.completed&&(t&&m||!t)&&(t&&this.onSyncComplete(this),this.completed=!0,(!this.repeat&&!e||!this.repeat&&e&&e.completed)&&this.revert()),y<1&&this.completed&&(this.completed=!1),this.prevProgress=y}revert(){if(this.reverted)return;const e=this.container;return $t(e,this),e._head||e.revert(),this._debug&&this.removeDebug(),this.reverted=!0,this.ready=!1,this}},Hh=(e={})=>new ma(e),va=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,Fh=(e,t,s)=>{let r=0,i=1,n,o,c=0;do o=r+(i-r)/2,n=va(o,t,s)-e,n>0?i=o:r=o;while(At(n)>1e-7&&++c<100);return o},ya=(e=.5,t=0,s=.5,r=1)=>e===t&&s===r?kt:i=>i===0||i===1?i:va(Fh(i,e,s),t,r),ba=(e=10,t)=>{const s=t?ih:$s;return r=>s(J(r,0,1)*e)*(1/e)},un=(...e)=>{const t=e.length;if(!t)return kt;const s=t-1,r=e[0],i=e[s],n=[0],o=[ws(r)];for(let c=1;c<s;c++){const h=e[c],u=Je(h)?h.trim().split(\" \"):[h],f=u[0],a=u[1];n.push(U(a)?c/s:ws(a)/100),o.push(ws(f))}return o.push(ws(i)),n.push(1),function(h){for(let u=1,f=n.length;u<f;u++){const a=n[u];if(h<=a){const d=n[u-1],l=o[u-1];return l+(o[u]-l)*(h-d)/(a-d)}}return o[o.length-1]}},Sa=(e=10,t=1)=>{const s=[0],r=e-1;for(let i=1;i<r;i++){const n=s[i-1],o=i/r,c=o+((i+1)/r-o)*Math.random(),h=o*(1-t)+c*t;s.push(J(h,n,1))}return s.push(1),un(...s)},Vh=Ps({Spring:()=>Zr,createSpring:()=>ca,cubicBezier:()=>ya,eases:()=>Jt,irregular:()=>Sa,linear:()=>un,spring:()=>Jr,steps:()=>ba}),ri=(e,t=100)=>{const s=[];for(let r=0;r<=t;r++)s.push(G(e(r/t),4));return`linear(${s.join(\", \")})`},_a={},wa=e=>{let t=_a[e];if(t)return t;if(t=\"linear\",Je(e)){if(Ye(e,\"linear\")||Ye(e,\"cubic-\")||Ye(e,\"steps\")||Ye(e,\"ease\"))t=e;else if(Ye(e,\"cubicB\"))t=Nr(e);else{const s=ra(e);Fe(s)&&(t=s===kt?\"linear\":ri(s))}_a[e]=t}else if(Fe(e)){const s=ri(e);s&&(t=s)}else e.ease&&(t=ri(e.ease));return t},ka=[\"x\",\"y\",\"z\"],zh=[\"perspective\",\"width\",\"height\",\"margin\",\"padding\",\"top\",\"right\",\"bottom\",\"left\",\"borderWidth\",\"fontSize\",\"borderRadius\",...ka],Uh=[...ka,...Ss.filter(e=>[\"X\",\"Y\",\"Z\"].some(t=>e.endsWith(t)))],hn=null,hr=(e,t,s,r,i)=>{let n=Je(t)?t:je(t,s,r,i,null,null);return tt(n)?zh.includes(e)||Ye(e,\"translate\")?`${n}px`:Ye(e,\"rotate\")||Ye(e,\"skew\")?`${n}deg`:`${n}`:n},xa=(e,t,s,r,i,n)=>{let o=\"0\";const c=U(r)?getComputedStyle(e)[t]:hr(t,r,e,i,n);return U(s)?o=et(r)?r.map(h=>hr(t,h,e,i,n)):c:o=[hr(t,s,e,i,n),c],o},Ta=class{constructor(e,t){Ge.current&&Ge.current.register(this),_s(hn)&&(Ut&&(U(CSS)||!Object.hasOwnProperty.call(CSS,\"registerProperty\"))?hn=!1:(Ss.forEach(d=>{const l=Ye(d,\"skew\"),g=Ye(d,\"scale\"),m=Ye(d,\"rotate\"),y=Ye(d,\"translate\"),_=m||l,w=_?\"<angle>\":g?\"<number>\":y?\"<length-percentage>\":\"*\";try{CSS.registerProperty({name:\"--\"+d,syntax:w,inherits:!1,initialValue:y?\"0px\":_?\"0deg\":g?\"1\":\"0\"})}catch{}}),hn=!0));const s=ls(e);s.length||console.warn(\"No target found. Make sure the element you're trying to animate is accessible before creating your animation.\");const r=j(t.autoplay,X.defaults.autoplay),i=r&&r.link?r:!1,n=t.alternate&&t.alternate===!0,o=t.reversed&&t.reversed===!0,c=j(t.loop,X.defaults.loop),h=c===!0||c===1/0?1/0:tt(c)?c+1:1,u=n?o?\"alternate-reverse\":\"alternate\":o?\"reverse\":\"normal\",f=\"both\",a=X.timeScale===1?1:ft;this.targets=s,this.animations=[],this.controlAnimation=null,this.onComplete=t.onComplete||X.defaults.onComplete,this.duration=0,this.muteCallbacks=!1,this.completed=!1,this.paused=!r||i!==!1,this.reversed=o,this.persist=j(t.persist,X.defaults.persist),this.autoplay=r,this._speed=j(t.playbackRate,X.defaults.playbackRate),this._resolve=ne,this._completed=0,this._inlineStyles=[],s.forEach((d,l)=>{const g=d[ir],m=Uh.some(P=>t.hasOwnProperty(P)),y=d.style,_=this._inlineStyles[l]={},w=j(t.ease,X.defaults.ease),S=je(w,d,l,s,null,null),v=Fe(S)||Je(S)?S:w,p=w.ease&&w,b=wa(v),k=(p?p.settlingDuration:je(j(t.duration,X.defaults.duration),d,l,s,null,null))*a,T=je(j(t.delay,X.defaults.delay),d,l,s,null,null)*a,R=j(t.composition,\"replace\");for(let P in t){if(!Ds(P))continue;const O={},I={iterations:h,direction:u,fill:f,easing:b,duration:k,delay:T,composite:R},q=t[P],B=m?Ss.includes(P)?P:Ui.get(P):!1,W=B?\"transform\":P;_[W]||(_[W]=y[W]);let E;if(Ze(q)){const N=q,A=j(N.ease,b),L=A.ease&&A,D=N.to,H=N.from;if(I.duration=(L?L.settlingDuration:je(j(N.duration,k),d,l,s,null,null))*a,I.delay=je(j(N.delay,T),d,l,s,null,null)*a,I.composite=j(N.composition,R),I.easing=wa(A),E=xa(d,P,H,D,l,s),B?(O[`--${B}`]=E,g[B]=E):O[P]=xa(d,P,H,D,l,s),ua(this,d,P,O,I),!U(H))if(!B)y[P]=O[P][0];else{const F=`--${B}`;y.setProperty(F,O[F][0])}}else E=et(q)?q.map(N=>hr(P,N,d,l,s)):hr(P,q,d,l,s),B?(O[`--${B}`]=E,g[B]=E):O[P]=E,ua(this,d,P,O,I)}if(m){let P=\"\";for(let O in g)P+=`${Po[O]}var(--${O})) `;y.transform=P}}),i&&this.autoplay.link(this)}forEach(e){try{const t=Je(e)?s=>s[e]():e;this.animations.forEach(t)}catch{}return this}get speed(){return this._speed}set speed(e){this._speed=+e,this.forEach(t=>t.playbackRate=e)}get currentTime(){const e=this.controlAnimation,t=X.timeScale;return this.completed?this.duration:e?+e.currentTime*(t===1?1:t):0}set currentTime(e){const t=e*(X.timeScale===1?1:ft);this.forEach(s=>{!this.persist&&t>=this.duration&&s.play(),s.currentTime=t})}get progress(){return this.currentTime/this.duration}set progress(e){this.forEach(t=>t.currentTime=e*this.duration||0)}resume(){return this.paused?(this.paused=!1,this.forEach(\"play\")):this}pause(){return this.paused?this:(this.paused=!0,this.forEach(\"pause\"))}alternate(){return this.reversed=!this.reversed,this.forEach(\"reverse\"),this.paused&&this.forEach(\"pause\"),this}play(){return this.reversed&&this.alternate(),this.resume()}reverse(){return this.reversed||this.alternate(),this.resume()}seek(e,t=!1){return t&&(this.muteCallbacks=!0),e<this.duration&&(this.completed=!1),this.currentTime=e,this.muteCallbacks=!1,this.paused&&this.pause(),this}restart(){return this.completed=!1,this.seek(0,!0).resume()}commitStyles(){return this.forEach(\"commitStyles\")}complete(){return this.seek(this.duration)}cancel(){return this.muteCallbacks=!0,this.commitStyles().forEach(\"cancel\"),this.animations.length=0,requestAnimationFrame(()=>{this.targets.forEach(e=>{e.style.transform===\"none\"&&e.style.removeProperty(\"transform\")})}),this}revert(){return this.cancel().targets.forEach((e,t)=>{const s=e.style,r=this._inlineStyles[t];for(let i in r){const n=r[i];U(n)||n===\"\"?s.removeProperty(Nr(i)):e.style[i]=n}e.getAttribute(\"style\")===\"\"&&e.removeAttribute(\"style\")}),this}then(e=ne){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=ne};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},Ca={animate:(e,t)=>new Ta(e,t),convertEase:ri},Wh=0,Gh=0,ii=(e,t)=>!e||!t?!1:e===t||e.contains(t),Vs=e=>{if(!e)return null;const t=e.style,s=t.transition||\"\";return t.setProperty(\"transition\",\"none\",\"important\"),s},ni=(e,t)=>{if(!e)return;const s=e.style;t?s.transition=t:s.removeProperty(\"transition\")},Xh=e=>{const t=e.layout.transitionMuteStore,s=e.$el,r=e.$measure;s&&!t.has(s)&&t.set(s,Vs(s)),r&&!t.has(r)&&t.set(r,Vs(r))},oi=e=>{e.forEach((t,s)=>ni(s,t)),e.clear()},jh={display:\"none\",visibility:\"hidden\",opacity:\"0\",transform:\"none\",position:\"static\"},Yh=e=>{if(!e)return;const t=e.parentNode;t&&(t._head===e&&(t._head=e._next),t._tail===e&&(t._tail=e._prev),e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e._prev=null,e._next=null,e.parentNode=null)},Ea=(e,t,s,r)=>{let i=e.dataset.layoutId;i||(i=e.dataset.layoutId=`node-${Gh++}`);const n=r||{};return n.$el=e,n.$measure=e,n.id=i,n.index=0,n.targets=null,n.delay=0,n.duration=0,n.ease=null,n.state=s,n.layout=s.layout,n.parentNode=t||null,n.isTarget=!1,n.isEntering=!1,n.isLeaving=!1,n.isInlined=!1,n.hasTransform=!1,n.inlineStyles=[],n.inlineTransforms=null,n.inlineTransition=null,n.branchAdded=!1,n.branchRemoved=!1,n.branchNotRendered=!1,n.sizeChanged=!1,n.hasVisibilitySwap=!1,n.hasDisplayNone=!1,n.hasVisibilityHidden=!1,n.measuredInlineTransform=null,n.measuredInlineTransition=null,n.measuredDisplay=null,n.measuredVisibility=null,n.measuredPosition=null,n.measuredHasDisplayNone=!1,n.measuredHasVisibilityHidden=!1,n.measuredIsVisible=!1,n.measuredIsRemoved=!1,n.measuredIsInsideRoot=!1,n.properties={transform:\"none\",x:0,y:0,left:0,top:0,clientLeft:0,clientTop:0,width:0,height:0},n.layout.properties.forEach(o=>n.properties[o]=0),n._head=null,n._tail=null,n._prev=null,n._next=null,n},Aa=(e,t,s,r)=>{const i=e.$el,n=e.layout.root,o=n===i,c=e.properties,h=e.state.rootNode,u=e.parentNode,f=s.transform,a=i.style.transform,d=u?u.measuredIsRemoved:!1,l=s.position;o&&(e.layout.absoluteCoords=l===\"fixed\"||l===\"absolute\"),e.$measure=t,e.inlineTransforms=a,e.hasTransform=f&&f!==\"none\",e.measuredIsInsideRoot=ii(n,t),e.measuredInlineTransform=null,e.measuredDisplay=s.display,e.measuredVisibility=s.visibility,e.measuredPosition=l,e.measuredHasDisplayNone=s.display===\"none\",e.measuredHasVisibilityHidden=s.visibility===\"hidden\",e.measuredIsVisible=!(e.measuredHasDisplayNone||e.measuredHasVisibilityHidden),e.measuredIsRemoved=e.measuredHasDisplayNone||e.measuredHasVisibilityHidden||d;let g=!1,m=i.previousSibling;for(;m&&(m.nodeType===Node.COMMENT_NODE||m.nodeType===Node.TEXT_NODE&&!m.textContent.trim());)m=m.previousSibling;if(m&&m.nodeType===Node.TEXT_NODE)g=!0;else{for(m=i.nextSibling;m&&(m.nodeType===Node.COMMENT_NODE||m.nodeType===Node.TEXT_NODE&&!m.textContent.trim());)m=m.nextSibling;g=m!==null&&m.nodeType===Node.TEXT_NODE}if(e.isInlined=g,e.hasTransform&&!r){const b=e.layout.transitionMuteStore;b.get(i)||(e.inlineTransition=Vs(i)),t===i?i.style.transform=\"none\":(b.get(t)||(e.measuredInlineTransition=Vs(t)),e.measuredInlineTransform=t.style.transform,t.style.transform=\"none\")}let y=0,_=0,w=0,S=0;if(!r){const b=t.getBoundingClientRect();y=b.left,_=b.top,w=b.width,S=b.height}for(let b in c){const k=b===\"transform\"?f:s[b]||s.getPropertyValue&&s.getPropertyValue(b);U(k)||(c[b]=k)}c.left=y,c.top=_,c.clientLeft=r?0:t.clientLeft,c.clientTop=r?0:t.clientTop;let v,p;if(o)e.layout.absoluteCoords?(v=y,p=_):(v=0,p=0);else{const b=u||h,k=b.properties.left,T=b.properties.top,R=b.properties.clientLeft,P=b.properties.clientTop;if(e.layout.absoluteCoords)v=y-k-R,p=_-T-P;else if(b===h){const O=h.properties.left,I=h.properties.top,q=h.properties.clientLeft,B=h.properties.clientTop;v=y-O-q,p=_-I-B}else v=y-k-R,p=_-T-P}return c.x=v,c.y=p,c.width=w,c.height=S,e},Pa=(e,t)=>{if(t)for(let s in t)e.properties[s]=t[s]},dr=(e,t)=>{const s=je(t.ease,e.$el,e.index,e.targets,null,null),r=Fe(s)?s:t.ease,i=!U(r)&&!U(r.ease);e.ease=i?r.ease:r,e.duration=i?r.settlingDuration:je(t.duration,e.$el,e.index,e.targets,null,null),e.delay=je(t.delay,e.$el,e.index,e.targets,null,null)},Zh=e=>{const t=e.$el.style,s=e.inlineStyles;s.length=0,e.layout.recordedProperties.forEach(r=>{s.push(r,t[r]||\"\")})},La=e=>{const t=e.$el.style,s=e.inlineStyles;for(let r=0,i=s.length;r<i;r+=2){const n=s[r],o=s[r+1];o&&o!==\"\"?t[n]=o:(t[n]=\"\",t.removeProperty(n))}},Jh=e=>{const t=e.inlineTransforms,s=e.$el.style;!e.hasTransform||!t||e.hasTransform&&s.transform===\"none\"||t&&t===\"none\"?s.removeProperty(\"transform\"):t&&(s.transform=t);const r=e.$measure;if(e.hasTransform&&r!==e.$el){const i=r.style,n=e.measuredInlineTransform;n&&n!==\"\"?i.transform=n:i.removeProperty(\"transform\")}e.measuredInlineTransform=null,e.inlineTransition!==null&&(ni(e.$el,e.inlineTransition),e.inlineTransition=null),r!==e.$el&&e.measuredInlineTransition!==null&&(ni(r,e.measuredInlineTransition),e.measuredInlineTransition=null)},Ra=e=>{(e.measuredIsRemoved||e.hasVisibilitySwap)&&(e.$el.style.removeProperty(\"display\"),e.$el.style.removeProperty(\"visibility\"),e.hasVisibilitySwap&&(e.$measure.style.removeProperty(\"display\"),e.$measure.style.removeProperty(\"visibility\"))),e.layout.pendingRemoval.delete(e.$el)},dn=(e,t,s)=>(t.properties={...e.properties},t.state=s,t.isTarget=e.isTarget,t.hasTransform=e.hasTransform,t.inlineTransforms=e.inlineTransforms,t.measuredIsVisible=e.measuredIsVisible,t.measuredDisplay=e.measuredDisplay,t.measuredIsRemoved=e.measuredIsRemoved,t.measuredHasDisplayNone=e.measuredHasDisplayNone,t.measuredHasVisibilityHidden=e.measuredHasVisibilityHidden,t.hasDisplayNone=e.hasDisplayNone,t.isInlined=e.isInlined,t.hasVisibilityHidden=e.hasVisibilityHidden,t),Ia=class{constructor(e){this.layout=e,this.rootNode=null,this.rootNodes=new Set,this.nodes=new Map,this.scrollX=0,this.scrollY=0}revert(){return this.forEachNode(e=>{this.layout.pendingRemoval.delete(e.$el),e.$el.removeAttribute(\"data-layout-id\"),e.$measure.removeAttribute(\"data-layout-id\")}),this.rootNode=null,this.rootNodes.clear(),this.nodes.clear(),this}getNode(e){if(!(!e||!e.dataset))return this.nodes.get(e.dataset.layoutId)}getComputedValue(e,t){const s=this.getNode(e);if(s)return s.properties[t]}forEach(e,t){let s=e,r=0;for(;s;)if(t(s,r++),s._head)s=s._head;else if(s._next)s=s._next;else{for(;s&&!s._next;)s=s.parentNode;s&&(s=s._next)}}forEachRootNode(e){this.forEach(this.rootNode,e)}forEachNode(e){for(const t of this.rootNodes)this.forEach(t,e)}registerElement(e,t){if(!e||e.nodeType!==1)return null;this.layout.transitionMuteStore.has(e)||this.layout.transitionMuteStore.set(e,Vs(e));const s=[e,t],r=this.layout.root;let i=null;for(;s.length;){const n=s.pop(),o=s.pop();if(!o||o.nodeType!==1||Dr(o))continue;const c=n?n.measuredIsRemoved:!1,h=c?jh:getComputedStyle(o),u=c?!0:h.display===\"none\",f=c?!0:h.visibility===\"hidden\",a=!u&&!f,d=o.dataset.layoutId,l=ii(r,o);let g=d?this.nodes.get(d):null;if(g&&g.$el!==o){const y=ii(r,g.$el),_=g.measuredIsVisible,w=!y&&(l||!l&&!_&&a),S=y&&!_&&a;if(w)Yh(g),g=Ea(o,n,this,g);else if(S){Aa(g,o,h,c);let v=o.lastElementChild;for(;v;)s.push(v,g),v=v.previousElementSibling;i||(i=g);continue}else{let v=o.lastElementChild;for(;v;)s.push(v,n),v=v.previousElementSibling;i||(i=g);continue}}else g=Ea(o,n,this,g);g.branchAdded=!1,g.branchRemoved=!1,g.branchNotRendered=!1,g.isTarget=!1,g.sizeChanged=!1,g.hasVisibilityHidden=f,g.hasDisplayNone=u,g.hasVisibilitySwap=f&&!g.measuredHasVisibilityHidden||u&&!g.measuredHasDisplayNone,this.nodes.set(g.id,g),g.parentNode=n||null,g._prev=null,g._next=null,n?(this.rootNodes.delete(g),n._head?(n._tail._next=g,g._prev=n._tail,n._tail=g):(n._head=g,n._tail=g)):this.rootNodes.add(g),Aa(g,g.$el,h,c);let m=o.lastElementChild;for(;m;)s.push(m,g),m=m.previousElementSibling;i||(i=g)}return i}ensureDetachedNode(e,t){if(!e||e===this.layout.root)return null;const s=e.dataset.layoutId,r=s?this.nodes.get(s):null;if(r&&r.$el===e)return r;let i=null,n=e.parentElement;for(;n&&n!==this.layout.root;){if(t.has(n)){i=this.ensureDetachedNode(n,t);break}n=n.parentElement}return this.registerElement(e,i)}record(){const e=this.layout,t=e.children,s=e.root,r=et(t)?t:[t],i=[],n=t===\"*\"?s:Ge.root,o=[];let c=s.parentElement;for(;c&&c.nodeType===1;){const m=getComputedStyle(c);if(m.transform&&m.transform!==\"none\"){const y=c.style.transform||\"\",_=Vs(c);o.push(c,y,_),c.style.transform=\"none\"}c=c.parentElement}for(let m=0,y=r.length;m<y;m++){const _=r[m];i[m]=Je(_)?n.querySelectorAll(_):_}const h=ls(i);this.nodes.clear(),this.rootNodes.clear();const u=this.registerElement(s,null);u.isTarget=!0,this.rootNode=u;const f=new Set;let a=0;const d=[];this.nodes.forEach(m=>{d.push(m.$el)}),this.nodes.forEach((m,y)=>{m.index=a++,m.targets=d,m&&m.measuredIsInsideRoot&&f.add(y)});const l=new Set,g=[];for(let m=0,y=h.length;m<y;m++){const _=h[m];if(!(!_||_.nodeType!==1||_===s)){if(!ii(s,_)){const w=_.dataset.layoutId;if(!w||!f.has(w))continue}l.has(_)||(l.add(_),g.push(_))}}for(let m=0,y=g.length;m<y;m++)this.ensureDetachedNode(g[m],l);for(let m=0,y=h.length;m<y;m++){const _=h[m],w=this.getNode(_);if(w){let S=w;for(;S&&!S.isTarget;)S.isTarget=!0,S=S.parentNode}}this.scrollX=window.scrollX,this.scrollY=window.scrollY,this.forEachNode(Jh);for(let m=0,y=o.length;m<y;m+=3){const _=o[m],w=o[m+1],S=o[m+2];w&&w!==\"\"?_.style.transform=w:_.style.removeProperty(\"transform\"),ni(_,S)}return this}};function zs(e){const t={},s={};for(let r in e){const i=e[r],n=r===\"ease\";r===\"duration\"||r===\"delay\"||n?s[r]=i:t[r]=i}return[t,s]}var Oa=class{constructor(e,t={}){Ge.current&&Ge.current.register(this);const s=zs(t.swapAt),r=zs(t.enterFrom),i=zs(t.leaveTo),n=t.properties;if(t.duration=j(t.duration,350),t.delay=j(t.delay,0),t.ease=j(t.ease,\"inOut(3.5)\"),this.params=t,this.root=ls(e)[0],this.id=t.id||Wh++,this.children=t.children||\"*\",this.absoluteCoords=!1,this.swapAtParams=Pt(t.swapAt||{opacity:0},{ease:\"inOut(1.75)\"}),this.enterFromParams=t.enterFrom||{opacity:0},this.leaveToParams=t.leaveTo||{opacity:0},this.properties=new Set([\"opacity\",\"fontSize\",\"color\",\"backgroundColor\",\"borderRadius\",\"border\",\"filter\",\"clipPath\"]),s[0])for(let o in s[0])this.properties.add(o);if(r[0])for(let o in r[0])this.properties.add(o);if(i[0])for(let o in i[0])this.properties.add(o);if(n)for(let o=0,c=n.length;o<c;o++)this.properties.add(n[o]);this.recordedProperties=new Set([\"display\",\"visibility\",\"translate\",\"position\",\"left\",\"top\",\"marginLeft\",\"marginTop\",\"width\",\"height\",\"maxWidth\",\"maxHeight\",\"minWidth\",\"minHeight\"]),this.properties.forEach(o=>this.recordedProperties.add(o)),this.pendingRemoval=new WeakSet,this.transitionMuteStore=new Map,this.oldState=new Ia(this),this.newState=new Ia(this),this.timeline=null,this.transformAnimation=null,this.animating=[],this.swapping=[],this.leaving=[],this.entering=[],this.oldState.record(),oi(this.transitionMuteStore)}revert(){return this.root.classList.remove(\"is-animated\"),this.timeline&&(this.timeline.complete(),this.timeline=null),this.transformAnimation&&(this.transformAnimation.complete(),this.transformAnimation=null),this.animating.length=this.swapping.length=this.leaving.length=this.entering.length=0,this.oldState.revert(),this.newState.revert(),requestAnimationFrame(()=>oi(this.transitionMuteStore)),this}record(){return this.transformAnimation&&(this.transformAnimation.cancel(),this.transformAnimation=null),this.oldState.record(),this.timeline&&(this.timeline.cancel(),this.timeline=null),this.newState.forEachRootNode(La),this}animate(e={}){const t={ease:j(e.ease,this.params.ease),delay:j(e.delay,this.params.delay),duration:j(e.duration,this.params.duration)},s={id:this.id},r=j(e.onComplete,this.params.onComplete),i=j(e.onPause,this.params.onPause);for(let E in nr)E!==\"ease\"&&E!==\"duration\"&&E!==\"delay\"&&(U(e[E])?U(this.params[E])||(s[E]=this.params[E]):s[E]=e[E]);s.onComplete=()=>{const E=e.autoplay,N=X.editor;if(E&&E.linked||N&&N.showPanel){r&&r(this.timeline);return}this.transformAnimation&&this.transformAnimation.cancel(),m.forEachRootNode(A=>{Ra(A),La(A)});for(let A=0,L=k.length;A<L;A++){const D=k[A];D.style.transform=m.getComputedValue(D,\"transform\")}this.root.classList.contains(\"is-animated\")&&(this.root.classList.remove(\"is-animated\"),r&&r(this.timeline)),requestAnimationFrame(()=>{this.root.classList.contains(\"is-animated\")||oi(this.transitionMuteStore)})},s.onPause=()=>{const E=e.autoplay;if(E&&E.linked){r&&r(this.timeline),i&&i(this.timeline);return}this.root.classList.contains(\"is-animated\")&&(this.transformAnimation&&this.transformAnimation.cancel(),m.forEachRootNode(Ra),this.root.classList.remove(\"is-animated\"),r&&r(this.timeline),i&&i(this.timeline))},s.composition=!1;const n=Pt(Pt(e.swapAt||{},this.swapAtParams),t),o=Pt(Pt(e.enterFrom||{},this.enterFromParams),t),c=Pt(Pt(e.leaveTo||{},this.leaveToParams),t),[h,u]=zs(n),[f,a]=zs(o),[d,l]=zs(c),g=this.oldState,m=this.newState,y=this.animating,_=this.swapping,w=this.entering,S=this.leaving,v=this.pendingRemoval;y.length=_.length=w.length=S.length=0,g.forEachRootNode(Xh),m.record(),m.forEachRootNode(Zh);const p=[],b=[],k=[],T=[],R=m.rootNode,P=R.$el;m.forEachRootNode(E=>{const N=E.$el,A=E.id,L=E.parentNode,D=L?L.branchAdded:!1,H=L?L.branchRemoved:!1,F=L?L.branchNotRendered:!1;let V=g.nodes.get(A);const Y=!V;Y?(V=dn(E,{},g),g.nodes.set(A,V),V.measuredIsRemoved=!0):V.measuredIsRemoved&&!E.measuredIsRemoved&&(dn(E,V,g),V.measuredIsRemoved=!0);const te=V.parentNode,se=(te?te.id:null)!==(L?L.id:null),me=V.$el!==E.$el,ge=V.measuredIsRemoved,oe=E.measuredIsRemoved;if(!V.measuredIsRemoved&&!oe&&!Y&&(se||me)){const be=V.properties.left,Oe=V.properties.top,Ie=L||m.rootNode,Se=Ie.id?g.nodes.get(Ie.id):null,le=Se?Se.properties.left:Ie.properties.left,_e=Se?Se.properties.top:Ie.properties.top,ye=Se?Se.properties.clientLeft:Ie.properties.clientLeft,Me=Se?Se.properties.clientTop:Ie.properties.clientTop;V.properties.x=be-le-ye,V.properties.y=Oe-_e-Me}E.hasVisibilitySwap&&(E.hasVisibilityHidden&&(E.$el.style.visibility=\"visible\",E.$measure.style.visibility=\"hidden\"),E.hasDisplayNone&&(E.$el.style.display=V.measuredDisplay||E.measuredDisplay||\"\",E.$measure.style.visibility=\"hidden\"));const K=v.has(N),ae=V.measuredIsVisible,Ce=E.measuredIsVisible,Re=!ae&&Ce&&!F,Le=!oe&&(ge||K)&&!D,Be=oe&&!ge&&!H,ke=Be||oe&&K&&!H;E.branchAdded=D||Le,E.branchRemoved=H||ke,E.branchNotRendered=F||oe,oe&&ae&&(E.$el.style.display=V.measuredDisplay,E.$el.style.visibility=\"visible\",dn(V,E,m)),Be?(E.isTarget&&(S.push(N),E.isLeaving=!0),v.add(N)):!oe&&K&&v.delete(N),Le&&!F||Re?(Pa(V,f),E.isTarget&&(w.push(N),E.isEntering=!0)):ke&&!F&&Pa(E,d),E!==R&&E.isTarget&&!E.isEntering&&!E.isLeaving&&y.push(N),p.push(N)});let O=0,I=0,q=0;m.forEachRootNode(E=>{const N=E.$el,A=E.parentNode,L=g.nodes.get(E.id),D=E.properties,H=L.properties;let F=A!==R&&A;for(;F&&!F.isTarget&&F!==R;)F=F.parentNode;E===R?(E.index=0,E.targets=y,dr(E,t)):E.isEntering?(E.index=F?F.index:O,E.targets=F?y:w,dr(E,a),O++):E.isLeaving?(E.index=F?F.index:I,E.targets=F?y:S,I++,dr(E,l)):E.isTarget?(E.index=q++,E.targets=y,dr(E,t)):(E.index=F?F.index:0,E.targets=y,dr(E,u)),L.index=E.index,L.targets=E.targets;for(let se in D)D[se]=je(D[se],N,E.index,E.targets,null,null),H[se]=je(H[se],N,L.index,L.targets,null,null);const V=1,Y=Math.abs(D.width-H.width)>V,te=Math.abs(D.height-H.height)>V;if(E.sizeChanged=Y||te,E.isTarget&&(!E.measuredIsRemoved&&L.measuredIsVisible||E.measuredIsRemoved&&E.measuredIsVisible)){(D.transform!==\"none\"||H.transform!==\"none\")&&(E.hasTransform=!0,k.push(N));for(let se in D)if(se!==\"transform\"&&D[se]!==H[se]){b.push(N);break}}E.isTarget||(_.push(N),E.sizeChanged&&A&&A.isTarget&&A.sizeChanged&&(h.transform&&(E.hasTransform=!0,k.push(N)),T.push(N)))});const B={delay:E=>m.getNode(E).delay,duration:E=>m.getNode(E).duration,ease:E=>m.getNode(E).ease};if(s.defaults=B,this.timeline=la(s),!b.length&&!k.length&&!_.length)return oi(this.transitionMuteStore),this.timeline.complete();if(p.length){this.root.classList.add(\"is-animated\");for(let E=0,N=p.length;E<N;E++){const A=p[E],L=A.dataset.layoutId,D=g.nodes.get(L),H=m.nodes.get(L),F=D.properties;H.isInlined||((D.measuredDisplay===\"grid\"||H.measuredDisplay===\"grid\")&&A.style.setProperty(\"display\",\"block\",\"important\"),(A!==P||this.absoluteCoords)&&(A.style.position=this.absoluteCoords?\"fixed\":\"absolute\",A.style.left=\"0px\",A.style.top=\"0px\",A.style.marginLeft=\"0px\",A.style.marginTop=\"0px\",A.style.translate=`${F.x}px ${F.y}px`),A===P&&H.measuredPosition===\"static\"&&(A.style.position=\"relative\",A.style.left=\"0px\",A.style.top=\"0px\")),A.style.width=`${F.width}px`,A.style.height=`${F.height}px`,A.style.minWidth=\"auto\",A.style.minHeight=\"auto\",A.style.maxWidth=\"none\",A.style.maxHeight=\"none\"}(g.scrollX!==window.scrollX||g.scrollY!==window.scrollY)&&requestAnimationFrame(()=>window.scrollTo(g.scrollX,g.scrollY));for(let E=0,N=b.length;E<N;E++){const A=b[E],L=A.dataset.layoutId,D=g.nodes.get(L),H=m.nodes.get(L),F=D.properties,V=H.properties;let Y=!1;const te={composition:\"none\"};F.width!==V.width&&(te.width=[F.width,V.width],Y=!0),F.height!==V.height&&(te.height=[F.height,V.height],Y=!0),!H.hasTransform&&!H.isInlined&&(te.translate=[`${F.x}px ${F.y}px`,`${V.x}px ${V.y}px`],Y=!0),this.properties.forEach(se=>{const me=F[se],ge=V[se];se!==\"transform\"&&me!==ge&&(te[se]=[me,ge],Y=!0)}),Y&&this.timeline.add(A,te,0)}}if(_.length){for(let E=0,N=_.length;E<N;E++){const A=_[E],L=g.getNode(A),D=L.properties;A.style.width=`${D.width}px`,A.style.height=`${D.height}px`,A.style.minWidth=\"auto\",A.style.minHeight=\"auto\",A.style.maxWidth=\"none\",A.style.maxHeight=\"none\",L.isInlined||(A.style.translate=`${D.x}px ${D.y}px`),this.properties.forEach(H=>{H!==\"transform\"&&(A.style[H]=`${g.getComputedValue(A,H)}`)})}for(let E=0,N=_.length;E<N;E++){const A=_[E],L=m.getNode(A),D=L.properties;this.timeline.call(()=>{A.style.width=`${D.width}px`,A.style.height=`${D.height}px`,A.style.minWidth=\"auto\",A.style.minHeight=\"auto\",A.style.maxWidth=\"none\",A.style.maxHeight=\"none\",L.isInlined||(A.style.translate=`${D.x}px ${D.y}px`),this.properties.forEach(H=>{H!==\"transform\"&&(A.style[H]=`${m.getComputedValue(A,H)}`)})},L.delay+L.duration/2)}if(T.length){const E=Kt(m.nodes.get(T[0].dataset.layoutId).ease),N=L=>1-E(1-L),A={};if(h)for(let L in h)L!==\"transform\"&&(A[L]=[{from:D=>g.getComputedValue(D,L),to:h[L]},{from:h[L],to:D=>m.getComputedValue(D,L),ease:N}]);this.timeline.add(T,A,0)}}const W=k.length;if(W){for(let E=0;E<W;E++){const N=k[E],A=m.getNode(N);A.isInlined||(N.style.translate=`${g.getComputedValue(N,\"x\")}px ${g.getComputedValue(N,\"y\")}px`),N.style.transform=g.getComputedValue(N,\"transform\"),T.includes(N)&&(A.ease=je(n.ease,N,A.index,A.targets,null,null),A.duration=je(n.duration,N,A.index,A.targets,null,null))}this.transformAnimation=Ca.animate(k,{translate:E=>m.getNode(E).isInlined?\"0px 0px\":`${m.getComputedValue(E,\"x\")}px ${m.getComputedValue(E,\"y\")}px`,transform:E=>{const N=m.getComputedValue(E,\"transform\");if(!T.includes(E))return N;const A=g.getComputedValue(E,\"transform\"),L=m.getNode(E);return[A,je(h.transform,E,L.index,L.targets,null,null),N]},autoplay:!1,...B}),this.timeline.sync(this.transformAnimation,0)}return this.timeline.init()}update(e,t={}){return this.record(),e(this),this.animate(t)}},Kh=(e,t)=>new Oa(e,t),Lt=xh,ai={},Qh=(e,t=0)=>(...s)=>t?r=>e(...s,r):r=>e(r,...s),Ma=e=>(...t)=>{const s=e(...t);return new Proxy(ne,{apply:(r,i,[n])=>s(n),get:(r,i)=>{if(ai[i])return Ma((...n)=>{const o=ai[i](...n);return c=>o(s(c))})}})},Rt=(e,t,s=0)=>{const r=(...i)=>(i.length<t.length?Ma(Qh(t,s)):t)(...i);return ai[e]||(ai[e]=r),r},Na=Rt(\"roundPad\",Lt.roundPad),Da=Rt(\"padStart\",Lt.padStart),$a=Rt(\"padEnd\",Lt.padEnd),qa=Rt(\"wrap\",Lt.wrap),Ba=Rt(\"mapRange\",Lt.mapRange),Ha=Rt(\"degToRad\",Lt.degToRad),Fa=Rt(\"radToDeg\",Lt.radToDeg),Va=Rt(\"snap\",Lt.snap),za=Rt(\"clamp\",Lt.clamp),Ua=Rt(\"round\",Lt.round),Wa=Rt(\"lerp\",Lt.lerp,1),Ga=Rt(\"damp\",Lt.damp,1),fr=(e=0,t=1,s=0)=>{const r=10**s;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},ed=0,pr=(e,t=0,s=1,r=0)=>{let i=e===void 0?ed++:e;return(n=t,o=s,c=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);const h=10**c;return Math.floor((((i^i>>>14)>>>0)/4294967296*(o-n+1/h)+n)*h)/h}},Xa=e=>e[fr(0,e.length-1)],fn=(e,t=fr)=>{let s=e.length,r,i;for(;s;)i=t(0,--s),r=e[s],e[s]=e[i],e[i]=r;return e},gr=(e,t={})=>{let s=[],r=0,i,n=null;const o=t.from,c=t.reversed,h=t.ease,u=!U(h),f=u&&!U(h.ease)?h.ease:u?Kt(h):null,a=t.grid,d=a===!0,l=t.axis,g=t.total,m=U(o)||o===0||o===\"first\",y=o===\"center\",_=o===\"last\",w=o===\"random\",S=et(o),v=et(e),p=t.use,b=ws(v?e[0]:e),k=v?ws(e[1]):0,T=Ro.exec((v?e[1]:e)+\"\"),R=t.start||0+(v?b:0),P=t.seed,O=!U(P)&&P!==!1?pr(P===!0?0:P):fr,I=t.jitter,q=!U(I),B=et(I),W=B?I[0]:I||0,E=B?I[1]:I||0;let N=m?0:tt(o)?o:0;return(A,L,D,H,F)=>{const[V]=ls(A),Y=U(g)?D.length:g,te=U(p)?!1:Fe(p)?p(V,L,Y):Ts(V,p),se=tt(te)||Je(te)&&tt(+te)?+te:L,me=se>=0&&se<Y?se:L;if(y&&(N=(Y-1)/2),_&&(N=Y-1),!s.length){if(d){let K=!0,ae=!1,Ce=1/0,Re=1/0,Le=1/0,Be=-1/0,ke=-1/0,be=-1/0;const Oe=[],Ie=[],Se=[];for(let le=0;le<Y;le++){const _e=D[le];let ye=0,Me=0,z=0,ie=!1;if(_e&&Fe(_e.getBoundingClientRect)){const fe=_e.getBoundingClientRect();ye=fe.left+fe.width/2,Me=fe.top+fe.height/2,ie=!0}else{const fe=_e;fe&&tt(fe.x)&&tt(fe.y)&&(ye=fe.x,Me=fe.y,tt(fe.z)&&(z=fe.z,ae=!0),ie=!0)}if(!ie){K=!1;break}Oe.push(ye),Ie.push(Me),Se.push(z),ye<Ce&&(Ce=ye),Me<Re&&(Re=Me),z<Le&&(Le=z),ye>Be&&(Be=ye),Me>ke&&(ke=Me),z>be&&(be=z)}if(K){let le=Oe[0],_e=Ie[0],ye=Se[0];S?(le=Ce+o[0]*(Be-Ce),_e=Re+o[1]*(ke-Re),ye=ae?Le+(o.length>=3?o[2]:.5)*(be-Le):0):y?(le=(Ce+Be)/2,_e=(Re+ke)/2,ye=(Le+be)/2):_?(le=Oe[Y-1],_e=Ie[Y-1],ye=Se[Y-1]):tt(o)&&(le=Oe[o],_e=Ie[o],ye=Se[o]);for(let z=0;z<Y;z++){const ie=le-Oe[z],fe=_e-Ie[z],ce=ye-Se[z];let Ne=Et(ie*ie+fe*fe+(ae?ce*ce:0));l===\"x\"&&(Ne=-ie),l===\"y\"&&(Ne=-fe),l===\"z\"&&(Ne=-ce),s.push(Ne)}let Me=1/0;for(let z=0;z<Y;z++){const ie=At(s[z]);ie>0&&ie<Me&&(Me=ie)}if(Me>0&&Me<1/0)for(let z=0;z<Y;z++)s[z]=s[z]/Me}else for(let le=0;le<Y;le++)s.push(At(N-le))}else for(let K=0;K<Y;K++)if(!a)s.push(At(N-K));else{const ae=a.length,Ce=a[0]*a[1];let Re,Le,Be;S?(Re=o[0]*(a[0]-1),Le=o[1]*(a[1]-1),Be=ae===3?(o.length>=3?o[2]:.5)*(a[2]-1):0):y?(Re=(a[0]-1)/2,Le=(a[1]-1)/2,Be=ae===3?(a[2]-1)/2:0):(Re=N%a[0],Le=$s(N/a[0])%a[1],Be=ae===3?$s(N/Ce):0);const ke=K%a[0],be=$s(K/a[0])%a[1],Oe=ae===3?$s(K/Ce):0,Ie=Re-ke,Se=Le-be,le=Be-Oe;let _e=Et(Ie*Ie+Se*Se+(ae===3?le*le:0));l===\"x\"&&(_e=-Ie),l===\"y\"&&(_e=-Se),l===\"z\"&&(_e=-le),s.push(_e)}r=s[0];for(let K=1;K<Y;K++)s[K]>r&&(r=s[K]);if(f||c)for(let K=0;K<Y;K++){let ae=s[K];f&&(ae=f(ae/r)*r),c&&(ae=l?-ae:At(r-ae)),s[K]=ae}if(q){n=new Array(Y);for(let K=0;K<Y;K++)n[K]=O(-1,1,4)}w&&(s=fn(s,O))}const ge=v?(k-b)/r:b;U(i)&&(i=F?lr(F,U(t.start)?F.iterationDuration:R):R);let oe=i+(ge*G(s[me],2)||0);if(q){const K=r?s[me]/r:0,ae=W+(E-W)*K;oe=oe+n[me]*ae}return t.modifier&&(oe=t.modifier(oe)),T&&(oe=`${oe}${T[2]}`),oe}},td=Ps({$:()=>ls,addChild:()=>qt,clamp:()=>za,cleanInlineStyles:()=>Wo,createSeededRandom:()=>pr,damp:()=>Ga,degToRad:()=>Ha,forEachChildren:()=>Pe,get:()=>us,keepTime:()=>Qr,lerp:()=>Wa,mapRange:()=>Ba,padEnd:()=>$a,padStart:()=>Da,radToDeg:()=>Fa,random:()=>fr,randomPick:()=>Xa,remove:()=>ha,removeChild:()=>$t,round:()=>Ua,roundPad:()=>Na,set:()=>es,shuffle:()=>fn,snap:()=>Va,stagger:()=>gr,sync:()=>cn,wrap:()=>qa}),ja=e=>{const t=wt(e)[0];return!t||!Dr(t)?console.warn(`${e} is not a valid SVGGeometryElement`):t},pn=(e,t,s,r,i)=>{const n=s+r,o=i?Math.max(0,Math.min(n,t)):(n%t+t)%t;return e.getPointAtLength(o)},gn=(e,t,s=0)=>r=>{const i=+e.getTotalLength(),n=r[zi],o=e.getCTM(),c=s===0;return{from:0,to:i,modifier:h=>{const u=h+s*i;if(t===\"a\"){const f=pn(e,i,u,-1,c),a=pn(e,i,u,1,c);return qr(a.y-f.y,a.x-f.x)*180/Wt}else{const f=pn(e,i,u,0,c);return t===\"x\"?n||!o?f.x:f.x*o.a+f.y*o.c+o.e:n||!o?f.y:f.x*o.b+f.y*o.d+o.f}}}},Ya=(e,t=0)=>{const s=ja(e);if(s)return{translateX:gn(s,\"x\",t),translateY:gn(s,\"y\",t),rotate:gn(s,\"a\",t)}},sd=e=>{let t=1;if(e&&e.getCTM){const s=e.getCTM();s&&(t=(Et(s.a*s.a+s.b*s.b)+Et(s.c*s.c+s.d*s.d))/2)}return t},rd=(e,t,s)=>{const r=ft,i=getComputedStyle(e),n=i.strokeLinecap,o=i.vectorEffect===\"non-scaling-stroke\"?e:null;let c=n;const h=new Proxy(e,{get(u,f){const a=u[f];return f===Ao?u:f===\"setAttribute\"?(...d)=>{if(d[0]===\"draw\"){const l=d[1].split(\" \"),g=+l[0],m=+l[1],y=sd(o),_=g*-r*y,w=m*r*y+_,S=r*y+(g===0&&m===1||g===1&&m===0?0:10*y)-w;if(n!==\"butt\"){const v=g===m?\"butt\":n;c!==v&&(u.style.strokeLinecap=`${v}`,c=v)}u.setAttribute(\"stroke-dashoffset\",`${_}`),u.setAttribute(\"stroke-dasharray\",`${w} ${S}`)}return Reflect.apply(a,u,d)}:Fe(a)?(...d)=>Reflect.apply(a,u,d):a}});return e.getAttribute(\"pathLength\")!==`${r}`&&(e.setAttribute(\"pathLength\",`${r}`),h.setAttribute(\"draw\",`${t} ${s}`)),h},Za=(e,t=0,s=0)=>wt(e).map(r=>rd(r,t,s)),Ja=(e,t=.33)=>(s,r,i,n)=>{if(!(s.tagName||\"\").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can't morph a <${s.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const o=ja(e);if(!o)throw new Error(\"Can't morph to an invalid target. 'path2' must resolve to an existing <path>, <polygon> or <polyline> SVG element.\");if(!(o.tagName||\"\").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can't morph a <${o.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const c=s.tagName===\"path\",h=c?\" \":\",\",u=n?n._value:null;u&&s.setAttribute(c?\"d\":\"points\",u);let f=\"\",a=\"\";if(!t)f=s.getAttribute(c?\"d\":\"points\"),a=o.getAttribute(c?\"d\":\"points\");else{const d=s.getTotalLength(),l=o.getTotalLength(),g=Math.max(Math.ceil(d*t),Math.ceil(l*t));for(let m=0;m<g;m++){const y=m/(g-1),_=s.getPointAtLength(d*y),w=o.getPointAtLength(l*y),S=c?m===0?\"M\":\"L\":\"\";f+=S+G(_.x,3)+h+_.y+\" \",a+=S+G(w.x,3)+h+w.y+\" \"}}return[f,a]},id=Ps({createDrawable:()=>Za,createMotionPath:()=>Ya,morphTo:()=>Ja}),li=typeof Intl<\"u\"&&Intl.Segmenter,nd=/\\{value\\}/g,od=/\\{i\\}/g,mn=/(\\s+)/,vn=/^\\s+$/,yn=\"line\",mr=\"word\",vr=\"char\",yr=\"data-line\",bn=null,Sn=null,ci=null,Ka=e=>e.isWordLike||e.segment===\" \"||tt(+e.segment),_n=e=>e.setAttribute(\"aria-hidden\",\"true\"),ui=(e,t)=>[...e.querySelectorAll(`[data-${t}]:not([data-${t}] [data-${t}])`)],ad={line:\"#00D672\",word:\"#FF4B4B\",char:\"#5A87FF\"},Qa=e=>{if(!e.childElementCount&&!e.textContent.trim()){const t=e.parentElement;e.remove(),t&&Qa(t)}},el=(e,t,s)=>{const r=e.getAttribute(yr);if(r!==null&&+r!==t||e.tagName===\"BR\"){s.add(e);const n=e.previousSibling,o=e.nextSibling;n&&n.nodeType===3&&vn.test(n.textContent)&&s.add(n),o&&o.nodeType===3&&vn.test(o.textContent)&&s.add(o)}let i=e.childElementCount;for(;i--;)el(e.children[i],t,s);return s},wn=(e,t={})=>{let s=\"\";t||(t={});const r=Je(t.class)?` class=\"${t.class}\"`:\"\",i=j(t.clone,!1),n=j(t.wrap,!1),o=n?n===!0?\"clip\":n:i?\"clip\":!1;if(n&&(s+=`<span${o?` style=\"overflow:${o};\"`:\"\"}>`),s+=`<span${r}${i?' style=\"position:relative;\"':\"\"} data-${e}=\"{i}\">`,i){const c=i===\"left\"?\"-100%\":i===\"right\"?\"100%\":\"0\",h=i===\"top\"?\"-100%\":i===\"bottom\"?\"100%\":\"0\";s+=\"<span>{value}</span>\",s+=`<span inert style=\"position:absolute;top:${h};left:${c};white-space:nowrap;\">{value}</span>`}else s+=\"{value}\";return s+=\"</span>\",n&&(s+=\"</span>\"),s},kn=(e,t,s,r,i,n,o,c,h)=>{const u=i===yn,f=i===vr,a=`_${i}_`,d=Fe(e)?e(s):e,l=u?\"block\":\"inline-block\";ci.innerHTML=d.replace(nd,`<i class=\"${a}\"></i>`).replace(od,`${f?h:u?o:c}`);const g=ci.content,m=g.firstElementChild,y=g.querySelector(`[data-${i}]`)||m,_=g.querySelectorAll(`i.${a}`),w=_.length;if(w){m.style.display=l,y.style.display=l,y.setAttribute(yr,`${o}`),u||(y.setAttribute(\"data-word\",`${c}`),f&&y.setAttribute(\"data-char\",`${h}`));let S=w;for(;S--;){const v=_[S],p=v.parentElement;p.style.display=l,u?p.innerHTML=s.innerHTML:p.replaceChild(s.cloneNode(!0),v)}t.push(y),r.appendChild(g)}else console.warn('The expression \"{value}\" is missing from the provided template.');return n&&(m.style.outline=`1px dotted ${ad[i]}`),m},hi=class{constructor(e,t={}){bn||(bn=li?new li([],{granularity:mr}):{segment:l=>{const g=[],m=l.split(mn);for(let y=0,_=m.length;y<_;y++){const w=m[y];g.push({segment:w,isWordLike:!vn.test(w)})}return g}}),Sn||(Sn=li?new li([],{granularity:\"grapheme\"}):{segment:l=>[...l].map(g=>({segment:g}))}),!ci&&Ut&&(ci=ee.createElement(\"template\")),Ge.current&&Ge.current.register(this);const{words:s,chars:r,lines:i,accessible:n,includeSpaces:o,debug:c}=t,h=(e=et(e)?e[0]:e)&&e.nodeType?e:(tn(e)||[])[0],u=i===!0?{}:i,f=s===!0||U(s)?{}:s,a=r===!0?{}:r;this.debug=j(c,!1),this.includeSpaces=j(o,!1),this.accessible=j(n,!0),this.linesOnly=u&&!f&&!a,this.lineTemplate=Ze(u)?wn(yn,u):u,this.wordTemplate=Ze(f)||this.linesOnly?wn(mr,f):f,this.charTemplate=Ze(a)?wn(vr,a):a,this.$target=h,this.html=h&&h.innerHTML,this.lines=[],this.words=[],this.chars=[],this.effects=[],this.effectsCleanups=[],this.cache=null,this.ready=!1,this.width=0,this.resizeTimeout=null;const d=()=>this.html&&(u||f||a)&&this.split();this.resizeObserver=new ResizeObserver(()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{const l=h.offsetWidth;l!==this.width&&(this.width=l,d())},150)}),this.lineTemplate&&!this.ready?ee.fonts.ready.then(d):d(),h?this.resizeObserver.observe(h):console.warn(\"No Text Splitter target found.\")}addEffect(e){if(!Fe(e))return console.warn(\"Effect must return a function.\"),this;const t=Qr(e);return this.effects.push(t),this.ready&&(this.effectsCleanups[this.effects.length-1]=t(this)),this}revert(){return clearTimeout(this.resizeTimeout),this.lines.length=this.words.length=this.chars.length=0,this.resizeObserver.disconnect(),this.effectsCleanups.forEach(e=>Fe(e)?e(this):e.revert&&e.revert()),this.$target.innerHTML=this.html,this}splitNode(e){const t=this.wordTemplate,s=this.charTemplate,r=this.includeSpaces,i=this.debug,n=e.nodeType;if(n===3){const o=e.nodeValue;if(o.trim()){const c=[],h=this.words,u=this.chars,f=bn.segment(o),a=ee.createDocumentFragment();let d=null;for(const l of f){const g=l.segment,m=Ka(l);if(!d||m&&d&&Ka(d))c.push(g);else{const y=c.length-1,_=c[y];!mn.test(_)&&!mn.test(g)?c[y]+=g:c.push(g)}d=l}for(let l=0,g=c.length;l<g;l++){const m=c[l];if(m.trim()){const y=c[l+1],_=r&&y&&!y.trim(),w=m,S=s?Sn.segment(w):null,v=s?ee.createDocumentFragment():ee.createTextNode(_?m+\" \":m);if(s){const p=[...S];for(let b=0,k=p.length;b<k;b++){const T=p[b],R=b===k-1&&_?T.segment+\" \":T.segment,P=ee.createTextNode(R);kn(s,u,P,v,vr,i,-1,h.length,u.length)}}t?kn(t,h,v,a,mr,i,-1,h.length,u.length):s?a.appendChild(v):a.appendChild(ee.createTextNode(m)),_&&l++}else{if(l&&r)continue;a.appendChild(ee.createTextNode(m))}}e.parentNode.replaceChild(a,e)}}else if(n===1){const o=[...e.childNodes];for(let c=0,h=o.length;c<h;c++)this.splitNode(o[c])}}split(e=!1){const t=this.$target,s=!!this.cache&&!e,r=this.lineTemplate,i=this.wordTemplate,n=this.charTemplate,o=ee.fonts.status!==\"loading\",c=r&&o;this.ready=!r||o,(c||e)&&this.effectsCleanups.forEach(a=>Fe(a)&&a(this)),s||(e&&(t.innerHTML=this.html,this.words.length=this.chars.length=0),this.splitNode(t),this.cache=t.innerHTML),c&&(s&&(t.innerHTML=this.cache),this.lines.length=0,i&&(this.words=ui(t,mr))),n&&(c||i)&&(this.chars=ui(t,vr));const h=this.words.length?this.words:this.chars;let u,f=0;for(let a=0,d=h.length;a<d;a++){const l=h[a],{top:g,height:m}=l.getBoundingClientRect();!U(u)&&g-u>m*.5&&f++,l.setAttribute(yr,`${f}`);const y=l.querySelectorAll(`[${yr}]`);let _=y.length;for(;_--;)y[_].setAttribute(yr,`${f}`);u=g}if(c){const a=ee.createDocumentFragment(),d=new Set,l=[];for(let g=0;g<f+1;g++){const m=t.cloneNode(!0);el(m,g,new Set).forEach(y=>{const _=y.parentNode;_&&(y.nodeType===1&&d.add(_),_.removeChild(y))}),l.push(m)}d.forEach(Qa);for(let g=0,m=l.length;g<m;g++)kn(r,this.lines,l[g],a,yn,this.debug,g);t.innerHTML=\"\",t.appendChild(a),i&&(this.words=ui(t,mr)),n&&(this.chars=ui(t,vr))}if(this.linesOnly){const a=this.words;let d=a.length;for(;d--;){const l=a[d];l.replaceWith(l.textContent)}a.length=0}if(this.accessible&&(c||!s)){const a=ee.createElement(\"span\");a.style.cssText=\"position:absolute;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;\",a.innerHTML=this.html,t.insertBefore(a,t.firstChild),this.lines.forEach(_n),this.words.forEach(_n),this.chars.forEach(_n)}return this.width=t.offsetWidth,(c||e)&&this.effects.forEach((a,d)=>this.effectsCleanups[d]=a(this)),this}refresh(){this.split(!0)}},br=(e,t)=>new hi(e,t),tl=(e,t)=>(console.warn(\"text.split() is deprecated, import splitText() directly, or text.splitText()\"),new hi(e,t)),sl=e=>{let t=\"\";for(let s=0,r=e.length;s<r;s++)if(s+2<r&&e[s+1]===\"-\"&&e.charCodeAt(s)<e.charCodeAt(s+2)){const i=e.charCodeAt(s),n=e.charCodeAt(s+2);for(let o=i;o<=n;o++)t+=String.fromCharCode(o);s+=2}else t+=e[s];return t},rl={lowercase:\"a-z\",uppercase:\"A-Z\",numbers:\"0-9\",symbols:\"!%#_|*+=\",braille:\"⠀-⣿\",blocks:\"▀-▟\",shades:\"░-▓\"},xn=new WeakMap,il=(e={})=>{e||(e={});const t=e.chars,s=Kt(e.ease||\"linear\"),r=e.text,i=e.from,n=e.reversed||!1,o=e.perturbation||0,c=e.cursor,h=c===!0?\"_\":typeof c==\"number\"?String.fromCharCode(c):typeof c==\"string\"?c:\"\",u=h.length,f=e.seed||0,a=e.override!==void 0?e.override:!0,d=e.revealRate||60,l=1e3*X.timeScale/d,g=e.settleDuration||300*X.timeScale,m=e.settleRate||30,y=e.duration,_=e.revealDelay,w=e.delay,S=e.onChange||ne;return(v,p,b,k)=>{const T=typeof t==\"function\"?t(v,p,b):t||\"a-zA-Z0-9!%#_\",R=sl(rl[T]||T),P=R.length-1,O=typeof y==\"function\"?y(v,p,b):y,I=typeof _==\"function\"?_(v,p,b):_||0,q=typeof w==\"function\"?w(v,p,b):w||0,B=f?pr(f):pr();xn.has(v)||xn.set(v,v.textContent);const W=k?k._value:v.textContent,E=r!==void 0?typeof r==\"function\"?r(v,p,b):r:k?k._value:xn.get(v),N=E===\" \"||E===\" \"?\" \":E,A=W===\" \"?0:W.length,L=N.length,D=a===!0?R:typeof a==\"string\"&&a.length>0?sl(rl[a]||a):null,H=D?D.length-1:0,F=a===\" \"?\" \":null,V=a===\"\"?L:Math.max(A,L),Y=O>0?O:(V-1)*l+g,te=G((Y+I)/X.timeScale,0)*X.timeScale,se=I>0?G(I/te,12):0,me=i===void 0||i===\"auto\"?L<A?\"right\":\"left\":i,ge=new Int32Array(V);if(me===\"random\"){for(let z=0;z<V;z++)ge[z]=z;for(let z=V-1;z>0;z--){const ie=B(0,z),fe=ge[z];ge[z]=ge[ie],ge[ie]=fe}}else{const z=me===\"right\"?(a===\"\"||!A?V:A)-1:me===\"center\"?((a===\"\"||!A?V:A)-1)/2:typeof me==\"number\"?me:0,ie=Math.abs,fe=new Array(V);for(let ce=0;ce<V;ce++)fe[ce]=ce;fe.sort((ce,Ne)=>ie(ce-z)-ie(Ne-z));for(let ce=0;ce<V;ce++)ge[fe[ce]]=ce}if(n){const z=V-1;for(let ie=0;ie<V;ie++)ge[ie]=z-ge[ie]}const oe=G(g/Y,12),K=G((1-oe)/V,12),ae=u*K,Ce=G(1e3*X.timeScale/(m*te),12),Re=new Float32Array(V),Le=new Float32Array(V),Be=o>0?o*oe:0;for(let z=0;z<V;z++){const ie=Be>0?(B(0,2e3)-1e3)/1e3*Be:0,fe=Be>0?(B(0,2e3)-1e3)/1e3*Be:0;Re[z]=ge[z]*K+ie,Le[z]=Math.ceil((Re[z]+oe+fe)/Ce)*Ce}if(L<V&&me!==\"left\"&&me!==\"right\"&&me!==\"random\"){let z=0;for(let ce=L;ce<V;ce++)Le[ce]>z&&(z=Le[ce]);const ie=new Array(L);for(let ce=0;ce<L;ce++)ie[ce]=ce;ie.sort((ce,Ne)=>ge[ce]-ge[Ne]);const fe=(1-z)/L;for(let ce=0;ce<L;ce++){const Ne=z+ce*fe;Ne>Le[ie[ce]]&&(Le[ie[ce]]=Ne)}}const ke=new Array(V);for(let z=0;z<V;z++)ke[z]=R[B(0,P)];const be=D?D===R?ke:new Array(V):null;if(be&&be!==ke)for(let z=0;z<V;z++)be[z]=F||D[B(0,D.length-1)];let Oe=W;if(!k){if(a===\"\")Oe=\"\";else if(D){Oe=\"\";for(let z=0;z<A;z++)Oe+=W[z]===\" \"?\" \":be[z]}}let Ie=-1,Se=-1,le=\"\";const _e=a!==\"\",ye=!!D,Me=u>0;return{from:0,to:1,duration:te,delay:q,ease:\"linear\",modifier:z=>{if(z===Ie)return le;if(Ie=z,q>0&&z<=0)return le=W,W;if(z<=0)return le=Oe,Oe;if(z>=1)return le=N,N;le=\"\";const ie=z/Ce|0,fe=ie!==Se;fe&&(Se=ie);const ce=se>0?(z-se)/(1-se):z,Ne=ce>0?s(ce):0;for(let Ve=0;Ve<V;Ve++){const Xe=Re[Ve];if(Ne>=Le[Ve]){Ve<L&&(le+=N[Ve]);continue}if(Ne<=0||Ne<Xe){_e&&Ve<A&&(ye?W[Ve]===\" \"?le+=\" \":(fe&&(be[Ve]=F||D[B(0,H)]),le+=be[Ve]):le+=W[Ve]);continue}Ve<L&&N[Ve]===\" \"||Ve<A&&W[Ve]===\" \"?le+=\" \":Me&&Ne-Xe<ae?le+=h[u-1-((Ne-Xe)/K|0)]:(fe&&(ke[Ve]=R[B(0,P)]),le+=ke[Ve])}return fe&&S(le,Ne),le}}}},ld=Ps({TextSplitter:()=>hi,scrambleText:()=>il,split:()=>tl,splitText:()=>br}),cd=Ps({$:()=>ls,Animatable:()=>on,AutoLayout:()=>Oa,Draggable:()=>da,JSAnimation:()=>Qt,Scope:()=>fa,ScrollObserver:()=>ma,Spring:()=>Zr,TextSplitter:()=>hi,Timeline:()=>aa,Timer:()=>_t,WAAPIAnimation:()=>Ta,addChild:()=>qt,animate:()=>ar,clamp:()=>za,cleanInlineStyles:()=>Wo,createAnimatable:()=>kh,createDraggable:()=>Mh,createDrawable:()=>Za,createLayout:()=>Kh,createMotionPath:()=>Ya,createScope:()=>Nh,createSeededRandom:()=>pr,createSpring:()=>ca,createTimeline:()=>la,createTimer:()=>vh,cubicBezier:()=>ya,damp:()=>Ga,degToRad:()=>Ha,eases:()=>Jt,easings:()=>Vh,engine:()=>rt,forEachChildren:()=>Pe,get:()=>us,globals:()=>X,irregular:()=>Sa,keepTime:()=>Qr,lerp:()=>Wa,linear:()=>un,mapRange:()=>Ba,morphTo:()=>Ja,onScroll:()=>Hh,padEnd:()=>$a,padStart:()=>Da,radToDeg:()=>Fa,random:()=>fr,randomPick:()=>Xa,remove:()=>ha,removeChild:()=>$t,round:()=>Ua,roundPad:()=>Na,scrambleText:()=>il,scrollContainers:()=>ti,set:()=>es,shuffle:()=>fn,snap:()=>Va,split:()=>tl,splitText:()=>br,spring:()=>Jr,stagger:()=>gr,steps:()=>ba,svg:()=>id,sync:()=>cn,text:()=>ld,utils:()=>td,waapi:()=>Ca,wrap:()=>qa}),ud=class{registerAnimation(e,t,s={}){this.animations[e]={handler:t,options:s}}isInitiallyHidden(e){return this.animations[e]?.options.initiallyHidden??!1}runAnimation(e,t,s,r,i){const n=this.animations[e];n?n.handler(t,s,r,i):(console.warn(`No animation registered with name: ${e}`),r())}addLinkAnimation(e,t){this.linkAnimations.set(e,t)}removeLinkAnimation(e){this.linkAnimations.delete(e)}runLinkAnimation(e){const t=this.linkAnimations.get(e);t&&t()}constructor(){this.animations={},this.linkAnimations=new Map,this.registerAnimation(\"typewriter\",function(e,t,s,r){const{chars:i}=br(e,{words:!0,chars:!0}),n=t.fadeDuration||100,o=t.interval||100;ar(i,{opacity:[0,1],easing:\"linear\",duration:n,delay:gr(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation(\"toast\",function(e,t,s,r){const{words:i}=br(e,{words:!0,chars:!1}),n=t.fadeDuration||100,o=t.interval||200;ar(i,{opacity:[0,1],y:[{to:[\"100%\",\"0%\"]}],easing:\"linear\",duration:n,delay:gr(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation(\"fadeIn\",function(e,t,s,r){const i=t.duration||500;ar(e,{opacity:[0,1],easing:t.easing||\"easeOutQuad\",duration:i,delay:t.start||0,loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation(\"continue\",function(e,t,s){e.classList.add(\"squiffy-continue\");const r=t.style||\"pulse\";let i=null,n=null;r===\"wave\"?(e.classList.add(\"squiffy-continue-wave\"),n=br(e,{words:!0,chars:!0}).chars,i=ar(n,{opacity:[1,.3,1],easing:\"easeInOutSine\",duration:1200,delay:gr(80),loop:!0})):e.classList.add(`squiffy-continue-${r}`);const o=()=>{if(e.classList.remove(\"squiffy-continue\",\"squiffy-continue-wave\",`squiffy-continue-${r}`),e.removeEventListener(\"click\",o),i&&(i.pause(),n))for(const c of n)c.style.opacity=\"1\";s()};e.addEventListener(\"click\",o)})}},hd={animejs:cd},nl=\"input:not([disabled]), textarea:not([disabled]), select:not([disabled])\",dd=\"a.squiffy-link[data-section], a.squiffy-link[data-passage]\";function Tn(e){if(!e)return!0;const t=e.querySelectorAll(nl);for(const s of t)if(!s.checkValidity())return!1;return!0}function Cn(e){if(!e)return;const t=Tn(e),s=e.querySelectorAll(dd);for(const r of s)t?(r.classList.remove(\"validation-disabled\"),r.removeAttribute(\"aria-disabled\")):(r.classList.add(\"validation-disabled\"),r.setAttribute(\"aria-disabled\",\"true\"))}function Sr(e){if(!e)return;const t=e.querySelectorAll(nl);for(const s of t)s.addEventListener(\"input\",()=>Cn(e)),s.addEventListener(\"change\",()=>Cn(e)),s.addEventListener(\"invalid\",r=>{r.preventDefault(),s.classList.add(\"squiffy-invalid\")}),s.addEventListener(\"input\",()=>{s.checkValidity()&&s.classList.remove(\"squiffy-invalid\")});Cn(e)}var ol=[\"src\",\"poster\"],fd=\"data-squiffy-asset-\",pd=[...ol,\"srcset\",\"style\"].map(e=>`[${e}]`).join(\",\"),al=e=>/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith(\"//\")||e.startsWith(\"#\"),En=(e,t)=>{const s=e.trim();if(!s||al(s))return e;let r=s;try{r=decodeURI(s)}catch{}return t(r)},gd=(e,t)=>e.split(\",\").map(s=>{const r=s.match(/^(\\s*)(\\S+)(.*)$/s);return r?r[1]+En(r[2],t)+r[3]:s}).join(\",\"),md=(e,t)=>e.replace(/url\\(\\s*(['\"]?)(.*?)\\1\\s*\\)/gi,(s,r,i)=>{const n=En(i,t);return n===i?s:`url(\"${n.replace(/[\"\\\\\\n]/g,o=>\"\\\\\"+(o===`\n`?\"a \":o))}\")`}),vd=(e,t,s)=>{const r=fd+t,i=e.getAttribute(r)??e.getAttribute(t);if(i===null)return;let n;t===\"srcset\"?n=gd(i,s):t===\"style\"?n=md(i,s):n=En(i,s),n===i?e.removeAttribute(r):e.setAttribute(r,i),e.setAttribute(t,n)},yd=e=>t=>{if(!e||!/\\b(src|srcset|poster|style)\\s*=/i.test(t))return t;const s=document.createElement(\"template\");s.innerHTML=t;for(const r of s.content.querySelectorAll(pd))for(const i of[...ol,\"srcset\",\"style\"])r.hasAttribute(i)&&vd(r,i,e);return s.innerHTML},lf=1,ll=50,bd=class{constructor(e){this.options=e,this.music=null,this.effects=new Set,this.preloaded=new Map,this.muted=!1,this.waitingForGesture=!1,this.disposed=!1,this.onGesture=()=>{this.removeGestureListeners();const t=this.music;t&&t.audio.paused&&(t.audio.volume=1,this.playTrack(t,0))},this.muted=this.readMuted()}preload(e){if(!(typeof Audio>\"u\"))for(const t of e){if(this.preloaded.has(t))continue;const s=new Audio;s.preload=\"auto\",s.src=this.options.resolveUrl(t),this.preloaded.set(t,s)}}sync(e=1){if(this.disposed)return;const t=this.options.getMusic()||null;t!==(this.music?.file??null)&&(this.stopMusic(e),t&&this.startMusic(t,e))}play(e,t=1){if(this.disposed||typeof Audio>\"u\")return;const s=this.newAudio(e);s.volume=cl(t),this.effects.add(s);const r=()=>this.effects.delete(s);s.addEventListener(\"ended\",r),s.addEventListener(\"error\",r),this.options.onPlay?.(),s.play()?.catch(r)}stopSounds(){for(const e of this.effects)e.pause();this.effects.clear()}isMuted(){return this.muted}setMuted(e){this.muted=e,this.music&&(this.music.audio.muted=e);for(const t of this.effects)t.muted=e;this.writeMuted()}dispose(){this.disposed=!0,this.stopMusic(0),this.stopSounds(),this.removeGestureListeners()}newAudio(e){const t=new Audio(this.options.resolveUrl(e));return t.muted=this.muted,t}startMusic(e,t){if(typeof Audio>\"u\")return;const s=this.newAudio(e);s.loop=!0;const r={file:e,audio:s};this.music=r,this.options.onPlay?.(),s.volume=t>0?0:1,this.playTrack(r,t)}playTrack(e,t){const s=e.audio.play();t>0&&this.fade(e,1,t),s?.catch(r=>{e===this.music&&r?.name==\"NotAllowedError\"&&this.waitForGesture()})}stopMusic(e){const t=this.music;t&&(this.music=null,e>0&&!t.audio.paused?this.fade(t,0,e,()=>t.audio.pause()):(clearInterval(t.fadeTimer),t.audio.pause()))}fade(e,t,s,r){clearInterval(e.fadeTimer);const i=e.audio.volume,n=Math.max(1,Math.round(s*1e3/ll));let o=0;e.fadeTimer=setInterval(()=>{o++,e.audio.volume=cl(i+(t-i)*o/n),o>=n&&(clearInterval(e.fadeTimer),e.fadeTimer=void 0,r?.())},ll)}waitForGesture(){this.waitingForGesture||typeof document>\"u\"||(this.waitingForGesture=!0,document.addEventListener(\"pointerdown\",this.onGesture,!0),document.addEventListener(\"keydown\",this.onGesture,!0))}removeGestureListeners(){this.waitingForGesture&&(this.waitingForGesture=!1,document.removeEventListener(\"pointerdown\",this.onGesture,!0),document.removeEventListener(\"keydown\",this.onGesture,!0))}readMuted(){if(!this.options.mutedKey)return!1;try{return localStorage.getItem(this.options.mutedKey)==\"true\"}catch{return!1}}writeMuted(){if(this.options.mutedKey)try{this.muted?localStorage.setItem(this.options.mutedKey,\"true\"):localStorage.removeItem(this.options.mutedKey)}catch{}}},cl=e=>Math.min(1,Math.max(0,Number.isFinite(e)?e:1)),Sd=0;function _d(e){const t=`squiffy-confirm-${++Sd}`,s=document.createElement(\"dialog\");s.className=\"squiffy-confirm\",s.setAttribute(\"role\",\"alertdialog\"),s.setAttribute(\"aria-labelledby\",`${t}-message`),s.innerHTML=`\n <p id=\"${t}-message\"></p>\n <div class=\"squiffy-confirm-buttons\">\n <button type=\"button\" class=\"squiffy-confirm-button\" data-answer=\"no\"></button>\n <button type=\"button\" class=\"squiffy-confirm-button ${e.danger?\"squiffy-confirm-danger\":\"squiffy-confirm-primary\"}\" data-answer=\"yes\"></button>\n </div>`,s.querySelector(\"p\").textContent=e.message;const r=s.querySelector(\"[data-answer=no]\"),i=s.querySelector(\"[data-answer=yes]\");return r.textContent=e.cancel??\"Cancel\",i.textContent=e.confirm,(e.container??document.body).appendChild(s),new Promise(n=>{let o=!1;const c=h=>{o||(o=!0,s.open&&s.close(),s.remove(),n(h))};r.addEventListener(\"click\",()=>c(!1)),i.addEventListener(\"click\",()=>c(!0)),s.addEventListener(\"cancel\",h=>{h.preventDefault(),c(!1)}),s.addEventListener(\"close\",()=>c(!1)),s.addEventListener(\"click\",h=>{if(h.target!==s)return;const u=s.getBoundingClientRect();h.clientX>=u.left&&h.clientX<=u.right&&h.clientY>=u.top&&h.clientY<=u.bottom||c(!1)}),s.showModal(),i.focus()})}var wd=\"squiffy-saves\",An=\"saves\",ul=(e,t)=>t.save.savedAt.localeCompare(e.save.savedAt)||t.id-e.id,Pn=e=>({id:e.id,name:e.name,save:e.save}),di=e=>e?.trim()||null;function Ln(e){return new Promise((t,s)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>s(e.error)})}function hl(e){return new Promise((t,s)=>{e.oncomplete=()=>t(),e.onerror=()=>s(e.error),e.onabort=()=>s(e.error)})}function kd(e){let t;const s=()=>t??(t=new Promise((u,f)=>{const a=indexedDB.open(wd,1);a.onupgradeneeded=()=>{a.result.createObjectStore(An,{keyPath:[\"key\",\"id\"]})},a.onsuccess=()=>u(a.result),a.onerror=()=>{t=void 0,f(a.error)}})),r=()=>IDBKeyRange.bound([e,-1/0],[e,1/0]),i=async u=>(await s()).transaction(An,u).objectStore(An),n=async u=>Ln((await i(\"readonly\")).get([e,u])),o=async u=>{const f=await i(\"readwrite\");f.put(u),await hl(f.transaction)};let c=!1;const h=()=>{c||(c=!0,navigator.storage?.persist?.().catch(()=>{}))};return{async list(){return(await Ln((await i(\"readonly\")).getAll(r()))).map(Pn).sort(ul)},async get(u){const f=await n(u);return f?Pn(f):null},async add(u,f){const a={key:e,id:(await Ln((await i(\"readonly\")).getAllKeys(r()))).reduce((d,l)=>Math.max(d,l[1]),0)+1,name:di(f),save:u};return await o(a),h(),Pn(a)},async overwrite(u,f){const a=await n(u);await o({key:e,id:u,name:a?.name??null,save:f})},async rename(u,f){const a=await n(u);a&&await o({...a,name:di(f)})},async delete(u){const f=await i(\"readwrite\");f.delete([e,u]),await hl(f.transaction)}}}function xd(){const e=new Map;let t=1;const s=r=>structuredClone(r);return{async list(){return[...e.values()].map(s).sort(ul)},async get(r){const i=e.get(r);return i?s(i):null},async add(r,i){const n={id:t++,name:di(i),save:structuredClone(r)};return e.set(n.id,n),s(n)},async overwrite(r,i){e.set(r,{id:r,name:e.get(r)?.name??null,save:structuredClone(i)})},async rename(r,i){const n=e.get(r);n&&(n.name=di(i))},async delete(r){e.delete(r)}}}var Rn={saves:\"Saved games\",saveName:\"Name (optional)\",save:\"Save\",noSaves:\"No saved games yet.\",savedGame:\"Saved game\",savedToday:\"Today, [time]\",savedYesterday:\"Yesterday, [time]\",load:\"Load\",loadConfirm:`Load \"[name]\"? You'll lose anything you've done since you last saved.`,saveOptions:\"Options for [name]\",overwrite:\"Overwrite\",overwriteConfirm:'Overwrite \"[name]\"?',rename:\"Rename\",newName:\"New name\",saveToFile:\"Save to file\",loadFromFile:\"Load from file\",delete:\"Delete\",deleteConfirm:`Delete \"[name]\"? This can't be undone.`,cancel:\"Cancel\",close:\"Close\",wrongStory:\"This saved game is for a different story.\",notASave:\"This file isn't a saved game.\",cantSave:\"The game couldn't be saved. Try Save to file instead.\"},dl=\".squiffy-save\",Td='<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M18 6 6 18M6 6l12 12\"/></svg>',Cd='<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><circle cx=\"5\" cy=\"12\" r=\"1\"/><circle cx=\"12\" cy=\"12\" r=\"1\"/><circle cx=\"19\" cy=\"12\" r=\"1\"/></svg>',Ed='<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3\"/></svg>',Ad='<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12\"/></svg>',Pd=0;function Ld(e,t=Rn,s=new Date){const r=new Date(e);if(isNaN(r.getTime()))return\"\";const i=r.toLocaleTimeString(void 0,{hour:\"numeric\",minute:\"2-digit\"}),n=c=>new Date(c.getFullYear(),c.getMonth(),c.getDate()).getTime(),o=Math.round((n(s)-n(r))/864e5);return o===0?t.savedToday.replace(\"[time]\",i):o===1?t.savedYesterday.replace(\"[time]\",i):`${r.toLocaleDateString(void 0,{day:\"numeric\",month:\"short\",...r.getFullYear()!==s.getFullYear()?{year:\"numeric\"}:{}})}, ${i}`}function Rd(e,t={}){const s={...Rn};for(const A of Object.keys(Rn)){const L=t.strings?.[A];typeof L==\"string\"&&(s[A]=L)}const r=t.slots??(typeof indexedDB<\"u\"?kd(t.key??window.location.pathname):xd()),i=`squiffy-saves-${++Pd}`,n=document.createElement(\"dialog\");n.className=\"squiffy-saves\",n.setAttribute(\"aria-labelledby\",`${i}-heading`),n.innerHTML=`\n <div class=\"squiffy-saves-header\">\n <h2 id=\"${i}-heading\"></h2>\n <button type=\"button\" class=\"squiffy-saves-icon-button\" data-close>${Td}</button>\n </div>\n <p class=\"squiffy-saves-error\" role=\"alert\" hidden></p>\n <form class=\"squiffy-saves-new\">\n <input type=\"text\" autocomplete=\"off\">\n <button type=\"submit\" class=\"squiffy-saves-button squiffy-saves-primary\"></button>\n </form>\n <ul class=\"squiffy-saves-list\"></ul>\n <div class=\"squiffy-saves-footer\">\n <button type=\"button\" class=\"squiffy-saves-link\" data-save-to-file>${Ed}<span></span></button>\n <button type=\"button\" class=\"squiffy-saves-link\" data-load-from-file>${Ad}<span></span></button>\n <input type=\"file\" accept=\"${dl},.json,application/json\" hidden>\n </div>\n <div class=\"squiffy-saves-footer-confirm\"></div>`;const o=A=>n.querySelector(A);o(\"h2\").textContent=s.saves;const c=o(\"[data-close]\");c.title=s.close,c.setAttribute(\"aria-label\",s.close);const h=o(\".squiffy-saves-error\"),u=o(\"form\"),f=o(\"form input\");f.placeholder=s.saveName,f.setAttribute(\"aria-label\",s.saveName),o(\"form button\").textContent=s.save;const a=o(\".squiffy-saves-list\");o(\"[data-save-to-file] span\").textContent=s.saveToFile,o(\"[data-load-from-file] span\").textContent=s.loadFromFile;const d=o(\"input[type=file]\"),l=o(\".squiffy-saves-footer-confirm\");(t.container??document.body).appendChild(n);let g=!1;e.on(\"navigated\",()=>{g=!1});const m=()=>!g&&e.canGoBack();let y=[],_=null;const w=A=>{h.textContent=A,h.hidden=!1},S=()=>{h.hidden=!0},v=A=>A.name||A.save.summary||s.savedGame,p=A=>[Ld(A.save.savedAt,s),A.name&&A.save.summary].filter(Boolean).join(\" · \"),b=A=>a.querySelector(`[data-slot=\"${A}\"]`);function k(){if(a.replaceChildren(),!y.length){const A=document.createElement(\"li\");A.className=\"squiffy-saves-empty\",A.textContent=s.noSaves,a.appendChild(A);return}for(const A of y){const L=v(A),D=document.createElement(\"li\");D.className=\"squiffy-saves-row\",D.dataset.slot=String(A.id),D.innerHTML=`\n <div class=\"squiffy-saves-line\">\n <div class=\"squiffy-saves-info\">\n <div class=\"squiffy-saves-title\" id=\"${i}-title-${A.id}\"></div>\n <div class=\"squiffy-saves-meta\"></div>\n </div>\n <button type=\"button\" class=\"squiffy-saves-button\" data-action=\"load\" aria-describedby=\"${i}-title-${A.id}\"></button>\n <div class=\"squiffy-saves-options\">\n <button type=\"button\" class=\"squiffy-saves-icon-button\" data-action=\"options\" aria-haspopup=\"menu\" aria-expanded=\"false\" aria-controls=\"${i}-menu-${A.id}\">${Cd}</button>\n <div class=\"squiffy-saves-menu\" id=\"${i}-menu-${A.id}\" role=\"menu\" hidden>\n <button type=\"button\" role=\"menuitem\" data-action=\"overwrite\"></button>\n <button type=\"button\" role=\"menuitem\" data-action=\"rename\"></button>\n <button type=\"button\" role=\"menuitem\" data-action=\"download\"></button>\n <button type=\"button\" role=\"menuitem\" data-action=\"delete\" class=\"squiffy-saves-danger\"></button>\n </div>\n </div>\n </div>`;const H=Y=>D.querySelector(Y);H(\".squiffy-saves-title\").textContent=L;const F=p(A);F?H(\".squiffy-saves-meta\").textContent=F:H(\".squiffy-saves-meta\").remove(),H(\"[data-action=load]\").textContent=s.load;const V=H(\"[data-action=options]\");V.title=s.saveOptions.replace(\"[name]\",L),V.setAttribute(\"aria-label\",V.title),H(\"[data-action=overwrite]\").textContent=s.overwrite,H(\"[data-action=rename]\").textContent=s.rename,H(\"[data-action=download]\").textContent=s.saveToFile,H(\"[data-action=delete]\").textContent=s.delete,a.appendChild(D)}}async function T(){try{y=await r.list()}catch{y=[],w(s.cantSave)}k()}function R(A,L,D,H=!1){_?.();const F=document.createElement(\"div\");F.className=\"squiffy-saves-confirm\",F.setAttribute(\"role\",\"group\"),F.innerHTML=`<p id=\"${i}-confirm\"></p>\n <div class=\"squiffy-saves-confirm-buttons\">\n <button type=\"button\" class=\"squiffy-saves-button\" data-answer=\"no\"></button>\n <button type=\"button\" class=\"squiffy-saves-button ${H?\"squiffy-saves-danger-button\":\"squiffy-saves-primary\"}\" data-answer=\"yes\" aria-describedby=\"${i}-confirm\"></button>\n </div>`,F.setAttribute(\"aria-labelledby\",`${i}-confirm`),F.querySelector(\"p\").textContent=L;const V=F.querySelector(\"[data-answer=no]\"),Y=F.querySelector(\"[data-answer=yes]\");return V.textContent=s.cancel,Y.textContent=D,A.appendChild(F),new Promise(te=>{const se=me=>{_=null,F.remove(),te(me)};_=()=>se(!1),V.addEventListener(\"click\",()=>se(!1)),Y.addEventListener(\"click\",()=>se(!0)),Y.focus()})}const P=typeof HTMLElement.prototype.showPopover==\"function\";function O(A,L){if(!P){A.hidden=!1;return}A.hidden=!1,A.popover=\"manual\",A.showPopover();const D=L.getBoundingClientRect(),{width:H,height:F}=A.getBoundingClientRect(),V=D.bottom+4;A.style.top=`${V+F>window.innerHeight-8?Math.max(8,D.top-4-F):V}px`,A.style.left=`${Math.max(8,Math.min(D.right-H,window.innerWidth-8-H))}px`}function I(A){P&&A.matches(\":popover-open\")&&A.hidePopover(),A.hidden=!0}function q(A){const L=document.getElementById(A.getAttribute(\"aria-controls\")),D=A.getAttribute(\"aria-expanded\")==\"true\";if(_?.(),D)return;O(L,A),A.setAttribute(\"aria-expanded\",\"true\");const H=[...L.querySelectorAll(\"[role=menuitem]\")];H[0].focus();const F=te=>{_=null,I(L),A.setAttribute(\"aria-expanded\",\"false\"),L.removeEventListener(\"keydown\",V),n.removeEventListener(\"pointerdown\",Y),te&&A.focus()},V=te=>{const se=H.indexOf(document.activeElement),me={ArrowDown:se+1,ArrowUp:se-1,Home:0,End:H.length-1}[te.key];me!==void 0?(te.preventDefault(),H[(me+H.length)%H.length].focus()):te.key==\"Tab\"&&F(!1)},Y=te=>{const se=te.target;!L.contains(se)&&!A.contains(se)&&F(!1)};L.addEventListener(\"keydown\",V),n.addEventListener(\"pointerdown\",Y),_=()=>F(!0)}function B(A){const L=b(A.id)?.querySelector(\".squiffy-saves-title\");if(!L)return;const D=document.createElement(\"input\");D.type=\"text\",D.className=\"squiffy-saves-rename\",D.autocomplete=\"off\",D.value=A.name??\"\",D.placeholder=v(A),D.setAttribute(\"aria-label\",s.newName),L.replaceWith(D),D.focus(),D.select();let H=!1;const F=async V=>{if(H)return;H=!0,_=null;const Y=D.value.trim()||null;V&&Y!==A.name&&await r.rename(A.id,Y).catch(()=>w(s.cantSave)),await T(),b(A.id)?.querySelector(\"[data-action=load]\")?.focus()};_=()=>{F(!1)},D.addEventListener(\"keydown\",V=>{V.key==\"Enter\"&&(V.preventDefault(),F(!0))}),D.addEventListener(\"blur\",()=>F(!0))}function W(){return((t.fileName??document.title).replace(/[\\\\/:*?\"<>|]+/g,\"\").replace(/\\s+/g,\" \").trim()||\"story\")+dl}function E(A){const L=URL.createObjectURL(new Blob([JSON.stringify(A)],{type:\"application/json\"})),D=document.createElement(\"a\");D.href=L,D.download=W(),n.appendChild(D),D.click(),D.remove(),setTimeout(()=>URL.revokeObjectURL(L),0)}async function N(A){const L=await e.loadSave(A);if(!L.success){w(s[L.error]);return}g=!0,n.close()}return n.addEventListener(\"cancel\",A=>{_&&(A.preventDefault(),_())}),c.addEventListener(\"click\",()=>n.close()),u.addEventListener(\"submit\",async A=>{A.preventDefault(),S(),_?.();try{await r.add(e.getSave(),f.value),g=!0,f.value=\"\"}catch{w(s.cantSave)}await T(),f.focus()}),a.addEventListener(\"click\",async A=>{const L=A.target.closest(\"[data-action]\"),D=L?.closest(\"[data-slot]\");if(!L||!D)return;const H=y.find(Y=>Y.id===Number(D.dataset.slot));if(!H)return;const F=L.dataset.action;if(F==\"options\"){q(L);return}L.getAttribute(\"role\")==\"menuitem\"&&_?.(),S();const V=v(H);if(F==\"load\"){if(m()&&!await R(D,s.loadConfirm.replace(\"[name]\",V),s.load)){L.focus();return}const Y=await r.get(H.id).catch(()=>null);Y&&await N(Y.save)}else if(F==\"overwrite\"){if(!await R(D,s.overwriteConfirm.replace(\"[name]\",V),s.overwrite))return;try{await r.overwrite(H.id,e.getSave()),g=!0}catch{w(s.cantSave)}await T(),b(H.id)?.querySelector(\"[data-action=load]\")?.focus()}else if(F==\"rename\")B(H);else if(F==\"download\")E(H.save);else if(F==\"delete\"){if(!await R(D,s.deleteConfirm.replace(\"[name]\",V),s.delete,!0))return;await r.delete(H.id).catch(()=>w(s.cantSave)),await T(),f.focus()}}),o(\"[data-save-to-file]\").addEventListener(\"click\",()=>{S(),E(e.getSave()),g=!0}),o(\"[data-load-from-file]\").addEventListener(\"click\",()=>{S(),d.click()}),d.addEventListener(\"change\",async()=>{const A=d.files?.[0];if(d.value=\"\",!A)return;let L;try{L=JSON.parse(await A.text())}catch{w(s.notASave);return}m()&&!await R(l,s.loadConfirm.replace(\"[name]\",A.name),s.load)||await N(L)}),{element:n,async open(){S(),_?.(),f.value=\"\",n.open||n.showModal(),f.focus(),await T()},close(){_?.(),n.close()}}}var fl={settings:\"Settings\",resetSettings:\"Reset to defaults\",close:\"Close\"},Id='<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></svg>',Od='<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M18 6 6 18M6 6l12 12\"/></svg>',Md=0;function pl(e,t={}){const s={...fl};for(const a of Object.keys(fl)){const d=t.strings?.[a];typeof d==\"string\"&&(s[a]=d)}const r=`squiffy-settings-${++Md}`,i=document.createElement(\"dialog\");i.className=\"squiffy-settings\",i.setAttribute(\"aria-labelledby\",`${r}-heading`),i.innerHTML=`\n <div class=\"squiffy-settings-header\">\n <h2 id=\"${r}-heading\"></h2>\n <button type=\"button\" class=\"squiffy-settings-close\" data-close>${Od}</button>\n </div>\n <div class=\"squiffy-settings-list\"></div>\n <div class=\"squiffy-settings-footer\">\n <button type=\"button\" class=\"squiffy-settings-reset\" data-reset></button>\n </div>`;const n=a=>i.querySelector(a);n(\"h2\").textContent=s.settings;const o=n(\"[data-close]\");o.title=s.close,o.setAttribute(\"aria-label\",s.close),o.addEventListener(\"click\",()=>i.close());const c=n(\".squiffy-settings-list\"),h=n(\"[data-reset]\");h.textContent=s.resetSettings,h.addEventListener(\"click\",()=>{e.resetSettings(),u()}),i.addEventListener(\"click\",a=>{a.target===i&&i.close()}),(t.container??document.body).appendChild(i);function u(){c.replaceChildren(...e.getSettings().map((a,d)=>f(a,`${r}-${d}`)))}function f(a,d){const l=document.createElement(\"div\");l.className=`squiffy-setting squiffy-setting-${a.type}`;const g=document.createElement(\"div\");g.className=\"squiffy-setting-text\";const m=document.createElement(\"label\");if(m.htmlFor=d,m.textContent=a.label||a.name,g.appendChild(m),a.description){const w=document.createElement(\"p\");w.id=`${d}-description`,w.textContent=a.description,g.appendChild(w)}l.appendChild(g);const y=e.getSetting(a.name);let _;if(a.type==\"toggle\"){const w=document.createElement(\"input\");w.type=\"checkbox\",w.setAttribute(\"role\",\"switch\"),w.checked=y===!0,w.addEventListener(\"change\",()=>e.setSetting(a.name,w.checked)),_=w}else if(a.type==\"list\"){const w=document.createElement(\"select\");for(const S of a.options){const v=document.createElement(\"option\");v.value=S.value,v.textContent=S.label,w.appendChild(v)}w.value=String(y),w.addEventListener(\"change\",()=>e.setSetting(a.name,w.value)),_=w}else{const w=document.createElement(\"input\");w.type=\"range\",w.min=String(a.min),w.max=String(a.max),w.step=a.step?String(a.step):\"any\",w.value=String(y);const S=document.createElement(\"output\");S.htmlFor.add(d),S.textContent=String(y),w.addEventListener(\"input\",()=>{e.setSetting(a.name,Number(w.value)),S.textContent=String(e.getSetting(a.name))});const v=document.createElement(\"div\");return v.className=\"squiffy-setting-slider\",v.append(w,S),_=w,_.id=d,a.description&&_.setAttribute(\"aria-describedby\",`${d}-description`),l.appendChild(v),l}return _.id=d,a.description&&_.setAttribute(\"aria-describedby\",`${d}-description`),l.appendChild(_),l}return{element:i,open(){u(),i.open||i.showModal(),c.querySelector(\"input, select\")?.focus()},close(){i.close()}}}var Nd=class{constructor(e,t){if(this.getDefinitions=e,this.storageKey=t,this.values={},!!t)try{const s=JSON.parse(localStorage.getItem(t)??\"{}\");s&&typeof s==\"object\"&&!Array.isArray(s)&&(this.values=s)}catch{}}definitions(){return this.getDefinitions().filter(e=>e&&typeof e.name==\"string\")}find(e){return this.definitions().find(t=>t.name==e)}any(){return this.definitions().length>0}get(e){const t=this.find(e);if(!t)return null;const s=Object.prototype.hasOwnProperty.call(this.values,e)?this.values[e]:void 0;return s!==void 0&&$d(t,s)?s:Dd(t)}all(){return Object.fromEntries(this.definitions().map(e=>[e.name,this.get(e.name)]))}set(e,t){const s=this.find(e);if(!s)return!1;const r=gl(s,t);return r===null||r===this.get(e)?!1:(this.values[e]=r,this.store(),!0)}reset(){this.values={},this.store()}classes(){const e=[];for(const t of this.definitions()){const s=this.get(t.name);t.type==\"toggle\"?s===!0&&e.push(`setting-${t.name}`):s!==null&&e.push(`setting-${t.name}-${String(s).replace(/[^A-Za-z0-9_-]+/g,\"-\")}`)}return e}store(){if(this.storageKey)try{Object.keys(this.values).length?localStorage.setItem(this.storageKey,JSON.stringify(this.values)):localStorage.removeItem(this.storageKey)}catch{}}};function Dd(e){switch(e.type){case\"toggle\":return e.default??!1;case\"list\":return e.default??e.options[0]?.value??\"\";case\"range\":return e.default??e.min}}function $d(e,t){return gl(e,t)===t}function gl(e,t){switch(e.type){case\"toggle\":return typeof t==\"boolean\"?t:t===\"true\"?!0:t===\"false\"?!1:null;case\"list\":{const s=typeof t==\"string\"||typeof t==\"number\"||typeof t==\"boolean\"?String(t):null;return s!==null&&e.options.some(r=>r.value===s)?s:null}case\"range\":{const s=typeof t==\"number\"?t:typeof t==\"string\"&&t.trim()?Number(t):NaN;if(!Number.isFinite(s))return null;const r=Math.min(e.max,Math.max(e.min,s));if(!e.step)return r;const i=e.min+Math.round((r-e.min)/e.step)*e.step;return Number(Math.min(e.max,i).toFixed(10))}}}var qd=[\"bag\",\"person\",\"map\",\"help\",\"info\",\"list\",\"book\",\"star\",\"heart\"],Bd='<path d=\"M18 6 6 18M6 6l12 12\"/>',Hd={bag:'<path d=\"M4 10a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z\"/><path d=\"M8 10h8\"/><path d=\"M8 18h8\"/><path d=\"M8 22v-6a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v6\"/><path d=\"M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2\"/>',person:'<path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\"/><circle cx=\"12\" cy=\"7\" r=\"4\"/>',map:'<path d=\"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z\"/><path d=\"M15 5.764v15\"/><path d=\"M9 3.236v15\"/>',help:'<circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\"/><path d=\"M12 17h.01\"/>',info:'<circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"M12 16v-4\"/><path d=\"M12 8h.01\"/>',list:'<path d=\"M3 6h.01M3 12h.01M3 18h.01M8 6h13M8 12h13M8 18h13\"/>',book:'<path d=\"M12 7v14\"/><path d=\"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z\"/>',star:'<path d=\"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\"/>',heart:'<path d=\"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z\"/>'},ml=e=>`<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">${e}</svg>`,Fd=0;function Vd(e,t){const s=typeof t.strings?.close==\"string\"?t.strings.close:\"Close\",r=`squiffy-panel-${++Fd}`,i=[],n=document.createElement(\"dialog\");n.className=\"squiffy-panel-dialog\",n.setAttribute(\"aria-labelledby\",`${r}-heading`),n.innerHTML=`\n <div class=\"squiffy-panel-dialog-header\">\n <h2 id=\"${r}-heading\"></h2>\n <button type=\"button\" class=\"squiffy-panel-dialog-close\">${ml(Bd)}</button>\n </div>\n <div class=\"squiffy-panel squiffy-panel-dialog-content\"></div>`;const o=n.querySelector(\"h2\"),c=n.querySelector(\".squiffy-panel-dialog-close\");c.title=s,c.setAttribute(\"aria-label\",s),c.addEventListener(\"click\",()=>n.close());const h=n.querySelector(\".squiffy-panel-dialog-content\");n.addEventListener(\"click\",v=>{v.target===n&&n.close()}),(t.container??document.body).appendChild(n),i.push(()=>n.remove());let u=null;const f=t.panels.filter(v=>v&&typeof v.passage==\"string\"),a=t.side?f.filter(v=>v.position==\"side\"):[],d=new Map;let l=null;if(a.length&&t.side){l=document.createElement(\"aside\"),l.className=\"squiffy-panels-side\";for(const p of a){const b=document.createElement(\"section\");b.className=\"squiffy-panel\",b.dataset.passage=p.passage,b.setAttribute(\"aria-label\",p.label||p.passage),l.appendChild(b),d.set(p,b)}const v=t.side;v.appendChild(l),v.classList.add(\"squiffy-has-side\"),i.push(()=>{l.remove(),v.classList.remove(\"squiffy-has-side\")})}const g=t.buttons.firstChild;for(const v of f){const p=v.label||v.passage,b=document.createElement(\"button\");b.type=\"button\",b.className=\"squiffy-header-button squiffy-panel-button\",v.position==\"side\"&&d.has(v)&&b.classList.add(\"squiffy-panel-side-button\"),b.dataset.passage=v.passage,b.setAttribute(\"aria-haspopup\",\"dialog\");const k=v.icon&&qd.includes(v.icon)?Hd[v.icon]:null;k?(b.innerHTML=ml(k),b.title=p,b.setAttribute(\"aria-label\",p)):(b.classList.add(\"squiffy-panel-text-button\"),b.textContent=p),b.addEventListener(\"click\",()=>m(v)),t.buttons.insertBefore(b,g),i.push(()=>b.remove())}function m(v){u=v,o.textContent=v.label||v.passage,h.innerHTML=e.renderPassage(v.passage),n.open||n.showModal()}function y(){for(const[v,p]of d)p.innerHTML=e.renderPassage(v.passage),p.hidden=!p.textContent?.trim()&&!p.querySelector(\"img, svg, video, canvas, iframe\");l&&(l.hidden=[...d.values()].every(v=>v.hidden)),n.open&&u&&(h.innerHTML=e.renderPassage(u.passage))}let _=!1;const w=()=>{_||(_=!0,queueMicrotask(()=>{_=!1,S||y()}))};for(const v of[\"set\",\"navigated\",\"storyUpdated\"])i.push(e.on(v,w));n.addEventListener(\"close\",()=>{u=null});let S=!1;return y(),{refresh:y,open(v){const p=f.find(b=>b.passage==v);p&&m(p)},dispose(){S=!0,n.open&&n.close();for(const v of i.splice(0))v()}}}var zd=async e=>{let t,s,r,i,n,o=0,c=!1;const h=[],u=new Nu,f=[];let a=!1,d,l=0;const g=100,m=new Iu(()=>r,at);let y=0;async function _(x){if(a||x.closest(\".squiffy-output-section\")!==r||x.classList.contains(\"disabled\")||!Tn(r))return!1;const C=x.getAttribute(\"data-passage\"),M=x.getAttribute(\"data-section\");if(C!==null||M!==null){if(l=0,x instanceof window.HTMLInputElement){const Te=x.getAttribute(\"data-attribute\")||x.id;Te&&De(Te,x.value)}De(\"turns\",(he(\"turns\")||0)+1)}if(C!==null){let Te;return S(C)||(v(x),Te=b(x),De(\"_turncount\",he(\"_turncount\")+1)),await B(x),C&&(n=null,await se(C,Te)),u.emit(\"linkClick\",{linkType:\"passage\"}),!0}if(M!==null)return await B(x),M&&await D(M),u.emit(\"linkClick\",{linkType:\"section\"}),!0;const[$,Z,Q]=kr.handleLink(x);return $?(Q?.disableLink&&v(x),K(),u.emit(\"linkClick\",{linkType:Z}),!0):!1}async function w(x){const C=x.target;C.classList.contains(\"squiffy-link\")&&await _(C)}function S(x){if(!x)return!1;const C=s?.passages;if(C&&x in C)return!!C[x].repeat;const M=t.sections[\"\"]?.passages;return!!(M&&x in M&&M[x].repeat)}function v(x){if(x instanceof window.HTMLInputElement){x.disabled=!0,x.classList.add(\"disabled\");return}x.classList.add(\"disabled\"),x.setAttribute(\"tabindex\",\"-1\")}function p(x){if(x instanceof window.HTMLInputElement){x.disabled=!1,x.classList.remove(\"disabled\");return}x.classList.remove(\"disabled\"),x.removeAttribute(\"tabindex\")}function b(x){let C=0;for(const $ of Ee.querySelectorAll(\"[data-clicked]\"))C=Math.max(C,Number($.getAttribute(\"data-clicked\"))||0);const M=String(C+1);return x.setAttribute(\"data-clicked\",M),M}async function k(x){if(x&&x.section in t.sections){Ce(),await D(x.section),x.passage!==void 0&&he(\"_section\")==x.section&&await se(x.passage);return}if(!Re()){await D(t.start);return}const C=he(\"_passage\");u.emit(\"navigated\",C?{section:he(\"_section\"),passage:C}:{section:he(\"_section\")}),await T(),m.sync()}async function T(){const x=i??r,C=x?.getAttribute(\"data-goto\");C&&C in t.sections&&await q({section:C,after:Number(x.getAttribute(\"data-goto-after\")||0)})}function R(){clearTimeout(d),d=void 0,Ae.goto=null,Ae.deactivate.clear()}function P(x){const C=Ae.deactivate;if(C.size==0)return;const M=String((he(\"_deactivations\")||0)+1);De(\"_deactivations\",Number(M)),x.setAttribute(\"data-deactivates\",M);for(const $ of r.querySelectorAll(\"a.squiffy-link[data-passage]\"))C.has($.getAttribute(\"data-passage\"))&&!$.classList.contains(\"disabled\")&&(v($),$.setAttribute(\"data-deactivated-by\",M));C.clear()}function O(x){const C=x.getAttribute(\"data-deactivates\");if(C)for(const M of r.querySelectorAll(`a.squiffy-link[data-deactivated-by=\"${C}\"]`))p(M),M.removeAttribute(\"data-deactivated-by\")}function I(x){const C=Ae.goto;return Ae.goto=null,C&&(x.setAttribute(\"data-goto\",C.section),C.after&&x.setAttribute(\"data-goto-after\",String(C.after))),C}async function q(x){if(x){if(x.after>0){d=setTimeout(()=>{d=void 0,l=0,D(x.section)},x.after);return}if(++l>g){l=0;const C=i??r;C.removeAttribute(\"data-goto\");const M=`stopped after ${g} in a row without the player clicking anything, going to \"${x.section}\". Is there a loop?`;console.error(\"Squiffy error in {{goto}}:\",M),C.insertAdjacentHTML(\"beforeend\",zt(\"Error in {{goto}}:\",M)),K();return}await D(x.section)}}async function B(x){_i.runLinkAnimation(x),await te();const C=x.getAttribute(\"data-set\");if(C){const M=JSON.parse(C);for(const $ of M)W($)}}function W(x){try{t.expressions?A(x):L(x)}catch(C){const M=C instanceof Error?C.message:String(C);console.error(`Squiffy error in \"${x}\":`,M),h.push(zt(`Error in \"${x}\":`,M))}}function E(x,C,M){const $=C+\"=\",Z=Ct($,M),Q=typeof x==\"string\"?[x]:x;let Te=Ct($,we.getAt(Q));C==\"+\"&&(Te+=Z),C==\"-\"&&(Te-=Z),C==\"*\"&&(Te*=Z),C==\"/\"&&(Te/=Z),we.setAt(Q,Te)}function N(x){return[x.attribute,...x.segments.map(C=>{if(\"name\"in C)return C.name;const M=Ae.evaluate(C.index);if(typeof M!=\"string\"&&typeof M!=\"number\")throw new Error(`[${C.index.trim()}] should be a number or text, to say which value to set`);const $=String(M);return Ir($),$})]}function A(x){const C=ko(x),M=C&&/^\\s*:=(.*)$/.exec(C.rest);if(C&&M){we.setAt(N(C),Xe.processText(M[1],!0));return}const $=C&&/^\\s*([+\\-*/]?)=(?!=)(.*)$/.exec(C.rest);if(C&&$){const[,Te,it]=$,It=N(C),Ft=Ae.evaluate(it);Te?E(It,Te,Ft):we.setAt(It,Ft);return}const Z=/^\\s*not\\s+/.exec(x),Q=ko(Z?x.substring(Z[0].length):x);if(!Q||Q.rest.trim())throw new Error(\"expected an attribute name, e.g. gold = 10, gold += 5, has_key or not has_key\");we.setAt(N(Q),!Z)}function L(x){x=x.replace(/^(\\w*\\s*):=(.*)$/,(M,$,Z)=>$+\"=\"+Xe.processText(Z,!0));const C=/^([\\w]*)\\s*=\\s*(.*)$/.exec(x);if(C){const M=C[1];let $=C[2];$===\"true\"?De(M,!0):$===\"false\"?De(M,!1):isNaN($)?($.startsWith(\"@\")&&($=he($.substring(1))),De(M,$)):De(M,parseFloat($))}else{const M=/^([\\w]*)\\s*([+\\-*/])=\\s*(.*)$/.exec(x);if(M){const $=M[1],Z=M[2],Q=M[3].trim();E($,Z,Q.startsWith(\"@\")?he(Q.substring(1)):Q)}else{let $=!0;x.startsWith(\"not \")&&(x=x.substring(4),$=!1),De(x,$)}}}async function D(x){y++;try{await H(x)}finally{y--,m.sync()}}async function H(x){R();const C=Tt();if(s=t.sections[x],!s)return;const M=he(\"_section\");M!==null&&(De(\"previous\",he(\"_passage\")??M),De(\"previous_section\",M)),he(\"_passage\")!==null&&De(\"_passage\",null),De(\"_section\",x),he(\"turns\")===null&&we.setInternal(\"turns\",0,!1),we.setSeen(x);const $=t.sections[\"\"],Z=$?.clear||s.clear;Z&&await ce([s,$]),_l([...$?.classes??[],...s.classes??[]]),Z&&ie(),le(x),fe(r,[s,$]);const Q=r;if($&&(await Y($,\"[[]]\"),he(\"_section\")!==x)){Q.remove();return}if(await Y(s,`[[${x}]]`),he(\"_section\")!==x){Q.remove();return}Sr(r),De(\"_turncount\",0),P(r);const Te=I(r);Ws(),K();const it=Tt();it!=C&&u.emit(\"canGoBackChanged\",{canGoBack:it}),u.emit(\"navigated\",{section:x}),await q(Te)}let F=!1;function V(x,C=null,M){const $={get:he,set:De,ui:{transition:kl,write:Xe.write,scrollToEnd:Xe.scrollToEnd,afterWrite:Z=>{if(!M)throw new Error(\"squiffy.ui.afterWrite can only be used in a section or passage's JavaScript\");M.push(Z)}},story:{go:Z=>F?(Ae.goto??(Ae.goto={section:Z,after:0}),Promise.resolve()):D(Z),seen:Z=>we.getSeen(Z),visits:Z=>we.getVisits(Z)},element:ds,import:hd,...C};t.js[x]($,he,De)}async function Y(x,C){x.attributes&&await ge(x.attributes),x.music!==void 0&&De(\"_music\",x.music);for(const $ of x.sounds??[])$==\"stop\"?ct.stopSounds():ct.play($);const M=[];if(x.jsIndex!==void 0){const $=he(\"_section\");if(V(x.jsIndex,null,M),he(\"_section\")!==$)return}Xe.write(x.text||\"\",C),F=!0;try{for(const $ of M)$()}finally{F=!1}await te()}async function te(){a=!0,r.classList.add(\"links-disabled\");for(const x of f)await x();f.length=0,a=!1,r.classList.remove(\"links-disabled\")}async function se(x,C){y++;try{await me(x,C)}finally{y--,m.sync()}}async function me(x,C){R();const M=Tt();let $=s.passages&&s.passages[x];const Z=t.sections[\"\"];if(!$&&Z&&Z.passages&&($=Z.passages[x]),!$)throw`No passage named ${x} in the current section or master section`;De(\"previous\",he(\"_passage\")??he(\"_section\")),De(\"_passage\",x),we.setSeen(x);const Q=[],Te=[];if(Z&&Z.passages){const nt=Z.passages[\"\"];nt&&(Q.push(nt),Te.push(()=>Y(nt,\"[[]][]\")))}const it=s.passages&&s.passages[\"\"];it&&(Q.push(it),Te.push(()=>Y(it,`[[${he(\"_section\")}]][]`))),Q.push($),Te.push(()=>Y($,`[[${he(\"_section\")}]][${x}]`));const It=\"@\"+he(\"_turncount\");if(s.passages&&!$.repeat){if(It in s.passages){const nt=s.passages[It];Q.push(nt),Te.push(()=>Y(nt,`[[${he(\"_section\")}]][${It}]`))}if(\"@last\"in s.passages&&he(\"_turncount\")>=(s.passageCount||0)){const nt=s.passages[\"@last\"];Q.push(nt),Te.push(()=>Y(nt,`[[${he(\"_section\")}]][${It}]`))}}const Ft=Q.some(nt=>nt.clear);Ft&&await ce([$,it,Z?.passages?.[\"\"],s,Z]);const ut=Q.flatMap(nt=>nt.classes??[]);ut.length&&_l([...vi(),...ut]),Ft&&(ie(),_e()),i=document.createElement(\"div\"),i.classList.add(\"squiffy-output-passage\"),i.setAttribute(\"data-passage\",`${x}`),C&&i.setAttribute(\"data-clicked-link\",C),r.appendChild(i),fe(i,[$,it,Z?.passages?.[\"\"],s,Z]);for(const nt of Te)await nt();Sr(r),P(i);const js=I(i);Ws(),K();const ps=Tt();ps!=M&&u.emit(\"canGoBackChanged\",{canGoBack:ps}),u.emit(\"navigated\",{section:he(\"_section\"),passage:x}),await q(js)}async function ge(x){for(const C of x)W(C)}function oe(){R(),m.stopAll(),we.reset(),ae=!1,ct.sync(),fs(),ot.scroll===\"element\"||ot.scroll===\"none\"?(Ee.innerHTML=\"\",k()):location.reload()}function K(){let x=Ee;x.querySelector(\".squiffy-transition\")&&(x=Ee.cloneNode(!0),x.querySelectorAll(\".squiffy-transition\").forEach(Ne)),De(\"_output\",x.innerHTML)}let ae=!1;function Ce(){ae||(ae=!0,t.uiJsIndex!==void 0&&V(t.uiJsIndex,{registerAnimation:_i.registerAnimation.bind(_i),registerHelper:Ae.handlebars.registerHelper.bind(Ae.handlebars),SafeString:Ae.handlebars.SafeString}))}function Re(){we.load(),ct.sync(),fs();const x=he(\"_output\");return x?(Le(x),Ce(),rs.onLoad(),Sr(r),!0):(Ce(),!1)}function Le(x){Ee.innerHTML=wr(x),xt(),Us(),n=Ee.querySelector(\".squiffy-output-block:last-child\"),s=t.sections[he(\"_section\")]}function Be(){return{format:\"squiffy-save\",version:1,storyId:t.projectId??null,section:he(\"_section\"),passage:he(\"_passage\"),summary:ke(),savedAt:new Date().toISOString(),state:structuredClone(we.store)}}function ke(){const C=r?.querySelectorAll(\".squiffy-output-block\")??[];for(const M of C){const $=be(M);if(!$)continue;const Z=[...M.querySelectorAll(\"h1, h2, h3, h4, h5, h6, p, li\")].find(it=>be(it));if(Z&&/^H[1-6]$/.test(Z.tagName)&&be(M).startsWith(be(Z)))return be(Z).substring(0,100);if($.length<=100)return $;const Q=$.substring(0,100),Te=Q.lastIndexOf(\" \");return(Te>100/2?Q.substring(0,Te):Q)+\"…\"}return\"\"}function be(x){const C=x.cloneNode(!0);return C.querySelectorAll(\"p, h1, h2, h3, h4, h5, h6, li, div, br, tr, blockquote\").forEach(M=>M.after(\" \")),(C.textContent??\"\").replace(/\\s+/g,\" \").trim()}function Oe(x){if(!x||typeof x!=\"object\")return!1;const C=x;return C.format===\"squiffy-save\"&&C.version===1&&!!C.state&&typeof C.state==\"object\"&&!Array.isArray(C.state)&&typeof C.state._output==\"string\"}async function Ie(x){if(!Oe(x))return{success:!1,error:\"notASave\"};if(x.storyId&&t.projectId&&x.storyId!==t.projectId)return{success:!1,error:\"wrongStory\"};for(;a;)await new Promise(M=>setTimeout(M,50));R(),m.stopAll(),h.length=0,we.reset();for(const[M,$]of Object.entries(x.state))we.setInternal(M,$,!1);if(ct.sync(),fs(),jt={},o=0,c=!1,Le(x.state._output),Ce(),!s)return Ee.innerHTML=\"\",await D(t.start),u.emit(\"canGoBackChanged\",{canGoBack:Tt()}),{success:!0};rs.onLoad(),Sr(r),u.emit(\"canGoBackChanged\",{canGoBack:Tt()});const C=he(\"_passage\");return u.emit(\"navigated\",C?{section:he(\"_section\"),passage:C}:{section:he(\"_section\")}),await T(),m.sync(),{success:!0}}function Se(){n=document.createElement(\"div\"),n.classList.add(\"squiffy-output-block\"),(i||r)?.appendChild(n)}function le(x){r&&(r.querySelectorAll(\"input, textarea, select\").forEach(C=>{const M=C,$=M.getAttribute(\"data-attribute\")||M.id;$&&De($,M.value),M.disabled||(M.disabled=!0,M.setAttribute(\"data-squiffy-disabled\",\"\"))}),r.querySelectorAll(\"[contenteditable]\").forEach(C=>{const M=C.getAttribute(\"data-attribute\")||C.id;M&&De(M,C.innerHTML),C.getAttribute(\"contenteditable\")!==\"false\"&&(C.setAttribute(\"contenteditable\",\"false\"),C.setAttribute(\"data-squiffy-disabled\",\"\"))})),i=null,_e(x),Se()}function _e(x){r=document.createElement(\"div\"),r.classList.add(\"squiffy-output-section\"),r.setAttribute(\"data-section\",x??he(\"_section\")),x||r.setAttribute(\"data-clear\",\"true\"),Ee.appendChild(r)}function ye(){return Ee.querySelector(\".squiffy-clear-stack\")}function Me(x,C){const M=x.getBoundingClientRect(),$=z(x);if($){const Z=$.getBoundingClientRect(),Q=C===\"start\"?M.top-Z.top:M.bottom-Z.bottom;$.scrollTo({top:$.scrollTop+Q,behavior:\"smooth\"})}else{const Z=C===\"start\"?M.top:M.bottom-window.innerHeight;window.scrollTo({top:window.scrollY+Z,behavior:\"smooth\"})}}function z(x){for(let C=x.parentElement;C&&C!==document.body&&C!==document.documentElement;C=C.parentElement){const M=getComputedStyle(C).overflowY;if((M===\"auto\"||M===\"scroll\")&&C.scrollHeight>C.clientHeight)return C}return null}function ie(){let x=ye();x||(x=document.createElement(\"div\"),x.classList.add(\"squiffy-clear-stack\"),x.style.display=\"none\",Ee.prepend(x));const C=document.createElement(\"div\");x.appendChild(C),c=!0;for(const M of[...Ee.children])M!==x&&C.appendChild(M);C.querySelectorAll(\".squiffy-transition\").forEach(Ne)}function fe(x,C){const M=C.find(Q=>Q?.transition),$=M?.transition;if(!$||$==\"none\"||$==\"instant\")return;x.classList.add(\"squiffy-transition\",$),x.setAttribute(\"data-transition\",$),M.transitionTime!==void 0&&x.style.setProperty(\"--squiffy-transition-time\",`${M.transitionTime}ms`);const Z=Q=>{Q.target!==x||x.classList.contains(\"squiffy-leave\")||(x.removeEventListener(\"animationend\",Z),x.removeEventListener(\"animationcancel\",Z),Ne(x))};x.addEventListener(\"animationend\",Z),x.addEventListener(\"animationcancel\",Z)}async function ce(x){const C=x.find(ut=>ut?.leave),M=C?.leave;if(!M||M==\"none\"||M==\"instant\")return;const $=ye(),Z=[...Ee.children].filter(ut=>ut!==$&&ut instanceof HTMLElement);if(!Z.length)return;for(const ut of Z)Ne(ut),ut.classList.add(\"squiffy-transition\",\"squiffy-leave\",M),ut.setAttribute(\"data-transition\",M),C.leaveTime!==void 0&&ut.style.setProperty(\"--squiffy-transition-time\",`${C.leaveTime}ms`);const Q=Z[0],Te=getComputedStyle(Q);if(!Te.animationName||Te.animationName==\"none\")return;const it=ut=>Math.max(0,...ut.split(\",\").map(js=>parseFloat(js)*(js.trim().endsWith(\"ms\")?.001:1)||0)),It=(it(Te.animationDuration)+it(Te.animationDelay))*1e3+1e3,Ft=a;a=!0;try{await new Promise(ut=>{const js=setTimeout(ps,It);function ps(nt){nt&&nt.target!==Q||(clearTimeout(js),Q.removeEventListener(\"animationend\",ps),Q.removeEventListener(\"animationcancel\",ps),ut())}Q.addEventListener(\"animationend\",ps),Q.addEventListener(\"animationcancel\",ps)})}finally{a=Ft}}function Ne(x){const C=x.getAttribute(\"data-transition\");C&&x.classList.remove(C),x.classList.remove(\"squiffy-transition\",\"squiffy-leave\"),x.classList.length||x.removeAttribute(\"class\"),x.removeAttribute(\"data-transition\"),x.style.removeProperty(\"--squiffy-transition-time\"),x.getAttribute(\"style\")||x.removeAttribute(\"style\")}function Ve(){const x=ye();if(!x)return;x.querySelectorAll(\".squiffy-transition\").forEach(Ne);for(const M of[...Ee.children])M!==x&&M.remove();const C=x.children[x.children.length-1];for(const M of[...C.children])Ee.appendChild(M);C.remove()}const Xe={write:(x,C)=>{o=Ee.scrollHeight;const M=h.splice(0).join(\"\")+Xe.renderHtml(x,!1).trim();n||Se();const $=document.createElement(\"div\");C&&$.setAttribute(\"data-source\",C),$.innerHTML=M,rs.onWrite($),n.appendChild($),Sr(r),Xe.scrollToEnd()},clearScreen:()=>{ie(),_e()},scrollToEnd:()=>{if(ot.scroll!==\"none\")if(c)if(c=!1,ot.scroll===\"element\")Me(r,\"start\");else{const x=Math.max(document.body.scrollTop,document.documentElement.scrollTop),C=Ee.getBoundingClientRect().top+x;C<x&&window.scrollTo({top:C,behavior:\"smooth\"})}else if(ot.scroll===\"element\"){const x=Ee.lastElementChild;x&&Me(x,\"end\")}else{let x=o;const C=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(x>C){const M=document.documentElement.scrollHeight-window.innerHeight;x>M&&(x=M),window.scrollTo({top:x,behavior:\"smooth\"})}}},processText:(x,C)=>Ae.process(x,C),renderHtml:(x,C)=>wr(Xe.processText(x,C))};function ts(x){if(x.start!=t.start){t=x,we.reset(),ct.sync(),fs(),ct.preload(t.audio??[]),Ee.innerHTML=\"\",D(t.start);return}const C=t;t=x,fs(),ct.preload(t.audio??[]),$u(C,x,Ee,($,Z)=>{const Q=s;s=Z,mi=!0;try{return Xe.renderHtml($,!1)}finally{s=Q,mi=!1}},v,$=>ge($)),xt(),Us(),m.sync(),u.emit(\"storyUpdated\",{})}function As(x){const C=t.sections[\"\"]?.passages?.[x];if(!C)return zt(\"Error in panel:\",`there is no passage called \"${x}\" in the master section [[]]`);const M=Ae.goto,$=[...Ae.deactivate];we.readOnly=!0;let Z;try{Z=Xe.renderHtml(C.text||\"\",!1)}finally{we.readOnly=!1,Ae.goto=M,Ae.deactivate=new Set($)}const Q=document.createElement(\"template\");return Q.innerHTML=Z,Q.content.querySelectorAll(\"a.squiffy-link\").forEach(v),Q.innerHTML}function xt(){const x=Ee.querySelectorAll(\".squiffy-output-section:last-child\");r=x[x.length-1];const C=r.getAttribute(\"data-section\");s=t.sections[C]}function Us(){i=r.querySelector(\".squiffy-output-passage:last-child\")}function gi(){const x=ye(),C=Ee.querySelectorAll(\".squiffy-output-section\").length+Ee.querySelectorAll(\".squiffy-output-passage\").length;return x?C+x.children.length:C}function _r(x){x.querySelectorAll(\"[data-squiffy-disabled]\").forEach(C=>{C.hasAttribute(\"contenteditable\")?C.setAttribute(\"contenteditable\",\"true\"):C.disabled=!1,C.removeAttribute(\"data-squiffy-disabled\")})}function Tt(){const x=i??r,C=[...Ee.querySelectorAll(\"[data-goto]\")].filter(M=>M!==x).length;return gi()-C>1}function Mn(){if(a||!Tt())return;R();do yt();while((i??r).hasAttribute(\"data-goto\")&&gi()>1);ct.sync(),fs(),K(),Tt()||u.emit(\"canGoBackChanged\",{canGoBack:!1});const x=i?.getAttribute(\"data-passage\");u.emit(\"navigated\",x?{section:he(\"_section\"),passage:x}:{section:he(\"_section\")}),m.sync()}function yt(){const x=ye();if(i){const C=i.getAttribute(\"data-passage\"),M=i.getAttribute(\"data-clicked-link\");Nn(i.getAttribute(\"data-undo\")),O(i),i.remove();let $=!1,Z=!1;for(const Q of Ee.children)if(Q!==x){if(Q.getAttribute(\"data-clear\")==\"true\"&&Q.children.length==0){$=!0;continue}Z=!0;break}if($&&!Z&&(Ve(),xt()),M)for(const Q of r.querySelectorAll(`a.squiffy-link[data-clicked=\"${M}\"], input[data-clicked=\"${M}\"]`))p(Q),Q.removeAttribute(\"data-clicked\");else if(C&&!S(C))for(const Q of r.querySelectorAll(\"a.squiffy-link[data-passage]\"))Q.getAttribute(\"data-passage\")==C&&p(Q);Us()}else{Nn(r.getAttribute(\"data-undo\")),r.remove();let C=!1;for(const M of[...Ee.children])if(M!==x){C=!0;break}C||Ve(),xt(),Us(),_r(r)}}const ds=e.element,Ee=document.createElement(\"div\");ds.appendChild(Ee),t=e.story;const wr=yd(e.resolveAssetUrl),ot={scroll:e.scroll||\"body\",persist:e.persist===void 0?!0:e.persist,onSet:e.onSet||(()=>{})};let Xt=\"\";ot.persist&&(e.storyId!==void 0?Xt=e.storyId:window.location.protocol===\"file:\"?Xt=t.id||\"\":Xt=window.location.pathname,Xt||(console.warn(\"Persist is set to true in Squiffy runtime options, but no storage key could be determined. Persist will be disabled.\"),ot.persist=!1)),ot.scroll===\"element\"&&(Ee.style.overflowY=\"auto\"),Ee.addEventListener(\"click\",w),Ee.addEventListener(\"keypress\",async function(x){if(x.key!==\"Enter\")return;const C=x.target;if(C instanceof window.HTMLInputElement&&(C.hasAttribute(\"data-section\")||C.hasAttribute(\"data-passage\"))){if(x.isComposing)return;if(x.preventDefault(),!Tn(r)){for(const M of r.querySelectorAll(\"input:not([disabled]), textarea:not([disabled]), select:not([disabled])\"))M.reportValidity();return}await _(C);return}await w(x)});let jt={};const gt=function(x,C){x!=\"_output\"&&(x in jt||(jt[x]=C))},Ws=function(){(i??r).setAttribute(\"data-undo\",JSON.stringify(jt)),jt={}},xe=function(){const x=i??r,C=JSON.parse(x.getAttribute(\"data-undo\")||\"{}\");for(const[M,$]of Object.entries(jt))M in C||(C[M]=$);x.setAttribute(\"data-undo\",JSON.stringify(C)),jt={}};function at(x){if(a||y>0)return!1;const C=x.tagName==\"SPAN\",M=decodeURIComponent(x.getAttribute(\"data-every\")||\"\");let $;Ae.stopEvery=!1;try{$=Xe.renderHtml(M,C),C&&($=(/^\\s/.test(M)?\" \":\"\")+$+(/\\s$/.test(M)?\" \":\"\"))}catch(Ft){$=zt(\"Error in {{#every}}:\",Ft instanceof Error?Ft.message:String(Ft)),Ae.stopEvery=!0}const Z=document.createElement(C?\"span\":\"div\");Z.className=\"squiffy-every-text\",Z.innerHTML=$,x.hasAttribute(\"data-every-append\")?x.append(Z):x.replaceChildren(Z),rs.onWrite(Z),Xe.scrollToEnd();const Q=(Number(x.getAttribute(\"data-every-count\"))||0)+1;x.setAttribute(\"data-every-count\",String(Q));const Te=Number(x.getAttribute(\"data-every-times\"))||0;(Ae.stopEvery||Te&&Q>=Te)&&x.setAttribute(\"data-every-stopped\",\"\"),Ae.stopEvery=!1;const it=i??r;P(it);const It=I(it);return xe(),K(),It&&(clearTimeout(d),l=0,q(It)),!0}const Nn=function(x){if(!x)return;const C=JSON.parse(x);if(C)for(const M of Object.keys(C))we.setInternal(M,C[M],!1)},we=new Du(ot.persist,Xt,ot.onSet,u,gt),he=we.get.bind(we),De=we.set.bind(we),Bt=new Nd(()=>t.settings??[],ot.persist?\"squiffy-settings:\"+Xt:void 0);we.playerSettings=()=>Bt.any()?Bt.all():null;const vl=(x,C)=>{fs(),u.emit(\"settingChanged\",{name:x,value:C}),u.emit(\"set\",{attribute:\"settings\",value:Bt.all()})},Ae=new Mu(()=>t,we,()=>s),Ht=e.strings??{};typeof Ht.restart==\"string\"&&(Ae.strings.restart=Ht.restart),typeof Ht.saves==\"string\"&&(Ae.strings.saves=Ht.saves),typeof Ht.settings==\"string\"&&(Ae.strings.settings=Ht.settings);let yl=!1,mi=!1,Gs=1;const ct=new bd({resolveUrl:x=>al(x)||!e.resolveAssetUrl?x:e.resolveAssetUrl(x.replace(/^(\\.\\/)+/,\"\")),getMusic:()=>he(\"_music\"),mutedKey:ot.persist?\"squiffy-muted:\"+Xt:void 0,onPlay:()=>{yl=!0,u.emit(\"sound\",{})}});ct.preload(t.audio??[]),u.on(\"set\",({attribute:x})=>{if(x!=\"_music\")return;const C=Gs;Gs=1,ct.sync(C)});const bl=x=>{const C=Number(x?.hash?.fade);return x?.hash&&\"fade\"in x.hash&&Number.isFinite(C)&&C>=0?C:1},Dn=x=>typeof x==\"object\"&&x!==null&&\"hash\"in x;Ae.handlebars.registerHelper(\"music\",(x,C)=>Dn(x)?he(\"music\"):(we.readOnly||typeof x!=\"string\"||(Gs=bl(C),De(\"_music\",x||null),Gs=1),\"\")),Ae.handlebars.registerHelper(\"stopmusic\",x=>(we.readOnly||(Gs=bl(x),De(\"_music\",null),Gs=1),\"\")),Ae.handlebars.registerHelper(\"sound\",(x,C)=>{if(Dn(x))return he(\"sound\");if(we.readOnly||mi||typeof x!=\"string\"||!x)return\"\";const M=Number(C?.hash?.volume??1);return ct.play(x,M),\"\"}),Ae.handlebars.registerHelper(\"stopsounds\",()=>(!we.readOnly&&!mi&&ct.stopSounds(),\"\"));const $n=\"_sectionclasses\",ss=\"_classes\";let Sl=[];const Xs=x=>{const C=he(x);return Array.isArray(C)?C.filter(M=>typeof M==\"string\"&&M.length>0):[]},vi=()=>Xs($n),yi=x=>x.filter(C=>!Dn(C)).flatMap(C=>String(C??\"\").split(/\\s+/)).filter(C=>C.length>0);function _l(x){const C=[...new Set(x)],M=vi();C.length==M.length&&C.every(($,Z)=>$==M[Z])||De($n,C)}function wl(x){for(const C of Sl)x.includes(C)||ds.classList.remove(C);for(const C of x)ds.classList.add(C);Sl=x}function fs(){wl([...new Set([...vi(),...Xs(ss),...Bt.classes()])])}u.on(\"set\",({attribute:x})=>{(x==$n||x==ss)&&fs()}),Ae.handlebars.registerHelper(\"addclass\",(...x)=>{if(we.readOnly)return\"\";const C=Xs(ss),M=yi(x).filter($=>!C.includes($));return M.length&&De(ss,[...C,...M]),\"\"}),Ae.handlebars.registerHelper(\"removeclass\",(...x)=>{if(we.readOnly)return\"\";const C=yi(x),M=Xs(ss);return M.some($=>C.includes($))&&De(ss,M.filter($=>!C.includes($))),\"\"}),Ae.handlebars.registerHelper(\"toggleclass\",(...x)=>{if(we.readOnly)return\"\";let C=Xs(ss);for(const M of new Set(yi(x)))C=C.includes(M)?C.filter($=>$!=M):[...C,M];return De(ss,C),\"\"}),Ae.handlebars.registerHelper(\"hasclass\",(...x)=>{const C=yi(x),M=[...vi(),...Xs(ss)];return C.length>0&&C.every($=>M.includes($))});const kr=new Wu;let bi=null;kr.registerLinkHandler(\"restart\",x=>{const C=x.getAttribute(\"data-confirm\")!==\"false\";return queueMicrotask(async()=>{if(u.has(\"restartRequested\")){u.emit(\"restartRequested\",{confirm:C});return}C&&!await _d({message:Ht.restartConfirm??\"Are you sure you want to restart?\",confirm:Ht.restart??\"Restart\",cancel:Ht.cancel})||oe()}),{}});let Si=null;kr.registerLinkHandler(\"settings\",()=>(u.has(\"settingsRequested\")?u.emit(\"settingsRequested\",{}):(Si??(Si=pl(qn,{strings:Ht})),Si.open()),{})),kr.registerLinkHandler(\"saves\",()=>(u.has(\"savesRequested\")?u.emit(\"savesRequested\",{}):(bi??(bi=Rd(qn,{strings:Ht})),bi.open()),{}));const Qd=x=>x in t.sections&&t.sections[x].text||null,ef=x=>s.passages&&x in s.passages?s.passages[x].text||null:\"passages\"in t.sections[\"\"]&&t.sections[\"\"].passages&&x in t.sections[\"\"].passages&&t.sections[\"\"].passages[x].text||null,kl=x=>{f.push(x)},_i=new ud,rs=new qu(Ee,Ae,we,kr,Qd,ef,Xe.renderHtml,kl,_i,u,wr);rs.add(rr.ReplaceLabel()),rs.add(rr.RotateSequencePlugin()),rs.add(rr.RandomPlugin()),rs.add(rr.LivePlugin()),rs.add(rr.AnimatePlugin());const qn={begin:k,restart:oe,get:he,set:De,clickLink:_,update:ts,goBack:Mn,canGoBack:Tt,getSave:Be,loadSave:Ie,renderPassage:As,isMuted:()=>ct.isMuted(),setMuted:x=>ct.setMuted(x),usesSound:()=>yl||!!t.audio?.length,getSettings:()=>structuredClone(Bt.definitions()),getSetting:x=>Bt.get(x),setSetting:(x,C)=>{Bt.set(x,C)&&vl(x,Bt.get(x))},resetSettings:()=>{const x=Bt.all();Bt.reset();for(const[C,M]of Object.entries(Bt.all()))M!==x[C]&&vl(C,M)},dispose:()=>{R(),m.stopAll(),ct.dispose(),wl([]),bi?.element.remove(),Si?.element.remove()},on:(x,C)=>u.on(x,C),off:(x,C)=>u.off(x,C),once:(x,C)=>u.once(x,C)};return qn},Ud={png:\"image/png\",jpg:\"image/jpeg\",jpeg:\"image/jpeg\",gif:\"image/gif\",webp:\"image/webp\",avif:\"image/avif\",svg:\"image/svg+xml\",ico:\"image/x-icon\",bmp:\"image/bmp\",mp3:\"audio/mpeg\",ogg:\"audio/ogg\",oga:\"audio/ogg\",wav:\"audio/wav\",m4a:\"audio/mp4\",flac:\"audio/flac\",mp4:\"video/mp4\",webm:\"video/webm\",ogv:\"video/ogg\",woff:\"font/woff\",woff2:\"font/woff2\",ttf:\"font/ttf\",otf:\"font/otf\",pdf:\"application/pdf\",vtt:\"text/vtt\"},Wd=e=>Ud[e.substring(e.lastIndexOf(\".\")+1).toLowerCase()]??\"\",fi=e=>e.replace(/^(\\.\\/)+/,\"\"),Gd=/url\\(\\s*(?:\"((?:[^\"\\\\\\n]|\\\\.)*)\"|'((?:[^'\\\\\\n]|\\\\.)*)'|([^)\"'\\s]*))\\s*\\)/gi,Xd=e=>e!=\"\"&&!/^(?:[a-z][a-z\\d+.-]*:|\\/|#)/i.test(e);async function jd(e){const t=URL.createObjectURL(new Blob([e],{type:\"text/javascript\"}));try{return await import(t)}finally{URL.revokeObjectURL(t)}}function In(e){return e instanceof Error?{type:\"runtimeError\",message:e.message,...e.stack?{stack:e.stack}:{}}:{type:\"runtimeError\",message:String(e)}}function Yd(e){const t=e.loadModule??jd;let s,r,i=\"\",n,o,c,h,u,f=[],a=!1,d=!1,l=0;const g=new Map,m=[];let y=[],_=[],w=[];const S=document.createElement(\"style\");document.head.appendChild(S);const v=E=>{try{e.send(E)}catch{E.type==\"attributeSet\"&&e.send({...E,value:String(E.value)})}};function p(){const E=S.textContent,N=L=>(S.textContent=`:root { color-scheme: ${L}; }`,getComputedStyle(document.documentElement).getPropertyValue(\"color-scheme\")),A=N(\"light\")==N(\"dark\");return S.textContent=E,A}const b=E=>g.get(fi(E))??E;function k(E){for(const N of m.splice(0))URL.revokeObjectURL(N);g.clear();for(const[N,A]of Object.entries(E.urls??{}))g.set(fi(N),A);for(const[N,A]of Object.entries(E.files??{})){const L=A instanceof Blob?A:new Blob([A],{type:Wd(N)}),D=URL.createObjectURL(L);m.push(D),g.set(fi(N),D)}y.forEach((N,A)=>{N.textContent=T(_[A])})}const T=E=>E.replace(Gd,(N,A,L,D)=>{const H=(A??L??D??\"\").trim(),F=Xd(H)?g.get(fi(H)):void 0;return F?`url(\"${F}\")`:N});function R(E){if(E.length==_.length&&E.every((L,D)=>_[D]==L))return!1;const N=y[0]??w[0]??null,A=E.map(L=>{const D=document.createElement(\"style\");return D.textContent=T(L),document.head.insertBefore(D,N),D});for(const L of y)L.remove();return y=A,_=[...E],!0}async function P(E){for(const N of[...y,...w])N.remove();y=[],_=[],w=[],R(E.css??[]);for(const N of E.scripts??[]){const A=document.createElement(\"script\"),L=URL.createObjectURL(new Blob([N],{type:\"text/javascript\"}));await new Promise(D=>{A.onload=A.onerror=()=>D(),A.src=L,document.head.appendChild(A)}),URL.revokeObjectURL(L),w.push(A)}}function O(E){const N=E?[...E.classList].filter(A=>A!=\"squiffy-preview-story\"):[];for(const A of f)N.includes(A)||e.element.classList.remove(A);for(const A of N)e.element.classList.add(A);f=N}async function I(E){const N=++l;s?.dispose(),s=void 0,u?.disconnect(),u=void 0,O(void 0),e.element.innerHTML=\"\",await P(E.story);const{story:A}=await t(E.story.js);if(N!=l)return;v({type:\"themeFixed\",fixed:p()}),r?.dispose(),r=void 0,i=\"\",c?.element.remove(),c=void 0,o=void 0,n=document.createElement(\"div\"),n.className=\"squiffy-preview-header\",h=document.createElement(\"div\"),h.className=\"squiffy-preview-body\";const L=document.createElement(\"div\");L.className=\"squiffy-preview-story\",h.appendChild(L),e.element.append(n,h),u=new MutationObserver(()=>O(L)),u.observe(L,{attributes:!0,attributeFilter:[\"class\"]});const D=await zd({element:L,story:A,persist:!1,scroll:\"element\",resolveAssetUrl:b,onSet:(H,F)=>{N==l&&!H.startsWith(\"_\")&&v({type:\"attributeSet\",name:H,value:F})}});D.on(\"canGoBackChanged\",H=>{N==l&&v({type:\"canGoBackChanged\",canGoBack:H.canGoBack})}),D.on(\"navigated\",H=>{N==l&&v({type:\"navigated\",...H})}),D.on(\"sound\",()=>{N==l&&!d&&(d=!0,v({type:\"usesSound\",usesSound:d}))}),D.setMuted(a),d=D.usesSound(),v({type:\"usesSound\",usesSound:d}),s=D,q(A.panels),B(A.settings),v({type:\"canGoBackChanged\",canGoBack:!1}),await D.begin(E.startAt),N==l&&O(L),N==l&&v({type:\"loaded\"})}function q(E){const N=JSON.stringify(E??[]);!s||!n||N==i||(i=N,r?.dispose(),r=E?.length?Vd(s,{panels:E,buttons:n,side:h}):void 0)}function B(E){if(!s||!n)return;if(!E?.length){o?.remove(),o=void 0;return}if(o){n.appendChild(o);return}const N=document.createElement(\"button\");N.type=\"button\",N.className=\"squiffy-header-button squiffy-settings-button\",N.title=\"Settings\",N.setAttribute(\"aria-label\",\"Settings\"),N.setAttribute(\"aria-haspopup\",\"dialog\"),N.innerHTML=Id,N.addEventListener(\"click\",()=>{s&&(c??(c=pl(s)),c.open())}),n.appendChild(N),o=N}async function W(E){try{switch(E.type){case\"load\":await I(E);break;case\"update\":if(!s)break;E.css&&R(E.css)&&v({type:\"themeFixed\",fixed:p()});{const{story:N}=await t(E.js);s.update(N),q(N.panels),B(N.settings)}break;case\"restart\":s?.restart();break;case\"back\":s?.goBack();break;case\"assets\":k(E.assets);break;case\"muted\":a=E.muted,s?.setMuted(a);break;case\"theme\":S.textContent=E.theme==\"system\"?\"\":`:root { color-scheme: ${E.theme}; }`}}catch(N){v(In(N))}}return{receive:W}}var Zd=\"squiffy-preview\",Jd=e=>typeof e==\"object\"&&e!==null&&e.channel===\"squiffy-preview\"&&typeof e.type==\"string\",On=typeof acquireVsCodeApi==\"function\"?acquireVsCodeApi():void 0,pi=e=>{const t={channel:Zd,...e};On?On.postMessage(t):window.parent.postMessage(t,\"*\")},Kd=Yd({element:document.getElementById(\"squiffy\"),send:pi});window.addEventListener(\"message\",e=>{!On&&e.source!==window.parent||Jd(e.data)&&Kd.receive(e.data)}),window.addEventListener(\"error\",e=>pi(In(e.error??e.message))),window.addEventListener(\"unhandledrejection\",e=>pi(In(e.reason))),pi({type:\"ready\"})})();\n\n</script>\n</body>\n</html>\n";
|