policybot/fassets/js/components/tinymce/plugins/media/plugin.min.js

9 lines
18 KiB
JavaScript
Raw Normal View History

2021-11-30 10:56:55 +00:00
/**
* 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 e,t,r,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=function(n){return function(e){return r=typeof(t=e),(null===t?"null":"object"==r&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":r)===n;var t,r}},i=o("string"),u=o("object"),g=o("array"),s=function(e){return!(null===(t=e)||t===undefined);var t},a=function(e){return function(){return e}},c=a(!1),l=a(!0),m=function(){return d},d=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:c,isSome:c,isNone:l,getOr:r=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:r,orThunk:t,map:m,each:function(){},bind:m,exists:c,forall:l,filter:m,equals:e,equals_:e,toArray:function(){return[]},toString:a("none()")}),f=function(r){var e=a(r),t=function(){return o},n=function(e){return e(r)},o={fold:function(e,t){return t(r)},is:function(e){return r===e},isSome:l,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return f(e(r))},each:function(e){e(r)},bind:n,exists:n,forall:n,filter:function(e){return e(r)?o:d},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,t){return e.fold(c,function(e){return t(r,e)})}};return o},h={some:f,none:m,from:function(e){return null===e||e===undefined?d:f(e)}},v=Array.prototype.push,w=function(e,t){for(var r=0,n=e.length;r<n;r++){t(e[r],r)}},b=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},y=Object.keys,x=Object.hasOwnProperty,j=function(e,t){return O(e,t)?h.from(e[t]):h.none()},O=function(e,t){return x.call(e,t)},S=function(e){return e.getParam("media_scripts")},_=tinymce.util.Tools.resolve("tinymce.util.Tools"),k=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),A=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),T=function(e,t){if(e)for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r].filter))return e[r]},C=k.DOM,P=function(e){return e.replace(/px$/,"")},D=function(i,e){var c=b(!1),u={};return A({validate:!1,allow_conditional_comments:!0,start:function(e,t){if(!c.get())if(O(t.map,"data-ephox-embed-iri"))c.set(!0),o=(n=t).map.style,a=o?C.parseStyle(o):{},u={type:"ephox-embed-iri",source:n.map["data-ephox-embed-iri"],altsource:"",poster:"",width:j(a,"max-width").map(P).getOr(""),height:j(a,"max-height").map(P).getOr("")};else{if(u.source||"param"!==e||(u.source=t.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(u.type||(u.type=e),u=_.extend(t.map,u)),"script"===e){var r=T(i,t.map.src);if(!r)return;u={type:"script",source:t.map.src,width:String(r.width),height:String(r.height)}}"source"===e&&(u.source?u.altsource||(u.altsource=t.map.src):u.source=t.map.src),"img"!==e||u.poster||(u.poster=t.map.src)}var n,o,a}}).parse(e),u.source=u.source||u.src||u.data,u.altsource=u.altsource||"",u.poster=u.poster||"",u},$=function(e){var t={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()];return t||""},M=tinymce.util.Tools.resolve("tinymce.html.Schema"),F=tinymce.util.Tools.resolve("tinymce.html.Writer"),z=k.DOM,N=function(e){return/^[0-9.]+$/.test(e)?e+"px":e},U=function(a,e){!function(e,t){for(var r=y(e),n=0,o=r.length;n<o;n++){var a=r[n];t(e[a],a)}}(e,function(e,t){var r=""+e;if(a.map[t])for(var n=a.length;n--;){var o=a[n];o.name===t&&(r?(a.map[t]=r,o.value=r):(delete a.map[t],a.splice(n,1)))}else r&&(a.push({name:t,value:r}),a.map[t]=r)})},E=["source","altsource"],R=function(e,c,u){var s,l=F(),m=b(!1),d=0;return A({validate:!1,allow_conditiona