From abacb9fa35b987e99e65e4bf5e2063fd665d5779 Mon Sep 17 00:00:00 2001 From: icaparros-at-wiris Date: Mon, 20 Jun 2022 11:43:32 +0200 Subject: [PATCH] build(version) publish 7.29.0 --- CHANGES.md | 2 +- thirdpartylibs.xml | 2 +- tinymce/editor_plugin.js | 2 +- version.php | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3155bbf..41417b2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Last release of this plugin is 7.27.1 (9th of nov. 2021). -## [Unreleased] +## v7.29.0 - 20th jun. 2022 - fix(ci): moodle code checker errors (#19424) - Change links to make them have UTMs #KB-25028. diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index cfe822b..7daddf5 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ tinymce/editor_plugin.js MathType for TinyMCE4 - 7.27.0.0 + 7.29.0.0 GPL 3.0+ diff --git a/tinymce/editor_plugin.js b/tinymce/editor_plugin.js index 830a701..024c85d 100644 --- a/tinymce/editor_plugin.js +++ b/tinymce/editor_plugin.js @@ -1 +1 @@ -(()=>{"use strict";var __webpack_modules__={971:()=>{function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var md5,__WEBPACK_DEFAULT_EXPORT__=md5;(function(){var HxOverrides=function(){};HxOverrides.__name__=!0,HxOverrides.dateStr=function(e){var t=e.getMonth()+1,n=e.getDate(),i=e.getHours(),r=e.getMinutes(),a=e.getSeconds();return e.getFullYear()+"-"+(t<10?"0"+t:""+t)+"-"+(n<10?"0"+n:""+n)+" "+(i<10?"0"+i:""+i)+":"+(r<10?"0"+r:""+r)+":"+(a<10?"0"+a:""+a)},HxOverrides.strDate=function(e){switch(e.length){case 8:var t=e.split(":"),n=new Date;return n.setTime(0),n.setUTCHours(t[0]),n.setUTCMinutes(t[1]),n.setUTCSeconds(t[2]),n;case 10:t=e.split("-");return new Date(t[0],t[1]-1,t[2],0,0,0);case 19:var i=(t=e.split(" "))[0].split("-"),r=t[1].split(":");return new Date(i[0],i[1]-1,i[2],r[0],r[1],r[2]);default:throw"Invalid date format : "+e}},HxOverrides.cca=function(e,t){var n=e.charCodeAt(t);if(n==n)return n},HxOverrides.substr=function(e,t,n){return null!=t&&0!=t&&null!=n&&n<0?"":(null==n&&(n=e.length),t<0?(t=e.length+t)<0&&(t=0):n<0&&(n=e.length+n-t),e.substr(t,n))},HxOverrides.remove=function(e,t){for(var n=0,i=e.length;n>>32-t},str2blks:function(e){for(var t=1+(e.length+8>>6),n=new Array,i=0,r=16*t;i>2]|=HxOverrides.cca(e,a)<<(8*e.length+a)%4*8,a++;n[a>>2]|=128<<(8*e.length+a)%4*8;var o=8*e.length,s=16*t-2;return n[s]=255&o,n[s]|=(o>>>8&255)<<8,n[s]|=(o>>>16&255)<<16,n[s]|=(o>>>24&255)<<24,n},rhex:function(e){for(var t="",n="0123456789abcdef",i=0;i<4;){var r=i++;t+=n.charAt(e>>8*r+4&15)+n.charAt(e>>8*r&15)}return t},addme:function(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},bitAND:function(e,t){return(e>>>1&t>>>1)<<1|1&e&t},bitXOR:function(e,t){return(e>>>1^t>>>1)<<1|1&e^1&t},bitOR:function(e,t){return(e>>>1|t>>>1)<<1|(1&e|1&t)},__class__:haxe.Md5},haxe.Timer=function(e){var t=this;this.id=window.setInterval((function(){t.run()}),e)},haxe.Timer.__name__=!0,haxe.Timer.delay=function(e,t){var n=new haxe.Timer(t);return n.run=function(){n.stop(),e()},n},haxe.Timer.measure=function(e,t){var n=haxe.Timer.stamp(),i=e();return haxe.Log.trace(haxe.Timer.stamp()-n+"s",t),i},haxe.Timer.stamp=function(){return(new Date).getTime()/1e3},haxe.Timer.prototype={run:function(){},stop:function(){null!=this.id&&(window.clearInterval(this.id),this.id=null)},__class__:haxe.Timer};var js=js||{},$_;function $bind(e,t){var n=function e(){return e.method.apply(e.scope,arguments)};return n.scope=e,n.method=t,n}js.Boot=function(){},js.Boot.__name__=!0,js.Boot.__unhtml=function(e){return e.split("&").join("&").split("<").join("<").split(">").join(">")},js.Boot.__trace=function(e,t){var n,i=null!=t?t.fileName+":"+t.lineNumber+": ":"";i+=js.Boot.__string_rec(e,""),"undefined"!=typeof document&&null!=(n=document.getElementById("haxe:trace"))?n.innerHTML+=js.Boot.__unhtml(i)+"
":"undefined"!=typeof console&&null!=console.log&&console.log(i)},js.Boot.__clear_trace=function(){var e=document.getElementById("haxe:trace");null!=e&&(e.innerHTML="")},js.Boot.isClass=function(e){return e.__name__},js.Boot.isEnum=function(e){return e.__ename__},js.Boot.getClass=function(e){return e.__class__},js.Boot.__string_rec=function(e,t){if(null==e)return"null";if(t.length>=5)return"<...>";var n=_typeof(e);switch("function"==n&&(e.__name__||e.__ename__)&&(n="object"),n){case"object":if(e instanceof Array){if(e.__enum__){if(2==e.length)return e[0];var i=e[0]+"(";t+="\t";for(var r=2,a=e.length;r0?",":"")+js.Boot.__string_rec(e[l],t)}return i+="]"}var c;try{c=e.toString}catch(e){return"???"}if(null!=c&&c!=Object.toString){var d=e.toString();if("[object Object]"!=d)return d}var u=null;i="{\n";t+="\t";var m=null!=e.hasOwnProperty;for(var u in e)m&&!e.hasOwnProperty(u)||"prototype"!=u&&"__class__"!=u&&"__super__"!=u&&"__interfaces__"!=u&&"__properties__"!=u&&(2!=i.length&&(i+=", \n"),i+=t+u+" : "+js.Boot.__string_rec(e[u],t));return i+="\n"+(t=t.substring(1))+"}";case"function":return"";case"string":return e;default:return String(e)}},js.Boot.__interfLoop=function(e,t){if(null==e)return!1;if(e==t)return!0;var n=e.__interfaces__;if(null!=n)for(var i=0,r=n.length;i>>32-t},str2blks:function(e){for(var t=1+(e.length+8>>6),n=new Array,i=0,r=16*t;i>2]|=HxOverrides.cca(e,a)<<(8*e.length+a)%4*8,a++;n[a>>2]|=128<<(8*e.length+a)%4*8;var o=8*e.length,s=16*t-2;return n[s]=255&o,n[s]|=(o>>>8&255)<<8,n[s]|=(o>>>16&255)<<16,n[s]|=(o>>>24&255)<<24,n},rhex:function(e){for(var t="",n="0123456789abcdef",i=0;i<4;){var r=i++;t+=n.charAt(e>>8*r+4&15)+n.charAt(e>>8*r&15)}return t},addme:function(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},bitAND:function(e,t){return(e>>>1&t>>>1)<<1|1&e&t},bitXOR:function(e,t){return(e>>>1^t>>>1)<<1|1&e^1&t},bitOR:function(e,t){return(e>>>1|t>>>1)<<1|(1&e|1&t)},__class__:haxe.Md5},haxe.Timer=function(e){var t=this;this.id=window.setInterval((function(){t.run()}),e)},haxe.Timer.__name__=!0,haxe.Timer.delay=function(e,t){var n=new haxe.Timer(t);return n.run=function(){n.stop(),e()},n},haxe.Timer.measure=function(e,t){var n=haxe.Timer.stamp(),i=e();return haxe.Log.trace(haxe.Timer.stamp()-n+"s",t),i},haxe.Timer.stamp=function(){return(new Date).getTime()/1e3},haxe.Timer.prototype={run:function(){},stop:function(){null!=this.id&&(window.clearInterval(this.id),this.id=null)},__class__:haxe.Timer};var js=js||{},$_;function $bind(e,t){var n=function e(){return e.method.apply(e.scope,arguments)};return n.scope=e,n.method=t,n}js.Boot=function(){},js.Boot.__name__=!0,js.Boot.__unhtml=function(e){return e.split("&").join("&").split("<").join("<").split(">").join(">")},js.Boot.__trace=function(e,t){var n,i=null!=t?t.fileName+":"+t.lineNumber+": ":"";i+=js.Boot.__string_rec(e,""),"undefined"!=typeof document&&null!=(n=document.getElementById("haxe:trace"))?n.innerHTML+=js.Boot.__unhtml(i)+"
":"undefined"!=typeof console&&null!=console.log&&console.log(i)},js.Boot.__clear_trace=function(){var e=document.getElementById("haxe:trace");null!=e&&(e.innerHTML="")},js.Boot.isClass=function(e){return e.__name__},js.Boot.isEnum=function(e){return e.__ename__},js.Boot.getClass=function(e){return e.__class__},js.Boot.__string_rec=function(e,t){if(null==e)return"null";if(t.length>=5)return"<...>";var n=_typeof(e);switch("function"==n&&(e.__name__||e.__ename__)&&(n="object"),n){case"object":if(e instanceof Array){if(e.__enum__){if(2==e.length)return e[0];var i=e[0]+"(";t+="\t";for(var r=2,a=e.length;r0?",":"")+js.Boot.__string_rec(e[l],t)}return i+="]"}var c;try{c=e.toString}catch(e){return"???"}if(null!=c&&c!=Object.toString){var d=e.toString();if("[object Object]"!=d)return d}var u=null;i="{\n";t+="\t";var m=null!=e.hasOwnProperty;for(var u in e)m&&!e.hasOwnProperty(u)||"prototype"!=u&&"__class__"!=u&&"__super__"!=u&&"__interfaces__"!=u&&"__properties__"!=u&&(2!=i.length&&(i+=", \n"),i+=t+u+" : "+js.Boot.__string_rec(e[u],t));return i+="\n"+(t=t.substring(1))+"}";case"function":return"";case"string":return e;default:return String(e)}},js.Boot.__interfLoop=function(e,t){if(null==e)return!1;if(e==t)return!0;var n=e.__interfaces__;if(null!=n)for(var i=0,r=n.length;i{function i(e,t){for(var n=0;n«/mo»",ampElement:"«mo»&«/mo»"}}},{key:"safeGoodBlackboardCharacters",get:function(){return{ltElement:"«mo»§lt;«/mo»",gtElement:"«mo»§gt;«/mo»",ampElement:"«mo»§amp;«/mo»"}}},{key:"xmlCharacters",get:function(){return{id:"xmlCharacters",tagOpener:"<",tagCloser:">",doubleQuote:'"',ampersand:"&",quote:"'"}}},{key:"safeXmlCharacters",get:function(){return{id:"safeXmlCharacters",tagOpener:"«",tagCloser:"»",doubleQuote:"¨",ampersand:"§",quote:"`",realDoubleQuote:"¨"}}}],(n=null)&&i(t.prototype,n),r&&i(t,r),e}();function a(e,t){for(var n=0;n128)t+="&#".concat(e.codePointAt(n),";"),e.codePointAt(n)>65535&&(n+=1);else if("&"===i){var r=e.indexOf(";",n+1);if(r>=0){var a=document.createElement("span");a.innerHTML=e.substring(n,r+1),t+="&#".concat(w.fixedCharCodeAt(a.textContent||a.innerText,0),";"),n=r}else t+=i}else t+=i}return t}},{key:"addCustomEditorClassAttribute",value:function(e,t){var n="",i=e.indexOf("");if(-1===e.indexOf("class"))return n="".concat(e.substr(i,r),' class="wrs_').concat(t,'">'),n+=e.substr(r+1,e.length)}return e}},{key:"removeCustomEditorClassAttribute",value:function(e,t){return-1===e.indexOf("class")||-1===e.indexOf("wrs_".concat(t))?e:-1!==e.indexOf('class="wrs_'.concat(t,'"'))?e.replace('class="wrs_'.concat(t,'"'),""):e.replace("wrs_".concat(t),"")}},{key:"addAnnotation",value:function(t,n,i){var r="";if(-1!==t.indexOf("");r="".concat(t.substring(0,a),'').concat(n,"").concat(t.substring(a))}else if(e.isEmpty(t)){var o=t.indexOf("/>"),s=t.indexOf(">"),l=s===o?o:s;r="".concat(t.substring(0,l),'>').concat(n,"")}else{var c=t.indexOf(">")+1,d=t.lastIndexOf(""),u=t.substring(c,d);r="".concat(t.substring(0,c),"").concat(u,'').concat(n,"")}return r}},{key:"removeAnnotation",value:function(t,n){var i=t,r=''),a="",o=t.indexOf(r);if(-1!==o){for(var s=!1,l=t.indexOf("")}return n}},{key:"removeSemanticsOcurrences",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.xmlCharacters,n="".concat(t.tagOpener,"math"),i="".concat(t.tagOpener,"/math").concat(t.tagCloser),a="/".concat(t.tagCloser),o=t.tagCloser,s="".concat(t.tagOpener,"semantics").concat(t.tagCloser),l="".concat(t.tagOpener,"annotation encoding="),c="",d=e.indexOf(n),u=0;-1!==d;){c+=e.substring(u,d);var m=e.indexOf(i,d),h=e.indexOf(a,d),g=e.indexOf(o,d);-1!==m?u=m:h===g-1&&(u=h);var p=e.indexOf(s,d);if(-1!==p){var f=e.substring(d,p),_=e.indexOf(l,d);if(-1!==_){var v=p+s.length,b=e.substring(v,_);c+=f+b+i,d=e.indexOf(n,d+n.length),u+=i.length}else u=d,d=e.indexOf(n,d+n.length)}else u=d,d=e.indexOf(n,d+n.length)}return c+=e.substring(u,e.length)}},{key:"containClass",value:function(e,t){var n=e.indexOf("class");if(-1===n)return!1;var i=e.indexOf(">",n);return-1!==e.substring(n,i).indexOf(t)}},{key:"isEmpty",value:function(e){var t=e.indexOf(">"),n=e.indexOf("/>"),i=!1;if(-1!==n&&n===t-1&&(i=!0),!i){var r=new RegExp("").exec(e);r&&(i=t+1===r.index)}return i}},{key:"encodeProperties",value:function(e){return e.replace(/\w+=".*?"/g,(function(e){var t=e.indexOf('"'),n=e.substring(t+1,e.length-1),i=w.htmlEntities(n);return"".concat(e.substring(0,t+1)).concat(i,'"')}))}}],(n=null)&&a(t.prototype,n),i&&a(t,i),e}();function s(e,t){for(var n=0;n2&&(t=t.slice(0,2)),this.strings.hasOwnProperty(t)||(console.warn("Unknown language ".concat(t," set in StringManager.")),t="en"),this.strings[t].hasOwnProperty(e)?this.strings[t][e]:(console.warn("Unknown key ".concat(e," for language ").concat(t," in StringManager.")),e)}}],(n=null)&&v(t.prototype,n),i&&v(t,i),e}();function y(e,t){for(var n=0;n=0;i-=1)if(n[i]===t)return!0;return!1}},{key:"removeClass",value:function(e,t){for(var n="",i=e.className.split(" "),r=0;r").join("").split("").join("")).split("").join("
").split("").join("
");var i=e.createElement("div",{},n);return i.innerHTML=t,function t(i){if(i.getAttribute&&"WirisParam"===i.getAttribute("wirisObject")){for(var r={},a=0;a0){n+=">";for(var r=0;r")}else"DIV"===t.nodeName||"SCRIPT"===t.nodeName?n+=">"):n+="/>";return n}return 3===t.nodeType?e.htmlEntities(t.nodeValue):""}},{key:"concatenateUrl",value:function(e,t){var n="";return e.indexOf("/")!==e.length&&0!==t.indexOf("/")&&(n="/"),(e+n+t).replace(/([^:]\/)\/+/g,"$1")}},{key:"htmlEntities",value:function(e){return e.split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""")}},{key:"htmlEntitiesDecode",value:function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.value}},{key:"createHttpRequest",value:function(){if("file://"===window.location.toString().substr(0,window.location.toString().lastIndexOf("/")+1).substr(0,7))throw b.get("exception_cross_site");if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return null}}}},{key:"httpBuildQuery",value:function(t){var n="";return Object.keys(t).forEach((function(i){null!=t[i]&&(n+="".concat(e.urlEncode(i),"=").concat(e.urlEncode(t[i]),"&"))})),"&"===n.substring(n.length-1)&&(n=n.substring(0,n.length-1)),n}},{key:"propertiesToString",value:function(t){var n=[];Object.keys(t).forEach((function(e){Object.prototype.hasOwnProperty.call(t,e)&&n.push(e)}));for(var i=n.length,r=0;r0&&(n[r]=s,n[a]=o)}for(var l="",c=0;ca?a:r;for(i=0;i=55296&&r<=56319){if(n=r,i=e.charCodeAt(t+1),Number.isNaN(i))throw b.get("exception_high_surrogate");return 1024*(n-55296)+(i-56320)+65536}return!(r>=56320&&r<=57343)&&r}},{key:"urlToAssArray",value:function(e){var t;if((t=e.indexOf("?"))>0){var n=e.substring(t+1).split("&"),i={};for(t=0;t1&&(i[r[0]]=decodeURIComponent(r[1].replace(/\+/g," ")))}return i}return{}}},{key:"urlEncode",value:function(e){return encodeURIComponent(e)}},{key:"getWIRISImageOutput",value:function(t,n,i){var r=e.createObject(t);if(r&&(r.className===l.get("imageClassName")||r.getAttribute(l.get("imageMathmlAttribute")))){if(!n)return t;var a=r.getAttribute(l.get("imageMathmlAttribute")),s=o.safeXmlDecode(a);return l.get("saveHandTraces")||(s=o.removeAnnotation(s,"application/json")),null==s&&(s=r.getAttribute("alt")),i?o.safeXmlEncode(s):s}return t}},{key:"getNodeLength",value:function(t){if(3===t.nodeType)return t.nodeValue.length;if(1===t.nodeType){var n={IMG:1,BR:1}[t.nodeName.toUpperCase()];void 0===n&&(n=0);for(var i=0;i0)return 0===a.text.length?e.getSelectedItem(t,n,!0):null;r.document.execCommand("InsertImage",!1,"#");var o,s,l=a.parentElement();return"IMG"!==l.nodeName.toUpperCase()&&(a.pasteHTML(''),l=r.document.getElementById("wrs_openEditorWindow_temporalObject")),l.nextSibling&&3===l.nextSibling.nodeType?(o=l.nextSibling,s=0):l.previousSibling&&3===l.previousSibling.nodeType?s=(o=l.previousSibling).nodeValue.length:(o=r.document.createTextNode(""),l.parentNode.insertBefore(o,l),s=0),l.parentNode.removeChild(l),{node:o,caretPosition:s}}return a.length>1?null:{node:a.item(0)}}if(r.getSelection){var c,d=r.getSelection();try{c=d.getRangeAt(0)}catch(e){c=r.document.createRange()}var u=c.startContainer;if(3===u.nodeType)return{node:u,caretPosition:c.startOffset};if(u!==c.endContainer)return null;if(1===u.nodeType){var m=c.startOffset;if(u.childNodes[m])return{node:u.childNodes[m]}}}return null}},{key:"getSelectedItemOnTextarea",value:function(e){var t=document.createTextNode(e.value),n=f.getLatexFromTextNode(t,e.selectionStart);return null===n?null:{node:t,caretPosition:e.selectionStart,startPosition:n.startPosition,endPosition:n.endPosition}}},{key:"getElementsByNameFromString",value:function(e,t,n){var i=[];e=e.toLowerCase(),t=t.toLowerCase();for(var r=e.indexOf("<".concat(t," "));-1!==r;){var a=void 0;a=n?">":"");var o=e.indexOf(a,r);-1!==o?(o+=a.length,i.push({start:r,end:o})):o=r+1,r=e.indexOf("<".concat(t," "),o)}return i}},{key:"decode64",value:function(e){var t="+".charCodeAt(0),n="/".charCodeAt(0),i="0".charCodeAt(0),r="a".charCodeAt(0),a="A".charCodeAt(0),o="-".charCodeAt(0),s="_".charCodeAt(0),l=e.charCodeAt(0);return l===t||l===o?62:l===n||l===s?63:l0)throw new Error("Invalid string. Length must be a multiple of 4");var r,a,o,s=[];for(r=n||((a="="===t.charAt(t.length-2)?2:"="===t.charAt(t.length-1)?1:0)>0?t.length-4:t.length),o=0;o>16&255),s.push(i>>8&255),s.push(255&i);return a&&(2===a?(i=e.decode64(t.charAt(o))<<2|e.decode64(t.charAt(o+1))>>4,s.push(255&i)):1===a&&(i=e.decode64(t.charAt(o))<<10|e.decode64(t.charAt(o+1))<<4|e.decode64(t.charAt(o+2))>>2,s.push(i>>8&255),s.push(255&i))),s}},{key:"readInt32",value:function(e){if(e.length<4)return!1;var t=e.splice(0,4);return t[0]<<24|t[1]<<16|t[2]<<8|t[3]<<0}},{key:"readByte",value:function(e){return e.shift()<<0}},{key:"readBytes",value:function(e,t,n){return e.splice(t,n)}},{key:"updateTextArea",value:function(e,t){if(e&&t)if(e.focus(),null!=e.selectionStart){var n=e.selectionEnd,i=e.value.substring(0,e.selectionStart),r=e.value.substring(n,e.value.length);e.value=i+t+r,e.selectionEnd=n+t.length}else document.selection.createRange().text=t}},{key:"updateExistingTextOnTextarea",value:function(e,t,n,i){e.focus();var r=e.value.substring(0,n);e.value=r+t+e.value.substring(i,e.value.length),e.selectionEnd=n+t.length}},{key:"addArgument",value:function(e,t,n){var i;return i=e.indexOf("?")>0?"&":"?","".concat(e+i+t,"=").concat(n)}}],(n=null)&&y(t.prototype,n),i&&y(t,i),e}();function x(e,t){for(var n=0;n=4;)1229472850===(i=w.readInt32(e))?(t=w.readInt32(e),n=w.readInt32(e),w.readInt32(e),w.readByte(e)):1650545477===i?r=w.readInt32(e):1883789683===i&&(a=w.readInt32(e),a=Math.round(a/39.37),w.readInt32(e),w.readByte(e)),w.readInt32(e);if(void 0!==t){var o=[];return o.cw=t,o.ch=n,o.dpi=a,r&&(o.cb=r),o}return[]}}],(n=null)&&x(t.prototype,n),i&&x(t,i),e}();function A(e,t){for(var n=0;n',i=0,r=0;r",m),g=u.substring(m,h),p="$$".concat(w.htmlEntitiesDecode(g),"$$"),f=e.substring(0,t[r].start+i),_=e.substring(t[r].end+i);e=f+p+_,i+=p.length-(t[r].end-t[r].start)}}}}return e}},{key:"endParse",value:function(t){var n=e.endParseEditMode(t);return e.endParseSaveMode(n)}},{key:"endParseEditMode",value:function(e){if(-1!==l.get("parseModes").indexOf("latex")){for(var t="",n=0,i=e.indexOf("$$");-1!==i;){if(t+=e.substring(n,i),-1!==(n=e.indexOf("$$",i+2))){var r=e.substring(i+2,n),a=w.htmlEntitiesDecode(r),s=f.getMathMLFromLatex(a,!0);l.get("saveHandTraces")||(s=o.removeAnnotation(s,"application/json")),t+=s,n+=2}else t+="$$",n=i+2;i=e.indexOf("$$",n)}t+=e.substring(n,e.length),e=t}return e}},{key:"endParseSaveMode",value:function(t){return l.get("saveMode")&&("safeXml"===l.get("saveMode")||"xml"===l.get("saveMode")?t=e.codeImgTransform(t,"img2mathml"):"base64"===l.get("saveMode")&&"image"===l.get("base64savemode")&&(t=e.codeImgTransform(t,"img264"))),t}},{key:"createShowImageSrc",value:function(e,t){var n={};["mml","color","centerbaseline","zoom","dpi","fontSize","fontFamily","defaultStretchy","backgroundColor","format"].forEach((function(t){void 0!==e[t]&&(n[t]=e[t])}));var i={};return Object.keys(e).forEach((function(t){"mml"!==t&&(i[t]=e[t])})),i.formula=com.wiris.js.JsPluginTools.md5encode(w.propertiesToString(n)),i.lang=void 0===t?"en":t,i.version=l.get("version"),g.getService("showimage",w.httpBuildQuery(i),!0)}},{key:"codeImgTransform",value:function(t,n){for(var i="",r=0,a=/"===u&&(r=d+1);d+=1}if(r",d):c.length,o.isMathmlInAttribute(t,d)||-1!==m)a+=t.substring(d,u);else{var h=t.substring(d,u);h=n.id===r.safeXmlCharacters.id?o.safeXmlDecode(h):o.mathMLEntities(h),a+=w.createObjectCode(e.mathmlToImgObject(document,h,null,i))}d=t.indexOf(s,u)}return a+=t.substring(u,t.length)}}],(n=null)&&T(t.prototype,n),i&&T(t,i),e}();if("undefined"!=typeof MutationObserver){var j=new MutationObserver((function(e){e.forEach((function(e){e.oldValue===l.get("imageClassName")&&"class"===e.attributeName&&-1===e.target.className.indexOf(l.get("imageClassName"))&&(e.target.className=l.get("imageClassName"))}))}));E.observer=Object.create(j),E.observer.Config={attributes:!0,attributeOldValue:!0},E.observer.observe=function(e){Object.getPrototypeOf(this).observe(e,this.Config)}}function P(e,t){for(var n=0;n-1,this.deviceProperties.isIOS=e.isIOS(),this.toolbar=null,this.modalDialogInstance=null,this.listeners=new m,this.mathML=null,this.isNewElement=!0,this.integrationModel=null}var t,n,i;return t=e,i=[{key:"setHrefToAnchorElement",value:function(e,t){e.href=t}},{key:"setProtocolToAnchorElement",value:function(e){0===window.location.href.indexOf("https://")&&"http:"===e.protocol&&(e.protocol="https:")}},{key:"getURLFromAnchorElement",value:function(e){var t="80"===e.port||"443"===e.port||""===e.port;return"".concat(e.protocol,"//").concat(e.hostname).concat(t?"":":".concat(e.port)).concat(e.pathname.startsWith("/")?e.pathname:"/".concat(e.pathname))}},{key:"isIOS",value:function(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}},{key:"isEditorLoaded",value:function(){return window.com&&window.com.wiris&&window.com.wiris.jsEditor&&window.com.wiris.jsEditor.JsEditor&&window.com.wiris.jsEditor.JsEditor.newInstance}}],(n=[{key:"addListener",value:function(e){this.listeners.add(e)}},{key:"setIntegrationModel",value:function(e){this.integrationModel=e}},{key:"setModalDialogInstance",value:function(e){this.modalDialogInstance=e}},{key:"insert",value:function(){this.updateTitle(this.modalDialogInstance),this.insertEditor(this.modalDialogInstance)}},{key:"insertEditor",value:function(){if(e.isEditorLoaded()){if(this.editor=window.com.wiris.jsEditor.JsEditor.newInstance(this.editorAttributes),this.editor.insertInto(this.modalDialogInstance.contentContainer),this.editor.focus(),this.modalDialogInstance.rtl&&this.editor.action("rtl"),this.editor.getEditorModel().isRTL()&&(this.editor.element.style.direction="rtl"),this.editor.getEditorModel().addEditorListener(this.editorListener),this.modalDialogInstance.deviceProperties.isIOS){setTimeout((function(){this.hasOwnProperty("modalDialogInstance")&&this.modalDialogInstance.hideKeyboard()}),400);var t=document.getElementsByClassName("wrs_formulaDisplay")[0];w.addEvent(t,"focus",this.modalDialogInstance.handleOpenedIosSoftkeyboard),w.addEvent(t,"blur",this.modalDialogInstance.handleClosedIosSoftkeyboard)}this.listeners.fire("onLoad",{})}else setTimeout(e.prototype.insertEditor.bind(this),100)}},{key:"init",value:function(){e.isEditorLoaded()||this.addEditorAsExternalDependency()}},{key:"addEditorAsExternalDependency",value:function(){var t=document.createElement("script");t.type="text/javascript";var n=l.get("editorUrl"),i=document.createElement("a");e.setHrefToAnchorElement(i,n),e.setProtocolToAnchorElement(i),n=e.getURLFromAnchorElement(i);var r=this.getEditorStats();t.src="".concat(n,"?lang=").concat(this.language,"&stats-editor=").concat(r.editor,"&stats-mode=").concat(r.mode,"&stats-version=").concat(r.version),document.getElementsByTagName("head")[0].appendChild(t)}},{key:"getEditorStats",value:function(){var e={};return"editor"in this.environment?e.editor=this.environment.editor:e.editor="unknown","mode"in this.environment?e.mode=this.environment.mode:e.mode=l.get("saveMode"),"version"in this.environment?e.version=this.environment.version:e.version=l.get("version"),e}},{key:"setInitialContent",value:function(){this.isNewElement||this.setMathML(this.mathML)}},{key:"setMathML",value:function(e,t){var n=this;void 0===t&&(t=!1),this.editor.setMathMLWithCallback(e,(function(){n.editorListener.setWaitingForChanges(!0)})),setTimeout((function(){n.editorListener.setIsContentChanged(!1)}),500),t||this.onFocus()}},{key:"onFocus",value:function(){void 0!==this.editor&&null!=this.editor&&this.editor.focus()}},{key:"submitAction",value:function(){if(this.editor.isFormulaEmpty())this.integrationModel.updateFormula(null);else{var e=this.editor.getMathMLWithSemantics();if(null!==this.customEditors.getActiveEditor()){var t=this.customEditors.getActiveEditor().toolbar;e=o.addCustomEditorClassAttribute(e,t)}else Object.keys(this.customEditors.editors).forEach((function(t){e=o.removeCustomEditorClassAttribute(e,t)}));var n=o.mathMLEntities(e);this.integrationModel.updateFormula(n)}this.customEditors.disable(),this.integrationModel.notifyWindowClosed(),this.setEmptyMathML(),this.customEditors.disable()}},{key:"setEmptyMathML",value:function(){this.deviceProperties.isAndroid||this.deviceProperties.isIOS?this.editor.getEditorModel().isRTL()?this.setMathML('[]',!0):this.setMathML('[]',!0):this.editor.getEditorModel().isRTL()?this.setMathML('',!0):this.setMathML("",!0)}},{key:"onOpen",value:function(){this.isNewElement?this.setEmptyMathML():this.setMathML(this.mathML),this.updateToolbar(),this.onFocus()}},{key:"updateToolbar",value:function(){this.updateTitle(this.modalDialogInstance);var e=this.customEditors.getActiveEditor();if(e){var t=e.toolbar?e.toolbar:_wrs_int_wirisProperties.toolbar;null!=this.toolbar&&this.toolbar===t||this.setToolbar(t)}else{var n=this.getToolbar();null!=this.toolbar&&this.toolbar===n||(this.setToolbar(n),this.customEditors.disable())}}},{key:"updateTitle",value:function(){var e=this.customEditors.getActiveEditor();e?this.modalDialogInstance.setTitle(e.title):this.modalDialogInstance.setTitle("MathType")}},{key:"getToolbar",value:function(){var e="general";return"toolbar"in this.editorAttributes&&(e=this.editorAttributes.toolbar),"general"===e&&(e="undefined"==typeof _wrs_int_wirisProperties||void 0===_wrs_int_wirisProperties.toolbar?"general":_wrs_int_wirisProperties.toolbar),e}},{key:"setToolbar",value:function(e){this.toolbar=e,this.editor.setParams({toolbar:this.toolbar})}},{key:"hasChanges",value:function(){return!this.editor.isFormulaEmpty()&&this.editorListener.getIsContentChanged()}},{key:"onKeyDown",value:function(e){if(void 0!==e.key&&!1===e.repeat)if("Escape"===e.key||"Esc"===e.key){var t=document.getElementsByClassName("wrs_expandButton wrs_expandButtonFor3RowsLayout wrs_pressed");0===t.length&&0===(t=document.getElementsByClassName("wrs_expandButton wrs_expandButtonFor2RowsLayout wrs_pressed")).length&&0===(t=document.getElementsByClassName("wrs_select wrs_pressed")).length&&(this.modalDialogInstance.cancelAction(),e.stopPropagation(),e.preventDefault())}else if(e.shiftKey&&"Tab"===e.key)if(document.activeElement===this.modalDialogInstance.submitButton)this.editor.focus(),e.stopPropagation(),e.preventDefault();else{var n=document.querySelector('[title="Manual"]');document.activeElement===n&&(this.modalDialogInstance.cancelButton.focus(),e.stopPropagation(),e.preventDefault())}else"Tab"===e.key&&(document.activeElement===this.modalDialogInstance.cancelButton?(document.querySelector('[title="Manual"]').focus(),e.stopPropagation(),e.preventDefault()):"wrs_formulaDisplay wrs_focused"===document.getElementsByClassName("wrs_formulaDisplay")[0].getAttribute("class")&&(this.modalDialogInstance.submitButton.focus(),e.stopPropagation(),e.preventDefault()))}}])&&I(t.prototype,n),i&&I(t,i),e}();function z(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=(J[e[t+0]]+J[e[t+1]]+J[e[t+2]]+J[e[t+3]]+"-"+J[e[t+4]]+J[e[t+5]]+"-"+J[e[t+6]]+J[e[t+7]]+"-"+J[e[t+8]]+J[e[t+9]]+"-"+J[e[t+10]]+J[e[t+11]]+J[e[t+12]]+J[e[t+13]]+J[e[t+14]]+J[e[t+15]]).toLowerCase();if(!V(n))throw TypeError("Stringified UUID is invalid");return n};const Y=function(e,t,n){var i=(e=e||{}).random||(e.rng||H)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return Q(i)};function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,r,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw r}}return a}(e,t)||Z(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t){if(e){if("string"==typeof e)return G(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G(e,t):void 0}}function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(document.cookie.split(";").map((function(e){return e.trim().split("=")})));try{for(n.s();!(t=n.n()).done;){var i=q(t.value,2),r=i[0],a=i[1];if(r===ee){this._senderId=a;break}}}catch(e){n.e(e)}finally{n.f()}this._senderId||(this._senderId=e.composeUUID(),document.cookie=this.composeCookie(ee,this._senderId,31536e4))}return this._senderId}},{key:"sessionId",get:function(){return this._sessionId||(this._sessionId=e.composeUUID()),this._sessionId}},{key:"send",value:function(t){var n={method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json","X-Api-Key":"CK20op1pOx2LAUjPFP7kB2UPveHZRidG51UJE26m","Accept-Version":"1"},body:JSON.stringify(e.composeBody(t))};return fetch(e.endpoint,n).then((function(e){return e})).catch((function(e){console.warn(e)}))}},{key:"session",get:function(){return{id:e.sessionId,page:0}}},{key:"sender",get:function(){return{id:e.senderId,os:navigator.oscpu,user_agent:window.navigator.userAgent,domain:window.location.hostname,deployment:e.deployment,editor_version:WirisPlugin.currentInstance.environment.editorVersion?WirisPlugin.currentInstance.environment.editorVersion:"",language:WirisPlugin.currentInstance.language,product_version:WirisPlugin.currentInstance.version,backend:WirisPlugin.currentInstance.serviceProviderProperties.server?WirisPlugin.currentInstance.serviceProviderProperties.server:""}}},{key:"deployment",get:function(){var e=WirisPlugin.currentInstance.environment.editor,t="";return/Generic/.test(e)?t="generic":/Froala/.test(e)?t="froala":/CKEditor/.test(e)?t="ckeditor":/TinyMCE/.test(e)&&(t="tinymce"),"".concat("mathtype-web-plugin-").concat(t)}},{key:"composeBody",value:function(t){return{messages:t,sender:e.sender,session:e.session}}},{key:"composeUUID",value:function(){return Y()}},{key:"composeSenderUUID",value:function(){return this.composeUUID()}},{key:"composeCookie",value:function(e,t,n){var i=null==n?"":"; max-age=".concat(n);return"".concat(e,"=").concat(t).concat(i)}}],(n=null)&&$(t.prototype,n),i&&$(t,i),e}();function ne(e,t){for(var n=0;n=0&&(t=e[n].src.substr(0,i-1))}return t}},{key:"getVersion",value:function(){return this.version}},{key:"setLanguage",value:function(e){this.language=e}},{key:"setCore",value:function(e){this.core=e,e.setIntegrationModel(this)}},{key:"getCore",value:function(){return this.core}},{key:"setTarget",value:function(e){this.target=e,this.isIframe="IFRAME"===this.target.tagName.toUpperCase()}},{key:"setEditorObject",value:function(e){this.editorObject=e}},{key:"openNewFormulaEditor",value:function(){this.core.editionProperties.isNewElement=!0,this.core.openModalDialog(this.target,this.isIframe)}},{key:"openExistingFormulaEditor",value:function(){this.core.editionProperties.isNewElement=!1,this.core.openModalDialog(this.target,this.isIframe)}},{key:"updateFormula",value:function(e){var t,n;this.editorParameters&&(e=com.wiris.editor.util.EditorUtils.addAnnotation(e,"application/vnd.wiris.mtweb-params+json",JSON.stringify(this.editorParameters))),this.isIframe?(t=this.target.contentWindow,n=this.target.contentWindow):(t=this.target,n=window);var i=this.core.beforeUpdateFormula(e,null);return i&&(i=this.insertFormula(t,n,i.mathml,i.wirisProperties))?this.core.afterUpdateFormula(i.focusElement,i.windowTarget,i.node,i.latex):""}},{key:"insertFormula",value:function(e,t,n,i){return this.core.insertFormula(e,t,n,i)}},{key:"getSelection",value:function(){return this.isIframe?(this.target.contentWindow.focus(),this.target.contentWindow.getSelection()):(this.target.focus(),window.getSelection())}},{key:"addEvents",value:function(){var e=this,t=this.isIframe?this.target.contentWindow.document:this.target;w.addElementEvents(t,(function(t,n){e.doubleClickHandler(t,n)}),(function(t,n){e.mousedownHandler(t,n)}),(function(t,n){e.mouseupHandler(t,n)}))}},{key:"doubleClickHandler",value:function(e){if("img"===e.nodeName.toLowerCase()){this.core.getCustomEditors().disable();var t=l.get("imageCustomEditorName");if(e.hasAttribute(t)){var n=e.getAttribute(t);this.core.getCustomEditors().enable(n)}w.containsClass(e,l.get("imageClassName"))&&(this.core.editionProperties.temporalImage=e,this.core.editionProperties.isNewElement=!0,this.openExistingFormulaEditor())}}},{key:"mouseupHandler",value:function(){var e=this;this.temporalImageResizing&&setTimeout((function(){k.fixAfterResize(e.temporalImageResizing)}),10)}},{key:"mousedownHandler",value:function(e){"img"===e.nodeName.toLowerCase()&&w.containsClass(e,l.get("imageClassName"))&&(this.temporalImageResizing=e)}},{key:"getLanguage",value:function(){return this.getBrowserLanguage()}},{key:"getBrowserLanguage",value:function(){return navigator.userLanguage?navigator.userLanguage.substring(0,2):navigator.language?navigator.language.substring(0,2):"en"}},{key:"callbackFunction",value:function(){var e=this,t=m.newListener("onTargetReady",(function(){e.addEvents(e.target)}));this.listeners.add(t)}},{key:"notifyWindowClosed",value:function(){}},{key:"getMathmlFromTextNode",value:function(e,t){}},{key:"fillNonLatexNode",value:function(e,t,n){}},{key:"getSelectedItem",value:function(e,t){}}])&&ne(t.prototype,n),i&&ne(t,i),e}();ie.prototype.getMathmlFromTextNode=void 0,ie.prototype.fillNonLatexNode=void 0,ie.prototype.getSelectedItem=void 0,ie.integrationParameters=["serviceProviderProperties","editorParameters"];const re='\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n',ae='\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n';function oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function se(e,t){for(var n=0;n-1,a=O.isIOS();this.iosSoftkeyboardOpened=!1,this.iosMeasureUnit=-1===i.indexOf("crios")?"%":"vh",this.iosDivHeight="100%".concat(this.iosMeasureUnit);var o=window.outerWidth,s=window.outerHeight,l=o>s,c=os,u=c&&this.attributes.width>o,m=d||u;this.instanceId=document.getElementsByClassName("wrs_modal_dialogContainer").length,this.deviceProperties={orientation:l?"landscape":"portait",isAndroid:r,isIOS:a,isMobile:m,isDesktop:!m&&!a&&!r},this.properties={created:!1,state:"",previousState:"",position:{bottom:0,right:10},size:{height:338,width:580}},this.websiteBeforeLockParameters=null;var h={class:"wrs_modal_overlay"};h.id=this.getElementId(h.class),this.overlay=w.createElement("div",h),(h={}).class="wrs_modal_title_bar",h.id=this.getElementId(h.class),this.titleBar=w.createElement("div",h),(h={}).class="wrs_modal_title",h.id=this.getElementId(h.class),this.title=w.createElement("div",h),this.title.innerHTML="",(h={}).class="wrs_modal_close_button",h.id=this.getElementId(h.class),h.title=b.get("close"),h.style={},this.closeDiv=w.createElement("a",h),this.closeDiv.setAttribute("role","button");var g="background-size: 10px; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")"),p="background-size: 10px; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")");this.closeDiv.setAttribute("style",g),this.closeDiv.setAttribute("onmouseover",'this.style = "'.concat(p,'";')),this.closeDiv.setAttribute("onmouseout",'this.style = "'.concat(g,'";')),(h={}).class="wrs_modal_stack_button",h.id=this.getElementId(h.class),h.title=b.get("exit_fullscreen"),this.stackDiv=w.createElement("a",h),this.stackDiv.setAttribute("role","button"),g="background-size: 10px; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")"),p="background-size: 10px; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")"),this.stackDiv.setAttribute("style",g),this.stackDiv.setAttribute("onmouseover",'this.style = "'.concat(p,'";')),this.stackDiv.setAttribute("onmouseout",'this.style = "'.concat(g,'";')),(h={}).class="wrs_modal_maximize_button",h.id=this.getElementId(h.class),h.title=b.get("fullscreen"),this.maximizeDiv=w.createElement("a",h),this.maximizeDiv.setAttribute("role","button"),g="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")"),p="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")"),this.maximizeDiv.setAttribute("style",g),this.maximizeDiv.setAttribute("onmouseover",'this.style = "'.concat(p,'";')),this.maximizeDiv.setAttribute("onmouseout",'this.style = "'.concat(g,'";')),(h={}).class="wrs_modal_minimize_button",h.id=this.getElementId(h.class),h.title=b.get("minimize"),this.minimizeDiv=w.createElement("a",h),this.minimizeDiv.setAttribute("role","button"),g="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa(re),")"),p="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa(ae),")"),this.minimizeDiv.setAttribute("style",g),this.minimizeDiv.setAttribute("onmouseover",'this.style = "'.concat(p,'";')),this.minimizeDiv.setAttribute("onmouseout",'this.style = "'.concat(g,'";')),(h={}).class="wrs_modal_dialogContainer",h.id=this.getElementId(h.class),h.role="dialog",this.container=w.createElement("div",h),this.container.setAttribute("aria-labeledby","wrs_modal_title[0]"),(h={}).class="wrs_modal_wrapper",h.id=this.getElementId(h.class),this.wrapper=w.createElement("div",h),(h={}).class="wrs_content_container",h.id=this.getElementId(h.class),this.contentContainer=w.createElement("div",h),(h={}).class="wrs_modal_controls",h.id=this.getElementId(h.class),this.controls=w.createElement("div",h),(h={}).class="wrs_modal_buttons_container",h.id=this.getElementId(h.class),this.buttonContainer=w.createElement("div",h),this.submitButton=this.createSubmitButton({id:this.getElementId("wrs_modal_button_accept"),class:"wrs_modal_button_accept",innerHTML:b.get("accept")},this.submitAction.bind(this)),this.cancelButton=this.createSubmitButton({id:this.getElementId("wrs_modal_button_cancel"),class:"wrs_modal_button_cancel",innerHTML:b.get("cancel")},this.cancelAction.bind(this)),this.contentManager=null;var f={cancelString:b.get("cancel"),submitString:b.get("close"),message:b.get("close_modal_warning")},_={closeCallback:function(){n.close()},cancelCallback:function(){n.focus()}},v={overlayElement:this.container,callbacks:_,strings:f};this.popup=new U(v),this.rtl=!1,"rtl"in this.attributes&&(this.rtl=this.attributes.rtl),this.handleOpenedIosSoftkeyboard=this.handleOpenedIosSoftkeyboard.bind(this),this.handleClosedIosSoftkeyboard=this.handleClosedIosSoftkeyboard.bind(this)}return le(e,[{key:"setContentManager",value:function(e){this.contentManager=e}},{key:"getContentManager",value:function(){return this.contentManager}},{key:"submitAction",value:function(){void 0!==this.contentManager.submitAction&&this.contentManager.submitAction(),this.close()}},{key:"cancelAction",value:function(){ie.setTemporalImageToNull(),void 0===this.contentManager.hasChanges?this.close():this.contentManager.hasChanges()?this.showPopUpMessage():this.close()}},{key:"createSubmitButton",value:function(e,t){return new(function(){function n(){oe(this,n),this.element=document.createElement("button"),this.element.id=e.id,this.element.className=e.class,this.element.innerHTML=e.innerHTML,w.addEvent(this.element,"click",t)}return le(n,[{key:"getElement",value:function(){return this.element}}]),n}())(e,t).getElement()}},{key:"create",value:function(){this.titleBar.appendChild(this.closeDiv),this.titleBar.appendChild(this.stackDiv),this.titleBar.appendChild(this.maximizeDiv),this.titleBar.appendChild(this.minimizeDiv),this.titleBar.appendChild(this.title),this.deviceProperties.isDesktop&&this.container.appendChild(this.titleBar),this.wrapper.appendChild(this.contentContainer),this.wrapper.appendChild(this.controls),this.controls.appendChild(this.buttonContainer),this.buttonContainer.appendChild(this.submitButton),this.buttonContainer.appendChild(this.cancelButton),this.container.appendChild(this.wrapper),this.recalculateScrollBar(),document.body.appendChild(this.container),document.body.appendChild(this.overlay),this.deviceProperties.isDesktop?(this.createModalWindowDesktop(),this.createResizeButtons(),this.addListeners(),l.get("modalWindowFullScreen")&&this.maximize()):this.deviceProperties.isAndroid?this.createModalWindowAndroid():this.deviceProperties.isIOS&&this.createModalWindowIos(),null!=this.contentManager&&this.contentManager.insert(this),this.properties.open=!0,this.properties.created=!0,this.isRTL()&&(this.container.style.right="".concat(window.innerWidth-this.scrollbarWidth-this.container.offsetWidth,"px"),this.container.className+=" wrs_modal_rtl")}},{key:"createResizeButtons",value:function(){this.resizerBR=document.createElement("div"),this.resizerBR.className="wrs_bottom_right_resizer",this.resizerBR.innerHTML="◢",this.resizerTL=document.createElement("div"),this.resizerTL.className="wrs_bottom_left_resizer",this.container.appendChild(this.resizerBR),this.titleBar.appendChild(this.resizerTL),w.addEvent(this.resizerBR,"mousedown",this.activateResizeStateBR.bind(this)),w.addEvent(this.resizerTL,"mousedown",this.activateResizeStateTL.bind(this))}},{key:"activateResizeStateBR",value:function(e){this.initializeResizeProperties(e,!1)}},{key:"activateResizeStateTL",value:function(e){this.initializeResizeProperties(e,!0)}},{key:"initializeResizeProperties",value:function(e,t){w.addClass(document.body,"wrs_noselect"),w.addClass(this.overlay,"wrs_overlay_active"),this.resizeDataObject={x:this.eventClient(e).X,y:this.eventClient(e).Y},this.initialWidth=parseInt(this.container.style.width,10),this.initialHeight=parseInt(this.container.style.height,10),t?this.leftScale=!0:(this.initialRight=parseInt(this.container.style.right,10),this.initialBottom=parseInt(this.container.style.bottom,10)),this.initialRight||(this.initialRight=0),this.initialBottom||(this.initialBottom=0),document.body.style["user-select"]="none"}},{key:"open",value:function(){var e=this;try{te.send([{timestamp:(new Date).toJSON(),topic:"0",level:"info",message:"HELO telemetry.wiris.net"}]).then((function(e){}))}catch(e){}this.removeClass("wrs_closed");var t=this.deviceProperties.isIOS,n=this.deviceProperties.isAndroid,i=this.deviceProperties.isMobile;if((t||n||i)&&(this.restoreWebsiteScale(),this.lockWebsiteScroll(),setTimeout((function(){e.hideKeyboard()}),400)),this.properties.created?(this.properties.open||(this.properties.open=!0,this.deviceProperties.isAndroid||this.deviceProperties.isIOS||this.restoreState()),this.deviceProperties.isDesktop&&l.get("modalWindowFullScreen")&&this.maximize(),this.deviceProperties.isIOS&&(this.iosSoftkeyboardOpened=!1,this.setContainerHeight("".concat(100+this.iosMeasureUnit)))):this.create(),O.isEditorLoaded())this.contentManager.onOpen(this);else{var r=m.newListener("onLoad",(function(){e.contentManager.onOpen(e)}));this.contentManager.addListener(r)}}},{key:"close",value:function(){this.removeClass("wrs_maximized"),this.removeClass("wrs_minimized"),this.removeClass("wrs_stack"),this.addClass("wrs_closed"),this.saveModalProperties(),this.unlockWebsiteScroll(),this.properties.open=!1}},{key:"restoreWebsiteScale",value:function(){var e=document.querySelector("meta[name=viewport]"),t=["initial-scale=","minimum-scale=","maximum-scale="],n=["1.0","1.0","1.0"],i=function(e,t){var i=e.getAttribute("content");if(i){for(var r=i.split(","),a="",o=[],s=0;s=0||navigator.userAgent.search("Trident/")>=0||navigator.userAgent.search("Edge/")>=0}},{key:"isRTL",value:function(){return"ar"===this.attributes.language||"he"===this.attributes.language||this.rtl}},{key:"addClass",value:function(e){w.addClass(this.overlay,e),w.addClass(this.titleBar,e),w.addClass(this.overlay,e),w.addClass(this.container,e),w.addClass(this.contentContainer,e),w.addClass(this.stackDiv,e),w.addClass(this.minimizeDiv,e),w.addClass(this.maximizeDiv,e),w.addClass(this.wrapper,e)}},{key:"removeClass",value:function(e){w.removeClass(this.overlay,e),w.removeClass(this.titleBar,e),w.removeClass(this.overlay,e),w.removeClass(this.container,e),w.removeClass(this.contentContainer,e),w.removeClass(this.stackDiv,e),w.removeClass(this.minimizeDiv,e),w.removeClass(this.maximizeDiv,e),w.removeClass(this.wrapper,e)}},{key:"createModalWindowDesktop",value:function(){this.addClass("wrs_modal_desktop"),this.stack()}},{key:"createModalWindowAndroid",value:function(){this.addClass("wrs_modal_android"),window.addEventListener("resize",this.orientationChangeAndroidSoftkeyboard.bind(this))}},{key:"createModalWindowIos",value:function(){this.addClass("wrs_modal_ios"),window.addEventListener("resize",this.orientationChangeIosSoftkeyboard.bind(this))}},{key:"restoreState",value:function(){"maximized"===this.properties.state?this.maximize():"minimized"===this.properties.state?(this.properties.state=this.properties.previousState,this.properties.previousState="",this.minimize()):this.stack()}},{key:"stack",value:function(){this.properties.previousState=this.properties.state,this.properties.state="stack",this.removeClass("wrs_maximized"),this.minimizeDiv.title=b.get("minimize"),this.removeClass("wrs_minimized"),this.addClass("wrs_stack");var e="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa(re),")"),t="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa(ae),")");this.minimizeDiv.setAttribute("style",e),this.minimizeDiv.setAttribute("onmouseover",'this.style = "'.concat(t,'";')),this.minimizeDiv.setAttribute("onmouseout",'this.style = "'.concat(e,'";')),this.restoreModalProperties(),void 0!==this.resizerBR&&void 0!==this.resizerTL&&this.setResizeButtonsVisibility(),this.recalculateScrollBar(),this.recalculatePosition(),this.recalculateScale(),this.focus()}},{key:"minimize",value:function(){if(this.saveModalProperties(),this.title.style.cursor="pointer","minimized"===this.properties.state&&"stack"===this.properties.previousState)this.stack();else if("minimized"===this.properties.state&&"maximized"===this.properties.previousState)this.maximize();else{this.container.style.height="30px",this.container.style.width="250px",this.container.style.bottom="0px",this.container.style.right="10px",this.removeListeners(),this.properties.previousState=this.properties.state,this.properties.state="minimized",this.setResizeButtonsVisibility(),this.minimizeDiv.title=b.get("maximize"),w.containsClass(this.overlay,"wrs_stack")?this.removeClass("wrs_stack"):this.removeClass("wrs_maximized"),this.addClass("wrs_minimized");var e="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")"),t="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")");this.minimizeDiv.setAttribute("style",e),this.minimizeDiv.setAttribute("onmouseover",'this.style = "'.concat(t,'";')),this.minimizeDiv.setAttribute("onmouseout",'this.style = "'.concat(e,'";'))}}},{key:"maximize",value:function(){this.saveModalProperties(),"maximized"!==this.properties.state&&(this.properties.previousState=this.properties.state,this.properties.state="maximized"),this.setResizeButtonsVisibility(),w.containsClass(this.overlay,"wrs_minimized")?(this.minimizeDiv.title=b.get("minimize"),this.removeClass("wrs_minimized")):w.containsClass(this.overlay,"wrs_stack")&&(this.container.style.left=null,this.container.style.top=null,this.removeClass("wrs_stack")),this.addClass("wrs_maximized");var e="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa(re),")"),t="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa(ae),")");this.minimizeDiv.setAttribute("style",e),this.minimizeDiv.setAttribute("onmouseover",'this.style = "'.concat(t,'";')),this.minimizeDiv.setAttribute("onmouseout",'this.style = "'.concat(e,'";')),this.setSize(parseInt(.8*window.innerHeight,10),parseInt(.8*window.innerWidth,10)),this.container.clientHeight>700&&(this.container.style.height="700px"),this.container.clientWidth>1200&&(this.container.style.width="1200px");var n=window.innerHeight,i=window.innerWidth,r=n/2-this.container.offsetHeight/2,a=i/2-this.container.offsetWidth/2;this.setPosition(r,a),this.recalculateScale(),this.recalculatePosition(),this.recalculateSize(),this.focus()}},{key:"reExpand",value:function(){"minimized"===this.properties.state&&("maximized"===this.properties.previousState?this.maximize():this.stack(),this.title.style.cursor="")}},{key:"setSize",value:function(e,t){this.container.style.height="".concat(e,"px"),this.container.style.width="".concat(t,"px"),this.recalculateSize()}},{key:"setPosition",value:function(e,t){this.container.style.bottom="".concat(e,"px"),this.container.style.right="".concat(t,"px")}},{key:"saveModalProperties",value:function(){"stack"===this.properties.state&&(this.properties.position.bottom=parseInt(this.container.style.bottom,10),this.properties.position.right=parseInt(this.container.style.right,10),this.properties.size.width=parseInt(this.container.style.width,10),this.properties.size.height=parseInt(this.container.style.height,10))}},{key:"restoreModalProperties",value:function(){"stack"===this.properties.state&&(this.setPosition(this.properties.position.bottom,this.properties.position.right),this.setSize(this.properties.size.height,this.properties.size.width))}},{key:"recalculateSize",value:function(){this.wrapper.style.width="".concat(this.container.clientWidth-12,"px"),this.wrapper.style.height="".concat(this.container.clientHeight-38,"px"),this.contentContainer.style.height="".concat(parseInt(this.wrapper.offsetHeight-50,10),"px")}},{key:"setResizeButtonsVisibility",value:function(){"stack"===this.properties.state?(this.resizerTL.style.visibility="visible",this.resizerBR.style.visibility="visible"):(this.resizerTL.style.visibility="hidden",this.resizerBR.style.visibility="hidden")}},{key:"addListeners",value:function(){this.maximizeDiv.addEventListener("click",this.maximize.bind(this),!0),this.stackDiv.addEventListener("click",this.stack.bind(this),!0),this.minimizeDiv.addEventListener("click",this.minimize.bind(this),!0),this.closeDiv.addEventListener("click",this.cancelAction.bind(this)),this.title.addEventListener("click",this.reExpand.bind(this)),this.overlay.addEventListener("click",this.cancelAction.bind(this)),w.addEvent(window,"mousedown",this.startDrag.bind(this)),w.addEvent(window,"mouseup",this.stopDrag.bind(this)),w.addEvent(window,"mousemove",this.drag.bind(this)),w.addEvent(window,"resize",this.onWindowResize.bind(this)),w.addEvent(this.container,"keydown",this.onKeyDown.bind(this))}},{key:"removeListeners",value:function(){w.removeEvent(window,"mousedown",this.startDrag),w.removeEvent(window,"mouseup",this.stopDrag),w.removeEvent(window,"mousemove",this.drag),w.removeEvent(window,"resize",this.onWindowResize),w.removeEvent(this.container,"keydown",this.onKeyDown)}},{key:"eventClient",value:function(e){return void 0===e.clientX&&e.changedTouches?{X:e.changedTouches[0].clientX,Y:e.changedTouches[0].clientY}:{X:e.clientX,Y:e.clientY}}},{key:"startDrag",value:function(e){"minimized"!==this.properties.state&&e.target===this.title&&(void 0!==this.dragDataObject&&null!==this.dragDataObject||(this.dragDataObject={x:this.eventClient(e).X,y:this.eventClient(e).Y},this.lastDrag={x:"0px",y:"0px"},""===this.container.style.right&&(this.container.style.right="0px"),""===this.container.style.bottom&&(this.container.style.bottom="0px"),this.isIE11(),w.addClass(document.body,"wrs_noselect"),w.addClass(this.overlay,"wrs_overlay_active"),this.limitWindow=this.getLimitWindow()))}},{key:"drag",value:function(e){if(this.dragDataObject){e.preventDefault();var t=Math.min(this.eventClient(e).Y,this.limitWindow.minPointer.y);t=Math.max(this.limitWindow.maxPointer.y,t);var n=Math.min(this.eventClient(e).X,this.limitWindow.minPointer.x);n=Math.max(this.limitWindow.maxPointer.x,n);var i="".concat(n-this.dragDataObject.x,"px"),r="".concat(t-this.dragDataObject.y,"px");this.lastDrag={x:i,y:r},this.container.style.transform="translate3d(".concat(i,",").concat(r,",0)")}if(this.resizeDataObject){var a,o=window.innerWidth,s=window.innerHeight,l=Math.min(this.eventClient(e).X,o-this.scrollbarWidth-7),c=Math.min(this.eventClient(e).Y,s-7);l<0&&(l=0),c<0&&(c=0),a=this.leftScale?-1:1,this.container.style.width="".concat(this.initialWidth+a*(l-this.resizeDataObject.x),"px"),this.container.style.height="".concat(this.initialHeight+a*(c-this.resizeDataObject.y),"px"),this.leftScale||(this.resizeDataObject.x-l-this.initialWidth<-580?this.container.style.right="".concat(this.initialRight-(l-this.resizeDataObject.x),"px"):(this.container.style.right="".concat(this.initialRight+this.initialWidth-580,"px"),this.container.style.width="580px"),this.resizeDataObject.y-c580?(this.container.style.width="".concat(Math.min(parseInt(this.container.style.width,10),window.innerWidth-this.scrollbarWidth),"px"),e=!0):(this.container.style.width="580px",e=!0),parseInt(this.container.style.height,10)>338?(this.container.style.height="".concat(Math.min(parseInt(this.container.style.height,10),window.innerHeight),"px"),e=!0):(this.container.style.height="338px",e=!0),e&&this.recalculateSize()}},{key:"recalculateScrollBar",value:function(){this.hasScrollBar=window.innerWidth>document.documentElement.clientWidth,this.hasScrollBar?this.scrollbarWidth=this.getScrollBarWidth():this.scrollbarWidth=0}},{key:"hideKeyboard",value:function(){var e=document.createElement("input");this.container.appendChild(e),e.focus(),e.blur(),e.remove()}},{key:"focus",value:function(){null!=this.contentManager&&void 0!==this.contentManager.onFocus&&this.contentManager.onFocus()}},{key:"portraitMode",value:function(){return window.innerHeight>window.innerWidth}},{key:"handleOpenedIosSoftkeyboard",value:function(){this.iosSoftkeyboardOpened||null==this.iosDivHeight||this.iosDivHeight!=="100".concat(this.iosMeasureUnit)||(this.portraitMode()?this.setContainerHeight("63".concat(this.iosMeasureUnit)):this.setContainerHeight("40".concat(this.iosMeasureUnit))),this.iosSoftkeyboardOpened=!0}},{key:"handleClosedIosSoftkeyboard",value:function(){this.iosSoftkeyboardOpened=!1,this.setContainerHeight("100".concat(this.iosMeasureUnit))}},{key:"orientationChangeIosSoftkeyboard",value:function(){this.iosSoftkeyboardOpened?this.portraitMode()?this.setContainerHeight("63".concat(this.iosMeasureUnit)):this.setContainerHeight("40".concat(this.iosMeasureUnit)):this.setContainerHeight("100".concat(this.iosMeasureUnit))}},{key:"orientationChangeAndroidSoftkeyboard",value:function(){this.setContainerHeight("100%")}},{key:"setContainerHeight",value:function(e){this.iosDivHeight=e,this.wrapper.style.height=e}},{key:"showPopUpMessage",value:function(){"minimized"===this.properties.state&&this.stack(),this.popup.show()}},{key:"setTitle",value:function(e){this.title.innerHTML=e}},{key:"getElementId",value:function(e){return"".concat(e,"[").concat(this.instanceId,"]")}}]),e}();var de;String.prototype.codePointAt||(de=function(e){if(null==this)throw TypeError();var t=String(this),n=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||i>=n)){var r,a=t.charCodeAt(i);return a>=55296&&a<=56319&&n>i+1&&(r=t.charCodeAt(i+1))>=56320&&r<=57343?1024*(a-55296)+r-56320+65536:a}},Object.defineProperty?Object.defineProperty(String.prototype,"codePointAt",{value:de,configurable:!0,writable:!0}):String.prototype.codePointAt=de),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),i=1;i>>0;if(0===i)return!1;var r,a,o=0|t,s=Math.max(o>=0?o:i-Math.abs(o),0);for(;s0?0|t:0;return this.substring(n,n+e.length)===e}});var ue=n(379),me=n.n(ue),he=n(139),ge={insert:"head",singleton:!1};me()(he.Z,ge);he.Z.locals;function pe(e,t){for(var n=0;n=0?i="EDGE":n.search("Chrome/")>=0?i="CHROME":n.search("Trident/")>=0?i="IE":n.search("Firefox/")>=0?i="FIREFOX":n.search("Safari/")>=0&&(i="SAFARI"),i),this.listeners=new m,this.serviceProviderProperties={},!("serviceProviderProperties"in t))throw new Error("serviceProviderProperties property missing.");this.serviceProviderProperties=t.serviceProviderProperties}var t,n,i;return t=e,i=[{key:"globalListeners",get:function(){return e._globalListeners},set:function(t){e._globalListeners=t}},{key:"initialized",get:function(){return e._initialized},set:function(t){e._initialized=t}},{key:"addGlobalListener",value:function(t){e.globalListeners.add(t)}}],(n=[{key:"setIntegrationModel",value:function(e){this.integrationModel=e}},{key:"setEnvironment",value:function(e){"editor"in e&&(this.environment.editor=e.editor),"mode"in e&&(this.environment.mode=e.mode),"version"in e&&(this.environment.version=e.version)}},{key:"getModalDialog",value:function(){return this.modalDialog}},{key:"init",value:function(){var t=this;if(e.initialized)this.listeners.fire("onLoad",{});else{var n=m.newListener("onInit",(function(){var e=g.getService("configurationjs","","get"),n=JSON.parse(e);l.addConfiguration(n),l.addConfiguration(B),b.language=t.language,t.listeners.fire("onLoad",{})}));g.addListener(n),g.init(this.serviceProviderProperties),e.initialized=!0}}},{key:"addListener",value:function(e){this.listeners.add(e)}},{key:"beforeUpdateFormula",value:function(t,n){var i=new D;return i.mathml=t,i.wirisProperties={},null!=n&&Object.keys(n).forEach((function(e){i.wirisProperties[e]=n[e]})),i.language=this.language,i.editMode=this.editMode,this.listeners.fire("onBeforeFormulaInsertion",i)||e.globalListeners.fire("onBeforeFormulaInsertion",i)?{}:{mathml:i.mathml,wirisProperties:i.wirisProperties}}},{key:"insertFormula",value:function(e,t,n,i){var r={};if(n)if("latex"===this.editMode){if(r.latex=f.getLatexFromMathML(n),this.integrationModel.fillNonLatexNode&&!r.latex){var a=new D;a.editMode=this.editMode,a.windowTarget=t,a.focusElement=e,a.latex=r.latex,this.integrationModel.fillNonLatexNode(a,t,n)}else r.node=t.document.createTextNode("$$".concat(r.latex,"$$"));this.insertElementOnSelection(r.node,e,t)}else r.node=E.mathmlToImgObject(t.document,n,i,this.language),this.insertElementOnSelection(r.node,e,t);else this.insertElementOnSelection(null,e,t);return r}},{key:"afterUpdateFormula",value:function(t,n,i,r){var a=new D;return a.editMode=this.editMode,a.windowTarget=n,a.focusElement=t,a.node=i,a.latex=r,this.listeners.fire("onAfterFormulaInsertion",a)||e.globalListeners.fire("onAfterFormulaInsertion",a),{}}},{key:"placeCaretAfterNode",value:function(e){this.integrationModel.getSelection();var t=e.ownerDocument;if(void 0!==t.getSelection&&e.parentElement){var n=t.createRange();n.setStartAfter(e),n.collapse(!0);var i=t.getSelection();i.removeAllRanges(),i.addRange(n),t.body.focus()}}},{key:"insertElementOnSelection",value:function(e,t,n){if(this.editionProperties.isNewElement)if(e)if("textarea"===t.type)w.updateTextArea(t,e.textContent);else if(document.selection&&0===document.getSelection){var i=n.document.selection.createRange();if(n.document.execCommand("InsertImage",!1,e.src),"parentElement"in i||(n.document.execCommand("delete",!1),i=n.document.selection.createRange(),n.document.execCommand("InsertImage",!1,e.src)),"parentElement"in i){var r=i.parentElement();"IMG"===r.nodeName.toUpperCase()?r.parentNode.replaceChild(e,r):i.pasteHTML(w.createObjectCode(e))}}else{var a=this.integrationModel.getSelection(),o=null;this.editionProperties.range?(o=this.editionProperties.range,this.editionProperties.range=null):o=a.getRangeAt(0),o.deleteContents();var s=o.startContainer,l=o.startOffset;3===s.nodeType?(s=s.splitText(l)).parentNode.insertBefore(e,s):1===s.nodeType&&s.insertBefore(e,s.childNodes[l]),this.placeCaretAfterNode(e)}else if("textarea"===t.type)t.focus();else{var c=this.integrationModel.getSelection();if(c.removeAllRanges(),this.editionProperties.range){var d=this.editionProperties.range;this.editionProperties.range=null,c.addRange(d)}}else if(this.editionProperties.latexRange)document.selection&&0===document.getSelection?(this.editionProperties.isNewElement=!0,this.editionProperties.latexRange.select(),this.insertElementOnSelection(e,t,n)):(this.editionProperties.latexRange.deleteContents(),this.editionProperties.latexRange.insertNode(e),this.placeCaretAfterNode(e));else if("textarea"===t.type){var u;u=void 0!==this.integrationModel.getSelectedItem?this.integrationModel.getSelectedItem(t,!1):w.getSelectedItemOnTextarea(t),w.updateExistingTextOnTextarea(t,e.textContent,u.startPosition,u.endPosition)}else e&&"img"===e.nodeName.toLowerCase()?(k.removeImgDataAttributes(this.editionProperties.temporalImage),k.clone(e,this.editionProperties.temporalImage)):this.editionProperties.temporalImage.remove(),this.placeCaretAfterNode(this.editionProperties.temporalImage)}},{key:"openModalDialog",value:function(e,t){var n,i=this;this.editMode="images";try{if(t){e.contentWindow.focus();var r=e.contentWindow.getSelection();this.editionProperties.range=r.getRangeAt(0)}else{e.focus();var a=getSelection();this.editionProperties.range=a.getRangeAt(0)}}catch(e){this.editionProperties.range=null}if(void 0===t&&(t=!0),this.editionProperties.latexRange=null,e)if(n=void 0!==this.integrationModel.getSelectedItem?this.integrationModel.getSelectedItem(e,t):w.getSelectedItem(e,t)){if(!n.caretPosition&&w.containsClass(n.node,l.get("imageClassName")))this.editionProperties.temporalImage=n.node,this.editionProperties.isNewElement=!1;else if(3===n.node.nodeType)if(this.integrationModel.getMathmlFromTextNode){var s=this.integrationModel.getMathmlFromTextNode(n.node,n.caretPosition);s&&(this.editMode="latex",this.editionProperties.isNewElement=!1,this.editionProperties.temporalImage=document.createElement("img"),this.editionProperties.temporalImage.setAttribute(l.get("imageMathmlAttribute"),o.safeXmlEncode(s)))}else{var c=f.getLatexFromTextNode(n.node,n.caretPosition);if(c){var d=f.getMathMLFromLatex(c.latex);this.editMode="latex",this.editionProperties.isNewElement=!1,this.editionProperties.temporalImage=document.createElement("img"),this.editionProperties.temporalImage.setAttribute(l.get("imageMathmlAttribute"),o.safeXmlEncode(d));var u=t?e.contentWindow:window;if("textarea"!==e.tagName.toLowerCase())if(document.selection){for(var h=0,g=c.startNode.previousSibling;g;)h+=w.getNodeLength(g),g=g.previousSibling;this.editionProperties.latexRange=u.document.selection.createRange(),this.editionProperties.latexRange.moveToElementText(c.startNode.parentNode),this.editionProperties.latexRange.move("character",h+c.startPosition),this.editionProperties.latexRange.moveEnd("character",c.latex.length+4)}else this.editionProperties.latexRange=u.document.createRange(),this.editionProperties.latexRange.setStart(c.startNode,c.startPosition),this.editionProperties.latexRange.setEnd(c.endNode,c.endPosition)}}}else"textarea"===e.tagName.toLowerCase()&&(this.editMode="latex");for(var p=l.get("editorAttributes").split(", "),_={},v=0,b=p.length;vx2',console.log(g.getService("showimage",e)),console.log("Testing createimage service..."),(e=[]).mml='x2',console.log(g.getService("createimage",e,"post")),console.log("Testing MathML2Latex service..."),(e=[]).service="mathml2latex",e.mml='x2',console.log(g.getService("service",e)),console.log("Testing Latex2MathML service..."),(e=[]).service="latex2mathml",e.latex="x^2",console.log(g.getService("service",e)),console.log("Testing Mathml2Accesible service..."),(e=[]).service="mathml2accessible",e.mml='x2',console.log(g.getService("service",e))}}],(n=null)&&_e(t.prototype,n),i&&_e(t,i),e}();const be="7.27.0";function ye(e){return(ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function we(e,t){for(var n=0;n'),o.addIcon(u,' '),o.addMenuItem("tiny_mce_wiris_formulaEditor",{text:"MathType",icon:d,onAction:c});var m=WirisPlugin.instances[e.id].getCore().getCustomEditors();Object.keys(m.editors).forEach((function(t){m.editors[t].confVariable&&o.addMenuItem("tiny_mce_wiris_formulaEditor".concat(m.editors[t].name),{text:m.editors[t].title,icon:u,onAction:function(){m.enable(t),WirisPlugin.instances[e.id].openNewFormulaEditor()}})}))}else(o=e).addCommand("tiny_mce_wiris_openFormulaEditor",c);o.addButton("tiny_mce_wiris_formulaEditor",{tooltip:"Insert a math equation - MathType",title:"Insert a math equation - MathType",cmd:"tiny_mce_wiris_openFormulaEditor",image:"".concat(WirisPlugin.instances[e.id].getIconsPath(),"formula.png"),onAction:c,icon:d});var h=WirisPlugin.instances[e.id].getCore().getCustomEditors(),g=function(t){if(h.editors[t].confVariable){var n=function(){h.enable(t),WirisPlugin.instances[e.id].openNewFormulaEditor()},i="tiny_mce_wiris_openFormulaEditor".concat(h.editors[t].name);e.addCommand(i,n),o.addButton("tiny_mce_wiris_formulaEditor".concat(h.editors[t].name),{title:h.editors[t].tooltip,tooltip:h.editors[t].tooltip,onAction:n,cmd:i,image:WirisPlugin.instances[e.id].getIconsPath()+h.editors[t].icon,icon:u})}};for(var p in h.editors)g(p)},getInfo:function(){return{longname:"tiny_mce_wiris",author:"Maths for More",authorurl:"http://www.wiris.com",infourl:"http://www.wiris.com",version:be}}}),tinymce.PluginManager.add("tiny_mce_wiris",tinymce.plugins.tiny_mce_wiris),window.WirisPlugin={Core:fe,Parser:E,Image:k,Util:w,Configuration:l,Listeners:m,IntegrationModel:ie,currentInstance:null,instances:{},TinyMceIntegration:Te,Latex:f,Test:ve}},139:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,".wrs_modal_overlay {\n position: fixed;\n font-family: arial, sans-serif;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.8);\n z-index: 999998;\n opacity: 0.65;\n pointer-events: auto;\n}\n\n.wrs_modal_overlay.wrs_modal_ios {\n visibility: hidden;\n display: none;\n}\n\n.wrs_modal_overlay.wrs_modal_android {\n visibility: hidden;\n display: none;\n}\n\n.wrs_modal_overlay.wrs_modal_ios.moodle {\n position: fixed;\n}\n\n.wrs_modal_overlay.wrs_modal_desktop.wrs_stack {\n background: rgba(0, 0, 0, 0);\n display: none;\n}\n\n.wrs_modal_overlay.wrs_modal_desktop.wrs_maximized {\n background: rgba(0, 0, 0, 0.8);\n}\n\n.wrs_modal_overlay.wrs_modal_desktop.wrs_minimized {\n background: rgba(0, 0, 0, 0);\n display: none;\n}\n\n.wrs_modal_overlay.wrs_modal_desktop.wrs_closed {\n background: rgba(0, 0, 0, 0);\n display: none;\n}\n\n.wrs_modal_title {\n color: #fff;\n padding: 5px 0 5px 10px;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n}\n\n.wrs_modal_close_button {\n float: right;\n cursor: pointer;\n color: #fff;\n padding: 5px 10px 5px 0;\n margin: 10px 7px 0 0;\n background-repeat: no-repeat;\n}\n\n.wrs_modal_minimize_button {\n float: right;\n cursor: pointer;\n color: #fff;\n padding: 5px 10px 5px 0;\n top: inherit;\n margin: 10px 7px 0 0;\n}\n\n.wrs_modal_stack_button {\n float: right;\n cursor: pointer;\n color: #fff;\n margin: 10px 7px 0 0;\n padding: 5px 10px 5px 0;\n top: inherit;\n}\n\n.wrs_modal_stack_button.wrs_stack {\n visibility: hidden;\n margin: 0;\n padding: 0;\n}\n\n.wrs_modal_stack_button.wrs_minimized {\n visibility: hidden;\n margin: 0;\n padding: 0;\n}\n\n.wrs_modal_maximize_button {\n float: right;\n cursor: pointer;\n color: #fff;\n margin: 10px 7px 0 0;\n padding: 5px 10px 5px 0;\n top: inherit;\n}\n\n.wrs_modal_maximize_button.wrs_maximized {\n visibility: hidden;\n margin: 0;\n padding: 0;\n}\n\n.wrs_modal_title_bar {\n display: block;\n background-color: #778e9a;\n}\n\n.wrs_modal_dialogContainer {\n border: none;\n background: #fafafa;\n z-index: 999999;\n}\n\n.wrs_modal_dialogContainer.wrs_modal_desktop {\n font-size: 14px;\n}\n\n.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_maximized {\n position: fixed;\n}\n\n.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_minimized {\n position: fixed;\n top: inherit;\n margin: 0;\n margin-right: 10px;\n}\n\n.wrs_modal_dialogContainer.wrs_closed {\n visibility: hidden;\n display: none;\n opacity: 0;\n}\n\n/* Class that exists but hasn't got css properties defined\n.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_minimized.wrs_drag {} */\n\n.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_stack {\n position: fixed;\n bottom: 0;\n right: 0;\n box-shadow: rgba(0, 0, 0, 0.5) 0 2px 8px;\n}\n\n.wrs_modal_dialogContainer.wrs_drag {\n box-shadow: rgba(0, 0, 0, 0.5) 0 2px 8px;\n}\n\n.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_drag {\n box-shadow: rgba(0, 0, 0, 0.5) 0 2px 8px;\n}\n\n.wrs_modal_dialogContainer.wrs_modal_android {\n margin: auto;\n position: fixed;\n width: 99%;\n height: 99%;\n overflow: hidden;\n transform: translate(50%, -50%);\n top: 50%;\n right: 50% !important;\n}\n\n.wrs_modal_dialogContainer.wrs_modal_ios {\n margin: auto;\n position: fixed;\n width: 100%;\n height: 100%;\n overflow: hidden;\n transform: translate(50%, -50%);\n top: 50%;\n right: 50% !important;\n}\n\n/* Class that exists but hasn't got css properties defined\n.wrs_content_container.wrs_maximized {} */\n\n.wrs_content_container.wrs_minimized {\n display: none;\n}\n\n/* .wrs_editor {\n flex-grow: 1;\n} */\n\n.wrs_content_container.wrs_modal_android {\n width: 100%;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n}\n\n.wrs_content_container.wrs_modal_android > div:first-child {\n flex-grow: 1;\n}\n\n.wrs_content_container.wrs_modal_ios > div:first-child {\n flex-grow: 1;\n}\n\n.wrs_content_container.wrs_modal_desktop > div:first-child {\n flex-grow: 1;\n}\n\n.wrs_modal_wrapper.wrs_modal_android {\n margin: auto;\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n}\n\n.wrs_content_container.wrs_modal_desktop {\n width: 100%;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n}\n\n.wrs_content_container.wrs_modal_ios {\n width: 100%;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n}\n\n.wrs_modal_wrapper.wrs_modal_ios {\n margin: auto;\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n}\n\n.wrs_virtual_keyboard {\n height: 100%;\n width: 100%;\n top: 0;\n left: 50%;\n transform: translate(-50%, 0%);\n}\n\n@media all and (orientation: portrait) {\n .wrs_modal_dialogContainer.wrs_modal_mobile {\n width: 100vmin;\n height: 100vmin;\n margin: auto;\n border-width: 0;\n }\n\n .wrs_modal_wrapper.wrs_modal_mobile {\n width: 100vmin;\n height: 100vmin;\n margin: auto;\n }\n}\n\n@media all and (orientation: landscape) {\n .wrs_modal_dialogContainer.wrs_modal_mobile {\n width: 100vmin;\n height: 100vmin;\n margin: auto;\n border-width: 0;\n }\n\n .wrs_modal_wrapper.wrs_modal_mobile {\n width: 100vmin;\n height: 100vmin;\n margin: auto;\n }\n}\n\n.wrs_modal_dialogContainer.wrs_modal_badStock {\n width: 100%;\n height: 280px;\n margin: 0 auto;\n border-width: 0;\n}\n\n.wrs_modal_wrapper.wrs_modal_badStock {\n width: 100%;\n height: 280px;\n margin: 0 auto;\n border-width: 0;\n}\n\n.wrs_noselect {\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.wrs_bottom_right_resizer {\n width: 10px;\n height: 10px;\n color: #778e9a;\n position: absolute;\n right: 4px;\n bottom: 8px;\n cursor: se-resize;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.wrs_bottom_left_resizer {\n width: 15px;\n height: 15px;\n color: #778e9a;\n position: absolute;\n left: 0;\n top: 0;\n cursor: se-resize;\n}\n\n.wrs_modal_controls {\n height: 42px;\n margin: 3px 0;\n overflow: hidden;\n line-height: normal;\n}\n\n.wrs_modal_links {\n margin: 10px auto;\n margin-bottom: 0;\n font-family: arial, sans-serif;\n padding: 6px;\n display: inline;\n float: right;\n text-align: right;\n}\n\n.wrs_modal_links > a {\n text-decoration: none;\n color: #778e9a;\n font-size: 16px;\n}\n\n.wrs_modal_button_cancel,\n.wrs_modal_button_cancel:hover,\n.wrs_modal_button_cancel:visited,\n.wrs_modal_button_cancel:active,\n.wrs_modal_button_cancel:focus {\n min-width: 80px;\n font-size: 14px;\n border-radius: 3px;\n border: 1px solid #778e9a;\n padding: 6px 8px;\n margin: 10px auto;\n margin-left: 5px;\n margin-bottom: 0;\n cursor: pointer;\n font-family: arial, sans-serif;\n background-color: #ddd;\n height: 32px;\n}\n\n.wrs_modal_button_accept,\n.wrs_modal_button_accept:hover,\n.wrs_modal_button_accept:visited,\n.wrs_modal_button_accept:active,\n.wrs_modal_button_accept:focus {\n min-width: 80px;\n font-size: 14px;\n border-radius: 3px;\n border: 1px solid #778e9a;\n padding: 6px 8px;\n margin: 10px auto;\n margin-right: 5px;\n margin-bottom: 0;\n color: #fff;\n background: #778e9a;\n cursor: pointer;\n font-family: arial, sans-serif;\n height: 32px;\n}\n\n.wrs_editor_vertical_bar {\n height: 20px;\n float: right;\n background: none;\n width: 20px;\n cursor: pointer;\n}\n\n.wrs_modal_buttons_container {\n display: inline;\n float: left;\n}\n\n.wrs_modal_buttons_container.wrs_modalAndroid {\n padding-left: 6px;\n}\n\n.wrs_modal_buttons_container.wrs_modalDesktop {\n padding-left: 0;\n}\n\n.wrs_modal_buttons_container > button {\n line-height: normal;\n background-image: none;\n}\n\n.wrs_modal_wrapper {\n margin: 6px;\n display: flex;\n flex-direction: column;\n}\n\n.wrs_modal_wrapper.wrs_modal_desktop.wrs_minimized {\n display: none;\n}\n\n@media only screen and (max-device-width: 480px) and (orientation: portrait) {\n #wrs_modal_wrapper {\n width: 140%;\n }\n}\n\n.wrs_popupmessage_overlay_envolture {\n display: none;\n width: 100%;\n}\n\n.wrs_popupmessage_overlay {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 4;\n cursor: pointer;\n}\n\n.wrs_popupmessage_panel {\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n position: absolute;\n background: white;\n max-width: 500px;\n width: 75%;\n border-radius: 2px;\n padding: 20px;\n font-family: sans-serif;\n font-size: 15px;\n text-align: left;\n color: #2e2e2e;\n z-index: 5;\n max-height: 75%;\n overflow: auto;\n}\n\n.wrs_popupmessage_button_area {\n margin: 10px 0 0 0;\n}\n\n.wrs_panelContainer * {\n border: 0;\n}\n\n.wrs_button_cancel,\n.wrs_button_cancel:hover,\n.wrs_button_cancel:visited,\n.wrs_button_cancel:active,\n.wrs_button_cancel:focus {\n min-width: 80px;\n font-size: 14px;\n border-radius: 3px;\n border: 1px solid #778e9a;\n padding: 6px 8px;\n margin: 10px auto;\n margin-left: 5px;\n margin-bottom: 0;\n cursor: pointer;\n font-family: arial, sans-serif;\n background-color: #ddd;\n background-image: none;\n height: 32px;\n}\n\n.wrs_button_accept,\n.wrs_button_accept:hover,\n.wrs_button_accept:visited,\n.wrs_button_accept:active,\n.wrs_button_accept:focus {\n min-width: 80px;\n font-size: 14px;\n border-radius: 3px;\n border: 1px solid #778e9a;\n padding: 6px 8px;\n margin: 10px auto;\n margin-right: 5px;\n margin-bottom: 0;\n color: #fff;\n background: #778e9a;\n cursor: pointer;\n font-family: arial, sans-serif;\n height: 32px;\n}\n\n.wrs_editor button {\n box-shadow: none;\n}\n\n.wrs_editor .wrs_header button {\n border-bottom: none;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.wrs_modal_overlay.wrs_modal_desktop.wrs_stack.wrs_overlay_active {\n display: block;\n}\n\n/* Fix selection in drupal style */\n.wrs_toolbar tr:focus {\n background: none;\n}\n\n.wrs_toolbar tr:hover {\n background: none;\n}\n\n/* End of fix drupal */\n.wrs_modal_rtl .wrs_modal_button_cancel {\n margin-right: 5px;\n margin-left: 0;\n}\n\n.wrs_modal_rtl .wrs_modal_button_accept {\n margin-right: 0;\n margin-left: 5px;\n}\n\n.wrs_modal_rtl .wrs_button_cancel {\n margin-right: 5px;\n margin-left: 0;\n}\n\n.wrs_modal_rtl .wrs_button_accept {\n margin-right: 0;\n margin-left: 5px;\n}\n",""]);const a=r},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,i){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(i)for(var a=0;a{var i,r=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),o=[];function s(e){for(var t=-1,n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__=__webpack_require__(733)})(); \ No newline at end of file +(()=>{"use strict";var __webpack_modules__={971:()=>{function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var md5,__WEBPACK_DEFAULT_EXPORT__=md5;(function(){var HxOverrides=function(){};HxOverrides.__name__=!0,HxOverrides.dateStr=function(e){var t=e.getMonth()+1,n=e.getDate(),i=e.getHours(),r=e.getMinutes(),a=e.getSeconds();return e.getFullYear()+"-"+(t<10?"0"+t:""+t)+"-"+(n<10?"0"+n:""+n)+" "+(i<10?"0"+i:""+i)+":"+(r<10?"0"+r:""+r)+":"+(a<10?"0"+a:""+a)},HxOverrides.strDate=function(e){switch(e.length){case 8:var t=e.split(":"),n=new Date;return n.setTime(0),n.setUTCHours(t[0]),n.setUTCMinutes(t[1]),n.setUTCSeconds(t[2]),n;case 10:t=e.split("-");return new Date(t[0],t[1]-1,t[2],0,0,0);case 19:var i=(t=e.split(" "))[0].split("-"),r=t[1].split(":");return new Date(i[0],i[1]-1,i[2],r[0],r[1],r[2]);default:throw"Invalid date format : "+e}},HxOverrides.cca=function(e,t){var n=e.charCodeAt(t);if(n==n)return n},HxOverrides.substr=function(e,t,n){return null!=t&&0!=t&&null!=n&&n<0?"":(null==n&&(n=e.length),t<0?(t=e.length+t)<0&&(t=0):n<0&&(n=e.length+n-t),e.substr(t,n))},HxOverrides.remove=function(e,t){for(var n=0,i=e.length;n>>32-t},str2blks:function(e){for(var t=1+(e.length+8>>6),n=new Array,i=0,r=16*t;i>2]|=HxOverrides.cca(e,a)<<(8*e.length+a)%4*8,a++;n[a>>2]|=128<<(8*e.length+a)%4*8;var o=8*e.length,s=16*t-2;return n[s]=255&o,n[s]|=(o>>>8&255)<<8,n[s]|=(o>>>16&255)<<16,n[s]|=(o>>>24&255)<<24,n},rhex:function(e){for(var t="",n="0123456789abcdef",i=0;i<4;){var r=i++;t+=n.charAt(e>>8*r+4&15)+n.charAt(e>>8*r&15)}return t},addme:function(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},bitAND:function(e,t){return(e>>>1&t>>>1)<<1|1&e&t},bitXOR:function(e,t){return(e>>>1^t>>>1)<<1|1&e^1&t},bitOR:function(e,t){return(e>>>1|t>>>1)<<1|(1&e|1&t)},__class__:haxe.Md5},haxe.Timer=function(e){var t=this;this.id=window.setInterval((function(){t.run()}),e)},haxe.Timer.__name__=!0,haxe.Timer.delay=function(e,t){var n=new haxe.Timer(t);return n.run=function(){n.stop(),e()},n},haxe.Timer.measure=function(e,t){var n=haxe.Timer.stamp(),i=e();return haxe.Log.trace(haxe.Timer.stamp()-n+"s",t),i},haxe.Timer.stamp=function(){return(new Date).getTime()/1e3},haxe.Timer.prototype={run:function(){},stop:function(){null!=this.id&&(window.clearInterval(this.id),this.id=null)},__class__:haxe.Timer};var js=js||{},$_;function $bind(e,t){var n=function e(){return e.method.apply(e.scope,arguments)};return n.scope=e,n.method=t,n}js.Boot=function(){},js.Boot.__name__=!0,js.Boot.__unhtml=function(e){return e.split("&").join("&").split("<").join("<").split(">").join(">")},js.Boot.__trace=function(e,t){var n,i=null!=t?t.fileName+":"+t.lineNumber+": ":"";i+=js.Boot.__string_rec(e,""),"undefined"!=typeof document&&null!=(n=document.getElementById("haxe:trace"))?n.innerHTML+=js.Boot.__unhtml(i)+"
":"undefined"!=typeof console&&null!=console.log&&console.log(i)},js.Boot.__clear_trace=function(){var e=document.getElementById("haxe:trace");null!=e&&(e.innerHTML="")},js.Boot.isClass=function(e){return e.__name__},js.Boot.isEnum=function(e){return e.__ename__},js.Boot.getClass=function(e){return e.__class__},js.Boot.__string_rec=function(e,t){if(null==e)return"null";if(t.length>=5)return"<...>";var n=_typeof(e);switch("function"==n&&(e.__name__||e.__ename__)&&(n="object"),n){case"object":if(e instanceof Array){if(e.__enum__){if(2==e.length)return e[0];var i=e[0]+"(";t+="\t";for(var r=2,a=e.length;r0?",":"")+js.Boot.__string_rec(e[l],t)}return i+="]"}var c;try{c=e.toString}catch(e){return"???"}if(null!=c&&c!=Object.toString){var d=e.toString();if("[object Object]"!=d)return d}var u=null;i="{\n";t+="\t";var m=null!=e.hasOwnProperty;for(var u in e)m&&!e.hasOwnProperty(u)||"prototype"!=u&&"__class__"!=u&&"__super__"!=u&&"__interfaces__"!=u&&"__properties__"!=u&&(2!=i.length&&(i+=", \n"),i+=t+u+" : "+js.Boot.__string_rec(e[u],t));return i+="\n"+(t=t.substring(1))+"}";case"function":return"";case"string":return e;default:return String(e)}},js.Boot.__interfLoop=function(e,t){if(null==e)return!1;if(e==t)return!0;var n=e.__interfaces__;if(null!=n)for(var i=0,r=n.length;i>>32-t},str2blks:function(e){for(var t=1+(e.length+8>>6),n=new Array,i=0,r=16*t;i>2]|=HxOverrides.cca(e,a)<<(8*e.length+a)%4*8,a++;n[a>>2]|=128<<(8*e.length+a)%4*8;var o=8*e.length,s=16*t-2;return n[s]=255&o,n[s]|=(o>>>8&255)<<8,n[s]|=(o>>>16&255)<<16,n[s]|=(o>>>24&255)<<24,n},rhex:function(e){for(var t="",n="0123456789abcdef",i=0;i<4;){var r=i++;t+=n.charAt(e>>8*r+4&15)+n.charAt(e>>8*r&15)}return t},addme:function(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},bitAND:function(e,t){return(e>>>1&t>>>1)<<1|1&e&t},bitXOR:function(e,t){return(e>>>1^t>>>1)<<1|1&e^1&t},bitOR:function(e,t){return(e>>>1|t>>>1)<<1|(1&e|1&t)},__class__:haxe.Md5},haxe.Timer=function(e){var t=this;this.id=window.setInterval((function(){t.run()}),e)},haxe.Timer.__name__=!0,haxe.Timer.delay=function(e,t){var n=new haxe.Timer(t);return n.run=function(){n.stop(),e()},n},haxe.Timer.measure=function(e,t){var n=haxe.Timer.stamp(),i=e();return haxe.Log.trace(haxe.Timer.stamp()-n+"s",t),i},haxe.Timer.stamp=function(){return(new Date).getTime()/1e3},haxe.Timer.prototype={run:function(){},stop:function(){null!=this.id&&(window.clearInterval(this.id),this.id=null)},__class__:haxe.Timer};var js=js||{},$_;function $bind(e,t){var n=function e(){return e.method.apply(e.scope,arguments)};return n.scope=e,n.method=t,n}js.Boot=function(){},js.Boot.__name__=!0,js.Boot.__unhtml=function(e){return e.split("&").join("&").split("<").join("<").split(">").join(">")},js.Boot.__trace=function(e,t){var n,i=null!=t?t.fileName+":"+t.lineNumber+": ":"";i+=js.Boot.__string_rec(e,""),"undefined"!=typeof document&&null!=(n=document.getElementById("haxe:trace"))?n.innerHTML+=js.Boot.__unhtml(i)+"
":"undefined"!=typeof console&&null!=console.log&&console.log(i)},js.Boot.__clear_trace=function(){var e=document.getElementById("haxe:trace");null!=e&&(e.innerHTML="")},js.Boot.isClass=function(e){return e.__name__},js.Boot.isEnum=function(e){return e.__ename__},js.Boot.getClass=function(e){return e.__class__},js.Boot.__string_rec=function(e,t){if(null==e)return"null";if(t.length>=5)return"<...>";var n=_typeof(e);switch("function"==n&&(e.__name__||e.__ename__)&&(n="object"),n){case"object":if(e instanceof Array){if(e.__enum__){if(2==e.length)return e[0];var i=e[0]+"(";t+="\t";for(var r=2,a=e.length;r0?",":"")+js.Boot.__string_rec(e[l],t)}return i+="]"}var c;try{c=e.toString}catch(e){return"???"}if(null!=c&&c!=Object.toString){var d=e.toString();if("[object Object]"!=d)return d}var u=null;i="{\n";t+="\t";var m=null!=e.hasOwnProperty;for(var u in e)m&&!e.hasOwnProperty(u)||"prototype"!=u&&"__class__"!=u&&"__super__"!=u&&"__interfaces__"!=u&&"__properties__"!=u&&(2!=i.length&&(i+=", \n"),i+=t+u+" : "+js.Boot.__string_rec(e[u],t));return i+="\n"+(t=t.substring(1))+"}";case"function":return"";case"string":return e;default:return String(e)}},js.Boot.__interfLoop=function(e,t){if(null==e)return!1;if(e==t)return!0;var n=e.__interfaces__;if(null!=n)for(var i=0,r=n.length;i{function i(e,t){for(var n=0;n«/mo»",ampElement:"«mo»&«/mo»"}}},{key:"safeGoodBlackboardCharacters",get:function(){return{ltElement:"«mo»§lt;«/mo»",gtElement:"«mo»§gt;«/mo»",ampElement:"«mo»§amp;«/mo»"}}},{key:"xmlCharacters",get:function(){return{id:"xmlCharacters",tagOpener:"<",tagCloser:">",doubleQuote:'"',ampersand:"&",quote:"'"}}},{key:"safeXmlCharacters",get:function(){return{id:"safeXmlCharacters",tagOpener:"«",tagCloser:"»",doubleQuote:"¨",ampersand:"§",quote:"`",realDoubleQuote:"¨"}}}],(n=null)&&i(t.prototype,n),r&&i(t,r),e}();function a(e,t){for(var n=0;n128)t+="&#".concat(e.codePointAt(n),";"),e.codePointAt(n)>65535&&(n+=1);else if("&"===i){var r=e.indexOf(";",n+1);if(r>=0){var a=document.createElement("span");a.innerHTML=e.substring(n,r+1),t+="&#".concat(w.fixedCharCodeAt(a.textContent||a.innerText,0),";"),n=r}else t+=i}else t+=i}return t}},{key:"addCustomEditorClassAttribute",value:function(e,t){var n="",i=e.indexOf("");if(-1===e.indexOf("class"))return n="".concat(e.substr(i,r),' class="wrs_').concat(t,'">'),n+=e.substr(r+1,e.length)}return e}},{key:"removeCustomEditorClassAttribute",value:function(e,t){return-1===e.indexOf("class")||-1===e.indexOf("wrs_".concat(t))?e:-1!==e.indexOf('class="wrs_'.concat(t,'"'))?e.replace('class="wrs_'.concat(t,'"'),""):e.replace("wrs_".concat(t),"")}},{key:"addAnnotation",value:function(t,n,i){var r="";if(-1!==t.indexOf("");r="".concat(t.substring(0,a),'').concat(n,"").concat(t.substring(a))}else if(e.isEmpty(t)){var o=t.indexOf("/>"),s=t.indexOf(">"),l=s===o?o:s;r="".concat(t.substring(0,l),'>').concat(n,"")}else{var c=t.indexOf(">")+1,d=t.lastIndexOf(""),u=t.substring(c,d);r="".concat(t.substring(0,c),"").concat(u,'').concat(n,"")}return r}},{key:"removeAnnotation",value:function(t,n){var i=t,r=''),a="",o=t.indexOf(r);if(-1!==o){for(var s=!1,l=t.indexOf("")}return n}},{key:"removeSemanticsOcurrences",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.xmlCharacters,n="".concat(t.tagOpener,"math"),i="".concat(t.tagOpener,"/math").concat(t.tagCloser),a="/".concat(t.tagCloser),o=t.tagCloser,s="".concat(t.tagOpener,"semantics").concat(t.tagCloser),l="".concat(t.tagOpener,"annotation encoding="),c="",d=e.indexOf(n),u=0;-1!==d;){c+=e.substring(u,d);var m=e.indexOf(i,d),h=e.indexOf(a,d),g=e.indexOf(o,d);-1!==m?u=m:h===g-1&&(u=h);var p=e.indexOf(s,d);if(-1!==p){var f=e.substring(d,p),v=e.indexOf(l,d);if(-1!==v){var _=p+s.length,b=e.substring(_,v);c+=f+b+i,d=e.indexOf(n,d+n.length),u+=i.length}else u=d,d=e.indexOf(n,d+n.length)}else u=d,d=e.indexOf(n,d+n.length)}return c+=e.substring(u,e.length)}},{key:"containClass",value:function(e,t){var n=e.indexOf("class");if(-1===n)return!1;var i=e.indexOf(">",n);return-1!==e.substring(n,i).indexOf(t)}},{key:"isEmpty",value:function(e){var t=e.indexOf(">"),n=e.indexOf("/>"),i=!1;if(-1!==n&&n===t-1&&(i=!0),!i){var r=new RegExp("").exec(e);r&&(i=t+1===r.index)}return i}},{key:"encodeProperties",value:function(e){return e.replace(/\w+=".*?"/g,(function(e){var t=e.indexOf('"'),n=e.substring(t+1,e.length-1),i=w.htmlEntities(n);return"".concat(e.substring(0,t+1)).concat(i,'"')}))}}],(n=null)&&a(t.prototype,n),i&&a(t,i),e}();function s(e,t){for(var n=0;n2&&(t=t.slice(0,2)),this.strings.hasOwnProperty(t)||(console.warn("Unknown language ".concat(t," set in StringManager.")),t="en"),this.strings[t].hasOwnProperty(e)?this.strings[t][e]:(console.warn("Unknown key ".concat(e," for language ").concat(t," in StringManager.")),e)}}],(n=null)&&_(t.prototype,n),i&&_(t,i),e}();function y(e,t){for(var n=0;n=0;i-=1)if(n[i]===t)return!0;return!1}},{key:"removeClass",value:function(e,t){for(var n="",i=e.className.split(" "),r=0;r").join("").split("").join("")).split("").join("
").split("").join("
");var i=e.createElement("div",{},n);return i.innerHTML=t,function t(i){if(i.getAttribute&&"WirisParam"===i.getAttribute("wirisObject")){for(var r={},a=0;a0){n+=">";for(var r=0;r")}else"DIV"===t.nodeName||"SCRIPT"===t.nodeName?n+=">"):n+="/>";return n}return 3===t.nodeType?e.htmlEntities(t.nodeValue):""}},{key:"concatenateUrl",value:function(e,t){var n="";return e.indexOf("/")!==e.length&&0!==t.indexOf("/")&&(n="/"),(e+n+t).replace(/([^:]\/)\/+/g,"$1")}},{key:"htmlEntities",value:function(e){return e.split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""")}},{key:"htmlEntitiesDecode",value:function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.value}},{key:"createHttpRequest",value:function(){if("file://"===window.location.toString().substr(0,window.location.toString().lastIndexOf("/")+1).substr(0,7))throw b.get("exception_cross_site");if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return null}}}},{key:"httpBuildQuery",value:function(t){var n="";return Object.keys(t).forEach((function(i){null!=t[i]&&(n+="".concat(e.urlEncode(i),"=").concat(e.urlEncode(t[i]),"&"))})),"&"===n.substring(n.length-1)&&(n=n.substring(0,n.length-1)),n}},{key:"propertiesToString",value:function(t){var n=[];Object.keys(t).forEach((function(e){Object.prototype.hasOwnProperty.call(t,e)&&n.push(e)}));for(var i=n.length,r=0;r0&&(n[r]=s,n[a]=o)}for(var l="",c=0;ca?a:r;for(i=0;i=55296&&r<=56319){if(n=r,i=e.charCodeAt(t+1),Number.isNaN(i))throw b.get("exception_high_surrogate");return 1024*(n-55296)+(i-56320)+65536}return!(r>=56320&&r<=57343)&&r}},{key:"urlToAssArray",value:function(e){var t;if((t=e.indexOf("?"))>0){var n=e.substring(t+1).split("&"),i={};for(t=0;t1&&(i[r[0]]=decodeURIComponent(r[1].replace(/\+/g," ")))}return i}return{}}},{key:"urlEncode",value:function(e){return encodeURIComponent(e)}},{key:"getWIRISImageOutput",value:function(t,n,i){var r=e.createObject(t);if(r&&(r.className===l.get("imageClassName")||r.getAttribute(l.get("imageMathmlAttribute")))){if(!n)return t;var a=r.getAttribute(l.get("imageMathmlAttribute")),s=o.safeXmlDecode(a);return l.get("saveHandTraces")||(s=o.removeAnnotation(s,"application/json")),null==s&&(s=r.getAttribute("alt")),i?o.safeXmlEncode(s):s}return t}},{key:"getNodeLength",value:function(t){if(3===t.nodeType)return t.nodeValue.length;if(1===t.nodeType){var n={IMG:1,BR:1}[t.nodeName.toUpperCase()];void 0===n&&(n=0);for(var i=0;i0)return 0===a.text.length?e.getSelectedItem(t,n,!0):null;r.document.execCommand("InsertImage",!1,"#");var o,s,l=a.parentElement();return"IMG"!==l.nodeName.toUpperCase()&&(a.pasteHTML(''),l=r.document.getElementById("wrs_openEditorWindow_temporalObject")),l.nextSibling&&3===l.nextSibling.nodeType?(o=l.nextSibling,s=0):l.previousSibling&&3===l.previousSibling.nodeType?s=(o=l.previousSibling).nodeValue.length:(o=r.document.createTextNode(""),l.parentNode.insertBefore(o,l),s=0),l.parentNode.removeChild(l),{node:o,caretPosition:s}}return a.length>1?null:{node:a.item(0)}}if(r.getSelection){var c,d=r.getSelection();try{c=d.getRangeAt(0)}catch(e){c=r.document.createRange()}var u=c.startContainer;if(3===u.nodeType)return{node:u,caretPosition:c.startOffset};if(u!==c.endContainer)return null;if(1===u.nodeType){var m=c.startOffset;if(u.childNodes[m])return{node:u.childNodes[m]}}}return null}},{key:"getSelectedItemOnTextarea",value:function(e){var t=document.createTextNode(e.value),n=f.getLatexFromTextNode(t,e.selectionStart);return null===n?null:{node:t,caretPosition:e.selectionStart,startPosition:n.startPosition,endPosition:n.endPosition}}},{key:"getElementsByNameFromString",value:function(e,t,n){var i=[];e=e.toLowerCase(),t=t.toLowerCase();for(var r=e.indexOf("<".concat(t," "));-1!==r;){var a=void 0;a=n?">":"");var o=e.indexOf(a,r);-1!==o?(o+=a.length,i.push({start:r,end:o})):o=r+1,r=e.indexOf("<".concat(t," "),o)}return i}},{key:"decode64",value:function(e){var t="+".charCodeAt(0),n="/".charCodeAt(0),i="0".charCodeAt(0),r="a".charCodeAt(0),a="A".charCodeAt(0),o="-".charCodeAt(0),s="_".charCodeAt(0),l=e.charCodeAt(0);return l===t||l===o?62:l===n||l===s?63:l0)throw new Error("Invalid string. Length must be a multiple of 4");var r,a,o,s=[];for(r=n||((a="="===t.charAt(t.length-2)?2:"="===t.charAt(t.length-1)?1:0)>0?t.length-4:t.length),o=0;o>16&255),s.push(i>>8&255),s.push(255&i);return a&&(2===a?(i=e.decode64(t.charAt(o))<<2|e.decode64(t.charAt(o+1))>>4,s.push(255&i)):1===a&&(i=e.decode64(t.charAt(o))<<10|e.decode64(t.charAt(o+1))<<4|e.decode64(t.charAt(o+2))>>2,s.push(i>>8&255),s.push(255&i))),s}},{key:"readInt32",value:function(e){if(e.length<4)return!1;var t=e.splice(0,4);return t[0]<<24|t[1]<<16|t[2]<<8|t[3]<<0}},{key:"readByte",value:function(e){return e.shift()<<0}},{key:"readBytes",value:function(e,t,n){return e.splice(t,n)}},{key:"updateTextArea",value:function(e,t){if(e&&t)if(e.focus(),null!=e.selectionStart){var n=e.selectionEnd,i=e.value.substring(0,e.selectionStart),r=e.value.substring(n,e.value.length);e.value=i+t+r,e.selectionEnd=n+t.length}else document.selection.createRange().text=t}},{key:"updateExistingTextOnTextarea",value:function(e,t,n,i){e.focus();var r=e.value.substring(0,n);e.value=r+t+e.value.substring(i,e.value.length),e.selectionEnd=n+t.length}},{key:"addArgument",value:function(e,t,n){var i;return i=e.indexOf("?")>0?"&":"?","".concat(e+i+t,"=").concat(n)}}],(n=null)&&y(t.prototype,n),i&&y(t,i),e}();function x(e,t){for(var n=0;n=4;)1229472850===(i=w.readInt32(e))?(t=w.readInt32(e),n=w.readInt32(e),w.readInt32(e),w.readByte(e)):1650545477===i?r=w.readInt32(e):1883789683===i&&(a=w.readInt32(e),a=Math.round(a/39.37),w.readInt32(e),w.readByte(e)),w.readInt32(e);if(void 0!==t){var o=[];return o.cw=t,o.ch=n,o.dpi=a,r&&(o.cb=r),o}return[]}}],(n=null)&&x(t.prototype,n),i&&x(t,i),e}();function A(e,t){for(var n=0;n',i=0,r=0;r",m),g=u.substring(m,h),p="$$".concat(w.htmlEntitiesDecode(g),"$$"),f=e.substring(0,t[r].start+i),v=e.substring(t[r].end+i);e=f+p+v,i+=p.length-(t[r].end-t[r].start)}}}}return e}},{key:"endParse",value:function(t){var n=e.endParseEditMode(t);return e.endParseSaveMode(n)}},{key:"endParseEditMode",value:function(e){if(-1!==l.get("parseModes").indexOf("latex")){for(var t="",n=0,i=e.indexOf("$$");-1!==i;){if(t+=e.substring(n,i),-1!==(n=e.indexOf("$$",i+2))){var r=e.substring(i+2,n),a=w.htmlEntitiesDecode(r),s=f.getMathMLFromLatex(a,!0);l.get("saveHandTraces")||(s=o.removeAnnotation(s,"application/json")),t+=s,n+=2}else t+="$$",n=i+2;i=e.indexOf("$$",n)}t+=e.substring(n,e.length),e=t}return e}},{key:"endParseSaveMode",value:function(t){return l.get("saveMode")&&("safeXml"===l.get("saveMode")||"xml"===l.get("saveMode")?t=e.codeImgTransform(t,"img2mathml"):"base64"===l.get("saveMode")&&"image"===l.get("base64savemode")&&(t=e.codeImgTransform(t,"img264"))),t}},{key:"createShowImageSrc",value:function(e,t){var n={};["mml","color","centerbaseline","zoom","dpi","fontSize","fontFamily","defaultStretchy","backgroundColor","format"].forEach((function(t){void 0!==e[t]&&(n[t]=e[t])}));var i={};return Object.keys(e).forEach((function(t){"mml"!==t&&(i[t]=e[t])})),i.formula=com.wiris.js.JsPluginTools.md5encode(w.propertiesToString(n)),i.lang=void 0===t?"en":t,i.version=l.get("version"),g.getService("showimage",w.httpBuildQuery(i),!0)}},{key:"codeImgTransform",value:function(t,n){for(var i="",r=0,a=/"===u&&(r=d+1);d+=1}if(r",d):c.length,o.isMathmlInAttribute(t,d)||-1!==m)a+=t.substring(d,u);else{var h=t.substring(d,u);h=n.id===r.safeXmlCharacters.id?o.safeXmlDecode(h):o.mathMLEntities(h),a+=w.createObjectCode(e.mathmlToImgObject(document,h,null,i))}d=t.indexOf(s,u)}return a+=t.substring(u,t.length)}}],(n=null)&&E(t.prototype,n),i&&E(t,i),e}();if("undefined"!=typeof MutationObserver){var j=new MutationObserver((function(e){e.forEach((function(e){e.oldValue===l.get("imageClassName")&&"class"===e.attributeName&&-1===e.target.className.indexOf(l.get("imageClassName"))&&(e.target.className=l.get("imageClassName"))}))}));T.observer=Object.create(j),T.observer.Config={attributes:!0,attributeOldValue:!0},T.observer.observe=function(e){Object.getPrototypeOf(this).observe(e,this.Config)}}function P(e,t){for(var n=0;n-1,this.deviceProperties.isIOS=e.isIOS(),this.toolbar=null,this.modalDialogInstance=null,this.listeners=new m,this.mathML=null,this.isNewElement=!0,this.integrationModel=null}var t,n,i;return t=e,i=[{key:"setHrefToAnchorElement",value:function(e,t){e.href=t}},{key:"setProtocolToAnchorElement",value:function(e){0===window.location.href.indexOf("https://")&&"http:"===e.protocol&&(e.protocol="https:")}},{key:"getURLFromAnchorElement",value:function(e){var t="80"===e.port||"443"===e.port||""===e.port;return"".concat(e.protocol,"//").concat(e.hostname).concat(t?"":":".concat(e.port)).concat(e.pathname.startsWith("/")?e.pathname:"/".concat(e.pathname))}},{key:"isIOS",value:function(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}},{key:"isEditorLoaded",value:function(){return window.com&&window.com.wiris&&window.com.wiris.jsEditor&&window.com.wiris.jsEditor.JsEditor&&window.com.wiris.jsEditor.JsEditor.newInstance}}],(n=[{key:"addListener",value:function(e){this.listeners.add(e)}},{key:"setIntegrationModel",value:function(e){this.integrationModel=e}},{key:"setModalDialogInstance",value:function(e){this.modalDialogInstance=e}},{key:"insert",value:function(){this.updateTitle(this.modalDialogInstance),this.insertEditor(this.modalDialogInstance)}},{key:"insertEditor",value:function(){if(e.isEditorLoaded()){if(this.editor=window.com.wiris.jsEditor.JsEditor.newInstance(this.editorAttributes),this.editor.insertInto(this.modalDialogInstance.contentContainer),this.editor.focus(),this.modalDialogInstance.rtl&&this.editor.action("rtl"),this.editor.getEditorModel().isRTL()&&(this.editor.element.style.direction="rtl"),this.editor.getEditorModel().addEditorListener(this.editorListener),this.modalDialogInstance.deviceProperties.isIOS){setTimeout((function(){this.hasOwnProperty("modalDialogInstance")&&this.modalDialogInstance.hideKeyboard()}),400);var t=document.getElementsByClassName("wrs_formulaDisplay")[0];w.addEvent(t,"focus",this.modalDialogInstance.handleOpenedIosSoftkeyboard),w.addEvent(t,"blur",this.modalDialogInstance.handleClosedIosSoftkeyboard)}this.listeners.fire("onLoad",{})}else setTimeout(e.prototype.insertEditor.bind(this),100)}},{key:"init",value:function(){e.isEditorLoaded()||this.addEditorAsExternalDependency()}},{key:"addEditorAsExternalDependency",value:function(){var t=document.createElement("script");t.type="text/javascript";var n=l.get("editorUrl"),i=document.createElement("a");e.setHrefToAnchorElement(i,n),e.setProtocolToAnchorElement(i),n=e.getURLFromAnchorElement(i);var r=this.getEditorStats();t.src="".concat(n,"?lang=").concat(this.language,"&stats-editor=").concat(r.editor,"&stats-mode=").concat(r.mode,"&stats-version=").concat(r.version),document.getElementsByTagName("head")[0].appendChild(t)}},{key:"getEditorStats",value:function(){var e={};return"editor"in this.environment?e.editor=this.environment.editor:e.editor="unknown","mode"in this.environment?e.mode=this.environment.mode:e.mode=l.get("saveMode"),"version"in this.environment?e.version=this.environment.version:e.version=l.get("version"),e}},{key:"setInitialContent",value:function(){this.isNewElement||this.setMathML(this.mathML)}},{key:"setMathML",value:function(e,t){var n=this;void 0===t&&(t=!1),this.editor.setMathMLWithCallback(e,(function(){n.editorListener.setWaitingForChanges(!0)})),setTimeout((function(){n.editorListener.setIsContentChanged(!1)}),500),t||this.onFocus()}},{key:"onFocus",value:function(){void 0!==this.editor&&null!=this.editor&&this.editor.focus()}},{key:"submitAction",value:function(){if(this.editor.isFormulaEmpty())this.integrationModel.updateFormula(null);else{var e=this.editor.getMathMLWithSemantics();if(null!==this.customEditors.getActiveEditor()){var t=this.customEditors.getActiveEditor().toolbar;e=o.addCustomEditorClassAttribute(e,t)}else Object.keys(this.customEditors.editors).forEach((function(t){e=o.removeCustomEditorClassAttribute(e,t)}));var n=o.mathMLEntities(e);this.integrationModel.updateFormula(n)}this.customEditors.disable(),this.integrationModel.notifyWindowClosed(),this.setEmptyMathML(),this.customEditors.disable()}},{key:"setEmptyMathML",value:function(){this.deviceProperties.isAndroid||this.deviceProperties.isIOS?this.editor.getEditorModel().isRTL()?this.setMathML('[]',!0):this.setMathML('[]',!0):this.editor.getEditorModel().isRTL()?this.setMathML('',!0):this.setMathML("",!0)}},{key:"onOpen",value:function(){this.isNewElement?this.setEmptyMathML():this.setMathML(this.mathML),this.updateToolbar(),this.onFocus(),this.deviceProperties.isIOS&&1!=document.documentElement.clientWidth/window.innerWidth&&this.setKeyboardMode()}},{key:"setKeyboardMode",value:function(){var t=document.getElementsByClassName("wrs_handOpen wrs_disablePalette")[0];t?(t.classList.remove("wrs_handOpen"),t.classList.remove("wrs_disablePalette")):setTimeout(e.prototype.setKeyboardMode.bind(this),100)}},{key:"updateToolbar",value:function(){this.updateTitle(this.modalDialogInstance);var e=this.customEditors.getActiveEditor();if(e){var t=e.toolbar?e.toolbar:_wrs_int_wirisProperties.toolbar;null!=this.toolbar&&this.toolbar===t||this.setToolbar(t)}else{var n=this.getToolbar();null!=this.toolbar&&this.toolbar===n||(this.setToolbar(n),this.customEditors.disable())}}},{key:"updateTitle",value:function(){var e=this.customEditors.getActiveEditor();e?this.modalDialogInstance.setTitle(e.title):this.modalDialogInstance.setTitle("MathType")}},{key:"getToolbar",value:function(){var e="general";return"toolbar"in this.editorAttributes&&(e=this.editorAttributes.toolbar),"general"===e&&(e="undefined"==typeof _wrs_int_wirisProperties||void 0===_wrs_int_wirisProperties.toolbar?"general":_wrs_int_wirisProperties.toolbar),e}},{key:"setToolbar",value:function(e){this.toolbar=e,this.editor.setParams({toolbar:this.toolbar})}},{key:"hasChanges",value:function(){return!this.editor.isFormulaEmpty()&&this.editorListener.getIsContentChanged()}},{key:"onKeyDown",value:function(e){if(void 0!==e.key&&!1===e.repeat)if("Escape"===e.key||"Esc"===e.key){var t=document.getElementsByClassName("wrs_expandButton wrs_expandButtonFor3RowsLayout wrs_pressed");0===t.length&&0===(t=document.getElementsByClassName("wrs_expandButton wrs_expandButtonFor2RowsLayout wrs_pressed")).length&&0===(t=document.getElementsByClassName("wrs_select wrs_pressed")).length&&(this.modalDialogInstance.cancelAction(),e.stopPropagation(),e.preventDefault())}else if(e.shiftKey&&"Tab"===e.key)if(document.activeElement===this.modalDialogInstance.submitButton)this.editor.focus(),e.stopPropagation(),e.preventDefault();else{var n=document.querySelector('[title="Manual"]');document.activeElement===n&&(this.modalDialogInstance.cancelButton.focus(),e.stopPropagation(),e.preventDefault())}else"Tab"===e.key&&(document.activeElement===this.modalDialogInstance.cancelButton?(document.querySelector('[title="Manual"]').focus(),e.stopPropagation(),e.preventDefault()):"wrs_formulaDisplay wrs_focused"===document.getElementsByClassName("wrs_formulaDisplay")[0].getAttribute("class")&&(this.modalDialogInstance.submitButton.focus(),e.stopPropagation(),e.preventDefault()))}}])&&I(t.prototype,n),i&&I(t,i),e}();function z(e,t){for(var n=0;n=0&&(t=e[n].src.substr(0,i-1))}return t}},{key:"getVersion",value:function(){return this.version}},{key:"setLanguage",value:function(e){this.language=e}},{key:"setCore",value:function(e){this.core=e,e.setIntegrationModel(this)}},{key:"getCore",value:function(){return this.core}},{key:"setTarget",value:function(e){this.target=e,this.isIframe="IFRAME"===this.target.tagName.toUpperCase()}},{key:"setEditorObject",value:function(e){this.editorObject=e}},{key:"openNewFormulaEditor",value:function(){this.core.editionProperties.isNewElement=!0,this.core.openModalDialog(this.target,this.isIframe)}},{key:"openExistingFormulaEditor",value:function(){this.core.editionProperties.isNewElement=!1,this.core.openModalDialog(this.target,this.isIframe)}},{key:"updateFormula",value:function(e){var t,n;this.editorParameters&&(e=com.wiris.editor.util.EditorUtils.addAnnotation(e,"application/vnd.wiris.mtweb-params+json",JSON.stringify(this.editorParameters))),this.isIframe?(t=this.target.contentWindow,n=this.target.contentWindow):(t=this.target,n=window);var i=this.core.beforeUpdateFormula(e,null);return i&&(i=this.insertFormula(t,n,i.mathml,i.wirisProperties))?this.core.afterUpdateFormula(i.focusElement,i.windowTarget,i.node,i.latex):""}},{key:"insertFormula",value:function(e,t,n,i){return this.core.insertFormula(e,t,n,i)}},{key:"getSelection",value:function(){return this.isIframe?(this.target.contentWindow.focus(),this.target.contentWindow.getSelection()):(this.target.focus(),window.getSelection())}},{key:"addEvents",value:function(){var e=this,t=this.isIframe?this.target.contentWindow.document:this.target;w.addElementEvents(t,(function(t,n){e.doubleClickHandler(t,n)}),(function(t,n){e.mousedownHandler(t,n)}),(function(t,n){e.mouseupHandler(t,n)}))}},{key:"removeEvents",value:function(){var e=this.isIframe?this.target.contentWindow.document:this.target;w.removeElementEvents(e)}},{key:"doubleClickHandler",value:function(e){if("img"===e.nodeName.toLowerCase()){this.core.getCustomEditors().disable();var t=l.get("imageCustomEditorName");if(e.hasAttribute(t)){var n=e.getAttribute(t);this.core.getCustomEditors().enable(n)}w.containsClass(e,l.get("imageClassName"))&&(this.core.editionProperties.temporalImage=e,this.core.editionProperties.isNewElement=!0,this.openExistingFormulaEditor())}}},{key:"mouseupHandler",value:function(){var e=this;this.temporalImageResizing&&setTimeout((function(){k.fixAfterResize(e.temporalImageResizing)}),10)}},{key:"mousedownHandler",value:function(e){"img"===e.nodeName.toLowerCase()&&w.containsClass(e,l.get("imageClassName"))&&(this.temporalImageResizing=e)}},{key:"getLanguage",value:function(){return this.getBrowserLanguage()}},{key:"getBrowserLanguage",value:function(){return navigator.userLanguage?navigator.userLanguage.substring(0,2):navigator.language?navigator.language.substring(0,2):"en"}},{key:"callbackFunction",value:function(){var e=this,t=m.newListener("onTargetReady",(function(){e.addEvents(e.target)}));this.listeners.add(t)}},{key:"notifyWindowClosed",value:function(){}},{key:"getMathmlFromTextNode",value:function(e,t){}},{key:"fillNonLatexNode",value:function(e,t,n){}},{key:"getSelectedItem",value:function(e,t){}}])&&F(t.prototype,n),i&&F(t,i),e}();function U(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=(Q[e[t+0]]+Q[e[t+1]]+Q[e[t+2]]+Q[e[t+3]]+"-"+Q[e[t+4]]+Q[e[t+5]]+"-"+Q[e[t+6]]+Q[e[t+7]]+"-"+Q[e[t+8]]+Q[e[t+9]]+"-"+Q[e[t+10]]+Q[e[t+11]]+Q[e[t+12]]+Q[e[t+13]]+Q[e[t+14]]+Q[e[t+15]]).toLowerCase();if(!K(n))throw TypeError("Stringified UUID is invalid");return n};const Z=function(e,t,n){var i=(e=e||{}).random||(e.rng||V)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return q(i)};function G(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,r,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw r}}return a}(e,t)||$(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){if(e){if("string"==typeof e)return ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ee(e,t):void 0}}function ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(document.cookie.split(";").map((function(e){return e.trim().split("=")})));try{for(n.s();!(t=n.n()).done;){var i=G(t.value,2),r=i[0],a=i[1];if(r===ne){this._senderId=a;break}}}catch(e){n.e(e)}finally{n.f()}this._senderId||(this._senderId=e.composeUUID(),document.cookie=this.composeCookie(ne,this._senderId,31536e4))}return this._senderId}},{key:"sessionId",get:function(){return this._sessionId||(this._sessionId=e.composeUUID()),this._sessionId}},{key:"send",value:function(t){var n={method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json","X-Api-Key":"CK20op1pOx2LAUjPFP7kB2UPveHZRidG51UJE26m","Accept-Version":"1"},body:JSON.stringify(e.composeBody(t))};return fetch(e.endpoint,n).then((function(e){return e})).catch((function(e){console.warn(e)}))}},{key:"session",get:function(){return{id:e.sessionId,page:0}}},{key:"sender",get:function(){return{id:e.senderId,os:navigator.oscpu,user_agent:window.navigator.userAgent,domain:window.location.hostname,deployment:e.deployment,editor_version:WirisPlugin.currentInstance.environment.editorVersion?WirisPlugin.currentInstance.environment.editorVersion:"",language:WirisPlugin.currentInstance.language,product_version:WirisPlugin.currentInstance.version,backend:WirisPlugin.currentInstance.serviceProviderProperties.server?WirisPlugin.currentInstance.serviceProviderProperties.server:""}}},{key:"deployment",get:function(){var e=WirisPlugin.currentInstance.environment.editor,t="";return/Generic/.test(e)?t="generic":/Froala/.test(e)?t="froala":/CKEditor/.test(e)?t="ckeditor":/TinyMCE/.test(e)&&(t="tinymce"),"".concat("mathtype-web-plugin-").concat(t)}},{key:"composeBody",value:function(t){return{messages:t,sender:e.sender,session:e.session}}},{key:"composeUUID",value:function(){return Z()}},{key:"composeSenderUUID",value:function(){return this.composeUUID()}},{key:"composeCookie",value:function(e,t,n){var i=null==n?"":"; max-age=".concat(n);return"".concat(e,"=").concat(t).concat(i)}}],(n=null)&&te(t.prototype,n),i&&te(t,i),e}();ie.endpoint="https://telemetry.wiris.net",ie._senderId="",ie._sessionId="";const re='\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n',ae='\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n';function oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function se(e,t){for(var n=0;n-1,a=O.isIOS();this.iosSoftkeyboardOpened=!1,this.iosMeasureUnit=-1===i.indexOf("crios")?"%":"vh",this.iosDivHeight="100%".concat(this.iosMeasureUnit);var o=window.outerWidth,s=window.outerHeight,l=o>s,c=os,u=c&&this.attributes.width>o,m=d||u;this.instanceId=document.getElementsByClassName("wrs_modal_dialogContainer").length,this.deviceProperties={orientation:l?"landscape":"portait",isAndroid:r,isIOS:a,isMobile:m,isDesktop:!m&&!a&&!r},this.properties={created:!1,state:"",previousState:"",position:{bottom:0,right:10},size:{height:338,width:580}},this.websiteBeforeLockParameters=null;var h={class:"wrs_modal_overlay"};h.id=this.getElementId(h.class),this.overlay=w.createElement("div",h),(h={}).class="wrs_modal_title_bar",h.id=this.getElementId(h.class),this.titleBar=w.createElement("div",h),(h={}).class="wrs_modal_title",h.id=this.getElementId(h.class),this.title=w.createElement("div",h),this.title.innerHTML="",(h={}).class="wrs_modal_close_button",h.id=this.getElementId(h.class),h.title=b.get("close"),h.style={},this.closeDiv=w.createElement("a",h),this.closeDiv.setAttribute("role","button");var g="background-size: 10px; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")"),p="background-size: 10px; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")");this.closeDiv.setAttribute("style",g),this.closeDiv.setAttribute("onmouseover",'this.style = "'.concat(p,'";')),this.closeDiv.setAttribute("onmouseout",'this.style = "'.concat(g,'";')),(h={}).class="wrs_modal_stack_button",h.id=this.getElementId(h.class),h.title=b.get("exit_fullscreen"),this.stackDiv=w.createElement("a",h),this.stackDiv.setAttribute("role","button"),g="background-size: 10px; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")"),p="background-size: 10px; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")"),this.stackDiv.setAttribute("style",g),this.stackDiv.setAttribute("onmouseover",'this.style = "'.concat(p,'";')),this.stackDiv.setAttribute("onmouseout",'this.style = "'.concat(g,'";')),(h={}).class="wrs_modal_maximize_button",h.id=this.getElementId(h.class),h.title=b.get("fullscreen"),this.maximizeDiv=w.createElement("a",h),this.maximizeDiv.setAttribute("role","button"),g="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")"),p="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")"),this.maximizeDiv.setAttribute("style",g),this.maximizeDiv.setAttribute("onmouseover",'this.style = "'.concat(p,'";')),this.maximizeDiv.setAttribute("onmouseout",'this.style = "'.concat(g,'";')),(h={}).class="wrs_modal_minimize_button",h.id=this.getElementId(h.class),h.title=b.get("minimize"),this.minimizeDiv=w.createElement("a",h),this.minimizeDiv.setAttribute("role","button"),g="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa(re),")"),p="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa(ae),")"),this.minimizeDiv.setAttribute("style",g),this.minimizeDiv.setAttribute("onmouseover",'this.style = "'.concat(p,'";')),this.minimizeDiv.setAttribute("onmouseout",'this.style = "'.concat(g,'";')),(h={}).class="wrs_modal_dialogContainer",h.id=this.getElementId(h.class),h.role="dialog",this.container=w.createElement("div",h),this.container.setAttribute("aria-labeledby","wrs_modal_title[0]"),(h={}).class="wrs_modal_wrapper",h.id=this.getElementId(h.class),this.wrapper=w.createElement("div",h),(h={}).class="wrs_content_container",h.id=this.getElementId(h.class),this.contentContainer=w.createElement("div",h),(h={}).class="wrs_modal_controls",h.id=this.getElementId(h.class),this.controls=w.createElement("div",h),(h={}).class="wrs_modal_buttons_container",h.id=this.getElementId(h.class),this.buttonContainer=w.createElement("div",h),this.submitButton=this.createSubmitButton({id:this.getElementId("wrs_modal_button_accept"),class:"wrs_modal_button_accept",innerHTML:b.get("accept")},this.submitAction.bind(this)),this.cancelButton=this.createSubmitButton({id:this.getElementId("wrs_modal_button_cancel"),class:"wrs_modal_button_cancel",innerHTML:b.get("cancel")},this.cancelAction.bind(this)),this.contentManager=null;var f={cancelString:b.get("cancel"),submitString:b.get("close"),message:b.get("close_modal_warning")},v={closeCallback:function(){n.close()},cancelCallback:function(){n.focus()}},_={overlayElement:this.container,callbacks:v,strings:f};this.popup=new H(_),this.rtl=!1,"rtl"in this.attributes&&(this.rtl=this.attributes.rtl),this.handleOpenedIosSoftkeyboard=this.handleOpenedIosSoftkeyboard.bind(this),this.handleClosedIosSoftkeyboard=this.handleClosedIosSoftkeyboard.bind(this)}return le(e,[{key:"setContentManager",value:function(e){this.contentManager=e}},{key:"getContentManager",value:function(){return this.contentManager}},{key:"submitAction",value:function(){void 0!==this.contentManager.submitAction&&this.contentManager.submitAction(),this.close()}},{key:"cancelAction",value:function(){void 0===this.contentManager.hasChanges?(R.setActionsOnCancelButtons(),this.close()):this.contentManager.hasChanges()?this.showPopUpMessage():(R.setActionsOnCancelButtons(),this.close())}},{key:"createSubmitButton",value:function(e,t){return new(function(){function n(){oe(this,n),this.element=document.createElement("button"),this.element.id=e.id,this.element.className=e.class,this.element.innerHTML=e.innerHTML,w.addEvent(this.element,"click",t)}return le(n,[{key:"getElement",value:function(){return this.element}}]),n}())(e,t).getElement()}},{key:"create",value:function(){this.titleBar.appendChild(this.closeDiv),this.titleBar.appendChild(this.stackDiv),this.titleBar.appendChild(this.maximizeDiv),this.titleBar.appendChild(this.minimizeDiv),this.titleBar.appendChild(this.title),this.deviceProperties.isDesktop&&this.container.appendChild(this.titleBar),this.wrapper.appendChild(this.contentContainer),this.wrapper.appendChild(this.controls),this.controls.appendChild(this.buttonContainer),this.buttonContainer.appendChild(this.submitButton),this.buttonContainer.appendChild(this.cancelButton),this.container.appendChild(this.wrapper),this.recalculateScrollBar(),document.body.appendChild(this.container),document.body.appendChild(this.overlay),this.deviceProperties.isDesktop?(this.createModalWindowDesktop(),this.createResizeButtons(),this.addListeners(),l.get("modalWindowFullScreen")&&this.maximize()):this.deviceProperties.isAndroid?this.createModalWindowAndroid():this.deviceProperties.isIOS&&this.createModalWindowIos(),null!=this.contentManager&&this.contentManager.insert(this),this.properties.open=!0,this.properties.created=!0,this.isRTL()&&(this.container.style.right="".concat(window.innerWidth-this.scrollbarWidth-this.container.offsetWidth,"px"),this.container.className+=" wrs_modal_rtl")}},{key:"createResizeButtons",value:function(){this.resizerBR=document.createElement("div"),this.resizerBR.className="wrs_bottom_right_resizer",this.resizerBR.innerHTML="◢",this.resizerTL=document.createElement("div"),this.resizerTL.className="wrs_bottom_left_resizer",this.container.appendChild(this.resizerBR),this.titleBar.appendChild(this.resizerTL),w.addEvent(this.resizerBR,"mousedown",this.activateResizeStateBR.bind(this)),w.addEvent(this.resizerTL,"mousedown",this.activateResizeStateTL.bind(this))}},{key:"activateResizeStateBR",value:function(e){this.initializeResizeProperties(e,!1)}},{key:"activateResizeStateTL",value:function(e){this.initializeResizeProperties(e,!0)}},{key:"initializeResizeProperties",value:function(e,t){w.addClass(document.body,"wrs_noselect"),w.addClass(this.overlay,"wrs_overlay_active"),this.resizeDataObject={x:this.eventClient(e).X,y:this.eventClient(e).Y},this.initialWidth=parseInt(this.container.style.width,10),this.initialHeight=parseInt(this.container.style.height,10),t?this.leftScale=!0:(this.initialRight=parseInt(this.container.style.right,10),this.initialBottom=parseInt(this.container.style.bottom,10)),this.initialRight||(this.initialRight=0),this.initialBottom||(this.initialBottom=0),document.body.style["user-select"]="none"}},{key:"open",value:function(){var e=this;try{ie.send([{timestamp:(new Date).toJSON(),topic:"0",level:"info",message:"HELO telemetry.wiris.net"}]).then((function(e){}))}catch(e){}this.removeClass("wrs_closed");var t=this.deviceProperties.isIOS,n=this.deviceProperties.isAndroid,i=this.deviceProperties.isMobile;if((t||n||i)&&(this.restoreWebsiteScale(),this.lockWebsiteScroll(),setTimeout((function(){e.hideKeyboard()}),400)),this.properties.created?(this.properties.open||(this.properties.open=!0,this.deviceProperties.isAndroid||this.deviceProperties.isIOS||this.restoreState()),this.deviceProperties.isDesktop&&l.get("modalWindowFullScreen")&&this.maximize(),this.deviceProperties.isIOS&&(this.iosSoftkeyboardOpened=!1,this.setContainerHeight("".concat(100+this.iosMeasureUnit)))):this.create(),O.isEditorLoaded())this.contentManager.onOpen(this);else{var r=m.newListener("onLoad",(function(){e.contentManager.onOpen(e)}));this.contentManager.addListener(r)}}},{key:"close",value:function(){this.removeClass("wrs_maximized"),this.removeClass("wrs_minimized"),this.removeClass("wrs_stack"),this.addClass("wrs_closed"),this.saveModalProperties(),this.unlockWebsiteScroll(),this.properties.open=!1}},{key:"restoreWebsiteScale",value:function(){var e=document.querySelector("meta[name=viewport]"),t=["initial-scale=","minimum-scale=","maximum-scale="],n=["1.0","1.0","1.0"],i=function(e,t){var i=e.getAttribute("content");if(i){for(var r=i.split(","),a="",o=[],s=0;s=0||navigator.userAgent.search("Trident/")>=0||navigator.userAgent.search("Edge/")>=0}},{key:"isRTL",value:function(){return"ar"===this.attributes.language||"he"===this.attributes.language||this.rtl}},{key:"addClass",value:function(e){w.addClass(this.overlay,e),w.addClass(this.titleBar,e),w.addClass(this.overlay,e),w.addClass(this.container,e),w.addClass(this.contentContainer,e),w.addClass(this.stackDiv,e),w.addClass(this.minimizeDiv,e),w.addClass(this.maximizeDiv,e),w.addClass(this.wrapper,e)}},{key:"removeClass",value:function(e){w.removeClass(this.overlay,e),w.removeClass(this.titleBar,e),w.removeClass(this.overlay,e),w.removeClass(this.container,e),w.removeClass(this.contentContainer,e),w.removeClass(this.stackDiv,e),w.removeClass(this.minimizeDiv,e),w.removeClass(this.maximizeDiv,e),w.removeClass(this.wrapper,e)}},{key:"createModalWindowDesktop",value:function(){this.addClass("wrs_modal_desktop"),this.stack()}},{key:"createModalWindowAndroid",value:function(){this.addClass("wrs_modal_android"),window.addEventListener("resize",this.orientationChangeAndroidSoftkeyboard.bind(this))}},{key:"createModalWindowIos",value:function(){this.addClass("wrs_modal_ios"),window.addEventListener("resize",this.orientationChangeIosSoftkeyboard.bind(this))}},{key:"restoreState",value:function(){"maximized"===this.properties.state?this.maximize():"minimized"===this.properties.state?(this.properties.state=this.properties.previousState,this.properties.previousState="",this.minimize()):this.stack()}},{key:"stack",value:function(){this.properties.previousState=this.properties.state,this.properties.state="stack",this.removeClass("wrs_maximized"),this.minimizeDiv.title=b.get("minimize"),this.removeClass("wrs_minimized"),this.addClass("wrs_stack");var e="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa(re),")"),t="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa(ae),")");this.minimizeDiv.setAttribute("style",e),this.minimizeDiv.setAttribute("onmouseover",'this.style = "'.concat(t,'";')),this.minimizeDiv.setAttribute("onmouseout",'this.style = "'.concat(e,'";')),this.restoreModalProperties(),void 0!==this.resizerBR&&void 0!==this.resizerTL&&this.setResizeButtonsVisibility(),this.recalculateScrollBar(),this.recalculatePosition(),this.recalculateScale(),this.focus()}},{key:"minimize",value:function(){if(this.saveModalProperties(),this.title.style.cursor="pointer","minimized"===this.properties.state&&"stack"===this.properties.previousState)this.stack();else if("minimized"===this.properties.state&&"maximized"===this.properties.previousState)this.maximize();else{this.container.style.height="30px",this.container.style.width="250px",this.container.style.bottom="0px",this.container.style.right="10px",this.removeListeners(),this.properties.previousState=this.properties.state,this.properties.state="minimized",this.setResizeButtonsVisibility(),this.minimizeDiv.title=b.get("maximize"),w.containsClass(this.overlay,"wrs_stack")?this.removeClass("wrs_stack"):this.removeClass("wrs_maximized"),this.addClass("wrs_minimized");var e="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")"),t="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa('\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n\n'),")");this.minimizeDiv.setAttribute("style",e),this.minimizeDiv.setAttribute("onmouseover",'this.style = "'.concat(t,'";')),this.minimizeDiv.setAttribute("onmouseout",'this.style = "'.concat(e,'";'))}}},{key:"maximize",value:function(){this.saveModalProperties(),"maximized"!==this.properties.state&&(this.properties.previousState=this.properties.state,this.properties.state="maximized"),this.setResizeButtonsVisibility(),w.containsClass(this.overlay,"wrs_minimized")?(this.minimizeDiv.title=b.get("minimize"),this.removeClass("wrs_minimized")):w.containsClass(this.overlay,"wrs_stack")&&(this.container.style.left=null,this.container.style.top=null,this.removeClass("wrs_stack")),this.addClass("wrs_maximized");var e="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa(re),")"),t="background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,".concat(window.btoa(ae),")");this.minimizeDiv.setAttribute("style",e),this.minimizeDiv.setAttribute("onmouseover",'this.style = "'.concat(t,'";')),this.minimizeDiv.setAttribute("onmouseout",'this.style = "'.concat(e,'";')),this.setSize(parseInt(.8*window.innerHeight,10),parseInt(.8*window.innerWidth,10)),this.container.clientHeight>700&&(this.container.style.height="700px"),this.container.clientWidth>1200&&(this.container.style.width="1200px");var n=window.innerHeight,i=window.innerWidth,r=n/2-this.container.offsetHeight/2,a=i/2-this.container.offsetWidth/2;this.setPosition(r,a),this.recalculateScale(),this.recalculatePosition(),this.recalculateSize(),this.focus()}},{key:"reExpand",value:function(){"minimized"===this.properties.state&&("maximized"===this.properties.previousState?this.maximize():this.stack(),this.title.style.cursor="")}},{key:"setSize",value:function(e,t){this.container.style.height="".concat(e,"px"),this.container.style.width="".concat(t,"px"),this.recalculateSize()}},{key:"setPosition",value:function(e,t){this.container.style.bottom="".concat(e,"px"),this.container.style.right="".concat(t,"px")}},{key:"saveModalProperties",value:function(){"stack"===this.properties.state&&(this.properties.position.bottom=parseInt(this.container.style.bottom,10),this.properties.position.right=parseInt(this.container.style.right,10),this.properties.size.width=parseInt(this.container.style.width,10),this.properties.size.height=parseInt(this.container.style.height,10))}},{key:"restoreModalProperties",value:function(){"stack"===this.properties.state&&(this.setPosition(this.properties.position.bottom,this.properties.position.right),this.setSize(this.properties.size.height,this.properties.size.width))}},{key:"recalculateSize",value:function(){this.wrapper.style.width="".concat(this.container.clientWidth-12,"px"),this.wrapper.style.height="".concat(this.container.clientHeight-38,"px"),this.contentContainer.style.height="".concat(parseInt(this.wrapper.offsetHeight-50,10),"px")}},{key:"setResizeButtonsVisibility",value:function(){"stack"===this.properties.state?(this.resizerTL.style.visibility="visible",this.resizerBR.style.visibility="visible"):(this.resizerTL.style.visibility="hidden",this.resizerBR.style.visibility="hidden")}},{key:"addListeners",value:function(){this.maximizeDiv.addEventListener("click",this.maximize.bind(this),!0),this.stackDiv.addEventListener("click",this.stack.bind(this),!0),this.minimizeDiv.addEventListener("click",this.minimize.bind(this),!0),this.closeDiv.addEventListener("click",this.cancelAction.bind(this)),this.title.addEventListener("click",this.reExpand.bind(this)),this.overlay.addEventListener("click",this.cancelAction.bind(this)),w.addEvent(window,"mousedown",this.startDrag.bind(this)),w.addEvent(window,"mouseup",this.stopDrag.bind(this)),w.addEvent(window,"mousemove",this.drag.bind(this)),w.addEvent(window,"resize",this.onWindowResize.bind(this)),w.addEvent(this.container,"keydown",this.onKeyDown.bind(this))}},{key:"removeListeners",value:function(){w.removeEvent(window,"mousedown",this.startDrag),w.removeEvent(window,"mouseup",this.stopDrag),w.removeEvent(window,"mousemove",this.drag),w.removeEvent(window,"resize",this.onWindowResize),w.removeEvent(this.container,"keydown",this.onKeyDown)}},{key:"eventClient",value:function(e){return void 0===e.clientX&&e.changedTouches?{X:e.changedTouches[0].clientX,Y:e.changedTouches[0].clientY}:{X:e.clientX,Y:e.clientY}}},{key:"startDrag",value:function(e){"minimized"!==this.properties.state&&e.target===this.title&&(void 0!==this.dragDataObject&&null!==this.dragDataObject||(this.dragDataObject={x:this.eventClient(e).X,y:this.eventClient(e).Y},this.lastDrag={x:"0px",y:"0px"},""===this.container.style.right&&(this.container.style.right="0px"),""===this.container.style.bottom&&(this.container.style.bottom="0px"),this.isIE11(),w.addClass(document.body,"wrs_noselect"),w.addClass(this.overlay,"wrs_overlay_active"),this.limitWindow=this.getLimitWindow()))}},{key:"drag",value:function(e){if(this.dragDataObject){e.preventDefault();var t=Math.min(this.eventClient(e).Y,this.limitWindow.minPointer.y);t=Math.max(this.limitWindow.maxPointer.y,t);var n=Math.min(this.eventClient(e).X,this.limitWindow.minPointer.x);n=Math.max(this.limitWindow.maxPointer.x,n);var i="".concat(n-this.dragDataObject.x,"px"),r="".concat(t-this.dragDataObject.y,"px");this.lastDrag={x:i,y:r},this.container.style.transform="translate3d(".concat(i,",").concat(r,",0)")}if(this.resizeDataObject){var a,o=window.innerWidth,s=window.innerHeight,l=Math.min(this.eventClient(e).X,o-this.scrollbarWidth-7),c=Math.min(this.eventClient(e).Y,s-7);l<0&&(l=0),c<0&&(c=0),a=this.leftScale?-1:1,this.container.style.width="".concat(this.initialWidth+a*(l-this.resizeDataObject.x),"px"),this.container.style.height="".concat(this.initialHeight+a*(c-this.resizeDataObject.y),"px"),this.leftScale||(this.resizeDataObject.x-l-this.initialWidth<-580?this.container.style.right="".concat(this.initialRight-(l-this.resizeDataObject.x),"px"):(this.container.style.right="".concat(this.initialRight+this.initialWidth-580,"px"),this.container.style.width="580px"),this.resizeDataObject.y-c580?(this.container.style.width="".concat(Math.min(parseInt(this.container.style.width,10),window.innerWidth-this.scrollbarWidth),"px"),e=!0):(this.container.style.width="580px",e=!0),parseInt(this.container.style.height,10)>338?(this.container.style.height="".concat(Math.min(parseInt(this.container.style.height,10),window.innerHeight),"px"),e=!0):(this.container.style.height="338px",e=!0),e&&this.recalculateSize()}},{key:"recalculateScrollBar",value:function(){this.hasScrollBar=window.innerWidth>document.documentElement.clientWidth,this.hasScrollBar?this.scrollbarWidth=this.getScrollBarWidth():this.scrollbarWidth=0}},{key:"hideKeyboard",value:function(){var e=document.createElement("input");this.container.appendChild(e),e.focus(),e.blur(),e.remove()}},{key:"focus",value:function(){null!=this.contentManager&&void 0!==this.contentManager.onFocus&&this.contentManager.onFocus()}},{key:"portraitMode",value:function(){return window.innerHeight>window.innerWidth}},{key:"handleOpenedIosSoftkeyboard",value:function(){this.iosSoftkeyboardOpened||null==this.iosDivHeight||this.iosDivHeight!=="100".concat(this.iosMeasureUnit)||(this.portraitMode()?this.setContainerHeight("63".concat(this.iosMeasureUnit)):this.setContainerHeight("40".concat(this.iosMeasureUnit))),this.iosSoftkeyboardOpened=!0}},{key:"handleClosedIosSoftkeyboard",value:function(){this.iosSoftkeyboardOpened=!1,this.setContainerHeight("100".concat(this.iosMeasureUnit))}},{key:"orientationChangeIosSoftkeyboard",value:function(){this.iosSoftkeyboardOpened?this.portraitMode()?this.setContainerHeight("63".concat(this.iosMeasureUnit)):this.setContainerHeight("40".concat(this.iosMeasureUnit)):this.setContainerHeight("100".concat(this.iosMeasureUnit))}},{key:"orientationChangeAndroidSoftkeyboard",value:function(){this.setContainerHeight("100%")}},{key:"setContainerHeight",value:function(e){this.iosDivHeight=e,this.wrapper.style.height=e}},{key:"showPopUpMessage",value:function(){"minimized"===this.properties.state&&this.stack(),this.popup.show()}},{key:"setTitle",value:function(e){this.title.innerHTML=e}},{key:"getElementId",value:function(e){return"".concat(e,"[").concat(this.instanceId,"]")}}]),e}();var de;String.prototype.codePointAt||(de=function(e){if(null==this)throw TypeError();var t=String(this),n=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||i>=n)){var r,a=t.charCodeAt(i);return a>=55296&&a<=56319&&n>i+1&&(r=t.charCodeAt(i+1))>=56320&&r<=57343?1024*(a-55296)+r-56320+65536:a}},Object.defineProperty?Object.defineProperty(String.prototype,"codePointAt",{value:de,configurable:!0,writable:!0}):String.prototype.codePointAt=de),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),i=1;i>>0;if(0===i)return!1;var r,a,o=0|t,s=Math.max(o>=0?o:i-Math.abs(o),0);for(;s0?0|t:0;return this.substring(n,n+e.length)===e}});var ue=n(379),me=n.n(ue),he=n(795),ge=n.n(he),pe=n(569),fe=n.n(pe),ve=n(565),_e=n.n(ve),be=n(216),ye=n.n(be),we=n(589),xe=n.n(we),ke=n(139),Ae={};Ae.styleTagTransform=xe(),Ae.setAttributes=_e(),Ae.insert=fe().bind(null,"head"),Ae.domAPI=ge(),Ae.insertStyleElement=ye();me()(ke.Z,Ae);ke.Z&&ke.Z.locals&&ke.Z.locals;function Ce(e,t){for(var n=0;n=0?i="EDGE":n.search("Chrome/")>=0?i="CHROME":n.search("Trident/")>=0?i="IE":n.search("Firefox/")>=0?i="FIREFOX":n.search("Safari/")>=0&&(i="SAFARI"),i),this.listeners=new m,this.serviceProviderProperties={},!("serviceProviderProperties"in t))throw new Error("serviceProviderProperties property missing.");this.serviceProviderProperties=t.serviceProviderProperties}var t,n,i;return t=e,i=[{key:"globalListeners",get:function(){return e._globalListeners},set:function(t){e._globalListeners=t}},{key:"initialized",get:function(){return e._initialized},set:function(t){e._initialized=t}},{key:"addGlobalListener",value:function(t){e.globalListeners.add(t)}}],(n=[{key:"setIntegrationModel",value:function(e){this.integrationModel=e}},{key:"setEnvironment",value:function(e){"editor"in e&&(this.environment.editor=e.editor),"mode"in e&&(this.environment.mode=e.mode),"version"in e&&(this.environment.version=e.version)}},{key:"getModalDialog",value:function(){return this.modalDialog}},{key:"init",value:function(){var t=this;if(e.initialized)this.listeners.fire("onLoad",{});else{var n=m.newListener("onInit",(function(){var e=g.getService("configurationjs","","get"),n=JSON.parse(e);l.addConfiguration(n),l.addConfiguration(B),b.language=t.language,t.listeners.fire("onLoad",{})}));g.addListener(n),g.init(this.serviceProviderProperties),e.initialized=!0}}},{key:"addListener",value:function(e){this.listeners.add(e)}},{key:"beforeUpdateFormula",value:function(t,n){var i=new D;return i.mathml=t,i.wirisProperties={},null!=n&&Object.keys(n).forEach((function(e){i.wirisProperties[e]=n[e]})),i.language=this.language,i.editMode=this.editMode,this.listeners.fire("onBeforeFormulaInsertion",i)||e.globalListeners.fire("onBeforeFormulaInsertion",i)?{}:{mathml:i.mathml,wirisProperties:i.wirisProperties}}},{key:"insertFormula",value:function(e,t,n,i){var r={};if(n)if("latex"===this.editMode){if(r.latex=f.getLatexFromMathML(n),this.integrationModel.fillNonLatexNode&&!r.latex){var a=new D;a.editMode=this.editMode,a.windowTarget=t,a.focusElement=e,a.latex=r.latex,this.integrationModel.fillNonLatexNode(a,t,n)}else r.node=t.document.createTextNode("$$".concat(r.latex,"$$"));this.insertElementOnSelection(r.node,e,t)}else r.node=T.mathmlToImgObject(t.document,n,i,this.language),this.insertElementOnSelection(r.node,e,t);else this.insertElementOnSelection(null,e,t);return r}},{key:"afterUpdateFormula",value:function(t,n,i,r){var a=new D;return a.editMode=this.editMode,a.windowTarget=n,a.focusElement=t,a.node=i,a.latex=r,this.listeners.fire("onAfterFormulaInsertion",a)||e.globalListeners.fire("onAfterFormulaInsertion",a),{}}},{key:"placeCaretAfterNode",value:function(e){this.integrationModel.getSelection();var t=e.ownerDocument;if(void 0!==t.getSelection&&e.parentElement){var n=t.createRange();n.setStartAfter(e),n.collapse(!0);var i=t.getSelection();i.removeAllRanges(),i.addRange(n),t.body.focus()}}},{key:"insertElementOnSelection",value:function(e,t,n){if(this.editionProperties.isNewElement)if(e)if("textarea"===t.type)w.updateTextArea(t,e.textContent);else if(document.selection&&0===document.getSelection){var i=n.document.selection.createRange();if(n.document.execCommand("InsertImage",!1,e.src),"parentElement"in i||(n.document.execCommand("delete",!1),i=n.document.selection.createRange(),n.document.execCommand("InsertImage",!1,e.src)),"parentElement"in i){var r=i.parentElement();"IMG"===r.nodeName.toUpperCase()?r.parentNode.replaceChild(e,r):i.pasteHTML(w.createObjectCode(e))}}else{var a=this.integrationModel.getSelection(),o=null;this.editionProperties.range?(o=this.editionProperties.range,this.editionProperties.range=null):o=a.getRangeAt(0),o.deleteContents();var s=o.startContainer,l=o.startOffset;3===s.nodeType?(s=s.splitText(l)).parentNode.insertBefore(e,s):1===s.nodeType&&s.insertBefore(e,s.childNodes[l]),this.placeCaretAfterNode(e)}else if("textarea"===t.type)t.focus();else{var c=this.integrationModel.getSelection();if(c.removeAllRanges(),this.editionProperties.range){var d=this.editionProperties.range;this.editionProperties.range=null,c.addRange(d)}}else if(this.editionProperties.latexRange)document.selection&&0===document.getSelection?(this.editionProperties.isNewElement=!0,this.editionProperties.latexRange.select(),this.insertElementOnSelection(e,t,n)):(this.editionProperties.latexRange.deleteContents(),this.editionProperties.latexRange.insertNode(e),this.placeCaretAfterNode(e));else if("textarea"===t.type){var u;u=void 0!==this.integrationModel.getSelectedItem?this.integrationModel.getSelectedItem(t,!1):w.getSelectedItemOnTextarea(t),w.updateExistingTextOnTextarea(t,e.textContent,u.startPosition,u.endPosition)}else e&&"img"===e.nodeName.toLowerCase()?(k.removeImgDataAttributes(this.editionProperties.temporalImage),k.clone(e,this.editionProperties.temporalImage)):this.editionProperties.temporalImage.remove(),this.placeCaretAfterNode(this.editionProperties.temporalImage)}},{key:"openModalDialog",value:function(e,t){var n,i=this;this.editMode="images";try{if(t){e.contentWindow.focus();var r=e.contentWindow.getSelection();this.editionProperties.range=r.getRangeAt(0)}else{e.focus();var a=getSelection();this.editionProperties.range=a.getRangeAt(0)}}catch(e){this.editionProperties.range=null}if(void 0===t&&(t=!0),this.editionProperties.latexRange=null,e)if(n=void 0!==this.integrationModel.getSelectedItem?this.integrationModel.getSelectedItem(e,t):w.getSelectedItem(e,t)){if(!n.caretPosition&&w.containsClass(n.node,l.get("imageClassName")))this.editionProperties.temporalImage=n.node,this.editionProperties.isNewElement=!1;else if(3===n.node.nodeType)if(this.integrationModel.getMathmlFromTextNode){var s=this.integrationModel.getMathmlFromTextNode(n.node,n.caretPosition);s&&(this.editMode="latex",this.editionProperties.isNewElement=!1,this.editionProperties.temporalImage=document.createElement("img"),this.editionProperties.temporalImage.setAttribute(l.get("imageMathmlAttribute"),o.safeXmlEncode(s)))}else{var c=f.getLatexFromTextNode(n.node,n.caretPosition);if(c){var d=f.getMathMLFromLatex(c.latex);this.editMode="latex",this.editionProperties.isNewElement=!1,this.editionProperties.temporalImage=document.createElement("img"),this.editionProperties.temporalImage.setAttribute(l.get("imageMathmlAttribute"),o.safeXmlEncode(d));var u=t?e.contentWindow:window;if("textarea"!==e.tagName.toLowerCase())if(document.selection){for(var h=0,g=c.startNode.previousSibling;g;)h+=w.getNodeLength(g),g=g.previousSibling;this.editionProperties.latexRange=u.document.selection.createRange(),this.editionProperties.latexRange.moveToElementText(c.startNode.parentNode),this.editionProperties.latexRange.move("character",h+c.startPosition),this.editionProperties.latexRange.moveEnd("character",c.latex.length+4)}else this.editionProperties.latexRange=u.document.createRange(),this.editionProperties.latexRange.setStart(c.startNode,c.startPosition),this.editionProperties.latexRange.setEnd(c.endNode,c.endPosition)}}}else"textarea"===e.tagName.toLowerCase()&&(this.editMode="latex");for(var p=l.get("editorAttributes").split(", "),v={},_=0,b=p.length;_x2',console.log(g.getService("showimage",e)),console.log("Testing createimage service..."),(e=[]).mml='x2',console.log(g.getService("createimage",e,"post")),console.log("Testing MathML2Latex service..."),(e=[]).service="mathml2latex",e.mml='x2',console.log(g.getService("service",e)),console.log("Testing Latex2MathML service..."),(e=[]).service="latex2mathml",e.latex="x^2",console.log(g.getService("service",e)),console.log("Testing Mathml2Accesible service..."),(e=[]).service="mathml2accessible",e.mml='x2',console.log(g.getService("service",e))}}],(n=null)&&Ee(t.prototype,n),i&&Ee(t,i),e}();const je="7.28.1";function Pe(e){return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Se(e,t){for(var n=0;n'),o.addIcon(u,' '),l.get("editorEnabled")&&o.addMenuItem("tiny_mce_wiris_formulaEditor",{text:"MathType",icon:d,onAction:c});var m=WirisPlugin.instances[e.id].getCore().getCustomEditors();Object.keys(m.editors).forEach((function(t){l.get(m.editors[t].confVariable)&&o.addMenuItem("tiny_mce_wiris_formulaEditor".concat(m.editors[t].name),{text:m.editors[t].title,icon:u,onAction:function(){m.enable(t),WirisPlugin.instances[e.id].openNewFormulaEditor()}})}))}else(o=e).addCommand("tiny_mce_wiris_openFormulaEditor",c);l.get("editorEnabled")&&o.addButton("tiny_mce_wiris_formulaEditor",{tooltip:"Insert a math equation - MathType",title:"Insert a math equation - MathType",cmd:"tiny_mce_wiris_openFormulaEditor",image:"".concat(WirisPlugin.instances[e.id].getIconsPath(),"formula.png"),onAction:c,icon:d});var h=WirisPlugin.instances[e.id].getCore().getCustomEditors(),g=function(t){if(l.get(h.editors[t].confVariable)){var n=function(){h.enable(t),WirisPlugin.instances[e.id].openNewFormulaEditor()},i="tiny_mce_wiris_openFormulaEditor".concat(h.editors[t].name);e.addCommand(i,n),o.addButton("tiny_mce_wiris_formulaEditor".concat(h.editors[t].name),{title:h.editors[t].tooltip,tooltip:h.editors[t].tooltip,onAction:n,cmd:i,image:WirisPlugin.instances[e.id].getIconsPath()+h.editors[t].icon,icon:u})}};for(var p in h.editors)g(p)},getInfo:function(){return{longname:"tiny_mce_wiris",author:"Maths for More",authorurl:"http://www.wiris.com/?utm_source=npmjs&utm_medium=referral",infourl:"http://www.wiris.com/?utm_source=npmjs&utm_medium=referral",version:je}}}),tinymce.PluginManager.add("tiny_mce_wiris",tinymce.plugins.tiny_mce_wiris),window.WirisPlugin={Core:Me,Parser:T,Image:k,Util:w,Configuration:l,Listeners:m,IntegrationModel:R,currentInstance:null,instances:{},TinyMceIntegration:Ne,Latex:f,Test:Te}},139:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,".wrs_modal_overlay {\n position: fixed;\n font-family: arial, sans-serif;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.8);\n z-index: 999998;\n opacity: 0.65;\n pointer-events: auto;\n}\n\n.wrs_modal_overlay.wrs_modal_ios {\n visibility: hidden;\n display: none;\n}\n\n.wrs_modal_overlay.wrs_modal_android {\n visibility: hidden;\n display: none;\n}\n\n.wrs_modal_overlay.wrs_modal_ios.moodle {\n position: fixed;\n}\n\n.wrs_modal_overlay.wrs_modal_desktop.wrs_stack {\n background: rgba(0, 0, 0, 0);\n display: none;\n}\n\n.wrs_modal_overlay.wrs_modal_desktop.wrs_maximized {\n background: rgba(0, 0, 0, 0.8);\n}\n\n.wrs_modal_overlay.wrs_modal_desktop.wrs_minimized {\n background: rgba(0, 0, 0, 0);\n display: none;\n}\n\n.wrs_modal_overlay.wrs_modal_desktop.wrs_closed {\n background: rgba(0, 0, 0, 0);\n display: none;\n}\n\n.wrs_modal_title {\n color: #fff;\n padding: 5px 0 5px 10px;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n}\n\n.wrs_modal_close_button {\n float: right;\n cursor: pointer;\n color: #fff;\n padding: 5px 10px 5px 0;\n margin: 10px 7px 0 0;\n background-repeat: no-repeat;\n}\n\n.wrs_modal_minimize_button {\n float: right;\n cursor: pointer;\n color: #fff;\n padding: 5px 10px 5px 0;\n top: inherit;\n margin: 10px 7px 0 0;\n}\n\n.wrs_modal_stack_button {\n float: right;\n cursor: pointer;\n color: #fff;\n margin: 10px 7px 0 0;\n padding: 5px 10px 5px 0;\n top: inherit;\n}\n\n.wrs_modal_stack_button.wrs_stack {\n visibility: hidden;\n margin: 0;\n padding: 0;\n}\n\n.wrs_modal_stack_button.wrs_minimized {\n visibility: hidden;\n margin: 0;\n padding: 0;\n}\n\n.wrs_modal_maximize_button {\n float: right;\n cursor: pointer;\n color: #fff;\n margin: 10px 7px 0 0;\n padding: 5px 10px 5px 0;\n top: inherit;\n}\n\n.wrs_modal_maximize_button.wrs_maximized {\n visibility: hidden;\n margin: 0;\n padding: 0;\n}\n\n.wrs_modal_title_bar {\n display: block;\n background-color: #778e9a;\n}\n\n.wrs_modal_dialogContainer {\n border: none;\n background: #fafafa;\n z-index: 999999;\n}\n\n.wrs_modal_dialogContainer.wrs_modal_desktop {\n font-size: 14px;\n}\n\n.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_maximized {\n position: fixed;\n}\n\n.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_minimized {\n position: fixed;\n top: inherit;\n margin: 0;\n margin-right: 10px;\n}\n\n.wrs_modal_dialogContainer.wrs_closed {\n visibility: hidden;\n display: none;\n opacity: 0;\n}\n\n/* Class that exists but hasn't got css properties defined\n.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_minimized.wrs_drag {} */\n\n.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_stack {\n position: fixed;\n bottom: 0;\n right: 0;\n box-shadow: rgba(0, 0, 0, 0.5) 0 2px 8px;\n}\n\n.wrs_modal_dialogContainer.wrs_drag {\n box-shadow: rgba(0, 0, 0, 0.5) 0 2px 8px;\n}\n\n.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_drag {\n box-shadow: rgba(0, 0, 0, 0.5) 0 2px 8px;\n}\n\n.wrs_modal_dialogContainer.wrs_modal_android {\n margin: auto;\n position: fixed;\n width: 99%;\n height: 99%;\n overflow: hidden;\n transform: translate(50%, -50%);\n top: 50%;\n right: 50% !important;\n}\n\n.wrs_modal_dialogContainer.wrs_modal_ios {\n margin: auto;\n position: fixed;\n width: 100%;\n height: 100%;\n overflow: hidden;\n transform: translate(50%, -50%);\n top: 50%;\n right: 50% !important;\n}\n\n/* Class that exists but hasn't got css properties defined\n.wrs_content_container.wrs_maximized {} */\n\n.wrs_content_container.wrs_minimized {\n display: none;\n}\n\n/* .wrs_editor {\n flex-grow: 1;\n} */\n\n.wrs_content_container.wrs_modal_android {\n width: 100%;\n height: 0%;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n}\n\n.wrs_content_container.wrs_modal_android > div:first-child {\n flex-grow: 1;\n}\n\n.wrs_content_container.wrs_modal_ios > div:first-child {\n flex-grow: 1;\n}\n\n.wrs_content_container.wrs_modal_desktop > div:first-child {\n flex-grow: 1;\n}\n\n.wrs_modal_wrapper.wrs_modal_android {\n margin: auto;\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n}\n\n.wrs_content_container.wrs_modal_desktop {\n width: 100%;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n}\n\n.wrs_content_container.wrs_modal_ios {\n width: 100%;\n height: 0%;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n}\n\n.wrs_modal_wrapper.wrs_modal_ios {\n margin: auto;\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n}\n\n.wrs_virtual_keyboard {\n height: 100%;\n width: 100%;\n top: 0;\n left: 50%;\n transform: translate(-50%, 0%);\n}\n\n@media all and (orientation: portrait) {\n .wrs_modal_dialogContainer.wrs_modal_mobile {\n width: 100vmin;\n height: 100vmin;\n margin: auto;\n border-width: 0;\n }\n\n .wrs_modal_wrapper.wrs_modal_mobile {\n width: 100vmin;\n height: 100vmin;\n margin: auto;\n }\n}\n\n@media all and (orientation: landscape) {\n .wrs_modal_dialogContainer.wrs_modal_mobile {\n width: 100vmin;\n height: 100vmin;\n margin: auto;\n border-width: 0;\n }\n\n .wrs_modal_wrapper.wrs_modal_mobile {\n width: 100vmin;\n height: 100vmin;\n margin: auto;\n }\n}\n\n.wrs_modal_dialogContainer.wrs_modal_badStock {\n width: 100%;\n height: 280px;\n margin: 0 auto;\n border-width: 0;\n}\n\n.wrs_modal_wrapper.wrs_modal_badStock {\n width: 100%;\n height: 280px;\n margin: 0 auto;\n border-width: 0;\n}\n\n.wrs_noselect {\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.wrs_bottom_right_resizer {\n width: 10px;\n height: 10px;\n color: #778e9a;\n position: absolute;\n right: 4px;\n bottom: 8px;\n cursor: se-resize;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.wrs_bottom_left_resizer {\n width: 15px;\n height: 15px;\n color: #778e9a;\n position: absolute;\n left: 0;\n top: 0;\n cursor: se-resize;\n}\n\n.wrs_modal_controls {\n height: 42px;\n margin: 3px 0;\n overflow: hidden;\n line-height: normal;\n}\n\n.wrs_modal_links {\n margin: 10px auto;\n margin-bottom: 0;\n font-family: arial, sans-serif;\n padding: 6px;\n display: inline;\n float: right;\n text-align: right;\n}\n\n.wrs_modal_links > a {\n text-decoration: none;\n color: #778e9a;\n font-size: 16px;\n}\n\n.wrs_modal_button_cancel,\n.wrs_modal_button_cancel:hover,\n.wrs_modal_button_cancel:visited,\n.wrs_modal_button_cancel:active,\n.wrs_modal_button_cancel:focus {\n min-width: 80px;\n font-size: 14px;\n border-radius: 3px;\n border: 1px solid #778e9a;\n padding: 6px 8px;\n margin: 10px auto;\n margin-left: 5px;\n margin-bottom: 0;\n cursor: pointer;\n font-family: arial, sans-serif;\n background-color: #ddd;\n height: 32px;\n}\n\n.wrs_modal_button_accept,\n.wrs_modal_button_accept:hover,\n.wrs_modal_button_accept:visited,\n.wrs_modal_button_accept:active,\n.wrs_modal_button_accept:focus {\n min-width: 80px;\n font-size: 14px;\n border-radius: 3px;\n border: 1px solid #778e9a;\n padding: 6px 8px;\n margin: 10px auto;\n margin-right: 5px;\n margin-bottom: 0;\n color: #fff;\n background: #778e9a;\n cursor: pointer;\n font-family: arial, sans-serif;\n height: 32px;\n}\n\n.wrs_editor_vertical_bar {\n height: 20px;\n float: right;\n background: none;\n width: 20px;\n cursor: pointer;\n}\n\n.wrs_modal_buttons_container {\n display: inline;\n float: left;\n}\n\n.wrs_modal_buttons_container.wrs_modalAndroid {\n padding-left: 6px;\n}\n\n.wrs_modal_buttons_container.wrs_modalDesktop {\n padding-left: 0;\n}\n\n.wrs_modal_buttons_container > button {\n line-height: normal;\n background-image: none;\n}\n\n.wrs_modal_wrapper {\n margin: 6px;\n display: flex;\n flex-direction: column;\n}\n\n.wrs_modal_wrapper.wrs_modal_desktop.wrs_minimized {\n display: none;\n}\n\n@media only screen and (max-device-width: 480px) and (orientation: portrait) {\n #wrs_modal_wrapper {\n width: 140%;\n }\n}\n\n.wrs_popupmessage_overlay_envolture {\n display: none;\n width: 100%;\n}\n\n.wrs_popupmessage_overlay {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 4;\n cursor: pointer;\n}\n\n.wrs_popupmessage_panel {\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n position: absolute;\n background: white;\n max-width: 500px;\n width: 75%;\n border-radius: 2px;\n padding: 20px;\n font-family: sans-serif;\n font-size: 15px;\n text-align: left;\n color: #2e2e2e;\n z-index: 5;\n max-height: 75%;\n overflow: auto;\n}\n\n.wrs_popupmessage_button_area {\n margin: 10px 0 0 0;\n}\n\n.wrs_panelContainer * {\n border: 0;\n}\n\n.wrs_button_cancel,\n.wrs_button_cancel:hover,\n.wrs_button_cancel:visited,\n.wrs_button_cancel:active,\n.wrs_button_cancel:focus {\n min-width: 80px;\n font-size: 14px;\n border-radius: 3px;\n border: 1px solid #778e9a;\n padding: 6px 8px;\n margin: 10px auto;\n margin-left: 5px;\n margin-bottom: 0;\n cursor: pointer;\n font-family: arial, sans-serif;\n background-color: #ddd;\n background-image: none;\n height: 32px;\n}\n\n.wrs_button_accept,\n.wrs_button_accept:hover,\n.wrs_button_accept:visited,\n.wrs_button_accept:active,\n.wrs_button_accept:focus {\n min-width: 80px;\n font-size: 14px;\n border-radius: 3px;\n border: 1px solid #778e9a;\n padding: 6px 8px;\n margin: 10px auto;\n margin-right: 5px;\n margin-bottom: 0;\n color: #fff;\n background: #778e9a;\n cursor: pointer;\n font-family: arial, sans-serif;\n height: 32px;\n}\n\n.wrs_editor button {\n box-shadow: none;\n}\n\n.wrs_editor .wrs_header button {\n border-bottom: none;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.wrs_modal_overlay.wrs_modal_desktop.wrs_stack.wrs_overlay_active {\n display: block;\n}\n\n/* Fix selection in drupal style */\n.wrs_toolbar tr:focus {\n background: none;\n}\n\n.wrs_toolbar tr:hover {\n background: none;\n}\n\n/* End of fix drupal */\n.wrs_modal_rtl .wrs_modal_button_cancel {\n margin-right: 5px;\n margin-left: 0;\n}\n\n.wrs_modal_rtl .wrs_modal_button_accept {\n margin-right: 0;\n margin-left: 5px;\n}\n\n.wrs_modal_rtl .wrs_button_cancel {\n margin-right: 5px;\n margin-left: 0;\n}\n\n.wrs_modal_rtl .wrs_button_accept {\n margin-right: 0;\n margin-left: 5px;\n}\n",""]);const a=r},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,i){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(i)for(var a=0;a{var t=[];function n(e){for(var n=-1,i=0;i{var t={};e.exports=function(e,n){var i=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:e=>{e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,r&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__=__webpack_require__(982)})(); \ No newline at end of file diff --git a/version.php b/version.php index 83e9abf..d14fc55 100644 --- a/version.php +++ b/version.php @@ -26,9 +26,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2022040800; -$plugin->release = '7.28.0'; +$plugin->version = 2022062000; +$plugin->release = '7.29.0'; $plugin->requires = 2012120300; $plugin->component = 'tinymce_tiny_mce_wiris'; -$plugin->dependencies = array('filter_wiris' => 2022040800); +$plugin->dependencies = array ('filter_wiris' => 2022062000); $plugin->maturity = MATURITY_STABLE;