"use strict";(self.webpackChunkstudio_client=self.webpackChunkstudio_client||[]).push([[7431],{5497:(t,e,o)=>{o.d(e,{Z:()=>g});var i=o(7638),r=o(4755),n=o(7366),s=o(6013),a=o(5941),d=o(4087),u=o(8418),h=o(9135),c=o(6107),p=o(9874),l=o(3955),f=o(4634);const b=function(){function t(t,e,o){this.alreadyEmbedded=!1,this.ref=t,this.doc=e,this.embedder=o}return t.prototype.embed=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e,o,r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return this.alreadyEmbedded?[3,2]:[4,this.embedder.embedIntoContext(this.doc.context,this.ref)];case 1:t=i.sent(),this.doc.catalog.has(c.wQ.of("Names"))||this.doc.catalog.set(c.wQ.of("Names"),this.doc.context.obj({})),(e=this.doc.catalog.lookup(c.wQ.of("Names"),c.mh)).has(c.wQ.of("EmbeddedFiles"))||e.set(c.wQ.of("EmbeddedFiles"),this.doc.context.obj({})),(o=e.lookup(c.wQ.of("EmbeddedFiles"),c.mh)).has(c.wQ.of("Names"))||o.set(c.wQ.of("Names"),this.doc.context.obj([])),(r=o.lookup(c.wQ.of("Names"),c.Gr)).push(c.Ij.fromText(this.embedder.fileName)),r.push(t),this.doc.catalog.has(c.wQ.of("AF"))||this.doc.catalog.set(c.wQ.of("AF"),this.doc.context.obj([])),this.doc.catalog.lookup(c.wQ.of("AF"),c.Gr).push(t),this.alreadyEmbedded=!0,i.label=2;case 2:return[2]}}))}))},t.of=function(e,o,i){return new t(e,o,i)},t}();var m=o(6789),y=o(2717);const g=function(){function t(t,e,o){var i=this;if(this.defaultWordBreaks=[" "],this.computePages=function(){var t=[];return i.catalog.Pages().traverse((function(e,o){if(e instanceof c.Eg){var r=i.pageMap.get(e);r||(r=d.Z.of(e,o,i),i.pageMap.set(e,r)),t.push(r)}})),t},this.getOrCreateForm=function(){var t=i.catalog.getOrCreateAcroForm();return u.Z.of(t,i)},(0,l.ku)(t,"context",[[c.o6,"PDFContext"]]),(0,l.ku)(e,"ignoreEncryption",["boolean"]),this.context=t,this.catalog=t.lookup(t.trailerInfo.Root),this.isEncrypted=!!t.lookup(t.trailerInfo.Encrypt),this.pageCache=l.Ct.populatedBy(this.computePages),this.pageMap=new Map,this.formCache=l.Ct.populatedBy(this.getOrCreateForm),this.fonts=[],this.images=[],this.embeddedPages=[],this.embeddedFiles=[],this.javaScripts=[],!e&&this.isEncrypted)throw new r.ip;o&&this.updateInfoDict()}return t.load=function(e,o){return void 0===o&&(o={}),(0,i.mG)(this,void 0,void 0,(function(){var r,n,s,a,d,u,h,f,b,m,y;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return r=o.ignoreEncryption,n=void 0!==r&&r,s=o.parseSpeed,a=void 0===s?p.u.Slow:s,d=o.throwOnInvalidObject,u=void 0!==d&&d,h=o.updateMetadata,f=void 0===h||h,b=o.capNumbers,m=void 0!==b&&b,(0,l.ku)(e,"pdf",["string",Uint8Array,ArrayBuffer]),(0,l.ku)(n,"ignoreEncryption",["boolean"]),(0,l.ku)(a,"parseSpeed",["number"]),(0,l.ku)(u,"throwOnInvalidObject",["boolean"]),y=(0,l._f)(e),[4,c.h9.forBytesWithOptions(y,a,u,m).parseDocument()];case 1:return[2,new t(i.sent(),n,f)]}}))}))},t.create=function(e){return void 0===e&&(e={}),(0,i.mG)(this,void 0,void 0,(function(){var o,r,n,s,a,d;return(0,i.Jh)(this,(function(i){return o=e.updateMetadata,r=void 0===o||o,n=c.o6.create(),s=c.N8.withContext(n),a=n.register(s),d=c.lR.withContextAndPages(n,a),n.trailerInfo.Root=n.register(d),[2,new t(n,!1,r)]}))}))},t.prototype.registerFontkit=function(t){this.fontkit=t},t.prototype.getForm=function(){var t=this.formCache.access();return t.hasXFA()&&(console.warn("Removing XFA form data as pdf-lib does not support reading or writing XFA"),t.deleteXFA()),t},t.prototype.getTitle=function(){var t=this.getInfoDict().lookup(c.wQ.Title);if(t)return v(t),t.decodeText()},t.prototype.getAuthor=function(){var t=this.getInfoDict().lookup(c.wQ.Author);if(t)return v(t),t.decodeText()},t.prototype.getSubject=function(){var t=this.getInfoDict().lookup(c.wQ.Subject);if(t)return v(t),t.decodeText()},t.prototype.getKeywords=function(){var t=this.getInfoDict().lookup(c.wQ.Keywords);if(t)return v(t),t.decodeText()},t.prototype.getCreator=function(){var t=this.getInfoDict().lookup(c.wQ.Creator);if(t)return v(t),t.decodeText()},t.prototype.getProducer=function(){var t=this.getInfoDict().lookup(c.wQ.Producer);if(t)return v(t),t.decodeText()},t.prototype.getCreationDate=function(){var t=this.getInfoDict().lookup(c.wQ.CreationDate);if(t)return v(t),t.decodeDate()},t.prototype.getModificationDate=function(){var t=this.getInfoDict().lookup(c.wQ.ModDate);if(t)return v(t),t.decodeDate()},t.prototype.setTitle=function(t,e){(0,l.ku)(t,"title",["string"]);var o=c.wQ.of("Title");(this.getInfoDict().set(o,c.Ij.fromText(t)),null==e?void 0:e.showInWindowTitleBar)&&this.catalog.getOrCreateViewerPreferences().setDisplayDocTitle(!0)},t.prototype.setAuthor=function(t){(0,l.ku)(t,"author",["string"]);var e=c.wQ.of("Author");this.getInfoDict().set(e,c.Ij.fromText(t))},t.prototype.setSubject=function(t){(0,l.ku)(t,"author",["string"]);var e=c.wQ.of("Subject");this.getInfoDict().set(e,c.Ij.fromText(t))},t.prototype.setKeywords=function(t){(0,l.ku)(t,"keywords",[Array]);var e=c.wQ.of("Keywords");this.getInfoDict().set(e,c.Ij.fromText(t.join(" ")))},t.prototype.setCreator=function(t){(0,l.ku)(t,"creator",["string"]);var e=c.wQ.of("Creator");this.getInfoDict().set(e,c.Ij.fromText(t))},t.prototype.setProducer=function(t){(0,l.ku)(t,"creator",["string"]);var e=c.wQ.of("Producer");this.getInfoDict().set(e,c.Ij.fromText(t))},t.prototype.setLanguage=function(t){(0,l.ku)(t,"language",["string"]);var e=c.wQ.of("Lang");this.catalog.set(e,c.u2.of(t))},t.prototype.setCreationDate=function(t){(0,l.ku)(t,"creationDate",[[Date,"Date"]]);var e=c.wQ.of("CreationDate");this.getInfoDict().set(e,c.u2.fromDate(t))},t.prototype.setModificationDate=function(t){(0,l.ku)(t,"modificationDate",[[Date,"Date"]]);var e=c.wQ.of("ModDate");this.getInfoDict().set(e,c.u2.fromDate(t))},t.prototype.getPageCount=function(){return void 0===this.pageCount&&(this.pageCount=this.getPages().length),this.pageCount},t.prototype.getPages=function(){return this.pageCache.access()},t.prototype.getPage=function(t){var e=this.getPages();return(0,l.gI)(t,"index",0,e.length-1),e[t]},t.prototype.getPageIndices=function(){return(0,l.w6)(0,this.getPageCount())},t.prototype.removePage=function(t){var e=this.getPageCount();if(0===this.pageCount)throw new r.jw;(0,l.gI)(t,"index",0,e-1),this.catalog.removeLeafNode(t),this.pageCount=e-1},t.prototype.addPage=function(t){return(0,l.ku)(t,"page",["undefined",[d.Z,"PDFPage"],Array]),this.insertPage(this.getPageCount(),t)},t.prototype.insertPage=function(t,e){var o=this.getPageCount();if((0,l.gI)(t,"index",0,o),(0,l.ku)(e,"page",["undefined",[d.Z,"PDFPage"],Array]),!e||Array.isArray(e)){var i=Array.isArray(e)?e:h.b.A4;(e=d.Z.create(this)).setSize.apply(e,i)}else if(e.doc!==this)throw new r.Nl;var n=this.catalog.insertLeafNode(e.ref,t);return e.node.setParent(n),this.pageMap.set(e.node,e),this.pageCache.invalidate(),this.pageCount=o+1,e},t.prototype.copyPages=function(e,o){return(0,i.mG)(this,void 0,void 0,(function(){var r,n,s,a,u,h,p,f;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return(0,l.ku)(e,"srcDoc",[[t,"PDFDocument"]]),(0,l.ku)(o,"indices",[Array]),[4,e.flush()];case 1:for(i.sent(),r=c.Wy.for(e.context,this.context),n=e.getPages(),s=new Array(o.length),a=0,u=o.length;a{var i;o.d(e,{u:()=>i}),function(t){t[t.Fastest=1/0]="Fastest",t[t.Fast=1500]="Fast",t[t.Medium=500]="Medium",t[t.Slow=100]="Slow"}(i||(i={}))},7366:(t,e,o)=>{o.d(e,{Z:()=>a});var i=o(7638),r=o(5497),n=o(6107),s=o(3955);const a=function(){function t(t,e,o){this.alreadyEmbedded=!1,(0,s.ku)(t,"ref",[[n.$F,"PDFRef"]]),(0,s.ku)(e,"doc",[[r.Z,"PDFDocument"]]),(0,s.ku)(o,"embedder",[[n.dS,"PDFPageEmbedder"]]),this.ref=t,this.doc=e,this.width=o.width,this.height=o.height,this.embedder=o}return t.prototype.scale=function(t){return(0,s.ku)(t,"factor",["number"]),{width:this.width*t,height:this.height*t}},t.prototype.size=function(){return this.scale(1)},t.prototype.embed=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){switch(t.label){case 0:return this.alreadyEmbedded?[3,2]:[4,this.embedder.embedIntoContext(this.doc.context,this.ref)];case 1:t.sent(),this.alreadyEmbedded=!0,t.label=2;case 2:return[2]}}))}))},t.of=function(e,o,i){return new t(e,o,i)},t}()},6013:(t,e,o)=>{o.d(e,{Z:()=>a});var i=o(7638),r=o(5497),n=o(6107),s=o(3955);const a=function(){function t(t,e,o){this.modified=!0,(0,s.ku)(t,"ref",[[n.$F,"PDFRef"]]),(0,s.ku)(e,"doc",[[r.Z,"PDFDocument"]]),(0,s.ku)(o,"embedder",[[n.Wz,"CustomFontEmbedder"],[n.IL,"StandardFontEmbedder"]]),this.ref=t,this.doc=e,this.name=o.fontName,this.embedder=o}return t.prototype.encodeText=function(t){return(0,s.ku)(t,"text",["string"]),this.modified=!0,this.embedder.encodeText(t)},t.prototype.widthOfTextAtSize=function(t,e){return(0,s.ku)(t,"text",["string"]),(0,s.ku)(e,"size",["number"]),this.embedder.widthOfTextAtSize(t,e)},t.prototype.heightAtSize=function(t,e){var o;return(0,s.ku)(t,"size",["number"]),(0,s.MU)(null==e?void 0:e.descender,"options.descender",["boolean"]),this.embedder.heightOfFontAtSize(t,{descender:null===(o=null==e?void 0:e.descender)||void 0===o||o})},t.prototype.sizeAtHeight=function(t){return(0,s.ku)(t,"height",["number"]),this.embedder.sizeOfFontAtHeight(t)},t.prototype.getCharacterSet=function(){return this.embedder instanceof n.IL?this.embedder.encoding.supportedCodePoints:this.embedder.font.characterSet},t.prototype.embed=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){switch(t.label){case 0:return this.modified?[4,this.embedder.embedIntoContext(this.doc.context,this.ref)]:[3,2];case 1:t.sent(),this.modified=!1,t.label=2;case 2:return[2]}}))}))},t.of=function(e,o,i){return new t(e,o,i)},t}()},5941:(t,e,o)=>{o.d(e,{Z:()=>a});var i=o(7638),r=o(5497),n=o(6107),s=o(3955);const a=function(){function t(t,e,o){(0,s.ku)(t,"ref",[[n.$F,"PDFRef"]]),(0,s.ku)(e,"doc",[[r.Z,"PDFDocument"]]),(0,s.ku)(o,"embedder",[[n.sm,"JpegEmbedder"],[n.Le,"PngEmbedder"]]),this.ref=t,this.doc=e,this.width=o.width,this.height=o.height,this.embedder=o}return t.prototype.scale=function(t){return(0,s.ku)(t,"factor",["number"]),{width:this.width*t,height:this.height*t}},t.prototype.scaleToFit=function(t,e){(0,s.ku)(t,"width",["number"]),(0,s.ku)(e,"height",["number"]);var o=t/this.width,i=e/this.height,r=Math.min(o,i);return this.scale(r)},t.prototype.size=function(){return this.scale(1)},t.prototype.embed=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return this.embedder?(this.embedTask||(e=(t=this).doc,o=t.ref,this.embedTask=this.embedder.embedIntoContext(e.context,o)),[4,this.embedTask]):[2];case 1:return i.sent(),this.embedder=void 0,[2]}}))}))},t.of=function(e,o,i){return new t(e,o,i)},t}()},6789:(t,e,o)=>{o.d(e,{Z:()=>n});var i=o(7638),r=o(6107);const n=function(){function t(t,e,o){this.alreadyEmbedded=!1,this.ref=t,this.doc=e,this.embedder=o}return t.prototype.embed=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e,o,n,s,a,d;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return this.alreadyEmbedded?[3,2]:(t=this.doc,e=t.catalog,o=t.context,[4,this.embedder.embedIntoContext(this.doc.context,this.ref)]);case 1:n=i.sent(),e.has(r.wQ.of("Names"))||e.set(r.wQ.of("Names"),o.obj({})),(s=e.lookup(r.wQ.of("Names"),r.mh)).has(r.wQ.of("JavaScript"))||s.set(r.wQ.of("JavaScript"),o.obj({})),(a=s.lookup(r.wQ.of("JavaScript"),r.mh)).has(r.wQ.of("Names"))||a.set(r.wQ.of("Names"),o.obj([])),(d=a.lookup(r.wQ.of("Names"),r.Gr)).push(r.Ij.fromText(this.embedder.scriptName)),d.push(n),this.alreadyEmbedded=!0,i.label=2;case 2:return[2]}}))}))},t.of=function(e,o,i){return new t(e,o,i)},t}()},4087:(t,e,o)=>{o.d(e,{Z:()=>m});var i=o(7638),r=o(985),n=o(1806),s=o(486),a=o(5497),d=o(7366),u=o(6013),h=o(5941),c=o(7531),p=o(5733),l=o(5893),f=o(6107),b=o(3955);const m=function(){function t(t,e,o){this.fontSize=24,this.fontColor=(0,r.B8)(0,0,0),this.lineHeight=24,this.x=0,this.y=0,(0,b.ku)(t,"leafNode",[[f.Eg,"PDFPageLeaf"]]),(0,b.ku)(e,"ref",[[f.$F,"PDFRef"]]),(0,b.ku)(o,"doc",[[a.Z,"PDFDocument"]]),this.node=t,this.ref=e,this.doc=o}return t.prototype.setRotation=function(t){var e=(0,p.Ux)(t);(0,b.m_)(e,"degreesAngle",90),this.node.set(f.wQ.of("Rotate"),this.doc.context.obj(e))},t.prototype.getRotation=function(){var t=this.node.Rotate();return(0,p.RW)(t?t.asNumber():0)},t.prototype.setSize=function(t,e){(0,b.ku)(t,"width",["number"]),(0,b.ku)(e,"height",["number"]);var o=this.getMediaBox();this.setMediaBox(o.x,o.y,t,e);var i=this.getCropBox(),r=this.getBleedBox(),n=this.getTrimBox(),s=this.getArtBox(),a=this.node.CropBox(),d=this.node.BleedBox(),u=this.node.TrimBox(),h=this.node.ArtBox();a&&(0,b.EO)(i,o)&&this.setCropBox(o.x,o.y,t,e),d&&(0,b.EO)(r,o)&&this.setBleedBox(o.x,o.y,t,e),u&&(0,b.EO)(n,o)&&this.setTrimBox(o.x,o.y,t,e),h&&(0,b.EO)(s,o)&&this.setArtBox(o.x,o.y,t,e)},t.prototype.setWidth=function(t){(0,b.ku)(t,"width",["number"]),this.setSize(t,this.getSize().height)},t.prototype.setHeight=function(t){(0,b.ku)(t,"height",["number"]),this.setSize(this.getSize().width,t)},t.prototype.setMediaBox=function(t,e,o,i){(0,b.ku)(t,"x",["number"]),(0,b.ku)(e,"y",["number"]),(0,b.ku)(o,"width",["number"]),(0,b.ku)(i,"height",["number"]);var r=this.doc.context.obj([t,e,t+o,e+i]);this.node.set(f.wQ.MediaBox,r)},t.prototype.setCropBox=function(t,e,o,i){(0,b.ku)(t,"x",["number"]),(0,b.ku)(e,"y",["number"]),(0,b.ku)(o,"width",["number"]),(0,b.ku)(i,"height",["number"]);var r=this.doc.context.obj([t,e,t+o,e+i]);this.node.set(f.wQ.CropBox,r)},t.prototype.setBleedBox=function(t,e,o,i){(0,b.ku)(t,"x",["number"]),(0,b.ku)(e,"y",["number"]),(0,b.ku)(o,"width",["number"]),(0,b.ku)(i,"height",["number"]);var r=this.doc.context.obj([t,e,t+o,e+i]);this.node.set(f.wQ.BleedBox,r)},t.prototype.setTrimBox=function(t,e,o,i){(0,b.ku)(t,"x",["number"]),(0,b.ku)(e,"y",["number"]),(0,b.ku)(o,"width",["number"]),(0,b.ku)(i,"height",["number"]);var r=this.doc.context.obj([t,e,t+o,e+i]);this.node.set(f.wQ.TrimBox,r)},t.prototype.setArtBox=function(t,e,o,i){(0,b.ku)(t,"x",["number"]),(0,b.ku)(e,"y",["number"]),(0,b.ku)(o,"width",["number"]),(0,b.ku)(i,"height",["number"]);var r=this.doc.context.obj([t,e,t+o,e+i]);this.node.set(f.wQ.ArtBox,r)},t.prototype.getSize=function(){var t=this.getMediaBox();return{width:t.width,height:t.height}},t.prototype.getWidth=function(){return this.getSize().width},t.prototype.getHeight=function(){return this.getSize().height},t.prototype.getMediaBox=function(){return this.node.MediaBox().asRectangle()},t.prototype.getCropBox=function(){var t,e=this.node.CropBox();return null!==(t=null==e?void 0:e.asRectangle())&&void 0!==t?t:this.getMediaBox()},t.prototype.getBleedBox=function(){var t,e=this.node.BleedBox();return null!==(t=null==e?void 0:e.asRectangle())&&void 0!==t?t:this.getCropBox()},t.prototype.getTrimBox=function(){var t,e=this.node.TrimBox();return null!==(t=null==e?void 0:e.asRectangle())&&void 0!==t?t:this.getCropBox()},t.prototype.getArtBox=function(){var t,e=this.node.ArtBox();return null!==(t=null==e?void 0:e.asRectangle())&&void 0!==t?t:this.getCropBox()},t.prototype.translateContent=function(t,e){(0,b.ku)(t,"x",["number"]),(0,b.ku)(e,"y",["number"]),this.node.normalize(),this.getContentStream();var o=this.createContentStream((0,s.bo)(),(0,s.Iu)(t,e)),i=this.doc.context.register(o),r=this.createContentStream((0,s.Pq)()),n=this.doc.context.register(r);this.node.wrapContentStreams(i,n)},t.prototype.scale=function(t,e){(0,b.ku)(t,"x",["number"]),(0,b.ku)(e,"y",["number"]),this.setSize(this.getWidth()*t,this.getHeight()*e),this.scaleContent(t,e),this.scaleAnnotations(t,e)},t.prototype.scaleContent=function(t,e){(0,b.ku)(t,"x",["number"]),(0,b.ku)(e,"y",["number"]),this.node.normalize(),this.getContentStream();var o=this.createContentStream((0,s.bo)(),(0,s.bA)(t,e)),i=this.doc.context.register(o),r=this.createContentStream((0,s.Pq)()),n=this.doc.context.register(r);this.node.wrapContentStreams(i,n)},t.prototype.scaleAnnotations=function(t,e){(0,b.ku)(t,"x",["number"]),(0,b.ku)(e,"y",["number"]);var o=this.node.Annots();if(o)for(var i=0;i{var i;o.d(e,{b:()=>i}),function(t){t.Normal="Normal",t.Multiply="Multiply",t.Screen="Screen",t.Overlay="Overlay",t.Darken="Darken",t.Lighten="Lighten",t.ColorDodge="ColorDodge",t.ColorBurn="ColorBurn",t.HardLight="HardLight",t.SoftLight="SoftLight",t.Difference="Difference",t.Exclusion="Exclusion"}(i||(i={}))},5893:(t,e,o)=>{var i;o.d(e,{E:()=>i}),function(t){t.Courier="Courier",t.CourierBold="Courier-Bold",t.CourierOblique="Courier-Oblique",t.CourierBoldOblique="Courier-BoldOblique",t.Helvetica="Helvetica",t.HelveticaBold="Helvetica-Bold",t.HelveticaOblique="Helvetica-Oblique",t.HelveticaBoldOblique="Helvetica-BoldOblique",t.TimesRoman="Times-Roman",t.TimesRomanBold="Times-Bold",t.TimesRomanItalic="Times-Italic",t.TimesRomanBoldItalic="Times-BoldItalic",t.Symbol="Symbol",t.ZapfDingbats="ZapfDingbats"}(i||(i={}))}}]);