/** 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([[13],{381:function(Ba,ya,z){z.r(ya);var qa=z(1),ka=z(0);z.n(ka);var la=z(2),ha=z(129);Ba=z(47);var da=z(83),y=z(217),r=z(61),h=z(216);z=z(339);var a=window,b=function(){function n(x,ca,w){var aa=-1===x.indexOf("?")?"?":"&";switch(ca){case r.a.NEVER_CACHE:this.url=x+aa+"_="+Object(ka.uniqueId)();break;default:this.url=x}this.Me=w;this.request=new XMLHttpRequest;this.request.open("GET",this.url,!0);this.request.setRequestHeader("X-Requested-With",
"XMLHttpRequest");this.request.overrideMimeType?this.request.overrideMimeType("text/plain; charset=x-user-defined"):this.request.setRequestHeader("Accept-Charset","x-user-defined");this.status=h.a.NOT_STARTED}n.prototype.start=function(x,ca){var w=this,aa=this,ja=this.request,fa;aa.bv=0;x&&Object.keys(x).forEach(function(ea){w.request.setRequestHeader(ea,x[ea])});ca&&(this.request.withCredentials=ca);this.DB=setInterval(function(){var ea=0===window.document.URL.indexOf("file:///");ea=200===ja.status||
ea&&0===ja.status;if(ja.readyState!==h.b.DONE||ea){try{ja.responseText}catch(ba){return}aa.bv<ja.responseText.length&&(fa=aa.baa())&&aa.trigger(n.Events.DATA,[fa]);0===ja.readyState&&(clearInterval(aa.DB),aa.trigger(n.Events.DONE))}else clearInterval(aa.DB),aa.trigger(n.Events.DONE,["Error received return status "+ja.status])},1E3);this.request.send(null);this.status=h.a.STARTED};n.prototype.baa=function(){var x=this.request,ca=x.responseText;if(0!==ca.length)if(this.bv===ca.length)clearInterval(this.DB),
this.trigger(n.Events.DONE);else return ca=Math.min(this.bv+3E6,ca.length),x=a.aQ(x,this.bv,!0,ca),this.bv=ca,x};n.prototype.abort=function(){clearInterval(this.DB);var x=this;this.request.onreadystatechange=function(){Object(la.i)("StreamingRequest aborted");x.status=h.a.ABORTED;return x.trigger(n.Events.ABORTED)};this.request.abort()};n.prototype.finish=function(){var x=this;this.request.onreadystatechange=function(){x.status=h.a.SUCCESS;return x.trigger(n.Events.DONE)};this.request.abort()};n.Events=
{DONE:"done",DATA:"data",ABORTED:"aborted"};return n}();Object(Ba.a)(b);var e;(function(n){n[n.LOCAL_HEADER=0]="LOCAL_HEADER";n[n.FILE=1]="FILE";n[n.CENTRAL_DIR=2]="CENTRAL_DIR"})(e||(e={}));var f=function(n){function x(){var ca=n.call(this)||this;ca.buffer="";ca.state=e.LOCAL_HEADER;ca.CJ=4;ca.Uk=null;ca.Cr=ha.c;ca.gm={};return ca}Object(qa.c)(x,n);x.prototype.W$=function(ca){var w;for(ca=this.buffer+ca;ca.length>=this.Cr;)switch(this.state){case e.LOCAL_HEADER:this.Uk=w=this.faa(ca.slice(0,this.Cr));
if(w.ds!==ha.g)throw Error("Wrong signature in local header: "+w.ds);ca=ca.slice(this.Cr);this.state=e.FILE;this.Cr=w.yE+w.Zo+w.ju+this.CJ;this.trigger(x.Events.HEADER,[w]);break;case e.FILE:this.Uk.name=ca.slice(0,this.Uk.Zo);this.gm[this.Uk.name]=this.Uk;w=this.Cr-this.CJ;var aa=ca.slice(this.Uk.Zo+this.Uk.ju,w);this.trigger(x.Events.FILE,[this.Uk.name,aa,this.Uk.PE]);ca=ca.slice(w);if(ca.slice(0,this.CJ)===ha.h)this.state=e.LOCAL_HEADER,this.Cr=ha.c;else return this.state=e.CENTRAL_DIR,!0}this.buffer=
ca;return!1};x.Events={HEADER:"header",FILE:"file"};return x}(y.a);Object(Ba.a)(f);Ba=function(n){function x(ca,w,aa,ja,fa){aa=n.call(this,ca,aa,ja)||this;aa.url=ca;aa.stream=new b(ca,w);aa.Gd=new f;aa.IS=window.createPromiseCapability();aa.fT={};aa.Me=fa;return aa}Object(qa.c)(x,n);x.prototype.Sv=function(ca){var w=this;this.request([this.wi,this.Oj,this.vi]);this.stream.addEventListener(b.Events.DATA,function(aa){try{if(w.Gd.W$(aa))return w.stream.finish()}catch(ja){throw w.stream.abort(),w.gu(ja),
ca(ja),ja;}});this.stream.addEventListener(b.Events.DONE,function(aa){w.D$=!0;w.IS.resolve();aa&&(w.gu(aa),ca(aa))});this.Gd.addEventListener(f.Events.HEADER,Object(ka.bind)(this.eT,this));this.Gd.addEventListener(f.Events.FILE,Object(ka.bind)(this.vaa,this));return this.stream.start(this.Me,this.withCredentials)};x.prototype.YP=function(ca){var w=this;this.IS.promise.then(function(){ca(Object.keys(w.Gd.gm))})};x.prototype.Om=function(){return!0};x.prototype.request=function(ca){var w=this;this.D$&&
ca.forEach(function(aa){w.fT[aa]||w.Dea(aa)})};x.prototype.eT=function(){};x.prototype.abort=function(){this.stream&&this.stream.abort()};x.prototype.Dea=function(ca){this.trigger(da.a.Events.PART_READY,[{ab:ca,error:"Requested part not found",Jh:!1,If:!1}])};x.prototype.vaa=function(ca,w,aa){this.fT[ca]=!0;this.trigger(da.a.Events.PART_READY,[{ab:ca,data:w,Jh:!1,If:!1,error:null,Qc:aa}])};return x}(da.a);Object(z.a)(Ba);Object(z.b)(Ba);ya["default"]=Ba}}]);}).call(this || window)
