Files
ALC27/mathjax/input/tex/extensions/action.js
2025-12-22 12:20:15 +08:00

1 line
1.6 KiB
JavaScript

(()=>{"use strict";var t={d:(e,a)=>{for(var o in a)t.o(a,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{ActionConfiguration:()=>h,ActionMethods:()=>d});const a=("undefined"!=typeof window?window:global).MathJax._.components.global,o=(a.GLOBAL,a.isObject,a.combineConfig,a.combineDefaults,a.combineWithMathJax),n=(a.MathJax,MathJax._.input.tex.HandlerTypes),i=n.ConfigurationType,r=n.HandlerType,c=MathJax._.input.tex.Configuration,p=c.Configuration,l=(c.ConfigurationHandler,c.ParserConfiguration,MathJax._.input.tex.TexParser.default),s=MathJax._.input.tex.TokenMap,g=(s.parseResult,s.AbstractTokenMap,s.RegExpMap,s.AbstractParseMap,s.CharacterMap,s.DelimiterMap,s.MacroMap,s.CommandMap),u=(s.EnvironmentMap,MathJax._.input.tex.base.BaseMethods),M=(u.splitAlignArray,u.default),d={Toggle(t,e){const a=[];let o;for(;"\\endtoggle"!==(o=t.GetArgument(e));)a.push(new l(o,t.stack.env,t.configuration).mml());t.Push(t.create("node","maction",a,{actiontype:"toggle"}))},Mathtip(t,e){const a=t.ParseArg(e),o=t.ParseArg(e);t.Push(t.create("node","maction",[a,o],{actiontype:"tooltip"}))},Macro:M.Macro};new g("action-macros",{toggle:d.Toggle,mathtip:d.Mathtip,texttip:[d.Macro,"\\mathtip{#1}{\\text{#2}}",2]});const h=p.create("action",{[i.HANDLER]:{[r.MACRO]:["action-macros"]}});MathJax.loader&&MathJax.loader.checkVersion("[tex]/action","4.0.0","tex-extension"),o({_:{input:{tex:{action:{ActionConfiguration:e}}}}})})();