/** 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([[17],{395:function(ia,y,e){function fa(){return!1}function x(e,f,h){if(!(f in aa))return!0;f=aa[f];for(var n=0;n=this.Kp&&this.Mba(this.Dr.pop().data)};e.prototype.E_=function(e){0=this.gh?(this.EF=!0,this.Zp.Rn()):3f[h])return-1;if(e[h]!==f[h])return 1}return 0};e.prototype.Fn=function(){return 0>=this.d0()};e.prototype.NE=function(){this.We||(this.We=new n,this.Fn()?this.We.request={t:"cAnnots"}:this.We.request={t:"annots"},this.zg(this.We.request));return this.We.promise};e.prototype.cB=function(e,f){this.pg[f]||(this.pg[f]=new n,this.pg[f].request={t:"image",p:f},this.US(e,this.pg[f].request));return this.pg[f].promise}; e.prototype.eba=function(e){this.fi[e]||(this.fi[e]=new n,this.fi[e].request={t:"text",p:e},this.zg(this.fi[e].request));return this.fi[e].promise};e.prototype.fba=function(e,f,h,r,w){var x=this.lf.length;this.bz.length&&(x=this.bz.pop());this.lf[x]=new n;this.lf[x].request={t:"tiles",p:f,z:h,r:r,size:w,rID:x};this.US(e,this.lf[x].request);return this.lf[x].promise};e.prototype.DS=function(){this.Qe||(this.Qe=new n,this.Qe.request={t:"pdf"},this.SM?this.Qe.resolve({url:this.kE}):this.zg(this.Qe.request)); return this.Qe.promise};e.prototype.DO=function(e){var h=this,r=new XMLHttpRequest,w=Object(f.a)(this.ue+"aul",{id:this.id}),x=new FormData,y={};e.annots&&(y.annots="xfdf");e.watermark&&(y.watermark="png");e.redactions&&(y.redactions="redact");y={t:"docmod",reqID:this.GQ++,parts:y};e.print&&(y.print=!0);var z=this.Et(y);x.append("msg",JSON.stringify(z));return Promise.all([e.annots,e.watermark,e.redactions].map(function(e){return Promise.resolve(e)})).then(function(e){var f=e[0],y=e[1];e=e[2];f&& x.append("annots",f);y&&x.append("watermark",y);e&&x.append("redactions",e);h.ai[z.reqID]=new n;r.open("POST",w);r.withCredentials=h.Tg;f=new Promise(function(e,f){r.onreadystatechange=function(){4===r.readyState&&(200===r.status?e():f("An error occurred while sending down annotation data to the server"))}});r.send(x);return f.then(function(){return h.ai[z.reqID].promise})})};e.prototype.aP=function(){this.ae||(this.ae=new n,this.ae.request={t:"xod",noCreate:!0},this.zg(this.ae.request));return this.ae.promise}; e.prototype.gba=function(){this.be||(this.be=new n,this.be.request={t:"xod"},this.zg(this.be.request));return this.be.promise};e.prototype.Em=function(){return!0};e.prototype.request=function(){};e.prototype.YR=function(){};e.prototype.abort=function(){for(var e=0;ef?f=0:(5===f&&(h="wss://"),f+=3);var r=e.lastIndexOf("/");0>r&&(r=e.length);return h+e.slice(f,r)};e.prototype.send=function(e){this.Sm.readyState===WebSocket.CLOSED||this.oQ||this.Sm.send(JSON.stringify(e))};e.prototype.Qz=function(){return Object(fa.b)(this,void 0,void 0,function(){var e,f=this;return Object(fa.d)(this,function(){e=Object(ea.a)("wvsQueryParameters"); e.bcid=Object(ha.i)(8);Object(ea.b)("wvsQueryParameters",e);return[2,new Promise(function(e,h){var n=Object(da.a)(f.url);f.Sm=new WebSocket(n);f.Sm.onopen=function(){f.gv&&f.gv();e()};f.Sm.onerror=function(e){f.oQ=!0;h(e)};f.Sm.onclose=function(e){var n=e.code;return Object(fa.b)(f,void 0,void 0,function(){var e=this;return Object(fa.d)(this,function(f){switch(f.label){case 0:return this.Ct&&this.Ct(),3E3===n?[3,3]:8>this.gh++?[4,new Promise(function(f){return setTimeout(function(){return Object(fa.b)(e, void 0,void 0,function(){return Object(fa.d)(this,function(e){switch(e.label){case 0:return this.BH(),[4,this.Qz()];case 1:return e.ea(),f(),[2]}})})},3E3)})]:[3,2];case 1:return f.ea(),[3,3];case 2:h(ba.a),f.label=3;case 3:return[2]}})})};f.Sm.onmessage=function(e){e&&e.data&&(e=JSON.parse(e.data),e.hb?f.send({hb:!0}):e.end?close():f.gE(e))}})]})})};e.prototype.Rn=function(e){void 0===e&&(e=!1);this.gh=0;e?this.Sm.close(3E3):this.Sm.close();return Promise.resolve()};return e}(),z=function(){function e(e, f,n,r,w,x,y){void 0===r&&(r=null);void 0===w&&(w=null);void 0===x&&(x=null);void 0===y&&(y=null);this.gh=this.bB=this.id=0;this.wu=!1;this.request=null;e=this.I$(e);this.url=f?e+"/"+f+"pf":e+"/pf";this.OB=n;this.gE=r;this.gv=w;this.Ct=x;this.BH=y}e.prototype.I$=function(e){var f=e.lastIndexOf("/");0>f&&(f=e.length);return e.slice(0,f)};e.prototype.O0=function(e){e=e.split("\n");for(e[e.length-1]&&e.pop();0e[e.length-1].length;)"]"===e.pop()&&(this.id=0);0e[0].length&&e.shift(); for(var f=0;fthis.gh++?[4,new Promise(function(f){return setTimeout(function(){e.BH();e.Qz();f()},3E3)})]:[3,2];case 1:f.ea(),f.label=2;case 2:return[2]}})})};e.prototype.K$=function(e){Object(fa.b)(this,void 0,void 0,function(){var f,h;return Object(fa.d)(this,function(n){switch(n.label){case 0:f= null,h=0,n.label=1;case 1:if(!(hthis.gh?[4,this.MS()]:[3,3];case 2:return e.ea(),[3,1];case 3:return[2]}})})}e.request=new XMLHttpRequest;e.request.withCredentials=e.OB;var r=Object(da.a)(e.url,0!==e.id?{id:String(e.id),uc:String(e.bB)}:{uc:String(e.bB)});e.bB++;e.request.open("GET",r,!0);e.request.setRequestHeader("Cache-Control", "no-cache");e.request.setRequestHeader("X-Requested-With","XMLHttpRequest");e.request.onreadystatechange=function(){e.m9(e.request)};e.request.addEventListener("error",n);e.request.addEventListener("timeout",n);e.request.addEventListener("load",function(){e.gv&&e.gv();f()});e.request.send()})]})})};e.prototype.Qz=function(){var e=Object(ea.a)("wvsQueryParameters");e.bcid=Object(ha.i)(8);Object(ea.b)("wvsQueryParameters",e);this.bB=this.id=0;this.wu=!1;return this.NN()};e.prototype.send=function(e){var f= this,h=new XMLHttpRequest;h.withCredentials=this.OB;var r=Object(da.a)(this.url,{id:String(this.id)}),w=new FormData;w.append("data",JSON.stringify(e));h.addEventListener("error",function(){f.Rn()});h.open("POST",r);h.setRequestHeader("X-Requested-With","XMLHttpRequest");h.send(w)};e.prototype.Rn=function(){this.id=0;this.wu=!0;this.Ct&&this.Ct();this.request.abort();return Promise.resolve()};return e}();ia=function(){function e(e,f,n){this.BM=e;this.target=f;this.OB=n}e.prototype.W3=function(e,f, n,r,x){void 0===e&&(e=!0);void 0===f&&(f=null);void 0===n&&(n=null);void 0===r&&(r=null);void 0===x&&(x=null);return e?new w(this.BM,this.target,f,n,r,x):new z(this.BM,this.target,this.OB,f,n,r,x)};return e}();y.a=ia}}]);}).call(this || window)