5 lines
1.6 KiB
JavaScript
5 lines
1.6 KiB
JavaScript
/** Notice * This file contains works from many authors under various (but compatible) licenses. Please see core.txt for more information. **/
|
|
(function(){(window.wpCoreControlsBundle=window.wpCoreControlsBundle||[]).push([[11],{437:function(ia,ba,e){e.r(ba);var ea=e(1);ia=e(51);var x=e(376),ha=e(229),ca=e(19),da=window;e=function(){function e(e){var w=this;this.Bda=function(e){return e&&("image"===e.type.split("/")[0].toLowerCase()||e.name&&!!e.name.match(/.(jpg|jpeg|png|gif)$/i))};this.file=e;this.Oda=new Promise(function(n){return Object(ea.b)(w,void 0,void 0,function(){var h;return Object(ea.d)(this,function(f){switch(f.label){case 0:return this.Bda(this.file)?
|
|
[4,Object(ha.b)(e)]:[3,2];case 1:h=f.ea(),this.file=ca.p?new Blob([h],{type:e.type}):new File([h],null===e||void 0===e?void 0:e.name,{type:e.type}),f.label=2;case 2:return n(!0),[2]}})})})}e.prototype.getFileData=function(w){var x=this,n=new FileReader;n.onload=function(h){x.trigger(e.Events.DOCUMENT_LOADING_PROGRESS,[h.loaded,h.loaded]);w(new Uint8Array(h.target.result))};n.onprogress=function(h){h.lengthComputable&&x.trigger(e.Events.DOCUMENT_LOADING_PROGRESS,[h.loaded,0<h.total?h.total:0])};n.readAsArrayBuffer(this.file)};
|
|
e.prototype.getFile=function(){return Object(ea.b)(this,void 0,Promise,function(){return Object(ea.d)(this,function(e){switch(e.label){case 0:return[4,this.Oda];case 1:return e.ea(),da.utils.isJSWorker?[2,this.file.path]:[2,this.file]}})})};e.Events={DOCUMENT_LOADING_PROGRESS:"documentLoadingProgress"};return e}();Object(ia.a)(e);Object(x.a)(e);Object(x.b)(e);ba["default"]=e}}]);}).call(this || window)
|