9 lines
21 KiB
JavaScript
9 lines
21 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.8.1 (2021-05-20)
|
||
|
*/
|
||
|
!function(){"use strict";var t,e,n,r,o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},a=function(r){return function(e){return n=typeof(t=e),(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n)===r;var t,n}},l=function(t){return function(e){return typeof e===t}},v=a("string"),s=a("object"),u=a("array"),m=function(e){return t===e},d=l("boolean"),y=function(e){return!(null===(t=e)||t===undefined);var t},g=l("number"),f=function(){},p=function(e){return function(){return e}},h=p(!1),b=p(!(t=null)),D=function(){return A},A=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:h,isSome:h,isNone:b,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:p(null),getOrUndefined:p(undefined),or:r,orThunk:n,map:D,each:f,bind:D,exists:h,forall:b,filter:D,equals:e,equals_:e,toArray:function(){return[]},toString:p("none()")}),w=function(n){var e=p(n),t=function(){return i},r=function(e){return e(n)},i={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:b,isNone:h,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return w(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?i:A},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(h,function(e){return t(n,e)})}};return i},S={some:w,none:D,from:function(e){return null===e||e===undefined?A:w(e)}},x=Object.keys,C=Object.hasOwnProperty,U=function(e,n,r,i){return function(e,t){for(var n=x(e),r=0,i=n.length;r<i;r++){var a=n[r];t(e[a],a)}}(e,function(e,t){(n(e,t)?r:i)(e,t)}),{}},I=function(e,t){var n,r={};return U(e,t,(n=r,function(e,t){n[t]=e}),f),r},O=function(e,t){return n=e,r=t,C.call(n,r)&&e[t]!==undefined&&null!==e[t];var n,r},T=Array.prototype.push,N=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!u(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);T.apply(t,e[n])}return t},L=function(e){return t=e,(n=0)<=n&&n<t.length?S.some(t[n]):S.none();var t,n},P=("undefined"!=typeof window||Function("return this;")(),function(e,t,n){!function(e,t,n){if(!(v(n)||d(n)||g(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)}),_=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:e}},E={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return _(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return _(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return _(n)},fromDom:_,fromPoint:function(e,t,n){return S.from(e.dom.elementFromPoint(t,n)).map(_)}},M=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),j=tinymce.util.Tools.resolve("tinymce.util.Promise"),R=tinymce.util.Tools.resolve("tinymce.util.XHR"),k=function(e){return e.getParam("image_dimensions",!0,"boolean")},z=function(e,t){return Math.max(parseInt(e,10),parseInt(t,10))},B=function(e){return e=e&&e.replace(/px$/,"")},H=function(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e},F=function(e){if(e.margin){var t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["
|