!function(){"use strict";vart=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){return(u=Object.assign||function(t){for(varn,r=1,e=arguments.length;r<e;r++)for(varoinn=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);returnt}).apply(this,arguments)};functiona(t,n,r){if(r||2===arguments.length)for(vare,o=0,a=n.length;o<a;o++)!e&&oinn||((e=e||Array.prototype.slice.call(n,0,o))[o]=n[o]);returnt.concat(e||Array.prototype.slice.call(n))}functionn(e){returnfunction(t){returnr=typeof(n=t),(null===n?"null":"object"==r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===e;varn,r}}functione(){}functioni(t){returnfunction(){returnt}}functiono(t){returnt}functionr(){returnm}varf=n("string"),c=n("object"),s=n("array"),l=i(!1),d=i(!0),m={fold:function(t,n){returnt()},isSome:l,isNone:d,getOr:o,getOrThunk:g,getOrDie:function(t){thrownewError(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void0),or:o,orThunk:g,map:r,each:e,bind:r,exists:l,forall:d,filter:function(){returnm},toArray:function(){return[]},toString:i("none()")};functiong(t){returnt()}functionp(t,n){return-1<E.call(t,n)}functionh(t,n){for(varr=t.length,e=newArray(r),o=0;o<r;o++){vara=t[o];e[o]=n(a,o)}returne}functionv(t,n){for(varr=0,e=t.length;r<e;r++)n(t[r],r)}functiony(t,n){for(varr=[],e=0,o=t.length;e<o;e++){vara=t[e];n(a,e)&&r.push(a)}returnr}functionb(t,e,o){returnfunction(t){for(varn,r=t.length-1;0<=r;r--)n=t[r],o=e(o,n,r)}(t),o}functionk(t,n){for(varr=0,e=t.length;r<e;++r)if(!0!==n(t[r],r))return;return1}varO=function(r){functiont(){returno}functionn(t){returnt(r)}vare=i(r),o={fold:function(t,n){returnn(r)},isSome:d,isNone:l,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(t){returnO(t(r))},each:function(t){t(r)},bind:n,exists:n,forall:n,filter:function(t){returnt(r)?o:m},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};returno},w={some:O,none:r,from:function(t){returnnull==t?m:O(t)}},C=Array.prototype.slice,E=Array.prototype.indexOf,x=Object.keys,R=Object.hasOwnProperty;functionT(t){varn=[],r=[];returnv(t,function(t){t.fold(function(t){n.push(t)},function(t){r.push(t)})}),{errors:n,values:r}}functionP(t){return"inline-command"===t.type||"inline-format"===t.type}functionN(t){return"block-command"===t.type||"block-format"===t.type}functionS(o){functiona(t){returnut.error({message:t,pattern:o})}functiont(t,n,r){if(void0===o.format)returnvoid0!==o.cmd?f(o.cmd)?ut.value(r(o.cmd,o.value)):a(t+" pattern has non-string `cmd` parameter"):a(t+" pattern is missing both `format` and `cmd` parameters");vare=void0;if(s(o.format)){if(!k(o.format,f))returna(t+" pattern has non-string items in the `format` array");e=o.format}else{if(!f(o.format))returna(t+" pattern has non-string `format` parameter");e=[o.format]}returnut.value(n(e))}if(!c(o))returna("Raw pattern is not an object");if(!f(o.start))returna("Raw pattern is missing `start` parameter");if(void0===o.end)returnvoid0!==o.replacement?f(o.replacement)?0===o.start.length?a("Replacement pattern has empty `start` parameter"):ut.value({type:"inline-command",start:"",end:o.start,cmd:"mceInsertContent",value:o.replacement}):a("Replacement pattern has non-string `replacement` parameter"):0===o.start.length?a("Block pattern has empty `start` parameter"):t("Block",function(t){return{type:"block-format",start:o.start,format:t[0]}},function(t,n){return{type:"block-command",start:o.start,cmd:t,value:n}});if(!f(o.end))returna("Inline pattern has non-string `end` parameter");if(0===o.start.length&&0===o.end.length)returna("Inline pattern has empty `start` and `end` parameters");varr=o.start,e=o.end;return0===e.length&&(e=r,r=""),t("Inline",function(t){return{type:"inline-format",start:r,end:e,format:t}},function(t,n){return{type:"inline-command",start:r,end:e,cmd:t,value:n}})}functionM(t){