egroupware_official/api/js/tinymce/plugins/imagetools/plugin.min.js

1 line
23 KiB
JavaScript
Raw Normal View History

!function(){"use strict";var r=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return r(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools");function e(t,n){return i(document.createElement("canvas"),t,n)}function o(t){return t.getContext("2d")}function i(t,n,e){return t.width=n,t.height=e,t}var n,a,c,f,l={create:e,clone:function Xt(t){var n;return o(n=e(t.width,t.height)).drawImage(t,0,0),n},resize:i,get2dContext:o,get3dContext:function Yt(t){var n=null;try{n=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(e){}return n||(n=null),n}},d={getWidth:function Qt(t){return t.naturalWidth||t.width},getHeight:function Zt(t){return t.naturalHeight||t.height}},h=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(t,r(o,this),r(a,this))},n=t.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){setTimeout(t,1)};function r(t,n){return function(){t.apply(n,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(r){var o=this;null!==this._state?n(function(){var t=o._state?r.onFulfilled:r.onRejected;if(null!==t){var n;try{n=t(o._value)}catch(e){return void r.reject(e)}r.resolve(n)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void f(r(n,t),r(o,this),r(a,this))}this._state=!0,this._value=t,u.call(this)}catch(e){a.call(this,e)}}function a(t){this._state=!1,this._value=t,u.call(this)}function u(){for(var t=0,n=this._deferreds.length;t<n;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function c(t,n,e,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof n?n:null,this.resolve=e,this.reject=r}function f(t,n,e){var r=!1;try{t(function(t){r||(r=!0,n(t))},function(t){r||(r=!0,e(t))})}catch(o){if(r)return;r=!0,e(o)}}return t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype.then=function(e,r){var o=this;return new t(function(t,n){i.call(o,new c(e,r,t,n))})},t.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new t(function(o,i){if(0===c.length)return o([]);var a=c.length;function u(n,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void e.call(t,function(t){u(n,t)},i)}c[n]=t,0==--a&&o(c)}catch(r){i(r)}}for(var t=0;t<c.length;t++)u(t,c[t])})},t.resolve=function(n){return n&&"object"==typeof n&&n.constructor===t?n:new t(function(t){t(n)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.race=function(o){return new t(function(t,n){for(var e=0,r=o.length;e<r;e++)o[e].then(t,n)})},t}(),g=function(t){return function(){return t}},s=function(i){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var a=new Array(arguments.length-1),e=1;e<arguments.length;e++)a[e-1]=arguments[e];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var o=a.concat(e);return i.apply(null,o)}},m=g(!1),p=g(!0),v=m,y=p,b=function(){return w},w=(f={fold:function(t,n){return t()},is:v,isSome:v,isNone:y,getOr:c=function(t){return t},getOrThunk:a=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:c,orThunk:a,map:b,ap:b,each:function(){},bind:b,flatten:b,exists:v,forall:y,filter:b,equals:n=function(t){return t.isNone()},equals_:n,toArray:function(){return[]},toString:g("none()")},Object.freeze&&Object.freeze(f),f),I=function(e){var t=functi