@pie-element/match 13.0.6-next.20261018193205 → 13.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 +2 -2
- package/dist/browser/{dist-CwkeJYno.js → dist-Ck3Whxbr.js} +55 -55
- package/dist/browser/{dist-CwkeJYno.js.map → dist-Ck3Whxbr.js.map} +1 -1
- 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 +2 -2
- package/dist/browser/editor-runtime/{dist-xoi1Q8MD.js → dist-DnjZuoI4.js} +55 -55
- package/dist/browser/editor-runtime/{dist-xoi1Q8MD.js.map → dist-DnjZuoI4.js.map} +1 -1
- package/dist/browser/editor-runtime/{mathjax-CptWnMbQ-DOHDl8ih.js → mathjax-DqXi3q4c-CmNb0K2t.js} +4 -4
- package/dist/browser/editor-runtime/{mathjax-CptWnMbQ-DOHDl8ih.js.map → mathjax-DqXi3q4c-CmNb0K2t.js.map} +1 -1
- package/dist/browser/{mathjax-CptWnMbQ-CSViSqWd.js → mathjax-DqXi3q4c-BXH7dQCu.js} +4 -4
- package/dist/browser/{mathjax-CptWnMbQ-CSViSqWd.js.map → mathjax-DqXi3q4c-BXH7dQCu.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/package.json +16 -16
package/dist/index.iife.js
CHANGED
|
@@ -82,7 +82,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
82
82
|
color: ${Jm} !important;
|
|
83
83
|
background-color: ${Qm} !important;
|
|
84
84
|
}
|
|
85
|
-
`;function eh(e=document){if(e.getElementById(`PIE-MJX-explorer-styles`))return;let t=e.createElement(`style`);t.id=qm,t.textContent=$m,e.head.appendChild(t)}var th=/[-]/g,nh={"+":`positive`,"-":`negative`,"−":`negative`,"±":`plus or minus`,"∓":`minus or plus`},rh={"(":`open parenthesis`,"[":`open bracket`,"{":`open brace`,"⟨":`open angle bracket`,"⌊":`open floor`,"⌈":`open ceiling`},ih={")":`close parenthesis`,"]":`close bracket`,"}":`close brace`,"⟩":`close angle bracket`,"⌋":`close floor`,"⌉":`close ceiling`},ah={"!":`factorial`,"%":`percent`,"°":`degrees`,"′":`prime`,"″":`double prime`},oh={"+":`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`,...rh,...ih,...ah},sh=new Set([`|`,`‖`]),ch=new Set([`∑`,`∏`,`∫`,`∪`,`∩`]),lh={α:`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`},uh={"¯":`bar`,"‾":`bar`,"―":`bar`,"^":`hat`,ˆ:`hat`,"~":`tilde`,"˜":`tilde`,"→":`vector`,"⃗":`vector`,"˙":`dot`},dh=e=>(e.textContent??``).replace(th,``).replace(/\s+/g,` `).trim(),fh=e=>e.replace(/\s+/g,` `).trim(),ph=e=>[...e.children];function mh(e){return!e||[`mn`,`mi`,`mtext`,`mo`].includes(e.localName)?!0:[`mrow`,`mstyle`].includes(e.localName)&&e.children.length===1?mh(e.children[0]):!1}function hh(e){let t=e?dh(e):``;return/^\d{1,3}$/.test(t)?Number(t):void 0}function gh(e){return`${e}${e%100>=11&&e%100<=13?`th`:{1:`st`,2:`nd`,3:`rd`}[e%10]??`th`}`}function _h(e){return lh[e]??e}function vh(e){return oh[e]??e}function yh(e){let t=[],n=!1;for(let r of e){if(r.localName!==`mo`){t.push(Oh(r)),n=!0;continue}let e=dh(r);e&&(!n&&nh[e]?t.push(nh[e]):e in ah?t.push(ah[e]):(t.push(vh(e)),n=e in ih||sh.has(e)&&n))}return t.filter(Boolean).join(` `)}function bh(e){let[t,...n]=e,r=n[n.length-1],i=e=>e?.localName===`mo`&&[`|`,`‖`].includes(dh(e)),a=n.slice(0,-1);if(a.length&&i(t)&&i(r)&&dh(t)===dh(r)&&!a.some(i)){let e=fh(yh(a));return dh(t)===`|`?`absolute value of ${e} end absolute value`:`norm of ${e} end norm`}return yh(e)}function xh(e,t){let n=e?Oh(e):``,r=t?Oh(t):``;return mh(e)&&mh(t)?`${n} over ${r}`:`the fraction with numerator ${n} and denominator ${r}`}function Sh(e,t,n){return n?`${t} of ${e}`:`${t} of ${e} end root`}function Ch(e,t){let n=t?dh(t):``;if(t&&mh(t)){if(n===`2`)return`${e} squared`;if(n===`3`)return`${e} cubed`;if(n in ah)return`${e} ${ah[n]}`}let r=t?Oh(t):``;return mh(t)?`${e} to the power of ${r}`:`${e} to the power of ${r} end power`}function wh(e,t){let n=t?Oh(t):``;return mh(t)?`${e} sub ${n}`:`${e} sub ${n} end sub`}function Th(e,t,n){let r=dh(e);if(r===`lim`)return`limit as ${t?Oh(t):``} of`;if(!ch.has(r))return;let i=t?`from ${Oh(t)}`:``,a=n?`to ${Oh(n)}`:``;return`${vh(r)} ${i} ${a} of`}function Eh(e){let t=ph(e).filter(e=>[`mtr`,`mlabeledtr`].includes(e.localName)),n=t.map(e=>ph(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=>fh(yh(ph(e)))).join(`, `)}`);return`table with ${t.length} ${t.length===1?`row`:`rows`} and ${r} ${r===1?`column`:`columns`}. ${i.join(`. `)}`}function Dh(e){let t=e.getAttribute(`open`)??`(`,n=e.getAttribute(`close`)??`)`,r=(e.getAttribute(`separators`)??`,`).replace(/\s+/g,``).split(``),i=ph(e).map((e,t,n)=>t<n.length-1?`${Oh(e)} ${vh(r[Math.min(t,r.length-1)]??`,`)}`:Oh(e));return[vh(t),...i,vh(n)].filter(Boolean).join(` `)}function Oh(e){let t=ph(e);switch(e.localName){case`mi`:return _h(dh(e));case`mn`:case`mtext`:case`ms`:return dh(e);case`mo`:return vh(dh(e));case`mspace`:case`mphantom`:case`annotation`:case`annotation-xml`:return``;case`semantics`:return t[0]?Oh(t[0]):``;case`mfrac`:return xh(t[0],t[1]);case`msqrt`:return Sh(fh(yh(t)),`square root`,t.length===1&&mh(t[0]));case`mroot`:{let e=hh(t[1]),n=e===2?`square root`:e===3?`cube root`:e?`${gh(e)} root`:`root with index ${t[1]?Oh(t[1]):``}`;return Sh(t[0]?Oh(t[0]):``,n,mh(t[0]))}case`msup`:return Ch(t[0]?Oh(t[0]):``,t[1]);case`msub`:return wh(t[0]?Oh(t[0]):``,t[1]);case`msubsup`:return(t[0]?Th(t[0],t[1],t[2]):void 0)||Ch(wh(t[0]?Oh(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?Th(n,a,o):void 0;if(s)return s;let c=n?Oh(n):``,l=e.localName===`mover`&&r?uh[dh(r)]:void 0;return l?l===`vector`?`vector ${c}`:`${c} ${l}`:[c,a?`with ${Oh(a)} below`:``,o?`with ${Oh(o)} above`:``].filter(Boolean).join(` `)}case`mfenced`:return Dh(e);case`mtable`:return Eh(e);case`mrow`:case`math`:return bh(t);default:return t.length?yh(t):dh(e)}}function kh(e){return fh(Oh(e))}var Ah=[`a[href]`,`button`,`label`,`summary`,...[`button`,`checkbox`,`combobox`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`switch`,`tab`,`treeitem`].map(e=>`[role="${e}"]`)].join(`, `);function jh(e){if(e.hasAttribute(`aria-label`)||!e.closest(Ah))return;let t=e.querySelector(`math`),n=t?kh(t):``;n&&e.setAttribute(`aria-label`,n)}function Mh(e){for(let t of e.querySelectorAll(`mjx-container`))jh(t)}var Nh=Symbol.for(`@pie-element/shared-math-rendering-mathjax/speech-worker-failed`);function Ph(){let e=globalThis;e[Nh]||(e[Nh]=!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 ${Dp}`))}function Fh(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(),Ph()}function Ih(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`,()=>Fh(e),{once:!0}),a})}`${Ap}`;var Lh={parallelogram:`\\lower.2em{\\Huge\\unicode{x25B1}}`,overarc:`\\overparen`,napprox:`\\not\\approx`,longdiv:`\\enclose{longdiv}`,abs:[`\\left|#1\\right|`,1],perpendicular:`\\perp`,divide:`\\div`},Rh=`[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)`,zh=/\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/,Bh=/\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/,Vh=/\\embed\{newLine\}\[\]/g,Hh=[[`$$`,`$$`],[`$`,`$`],[`\\[`,`\\]`],[`\\(`,`\\)`]],Uh=Symbol.for(`@pie-element/shared-math-rendering-mathjax/loading`),Wh=`MJX-CHTML-styles`,Gh=`PIE-MJX-SVG-styles`,Kh=`PIE-MathJax-Menu-Settings`,qh={'mjx-container[overflow="linebreak"][display]':{overflow:`auto clip`,"min-width":`initial !important`}},Jh=200,Yh=201,Xh=202;function Zh(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 Qh(e){for(let[t,n]of Hh)if(e.startsWith(t)&&e.endsWith(n))return e.substring(t.length,e.length-n.length);return e}function $h(e){return Qh(e.includes(`\\displaystyle`)?e.replace(`\\displaystyle`,``).trim():e)}var eg=`mathjax_ignore`,tg=`mathjax_process`;function ng(e,t){let n=e.closest(`.${eg}, .${tg}`);return n!==null&&t.contains(n)&&!n.classList.contains(tg)}function rg(e){for(let t of e.querySelectorAll(`[data-latex]`)){if(t.dataset.mathHandled||t.closest(`mjx-container`)||ng(t,e))continue;let n=t.textContent;n&&(t.textContent=`\\(${$h(n)}\\)`.replace(Vh,`\\newline `),t.dataset.mathHandled=`true`)}}function ig(e){for(let t of e.querySelectorAll(`math`))t.closest(`mjx-container`)||t.setAttribute(`displaystyle`,`true`)}function ag(e,t){for(let t of e.querySelectorAll(`math`))if(!t.closest(`mjx-assistive-mml`))return!0;return(t?Bh:zh).test(e.textContent??``)}function og(e){return new Promise((t,n)=>{let{useSingleDollar:r=!1,accessibility:i=!0,loadFonts:a=!0,srcUrl:o}=e,s=Rp(e,{}.url),c=Pp(),l={loader:{load:i?[`a11y/assistive-mml`]:[],failed:e=>n(e),"output/svg":{ready:e=>{let t=Xp();return sg(t)&&cg(t),e}}},startup:{typeset:!1,ready:()=>{let e=Xp(),r=e?.startup,i=sg(e);i&&(cg(e),lg(e,s.speechLocales),zp(e?._?.a11y?.sre_ts?.locales,s.speechLocales)),r?.defaultReady?.(),i&&(ug(r?.document),dg(r?.document),r?.document?.addStyles?.(qh),Ih(r?.document)),Promise.resolve(r?.promise).then(()=>t(),n)}},tex:{macros:{...Lh}},output:{displayOverflow:`linebreak`},options:{enableMenu:i,menuOptions:{settings:{assistiveMml:i,enrich:!1,inTabOrder:c}},a11y:{inTabOrder:c}}};r&&l.tex&&(console.warn(Rh),l.tex.inlineMath=[[`$`,`$`],[`\\(`,`\\)`]],l.tex.processEscapes=!0),a||(l.chtml={fontURL:``});let u=Bp(s.speechLocales);u&&l.options&&(l.options.sre={locale:u}),Qp(l,{...s,srcUrl:o}).then(e=>{e||t()},n)})}function sg(e){return!!e?.version?.startsWith(`4.`)}function cg(e){let t=e?._?.output,n=t?.chtml_ts?.CHTML;n&&(n.STYLESHEETID=em);let r=t?.svg_ts?.SVG;r&&(r.STYLESHEETID=Gh)}function lg(e,t){let n=e?._?.ui?.menu?.Menu?.Menu;if(n){n.MENU_STORAGE=Kh;try{let e=localStorage.getItem(Kh);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(Kh,JSON.stringify(i)):localStorage.removeItem(Kh)}catch{}}}function ug(e){if(!e)return;let t=new WeakSet,n=e=>{let n=e.typesetRoot;!n||t.has(n)||(Zh(n),t.add(n))};e.addRenderAction?.(`pie-strip-latex`,Yh,e=>{for(let t of e.math??[])n(t);return!1},e=>{let t=e.typesetRoot;return t&&Zh(t),!1});let r=e.outputJax?.chtmlStyles;r?.id===Wh&&(r.id=em),mg()}function dg(e){let t=e=>{e.typesetRoot&&jh(e.typesetRoot)};e?.addRenderAction?.(`pie-name-math`,Xh,e=>{for(let n of e.math??[])t(n);return!1},e=>(t(e),!1))}function fg(e){return e instanceof HTMLStyleElement&&tm.includes(e.id)}function pg(e){Jp(`foreign-output-stylesheet`,`another MathJax added <style id="${e.id}"> to <head>`)}function mg(){let e=document.head,t=[...e.children].find(fg);if(t){pg(t);return}let n=new MutationObserver(e=>{for(let t of e){let e=[...t.addedNodes].find(fg);if(e){pg(e),n.disconnect();return}}});n.observe(e,{childList:!0})}function hg(e){let t=e?.math;if(!t?.remove)return;let n=[...t].filter(e=>(e.state?.()??0)>=Jh&&e.typesetRoot?.isConnected===!1);if(n.length!==0){for(let e of[...n].reverse())e.clear?.();t.remove(...n)}}function gg(e){return new Promise((t,n)=>{let r=e.startup??{};e.startup=r;let i=r.ready;r.ready=()=>{let e=Xp()?.startup;i?i.call(r):e?.defaultReady?.(),Promise.resolve(e?.promise).then(()=>t(),n)}})}function _g(e){let t=Xp();return t?t.version?t.startup?.promise?Promise.resolve(t.startup.promise).then(()=>void 0):Promise.resolve():gg(t):og(e)}function vg(e){return _g(e).then(()=>{let e=Xp();e&&typeof e.typesetPromise!=`function`&&console.warn(`[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.`)})}function yg(e){let t=$p,n=t[Uh];return n||(n=vg(e),t[Uh]=n),n}function bg(e={}){let t=e.useSingleDollar??!1;return async n=>{if(typeof window>`u`)return;let r=nm();r&&Jp(`mathjax-3-global`,`window.MathJax is MathJax ${r}`),rg(n),om(n),ig(n),Km(n);let i=yg(e);if(!ag(n,t)){i.catch(()=>{});return}await i;let a=Xp();if(await a?.startup?.promise,typeof a?.typesetPromise==`function`){eh(),hg(a.startup?.document);try{await a.typesetPromise([n])}catch(e){throw a.typesetClear?.([n]),e}Zh(n),Mh(n)}}}var xg=`@pie-lib/math-rendering`,Sg=`@pie-lib/math-rendering@2`,Cg=`pie-print`,wg=50,Tg=1e4,Eg=null;function Dg(){return!!window[Sg]?.opts?.useSingleDollar}function Og(){return Eg||=bg({useSingleDollar:Dg()}),Eg}function kg(){if(typeof window>`u`)return null;let e=window[xg];return typeof e?.renderMath==`function`&&e.renderMath!==Ng?e:null}function Ag(e){let t=e;for(;t;){if(t instanceof Element&&t.localName===Cg)return t;t=t instanceof ShadowRoot?t.host:t.parentNode}return null}function jg(){let e=window.renderMath;return typeof e==`function`?e:null}async function Mg(e){let t=Ag(e);if(!t)return null;let n=jg();if(n||t.mathRenderingModuleUrlImported!==!0)return n;let r=Date.now()+Tg;for(;Date.now()<r;){await new Promise(e=>setTimeout(e,wg));let e=jg();if(e)return e}return null}var Ng=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=kg(),i=r||t?null:await Mg(n);return r?(await r.renderMath?.(n),Mh(n)):i&&i!==Ng?(await i(n),Mh(n)):await Og()(n),t?n.innerHTML:void 0};function Pg(e){return e?e.trim().replace(/_/g,`-`).split(/[.@]/)[0].toLowerCase():``}function Fg(e){return e?e.trim().replace(/_/g,`-`):``}function Ig(e){let t=Pg(e);if(!t)return[];let n=t.split(`-`),r=[];for(let e=n.length;e>0;e--){let t=n.slice(0,e);t.length>1&&t[t.length-1].length===1||r.push(t.join(`-`))}return r}function Lg(e,t){for(let n of Ig(e)){let e=t.find(e=>Pg(e)===n);if(e!=null)return e}}var Rg=`en-US`,zg=new Set([`ar`,`ckb`,`dv`,`fa`,`he`,`iw`,`ks`,`ku`,`nqo`,`ps`,`sd`,`syr`,`ug`,`ur`,`yi`]),Bg=new Set([`zero`,`one`,`two`,`few`,`many`,`other`]);function Vg(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e);return t.length>0&&t.every(e=>Bg.has(e))}function Hg(e){try{let t=new Intl.Locale(e).textInfo;if(t?.direction===`rtl`||t?.direction===`ltr`)return t.direction}catch{}let t=Pg(e).split(`-`)[0]??``;return zg.has(t)?`rtl`:`ltr`}var Ug=class e{static{this.pluralRules=new Map}constructor(e){this.listeners=new Set,this.config={...e},this.fallbackLocale=Fg(e.fallbackLocale)||`en-US`,this.catalogs=new Map([[Rg,e.source]]),this.customMessages={...e.customMessages??{}},this.loading=new Map,this.locale=this.resolveLocaleTag(e.locale)??`en-US`}getLocale(){return this.locale}async setLocale(e){let t=this.resolveLocaleTag(e);if(!t){this.locale=Fg(e)||`en-US`,this.notify();return}await this.ensureLoaded(t),this.locale=t,this.notify()}t(e,t){let n=this.lookup(e);return n===void 0?(this.config.onMissingKey?.(e,this.locale),e):qg(n,t,this.locale)}plural(e,t){let n=this.lookupNode(e);return n===void 0||!Vg(n)?this.t(e,t):qg(n[this.selectPluralCategory(t.count)]??n.other,t,this.locale)}getDirection(){return Hg(this.locale)}getAvailableLocales(){return[...new Set([...this.catalogs.keys(),...this.config.availableLocales??[],...Object.keys(this.customMessages)])]}isLocaleLoaded(e){let t=this.resolveLocaleTag(e);return t!==void 0&&this.catalogs.has(t)}needsLoad(e){let t=this.resolveLocaleTag(e);return t!==void 0&&!this.catalogs.has(t)&&this.config.availableLocales?.includes(t)===!0}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}hasKey(e){return this.lookup(e)!==void 0}addCustomMessages(e,t){let n=Fg(e);this.customMessages[n]=Jg(this.customMessages[n]??{},t),this.notify()}withLocale(t){let n=this.resolveLocaleTag(t)??Fg(t);if(n===this.locale)return this;let r=new e({...this.config,locale:n});return r.locale=n||`en-US`,r.catalogs=this.catalogs,r.customMessages=this.customMessages,r.loading=this.loading,r}formatNumber(e,t){try{return new Intl.NumberFormat(this.locale,t).format(e)}catch{return new Intl.NumberFormat(Rg,t).format(e)}}formatDate(e,t){try{return new Intl.DateTimeFormat(this.locale,t).format(e)}catch{return new Intl.DateTimeFormat(Rg,t).format(e)}}async ensureLoaded(e){if(this.catalogs.has(e)||!this.config.availableLocales?.includes(e))return;let t=this.loading.get(e);if(t){await t;return}let n=this.loadCatalog(e);this.loading.set(e,n);try{await n}finally{this.loading.delete(e)}}resolveLocaleTag(e){if(!e)return;let t=this.getAvailableLocales(),n=Lg(e,t);if(n)return n;let r=Pg(e).split(`-`)[0];if(r)return t.find(e=>Pg(e).split(`-`)[0]===r)}async loadCatalog(e){let t=this.config.loadCatalog;if(t)try{this.catalogs.set(e,await t(e))}catch(t){throw Error(`Failed to load i18n catalog for locale: ${e}`,{cause:t})}}lookupNode(e){let t=[this.customMessages[this.locale],this.catalogs.get(this.locale),this.customMessages[this.fallbackLocale],this.catalogs.get(this.fallbackLocale)];for(let n of t){let t=Wg(n,e);if(t!==void 0)return t}}lookup(e){let t=this.lookupNode(e);if(typeof t==`string`)return t;if(t!==void 0&&Vg(t))return t.other}selectPluralCategory(t){let n=e.pluralRules.get(this.locale);if(!n){try{n=new Intl.PluralRules(this.locale)}catch{return t===1?`one`:`other`}e.pluralRules.set(this.locale,n)}return n.select(t)}notify(){for(let e of this.listeners)e()}};function Wg(e,t){if(!e)return;let n=e;for(let e of t.split(`.`))if(typeof n!=`object`||!n||(n=n[e],n===void 0))return;return n}var Gg=new Map;function Kg(e,t){let n=Gg.get(t);if(!n){try{n=new Intl.NumberFormat(t)}catch{n=new Intl.NumberFormat(Rg)}Gg.set(t,n)}return n.format(e)}function qg(e,t,n){return t?e.replace(/\{(\w+)\}/g,(e,r)=>{let i=t[r];return i==null?e:n!==void 0&&typeof i==`number`&&Number.isFinite(i)?Kg(i,n):String(i)}):e}function Jg(e,t){let n={...e};for(let[e,r]of Object.entries(t)){let t=n[e];r&&typeof r==`object`&&t&&typeof t==`object`?n[e]=Jg(t,r):n[e]=r}return n}var Yg=Symbol.for(`pie-element.i18n.registry`);function Xg(){let e=globalThis;return e[Yg]||(e[Yg]={sets:new Set,messages:new Map}),e[Yg]}function Zg(e){let t=e.loaders??{},n=Xg(),r=new Ug({source:e.source,availableLocales:[Rg,...Object.keys(t)],loadCatalog:async e=>(await t[e]()).default});for(let{locale:t,messages:i}of n.messages.get(e.packageName)??[])r.addCustomMessages(t,i);let i=new Map,a=new Map,o=new Set,s=e=>{let t=e||`en-US`,n=i.get(t);return n||(n=r.withLocale(t),i.set(t,n)),n},c={packageName:e.packageName,locales:[Rg,...Object.keys(t)],forLocale:(e,t)=>(t&&e&&c.needsLoad(e)&&c.load(e).then(t),s(e)),needsLoad:e=>!o.has(e)&&r.needsLoad(e),load:t=>{if(!c.needsLoad(t))return Promise.resolve();let n=a.get(t);return n||(n=s(t).setLocale(t).catch(n=>{o.add(t),console.warn(`[${e.packageName}]`,n)}).finally(()=>a.delete(t)),a.set(t,n)),n},addCustomMessages:(e,t)=>{r.addCustomMessages(e,t),i.clear()}};return n.sets.add(c),c}var Qg=Zg({packageName:`@pie-lib/render-ui`,source:{playAudio:`Play audio`,show:`Show`,hide:`Hide`},loaders:{}}),$g=e=>`${e}-${Math.random().toString(36).slice(2,10)}`,e_=e=>R.useState(()=>$g(e))[0],t_=G(`button`)({display:`inline-block`,minHeight:`24px`,padding:0,border:0,background:`transparent`,font:`inherit`,textAlign:`inherit`,color:Sf(),cursor:`pointer`}),n_=G(`span`)({borderBottom:`1px dotted currentColor`}),r_=G(Tp)(({theme:e})=>({paddingTop:e.spacing(2)})),i_=class extends R.Component{static propTypes={className:y.string,children:y.object,labels:y.shape({visible:y.string,hidden:y.string}),language:y.string};static defaultProps={labels:{}};state={expanded:!1};panelId=$g(`pie-collapsible`);toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))};relabel=()=>this.forceUpdate();componentDidMount(){Ng(this.root)}componentDidUpdate(){Ng(this.root)}render(){let{labels:e,children:t,className:n,language:r}=this.props,{expanded:i}=this.state,a=Qg.forLocale(r,this.relabel),o=i?e.visible||a.t(`hide`):e.hidden||a.t(`show`);return(0,B.jsxs)(`div`,{className:n,ref:e=>this.root=e,children:[(0,B.jsx)(`div`,{children:(0,B.jsx)(t_,{type:`button`,"aria-expanded":i,"aria-controls":this.panelId,onClick:this.toggleExpanded,children:(0,B.jsx)(n_,{children:o})})}),(0,B.jsx)(`div`,{id:this.panelId,children:(0,B.jsx)(r_,{in:i,timeout:{enter:225,exit:195},unmountOnExit:!0,children:t})})]})}};function a_(e){try{return e.matches(`:focus-visible`)}catch{}return!1}var o_=class e{static create(){return new e}static use(){let t=Ls(e.create).current,[n,r]=R.useState(!1);return t.shouldMount=n,t.setShouldMount=r,R.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=c_(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then(()=>this.ref.current?.start(...e))}stop(...e){this.mount().then(()=>this.ref.current?.stop(...e))}pulsate(...e){this.mount().then(()=>this.ref.current?.pulsate(...e))}};function s_(){return o_.use()}function c_(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}function l_(e){let{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:a,rippleSize:o,in:s,onExited:c,timeout:l}=e,[u,d]=R.useState(!1),f=V(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:o,height:o,top:-(o/2)+a,left:-(o/2)+i},m=V(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&d(!0),R.useEffect(()=>{if(!s&&c!=null){let e=setTimeout(c,l);return()=>{clearTimeout(e)}}},[c,s,l]),(0,B.jsx)(`span`,{className:f,style:p,children:(0,B.jsx)(`span`,{className:m})})}var u_=Lr(`MuiTouchRipple`,[`root`,`ripple`,`rippleVisible`,`ripplePulsate`,`child`,`childLeaving`,`childPulsate`]),d_=550,f_=Pt`
|
|
85
|
+
`;function eh(e=document){if(e.getElementById(`PIE-MJX-explorer-styles`))return;let t=e.createElement(`style`);t.id=qm,t.textContent=$m,e.head.appendChild(t)}var th=/[-]/g,nh={"+":`positive`,"-":`negative`,"−":`negative`,"±":`plus or minus`,"∓":`minus or plus`},rh={"(":`open parenthesis`,"[":`open bracket`,"{":`open brace`,"⟨":`open angle bracket`,"⌊":`open floor`,"⌈":`open ceiling`},ih={")":`close parenthesis`,"]":`close bracket`,"}":`close brace`,"⟩":`close angle bracket`,"⌋":`close floor`,"⌉":`close ceiling`},ah={"!":`factorial`,"%":`percent`,"°":`degrees`,"′":`prime`,"″":`double prime`},oh={"+":`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`,...rh,...ih,...ah},sh=new Set([`|`,`‖`]),ch=new Set([`∑`,`∏`,`∫`,`∪`,`∩`]),lh={α:`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`},uh={"¯":`bar`,"‾":`bar`,"―":`bar`,"^":`hat`,ˆ:`hat`,"~":`tilde`,"˜":`tilde`,"→":`vector`,"⃗":`vector`,"˙":`dot`},dh=e=>(e.textContent??``).replace(th,``).replace(/\s+/g,` `).trim(),fh=e=>e.replace(/\s+/g,` `).trim(),ph=e=>[...e.children];function mh(e){return!e||[`mn`,`mi`,`mtext`,`mo`].includes(e.localName)?!0:[`mrow`,`mstyle`].includes(e.localName)&&e.children.length===1?mh(e.children[0]):!1}function hh(e){let t=e?dh(e):``;return/^\d{1,3}$/.test(t)?Number(t):void 0}function gh(e){return`${e}${e%100>=11&&e%100<=13?`th`:{1:`st`,2:`nd`,3:`rd`}[e%10]??`th`}`}function _h(e){return lh[e]??e}function vh(e){return oh[e]??e}function yh(e){let t=[],n=!1;for(let r of e){if(r.localName!==`mo`){t.push(Oh(r)),n=!0;continue}let e=dh(r);e&&(!n&&nh[e]?t.push(nh[e]):e in ah?t.push(ah[e]):(t.push(vh(e)),n=e in ih||sh.has(e)&&n))}return t.filter(Boolean).join(` `)}function bh(e){let[t,...n]=e,r=n[n.length-1],i=e=>e?.localName===`mo`&&[`|`,`‖`].includes(dh(e)),a=n.slice(0,-1);if(a.length&&i(t)&&i(r)&&dh(t)===dh(r)&&!a.some(i)){let e=fh(yh(a));return dh(t)===`|`?`absolute value of ${e} end absolute value`:`norm of ${e} end norm`}return yh(e)}function xh(e,t){let n=e?Oh(e):``,r=t?Oh(t):``;return mh(e)&&mh(t)?`${n} over ${r}`:`the fraction with numerator ${n} and denominator ${r}`}function Sh(e,t,n){return n?`${t} of ${e}`:`${t} of ${e} end root`}function Ch(e,t){let n=t?dh(t):``;if(t&&mh(t)){if(n===`2`)return`${e} squared`;if(n===`3`)return`${e} cubed`;if(n in ah)return`${e} ${ah[n]}`}let r=t?Oh(t):``;return mh(t)?`${e} to the power of ${r}`:`${e} to the power of ${r} end power`}function wh(e,t){let n=t?Oh(t):``;return mh(t)?`${e} sub ${n}`:`${e} sub ${n} end sub`}function Th(e,t,n){let r=dh(e);if(r===`lim`)return`limit as ${t?Oh(t):``} of`;if(!ch.has(r))return;let i=t?`from ${Oh(t)}`:``,a=n?`to ${Oh(n)}`:``;return`${vh(r)} ${i} ${a} of`}function Eh(e){let t=ph(e).filter(e=>[`mtr`,`mlabeledtr`].includes(e.localName)),n=t.map(e=>ph(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=>fh(yh(ph(e)))).join(`, `)}`);return`table with ${t.length} ${t.length===1?`row`:`rows`} and ${r} ${r===1?`column`:`columns`}. ${i.join(`. `)}`}function Dh(e){let t=e.getAttribute(`open`)??`(`,n=e.getAttribute(`close`)??`)`,r=(e.getAttribute(`separators`)??`,`).replace(/\s+/g,``).split(``),i=ph(e).map((e,t,n)=>t<n.length-1?`${Oh(e)} ${vh(r[Math.min(t,r.length-1)]??`,`)}`:Oh(e));return[vh(t),...i,vh(n)].filter(Boolean).join(` `)}function Oh(e){let t=ph(e);switch(e.localName){case`mi`:return _h(dh(e));case`mn`:case`mtext`:case`ms`:return dh(e);case`mo`:return vh(dh(e));case`mspace`:case`mphantom`:case`annotation`:case`annotation-xml`:return``;case`semantics`:return t[0]?Oh(t[0]):``;case`mfrac`:return xh(t[0],t[1]);case`msqrt`:return Sh(fh(yh(t)),`square root`,t.length===1&&mh(t[0]));case`mroot`:{let e=hh(t[1]),n=e===2?`square root`:e===3?`cube root`:e?`${gh(e)} root`:`root with index ${t[1]?Oh(t[1]):``}`;return Sh(t[0]?Oh(t[0]):``,n,mh(t[0]))}case`msup`:return Ch(t[0]?Oh(t[0]):``,t[1]);case`msub`:return wh(t[0]?Oh(t[0]):``,t[1]);case`msubsup`:return(t[0]?Th(t[0],t[1],t[2]):void 0)||Ch(wh(t[0]?Oh(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?Th(n,a,o):void 0;if(s)return s;let c=n?Oh(n):``,l=e.localName===`mover`&&r?uh[dh(r)]:void 0;return l?l===`vector`?`vector ${c}`:`${c} ${l}`:[c,a?`with ${Oh(a)} below`:``,o?`with ${Oh(o)} above`:``].filter(Boolean).join(` `)}case`mfenced`:return Dh(e);case`mtable`:return Eh(e);case`mrow`:case`math`:return bh(t);default:return t.length?yh(t):dh(e)}}function kh(e){return fh(Oh(e))}var Ah=[`a[href]`,`button`,`label`,`summary`,...[`button`,`checkbox`,`combobox`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`switch`,`tab`,`treeitem`].map(e=>`[role="${e}"]`)].join(`, `);function jh(e){if(e.hasAttribute(`aria-label`)||!e.closest(Ah))return;let t=e.querySelector(`math`),n=t?kh(t):``;n&&e.setAttribute(`aria-label`,n)}function Mh(e){for(let t of e.querySelectorAll(`mjx-container`))jh(t)}var Nh=Symbol.for(`@pie-element/shared-math-rendering-mathjax/speech-worker-failed`);function Ph(){let e=globalThis;e[Nh]||(e[Nh]=!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 ${Dp}`))}function Fh(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(),Ph()}function Ih(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`,()=>Fh(e),{once:!0}),a})}`${Ap}`;var Lh={parallelogram:`\\lower.2em{\\Huge\\unicode{x25B1}}`,overarc:`\\overparen`,napprox:`\\not\\approx`,longdiv:`\\enclose{longdiv}`,abs:[`\\left|#1\\right|`,1],perpendicular:`\\perp`,divide:`\\div`},Rh=/\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/,zh=/\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/,Bh=/\\embed\{newLine\}\[\]/g,Vh=[[`$$`,`$$`],[`$`,`$`],[`\\[`,`\\]`],[`\\(`,`\\)`]];function Hh(e){for(let[t,n]of Vh)if(e.startsWith(t)&&e.endsWith(n))return e.substring(t.length,e.length-n.length);return e}function Uh(e){return`\\(${Hh(e.includes(`\\displaystyle`)?e.replace(`\\displaystyle`,``).trim():e)}\\)`.replace(Bh,`\\newline `)}var Wh=`mathjax_ignore`,Gh=`mathjax_process`,Kh=`[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)`,qh=Symbol.for(`@pie-element/shared-math-rendering-mathjax/loading`),Jh=`MJX-CHTML-styles`,Yh=`PIE-MJX-SVG-styles`,Xh=`PIE-MathJax-Menu-Settings`,Zh={'mjx-container[overflow="linebreak"][display]':{overflow:`auto clip`,"min-width":`initial !important`}},Qh=200,$h=201,eg=202;function tg(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 ng(e,t){let n=e.closest(`.${Wh}, .${Gh}`);return n!==null&&t.contains(n)&&!n.classList.contains(`mathjax_process`)}function rg(e){for(let t of e.querySelectorAll(`[data-latex]`)){if(t.dataset.mathHandled||t.closest(`mjx-container`)||ng(t,e))continue;let n=t.textContent;n&&(t.textContent=Uh(n),t.dataset.mathHandled=`true`)}}function ig(e){for(let t of e.querySelectorAll(`math`))t.closest(`mjx-container`)||t.setAttribute(`displaystyle`,`true`)}function ag(e,t){for(let t of e.querySelectorAll(`math`))if(!t.closest(`mjx-assistive-mml`))return!0;return(t?zh:Rh).test(e.textContent??``)}function og(e){return new Promise((t,n)=>{let{useSingleDollar:r=!1,accessibility:i=!0,loadFonts:a=!0,srcUrl:o}=e,s=Rp(e,{}.url),c=Pp(),l={loader:{load:i?[`a11y/assistive-mml`]:[],failed:e=>n(e),"output/svg":{ready:e=>{let t=Xp();return sg(t)&&cg(t),e}}},startup:{typeset:!1,ready:()=>{let e=Xp(),r=e?.startup,i=sg(e);i&&(cg(e),lg(e,s.speechLocales),zp(e?._?.a11y?.sre_ts?.locales,s.speechLocales)),r?.defaultReady?.(),i&&(ug(r?.document),dg(r?.document),r?.document?.addStyles?.(Zh),Ih(r?.document)),Promise.resolve(r?.promise).then(()=>t(),n)}},tex:{macros:{...Lh}},output:{displayOverflow:`linebreak`},options:{enableMenu:i,menuOptions:{settings:{assistiveMml:i,enrich:!1,inTabOrder:c}},a11y:{inTabOrder:c}}};r&&l.tex&&(console.warn(Kh),l.tex.inlineMath=[[`$`,`$`],[`\\(`,`\\)`]],l.tex.processEscapes=!0),a||(l.chtml={fontURL:``});let u=Bp(s.speechLocales);u&&l.options&&(l.options.sre={locale:u}),Qp(l,{...s,srcUrl:o}).then(e=>{e||t()},n)})}function sg(e){return!!e?.version?.startsWith(`4.`)}function cg(e){let t=e?._?.output,n=t?.chtml_ts?.CHTML;n&&(n.STYLESHEETID=em);let r=t?.svg_ts?.SVG;r&&(r.STYLESHEETID=Yh)}function lg(e,t){let n=e?._?.ui?.menu?.Menu?.Menu;if(n){n.MENU_STORAGE=Xh;try{let e=localStorage.getItem(Xh);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(Xh,JSON.stringify(i)):localStorage.removeItem(Xh)}catch{}}}function ug(e){if(!e)return;let t=new WeakSet,n=e=>{let n=e.typesetRoot;!n||t.has(n)||(tg(n),t.add(n))};e.addRenderAction?.(`pie-strip-latex`,$h,e=>{for(let t of e.math??[])n(t);return!1},e=>{let t=e.typesetRoot;return t&&tg(t),!1});let r=e.outputJax?.chtmlStyles;r?.id===Jh&&(r.id=em),mg()}function dg(e){let t=e=>{e.typesetRoot&&jh(e.typesetRoot)};e?.addRenderAction?.(`pie-name-math`,eg,e=>{for(let n of e.math??[])t(n);return!1},e=>(t(e),!1))}function fg(e){return e instanceof HTMLStyleElement&&tm.includes(e.id)}function pg(e){Jp(`foreign-output-stylesheet`,`another MathJax added <style id="${e.id}"> to <head>`)}function mg(){let e=document.head,t=[...e.children].find(fg);if(t){pg(t);return}let n=new MutationObserver(e=>{for(let t of e){let e=[...t.addedNodes].find(fg);if(e){pg(e),n.disconnect();return}}});n.observe(e,{childList:!0})}function hg(e){let t=e?.math;if(!t?.remove)return;let n=[...t].filter(e=>(e.state?.()??0)>=Qh&&e.typesetRoot?.isConnected===!1);if(n.length!==0){for(let e of[...n].reverse())e.clear?.();t.remove(...n)}}function gg(e){return new Promise((t,n)=>{let r=e.startup??{};e.startup=r;let i=r.ready;r.ready=()=>{let e=Xp()?.startup;i?i.call(r):e?.defaultReady?.(),Promise.resolve(e?.promise).then(()=>t(),n)}})}function _g(e){let t=Xp();return t?t.version?t.startup?.promise?Promise.resolve(t.startup.promise).then(()=>void 0):Promise.resolve():gg(t):og(e)}function vg(e){return _g(e).then(()=>{let e=Xp();e&&typeof e.typesetPromise!=`function`&&console.warn(`[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.`)})}function yg(e){let t=$p,n=t[qh];return n||(n=vg(e),t[qh]=n),n}function bg(e={}){let t=e.useSingleDollar??!1;return async n=>{if(typeof window>`u`)return;let r=nm();r&&Jp(`mathjax-3-global`,`window.MathJax is MathJax ${r}`),rg(n),om(n),ig(n),Km(n);let i=yg(e);if(!ag(n,t)){i.catch(()=>{});return}await i;let a=Xp();if(await a?.startup?.promise,typeof a?.typesetPromise==`function`){eh(),hg(a.startup?.document);try{await a.typesetPromise([n])}catch(e){throw a.typesetClear?.([n]),e}tg(n),Mh(n)}}}var xg=`@pie-lib/math-rendering`,Sg=`@pie-lib/math-rendering@2`,Cg=`pie-print`,wg=50,Tg=1e4,Eg=null;function Dg(){return!!window[Sg]?.opts?.useSingleDollar}function Og(){return Eg||=bg({useSingleDollar:Dg()}),Eg}function kg(){if(typeof window>`u`)return null;let e=window[xg];return typeof e?.renderMath==`function`&&e.renderMath!==Ng?e:null}function Ag(e){let t=e;for(;t;){if(t instanceof Element&&t.localName===Cg)return t;t=t instanceof ShadowRoot?t.host:t.parentNode}return null}function jg(){let e=window.renderMath;return typeof e==`function`?e:null}async function Mg(e){let t=Ag(e);if(!t)return null;let n=jg();if(n||t.mathRenderingModuleUrlImported!==!0)return n;let r=Date.now()+Tg;for(;Date.now()<r;){await new Promise(e=>setTimeout(e,wg));let e=jg();if(e)return e}return null}var Ng=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=kg(),i=r||t?null:await Mg(n);return r?(await r.renderMath?.(n),Mh(n)):i&&i!==Ng?(await i(n),Mh(n)):await Og()(n),t?n.innerHTML:void 0};function Pg(e){return e?e.trim().replace(/_/g,`-`).split(/[.@]/)[0].toLowerCase():``}function Fg(e){return e?e.trim().replace(/_/g,`-`):``}function Ig(e){let t=Pg(e);if(!t)return[];let n=t.split(`-`),r=[];for(let e=n.length;e>0;e--){let t=n.slice(0,e);t.length>1&&t[t.length-1].length===1||r.push(t.join(`-`))}return r}function Lg(e,t){for(let n of Ig(e)){let e=t.find(e=>Pg(e)===n);if(e!=null)return e}}var Rg=`en-US`,zg=new Set([`ar`,`ckb`,`dv`,`fa`,`he`,`iw`,`ks`,`ku`,`nqo`,`ps`,`sd`,`syr`,`ug`,`ur`,`yi`]),Bg=new Set([`zero`,`one`,`two`,`few`,`many`,`other`]);function Vg(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e);return t.length>0&&t.every(e=>Bg.has(e))}function Hg(e){try{let t=new Intl.Locale(e).textInfo;if(t?.direction===`rtl`||t?.direction===`ltr`)return t.direction}catch{}let t=Pg(e).split(`-`)[0]??``;return zg.has(t)?`rtl`:`ltr`}var Ug=class e{static{this.pluralRules=new Map}constructor(e){this.listeners=new Set,this.config={...e},this.fallbackLocale=Fg(e.fallbackLocale)||`en-US`,this.catalogs=new Map([[Rg,e.source]]),this.customMessages={...e.customMessages??{}},this.loading=new Map,this.locale=this.resolveLocaleTag(e.locale)??`en-US`}getLocale(){return this.locale}async setLocale(e){let t=this.resolveLocaleTag(e);if(!t){this.locale=Fg(e)||`en-US`,this.notify();return}await this.ensureLoaded(t),this.locale=t,this.notify()}t(e,t){let n=this.lookup(e);return n===void 0?(this.config.onMissingKey?.(e,this.locale),e):qg(n,t,this.locale)}plural(e,t){let n=this.lookupNode(e);return n===void 0||!Vg(n)?this.t(e,t):qg(n[this.selectPluralCategory(t.count)]??n.other,t,this.locale)}getDirection(){return Hg(this.locale)}getAvailableLocales(){return[...new Set([...this.catalogs.keys(),...this.config.availableLocales??[],...Object.keys(this.customMessages)])]}isLocaleLoaded(e){let t=this.resolveLocaleTag(e);return t!==void 0&&this.catalogs.has(t)}needsLoad(e){let t=this.resolveLocaleTag(e);return t!==void 0&&!this.catalogs.has(t)&&this.config.availableLocales?.includes(t)===!0}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}hasKey(e){return this.lookup(e)!==void 0}addCustomMessages(e,t){let n=Fg(e);this.customMessages[n]=Jg(this.customMessages[n]??{},t),this.notify()}withLocale(t){let n=this.resolveLocaleTag(t)??Fg(t);if(n===this.locale)return this;let r=new e({...this.config,locale:n});return r.locale=n||`en-US`,r.catalogs=this.catalogs,r.customMessages=this.customMessages,r.loading=this.loading,r}formatNumber(e,t){try{return new Intl.NumberFormat(this.locale,t).format(e)}catch{return new Intl.NumberFormat(Rg,t).format(e)}}formatDate(e,t){try{return new Intl.DateTimeFormat(this.locale,t).format(e)}catch{return new Intl.DateTimeFormat(Rg,t).format(e)}}async ensureLoaded(e){if(this.catalogs.has(e)||!this.config.availableLocales?.includes(e))return;let t=this.loading.get(e);if(t){await t;return}let n=this.loadCatalog(e);this.loading.set(e,n);try{await n}finally{this.loading.delete(e)}}resolveLocaleTag(e){if(!e)return;let t=this.getAvailableLocales(),n=Lg(e,t);if(n)return n;let r=Pg(e).split(`-`)[0];if(r)return t.find(e=>Pg(e).split(`-`)[0]===r)}async loadCatalog(e){let t=this.config.loadCatalog;if(t)try{this.catalogs.set(e,await t(e))}catch(t){throw Error(`Failed to load i18n catalog for locale: ${e}`,{cause:t})}}lookupNode(e){let t=[this.customMessages[this.locale],this.catalogs.get(this.locale),this.customMessages[this.fallbackLocale],this.catalogs.get(this.fallbackLocale)];for(let n of t){let t=Wg(n,e);if(t!==void 0)return t}}lookup(e){let t=this.lookupNode(e);if(typeof t==`string`)return t;if(t!==void 0&&Vg(t))return t.other}selectPluralCategory(t){let n=e.pluralRules.get(this.locale);if(!n){try{n=new Intl.PluralRules(this.locale)}catch{return t===1?`one`:`other`}e.pluralRules.set(this.locale,n)}return n.select(t)}notify(){for(let e of this.listeners)e()}};function Wg(e,t){if(!e)return;let n=e;for(let e of t.split(`.`))if(typeof n!=`object`||!n||(n=n[e],n===void 0))return;return n}var Gg=new Map;function Kg(e,t){let n=Gg.get(t);if(!n){try{n=new Intl.NumberFormat(t)}catch{n=new Intl.NumberFormat(Rg)}Gg.set(t,n)}return n.format(e)}function qg(e,t,n){return t?e.replace(/\{(\w+)\}/g,(e,r)=>{let i=t[r];return i==null?e:n!==void 0&&typeof i==`number`&&Number.isFinite(i)?Kg(i,n):String(i)}):e}function Jg(e,t){let n={...e};for(let[e,r]of Object.entries(t)){let t=n[e];r&&typeof r==`object`&&t&&typeof t==`object`?n[e]=Jg(t,r):n[e]=r}return n}var Yg=Symbol.for(`pie-element.i18n.registry`);function Xg(){let e=globalThis;return e[Yg]||(e[Yg]={sets:new Set,messages:new Map}),e[Yg]}function Zg(e){let t=e.loaders??{},n=Xg(),r=new Ug({source:e.source,availableLocales:[Rg,...Object.keys(t)],loadCatalog:async e=>(await t[e]()).default});for(let{locale:t,messages:i}of n.messages.get(e.packageName)??[])r.addCustomMessages(t,i);let i=new Map,a=new Map,o=new Set,s=e=>{let t=e||`en-US`,n=i.get(t);return n||(n=r.withLocale(t),i.set(t,n)),n},c={packageName:e.packageName,locales:[Rg,...Object.keys(t)],forLocale:(e,t)=>(t&&e&&c.needsLoad(e)&&c.load(e).then(t),s(e)),needsLoad:e=>!o.has(e)&&r.needsLoad(e),load:t=>{if(!c.needsLoad(t))return Promise.resolve();let n=a.get(t);return n||(n=s(t).setLocale(t).catch(n=>{o.add(t),console.warn(`[${e.packageName}]`,n)}).finally(()=>a.delete(t)),a.set(t,n)),n},addCustomMessages:(e,t)=>{r.addCustomMessages(e,t),i.clear()}};return n.sets.add(c),c}var Qg=Zg({packageName:`@pie-lib/render-ui`,source:{playAudio:`Play audio`,show:`Show`,hide:`Hide`},loaders:{}}),$g=e=>`${e}-${Math.random().toString(36).slice(2,10)}`,e_=e=>R.useState(()=>$g(e))[0],t_=G(`button`)({display:`inline-block`,minHeight:`24px`,padding:0,border:0,background:`transparent`,font:`inherit`,textAlign:`inherit`,color:Sf(),cursor:`pointer`}),n_=G(`span`)({borderBottom:`1px dotted currentColor`}),r_=G(Tp)(({theme:e})=>({paddingTop:e.spacing(2)})),i_=class extends R.Component{static propTypes={className:y.string,children:y.object,labels:y.shape({visible:y.string,hidden:y.string}),language:y.string};static defaultProps={labels:{}};state={expanded:!1};panelId=$g(`pie-collapsible`);toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))};relabel=()=>this.forceUpdate();componentDidMount(){Ng(this.root)}componentDidUpdate(){Ng(this.root)}render(){let{labels:e,children:t,className:n,language:r}=this.props,{expanded:i}=this.state,a=Qg.forLocale(r,this.relabel),o=i?e.visible||a.t(`hide`):e.hidden||a.t(`show`);return(0,B.jsxs)(`div`,{className:n,ref:e=>this.root=e,children:[(0,B.jsx)(`div`,{children:(0,B.jsx)(t_,{type:`button`,"aria-expanded":i,"aria-controls":this.panelId,onClick:this.toggleExpanded,children:(0,B.jsx)(n_,{children:o})})}),(0,B.jsx)(`div`,{id:this.panelId,children:(0,B.jsx)(r_,{in:i,timeout:{enter:225,exit:195},unmountOnExit:!0,children:t})})]})}};function a_(e){try{return e.matches(`:focus-visible`)}catch{}return!1}var o_=class e{static create(){return new e}static use(){let t=Ls(e.create).current,[n,r]=R.useState(!1);return t.shouldMount=n,t.setShouldMount=r,R.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=c_(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then(()=>this.ref.current?.start(...e))}stop(...e){this.mount().then(()=>this.ref.current?.stop(...e))}pulsate(...e){this.mount().then(()=>this.ref.current?.pulsate(...e))}};function s_(){return o_.use()}function c_(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}function l_(e){let{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:a,rippleSize:o,in:s,onExited:c,timeout:l}=e,[u,d]=R.useState(!1),f=V(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:o,height:o,top:-(o/2)+a,left:-(o/2)+i},m=V(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&d(!0),R.useEffect(()=>{if(!s&&c!=null){let e=setTimeout(c,l);return()=>{clearTimeout(e)}}},[c,s,l]),(0,B.jsx)(`span`,{className:f,style:p,children:(0,B.jsx)(`span`,{className:m})})}var u_=Lr(`MuiTouchRipple`,[`root`,`ripple`,`rippleVisible`,`ripplePulsate`,`child`,`childLeaving`,`childPulsate`]),d_=550,f_=Pt`
|
|
86
86
|
0% {
|
|
87
87
|
transform: scale(0);
|
|
88
88
|
opacity: 0.1;
|
|
@@ -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/match@13.0.6
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/match@13.0.6/dist/schemas/configuration.schema.json",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
6
6
|
"baseInputConfiguration": {
|
|
@@ -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/match@13.0.6
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/match@13.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/match@13.0.6
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/match@13.0.6/dist/schemas/session.schema.json",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
6
6
|
"id": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/match",
|
|
3
|
-
"version": "13.0.6
|
|
3
|
+
"version": "13.0.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,26 +11,26 @@
|
|
|
11
11
|
"@emotion/react": "^11.14.0",
|
|
12
12
|
"@mui/icons-material": "^7.3.4",
|
|
13
13
|
"@mui/material": "^7.3.4",
|
|
14
|
-
"@pie-element/shared-utils": "0.1.5
|
|
15
|
-
"@pie-lib/correct-answer-toggle": "5.0.6
|
|
16
|
-
"@pie-lib/render-ui": "8.0.6
|
|
17
|
-
"@pie-lib/translator": "5.0.
|
|
14
|
+
"@pie-element/shared-utils": "0.1.5",
|
|
15
|
+
"@pie-lib/correct-answer-toggle": "5.0.6",
|
|
16
|
+
"@pie-lib/render-ui": "8.0.6",
|
|
17
|
+
"@pie-lib/translator": "5.0.1",
|
|
18
18
|
"debug": "^4.1.1",
|
|
19
19
|
"prop-types": "^15.8.1",
|
|
20
20
|
"clsx": "^2.1.1",
|
|
21
|
-
"@pie-element/shared-lodash": "0.1.
|
|
22
|
-
"@pie-lib/editable-html-tip-tap": "3.1.1
|
|
23
|
-
"@pie-lib/drag": "5.0.6
|
|
24
|
-
"@pie-lib/config-ui": "14.0.6
|
|
25
|
-
"@pie-element/shared-configure-events": "0.1.
|
|
21
|
+
"@pie-element/shared-lodash": "0.1.2",
|
|
22
|
+
"@pie-lib/editable-html-tip-tap": "3.1.1",
|
|
23
|
+
"@pie-lib/drag": "5.0.6",
|
|
24
|
+
"@pie-lib/config-ui": "14.0.6",
|
|
25
|
+
"@pie-element/shared-configure-events": "0.1.1",
|
|
26
26
|
"@dnd-kit/core": "^6.3.1",
|
|
27
|
-
"@pie-element/shared-feedback": "0.1.
|
|
28
|
-
"@pie-element/shared-controller-utils": "0.1.3
|
|
29
|
-
"@pie-element/shared-player-events": "0.2.
|
|
30
|
-
"@pie-element/shared-math-rendering-mathjax": "0.1.7
|
|
27
|
+
"@pie-element/shared-feedback": "0.1.2",
|
|
28
|
+
"@pie-element/shared-controller-utils": "0.1.3",
|
|
29
|
+
"@pie-element/shared-player-events": "0.2.0",
|
|
30
|
+
"@pie-element/shared-math-rendering-mathjax": "0.1.7",
|
|
31
31
|
"react": "^18.2.0",
|
|
32
32
|
"react-dom": "^18.2.0",
|
|
33
|
-
"@pie-element/shared-types": "0.2.2
|
|
33
|
+
"@pie-element/shared-types": "0.2.2"
|
|
34
34
|
},
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
},
|
|
104
104
|
"browserEditorRuntime": {
|
|
105
105
|
"name": "@pie-element/shared-editor-runtime",
|
|
106
|
-
"version": "0.1.
|
|
106
|
+
"version": "0.1.2",
|
|
107
107
|
"views": {
|
|
108
108
|
"delivery": "editor-runtime/delivery",
|
|
109
109
|
"author": "editor-runtime/author",
|