System.register([],(function(e,t){"use strict";return{execute:function(){function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,a;function resume(t,a){try{var n=e[t](a),r=n.value,o=r instanceof _AwaitValue;Promise.resolve(o?r.wrapped:r).then((function(e){o?resume("return"===t?"return":"next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?resume(t.key,t.arg):a=null}this._invoke=function send(e,n){return new Promise((function(r,o){var i={key:e,arg:n,resolve:r,reject:o,next:null};a?a=a.next=i:(t=a=i,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,a,n,r,o,i){try{var s=e[o](i),c=s.value}catch(e){return void a(e)}s.done?t(c):Promise.resolve(c).then(n,r)}function _asyncToGenerator(e){return function(){var t=this,a=arguments;return new Promise((function(n,r){var o=e.apply(t,a);function _next(e){asyncGeneratorStep(o,n,r,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,r,_next,_throw,"throw",e)}_next(void 0)}))}}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)}; /** * @file ext-mathjax.js * * @license MIT * * @copyright 2013 Jo Segaert * */ e("default",{name:"mathjax",init:function init(e){var a=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var n,r,o,i,s,c,l,u,h,m,d,x;return regeneratorRuntime.wrap((function _callee2$(p){for(;;)switch(p.prev=p.next){case 0:return d=function _saveMath(){var e=n("#mathjax_code_textarea").val();MathJax.Hub.queue.Push(["Text",l,"\\displaystyle{"+e+"}"]),MathJax.Hub.queue.Push((function(){var e=n(".MathJax_SVG"),t=n(e.html());t.find("use").each((function(){var e=n(this).attr("href")?n(this).attr("href").slice(1):n(this).attr("xlink:href").slice(1),t=n("#"+e).clone().removeAttr("id"),a=n(this).attr("x"),r=n(this).attr("y"),o=n(this).attr("transform");o&&(a||r)?t.attr("transform",o+" translate("+a+","+r+")"):o?t.attr("transform",o):(a||r)&&t.attr("transform","translate("+a+","+r+")"),n(this).replaceWith(t)})),t.removeAttr("style"),t.attr("xmlns","http://www.w3.org/2000/svg"),s.importSvgString(n("
").append(t.clone()).html(),!0),s.ungroupSelectedElement(),s.moveSelectedElements(u,h,!0)}))},n=e.$,r=e.importLocale,p.next=4,r();case 4:return o=p.sent,s=(i=a).canvas,"mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js",c=i.uiStrings,m=!1,n.extend(c,{mathjax:{embed_svg:"Save as mathematics",embed_mathml:"Save as figure",svg_save_warning:"The math will be transformed into a figure is manipulatable like everything else. You will not be able to manipulate the TeX-code anymore.",mathml_save_warning:"Advised. The math will be saved as a figure.",title:"Mathematics code editor"}}),x=[{id:"tool_mathjax",type:"mode",icon:"mathjax.png",events:{click:function click(){return _asyncToGenerator(regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(s.setMode("mathjax"),!1!==m){e.next=17;break}return n('
\x3c!-- Here is where MathJax creates the math --\x3e
Mathematics Editor
').insertAfter("#svg_prefs").hide(),n("#mathjax_container").draggable({cancel:"button,fieldset",containment:"window"}),n("#tool_mathjax_cancel").prepend(n.getSvgIcon("cancel",!0)).on("click touched",(function(){n("#mathjax").hide()})),n("#tool_mathjax_save").prepend(n.getSvgIcon("ok",!0)).on("click touched",(function(){d(),n("#mathjax").hide()})),n("body").addClass("tex2jax_ignore"),e.prev=7,e.next=10,t.import("mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js");case 10:MathJax.Hub.queue.Push((function(){l=MathJax.Hub.getAllJax("#mathjax_creator")[0],console.log(l),m=!0,console.log("MathJax Loaded")})),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(7),console.log("Failed loading MathJax."),n.alert("Failed loading MathJax. You will not be able to change the mathematics.");case 17:case"end":return e.stop()}}),_callee,null,[[7,13]])})))()}}}],p.abrupt("return",{name:o.name,svgicons:"mathjax-icons.xml",buttons:o.buttons.map((function(e,t){return Object.assign(x[t],e)})),mouseDown:function mouseDown(){if("mathjax"===s.getMode())return{started:!0}},mouseUp:function mouseUp(e){if("mathjax"===s.getMode()){var t=s.getZoom();return u=e.mouse_x/t,h=e.mouse_y/t,n("#mathjax").show(),{started:!1}}},callback:function callback(){n("