!function(f){"use strict";vart,n,e,r,o,a=function(t){varn=t,e=function(){returnn};return{get:e,set:function(t){n=t},clone:function(){returna(e())}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){for(vart=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},s=function(t){returnfunction(){returnt}},c=function(t){returnt},l=s(!1),d=s(!0),m=l,g=d,h=function(){returnp},p=(r={fold:function(t,n){returnt()},is:m,isSome:m,isNone:g,getOr:e=function(t){returnt},getOrThunk:n=function(t){returnt()},getOrDie:function(t){thrownewError(t||"error: getOrDie called on none.")},getOrNull:function(){returnnull},getOrUndefined:function(){returnundefined},or:e,orThunk:n,map:h,ap:h,each:function(){},bind:h,flatten:h,exists:m,forall:g,filter:h,equals:t=function(t){returnt.isNone()},equals_:t,toArray:function(){return[]},toString:s("none()")},Object.freeze&&Object.freeze(r),r),v=function(e){vart=function(){returne},n=function(){returno},r=function(t){returnt(e)},o={fold:function(t,n){returnn(e)},is:function(t){returne===t},isSome:g,isNone:m,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){returnv(t(e))},ap:function(t){returnt.fold(h,function(t){returnv(t(e))})},each:function(t){t(e)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){returnt(e)?o:p},equals:function(t){returnt.is(e)},equals_:function(t,n){returnt.fold(m,function(t){returnn(e,t)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};returno},w={some:v,none:h,from:function(t){returnnull===t||t===undefined?p:v(t)}},y=function(n){returnfunction(t){returnfunction(t){if(null===t)return"null";varn=typeoft;return"object"===n&&Array.prototype.isPrototypeOf(t)?"array":"object"===n&&String.prototype.isPrototypeOf(t)?"string":n}(t)===n}},O=y("string"),N=y("object"),E=y("array"),b=y("function"),k=(o=Array.prototype.indexOf)===undefined?function(t,n){returnC(t,n)}:function(t,n){returno.call(t,n)},T=function(t,n){for(vare=t.length,r=newArray(e),o=0;o<e;o++){vara=t[o];r[o]=n(a,o,t)}returnr},D=function(t,n){for(vare=0,r=t.length;e<r;e++)n(t[e],e,t)},x=function(t,n){for(vare=[],r=0,o=t.length;r<o;r++){vara=t[r];n(a,r,t)&&e.push(a)}returne},C=function(t,n){for(vare=0,r=t.length;e<r;++e)if(t[e]===n)returne;return-1},_=function(t,n){for(vare=0,r=t.length;e<r;++e)if(!0!==n(t[e],e,t))return!1;return!0},P=Array.prototype.slice,R=(b(Array.from)&&Array.from,Object.keys),I=Object.hasOwnProperty,A=function(t,n){returnI.call(t,n)},S=(function(i){if(!E(i))thrownewError("cases must be an array");if(0===i.length)thrownewError("there must be at least one case");varu=[],e={};D(i,function(t,r){varn=R(t);if(1!==n.length)thrownewError("one and only one name per case");varo=n[0],a=t[o];if(e[o]!==undefined)thrownewError("duplicate key detected:"+o);if("cata"===o)thrownewError("cannot have a case named cata (sorry)");if(!E(a))thrownewError("case arguments must be an array");u.push(o),e[o]=function(){vart=arguments.length;if(t!==a.length)thrownewError("Wrong number of arguments to case "+o+". Expected "+a.length+" ("+a+"), got "+t);for(vare=newArray(t),n=0;n<e.length;n++)e[n]=arguments[n];return{fold:function(){if(arguments.length!==i.length)thrownewError("Wrong number of arguments to fold. Expected "+i.length+", got "+arguments.length);returnarguments[r].apply(null,e)},match:function(t){varn=R(t);if(u.length!==n.length)thrownewError("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+n.join(","));if(!_(u,function(t){return-1<k(n,t)}))thrownewError("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+u.join(", "));returnt[o].apply(null,e)},log:function(t){f.console.log(t,{constructors:u,constructor:o,params:e})}}}})}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){varn=[],e=[];returnD(t,function(t){t.fold(function(t){n.push(t)},function(t){e.push(t)})}),{errors:n,values:e}}),B=function(e){return{is:fu