@pie-element/passage 8.0.6-next.20261018193205 → 8.0.6
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/browser/author/index.js +2 -2
- package/dist/browser/controller/index.js +1 -1
- package/dist/browser/delivery/index.js +3 -3
- package/dist/browser/{dist-CTb5ZMik.js → dist-KPdIUDQ3.js} +55 -55
- package/dist/browser/dist-KPdIUDQ3.js.map +1 -0
- package/dist/browser/editor-runtime/author/index.js +2 -2
- package/dist/browser/editor-runtime/controller/index.js +1 -1
- package/dist/browser/editor-runtime/delivery/index.js +3 -3
- package/dist/browser/editor-runtime/{dist-DzhiWShq.js → dist-Bvb4ZmU5.js} +55 -55
- package/dist/browser/editor-runtime/dist-Bvb4ZmU5.js.map +1 -0
- package/dist/browser/editor-runtime/{mathjax-CptWnMbQ-BymmkoDr.js → mathjax-DqXi3q4c-iuQQkXxN.js} +3 -3
- package/dist/browser/editor-runtime/{mathjax-CptWnMbQ-BymmkoDr.js.map → mathjax-DqXi3q4c-iuQQkXxN.js.map} +1 -1
- package/dist/browser/editor-runtime/print/index.js +3 -3
- package/dist/browser/editor-runtime/{stimulus-tabs-CRQmVnXW.js → stimulus-tabs-BDmwfj5U.js} +2 -2
- package/dist/browser/editor-runtime/{stimulus-tabs-CRQmVnXW.js.map → stimulus-tabs-BDmwfj5U.js.map} +1 -1
- package/dist/browser/{mathjax-CptWnMbQ-ncPHVakS.js → mathjax-DqXi3q4c-BZrO4NBZ.js} +3 -3
- package/dist/browser/{mathjax-CptWnMbQ-ncPHVakS.js.map → mathjax-DqXi3q4c-BZrO4NBZ.js.map} +1 -1
- package/dist/browser/print/index.js +3 -3
- package/dist/browser/{stimulus-tabs-B6IEGNfs.js → stimulus-tabs-D8i60aIU.js} +2 -2
- package/dist/browser/{stimulus-tabs-B6IEGNfs.js.map → stimulus-tabs-D8i60aIU.js.map} +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/schemas/configuration.schema.json +1 -1
- package/dist/schemas/model.schema.json +1 -1
- package/dist/schemas/session.schema.json +1 -1
- package/module/print.js +31 -31
- package/module/print.js.map +1 -1
- package/package.json +12 -12
- package/dist/browser/dist-CTb5ZMik.js.map +0 -1
- package/dist/browser/editor-runtime/dist-DzhiWShq.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as e } from "../speech-worker-CTpOB9m5-BIgcSm3A.js";
|
|
2
|
-
import { w as t } from "../dist-
|
|
3
|
-
import { t as n } from "../stimulus-tabs-
|
|
2
|
+
import { w as t } from "../dist-KPdIUDQ3.js";
|
|
3
|
+
import { t as n } from "../stimulus-tabs-D8i60aIU.js";
|
|
4
4
|
import { i as r } from "../dist-CdepepQM.js";
|
|
5
5
|
import i from "react";
|
|
6
6
|
import { createRoot as a } from "react-dom/client";
|
|
@@ -46,7 +46,7 @@ var o = (0, (/* @__PURE__ */ e(t(), 1)).default)("pie-element:passage:print"), s
|
|
|
46
46
|
}
|
|
47
47
|
}, d = Object.freeze({
|
|
48
48
|
name: "@pie-element/passage",
|
|
49
|
-
version: "8.0.6
|
|
49
|
+
version: "8.0.6"
|
|
50
50
|
});
|
|
51
51
|
//#endregion
|
|
52
52
|
export { u as default, d as piePackage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as e } from "./speech-worker-CTpOB9m5-BIgcSm3A.js";
|
|
2
|
-
import { C as t, Dt as n, F as r, I as i, M as a, N as o, c as s, g as c, n as l, o as u, s as d, t as f, tt as p, x as m } from "./dist-
|
|
2
|
+
import { C as t, Dt as n, F as r, I as i, M as a, N as o, c as s, g as c, n as l, o as u, s as d, t as f, tt as p, x as m } from "./dist-KPdIUDQ3.js";
|
|
3
3
|
import h from "react";
|
|
4
4
|
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
5
5
|
//#region src/delivery/stimulus-tabs.tsx
|
|
@@ -260,4 +260,4 @@ V.propTypes = {
|
|
|
260
260
|
//#endregion
|
|
261
261
|
export { V as t };
|
|
262
262
|
|
|
263
|
-
//# sourceMappingURL=stimulus-tabs-
|
|
263
|
+
//# sourceMappingURL=stimulus-tabs-D8i60aIU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stimulus-tabs-B6IEGNfs.js","names":[],"sources":["../../src/delivery/stimulus-tabs.tsx"],"sourcesContent":["// @ts-nocheck\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Tabs from '@mui/material/Tabs';\nimport Tab from '@mui/material/Tab';\nimport { styled } from '@mui/material/styles';\nimport { Collapsible as CollapsibleImport, color, createUniqueId, PreviewPrompt as PreviewPromptImport, Purpose as PurposeImport, UiLayout as UiLayoutImport, transformDataHeadings } from '@pie-lib/render-ui';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nimport { sanitizeModelHtml } from '@pie-element/shared-utils';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nconst Purpose = unwrapReactInteropSymbol(PurposeImport, 'Purpose') || unwrapReactInteropSymbol(renderUi.Purpose, 'Purpose');\nconst PreviewPrompt = unwrapReactInteropSymbol(PreviewPromptImport, 'PreviewPrompt') || unwrapReactInteropSymbol(renderUi.PreviewPrompt, 'PreviewPrompt');\nconst Collapsible = unwrapReactInteropSymbol(CollapsibleImport, 'Collapsible') || unwrapReactInteropSymbol(renderUi.Collapsible, 'Collapsible');\n// Must match the breakpoint Quiz Engine passes to the PIE section player for\n// switching from the side-by-side passage/question layout to the tabbed layout.\n// Below (and at) this width the passage tabs scroll with the passage content\n// instead of being locked to the top of the panel, so that they do not lock up\n// space needed for the passage text (WCAG 1.4.10 Reflow, 400% zoom / 320px).\nconst STICKY_TABS_BREAKPOINT = 840;\n\n/**\n * Zoom compensation for the passage selection tabs.\n *\n * The tabs scale naturally with browser zoom up to 200%. Beyond 200%,\n * we shrink their CSS size proportionally so their physical on-screen size\n * freezes at the 200% appearance, leaving more room for passage content\n * in high-zoom / small-window situations.\n * The factor is min(1, 2 / zoom): exactly 1 at zoom <= 200% (component\n * behavior unchanged), shrinking proportionally above that. A lower clamp\n * of 0.4 guards against inflated ratios (docked devtools, browser side\n * panels, window chrome) ever making the tabs unusably small.\n */\nconst MAX_TABS_ZOOM = 2;\nconst MIN_ZOOM_COMPENSATION = 0.4;\n\n// Per-tab horizontal-space floor in CSS pixels. When the passage container is\n// narrow enough that each tab would have at most this much room\n// (containerWidth <= tabs.length * NUMERIC_LABEL_MIN_WIDTH_PER_TAB), tab labels\n// fall back to \"Passage 1\", \"Passage 2\", ... so navigation stays usable instead\n// of being dominated by aggressively truncated titles.\nconst NUMERIC_LABEL_MIN_WIDTH_PER_TAB = 170;\n\nconst computeZoomCompensation = () => {\n if (typeof window === 'undefined') return 1;\n const ratio = window.outerWidth / window.innerWidth;\n const zoom = Number.isFinite(ratio) && ratio > 0 ? ratio : 1;\n return Math.max(MIN_ZOOM_COMPENSATION, Math.min(1, MAX_TABS_ZOOM / zoom));\n};\n\nconst PassagesContainer: any = styled('div')({\n flexGrow: 1,\n backgroundColor: color.background(),\n color: color.text(),\n '&:not(.MathJax) table': {\n borderCollapse: 'collapse',\n },\n '&:not(.MathJax) table td, &:not(.MathJax) table th': {\n padding: '.6em 1em',\n textAlign: 'left',\n },\n});\n\nconst Passage: any = styled('div')(({ theme }) => ({\n backgroundColor: color.background(),\n color: color.text(),\n padding: theme.spacing(2),\n '& blockquote': {\n background: '#f9f9f9',\n borderLeft: '5px solid #ccc',\n margin: '1.5em 10px',\n padding: '.5em 10px',\n },\n}));\n\nconst PassageTitle: any = styled('div')({\n fontSize: '1.75rem',\n});\n\nconst PassageSubtitle: any = styled('div')({\n fontSize: '1.5rem',\n});\n\nconst PassageAuthor: any = styled('div')({\n fontSize: '1.25rem',\n});\n\nconst TabStyled: any = styled(Tab)(({ theme }) => ({\n /*\n * The tab carries the colour of the panel it opens, which is what makes it read as a\n * tab rather than a button, and it has to be the themed panel colour: MUI's palette\n * does not follow `--pie-*`, so `common.white` here left the tab white on every color\n * scheme while the passage body beneath it went dark. The comment this replaces gated\n * the change on PD-2801, which is about OT's `color-contrast` class -- the mechanism\n * pie-theme superseded, and blocked since 2023.\n */\n background: color.background(),\n fontSize: 'inherit',\n fontFamily: 'Roboto, sans-serif',\n color: color.text(),\n borderRadius: `${theme.spacing(2)} ${theme.spacing(2)} 0 0`,\n /*\n * `--pie-border-gray` is stepped to the 3:1 non-text minimum in every scheme. The\n * literal it replaces measured about 1.2:1 against the dark schemes' surfaces, so the\n * tab outline -- the only thing separating an unselected tab from the strip -- was\n * invisible there.\n */\n border: `1px solid ${color.borderGray()}`,\n borderBottomWidth: 0,\n minHeight: '56px',\n padding: '8px 10px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n margin: `0 ${theme.spacing(1)}`,\n textTransform: 'none',\n\n '.passage-label': {\n display: '-webkit-box',\n WebkitLineClamp: 2,\n WebkitBoxOrient: 'vertical',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'normal',\n margin: 'auto 0',\n opacity: 0.7,\n },\n\n '&.Mui-selected': {\n color: color.text(),\n '.passage-label': {\n opacity: 1,\n },\n '.passage-label-underline': {\n backgroundColor: color.tertiary(),\n },\n },\n\n '&:hover': {\n '.passage-label-underline': {\n backgroundColor: color.tertiaryLight(),\n },\n },\n\n '& .MuiTouchRipple-root': {\n opacity: 0.7,\n },\n}));\n\n/*\n * The selection indicator, one per tab. Unselected it has to disappear into the tab, so it\n * paints the tab's own background rather than a fixed white; selected it becomes\n * `--pie-tertiary`, which every scheme sets.\n */\nconst Underline: any = styled('div')(() => ({\n height: '2px',\n width: '100%',\n marginTop: '6px',\n background: color.background(),\n}));\n\nclass StimulusTabs extends React.Component {\n state = {\n activeTab: 0,\n zoomCompensation: computeZoomCompensation(),\n containerWidth: 0,\n };\n\n containerRef = React.createRef();\n\n // Tab ids are model indexes, so DOM ids take a per-instance prefix and each passage's\n // aria-controls / aria-labelledby pairs resolve inside that passage. `button-N` and\n // `tabpanel-N` stay as class hooks.\n idPrefix = createUniqueId('passage');\n\n tabButtonId: any = (tabId) => `${this.idPrefix}-button-${tabId}`;\n\n tabPanelId: any = (tabId) => `${this.idPrefix}-tabpanel-${tabId}`;\n\n componentDidMount() {\n if (typeof window === 'undefined') return;\n window.addEventListener('resize', this.updateZoomCompensation);\n\n if (this.containerRef.current && typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(this.updateContainerWidth);\n this.resizeObserver.observe(this.containerRef.current);\n }\n\n this.updateContainerWidth();\n }\n\n componentWillUnmount() {\n if (typeof window === 'undefined') return;\n window.removeEventListener('resize', this.updateZoomCompensation);\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n updateZoomCompensation: any = () => {\n this.setState({ zoomCompensation: computeZoomCompensation() });\n };\n\n updateContainerWidth: any = () => {\n const node = this.containerRef.current;\n if (!node) return;\n const width = node.clientWidth;\n if (width !== this.state.containerWidth) {\n this.setState({ containerWidth: width });\n }\n };\n\n handleChange: any = (event, activeTab) => {\n this.setState(() => ({ activeTab }));\n\n setTimeout(() => {\n const tabChangeEvent = new CustomEvent('pie-ui-passage-tabChanged', {\n detail: { tab: activeTab },\n });\n\n window.dispatchEvent(tabChangeEvent);\n });\n };\n\n handleKeyDown: any = (event, currentTabId) => {\n const { key } = event;\n const { tabs } = this.props;\n\n let newTabIndex = -1;\n const currentIndex = tabs.findIndex((tab) => tab.id === currentTabId);\n\n switch (key) {\n case 'ArrowRight':\n // Move to the next tab\n newTabIndex = (currentIndex + 1) % tabs.length;\n break;\n case 'ArrowLeft':\n // Move to the previous tab\n newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n break;\n // Commented out ArrowDown and ArrowUp for future vertical tab navigation\n // case 'ArrowDown':\n // // Move to the next tab (for vertical alignment)\n // newTabIndex = (currentIndex + 1) % tabs.length;\n // break;\n // case 'ArrowUp':\n // // Move to the previous tab (for vertical alignment)\n // newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n // break;\n case 'Home':\n // Move to the first tab\n newTabIndex = 0;\n break;\n case 'End':\n // Move to the last tab\n newTabIndex = tabs.length - 1;\n break;\n case 'Enter':\n case ' ':\n // Activate the current tab\n newTabIndex = currentIndex;\n break;\n default:\n break;\n }\n\n if (newTabIndex !== -1) {\n event.preventDefault();\n event.stopPropagation();\n this.handleChange(event, tabs[newTabIndex].id);\n this.containerRef.current?.querySelector(`[id=\"${this.tabButtonId(tabs[newTabIndex].id)}\"]`)?.focus();\n }\n };\n\n parsedText: any = (text = '') => {\n // fix imported audio content for Safari PD-1391\n const div = document.createElement('div');\n div.innerHTML = sanitizeModelHtml(text.replace(/(<br\\/>\\n)/g, '<br/>'));\n\n const audio = div.querySelector('audio');\n\n if (audio) {\n const source = document.createElement('source');\n\n source.setAttribute('type', 'audio/mp3');\n source.setAttribute('src', audio.getAttribute('src'));\n\n audio.removeAttribute('src');\n audio.appendChild(source);\n }\n\n return div.innerHTML;\n };\n\n renderInstructions(teacherInstructions, disabledTabs = false) {\n if (!teacherInstructions) {\n return;\n }\n\n const teacherInstructionsDiv = (\n <PreviewPrompt\n tagName=\"div\"\n className=\"prompt\"\n defaultClassName=\"teacher-instructions\"\n prompt={teacherInstructions}\n />\n );\n\n if (disabledTabs) {\n return teacherInstructionsDiv;\n }\n\n return (\n <Collapsible\n labels={{\n hidden: translator.t('common:showTeacherInstructions', { lng: this.props.model?.language }),\n visible: translator.t('common:hideTeacherInstructions', { lng: this.props.model?.language }),\n }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n );\n }\n\n // Outside a tab list (one passage, or print) no tab names the panel, so it renders without the\n // tabpanel role and its title heading carries the structure.\n renderTab(tab, disabledTabs, tabbed = true) {\n const { baseHeadingLevel } = this.props;\n const clampedLevel = baseHeadingLevel ? Math.min(6, Math.max(1, baseHeadingLevel)) : undefined;\n const TitleTag = baseHeadingLevel ? `h${clampedLevel}` : 'h2'; // default to h2 if no base level is provided - this was the previous behavior\n const textLevel = baseHeadingLevel ? Math.min(6, Math.max(1, clampedLevel + 1)) : undefined; // promote text headings one level above title\n\n return (\n <Passage\n key={tab.id}\n id={this.tabPanelId(tab.id)}\n className={`tabpanel-${tab.id}`}\n {...(tabbed && { role: 'tabpanel', 'aria-labelledby': this.tabButtonId(tab.id) })}\n >\n {this.renderInstructions(tab.teacherInstructions, disabledTabs)}\n\n {tab.title && (\n <Purpose purpose=\"passage-title\">\n <TitleTag>\n <PassageTitle dangerouslySetInnerHTML={{ __html: this.parsedText(tab.title) }} />\n </TitleTag>\n </Purpose>\n )}\n\n {tab.subtitle && (\n <Purpose purpose=\"passage-subtitle\">\n <PassageSubtitle dangerouslySetInnerHTML={{ __html: this.parsedText(tab.subtitle) }} />\n </Purpose>\n )}\n\n {tab.author && (\n <Purpose purpose=\"passage-author\">\n <PassageAuthor className=\"author\" dangerouslySetInnerHTML={{ __html: this.parsedText(tab.author) }} />\n </Purpose>\n )}\n\n {tab.text && (\n <Purpose purpose=\"passage-text\">\n <div key={tab.id} className=\"text\" dangerouslySetInnerHTML={{ __html: sanitizeModelHtml(baseHeadingLevel ? transformDataHeadings(tab.text, textLevel) : tab.text) }} />\n </Purpose>\n )}\n </Passage>\n );\n }\n\n render() {\n const { model, tabs, disabledTabs } = this.props;\n const { activeTab, zoomCompensation, containerWidth } = this.state;\n\n if (!tabs?.length) {\n return;\n }\n\n const { extraCSSRules } = model || {};\n const selectedTab = (tabs || []).find((tab) => tab.id === activeTab);\n\n // cap each tab at 1/n of the passage container width so a single long\n // title can't push other tabs off-screen. Existing two-line wrap + ellipsis\n // on .passage-label still trims anything that doesn't fit.\n const tabMaxWidth = containerWidth > 0 ? containerWidth / tabs.length : null;\n // When per-tab horizontal space drops to NUMERIC_LABEL_MIN_WIDTH_PER_TAB or\n // less, titles become unreadably truncated; swap to \"Passage N\" so users\n // can still navigate. Container width is read once layout has settled\n // (>0), so initial render uses real labels.\n const useNumericLabels =\n containerWidth > 0 && containerWidth <= tabs.length * NUMERIC_LABEL_MIN_WIDTH_PER_TAB;\n\n return (\n <UiLayout extraCSSRules={extraCSSRules}>\n <PassagesContainer className=\"passages\" ref={this.containerRef}>\n {disabledTabs || tabs.length === 1 ? (\n tabs.map((tab) => this.renderTab(tab, disabledTabs, false))\n ) : (\n <>\n <Tabs\n sx={{\n // Below the breakpoint (e.g. WCAG 400% zoom, ~320px viewport)\n // the tabs are in normal flow and scroll with the passage text,\n // so they don't lock up space needed to display the passage.\n position: 'static',\n // Above the breakpoint there is adequate screen space, so the\n // tabs stay locked to the top of the panel while the passage\n // text scrolls beneath them.\n [`@media (min-width: ${STICKY_TABS_BREAKPOINT + 1}px)`]: {\n position: 'sticky',\n top: 0,\n zIndex: 1,\n },\n background: 'var(--pie-passage-header-background, rgba(255,255,255,0))',\n color: color.text(),\n fontFamily: 'Roboto, sans-serif',\n // Freeze the tabs' physical size at their 200%-zoom appearance\n // when browser zoom exceeds 200%. The factor is 1 at zoom <= 200%,\n // so behavior below that threshold is unchanged. Using `zoom`\n // (rather than transform: scale) shrinks the layout box itself,\n // so the reclaimed space flows to the passage content below.\n zoom: zoomCompensation,\n '& .MuiTabs-list': {\n /*\n * The strip behind the tabs. A host that has opted into\n * `--pie-passage-header-background` keeps its own colour on every\n * scheme -- Knowledge Checks' pale green-blue is deliberate and is not\n * a scheme's business to override. With no host colour the fallback has\n * to be a theme token rather than a white literal, or the strip stays\n * white over a dark passage body.\n */\n backgroundColor: `var(--pie-passage-header-background, ${color.backgroundDark()})`,\n borderBottom: `1px solid ${color.borderGray()}`,\n },\n '& .MuiTabs-indicator': {\n backgroundColor: color.white(),\n marginBottom: '-1px',\n },\n }}\n value={activeTab}\n onChange={this.handleChange}\n >\n {tabs.map((tab, index) => (\n <TabStyled\n key={tab.id}\n id={this.tabButtonId(tab.id)}\n className={`button-${tab.id}`}\n sx={tabMaxWidth ? { maxWidth: `${tabMaxWidth}px` } : undefined}\n label={\n <>\n <Purpose purpose=\"passage-label\">\n {useNumericLabels ? (\n <span className=\"passage-label\">{`Passage ${index + 1}`}</span>\n ) : (\n <span\n className=\"passage-label\"\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.label) }}\n />\n )}\n </Purpose>\n <Underline className=\"passage-label-underline\" />\n </>\n }\n value={tab.id}\n tabIndex={activeTab === tab.id ? 0 : -1}\n aria-controls={this.tabPanelId(tab.id)}\n aria-selected={activeTab === tab.id}\n onKeyDown={(event) => this.handleKeyDown(event, tab.id)}\n />\n ))}\n </Tabs>\n {selectedTab ? this.renderTab(selectedTab, disabledTabs) : null}\n </>\n )}\n </PassagesContainer>\n </UiLayout>\n );\n }\n}\n\nStimulusTabs.propTypes = {\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.number.isRequired,\n label: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string,\n author: PropTypes.string,\n text: PropTypes.string.isRequired,\n teacherInstructions: PropTypes.string,\n }).isRequired,\n ).isRequired,\n disabledTabs: PropTypes.bool,\n model: PropTypes.object,\n baseHeadingLevel: PropTypes.number,\n};\n\nexport default StimulusTabs;\n"],"mappings":";;;;;mCAUM,EAAE,kBAAe;AAEvB,SAAS,EAA6B,GAAY;CAChD,OACE,OAAO,KAAU,cAChB,OAAO,KAAU,cAAY,KAAkB,OAAO,EAAM,YAAa;AAE9E;AAEA,SAAS,EAAyB,GAAkB,GAAsB;CAUxE,OATI,CAAC,KACD,EAA6B,CAAW,IAAU,IAClD,EAA6B,EAAY,OAAO,IAAU,EAAY,UACtE,KAAe,EAA6B,EAAY,EAAY,IAC/D,EAAY,KAEjB,KAAe,EAA6B,EAAY,EAAY,EAAE,OAAO,IACxE,EAAY,EAAY,CAAC,UAE3B;AACT;AAGA,IAAM,IAAuB,GACvB,IAAuB,EAAqB,SAC5C,IACJ,KAAwB,OAAO,KAAyB,WACpD,IACA,GACA,IAAW,EAAyB,GAAgB,UAAU,KAAK,EAAyB,EAAS,UAAU,UAAU,GACzH,IAAU,EAAyB,GAAe,SAAS,KAAK,EAAyB,EAAS,SAAS,SAAS,GACpH,IAAgB,EAAyB,GAAqB,eAAe,KAAK,EAAyB,EAAS,eAAe,eAAe,GAClJ,IAAc,EAAyB,GAAmB,aAAa,KAAK,EAAyB,EAAS,aAAa,aAAa,GAoBxI,IAAgB,GAChB,IAAwB,IAOxB,IAAkC,KAElC,UAAgC;CACpC,IAAI,OAAO,SAAW,KAAa,OAAO;CAC1C,IAAM,IAAQ,OAAO,aAAa,OAAO;CAEzC,OAAO,KAAK,IAAI,GAAuB,KAAK,IAAI,GAAG,KADtC,OAAO,SAAS,CAAK,KAAK,IAAQ,IAAI,IAAQ,EACY,CAAC;AAC1E,GAEM,IAAyB,EAAO,KAAK,CAAC,CAAC;CAC3C,UAAU;CACV,iBAAiB,EAAM,WAAW;CAClC,OAAO,EAAM,KAAK;CAClB,yBAAyB,EACvB,gBAAgB,WAClB;CACA,sDA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kBAAC,GAAD,EAAW,WAAU,0BAA2B,CAAA,CAChD,EAAA,CAAA;MAEJ,OAAO,EAAI;MACX,UAAU,MAAc,EAAI,KAAK,IAAI;MACrC,iBAAe,KAAK,WAAW,EAAI,EAAE;MACrC,iBAAe,MAAc,EAAI;MACjC,YAAY,MAAU,KAAK,cAAc,GAAO,EAAI,EAAE;KACvD,GAxBM,EAAI,EAwBV,CACF;IACG,CAAA,GACL,IAAc,KAAK,UAAU,GAAa,CAAY,IAAI,IAC3D,EAAA,CAAA;GAEa,CAAA;EACX,CAAA;CAEd;AACF;AAEA,EAAa,YAAY;CACvB,MAAM,EAAA,QAAU,QACd,EAAA,QAAU,MAAM;EACd,IAAI,EAAA,QAAU,OAAO;EACrB,OAAO,EAAA,QAAU,OAAO;EACxB,OAAO,EAAA,QAAU,OAAO;EACxB,UAAU,EAAA,QAAU;EACpB,QAAQ,EAAA,QAAU;EAClB,MAAM,EAAA,QAAU,OAAO;EACvB,qBAAqB,EAAA,QAAU;CACjC,CAAC,CAAC,CAAC,UACL,CAAC,CAAC;CACF,cAAc,EAAA,QAAU;CACxB,OAAO,EAAA,QAAU;CACjB,kBAAkB,EAAA,QAAU;AAC9B"}
|
|
1
|
+
{"version":3,"file":"stimulus-tabs-D8i60aIU.js","names":[],"sources":["../../src/delivery/stimulus-tabs.tsx"],"sourcesContent":["// @ts-nocheck\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Tabs from '@mui/material/Tabs';\nimport Tab from '@mui/material/Tab';\nimport { styled } from '@mui/material/styles';\nimport { Collapsible as CollapsibleImport, color, createUniqueId, PreviewPrompt as PreviewPromptImport, Purpose as PurposeImport, UiLayout as UiLayoutImport, transformDataHeadings } from '@pie-lib/render-ui';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nimport { sanitizeModelHtml } from '@pie-element/shared-utils';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nconst Purpose = unwrapReactInteropSymbol(PurposeImport, 'Purpose') || unwrapReactInteropSymbol(renderUi.Purpose, 'Purpose');\nconst PreviewPrompt = unwrapReactInteropSymbol(PreviewPromptImport, 'PreviewPrompt') || unwrapReactInteropSymbol(renderUi.PreviewPrompt, 'PreviewPrompt');\nconst Collapsible = unwrapReactInteropSymbol(CollapsibleImport, 'Collapsible') || unwrapReactInteropSymbol(renderUi.Collapsible, 'Collapsible');\n// Must match the breakpoint Quiz Engine passes to the PIE section player for\n// switching from the side-by-side passage/question layout to the tabbed layout.\n// Below (and at) this width the passage tabs scroll with the passage content\n// instead of being locked to the top of the panel, so that they do not lock up\n// space needed for the passage text (WCAG 1.4.10 Reflow, 400% zoom / 320px).\nconst STICKY_TABS_BREAKPOINT = 840;\n\n/**\n * Zoom compensation for the passage selection tabs.\n *\n * The tabs scale naturally with browser zoom up to 200%. Beyond 200%,\n * we shrink their CSS size proportionally so their physical on-screen size\n * freezes at the 200% appearance, leaving more room for passage content\n * in high-zoom / small-window situations.\n * The factor is min(1, 2 / zoom): exactly 1 at zoom <= 200% (component\n * behavior unchanged), shrinking proportionally above that. A lower clamp\n * of 0.4 guards against inflated ratios (docked devtools, browser side\n * panels, window chrome) ever making the tabs unusably small.\n */\nconst MAX_TABS_ZOOM = 2;\nconst MIN_ZOOM_COMPENSATION = 0.4;\n\n// Per-tab horizontal-space floor in CSS pixels. When the passage container is\n// narrow enough that each tab would have at most this much room\n// (containerWidth <= tabs.length * NUMERIC_LABEL_MIN_WIDTH_PER_TAB), tab labels\n// fall back to \"Passage 1\", \"Passage 2\", ... so navigation stays usable instead\n// of being dominated by aggressively truncated titles.\nconst NUMERIC_LABEL_MIN_WIDTH_PER_TAB = 170;\n\nconst computeZoomCompensation = () => {\n if (typeof window === 'undefined') return 1;\n const ratio = window.outerWidth / window.innerWidth;\n const zoom = Number.isFinite(ratio) && ratio > 0 ? ratio : 1;\n return Math.max(MIN_ZOOM_COMPENSATION, Math.min(1, MAX_TABS_ZOOM / zoom));\n};\n\nconst PassagesContainer: any = styled('div')({\n flexGrow: 1,\n backgroundColor: color.background(),\n color: color.text(),\n '&:not(.MathJax) table': {\n borderCollapse: 'collapse',\n },\n '&:not(.MathJax) table td, &:not(.MathJax) table th': {\n padding: '.6em 1em',\n textAlign: 'left',\n },\n});\n\nconst Passage: any = styled('div')(({ theme }) => ({\n backgroundColor: color.background(),\n color: color.text(),\n padding: theme.spacing(2),\n '& blockquote': {\n background: '#f9f9f9',\n borderLeft: '5px solid #ccc',\n margin: '1.5em 10px',\n padding: '.5em 10px',\n },\n}));\n\nconst PassageTitle: any = styled('div')({\n fontSize: '1.75rem',\n});\n\nconst PassageSubtitle: any = styled('div')({\n fontSize: '1.5rem',\n});\n\nconst PassageAuthor: any = styled('div')({\n fontSize: '1.25rem',\n});\n\nconst TabStyled: any = styled(Tab)(({ theme }) => ({\n /*\n * The tab carries the colour of the panel it opens, which is what makes it read as a\n * tab rather than a button, and it has to be the themed panel colour: MUI's palette\n * does not follow `--pie-*`, so `common.white` here left the tab white on every color\n * scheme while the passage body beneath it went dark. The comment this replaces gated\n * the change on PD-2801, which is about OT's `color-contrast` class -- the mechanism\n * pie-theme superseded, and blocked since 2023.\n */\n background: color.background(),\n fontSize: 'inherit',\n fontFamily: 'Roboto, sans-serif',\n color: color.text(),\n borderRadius: `${theme.spacing(2)} ${theme.spacing(2)} 0 0`,\n /*\n * `--pie-border-gray` is stepped to the 3:1 non-text minimum in every scheme. The\n * literal it replaces measured about 1.2:1 against the dark schemes' surfaces, so the\n * tab outline -- the only thing separating an unselected tab from the strip -- was\n * invisible there.\n */\n border: `1px solid ${color.borderGray()}`,\n borderBottomWidth: 0,\n minHeight: '56px',\n padding: '8px 10px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n margin: `0 ${theme.spacing(1)}`,\n textTransform: 'none',\n\n '.passage-label': {\n display: '-webkit-box',\n WebkitLineClamp: 2,\n WebkitBoxOrient: 'vertical',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'normal',\n margin: 'auto 0',\n opacity: 0.7,\n },\n\n '&.Mui-selected': {\n color: color.text(),\n '.passage-label': {\n opacity: 1,\n },\n '.passage-label-underline': {\n backgroundColor: color.tertiary(),\n },\n },\n\n '&:hover': {\n '.passage-label-underline': {\n backgroundColor: color.tertiaryLight(),\n },\n },\n\n '& .MuiTouchRipple-root': {\n opacity: 0.7,\n },\n}));\n\n/*\n * The selection indicator, one per tab. Unselected it has to disappear into the tab, so it\n * paints the tab's own background rather than a fixed white; selected it becomes\n * `--pie-tertiary`, which every scheme sets.\n */\nconst Underline: any = styled('div')(() => ({\n height: '2px',\n width: '100%',\n marginTop: '6px',\n background: color.background(),\n}));\n\nclass StimulusTabs extends React.Component {\n state = {\n activeTab: 0,\n zoomCompensation: computeZoomCompensation(),\n containerWidth: 0,\n };\n\n containerRef = React.createRef();\n\n // Tab ids are model indexes, so DOM ids take a per-instance prefix and each passage's\n // aria-controls / aria-labelledby pairs resolve inside that passage. `button-N` and\n // `tabpanel-N` stay as class hooks.\n idPrefix = createUniqueId('passage');\n\n tabButtonId: any = (tabId) => `${this.idPrefix}-button-${tabId}`;\n\n tabPanelId: any = (tabId) => `${this.idPrefix}-tabpanel-${tabId}`;\n\n componentDidMount() {\n if (typeof window === 'undefined') return;\n window.addEventListener('resize', this.updateZoomCompensation);\n\n if (this.containerRef.current && typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(this.updateContainerWidth);\n this.resizeObserver.observe(this.containerRef.current);\n }\n\n this.updateContainerWidth();\n }\n\n componentWillUnmount() {\n if (typeof window === 'undefined') return;\n window.removeEventListener('resize', this.updateZoomCompensation);\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n updateZoomCompensation: any = () => {\n this.setState({ zoomCompensation: computeZoomCompensation() });\n };\n\n updateContainerWidth: any = () => {\n const node = this.containerRef.current;\n if (!node) return;\n const width = node.clientWidth;\n if (width !== this.state.containerWidth) {\n this.setState({ containerWidth: width });\n }\n };\n\n handleChange: any = (event, activeTab) => {\n this.setState(() => ({ activeTab }));\n\n setTimeout(() => {\n const tabChangeEvent = new CustomEvent('pie-ui-passage-tabChanged', {\n detail: { tab: activeTab },\n });\n\n window.dispatchEvent(tabChangeEvent);\n });\n };\n\n handleKeyDown: any = (event, currentTabId) => {\n const { key } = event;\n const { tabs } = this.props;\n\n let newTabIndex = -1;\n const currentIndex = tabs.findIndex((tab) => tab.id === currentTabId);\n\n switch (key) {\n case 'ArrowRight':\n // Move to the next tab\n newTabIndex = (currentIndex + 1) % tabs.length;\n break;\n case 'ArrowLeft':\n // Move to the previous tab\n newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n break;\n // Commented out ArrowDown and ArrowUp for future vertical tab navigation\n // case 'ArrowDown':\n // // Move to the next tab (for vertical alignment)\n // newTabIndex = (currentIndex + 1) % tabs.length;\n // break;\n // case 'ArrowUp':\n // // Move to the previous tab (for vertical alignment)\n // newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n // break;\n case 'Home':\n // Move to the first tab\n newTabIndex = 0;\n break;\n case 'End':\n // Move to the last tab\n newTabIndex = tabs.length - 1;\n break;\n case 'Enter':\n case ' ':\n // Activate the current tab\n newTabIndex = currentIndex;\n break;\n default:\n break;\n }\n\n if (newTabIndex !== -1) {\n event.preventDefault();\n event.stopPropagation();\n this.handleChange(event, tabs[newTabIndex].id);\n this.containerRef.current?.querySelector(`[id=\"${this.tabButtonId(tabs[newTabIndex].id)}\"]`)?.focus();\n }\n };\n\n parsedText: any = (text = '') => {\n // fix imported audio content for Safari PD-1391\n const div = document.createElement('div');\n div.innerHTML = sanitizeModelHtml(text.replace(/(<br\\/>\\n)/g, '<br/>'));\n\n const audio = div.querySelector('audio');\n\n if (audio) {\n const source = document.createElement('source');\n\n source.setAttribute('type', 'audio/mp3');\n source.setAttribute('src', audio.getAttribute('src'));\n\n audio.removeAttribute('src');\n audio.appendChild(source);\n }\n\n return div.innerHTML;\n };\n\n renderInstructions(teacherInstructions, disabledTabs = false) {\n if (!teacherInstructions) {\n return;\n }\n\n const teacherInstructionsDiv = (\n <PreviewPrompt\n tagName=\"div\"\n className=\"prompt\"\n defaultClassName=\"teacher-instructions\"\n prompt={teacherInstructions}\n />\n );\n\n if (disabledTabs) {\n return teacherInstructionsDiv;\n }\n\n return (\n <Collapsible\n labels={{\n hidden: translator.t('common:showTeacherInstructions', { lng: this.props.model?.language }),\n visible: translator.t('common:hideTeacherInstructions', { lng: this.props.model?.language }),\n }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n );\n }\n\n // Outside a tab list (one passage, or print) no tab names the panel, so it renders without the\n // tabpanel role and its title heading carries the structure.\n renderTab(tab, disabledTabs, tabbed = true) {\n const { baseHeadingLevel } = this.props;\n const clampedLevel = baseHeadingLevel ? Math.min(6, Math.max(1, baseHeadingLevel)) : undefined;\n const TitleTag = baseHeadingLevel ? `h${clampedLevel}` : 'h2'; // default to h2 if no base level is provided - this was the previous behavior\n const textLevel = baseHeadingLevel ? Math.min(6, Math.max(1, clampedLevel + 1)) : undefined; // promote text headings one level above title\n\n return (\n <Passage\n key={tab.id}\n id={this.tabPanelId(tab.id)}\n className={`tabpanel-${tab.id}`}\n {...(tabbed && { role: 'tabpanel', 'aria-labelledby': this.tabButtonId(tab.id) })}\n >\n {this.renderInstructions(tab.teacherInstructions, disabledTabs)}\n\n {tab.title && (\n <Purpose purpose=\"passage-title\">\n <TitleTag>\n <PassageTitle dangerouslySetInnerHTML={{ __html: this.parsedText(tab.title) }} />\n </TitleTag>\n </Purpose>\n )}\n\n {tab.subtitle && (\n <Purpose purpose=\"passage-subtitle\">\n <PassageSubtitle dangerouslySetInnerHTML={{ __html: this.parsedText(tab.subtitle) }} />\n </Purpose>\n )}\n\n {tab.author && (\n <Purpose purpose=\"passage-author\">\n <PassageAuthor className=\"author\" dangerouslySetInnerHTML={{ __html: this.parsedText(tab.author) }} />\n </Purpose>\n )}\n\n {tab.text && (\n <Purpose purpose=\"passage-text\">\n <div key={tab.id} className=\"text\" dangerouslySetInnerHTML={{ __html: sanitizeModelHtml(baseHeadingLevel ? transformDataHeadings(tab.text, textLevel) : tab.text) }} />\n </Purpose>\n )}\n </Passage>\n );\n }\n\n render() {\n const { model, tabs, disabledTabs } = this.props;\n const { activeTab, zoomCompensation, containerWidth } = this.state;\n\n if (!tabs?.length) {\n return;\n }\n\n const { extraCSSRules } = model || {};\n const selectedTab = (tabs || []).find((tab) => tab.id === activeTab);\n\n // cap each tab at 1/n of the passage container width so a single long\n // title can't push other tabs off-screen. Existing two-line wrap + ellipsis\n // on .passage-label still trims anything that doesn't fit.\n const tabMaxWidth = containerWidth > 0 ? containerWidth / tabs.length : null;\n // When per-tab horizontal space drops to NUMERIC_LABEL_MIN_WIDTH_PER_TAB or\n // less, titles become unreadably truncated; swap to \"Passage N\" so users\n // can still navigate. Container width is read once layout has settled\n // (>0), so initial render uses real labels.\n const useNumericLabels =\n containerWidth > 0 && containerWidth <= tabs.length * NUMERIC_LABEL_MIN_WIDTH_PER_TAB;\n\n return (\n <UiLayout extraCSSRules={extraCSSRules}>\n <PassagesContainer className=\"passages\" ref={this.containerRef}>\n {disabledTabs || tabs.length === 1 ? (\n tabs.map((tab) => this.renderTab(tab, disabledTabs, false))\n ) : (\n <>\n <Tabs\n sx={{\n // Below the breakpoint (e.g. WCAG 400% zoom, ~320px viewport)\n // the tabs are in normal flow and scroll with the passage text,\n // so they don't lock up space needed to display the passage.\n position: 'static',\n // Above the breakpoint there is adequate screen space, so the\n // tabs stay locked to the top of the panel while the passage\n // text scrolls beneath them.\n [`@media (min-width: ${STICKY_TABS_BREAKPOINT + 1}px)`]: {\n position: 'sticky',\n top: 0,\n zIndex: 1,\n },\n background: 'var(--pie-passage-header-background, rgba(255,255,255,0))',\n color: color.text(),\n fontFamily: 'Roboto, sans-serif',\n // Freeze the tabs' physical size at their 200%-zoom appearance\n // when browser zoom exceeds 200%. The factor is 1 at zoom <= 200%,\n // so behavior below that threshold is unchanged. Using `zoom`\n // (rather than transform: scale) shrinks the layout box itself,\n // so the reclaimed space flows to the passage content below.\n zoom: zoomCompensation,\n '& .MuiTabs-list': {\n /*\n * The strip behind the tabs. A host that has opted into\n * `--pie-passage-header-background` keeps its own colour on every\n * scheme -- Knowledge Checks' pale green-blue is deliberate and is not\n * a scheme's business to override. With no host colour the fallback has\n * to be a theme token rather than a white literal, or the strip stays\n * white over a dark passage body.\n */\n backgroundColor: `var(--pie-passage-header-background, ${color.backgroundDark()})`,\n borderBottom: `1px solid ${color.borderGray()}`,\n },\n '& .MuiTabs-indicator': {\n backgroundColor: color.white(),\n marginBottom: '-1px',\n },\n }}\n value={activeTab}\n onChange={this.handleChange}\n >\n {tabs.map((tab, index) => (\n <TabStyled\n key={tab.id}\n id={this.tabButtonId(tab.id)}\n className={`button-${tab.id}`}\n sx={tabMaxWidth ? { maxWidth: `${tabMaxWidth}px` } : undefined}\n label={\n <>\n <Purpose purpose=\"passage-label\">\n {useNumericLabels ? (\n <span className=\"passage-label\">{`Passage ${index + 1}`}</span>\n ) : (\n <span\n className=\"passage-label\"\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.label) }}\n />\n )}\n </Purpose>\n <Underline className=\"passage-label-underline\" />\n </>\n }\n value={tab.id}\n tabIndex={activeTab === tab.id ? 0 : -1}\n aria-controls={this.tabPanelId(tab.id)}\n aria-selected={activeTab === tab.id}\n onKeyDown={(event) => this.handleKeyDown(event, tab.id)}\n />\n ))}\n </Tabs>\n {selectedTab ? this.renderTab(selectedTab, disabledTabs) : null}\n </>\n )}\n </PassagesContainer>\n </UiLayout>\n );\n }\n}\n\nStimulusTabs.propTypes = {\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.number.isRequired,\n label: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string,\n author: PropTypes.string,\n text: PropTypes.string.isRequired,\n teacherInstructions: PropTypes.string,\n }).isRequired,\n ).isRequired,\n disabledTabs: PropTypes.bool,\n model: PropTypes.object,\n baseHeadingLevel: PropTypes.number,\n};\n\nexport default StimulusTabs;\n"],"mappings":";;;;;mCAUM,EAAE,kBAAe;AAEvB,SAAS,EAA6B,GAAY;CAChD,OACE,OAAO,KAAU,cAChB,OAAO,KAAU,cAAY,KAAkB,OAAO,EAAM,YAAa;AAE9E;AAEA,SAAS,EAAyB,GAAkB,GAAsB;CAUxE,OATI,CAAC,KACD,EAA6B,CAAW,IAAU,IAClD,EAA6B,EAAY,OAAO,IAAU,EAAY,UACtE,KAAe,EAA6B,EAAY,EAAY,IAC/D,EAAY,KAEjB,KAAe,EAA6B,EAAY,EAAY,EAAE,OAAO,IACxE,EAAY,EAAY,CAAC,UAE3B;AACT;AAGA,IAAM,IAAuB,GACvB,IAAuB,EAAqB,SAC5C,IACJ,KAAwB,OAAO,KAAyB,WACpD,IACA,GACA,IAAW,EAAyB,GAAgB,UAAU,KAAK,EAAyB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AC,CAAC,CAAC,UACL,CAAC,CAAC;CACF,cAAc,EAAA,QAAU;CACxB,OAAO,EAAA,QAAU;CACjB,kBAAkB,EAAA,QAAU;AAC9B"}
|
package/dist/index.iife.js
CHANGED
|
@@ -33,7 +33,7 @@ this.PassageElement=(function(){var e=Object.create,t=Object.defineProperty,n=Ob
|
|
|
33
33
|
color: ${Je} !important;
|
|
34
34
|
background-color: ${Qe} !important;
|
|
35
35
|
}
|
|
36
|
-
`;function et(e=document){if(e.getElementById(`PIE-MJX-explorer-styles`))return;let t=e.createElement(`style`);t.id=qe,t.textContent=$e,e.head.appendChild(t)}var tt=/[-]/g,nt={"+":`positive`,"-":`negative`,"−":`negative`,"±":`plus or minus`,"∓":`minus or plus`},rt={"(":`open parenthesis`,"[":`open bracket`,"{":`open brace`,"⟨":`open angle bracket`,"⌊":`open floor`,"⌈":`open ceiling`},it={")":`close parenthesis`,"]":`close bracket`,"}":`close brace`,"⟩":`close angle bracket`,"⌋":`close floor`,"⌉":`close ceiling`},at={"!":`factorial`,"%":`percent`,"°":`degrees`,"′":`prime`,"″":`double prime`},ot={"+":`plus`,"-":`minus`,"−":`minus`,"±":`plus or minus`,"∓":`minus or plus`,"×":`times`,"⋅":`times`,"·":`times`,"*":`times`,"÷":`divided by`,"/":`divided by`,"=":`equals`,"≠":`does not equal`,"<":`is less than`,">":`is greater than`,"≤":`is less than or equal to`,"≥":`is greater than or equal to`,"≈":`is approximately equal to`,"≡":`is equivalent to`,"∝":`is proportional to`,"∈":`is an element of`,"∉":`is not an element of`,"⊂":`is a subset of`,"⊆":`is a subset of or equal to`,"∪":`union`,"∩":`intersection`,"→":`right arrow`,"←":`left arrow`,"⇒":`implies`,"⇔":`if and only if`,"∑":`sum`,"∏":`product`,"∫":`integral`,"∞":`infinity`,"∠":`angle`,"⊥":`is perpendicular to`,"∥":`is parallel to`,"∴":`therefore`,",":`comma`,";":`semicolon`,":":`colon`,"|":`vertical bar`,"‖":`double vertical bar`,...rt,...it,...at},st=new Set([`|`,`‖`]),ct=new Set([`∑`,`∏`,`∫`,`∪`,`∩`]),lt={α:`alpha`,β:`beta`,γ:`gamma`,δ:`delta`,ε:`epsilon`,θ:`theta`,λ:`lambda`,μ:`mu`,π:`pi`,ρ:`rho`,σ:`sigma`,τ:`tau`,φ:`phi`,ω:`omega`,Δ:`capital delta`,Σ:`capital sigma`,Ω:`capital omega`,"∞":`infinity`,sin:`sine`,cos:`cosine`,tan:`tangent`,sec:`secant`,csc:`cosecant`,cot:`cotangent`,ln:`natural log`,lim:`limit`},ut={"¯":`bar`,"‾":`bar`,"―":`bar`,"^":`hat`,ˆ:`hat`,"~":`tilde`,"˜":`tilde`,"→":`vector`,"⃗":`vector`,"˙":`dot`},dt=e=>(e.textContent??``).replace(tt,``).replace(/\s+/g,` `).trim(),ft=e=>e.replace(/\s+/g,` `).trim(),pt=e=>[...e.children];function mt(e){return!e||[`mn`,`mi`,`mtext`,`mo`].includes(e.localName)?!0:[`mrow`,`mstyle`].includes(e.localName)&&e.children.length===1?mt(e.children[0]):!1}function ht(e){let t=e?dt(e):``;return/^\d{1,3}$/.test(t)?Number(t):void 0}function gt(e){return`${e}${e%100>=11&&e%100<=13?`th`:{1:`st`,2:`nd`,3:`rd`}[e%10]??`th`}`}function _t(e){return lt[e]??e}function vt(e){return ot[e]??e}function yt(e){let t=[],n=!1;for(let r of e){if(r.localName!==`mo`){t.push(Ot(r)),n=!0;continue}let e=dt(r);e&&(!n&&nt[e]?t.push(nt[e]):e in at?t.push(at[e]):(t.push(vt(e)),n=e in it||st.has(e)&&n))}return t.filter(Boolean).join(` `)}function bt(e){let[t,...n]=e,r=n[n.length-1],i=e=>e?.localName===`mo`&&[`|`,`‖`].includes(dt(e)),a=n.slice(0,-1);if(a.length&&i(t)&&i(r)&&dt(t)===dt(r)&&!a.some(i)){let e=ft(yt(a));return dt(t)===`|`?`absolute value of ${e} end absolute value`:`norm of ${e} end norm`}return yt(e)}function xt(e,t){let n=e?Ot(e):``,r=t?Ot(t):``;return mt(e)&&mt(t)?`${n} over ${r}`:`the fraction with numerator ${n} and denominator ${r}`}function St(e,t,n){return n?`${t} of ${e}`:`${t} of ${e} end root`}function Ct(e,t){let n=t?dt(t):``;if(t&&mt(t)){if(n===`2`)return`${e} squared`;if(n===`3`)return`${e} cubed`;if(n in at)return`${e} ${at[n]}`}let r=t?Ot(t):``;return mt(t)?`${e} to the power of ${r}`:`${e} to the power of ${r} end power`}function wt(e,t){let n=t?Ot(t):``;return mt(t)?`${e} sub ${n}`:`${e} sub ${n} end sub`}function Tt(e,t,n){let r=dt(e);if(r===`lim`)return`limit as ${t?Ot(t):``} of`;if(!ct.has(r))return;let i=t?`from ${Ot(t)}`:``,a=n?`to ${Ot(n)}`:``;return`${vt(r)} ${i} ${a} of`}function Et(e){let t=pt(e).filter(e=>[`mtr`,`mlabeledtr`].includes(e.localName)),n=t.map(e=>pt(e).filter(e=>e.localName===`mtd`)),r=Math.max(0,...n.map(e=>e.length)),i=n.map((e,t)=>`row ${t+1}: ${e.map(e=>ft(yt(pt(e)))).join(`, `)}`);return`table with ${t.length} ${t.length===1?`row`:`rows`} and ${r} ${r===1?`column`:`columns`}. ${i.join(`. `)}`}function Dt(e){let t=e.getAttribute(`open`)??`(`,n=e.getAttribute(`close`)??`)`,r=(e.getAttribute(`separators`)??`,`).replace(/\s+/g,``).split(``),i=pt(e).map((e,t,n)=>t<n.length-1?`${Ot(e)} ${vt(r[Math.min(t,r.length-1)]??`,`)}`:Ot(e));return[vt(t),...i,vt(n)].filter(Boolean).join(` `)}function Ot(e){let t=pt(e);switch(e.localName){case`mi`:return _t(dt(e));case`mn`:case`mtext`:case`ms`:return dt(e);case`mo`:return vt(dt(e));case`mspace`:case`mphantom`:case`annotation`:case`annotation-xml`:return``;case`semantics`:return t[0]?Ot(t[0]):``;case`mfrac`:return xt(t[0],t[1]);case`msqrt`:return St(ft(yt(t)),`square root`,t.length===1&&mt(t[0]));case`mroot`:{let e=ht(t[1]),n=e===2?`square root`:e===3?`cube root`:e?`${gt(e)} root`:`root with index ${t[1]?Ot(t[1]):``}`;return St(t[0]?Ot(t[0]):``,n,mt(t[0]))}case`msup`:return Ct(t[0]?Ot(t[0]):``,t[1]);case`msub`:return wt(t[0]?Ot(t[0]):``,t[1]);case`msubsup`:return(t[0]?Tt(t[0],t[1],t[2]):void 0)||Ct(wt(t[0]?Ot(t[0]):``,t[1]),t[2]);case`munder`:case`mover`:case`munderover`:{let[n,r,i]=t,a=e.localName===`mover`?void 0:r,o=e.localName===`munder`?void 0:e.localName===`mover`?r:i,s=n?Tt(n,a,o):void 0;if(s)return s;let c=n?Ot(n):``,l=e.localName===`mover`&&r?ut[dt(r)]:void 0;return l?l===`vector`?`vector ${c}`:`${c} ${l}`:[c,a?`with ${Ot(a)} below`:``,o?`with ${Ot(o)} above`:``].filter(Boolean).join(` `)}case`mfenced`:return Dt(e);case`mtable`:return Et(e);case`mrow`:case`math`:return bt(t);default:return t.length?yt(t):dt(e)}}function kt(e){return ft(Ot(e))}var At=[`a[href]`,`button`,`label`,`summary`,...[`button`,`checkbox`,`combobox`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`switch`,`tab`,`treeitem`].map(e=>`[role="${e}"]`)].join(`, `);function jt(e){if(e.hasAttribute(`aria-label`)||!e.closest(At))return;let t=e.querySelector(`math`),n=t?kt(t):``;n&&e.setAttribute(`aria-label`,n)}function Mt(e){for(let t of e.querySelectorAll(`mjx-container`))jt(t)}var Nt=Symbol.for(`@pie-element/shared-math-rendering-mathjax/speech-worker-failed`);function Pt(){let e=globalThis;e[Nt]||(e[Nt]=!0,console.warn(`[math-rendering] MathJax's speech worker did not start, so speech, braille and the explorer are off. A content security policy must allow blob: workers, and scripts and fetches from the asset root. See ${f}`))}function Ft(e){let t=e.webworker;if(!t||t.ready)return;e.options??={};let n=e.options;n.enableSpeech=!1,n.enableBraille=!1,n.speechError=()=>{},t.Post=()=>Promise.reject(Error(`The speech worker did not start`)),t.Terminate(),Pt()}function It(e){let t=e?.adaptor,n=t?.createWorker;!e||!t||!n||(t.createWorker=async(r,i)=>{let a=await n.call(t,r,i);return a.addEventListener(`error`,()=>Ft(e),{once:!0}),a})}`${h}`;var Lt={parallelogram:`\\lower.2em{\\Huge\\unicode{x25B1}}`,overarc:`\\overparen`,napprox:`\\not\\approx`,longdiv:`\\enclose{longdiv}`,abs:[`\\left|#1\\right|`,1],perpendicular:`\\perp`,divide:`\\div`},Rt=`[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)`,zt=/\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/,Bt=/\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/,Vt=/\\embed\{newLine\}\[\]/g,Ht=[[`$$`,`$$`],[`$`,`$`],[`\\[`,`\\]`],[`\\(`,`\\)`]],Ut=Symbol.for(`@pie-element/shared-math-rendering-mathjax/loading`),Wt=`MJX-CHTML-styles`,Gt=`PIE-MJX-SVG-styles`,Kt=`PIE-MathJax-Menu-Settings`,qt={'mjx-container[overflow="linebreak"][display]':{overflow:`auto clip`,"min-width":`initial !important`}},Jt=200,Yt=201,Xt=202;function Zt(e){let t=[...e.matches(`mjx-container`)?[e]:[],...e.querySelectorAll(`mjx-container`)];for(let e of t)for(let t of[e,...e.querySelectorAll(`[data-latex],[data-latex-item]`)])t.removeAttribute(`data-latex`),t.removeAttribute(`data-latex-item`)}function Qt(e){for(let[t,n]of Ht)if(e.startsWith(t)&&e.endsWith(n))return e.substring(t.length,e.length-n.length);return e}function $t(e){return Qt(e.includes(`\\displaystyle`)?e.replace(`\\displaystyle`,``).trim():e)}var en=`mathjax_ignore`,tn=`mathjax_process`;function nn(e,t){let n=e.closest(`.${en}, .${tn}`);return n!==null&&t.contains(n)&&!n.classList.contains(tn)}function rn(e){for(let t of e.querySelectorAll(`[data-latex]`)){if(t.dataset.mathHandled||t.closest(`mjx-container`)||nn(t,e))continue;let n=t.textContent;n&&(t.textContent=`\\(${$t(n)}\\)`.replace(Vt,`\\newline `),t.dataset.mathHandled=`true`)}}function an(e){for(let t of e.querySelectorAll(`math`))t.closest(`mjx-container`)||t.setAttribute(`displaystyle`,`true`)}function on(e,t){for(let t of e.querySelectorAll(`math`))if(!t.closest(`mjx-assistive-mml`))return!0;return(t?Bt:zt).test(e.textContent??``)}function sn(e){return new Promise((t,n)=>{let{useSingleDollar:r=!1,accessibility:i=!0,loadFonts:a=!0,srcUrl:o}=e,s=C(e,{}.url),c=y(),l={loader:{load:i?[`a11y/assistive-mml`]:[],failed:e=>n(e),"output/svg":{ready:e=>{let t=N();return cn(t)&&ln(t),e}}},startup:{typeset:!1,ready:()=>{let e=N(),r=e?.startup,i=cn(e);i&&(ln(e),un(e,s.speechLocales),w(e?._?.a11y?.sre_ts?.locales,s.speechLocales)),r?.defaultReady?.(),i&&(dn(r?.document),fn(r?.document),r?.document?.addStyles?.(qt),It(r?.document)),Promise.resolve(r?.promise).then(()=>t(),n)}},tex:{macros:{...Lt}},output:{displayOverflow:`linebreak`},options:{enableMenu:i,menuOptions:{settings:{assistiveMml:i,enrich:!1,inTabOrder:c}},a11y:{inTabOrder:c}}};r&&l.tex&&(console.warn(Rt),l.tex.inlineMath=[[`$`,`$`],[`\\(`,`\\)`]],l.tex.processEscapes=!0),a||(l.chtml={fontURL:``});let u=T(s.speechLocales);u&&l.options&&(l.options.sre={locale:u}),F(l,{...s,srcUrl:o}).then(e=>{e||t()},n)})}function cn(e){return!!e?.version?.startsWith(`4.`)}function ln(e){let t=e?._?.output,n=t?.chtml_ts?.CHTML;n&&(n.STYLESHEETID=re);let r=t?.svg_ts?.SVG;r&&(r.STYLESHEETID=Gt)}function un(e,t){let n=e?._?.ui?.menu?.Menu?.Menu;if(n){n.MENU_STORAGE=Kt;try{let e=localStorage.getItem(Kt);if(!e)return;let{assistiveMml:n,locale:r,...i}=JSON.parse(e),a=r===void 0||!t||t.has(r);if(n===void 0&&a)return;a&&r!==void 0&&(i.locale=r),Object.keys(i).length?localStorage.setItem(Kt,JSON.stringify(i)):localStorage.removeItem(Kt)}catch{}}}function dn(e){if(!e)return;let t=new WeakSet,n=e=>{let n=e.typesetRoot;!n||t.has(n)||(Zt(n),t.add(n))};e.addRenderAction?.(`pie-strip-latex`,Yt,e=>{for(let t of e.math??[])n(t);return!1},e=>{let t=e.typesetRoot;return t&&Zt(t),!1});let r=e.outputJax?.chtmlStyles;r?.id===Wt&&(r.id=re),hn()}function fn(e){let t=e=>{e.typesetRoot&&jt(e.typesetRoot)};e?.addRenderAction?.(`pie-name-math`,Xt,e=>{for(let n of e.math??[])t(n);return!1},e=>(t(e),!1))}function pn(e){return e instanceof HTMLStyleElement&&I.includes(e.id)}function mn(e){te(`foreign-output-stylesheet`,`another MathJax added <style id="${e.id}"> to <head>`)}function hn(){let e=document.head,t=[...e.children].find(pn);if(t){mn(t);return}let n=new MutationObserver(e=>{for(let t of e){let e=[...t.addedNodes].find(pn);if(e){mn(e),n.disconnect();return}}});n.observe(e,{childList:!0})}function gn(e){let t=e?.math;if(!t?.remove)return;let n=[...t].filter(e=>(e.state?.()??0)>=Jt&&e.typesetRoot?.isConnected===!1);if(n.length!==0){for(let e of[...n].reverse())e.clear?.();t.remove(...n)}}function _n(e){return new Promise((t,n)=>{let r=e.startup??{};e.startup=r;let i=r.ready;r.ready=()=>{let e=N()?.startup;i?i.call(r):e?.defaultReady?.(),Promise.resolve(e?.promise).then(()=>t(),n)}})}function vn(e){let t=N();return t?t.version?t.startup?.promise?Promise.resolve(t.startup.promise).then(()=>void 0):Promise.resolve():_n(t):sn(e)}function yn(e){return vn(e).then(()=>{let e=N();e&&typeof e.typesetPromise!=`function`&&console.warn(`[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.`)})}function bn(e){let t=ne,n=t[Ut];return n||(n=yn(e),t[Ut]=n),n}function xn(e={}){let t=e.useSingleDollar??!1;return async n=>{if(typeof window>`u`)return;let r=ie();r&&te(`mathjax-3-global`,`window.MathJax is MathJax ${r}`),rn(n),ce(n),an(n),Ke(n);let i=bn(e);if(!on(n,t)){i.catch(()=>{});return}await i;let a=N();if(await a?.startup?.promise,typeof a?.typesetPromise==`function`){et(),gn(a.startup?.document);try{await a.typesetPromise([n])}catch(e){throw a.typesetClear?.([n]),e}Zt(n),Mt(n)}}}var Sn=`@pie-lib/math-rendering`,Cn=`@pie-lib/math-rendering@2`,wn=`pie-print`,Tn=50,En=1e4,Dn=null;function On(){return!!window[Cn]?.opts?.useSingleDollar}function kn(){return Dn||=xn({useSingleDollar:On()}),Dn}function An(){if(typeof window>`u`)return null;let e=window[Sn];return typeof e?.renderMath==`function`&&e.renderMath!==Pn?e:null}function jn(e){let t=e;for(;t;){if(t instanceof Element&&t.localName===wn)return t;t=t instanceof ShadowRoot?t.host:t.parentNode}return null}function Mn(){let e=window.renderMath;return typeof e==`function`?e:null}async function Nn(e){let t=jn(e);if(!t)return null;let n=Mn();if(n||t.mathRenderingModuleUrlImported!==!0)return n;let r=Date.now()+En;for(;Date.now()<r;){await new Promise(e=>setTimeout(e,Tn));let e=Mn();if(e)return e}return null}var Pn=async e=>{if(typeof window>`u`)return;let t=typeof e==`string`,n;t?(n=document.createElement(`div`),n.innerHTML=e):n=e||document.body;let r=An(),i=r||t?null:await Nn(n);return r?(await r.renderMath?.(n),Mt(n)):i&&i!==Pn?(await i(n),Mt(n)):await kn()(n),t?n.innerHTML:void 0},Fn=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+ee(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+ee(s,l);c+=A(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+ee(s,l++),c+=A(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function j(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M={current:null},N={transition:null},P={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:N,ReactCurrentOwner:C};function F(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P,e.act=F,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}},e.unstable_act=F,e.useCallback=function(e,t){return M.current.useCallback(e,t)},e.useContext=function(e){return M.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return M.current.useDeferredValue(e)},e.useEffect=function(e,t){return M.current.useEffect(e,t)},e.useId=function(){return M.current.useId()},e.useImperativeHandle=function(e,t,n){return M.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return M.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return M.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return M.current.useMemo(e,t)},e.useReducer=function(e,t,n){return M.current.useReducer(e,t,n)},e.useRef=function(e){return M.current.useRef(e)},e.useState=function(e){return M.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return M.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return M.current.useTransition()},e.version=`18.3.1`})),In=o(((e,t)=>{t.exports=Fn()})),Ln=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,j(x);else{var t=n(l);t!==null&&te(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&te(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,A=ee.port2;ee.port1.onmessage=O,k=function(){A.postMessage(null)}}else k=function(){g(O,0)};function j(e){C=e,S||(S=!0,k())}function te(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,j(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,te(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,j(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Rn=o(((e,t)=>{t.exports=Ln()})),zn=o((e=>{var t=In(),n=Rn();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function p(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function m(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function h(e,t,n,r){if(t==null||m(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var _={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){_[e]=new g(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];_[t]=new g(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){_[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){_[e]=new g(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){_[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){_[e]=new g(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){_[e]=new g(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){_[e]=new g(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){_[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new g(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,r){var i=_.hasOwnProperty(t)?_[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(h(t,n,i,r)&&(n=null),r||i===null?p(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for(`react.element`),C=Symbol.for(`react.portal`),w=Symbol.for(`react.fragment`),T=Symbol.for(`react.strict_mode`),E=Symbol.for(`react.profiler`),D=Symbol.for(`react.provider`),O=Symbol.for(`react.context`),k=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),A=Symbol.for(`react.suspense_list`),j=Symbol.for(`react.memo`),te=Symbol.for(`react.lazy`),M=Symbol.for(`react.offscreen`),N=Symbol.iterator;function P(e){return typeof e!=`object`||!e?null:(e=N&&e[N]||e[`@@iterator`],typeof e==`function`?e:null)}var F=Object.assign,ne;function re(e){if(ne===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ne=t&&t[1]||``}return`
|
|
36
|
+
`;function et(e=document){if(e.getElementById(`PIE-MJX-explorer-styles`))return;let t=e.createElement(`style`);t.id=qe,t.textContent=$e,e.head.appendChild(t)}var tt=/[-]/g,nt={"+":`positive`,"-":`negative`,"−":`negative`,"±":`plus or minus`,"∓":`minus or plus`},rt={"(":`open parenthesis`,"[":`open bracket`,"{":`open brace`,"⟨":`open angle bracket`,"⌊":`open floor`,"⌈":`open ceiling`},it={")":`close parenthesis`,"]":`close bracket`,"}":`close brace`,"⟩":`close angle bracket`,"⌋":`close floor`,"⌉":`close ceiling`},at={"!":`factorial`,"%":`percent`,"°":`degrees`,"′":`prime`,"″":`double prime`},ot={"+":`plus`,"-":`minus`,"−":`minus`,"±":`plus or minus`,"∓":`minus or plus`,"×":`times`,"⋅":`times`,"·":`times`,"*":`times`,"÷":`divided by`,"/":`divided by`,"=":`equals`,"≠":`does not equal`,"<":`is less than`,">":`is greater than`,"≤":`is less than or equal to`,"≥":`is greater than or equal to`,"≈":`is approximately equal to`,"≡":`is equivalent to`,"∝":`is proportional to`,"∈":`is an element of`,"∉":`is not an element of`,"⊂":`is a subset of`,"⊆":`is a subset of or equal to`,"∪":`union`,"∩":`intersection`,"→":`right arrow`,"←":`left arrow`,"⇒":`implies`,"⇔":`if and only if`,"∑":`sum`,"∏":`product`,"∫":`integral`,"∞":`infinity`,"∠":`angle`,"⊥":`is perpendicular to`,"∥":`is parallel to`,"∴":`therefore`,",":`comma`,";":`semicolon`,":":`colon`,"|":`vertical bar`,"‖":`double vertical bar`,...rt,...it,...at},st=new Set([`|`,`‖`]),ct=new Set([`∑`,`∏`,`∫`,`∪`,`∩`]),lt={α:`alpha`,β:`beta`,γ:`gamma`,δ:`delta`,ε:`epsilon`,θ:`theta`,λ:`lambda`,μ:`mu`,π:`pi`,ρ:`rho`,σ:`sigma`,τ:`tau`,φ:`phi`,ω:`omega`,Δ:`capital delta`,Σ:`capital sigma`,Ω:`capital omega`,"∞":`infinity`,sin:`sine`,cos:`cosine`,tan:`tangent`,sec:`secant`,csc:`cosecant`,cot:`cotangent`,ln:`natural log`,lim:`limit`},ut={"¯":`bar`,"‾":`bar`,"―":`bar`,"^":`hat`,ˆ:`hat`,"~":`tilde`,"˜":`tilde`,"→":`vector`,"⃗":`vector`,"˙":`dot`},dt=e=>(e.textContent??``).replace(tt,``).replace(/\s+/g,` `).trim(),ft=e=>e.replace(/\s+/g,` `).trim(),pt=e=>[...e.children];function mt(e){return!e||[`mn`,`mi`,`mtext`,`mo`].includes(e.localName)?!0:[`mrow`,`mstyle`].includes(e.localName)&&e.children.length===1?mt(e.children[0]):!1}function ht(e){let t=e?dt(e):``;return/^\d{1,3}$/.test(t)?Number(t):void 0}function gt(e){return`${e}${e%100>=11&&e%100<=13?`th`:{1:`st`,2:`nd`,3:`rd`}[e%10]??`th`}`}function _t(e){return lt[e]??e}function vt(e){return ot[e]??e}function yt(e){let t=[],n=!1;for(let r of e){if(r.localName!==`mo`){t.push(Ot(r)),n=!0;continue}let e=dt(r);e&&(!n&&nt[e]?t.push(nt[e]):e in at?t.push(at[e]):(t.push(vt(e)),n=e in it||st.has(e)&&n))}return t.filter(Boolean).join(` `)}function bt(e){let[t,...n]=e,r=n[n.length-1],i=e=>e?.localName===`mo`&&[`|`,`‖`].includes(dt(e)),a=n.slice(0,-1);if(a.length&&i(t)&&i(r)&&dt(t)===dt(r)&&!a.some(i)){let e=ft(yt(a));return dt(t)===`|`?`absolute value of ${e} end absolute value`:`norm of ${e} end norm`}return yt(e)}function xt(e,t){let n=e?Ot(e):``,r=t?Ot(t):``;return mt(e)&&mt(t)?`${n} over ${r}`:`the fraction with numerator ${n} and denominator ${r}`}function St(e,t,n){return n?`${t} of ${e}`:`${t} of ${e} end root`}function Ct(e,t){let n=t?dt(t):``;if(t&&mt(t)){if(n===`2`)return`${e} squared`;if(n===`3`)return`${e} cubed`;if(n in at)return`${e} ${at[n]}`}let r=t?Ot(t):``;return mt(t)?`${e} to the power of ${r}`:`${e} to the power of ${r} end power`}function wt(e,t){let n=t?Ot(t):``;return mt(t)?`${e} sub ${n}`:`${e} sub ${n} end sub`}function Tt(e,t,n){let r=dt(e);if(r===`lim`)return`limit as ${t?Ot(t):``} of`;if(!ct.has(r))return;let i=t?`from ${Ot(t)}`:``,a=n?`to ${Ot(n)}`:``;return`${vt(r)} ${i} ${a} of`}function Et(e){let t=pt(e).filter(e=>[`mtr`,`mlabeledtr`].includes(e.localName)),n=t.map(e=>pt(e).filter(e=>e.localName===`mtd`)),r=Math.max(0,...n.map(e=>e.length)),i=n.map((e,t)=>`row ${t+1}: ${e.map(e=>ft(yt(pt(e)))).join(`, `)}`);return`table with ${t.length} ${t.length===1?`row`:`rows`} and ${r} ${r===1?`column`:`columns`}. ${i.join(`. `)}`}function Dt(e){let t=e.getAttribute(`open`)??`(`,n=e.getAttribute(`close`)??`)`,r=(e.getAttribute(`separators`)??`,`).replace(/\s+/g,``).split(``),i=pt(e).map((e,t,n)=>t<n.length-1?`${Ot(e)} ${vt(r[Math.min(t,r.length-1)]??`,`)}`:Ot(e));return[vt(t),...i,vt(n)].filter(Boolean).join(` `)}function Ot(e){let t=pt(e);switch(e.localName){case`mi`:return _t(dt(e));case`mn`:case`mtext`:case`ms`:return dt(e);case`mo`:return vt(dt(e));case`mspace`:case`mphantom`:case`annotation`:case`annotation-xml`:return``;case`semantics`:return t[0]?Ot(t[0]):``;case`mfrac`:return xt(t[0],t[1]);case`msqrt`:return St(ft(yt(t)),`square root`,t.length===1&&mt(t[0]));case`mroot`:{let e=ht(t[1]),n=e===2?`square root`:e===3?`cube root`:e?`${gt(e)} root`:`root with index ${t[1]?Ot(t[1]):``}`;return St(t[0]?Ot(t[0]):``,n,mt(t[0]))}case`msup`:return Ct(t[0]?Ot(t[0]):``,t[1]);case`msub`:return wt(t[0]?Ot(t[0]):``,t[1]);case`msubsup`:return(t[0]?Tt(t[0],t[1],t[2]):void 0)||Ct(wt(t[0]?Ot(t[0]):``,t[1]),t[2]);case`munder`:case`mover`:case`munderover`:{let[n,r,i]=t,a=e.localName===`mover`?void 0:r,o=e.localName===`munder`?void 0:e.localName===`mover`?r:i,s=n?Tt(n,a,o):void 0;if(s)return s;let c=n?Ot(n):``,l=e.localName===`mover`&&r?ut[dt(r)]:void 0;return l?l===`vector`?`vector ${c}`:`${c} ${l}`:[c,a?`with ${Ot(a)} below`:``,o?`with ${Ot(o)} above`:``].filter(Boolean).join(` `)}case`mfenced`:return Dt(e);case`mtable`:return Et(e);case`mrow`:case`math`:return bt(t);default:return t.length?yt(t):dt(e)}}function kt(e){return ft(Ot(e))}var At=[`a[href]`,`button`,`label`,`summary`,...[`button`,`checkbox`,`combobox`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`switch`,`tab`,`treeitem`].map(e=>`[role="${e}"]`)].join(`, `);function jt(e){if(e.hasAttribute(`aria-label`)||!e.closest(At))return;let t=e.querySelector(`math`),n=t?kt(t):``;n&&e.setAttribute(`aria-label`,n)}function Mt(e){for(let t of e.querySelectorAll(`mjx-container`))jt(t)}var Nt=Symbol.for(`@pie-element/shared-math-rendering-mathjax/speech-worker-failed`);function Pt(){let e=globalThis;e[Nt]||(e[Nt]=!0,console.warn(`[math-rendering] MathJax's speech worker did not start, so speech, braille and the explorer are off. A content security policy must allow blob: workers, and scripts and fetches from the asset root. See ${f}`))}function Ft(e){let t=e.webworker;if(!t||t.ready)return;e.options??={};let n=e.options;n.enableSpeech=!1,n.enableBraille=!1,n.speechError=()=>{},t.Post=()=>Promise.reject(Error(`The speech worker did not start`)),t.Terminate(),Pt()}function It(e){let t=e?.adaptor,n=t?.createWorker;!e||!t||!n||(t.createWorker=async(r,i)=>{let a=await n.call(t,r,i);return a.addEventListener(`error`,()=>Ft(e),{once:!0}),a})}`${h}`;var Lt={parallelogram:`\\lower.2em{\\Huge\\unicode{x25B1}}`,overarc:`\\overparen`,napprox:`\\not\\approx`,longdiv:`\\enclose{longdiv}`,abs:[`\\left|#1\\right|`,1],perpendicular:`\\perp`,divide:`\\div`},Rt=/\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/,zt=/\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/,Bt=/\\embed\{newLine\}\[\]/g,Vt=[[`$$`,`$$`],[`$`,`$`],[`\\[`,`\\]`],[`\\(`,`\\)`]];function Ht(e){for(let[t,n]of Vt)if(e.startsWith(t)&&e.endsWith(n))return e.substring(t.length,e.length-n.length);return e}function Ut(e){return`\\(${Ht(e.includes(`\\displaystyle`)?e.replace(`\\displaystyle`,``).trim():e)}\\)`.replace(Bt,`\\newline `)}var Wt=`mathjax_ignore`,Gt=`mathjax_process`,Kt=`[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)`,qt=Symbol.for(`@pie-element/shared-math-rendering-mathjax/loading`),Jt=`MJX-CHTML-styles`,Yt=`PIE-MJX-SVG-styles`,Xt=`PIE-MathJax-Menu-Settings`,Zt={'mjx-container[overflow="linebreak"][display]':{overflow:`auto clip`,"min-width":`initial !important`}},Qt=200,$t=201,en=202;function tn(e){let t=[...e.matches(`mjx-container`)?[e]:[],...e.querySelectorAll(`mjx-container`)];for(let e of t)for(let t of[e,...e.querySelectorAll(`[data-latex],[data-latex-item]`)])t.removeAttribute(`data-latex`),t.removeAttribute(`data-latex-item`)}function nn(e,t){let n=e.closest(`.${Wt}, .${Gt}`);return n!==null&&t.contains(n)&&!n.classList.contains(`mathjax_process`)}function rn(e){for(let t of e.querySelectorAll(`[data-latex]`)){if(t.dataset.mathHandled||t.closest(`mjx-container`)||nn(t,e))continue;let n=t.textContent;n&&(t.textContent=Ut(n),t.dataset.mathHandled=`true`)}}function an(e){for(let t of e.querySelectorAll(`math`))t.closest(`mjx-container`)||t.setAttribute(`displaystyle`,`true`)}function on(e,t){for(let t of e.querySelectorAll(`math`))if(!t.closest(`mjx-assistive-mml`))return!0;return(t?zt:Rt).test(e.textContent??``)}function sn(e){return new Promise((t,n)=>{let{useSingleDollar:r=!1,accessibility:i=!0,loadFonts:a=!0,srcUrl:o}=e,s=C(e,{}.url),c=y(),l={loader:{load:i?[`a11y/assistive-mml`]:[],failed:e=>n(e),"output/svg":{ready:e=>{let t=N();return cn(t)&&ln(t),e}}},startup:{typeset:!1,ready:()=>{let e=N(),r=e?.startup,i=cn(e);i&&(ln(e),un(e,s.speechLocales),w(e?._?.a11y?.sre_ts?.locales,s.speechLocales)),r?.defaultReady?.(),i&&(dn(r?.document),fn(r?.document),r?.document?.addStyles?.(Zt),It(r?.document)),Promise.resolve(r?.promise).then(()=>t(),n)}},tex:{macros:{...Lt}},output:{displayOverflow:`linebreak`},options:{enableMenu:i,menuOptions:{settings:{assistiveMml:i,enrich:!1,inTabOrder:c}},a11y:{inTabOrder:c}}};r&&l.tex&&(console.warn(Kt),l.tex.inlineMath=[[`$`,`$`],[`\\(`,`\\)`]],l.tex.processEscapes=!0),a||(l.chtml={fontURL:``});let u=T(s.speechLocales);u&&l.options&&(l.options.sre={locale:u}),F(l,{...s,srcUrl:o}).then(e=>{e||t()},n)})}function cn(e){return!!e?.version?.startsWith(`4.`)}function ln(e){let t=e?._?.output,n=t?.chtml_ts?.CHTML;n&&(n.STYLESHEETID=re);let r=t?.svg_ts?.SVG;r&&(r.STYLESHEETID=Yt)}function un(e,t){let n=e?._?.ui?.menu?.Menu?.Menu;if(n){n.MENU_STORAGE=Xt;try{let e=localStorage.getItem(Xt);if(!e)return;let{assistiveMml:n,locale:r,...i}=JSON.parse(e),a=r===void 0||!t||t.has(r);if(n===void 0&&a)return;a&&r!==void 0&&(i.locale=r),Object.keys(i).length?localStorage.setItem(Xt,JSON.stringify(i)):localStorage.removeItem(Xt)}catch{}}}function dn(e){if(!e)return;let t=new WeakSet,n=e=>{let n=e.typesetRoot;!n||t.has(n)||(tn(n),t.add(n))};e.addRenderAction?.(`pie-strip-latex`,$t,e=>{for(let t of e.math??[])n(t);return!1},e=>{let t=e.typesetRoot;return t&&tn(t),!1});let r=e.outputJax?.chtmlStyles;r?.id===Jt&&(r.id=re),hn()}function fn(e){let t=e=>{e.typesetRoot&&jt(e.typesetRoot)};e?.addRenderAction?.(`pie-name-math`,en,e=>{for(let n of e.math??[])t(n);return!1},e=>(t(e),!1))}function pn(e){return e instanceof HTMLStyleElement&&I.includes(e.id)}function mn(e){te(`foreign-output-stylesheet`,`another MathJax added <style id="${e.id}"> to <head>`)}function hn(){let e=document.head,t=[...e.children].find(pn);if(t){mn(t);return}let n=new MutationObserver(e=>{for(let t of e){let e=[...t.addedNodes].find(pn);if(e){mn(e),n.disconnect();return}}});n.observe(e,{childList:!0})}function gn(e){let t=e?.math;if(!t?.remove)return;let n=[...t].filter(e=>(e.state?.()??0)>=Qt&&e.typesetRoot?.isConnected===!1);if(n.length!==0){for(let e of[...n].reverse())e.clear?.();t.remove(...n)}}function _n(e){return new Promise((t,n)=>{let r=e.startup??{};e.startup=r;let i=r.ready;r.ready=()=>{let e=N()?.startup;i?i.call(r):e?.defaultReady?.(),Promise.resolve(e?.promise).then(()=>t(),n)}})}function vn(e){let t=N();return t?t.version?t.startup?.promise?Promise.resolve(t.startup.promise).then(()=>void 0):Promise.resolve():_n(t):sn(e)}function yn(e){return vn(e).then(()=>{let e=N();e&&typeof e.typesetPromise!=`function`&&console.warn(`[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.`)})}function bn(e){let t=ne,n=t[qt];return n||(n=yn(e),t[qt]=n),n}function xn(e={}){let t=e.useSingleDollar??!1;return async n=>{if(typeof window>`u`)return;let r=ie();r&&te(`mathjax-3-global`,`window.MathJax is MathJax ${r}`),rn(n),ce(n),an(n),Ke(n);let i=bn(e);if(!on(n,t)){i.catch(()=>{});return}await i;let a=N();if(await a?.startup?.promise,typeof a?.typesetPromise==`function`){et(),gn(a.startup?.document);try{await a.typesetPromise([n])}catch(e){throw a.typesetClear?.([n]),e}tn(n),Mt(n)}}}var Sn=`@pie-lib/math-rendering`,Cn=`@pie-lib/math-rendering@2`,wn=`pie-print`,Tn=50,En=1e4,Dn=null;function On(){return!!window[Cn]?.opts?.useSingleDollar}function kn(){return Dn||=xn({useSingleDollar:On()}),Dn}function An(){if(typeof window>`u`)return null;let e=window[Sn];return typeof e?.renderMath==`function`&&e.renderMath!==Pn?e:null}function jn(e){let t=e;for(;t;){if(t instanceof Element&&t.localName===wn)return t;t=t instanceof ShadowRoot?t.host:t.parentNode}return null}function Mn(){let e=window.renderMath;return typeof e==`function`?e:null}async function Nn(e){let t=jn(e);if(!t)return null;let n=Mn();if(n||t.mathRenderingModuleUrlImported!==!0)return n;let r=Date.now()+En;for(;Date.now()<r;){await new Promise(e=>setTimeout(e,Tn));let e=Mn();if(e)return e}return null}var Pn=async e=>{if(typeof window>`u`)return;let t=typeof e==`string`,n;t?(n=document.createElement(`div`),n.innerHTML=e):n=e||document.body;let r=An(),i=r||t?null:await Nn(n);return r?(await r.renderMath?.(n),Mt(n)):i&&i!==Pn?(await i(n),Mt(n)):await kn()(n),t?n.innerHTML:void 0},Fn=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+ee(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+ee(s,l);c+=A(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+ee(s,l++),c+=A(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function j(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M={current:null},N={transition:null},P={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:N,ReactCurrentOwner:C};function F(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P,e.act=F,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}},e.unstable_act=F,e.useCallback=function(e,t){return M.current.useCallback(e,t)},e.useContext=function(e){return M.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return M.current.useDeferredValue(e)},e.useEffect=function(e,t){return M.current.useEffect(e,t)},e.useId=function(){return M.current.useId()},e.useImperativeHandle=function(e,t,n){return M.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return M.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return M.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return M.current.useMemo(e,t)},e.useReducer=function(e,t,n){return M.current.useReducer(e,t,n)},e.useRef=function(e){return M.current.useRef(e)},e.useState=function(e){return M.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return M.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return M.current.useTransition()},e.version=`18.3.1`})),In=o(((e,t)=>{t.exports=Fn()})),Ln=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,j(x);else{var t=n(l);t!==null&&te(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&te(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,A=ee.port2;ee.port1.onmessage=O,k=function(){A.postMessage(null)}}else k=function(){g(O,0)};function j(e){C=e,S||(S=!0,k())}function te(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,j(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,te(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,j(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Rn=o(((e,t)=>{t.exports=Ln()})),zn=o((e=>{var t=In(),n=Rn();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function p(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function m(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function h(e,t,n,r){if(t==null||m(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var _={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){_[e]=new g(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];_[t]=new g(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){_[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){_[e]=new g(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){_[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){_[e]=new g(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){_[e]=new g(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){_[e]=new g(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){_[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new g(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,r){var i=_.hasOwnProperty(t)?_[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(h(t,n,i,r)&&(n=null),r||i===null?p(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for(`react.element`),C=Symbol.for(`react.portal`),w=Symbol.for(`react.fragment`),T=Symbol.for(`react.strict_mode`),E=Symbol.for(`react.profiler`),D=Symbol.for(`react.provider`),O=Symbol.for(`react.context`),k=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),A=Symbol.for(`react.suspense_list`),j=Symbol.for(`react.memo`),te=Symbol.for(`react.lazy`),M=Symbol.for(`react.offscreen`),N=Symbol.iterator;function P(e){return typeof e!=`object`||!e?null:(e=N&&e[N]||e[`@@iterator`],typeof e==`function`?e:null)}var F=Object.assign,ne;function re(e){if(ne===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ne=t&&t[1]||``}return`
|
|
37
37
|
`+ne+e}var I=!1;function ie(e,t){if(!e||I)return``;I=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
|
38
38
|
`),a=r.stack.split(`
|
|
39
39
|
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/passage@8.0.6
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/passage@8.0.6/dist/schemas/configuration.schema.json",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
6
6
|
"settingsPanelDisabled": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/passage@8.0.6
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/passage@8.0.6/dist/schemas/model.schema.json",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
6
6
|
"id": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/passage@8.0.6
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/passage@8.0.6/dist/schemas/session.schema.json",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
6
6
|
"id": {
|
package/module/print.js
CHANGED
|
@@ -16016,36 +16016,36 @@ var Q_ = {
|
|
|
16016
16016
|
abs: ["\\left|#1\\right|", 1],
|
|
16017
16017
|
perpendicular: "\\perp",
|
|
16018
16018
|
divide: "\\div"
|
|
16019
|
-
}, $_ =
|
|
16019
|
+
}, $_ = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/, ev = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/, tv = /\\embed\{newLine\}\[\]/g, nv = [
|
|
16020
16020
|
["$$", "$$"],
|
|
16021
16021
|
["$", "$"],
|
|
16022
16022
|
["\\[", "\\]"],
|
|
16023
16023
|
["\\(", "\\)"]
|
|
16024
|
-
]
|
|
16024
|
+
];
|
|
16025
|
+
function rv(e) {
|
|
16026
|
+
for (let [t, n] of nv) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
|
|
16027
|
+
return e;
|
|
16028
|
+
}
|
|
16029
|
+
function iv(e) {
|
|
16030
|
+
return `\\(${rv(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e)}\\)`.replace(tv, "\\newline ");
|
|
16031
|
+
}
|
|
16032
|
+
var av = "mathjax_ignore", ov = "mathjax_process", sv = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)", cv = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading"), lv = "MJX-CHTML-styles", uv = "PIE-MJX-SVG-styles", dv = "PIE-MathJax-Menu-Settings", fv = { "mjx-container[overflow=\"linebreak\"][display]": {
|
|
16025
16033
|
overflow: "auto clip",
|
|
16026
16034
|
"min-width": "initial !important"
|
|
16027
|
-
} },
|
|
16028
|
-
function
|
|
16035
|
+
} }, pv = 200, mv = 201, hv = 202;
|
|
16036
|
+
function gv(e) {
|
|
16029
16037
|
let t = [...e.matches("mjx-container") ? [e] : [], ...e.querySelectorAll("mjx-container")];
|
|
16030
16038
|
for (let e of t) for (let t of [e, ...e.querySelectorAll("[data-latex],[data-latex-item]")]) t.removeAttribute("data-latex"), t.removeAttribute("data-latex-item");
|
|
16031
16039
|
}
|
|
16032
|
-
function pv(e) {
|
|
16033
|
-
for (let [t, n] of rv) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
|
|
16034
|
-
return e;
|
|
16035
|
-
}
|
|
16036
|
-
function mv(e) {
|
|
16037
|
-
return pv(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
|
|
16038
|
-
}
|
|
16039
|
-
var hv = "mathjax_ignore", gv = "mathjax_process";
|
|
16040
16040
|
function _v(e, t) {
|
|
16041
|
-
let n = e.closest(`.${
|
|
16042
|
-
return n !== null && t.contains(n) && !n.classList.contains(
|
|
16041
|
+
let n = e.closest(`.${av}, .${ov}`);
|
|
16042
|
+
return n !== null && t.contains(n) && !n.classList.contains("mathjax_process");
|
|
16043
16043
|
}
|
|
16044
16044
|
function vv(e) {
|
|
16045
16045
|
for (let t of e.querySelectorAll("[data-latex]")) {
|
|
16046
16046
|
if (t.dataset.mathHandled || t.closest("mjx-container") || _v(t, e)) continue;
|
|
16047
16047
|
let n = t.textContent;
|
|
16048
|
-
n && (t.textContent =
|
|
16048
|
+
n && (t.textContent = iv(n), t.dataset.mathHandled = "true");
|
|
16049
16049
|
}
|
|
16050
16050
|
}
|
|
16051
16051
|
function yv(e) {
|
|
@@ -16053,7 +16053,7 @@ function yv(e) {
|
|
|
16053
16053
|
}
|
|
16054
16054
|
function bv(e, t) {
|
|
16055
16055
|
for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
|
|
16056
|
-
return (t ?
|
|
16056
|
+
return (t ? ev : $_).test(e.textContent ?? "");
|
|
16057
16057
|
}
|
|
16058
16058
|
function xv(e) {
|
|
16059
16059
|
return new Promise((t, n) => {
|
|
@@ -16070,7 +16070,7 @@ function xv(e) {
|
|
|
16070
16070
|
typeset: !1,
|
|
16071
16071
|
ready: () => {
|
|
16072
16072
|
let e = dg(), r = e?.startup, i = Sv(e);
|
|
16073
|
-
i && (Cv(e), wv(e, s.speechLocales), tg(e?._?.a11y?.sre_ts?.locales, s.speechLocales)), r?.defaultReady?.(), i && (Tv(r?.document), Ev(r?.document), r?.document?.addStyles?.(
|
|
16073
|
+
i && (Cv(e), wv(e, s.speechLocales), tg(e?._?.a11y?.sre_ts?.locales, s.speechLocales)), r?.defaultReady?.(), i && (Tv(r?.document), Ev(r?.document), r?.document?.addStyles?.(fv), Z_(r?.document)), Promise.resolve(r?.promise).then(() => t(), n);
|
|
16074
16074
|
}
|
|
16075
16075
|
},
|
|
16076
16076
|
tex: { macros: { ...Q_ } },
|
|
@@ -16085,7 +16085,7 @@ function xv(e) {
|
|
|
16085
16085
|
a11y: { inTabOrder: c }
|
|
16086
16086
|
}
|
|
16087
16087
|
};
|
|
16088
|
-
r && l.tex && (console.warn(
|
|
16088
|
+
r && l.tex && (console.warn(sv), l.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], l.tex.processEscapes = !0), a || (l.chtml = { fontURL: "" });
|
|
16089
16089
|
let u = ng(s.speechLocales);
|
|
16090
16090
|
u && l.options && (l.options.sre = { locale: u }), pg(l, {
|
|
16091
16091
|
...s,
|
|
@@ -16102,18 +16102,18 @@ function Cv(e) {
|
|
|
16102
16102
|
let t = e?._?.output, n = t?.chtml_ts?.CHTML;
|
|
16103
16103
|
n && (n.STYLESHEETID = hg);
|
|
16104
16104
|
let r = t?.svg_ts?.SVG;
|
|
16105
|
-
r && (r.STYLESHEETID =
|
|
16105
|
+
r && (r.STYLESHEETID = uv);
|
|
16106
16106
|
}
|
|
16107
16107
|
function wv(e, t) {
|
|
16108
16108
|
let n = e?._?.ui?.menu?.Menu?.Menu;
|
|
16109
16109
|
if (n) {
|
|
16110
|
-
n.MENU_STORAGE =
|
|
16110
|
+
n.MENU_STORAGE = dv;
|
|
16111
16111
|
try {
|
|
16112
|
-
let e = localStorage.getItem(
|
|
16112
|
+
let e = localStorage.getItem(dv);
|
|
16113
16113
|
if (!e) return;
|
|
16114
16114
|
let { assistiveMml: n, locale: r, ...i } = JSON.parse(e), a = r === void 0 || !t || t.has(r);
|
|
16115
16115
|
if (n === void 0 && a) return;
|
|
16116
|
-
a && r !== void 0 && (i.locale = r), Object.keys(i).length ? localStorage.setItem(
|
|
16116
|
+
a && r !== void 0 && (i.locale = r), Object.keys(i).length ? localStorage.setItem(dv, JSON.stringify(i)) : localStorage.removeItem(dv);
|
|
16117
16117
|
} catch {}
|
|
16118
16118
|
}
|
|
16119
16119
|
}
|
|
@@ -16121,23 +16121,23 @@ function Tv(e) {
|
|
|
16121
16121
|
if (!e) return;
|
|
16122
16122
|
let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
|
|
16123
16123
|
let n = e.typesetRoot;
|
|
16124
|
-
!n || t.has(n) || (
|
|
16124
|
+
!n || t.has(n) || (gv(n), t.add(n));
|
|
16125
16125
|
};
|
|
16126
|
-
e.addRenderAction?.("pie-strip-latex",
|
|
16126
|
+
e.addRenderAction?.("pie-strip-latex", mv, (e) => {
|
|
16127
16127
|
for (let t of e.math ?? []) n(t);
|
|
16128
16128
|
return !1;
|
|
16129
16129
|
}, (e) => {
|
|
16130
16130
|
let t = e.typesetRoot;
|
|
16131
|
-
return t &&
|
|
16131
|
+
return t && gv(t), !1;
|
|
16132
16132
|
});
|
|
16133
16133
|
let r = e.outputJax?.chtmlStyles;
|
|
16134
|
-
r?.id ===
|
|
16134
|
+
r?.id === lv && (r.id = hg), kv();
|
|
16135
16135
|
}
|
|
16136
16136
|
function Ev(e) {
|
|
16137
16137
|
let t = (e) => {
|
|
16138
16138
|
e.typesetRoot && K_(e.typesetRoot);
|
|
16139
16139
|
};
|
|
16140
|
-
e?.addRenderAction?.("pie-name-math",
|
|
16140
|
+
e?.addRenderAction?.("pie-name-math", hv, (e) => {
|
|
16141
16141
|
for (let n of e.math ?? []) t(n);
|
|
16142
16142
|
return !1;
|
|
16143
16143
|
}, (e) => (t(e), !1));
|
|
@@ -16168,7 +16168,7 @@ function kv() {
|
|
|
16168
16168
|
function Av(e) {
|
|
16169
16169
|
let t = e?.math;
|
|
16170
16170
|
if (!t?.remove) return;
|
|
16171
|
-
let n = [...t].filter((e) => (e.state?.() ?? 0) >=
|
|
16171
|
+
let n = [...t].filter((e) => (e.state?.() ?? 0) >= pv && e.typesetRoot?.isConnected === !1);
|
|
16172
16172
|
if (n.length !== 0) {
|
|
16173
16173
|
for (let e of [...n].reverse()) e.clear?.();
|
|
16174
16174
|
t.remove(...n);
|
|
@@ -16196,8 +16196,8 @@ function Nv(e) {
|
|
|
16196
16196
|
});
|
|
16197
16197
|
}
|
|
16198
16198
|
function Pv(e) {
|
|
16199
|
-
let t = mg, n = t[
|
|
16200
|
-
return n || (n = Nv(e), t[
|
|
16199
|
+
let t = mg, n = t[cv];
|
|
16200
|
+
return n || (n = Nv(e), t[cv] = n), n;
|
|
16201
16201
|
}
|
|
16202
16202
|
function Fv(e = {}) {
|
|
16203
16203
|
let t = e.useSingleDollar ?? !1;
|
|
@@ -16219,7 +16219,7 @@ function Fv(e = {}) {
|
|
|
16219
16219
|
} catch (e) {
|
|
16220
16220
|
throw a.typesetClear?.([n]), e;
|
|
16221
16221
|
}
|
|
16222
|
-
|
|
16222
|
+
gv(n), q_(n);
|
|
16223
16223
|
}
|
|
16224
16224
|
};
|
|
16225
16225
|
}
|