You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
19 KiB

!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=Object.getPrototypeOf,a=(e,t,a)=>{var i;return!!a(e,t.prototype)||(null===(i=e.constructor)||void 0===i?void 0:i.name)===t.name},i=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&a(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t})(t)===e,s=e=>t=>typeof t===e,r=i("string"),o=i("object"),n=e=>((e,i)=>o(e)&&a(e,i,((e,a)=>t(e)===a)))(e,Object),l=i("array"),c=e=>null===e;const m=s("boolean"),d=e=>!(e=>null==e)(e),g=s("function"),u=s("number"),p=()=>{};class h{constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return d(e)?h.some(e):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}h.singletonNone=new h(!1),Array.prototype.slice;const b=Array.prototype.push,v=e=>{const t=[];for(let a=0,i=e.length;a<i;++a){if(!l(e[a]))throw new Error("Arr.flatten item "+a+" was not an array, input: "+e);b.apply(t,e[a])}return t};g(Array.from)&&Array.from;const y=Object.keys,f=Object.hasOwnProperty,A=(e,t)=>f.call(e,t),w=(D=(e,t)=>n(e)&&n(t)?w(e,t):t,(...e)=>{if(0===e.length)throw new Error("Can't merge zero objects");const t={};for(let a=0;a<e.length;a++){const i=e[a];for(const e in i)A(i,e)&&(t[e]=D(t[e],i[e]))}return t});var D;const _=e=>e.length>0,C=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},I=C,U=(e,t,a)=>{((e,t,a)=>{if(!(r(a)||m(a)||u(a)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",a,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,a+"")})(e.dom,t,a)};var S=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),x=tinymce.util.Tools.resolve("tinymce.util.URI");const N=e=>t=>t.options.get(e),T=N("image_dimensions"),E=N("image_advtab"),L=N("image_uploadtab"),O=N("image_prepend_url"),j=N("image_class_list"),M=N("image_description"),R=N("image_title"),k=N("image_caption"),z=N("image_list"),B=N("a11y_advanced_options"),P=N("automatic_uploads"),H=(e,t)=>Math.max(parseInt(e,10),parseInt(t,10)),F=e=>(e&&(e=e.replace(/px$/,"")),e),G=e=>(e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e),W=e=>"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder")),$=(e,t)=>{const a=e.options.get;return x.isDomSafe(t,"img",{allow_html_data_urls:a("allow_html_data_urls"),allow_script_urls:a("allow_script_urls"),allow_svg_data_urls:a("allow_svg_data_urls")})},V=S.DOM,K=e=>e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?F(e.style.marginLeft):"",Z=e=>e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?F(e.style.marginTop):"",q=e=>e.style.borderWidth?F(e.style.borderWidth):"",J=(e,t)=>{var a;return e.hasAttribute(t)&&null!==(a=e.getAttribute(t))&&void 0!==a?a:""},Q=e=>null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName,X=(e,t,a)=>{""===a||null===a?e.removeAttribute(t):e.setAttribute(t,a)},Y=(e,t)=>{const a=e.getAttribute("style"),i=t(null!==a?a:"");i.length>0?(e.setAttribute("style",i),e.setAttribute("data-mce-style",i)):e.removeAttribute("style")},ee=(e,t)=>(e,a,i)=>{const s=e.style;s[a]?(s[a]=G(i),Y(e,t)):X(e,a,i)},te=(e,t)=>e.style[t]?F(e.style[t]):J(e,t),ae=(e,t)=>{const a=G(t);e.style.marginLeft=a,e.style.marginRight=a},ie=(e,t)