!function(m){"use strict";varr=function(t){vare=t,n=function(){returne};return{get:n,set:function(t){e=t},clone:function(){returnr(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),G=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=function(){},i=function(t){returnfunction(){returnt}};functiona(r){for(varo=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];returnfunction(){for(vart=[],e=0;e<arguments.length;e++)t[e]=arguments[e];varn=o.concat(t);returnr.apply(null,n)}}varn,o,c,u,l=i(!1),f=i(!0),s=function(){returnd},d=(n=function(t){returnt.isNone()},u={fold:function(t,e){returnt()},is:l,isSome:l,isNone:f,getOr:c=function(t){returnt},getOrThunk:o=function(t){returnt()},getOrDie:function(t){thrownewError(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:c,orThunk:o,map:s,each:e,bind:s,exists:l,forall:f,filter:s,equals:n,equals_:n,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(u),u),h=function(n){vart=i(n),e=function(){returno},r=function(t){returnt(n)},o={fold:function(t,e){returne(n)},is:function(t){returnn===t},isSome:f,isNone:l,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){returnh(t(n))},each:function(t){t(n)},bind:r,exists:r,forall:r,filter:function(t){returnt(n)?o:d},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){returnt.is(n)},equals_:function(t,e){returnt.fold(l,function(t){returne(n,t)})}};returno},g={some:h,none:s,from:function(t){returnnull===t||t===undefined?d:h(t)}};functionp(t,e){returnw(m.document.createElement("canvas"),t,e)}functionv(t){vare=p(t.width,t.height);returny(e).drawImage(t,0,0),e}functiony(t){returnt.getContext("2d")}functionw(t,e,n){returnt.width=e,t.height=n,t}functionb(t){returnt.naturalWidth||t.width}functionx(t){returnt.naturalHeight||t.height}vark=window.Promise?window.Promise:function(){vari=function(t){if("object"!=typeofthis)thrownewTypeError("Promises must be constructed via new");if("function"!=typeoft)thrownewTypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(t,r(o,this),r(c,this))},t=i.immediateFn||"function"==typeofwindow.setImmediate&&window.setImmediate||function(t){m.setTimeout(t,1)};functionr(t,e){returnfunction(){returnt.apply(e,arguments)}}varn=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};functiona(r){varo=this;null!==this._state?t(function(){vart=o._state?r.onFulfilled:r.onRejected;if(null!==t){vare;try{e=t(o._value)}catch(n){returnvoidr.reject(n)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}functiono(t){try{if(t===this)thrownewTypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeoft||"function"==typeoft)){vare=t.then;if("function"==typeofe)returnvoidf(r(e,t),r(o,this),r(c,this))}this._state=!0,this._value=t,u.call(this)}catch(n){c.call(this,n)}}functionc(t){this._state=!1,this._value=t,u.call(this)}functionu(){for(vart=0,e=this._deferreds;t<e.length;t++){varn=e[t];a.call(this,n)}this._deferreds=[]}functionl(t,e,n,r){this.onFulfilled="function"==typeoft?t:null,this.onRejected="function"==typeofe?e:null,this.resolve=n,this.reject=r}functionf(t,e,n){varr=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(o){if(r)return;r=!0,n(o)}}returni.prototype["catch"]=function(t){returnthis.then(null,t)},i.prototype.then=function(n,r){varo=this;returnnewi(function(t,e){a.call(o,newl(n,r,t,e))})},i.all=function(){for(vart=[],e=0;e<arguments.length;e++)t[e]=arguments[e];varu=Array.prototype.slice.call(1===t.length&&n(t[0])?t[0]:t);returnnewi(function(o,i){if(0===u.length)returno([]);vara=u.length;functionc(e,t){try{if(t&&("object"==typeoft||"function"==typeoft)){varn=t.then;if("function"==typeofn)returnvoidn.call(t,function(t){c(e,t)},i)}u[e]=t,0==--a&&o(u)}catch(r){i(r)}}for(vart=0;t<u.length;t++)c(t,u[t])})},i.resolve=function(e){returne&&"object"==typeofe&&e.con