/** 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([[8],{331:function(Ca,va,ba){ba.r(va);var pa=ba(2);Ca=ba(44);var ka=ba(126),la=ba(283),fa=ba(344),ca=window;ba=function(){function z(r,n){this.JL=function(b){b=b.split(".");return b[b.length-1].match(/(jpg|jpeg|png|gif)$/i)};n=n||{};this.url=r;this.filename=n.filename||r;this.he=n.customHeaders;this.x8=!!n.useDownloader;this.withCredentials=!!n.withCredentials}z.prototype.Jy=function(r){this.he=r};z.prototype.getCustomHeaders=function(){return this.he};
z.prototype.getFileData=function(r){var n=this,b=this,a=new XMLHttpRequest,e=0===this.url.indexOf("blob:")?"blob":"arraybuffer";a.open("GET",this.url,!0);a.withCredentials=this.withCredentials;a.responseType=e;this.he&&Object.keys(this.he).forEach(function(x){a.setRequestHeader(x,n.he[x])});var f=/^https?:/i.test(this.url);a.addEventListener("load",function(x){return Object(pa.b)(this,void 0,void 0,function(){var w,h,y,aa,ja,ha;return Object(pa.d)(this,function(ia){switch(ia.label){case 0:if(200!==
this.status&&(f||0!==this.status))return[3,10];b.trigger(z.Events.DOCUMENT_LOADING_PROGRESS,[x.loaded,x.loaded]);if("blob"!==this.responseType)return[3,4];w=this.response;return b.JL(b.filename)?[4,Object(fa.a)(w)]:[3,2];case 1:return h=ia.ia(),b.fileSize=h.byteLength,r(new Uint8Array(h)),[3,3];case 2:y=new FileReader,y.onload=function(ea){ea=new Uint8Array(ea.target.result);b.fileSize=ea.length;r(ea)},y.readAsArrayBuffer(w),ia.label=3;case 3:return[3,9];case 4:ia.pi.push([4,8,,9]);aa=new Uint8Array(this.response);
if(!b.JL(b.filename))return[3,6];w=new Blob([aa.buffer]);return[4,Object(fa.a)(w)];case 5:return h=ia.ia(),b.fileSize=h.byteLength,r(new Uint8Array(h)),[3,7];case 6:b.fileSize=aa.length,r(aa),ia.label=7;case 7:return[3,9];case 8:return ia.ia(),b.trigger(z.Events.ERROR,["pdfLoad","Out of memory"]),[3,9];case 9:return[3,11];case 10:ja=x.currentTarget,ha=Object(ka.b)(ja),b.trigger(z.Events.ERROR,["pdfLoad",this.status+" "+ja.statusText,ha]),ia.label=11;case 11:return b.Ut=null,[2]}})})},!1);a.onprogress=
function(x){b.trigger(z.Events.DOCUMENT_LOADING_PROGRESS,[x.loaded,0<x.total?x.total:0])};a.addEventListener("error",function(){b.trigger(z.Events.ERROR,["pdfLoad","Network failure"]);b.Ut=null},!1);a.send();this.Ut=a};z.prototype.getFile=function(){var r=this;return new Promise(function(n){ca.utils.isJSWorker&&n(r.url);if(r.x8){var b=Object(pa.a)({url:r.url},r.he?{customHeaders:r.he}:{});n(b)}n(null)})};z.prototype.abort=function(){this.Ut&&(this.Ut.abort(),this.Ut=null)};z.Events={DOCUMENT_LOADING_PROGRESS:"documentLoadingProgress",
ERROR:"error"};return z}();Object(Ca.a)(ba);Object(la.a)(ba);Object(la.b)(ba);va["default"]=ba}}]);}).call(this || window)
