/** 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([[7],{143:function(ia,y,e){function fa(e,f,h,n){return Object(na.b)(void 0,void 0,void 0,function(){var r,w,x,y,z,aa,ba,da,fa;return Object(na.d)(this,function(ha){switch(ha.label){case 0:return r=Ia.getDocument(),w=[1],[4,Object(za.c)(f,{extension:"pdf"})];case 1:return x=ha.ea(),y=Ia.La(),ba=(aa=ua.a).B$,[4,x.Uy()];case 2:return z=ba.apply(aa,[ha.ea().xfdfString,e]),da=!0,[4,r.af(x,w,e,da)];case 3:return ha.ea(),[4,r.Nf([e+1],da)]; case 4:return ha.ea(),fa=y.Ng().filter(function(f){return f.NP()&&f.PageNumber===e}),y.Kt(fa,{force:!0,source:"contentEditTool"}),[4,y.qP(z)];case 5:return ha.ea(),Ia.getDocument().rH(),Ia.qH(e),Ia.xe(),ea(e),ca(e,h.galleys,n),ca(e,h.objects,n),[2]}})})}function x(e){e=(new DOMParser).parseFromString(e,"text/html").documentElement.querySelector("body");e.querySelectorAll("p").forEach(function(e){e.querySelectorAll("span").forEach(function(e){var f=e.getAttribute("style");f=ha(f,e.innerHTML);e.innerHTML= f});var f=e.getAttribute("style"),h=e.innerHTML.oi("
","");e.innerHTML=ha(f,h)});return e.innerHTML.trim()}function ha(e,f){e.includes("bold")&&(f=""+f+"");e.includes("italic")&&(f=""+f+"");e.includes("text-decoration: underline")&&(f=""+f+"");return f}function ea(e){var f=Ia.La(),h=f.Ng().filter(function(f){return f.Cu()&&f.PageNumber===e});f.Kt(h,{force:!0,source:"contentEditTool"})}function da(e,f){f.forEach(function(f){Ga[e]||(Ga[e]=[]);Ga[e].find(function(e){return e.id=== f.id})||Ga[e].push(f)})}function ba(e,f){f.forEach(function(f){Ea[e]||(Ea[e]=[]);Ea[e].find(function(e){return e.id===f.id})||Ea[e].push(f)})}function w(e){var f=new DOMParser,h=f.parseFromString(e,"text/xml");h.querySelector("parsererror")&&(h=f.parseFromString(""+e+"","text/xml"));h.querySelectorAll("a").forEach(function(e){var f=e.childNodes[0];Array.from(e.querySelectorAll("*")).find(function(e){return"u"===e.tagName.toLowerCase()})||(e=document.createElement("u"),f.after(e),e.appendChild(f))}); return(new XMLSerializer).serializeToString(h)}function z(e,f,h,n){this.top=e;this.left=f;this.bottom=h;this.right=n;this.topVal=function(){return Math.round(this.top)};this.bottomVal=function(){return Math.round(this.bottom)};this.leftVal=function(){return Math.round(this.left)};this.rightVal=function(){return Math.round(this.right)};this.height=function(){return Math.round(Math.abs(this.top-this.bottom))};this.width=function(){return Math.round(this.right-this.left)};this.fM=function(e){return this.topVal()!== e.topVal()||this.leftVal()!==e.leftVal()||this.bottomVal()!==e.bottomVal()||this.rightVal()!==e.rightVal()}}function r(e,f,h,n,r){this.id=e;this.pagenum=f;this.galleysContents=h;this.contents=n;this.galleyBox=r;Object(Fa.d)(Ea)}function h(e,f,h,n){this.id=f;this.type=e;this.bbox=h;this.pagenum=n}function f(e,f,h,n,r){this.id=e;this.pagecount=f;this.pageBBox=h;this.galleys=n;this.objects=r}function n(e,f,h,n,r){var w=[];(new DOMParser).parseFromString(n,"text/html").documentElement.querySelectorAll("p").forEach(function(e, f){w[f]=e.innerHTML});h=(new DOMParser).parseFromString(h,"text/html");var x=null;h.documentElement.querySelectorAll("p").forEach(function(e,f){f";f=f+("")+(""+z.galleysContents+"");z.contents=h;f=f+h+"\n";return f+=""}function ca(e,f,n){var w=[],x=Ia.getDocument(),y=null;f.forEach(function(f){if(f instanceof h){var z=x.lm(e,f.bbox.leftVal(),f.bbox.topVal());var aa=z.x;var ba=z.y;var ca=x.lm(e,f.bbox.rightVal(),f.bbox.bottomVal());z=ca.x;ca=ca.y}else if(f instanceof r)z=x.lm(e,f.galleyBox.leftVal(),f.galleyBox.topVal()),aa=z.x,ba=z.y,ca=x.lm(e,f.galleyBox.rightVal(),f.galleyBox.bottomVal()),z=ca.x,ca=ca.y;else return;var da=new window.Core.Annotations.RectangleAnnotation,ea=va.a.OBJECT;f instanceof r&&(ea=va.a.TEXT);da.Yba(f,ea);da.PageNumber=f.pagenum;da.X=aa;da.Y=ba;da.Width=z-aa;da.Height=ca-ba;da.StrokeColor= new ra.a("#3183C8");da.FillColor=new ra.a(255,255,255,.01);da.Style="dash";da.Dashes="4,3";da.eN();da.selectionModel=Da.a;w.push(da);"undefined"!==typeof n&&n===f.id&&(y=da)});f=Ia.La();f.un(w);y&&f.Wo(y);f.Ui(w)}function aa(e,f,h){return Object(na.b)(this,void 0,void 0,function(){var n,r,w,x,y;return Object(na.d)(this,function(z){switch(z.label){case 0:n=e.data;w=n.cmd;switch(w){case "isReady":return[3,1];case "initialiseInfixServer":return[3,3];case "exportFile":return[3,4];case "importText":return[3, 5];case "transformObject":return[3,5];case "deleteObject":return[3,6]}return[3,7];case 1:return[4,Object(oa.b)()];case 2:return x=z.ea(),Ca.postMessage({cmd:"initialiseInfixServer",l:x}),[3,7];case 3:return(y=ja(n.resultsXML))?f():h("License key does not have content edit permission"),[3,7];case 4:return n.exportPerformed?ka(n.pageNumber,n.exportXML,n.objectXML,n.resultsXML):(r=Ba[n.pageNumber],ba(n.pageNumber,r.galleys),da(n.pageNumber,r.objects),ea(n.pageNumber),ca(n.pageNumber,r.galleys),ca(n.pageNumber, r.objects)),[3,7];case 5:return r=Ba[n.pageNumber],la(n.pageNumber,n.resultsXML),fa(n.pageNumber,n.pdfBuffer,r,n.id),[3,7];case 6:return r=Ba[n.pageNumber],la(n.pageNumber,n.resultsXML),r.galleys=r.galleys.filter(function(e){return e.id!==n.id}),r.objects=r.objects.filter(function(e){return e.id!==n.id}),fa(n.pageNumber,n.pdfBuffer,r),[3,7];case 7:return[2]}})})}function ja(e){e=new Uint8Array(e);var f=(new TextDecoder("utf-8")).decode(e);e=!1;f=(new DOMParser).parseFromString(f,"text/xml").getElementsByTagName("LicenseCheck"); null!==f&&0

","");r=w(h);r=r.replace(/(.*?)<\/span>/g,"$1");y=e.oC.id;z=e.PageNumber;aa=Ba[z];ba=aa.galleys.find(function(e){return e.id===y});ca=x(ba.contents); da=n(z,aa,ca,r,y);if(""===da)return[3,2];ea=new TextEncoder;fa=ea.encode(da);ha=fa.buffer;ia=Object(sa.c)()||"https://www.pdftron.com/webfonts/v2/";ja=Ia.getDocument();return[4,ja.ge([z])];case 1:return ka=na.ea(),ea=new TextEncoder,la=ea.encode(""),oa=la.buffer,Ca.postMessage({cmd:"importText",pdfFile:ka,pageNumber:z,webFontURL:ia,galleyId:y,importData:ha,tableData:oa},[ha,oa]),pa={},ba&&(ra=ba.galleyBox,pa={top:ra.top,left:ra.left,bottom:ra.bottom,right:ra.right}),Object(Fa.e)(ca,r,pa),[3,3];case 2:Object(ma.g)("Unable to generate import XML"), na.label=3;case 3:return[2]}})})},M4:function(e){if(e)return x(e.contents);Object(ma.g)("Unable to extract document content")}}},429:function(ia,y,e){var fa=e(1);ia=e(73);var x=e(45);e=function(e){function y(){return null!==e&&e.apply(this,arguments)||this}Object(fa.c)(y,e);y.prototype.testSelection=function(e,y,w){return x.a.Yj(e,y,w)};return y}(ia.a);y.a=e}}]);}).call(this || window)