@suns/react-monorepo-nx
Version:
To evaluate and compare the bundled and unbundled builds on large codebase.
11 lines (10 loc) • 4.67 kB
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],{526:function(wa,ta,n){n.r(ta);var pa=n(0),oa=n(1);n.n(oa);var na=n(3),ja=n(176);wa=n(51);var ka=n(112),fa=n(293),y=n(83),x=n(292);n=n(438);var f=window,e=function(){function h(r,w,z){var aa=-1===r.indexOf("?")?"?":"&";switch(w){case y.a.NEVER_CACHE:this.url=r+aa+"_="+Object(oa.uniqueId)();break;default:this.url=r}this.cg=z;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=x.a.NOT_STARTED}h.prototype.start=function(r,w){var z=this,aa=this,ha=this.request,ba;aa.NA=0;r&&Object.keys(r).forEach(function(ca){z.request.setRequestHeader(ca,r[ca])});w&&(this.request.withCredentials=w);this.vI=setInterval(function(){var ca=0===window.document.URL.indexOf("file:///");ca=200===ha.status||
ca&&0===ha.status;if(ha.readyState!==x.b.DONE||ca){try{ha.responseText}catch(ea){return}aa.NA<ha.responseText.length&&(ba=aa.Nua())&&aa.trigger(h.Events.DATA,[ba]);0===ha.readyState&&(clearInterval(aa.vI),aa.trigger(h.Events.DONE))}else clearInterval(aa.vI),aa.trigger(h.Events.DONE,["Error received return status "+ha.status])},1E3);this.request.send(null);this.status=x.a.STARTED};h.prototype.Nua=function(){var r=this.request,w=r.responseText;if(0!==w.length)if(this.NA===w.length)clearInterval(this.vI),
this.trigger(h.Events.DONE);else return w=Math.min(this.NA+3E6,w.length),r=f.b1(r,this.NA,!0,w),this.NA=w,r};h.prototype.abort=function(){clearInterval(this.vI);var r=this;this.request.onreadystatechange=function(){Object(na.j)("StreamingRequest aborted");r.status=x.a.ABORTED;return r.trigger(h.Events.ABORTED)};this.request.abort()};h.prototype.finish=function(){var r=this;this.request.onreadystatechange=function(){r.status=x.a.SUCCESS;return r.trigger(h.Events.DONE)};this.request.abort()};h.Events=
{DONE:"done",DATA:"data",ABORTED:"aborted"};return h}();Object(wa.a)(e);var a;(function(h){h[h.LOCAL_HEADER=0]="LOCAL_HEADER";h[h.FILE=1]="FILE";h[h.CENTRAL_DIR=2]="CENTRAL_DIR"})(a||(a={}));var b=function(h){function r(){var w=h.call(this)||this;w.buffer="";w.state=a.LOCAL_HEADER;w.YS=4;w.io=null;w.fw=ja.c;w.Op={};return w}Object(pa.c)(r,h);r.prototype.Gua=function(w){var z;for(w=this.buffer+w;w.length>=this.fw;)switch(this.state){case a.LOCAL_HEADER:this.io=z=this.Rua(w.slice(0,this.fw));if(z.Qw!==
ja.g)throw Error("Wrong signature in local header: "+z.Qw);w=w.slice(this.fw);this.state=a.FILE;this.fw=z.tM+z.Us+z.pz+this.YS;this.trigger(r.Events.HEADER,[z]);break;case a.FILE:this.io.name=w.slice(0,this.io.Us);this.Op[this.io.name]=this.io;z=this.fw-this.YS;var aa=w.slice(this.io.Us+this.io.pz,z);this.trigger(r.Events.FILE,[this.io.name,aa,this.io.NM]);w=w.slice(z);if(w.slice(0,this.YS)===ja.h)this.state=a.LOCAL_HEADER,this.fw=ja.c;else return this.state=a.CENTRAL_DIR,!0}this.buffer=w;return!1};
r.Events={HEADER:"header",FILE:"file"};return r}(fa.a);Object(wa.a)(b);wa=function(h){function r(w,z,aa,ha,ba){aa=h.call(this,w,aa,ha)||this;aa.url=w;aa.stream=new e(w,z);aa.ie=new b;aa.n5=window.createPromiseCapability();aa.R5={};aa.cg=ba;return aa}Object(pa.c)(r,h);r.prototype.MB=function(w){var z=this;this.request([this.Hk,this.Jm,this.Gk]);this.stream.addEventListener(e.Events.DATA,function(aa){try{if(z.ie.Gua(aa))return z.stream.finish()}catch(ha){throw z.stream.abort(),z.bs(ha),w(ha),ha;}});
this.stream.addEventListener(e.Events.DONE,function(aa){z.fua=!0;z.n5.resolve();aa&&(z.bs(aa),w(aa))});this.ie.addEventListener(b.Events.HEADER,Object(oa.bind)(this.Q5,this));this.ie.addEventListener(b.Events.FILE,Object(oa.bind)(this.hva,this));return this.stream.start(this.cg,this.withCredentials)};r.prototype.X0=function(w){var z=this;this.n5.promise.then(function(){w(Object.keys(z.ie.Op))})};r.prototype.Aq=function(){return!0};r.prototype.request=function(w){var z=this;this.fua&&w.forEach(function(aa){z.R5[aa]||
z.LAa(aa)})};r.prototype.Q5=function(){};r.prototype.abort=function(){this.stream&&this.stream.abort()};r.prototype.LAa=function(w){this.trigger(ka.a.Events.PART_READY,[{yb:w,error:"Requested part not found",Qj:!1,dh:!1}])};r.prototype.hva=function(w,z,aa){this.R5[w]=!0;this.trigger(ka.a.Events.PART_READY,[{yb:w,data:z,Qj:!1,dh:!1,error:null,Nd:aa}])};return r}(ka.a);Object(n.a)(wa);Object(n.b)(wa);ta["default"]=wa}}]);}).call(this || window)