123456789101112 |
- /** 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([[0],{428:function(ia,da,e){e.r(da);e.d(da,"ByteRangeRequest",function(){return ka});var ca=e(1),y=e(0);e.n(y);var ha=e(2),ea=e(148);ia=e(94);var fa=e(244),ba=e(71),w=e(69),aa=e(243),r=e(164);e=e(371);var h=[],n=[],f=window,z=function(){return function(){this.am=1}}(),x;(function(f){f[f.UNSENT=0]="UNSENT";f[f.DONE=4]="DONE"})(x||(x={}));var ka=function(){function e(e,h,n,r){var w=this;this.url=e;this.range=h;this.ef=n;this.withCredentials=
- r;this.g1=x;this.request=new XMLHttpRequest;this.request.open("GET",this.url,!0);f.Uint8Array&&(this.request.responseType="arraybuffer");r&&(this.request.withCredentials=r);ja.DISABLE_RANGE_HEADER||(Object(y.isUndefined)(h.stop)?this.request.setRequestHeader("Range","bytes="+h.start):this.request.setRequestHeader("Range",["bytes=",h.start,"-",h.stop-1].join("")));n&&Object.keys(n).forEach(function(f){w.request.setRequestHeader(f,n[f])});this.request.overrideMimeType?this.request.overrideMimeType("text/plain; charset=x-user-defined"):
- this.request.setRequestHeader("Accept-Charset","x-user-defined");this.status=aa.a.NOT_STARTED}e.prototype.start=function(e){var h=this,n=this.request;n.onreadystatechange=function(){if(h.aborted)return h.status=aa.a.ABORTED,e({code:aa.a.ABORTED});if(this.readyState===h.g1.DONE){h.dC();var r=0===window.document.URL.indexOf("file:///");200===n.status||206===n.status||r&&0===n.status?(r=f.mT(this),h.Wt(r,e)):(h.status=aa.a.ERROR,e({code:h.status,status:h.status}))}};this.request.send(null);this.status=
- aa.a.STARTED};e.prototype.Wt=function(f,e){this.status=aa.a.SUCCESS;if(e)return e(!1,f)};e.prototype.abort=function(){this.dC();this.aborted=!0;this.request.abort()};e.prototype.dC=function(){var f=Object(r.c)(this.url,this.range,n);-1!==f&&n.splice(f,1);if(0<h.length){f=h.shift();var w=new e(f.url,f.range,this.ef,this.withCredentials);f.request=w;n.push(f);w.start(Object(r.d)(f))}};e.prototype.extend=function(f){var e=Object.assign({},this,f.prototype);e.constructor=f;return e};return e}(),ja=function(f){function e(e,
- h,n,r,w){n=f.call(this,e,n,r)||this;n.em={};n.DA=h;n.url=e;n.DISABLE_RANGE_HEADER=!1;n.zx=ka;n.pN=3;n.ef=w||{};return n}Object(ca.c)(e,f);e.prototype.Cv=function(f,e,h){var n=-1===f.indexOf("?")?"?":"&";switch(h){case !1:case w.a.NEVER_CACHE:f=f+n+"_="+Object(y.uniqueId)();break;case !0:case w.a.CACHE:f=f+n+"_="+e.start+","+(Object(y.isUndefined)(e.stop)?"":e.stop)}return f};e.prototype.kR=function(f,e,h,n){void 0===h&&(h={});return new this.zx(f,e,h,n)};e.prototype.j9=function(f,e,r,w,x){for(var z=
- 0;z<h.length;z++)if(Object(y.isEqual)(h[z].range,e)&&Object(y.isEqual)(h[z].url,f))return h[z].Lg.push(w),h[z].eD++,null;for(z=0;z<n.length;z++)if(Object(y.isEqual)(n[z].range,e)&&Object(y.isEqual)(n[z].url,f))return n[z].Lg.push(w),n[z].eD++,null;r={url:f,range:e,DA:r,Lg:[w],eD:1};if(0===h.length&&n.length<this.pN)return n.push(r),r.request=this.kR(f,e,x,this.withCredentials),r;h.push(r);return null};e.prototype.Sn=function(f,e,w){var x=this.Cv(f,e,this.DA);(f=this.j9(x,e,this.DA,w,this.ef))&&f.request.start(Object(r.d)(f));
- return function(){var f=Object(r.c)(x,e,n);if(-1!==f){var w=--n[f].eD;0===w&&n[f].request&&n[f].request.abort()}else f=Object(r.c)(x,e,h),-1!==f&&(w=--h[f].eD,0===w&&h.splice(f,1))}};e.prototype.RS=function(){return{start:-ea.a}};e.prototype.Lba=function(){var f=-(ea.a+ea.e);return{start:f-ea.d,end:f}};e.prototype.Zs=function(f){var e=this;this.KA=!0;var h=ea.a;this.Sn(this.url,this.RS(),function(n,r,w){function x(){var h=e.$d.NS();e.Sn(e.url,h,function(n,r){if(n)return Object(ha.j)("Error loading central directory: "+
- n),f(n);r=Object(ba.a)(r);if(r.length!==h.stop-h.start)return f("Invalid XOD file: Zip central directory data is wrong size! Should be "+(h.stop-h.start)+" but is "+r.length);e.$d.AW(r);e.cH=!0;e.KA=!1;return f(!1)})}if(n)return Object(ha.j)("Error loading end header: "+n),f(n,r,w);r=Object(ba.a)(r);if(r.length!==h)return f("Invalid XOD file: Zip end header data is wrong size!");try{e.$d=new fa.a(r)}catch(qa){return f(qa)}e.$d.oda?e.Sn(e.url,e.Lba(),function(h,n){if(h)return Object(ha.j)("Error loading zip64 header: "+
- h),f(h);n=Object(ba.a)(n);e.$d.Ida(n);x()}):x()})};e.prototype.jT=function(f){f(Object.keys(this.$d.sn))};e.prototype.$K=function(f,e){var h=this;if(this.$d.$Q(f)){var n=this.$d.ZB(f);if(n in this.em){var r=this.Yh[f];r.Or=this.em[n];r.Or.am++;r.cancel=r.Or.cancel}else{var w=this.$d.Y$(f),x=this.Sn(this.url,w,function(r,x){r?(Object(ha.j)('Error loading part "'+f+'": '+r),h.Sn(h.url,w,function(r,x){if(r)return e(r,f);h.FW(x,w,n,f,e)})):h.FW(x,w,n,f,e)}),aa=this.Yh[f];aa&&(aa.FY=!0,aa.cancel=function(){aa.Or.am--;
- 0===aa.Or.am&&(x(),delete h.em[n])},this.em[n]=new z(n),aa.Or=this.em[n],aa.Or.cancel=aa.cancel)}}else delete this.Yh[f],e(Error('File not found: "'+f+'"'),f)};e.prototype.FW=function(f,e,h,n,r){if(f.length!==e.stop-e.start)r(Error("Part data is wrong size!"),n);else{do{if(!this.em[h])return;n=this.em[h].am;for(var w=e.wq.length,x=0;x<w;++x){var z=e.wq[x];r(!1,z.sq,f["string"===typeof f?"substring":"subarray"](z.start,z.stop),this.$d.mU(z.sq));z.sq in this.Yh&&delete this.Yh[z.sq]}}while(n!==this.em[h].am);
- delete this.em[h]}};e.DISABLE_RANGE_HEADER=!1;e.pN=3;return e}(ia.a);(function(f){function e(e,h,n){var r=f.call(this)||this,w;for(w in e)r[w]=e[w];r.Woa=e;r.startOffset=h;r.endOffset=n;r.kR=function(f,h,n,w){Object(y.isUndefined)(h.stop)?(h.start+=r.endOffset,h.stop=r.endOffset):(h.start+=r.startOffset,h.stop+=r.startOffset);f=r.Cv(r.url,h,r.DA);return new e.zx(f,h,n,w)};return r}Object(ca.c)(e,f);return e})(ja);Object(e.a)(ja);Object(e.b)(ja);da["default"]=ja}}]);}).call(this || window)
|