11 lines
28 KiB
JavaScript
11 lines
28 KiB
JavaScript
|
/**
|
||
|
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
||
|
* Licensed under the LGPL or a commercial license.
|
||
|
* For LGPL see License.txt in the project root for license information.
|
||
|
* For commercial licenses see https://www.tiny.cloud/
|
||
|
*
|
||
|
* Version: 5.0.3 (2019-03-19)
|
||
|
*/
|
||
|
|
||
|
!function(s){"use strict";var e,n,t,r,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]},h=function(e){return function(){return e}},a=function(e){return e},u=h(!1),c=h(!0),l=u,f=c,d=function(){return m},m=(r={fold:function(e,n){return e()},is:l,isSome:l,isNone:f,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:t,orThunk:n,map:d,ap:d,each:function(){},bind:d,flatten:d,exists:l,forall:f,filter:d,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:h("none()")},Object.freeze&&Object.freeze(r),r),g=function(t){var e=function(){return t},n=function(){return i},r=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:f,isNone:l,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return g(e(t))},ap:function(e){return e.fold(d,function(e){return g(e(t))})},each:function(e){e(t)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(t)?i:m},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(l,function(e){return n(t,e)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return i},y={some:g,none:d,from:function(e){return null===e||e===undefined?m:g(e)}},p=function(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&Array.prototype.isPrototypeOf(e)?"array":"object"===n&&String.prototype.isPrototypeOf(e)?"string":n}(e)===n}},w=p("string"),v=p("object"),b=p("function"),O=p("number"),S=function(e,n){for(var t=0,r=e.length;t<r;t++)n(e[t],t,e)},N=Array.prototype.push,x=function(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!Array.prototype.isPrototypeOf(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);N.apply(n,e[t])}return n},T=(Array.prototype.slice,b(Array.from)&&Array.from,function(){return(T=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e}).apply(this,arguments)}),E=function(e){var t=y.none(),n=[],r=function(e){i()?a(e):n.push(e)},i=function(){return t.isSome()},o=function(e){S(e,a)},a=function(n){t.each(function(e){s.setTimeout(function(){n(e)},0)})};return e(function(e){t=y.some(e),o(n),n=[]}),{get:r,map:function(t){return E(function(n){r(function(e){n(t(e))})})},isReady:i}},D={nu:E,pure:function(n){return E(function(e){e(n)})}},A=function(n){var e=function(e){var r;n((r=e,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=this;s.setTimeout(function(){r.apply(t,e)},0)}))},t=function(){return D.nu(e)};return{map:function(r){return A(function(t){e(function(e){var n=r(e);t(n)})})},bind:function(t){return A(function(n){e(function(e){t(e).get(n)})})},anonBind:function(t){return A(function(n){e(function(e){t.get(n)})})},toLazy:t,toCached:function(){var n=null;return A(function(e){null===n&&(n=t()),n.get(e)})},get:e}},C={nu:A,pure:function(n){return A(function(e){e(n)})}},_=function(t){return{is:function(e){return t===e},isValue:c,isError:u,getOr:h(t),getOrThunk:h(t),getOrDie:h(t),or:function(e){return _(t)},orThunk:function(e){return _(t)},fold:function(e,n){return n(t)},map:function(e){return _(e(t))},mapError:function(e){return _(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOption:function(){return y.some(t)}}},I=function(t){return{is:u,isValue:u,isError:c,getOr:a,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(t),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,n){return e(t)},map:function(e){return I(t)},mapError:function(e){return I(e(t))},each:o,bind:function(e){return I(t)},exists:u,forall:c,toOption:y.none}},R={value:_,error:I},L=function(o){return T(
|