@syncfusion/ej2-pdf-export 27.2.2 → 28.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-pdf-export.min.js +3 -3
- package/dist/ej2-pdf-export.umd.min.js +3 -3
- package/dist/ej2-pdf-export.umd.min.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es2015.js +15 -2
- package/dist/es6/ej2-pdf-export.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es5.js +15 -2
- package/dist/es6/ej2-pdf-export.es5.js.map +1 -1
- package/dist/global/ej2-pdf-export.min.js +3 -3
- package/dist/global/ej2-pdf-export.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +7 -7
- package/src/implementation/annotations/pdf-text-web-link.js +3 -0
- package/src/implementation/graphics/figures/base/text-layouter.js +9 -1
- package/src/implementation/graphics/figures/text-element.d.ts +1 -0
- package/src/implementation/graphics/figures/text-element.js +4 -0
- package/src/implementation/graphics/pdf-graphics.js +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-pdf-export.umd.min.js
|
|
3
|
-
* version :
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 -
|
|
3
|
+
* version : 28.1.38
|
|
4
|
+
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-compression"),require("@syncfusion/ej2-file-utils")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-compression","@syncfusion/ej2-file-utils"],e):e((t=t||self).ej={},t.ej2Compression,t.ej2FileUtils)}(this,function(Y,V,R){"use strict";function M(t){return"[object String]"===Object.prototype.toString.call(t)?"$s"+t:"$o"+t.toString()}D.prototype.getValue=function(t){t=this.table["$"+this.toStr(t)];if(void 0!==t)return t.value},D.prototype.setValue=function(t,e){var i="$"+this.toStr(t);this.table[i];this.nElements++,this.table[i]={key:t,value:e}},D.prototype.remove=function(t){var t="$"+this.toStr(t),e=this.table[t];return delete this.table[t],this.nElements--,e.value},D.prototype.keys=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.key)}return t},D.prototype.values=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.value)}return t},D.prototype.containsKey=function(t){return!(void 0===this.getValue(t))},D.prototype.clear=function(){this.table={},this.nElements=0},D.prototype.size=function(){return this.nElements};var a=D;function D(t){this.table={},this.nElements=0,this.toStr=t||M}Object.defineProperty(A.prototype,"status",{get:function(){return this.status6},set:function(t){this.status6=t},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"isSaving",{get:function(){return this.isSaving6},set:function(t){this.isSaving6=t},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"objectCollectionIndex",{get:function(){return this.index6},set:function(t){this.index6=t},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"position",{get:function(){return this.position6},set:function(t){this.position6=t},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"value",{get:function(){return this.internalValue},set:function(t){var e=t;null!==t&&0<t.length?this.internalValue=this.normalizeValue(e=t):this.internalValue=e},enumerable:!0,configurable:!0}),A.prototype.save=function(t){t.write(this.toString())},A.prototype.toString=function(){return this.stringStartMark+this.escapeString(this.value)},A.prototype.clone=function(t){var e=new A;return e.value=this.internalValue,e},A.prototype.escapeString=function(t){for(var e="",i=0,r=t.length;i<r;i++){var n=t[i];A.delimiters.indexOf(n);e+=n}return e},A.prototype.normalizeValue=function(t,e){return t},A.delimiters="()<>[]{}/%}",A.replacements=[" ","\t","\n","\r"];var o=A;function A(t){this.stringStartMark="/",this.internalValue="",this.isSaving6=!1,this.position6=-1,this.internalValue=this.normalizeValue(t)}t.obj="obj",t.endObj="endobj",t.r="R",t.whiteSpace=" ",t.slash="/",t.newLine="\r\n",t.stream="stream",t.endStream="endstream",t.xref="xref",t.f="f",t.n="n",t.trailer="trailer",t.startxref="startxref",t.eof="%%EOF",t.header="%PDF-1.5",t.beginText="BT",t.endText="ET",t.beginPath="m",t.appendLineSegment="l",t.stroke="S",t.fill="f",t.fillEvenOdd="f*",t.fillStroke="B",t.fillStrokeEvenOdd="B*",t.appendbeziercurve="c",t.appendRectangle="re",t.saveState="q",t.restoreState="Q",t.paintXObject="Do",t.modifyCtm="cm",t.modifyTM="Tm",t.setLineWidth="w",t.setLineCapStyle="J",t.setLineJoinStyle="j",t.setDashPattern="d",t.setFlatnessTolerance="i",t.closePath="h",t.closeStrokePath="s",t.closeFillStrokePath="b",t.setCharacterSpace="Tc",t.setWordSpace="Tw",t.setHorizontalScaling="Tz",t.setTextLeading="TL",t.setFont="Tf",t.setRenderingMode="Tr",t.setTextRise="Ts",t.setTextScaling="Tz",t.setCoords="Td",t.goToNextLine="T*",t.setText="Tj",t.setTextWithFormatting="TJ",t.setTextOnNewLine="'",t.selectcolorspaceforstroking="CS",t.selectcolorspacefornonstroking="cs",t.setrbgcolorforstroking="RG",t.setrbgcolorfornonstroking="rg",t.setcmykcolorforstroking="K",t.setcmykcolorfornonstroking="k",t.setgraycolorforstroking="G",t.setgraycolorfornonstroking="g",t.clipPath="W",t.clipPathEvenOdd="W*",t.endPath="n",t.setGraphicsState="gs",t.comment="%",t.evenOdd="*",t.setMiterLimit="M",t.setColorAndPattern="scn",t.setColorAndPatternStroking="SCN";var h=t;function t(){this.forTest="test",this.forTest=t.obj}var l=function(){this.pages="Pages",this.kids="Kids",this.count="Count",this.resources="Resources",this.type="Type",this.size="Size",this.mediaBox="MediaBox",this.parent="Parent",this.root="Root",this.decodeParms="DecodeParms",this.filter="Filter",this.font="Font",this.type1="Type1",this.baseFont="BaseFont",this.encoding="Encoding",this.subtype="Subtype",this.contents="Contents",this.procset="ProcSet",this.colorSpace="ColorSpace",this.extGState="ExtGState",this.pattern="Pattern",this.xObject="XObject",this.length="Length",this.width="Width",this.height="Height",this.bitsPerComponent="BitsPerComponent",this.image="Image",this.dctdecode="DCTDecode",this.columns="Columns",this.blackIs1="BlackIs1",this.k="K",this.s="S",this.predictor="Predictor",this.deviceRgb="DeviceRGB",this.next="Next",this.action="Action",this.link="Link",this.a="A",this.annot="Annot",this.p="P",this.c="C",this.rect="Rect",this.uri="URI",this.annots="Annots",this.ca="ca",this.CA="CA",this.xyz="XYZ",this.fit="Fit",this.dest="Dest",this.BM="BM",this.flatedecode="FlateDecode",this.rotate="Rotate",this.bBox="BBox",this.form="Form",this.w="W",this.cIDFontType2="CIDFontType2",this.cIDToGIDMap="CIDToGIDMap",this.identity="Identity",this.dw="DW",this.fontDescriptor="FontDescriptor",this.cIDSystemInfo="CIDSystemInfo",this.fontName="FontName",this.flags="Flags",this.fontBBox="FontBBox",this.missingWidth="MissingWidth",this.stemV="StemV",this.italicAngle="ItalicAngle",this.capHeight="CapHeight",this.ascent="Ascent",this.descent="Descent",this.leading="Leading",this.avgWidth="AvgWidth",this.fontFile2="FontFile2",this.maxWidth="MaxWidth",this.xHeight="XHeight",this.stemH="StemH",this.registry="Registry",this.ordering="Ordering",this.supplement="Supplement",this.type0="Type0",this.identityH="Identity-H",this.toUnicode="ToUnicode",this.descendantFonts="DescendantFonts",this.background="Background",this.shading="Shading",this.matrix="Matrix",this.antiAlias="AntiAlias",this.function="Function",this.extend="Extend",this.shadingType="ShadingType",this.coords="Coords",this.domain="Domain",this.range="Range",this.functionType="FunctionType",this.bitsPerSample="BitsPerSample",this.patternType="PatternType",this.paintType="PaintType",this.tilingType="TilingType",this.xStep="XStep",this.yStep="YStep",this.viewerPreferences="ViewerPreferences",this.centerWindow="CenterWindow",this.displayTitle="DisplayTitle",this.fitWindow="FitWindow",this.hideMenuBar="HideMenubar",this.hideToolBar="HideToolbar",this.hideWindowUI="HideWindowUI",this.pageMode="PageMode",this.pageLayout="PageLayout",this.duplex="Duplex",this.printScaling="PrintScaling"},c=(Object.defineProperty(e.prototype,"items",{get:function(){return this.primitiveItems},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.status7},set:function(t){this.status7=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSaving",{get:function(){return this.isSaving7},set:function(t){this.isSaving7=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objectCollectionIndex",{get:function(){return this.index7},set:function(t){this.index7=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clonedObject",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.position7},set:function(t){this.position7=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Count",{get:function(){return this.primitiveItems.size()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Dictionary",{get:function(){return this},enumerable:!0,configurable:!0}),e.prototype.getArchive=function(){return this.archive},e.prototype.setArchive=function(t){this.archive=t},e.prototype.setEncrypt=function(t){this.encrypt=t,this.modify()},e.prototype.getEncrypt=function(){return this.encrypt},e.prototype.freezeChanges=function(t){this.bChanged=!1},e.prototype.clone=function(t){return new e},e.prototype.modify=function(){this.bChanged=!0},e.prototype.remove=function(t){"string"!=typeof t?(this.primitiveItems.remove(t.value),this.modify()):this.remove(new o(t))},e.prototype.containsKey=function(t){return this.primitiveItems.containsKey(t.toString())},e.prototype.onBeginSave=function(){this.beginSave.sender.beginSave()},e.prototype.onFontDictionaryBeginSave=function(){this.fontDictionaryBeginSave.sender.fontDictionaryBeginSave()},e.prototype.onDescendantFontBeginSave=function(){this.descendantFontBeginSave.sender.descendantFontBeginSave()},e.prototype.onTemplateBeginSave=function(){this.pageBeginDrawTemplate.sender.pageBeginSave()},e.prototype.onBeginAnnotationSave=function(){this.annotationBeginSave.sender.beginSave()},e.prototype.onSectionBeginSave=function(t){var e=this.sectionBeginSave;e.sender.beginSave(e.state,t)},e.prototype.save=function(t,e){void 0===e?this.save(t,!0):(t.write(this.prefix),void 0!==this.beginSave&&this.onBeginSave(),void 0!==this.descendantFontBeginSave&&this.onDescendantFontBeginSave(),void 0!==this.fontDictionaryBeginSave&&this.onFontDictionaryBeginSave(),void 0!==this.annotationBeginSave&&this.onBeginAnnotationSave(),void 0!==this.sectionBeginSave&&this.onSectionBeginSave(t),void 0!==this.pageBeginDrawTemplate&&this.onTemplateBeginSave(),0<this.Count&&this.saveItems(t),t.write(this.suffix),t.write(h.newLine))},e.prototype.saveItems=function(t){t.write(h.newLine);for(var e=this.primitiveItems.keys(),i=this.primitiveItems.values(),r=0;r<e.length;r++){var n=e[r];new o(n).save(t),t.write(h.whiteSpace),i[r].save(t),t.write(h.newLine)}},e);function e(t){if(this.position7=-1,this.primitiveItems=new a,this.prefix="<<",this.suffix=">>",this.resources=[],this.object=null,this.archive=!0,this.isResource=!1,void 0===t)this.primitiveItems=new a;else{this.primitiveItems=new a;for(var e=t.items.keys(),i=t.items.values(),r=0;r<t.items.size();r++)this.primitiveItems.setValue(e[r],i[r]);this.status=t.status,this.freezeChanges(this)}this.encrypt=!0,this.dictionaryProperties=new l}var N=function(t){this.sender=t},I=function(t){this.sender=t},F=function(t){this.sender=t},E=function(t){this.sender=t},G=function(t,e){this.sender=t,this.state=e},z=function(t){this.sender=t},u=(Object.defineProperty(W.prototype,"intValue",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"isInteger",{get:function(){return this.integer},set:function(t){this.integer=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"status",{get:function(){return this.status5},set:function(t){this.status5=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"isSaving",{get:function(){return this.isSaving5},set:function(t){this.isSaving5=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"objectCollectionIndex",{get:function(){return this.index5},set:function(t){this.index5=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"position",{get:function(){return this.position5},set:function(t){this.position5=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),W.prototype.save=function(t){t.write(this.intValue.toString())},W.prototype.clone=function(t){return new W(this.value)},W.floatToString=function(t){t=t.toFixed(2);return t="0.00"===t?".00":t},W.min=function(t,e,i){t=Math.min(t,e);return Math.min(i,t)},W);function W(t){this.position5=-1,this.value=t}s.prototype.items=function(t){return this.internalElements[t]},Object.defineProperty(s.prototype,"count",{get:function(){return this.internalElements.length},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"status",{get:function(){return this.status9},set:function(t){this.status9=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isSaving",{get:function(){return this.isSaving9},set:function(t){this.isSaving9=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"clonedObject",{get:function(){return this.clonedObject9},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"position",{get:function(){return this.position9},set:function(t){this.position9=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"objectCollectionIndex",{get:function(){return this.index9},set:function(t){this.index9=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"CrossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"elements",{get:function(){return this.internalElements},enumerable:!0,configurable:!0}),s.prototype.add=function(t){void 0===this.internalElements&&(this.internalElements=[]),this.internalElements.push(t),this.markedChange()},s.prototype.markedChange=function(){this.bChanged=!0},s.prototype.contains=function(t){for(var e=0;e<this.internalElements.length;e++){var i=this.internalElements[e],r=t;if(null!=i&&void 0!==i&&null!=r&&void 0!==r&&i.value===r.value)return!0}return!1},s.prototype.getItems=function(t){return this.internalElements[t]},s.prototype.save=function(t){t.write(this.startMark);for(var e=0,i=this.count;e<i;e++)this.getItems(e).save(t),e+1!==i&&t.write(h.whiteSpace);t.write(this.endMark)},s.prototype.clone=function(t){this.clonedObject9=null;for(var e=new s,i=0;i<this.internalElements.length;i++){var r=this.internalElements[i];e.add(r.clone(t))}return e.pdfCrossTable=t,this.clonedObject9=e},s.fromRectangle=function(t){return new s([t.x,t.y,t.width,t.height])},s.prototype.insert=function(t,e){if(t<this.internalElements.length&&0<t){for(var i=[],r=0;r<t;r++)i.push(this.internalElements[r]);i.push(e);for(r=t;r<this.internalElements.length;r++)i.push(this.internalElements[r]);this.internalElements=i}else this.internalElements.push(e);this.markChanged()},s.prototype.indexOf=function(t){return this.internalElements.indexOf(t)},s.prototype.remove=function(t){t=this.internalElements.indexOf(t);this.internalElements[t]=null,this.markChanged()},s.prototype.removeAt=function(t){if(this.internalElements.length>t){for(var e=[],i=0;i<t;i++)e.push(this.internalElements[i]);for(i=t+1;i<this.internalElements.length;i++)e.push(this.internalElements[i]);this.internalElements=e}this.markChanged()},s.prototype.clear=function(){this.internalElements=[],this.markChanged()},s.prototype.markChanged=function(){this.bChanged=!0};var p=s;function s(t){if(this.startMark="[",this.endMark="]",this.position9=-1,this.clonedObject9=null,this.isFont=!1,void 0===t)this.internalElements=[];else if(void 0===t||t instanceof s){var e=t;this.internalElements=[];for(r=0;r<e.elements.length;r++)this.internalElements.push(e.elements[r])}else for(var i=t,r=0;r<i.length;r++){var n=new u(i[r]);this.add(n)}}_=function(t,e){return(_=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(K,H=c),Object.defineProperty(K.prototype,"internalStream",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"compress",{get:function(){return this.bCompress},set:function(t){this.bCompress=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"data",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),K.prototype.clearStream=function(){this.internalStream=[],this.items.containsKey(this.dictionaryProperties.filter)&&this.remove(this.dictionaryProperties.filter),this.bCompress=!0,this.modify()},K.prototype.write=function(t){if(null==t)throw new Error("ArgumentNullException:text");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty string, text");this.dataStream2.push(t),this.modify()},K.prototype.writeBytes=function(t){if(null===t)throw new Error("ArgumentNullException:data");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty bytes, data");for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);this.dataStream2.push(e),this.modify()},K.prototype.onCmapBeginSave=function(){this.cmapBeginSave.sender.cmapBeginSave()},K.prototype.onFontProgramBeginSave=function(){this.fontProgramBeginSave.sender.fontProgramBeginSave()},K.prototype.compressContent=function(t,e){if(this.bCompress){for(var i=[],r=0;r<t.length;r++)i.push(t.charCodeAt(r));var n=new Uint8Array(i),o=new V.CompressedStreamWriter;o.write(n,0,n.length),o.close(),t=o.getCompressedString,this.addFilter(this.dictionaryProperties.flatedecode)}return t},K.prototype.addFilter=function(t){var e=this.items.getValue(this.dictionaryProperties.filter),i=e=e instanceof d?e.object:e;null!=e&&((i=new p).insert(0,e),this.items.setValue(this.dictionaryProperties.filter,i)),e=new o(t),null==i?this.items.setValue(this.dictionaryProperties.filter,e):i.insert(0,e)},K.prototype.save=function(t){void 0!==this.cmapBeginSave&&this.onCmapBeginSave(),void 0!==this.fontProgramBeginSave&&this.onFontProgramBeginSave();for(var e="",i=0;i<this.data.length;i++)e+=this.data[i];1<e.length&&!this.isResource&&(e="q\r\n"+e+"Q\r\n");var r=(e=this.compressContent(e,t)).length;this.items.setValue(this.dictionaryProperties.length,new u(r)),H.prototype.save.call(this,t,!1),t.write(this.dicPrefix),t.write(h.newLine),0<e.length&&t.write(e),t.write(h.newLine),t.write(this.dicSuffix),t.write(h.newLine)},K.bytesToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e};var _,H,U=K;function K(t,e){var i=H.call(this,t)||this;return i.dicPrefix="stream",i.dicSuffix="endstream",i.clonedObject2=null,i.bCompress=!0,void 0!==t||void 0!==e?(i.dataStream2=[],i.dataStream2=e,i.bCompress2=!1):(i.dataStream2=[],i.bCompress2=!0),i}var q=function(t){this.sender=t},Q=function(t){this.sender=t},tt=((nt=(nt=Y.InternalEnum||(Y.InternalEnum={})).ForceEncoding||(nt.ForceEncoding={}))[nt.None=0]="None",nt[nt.Ascii=1]="Ascii",nt[nt.Unicode=2]="Unicode",Object.defineProperty(r.prototype,"hex",{get:function(){return this.bHex},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"value",{get:function(){return this.stringValue},set:function(t){this.stringValue=t,this.data=null},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"status",{get:function(){return this.status1},set:function(t){this.status1=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isSaving",{get:function(){return this.isSaving1},set:function(t){this.isSaving1=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"objectCollectionIndex",{get:function(){return this.index1},set:function(t){this.index1=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"clonedObject",{get:function(){return this.clonedObject1},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"position",{get:function(){return this.position1},set:function(t){this.position1=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"CrossTable",{get:function(){return this.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"converted",{get:function(){return this.bConverted},set:function(t){this.bConverted=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"encode",{get:function(){return this.bForceEncoding},set:function(t){this.bForceEncoding=t},enumerable:!0,configurable:!0}),r.bytesToHex=function(t){return null!=t&&0,""},r.prototype.save=function(t){if(null===t)throw new Error("ArgumentNullException : writer");void 0!==this.encode&&this.encode===Y.InternalEnum.ForceEncoding.Ascii?t.write(this.pdfEncode()):t.write(r.stringMark[0]+this.value+r.stringMark[1])},r.prototype.pdfEncode=function(){var t="";if(void 0!==this.encode&&this.encode===Y.InternalEnum.ForceEncoding.Ascii){for(var e=this.escapeSymbols(this.value),i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);t=r.stringMark[0]+t+r.stringMark[1]}else t=this.value;return t},r.prototype.escapeSymbols=function(t){for(var e=[],i=0;i<t.length;i++){var r=t.charCodeAt(i);switch(r){case 40:case 41:e.push(92),e.push(r);break;case 13:e.push(92),e.push(114);break;case 92:e.push(92),e.push(r);break;default:e.push(r)}}return e},r.prototype.clone=function(t){if(null!==this.clonedObject1&&this.clonedObject1.CrossTable===t)return this.clonedObject1;this.clonedObject1=null;var e=new r(this.stringValue);return e.bHex=this.bHex,e.crossTable=t,e.isColorSpace=this.isColorSpace,this.clonedObject1=e},r.toUnicodeArray=function(t,e){if(null==t)throw new Error("Argument Null Exception : value");for(var i=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);i.push(n/256>>>0),i.push(255&n)}return i},r.byteToString=function(t){if(null==t)throw new Error("Argument Null Exception : stream");for(var e="",i=0;i<t.length;++i)e+=String.fromCharCode(t[i]);return e},r.stringMark="()",r.hexStringMark="<>",r.hexFormatPattern="{0:X2}",r);function r(t){if(this.bHex=!1,this.position1=-1,this.clonedObject1=null,this.bDecrypted=!1,this.isParentDecrypted=!1,this.isPacked=!1,this.isFormField=!1,this.isColorSpace=!1,this.isHexString=!0,void 0===t)this.bHex=!1;else if(!(0<t.length&&"0xfeff"===t[0])){this.stringValue=t,this.data=[];for(var e=0;e<t.length;++e)this.data.push(t.charCodeAt(e))}}Object.defineProperty(it.prototype,"status",{get:function(){return this.status3},set:function(t){this.status3=t},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"isSaving",{get:function(){return this.isSaving3},set:function(t){this.isSaving3=t},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"objectCollectionIndex",{get:function(){return this.index3},set:function(t){this.index3=t},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"position",{get:function(){return this.position3},set:function(t){this.position3=t},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),it.prototype.save=function(t){t.write(this.toString())},it.prototype.toString=function(){return this.objNumber.toString()+" "+this.genNumber.toString()+" R"},it.prototype.clone=function(t){return null};var et=it;function it(t,e){this.index3=-1,this.position3=-1,this.objNumber=0,this.genNumber=0,"number"==typeof t&&"number"==typeof e?(this.objNumber=t,this.genNumber=e):(this.objNumber=Number(t),this.genNumber=Number(e))}Object.defineProperty(rt.prototype,"status",{get:function(){return this.status4},set:function(t){this.status4=t},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"isSaving",{get:function(){return this.isSaving4},set:function(t){this.isSaving4=t},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"objectCollectionIndex",{get:function(){return this.index4},set:function(t){this.index4=t},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"position",{get:function(){return this.position4},set:function(t){this.position4=t},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"object",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"index",{get:function(){return this.objectIndex},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"element",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),rt.prototype.initialize=function(t){t instanceof p||t instanceof c||t instanceof o||t instanceof u||t instanceof U||t instanceof et||t instanceof tt?this.primitiveObject=t:this.initialize(t.element)},rt.prototype.save=function(t){t.position;var e=t.document.crossTable;this.object.isSaving=!0;e.getReference(this.object).save(t)},rt.prototype.clone=function(t){return null};var d=rt;function rt(t,e){this.index4=-1,this.position4=-1,this.objectIndex=-1,this.dictionaryProperties=new l,this.initialize(t)}Object.defineProperty(ot.prototype,"next",{get:function(){return this.action},set:function(t){this.action=t,this.dictionary.items.setValue(this.dictionaryProperties.next,new d(this.action))},enumerable:!0,configurable:!0}),Object.defineProperty(ot.prototype,"dictionary",{get:function(){return void 0===this.pdfDictionary&&(this.pdfDictionary=new c),this.pdfDictionary},enumerable:!0,configurable:!0}),ot.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.action))},Object.defineProperty(ot.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0});var nt=ot;function ot(){this.action=null,this.dictionaryProperties=new l,this.initialize()}st=function(t,e){return(st=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}st(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(lt,at=nt),Object.defineProperty(lt.prototype,"uri",{get:function(){return this.uniformResourceIdentifier},set:function(t){this.uniformResourceIdentifier=t,this.dictionary.items.setValue(this.dictionaryProperties.uri,new tt(this.uniformResourceIdentifier))},enumerable:!0,configurable:!0}),lt.prototype.initialize=function(){at.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.s,new o(this.dictionaryProperties.uri))};var st,at,ht=lt;function lt(t){var e=at.call(this)||this;return e.uniformResourceIdentifier="",e}(i=Y.PdfHorizontalAlignment||(Y.PdfHorizontalAlignment={}))[i.Left=0]="Left",i[i.Center=1]="Center",i[i.Right=2]="Right",(i=Y.PdfVerticalAlignment||(Y.PdfVerticalAlignment={}))[i.Top=0]="Top",i[i.Middle=1]="Middle",i[i.Bottom=2]="Bottom",(i=Y.PdfTextAlignment||(Y.PdfTextAlignment={}))[i.Left=0]="Left",i[i.Center=1]="Center",i[i.Right=2]="Right",i[i.Justify=3]="Justify",(i=Y.TextRenderingMode||(Y.TextRenderingMode={}))[i.Fill=0]="Fill",i[i.Stroke=1]="Stroke",i[i.FillStroke=2]="FillStroke",i[i.None=3]="None",i[i.ClipFlag=4]="ClipFlag",i[i.ClipFill=4]="ClipFill",i[i.ClipStroke=5]="ClipStroke",i[i.ClipFillStroke=6]="ClipFillStroke",i[i.Clip=7]="Clip",(i=Y.PdfLineJoin||(Y.PdfLineJoin={}))[i.Miter=0]="Miter",i[i.Round=1]="Round",i[i.Bevel=2]="Bevel",(i=Y.PdfLineCap||(Y.PdfLineCap={}))[i.Flat=0]="Flat",i[i.Round=1]="Round",i[i.Square=2]="Square",(i=Y.PdfDashStyle||(Y.PdfDashStyle={}))[i.Solid=0]="Solid",i[i.Dash=1]="Dash",i[i.Dot=2]="Dot",i[i.DashDot=3]="DashDot",i[i.DashDotDot=4]="DashDotDot",i[i.Custom=5]="Custom",(i=Y.PdfFillMode||(Y.PdfFillMode={}))[i.Winding=0]="Winding",i[i.Alternate=1]="Alternate",(i=Y.PdfColorSpace||(Y.PdfColorSpace={}))[i.Rgb=0]="Rgb",i[i.Cmyk=1]="Cmyk",i[i.GrayScale=2]="GrayScale",i[i.Indexed=3]="Indexed",(i=Y.PdfBlendMode||(Y.PdfBlendMode={}))[i.Normal=0]="Normal",i[i.Multiply=1]="Multiply",i[i.Screen=2]="Screen",i[i.Overlay=3]="Overlay",i[i.Darken=4]="Darken",i[i.Lighten=5]="Lighten",i[i.ColorDodge=6]="ColorDodge",i[i.ColorBurn=7]="ColorBurn",i[i.HardLight=8]="HardLight",i[i.SoftLight=9]="SoftLight",i[i.Difference=10]="Difference",i[i.Exclusion=11]="Exclusion",i[i.Hue=12]="Hue",i[i.Saturation=13]="Saturation",i[i.Color=14]="Color",i[i.Luminosity=15]="Luminosity",(i=Y.PdfGraphicsUnit||(Y.PdfGraphicsUnit={}))[i.Centimeter=0]="Centimeter",i[i.Pica=1]="Pica",i[i.Pixel=2]="Pixel",i[i.Point=3]="Point",i[i.Inch=4]="Inch",i[i.Document=5]="Document",i[i.Millimeter=6]="Millimeter",(i=Y.PdfGridImagePosition||(Y.PdfGridImagePosition={}))[i.Fit=0]="Fit",i[i.Center=1]="Center",i[i.Stretch=2]="Stretch",i[i.Tile=3]="Tile",(i=Y.PdfTextDirection||(Y.PdfTextDirection={}))[i.None=0]="None",i[i.LeftToRight=1]="LeftToRight",i[i.RightToLeft=2]="RightToLeft";g.prototype.assignRGB=function(t,e,i,r){void 0===t||void 0===e||void 0===i?this.filled=!1:(this.cyanColor=0,this.magentaColor=0,this.yellowColor=0,this.blackColor=0,this.grayColor=0,this.redColor=t,this.greenColor=e,this.blueColor=i,this.alpha=void 0===r?g.maxColourChannelValue:r,this.filled=!0,this.assignCMYK(t,e,i))},g.prototype.assignCMYK=function(t,e,i){var t=t/g.maxColourChannelValue,e=e/g.maxColourChannelValue,i=i/g.maxColourChannelValue,r=u.min(1-t,1-e,1-i),t=1===r?0:(1-t-r)/(1-r),e=1===r?0:(1-e-r)/(1-r),i=1===r?0:(1-i-r)/(1-r);this.blackColor=r,this.cyanColor=t,this.magentaColor=e,this.yellowColor=i},Object.defineProperty(g.prototype,"r",{get:function(){return this.redColor},set:function(t){this.redColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"red",{get:function(){return this.r/g.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"b",{get:function(){return this.blueColor},set:function(t){this.blueColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"blue",{get:function(){return this.b/g.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"c",{get:function(){return this.cyanColor},set:function(t){this.cyanColor=t<0?0:1<t?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"k",{get:function(){return this.blackColor},set:function(t){this.blackColor=t<0?0:1<t?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"m",{get:function(){return this.magentaColor},set:function(t){this.magentaColor=t<0?0:1<t?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"y",{get:function(){return this.yellowColor},set:function(t){this.yellowColor=t<0?0:1<t?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"g",{get:function(){return this.greenColor},set:function(t){this.greenColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"green",{get:function(){return this.g/g.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"gray",{get:function(){return(this.redColor+this.greenColor+this.blueColor)/(3*g.maxColourChannelValue)},set:function(t){this.grayColor=t<0?0:1<t?1:t,this.r=this.grayColor*g.maxColourChannelValue,this.g=this.grayColor*g.maxColourChannelValue,this.b=this.grayColor*g.maxColourChannelValue,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"isEmpty",{get:function(){return!this.filled},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"a",{get:function(){return this.alpha},set:function(t){this.alpha=t<0?0:t,this.filled=!0},enumerable:!0,configurable:!0}),g.prototype.toString=function(t,e){if(this.isEmpty)return"";var i="";switch(t){case Y.PdfColorSpace.Rgb:i=this.rgbToString(e);break;case Y.PdfColorSpace.GrayScale:i=this.grayScaleToString(e);break;case Y.PdfColorSpace.Cmyk:i=this.cmykToString(e)}return i},g.prototype.grayScaleToString=function(t){var e=this.gray,i="",r=null;return null==(r=t?g.grayStringsSroke.containsKey(e)?g.grayStringsSroke.getValue(e):null:g.grayStringsFill.containsKey(e)?g.grayStringsFill.getValue(e):null)?t&&(i=e.toString()+" G",g.grayStringsSroke.setValue(e,i)):i=r.toString(),i+h.newLine},g.prototype.rgbToString=function(t){var e=this.r,i=this.g,r=this.b,n=(e<<16)+(i<<8)+r,o=(t&&(n+=1<<24),""),s=null;return null==(s=g.rgbStrings.containsKey(n)?g.rgbStrings.getValue(n):s)?(e=e/g.maxColourChannelValue,i=i/g.maxColourChannelValue,r=r/g.maxColourChannelValue,o=t?e.toString()+" "+i.toString()+" "+r.toString()+" RG":e.toString()+" "+i.toString()+" "+r.toString()+" rg",g.rgbStrings.setValue(n,o)):o=s.toString(),o+h.newLine},g.prototype.cmykToString=function(t){var e=this.c,i=this.m,r=this.y,n=this.b;return e.toString()+" "+i.toString()+" "+r.toString()+" "+n.toString()+" K"+h.newLine},g.prototype.toArray=function(t){var e=new p;return t===Y.PdfColorSpace.Rgb&&(e.add(new u(this.red)),e.add(new u(this.green)),e.add(new u(this.blue))),e},g.rgbStrings=new a,g.grayStringsSroke=new a,g.grayStringsFill=new a,g.maxColourChannelValue=255;var f=g;function g(t,e,i,r){void 0===t?void 0!==e&&void 0!==i&&void 0!==r?this.assignRGB(e,i,r):this.filled=!1:t instanceof g?(this.redColor=t.r,this.greenColor=t.g,this.blueColor=t.b,this.grayColor=t.gray,this.alpha=t.alpha,this.filled=0!==this.alpha):"number"==typeof t&&void 0===e&&void 0===i&&void 0===r?(this.redColor=(t=1<(t=t<0?0:t)?1:t)*g.maxColourChannelValue,this.greenColor=t*g.maxColourChannelValue,this.blueColor=t*g.maxColourChannelValue,this.cyanColor=t,this.magentaColor=t,this.yellowColor=t,this.blackColor=t,this.grayColor=t,this.alpha=g.maxColourChannelValue,this.filled=!0):void 0===r?this.assignRGB(t,e,i):this.assignRGB(e,i,r,t)}var X=function(t,e){void 0===t?(this.x=0,this.y=0):(this.x=null!==t?t:0,this.y=null!==e?e:0)},J=function(t,e){void 0===e?(this.height=0,this.width=0):(this.height=null!==e?e:0,this.width=null!==t?t:0)},Z=function(t,e,i,r){var n;typeof t==typeof t&&void 0===t?(this.x=0,this.y=0,this.height=0,this.width=0):t instanceof X&&e instanceof J&&void 0===i?(this.x=(n=t).x,this.y=n.y,this.height=(n=e).height,this.width=n.width):(n=e,e=i,i=r,this.x=t,this.y=n,this.height=i,this.width=e)},ut=(Object.defineProperty(ct.prototype,"width",{get:function(){return this.right-this.left},enumerable:!0,configurable:!0}),Object.defineProperty(ct.prototype,"height",{get:function(){return this.bottom-this.top},enumerable:!0,configurable:!0}),Object.defineProperty(ct.prototype,"topLeft",{get:function(){return new X(this.left,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(ct.prototype,"size",{get:function(){return new J(this.width,this.height)},enumerable:!0,configurable:!0}),ct.prototype.toString=function(){return this.topLeft+"x"+this.size},ct);function ct(t,e,i,r){this.left=t,this.top=e,this.right=i,this.bottom=r}dt.prototype.clone=function(){return this};var pt=dt;function dt(){}ft=function(t,e){return(ft=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}ft(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(yt,gt=pt),Object.defineProperty(yt.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),yt.prototype.monitorChanges=function(t,e,i,r,n){if(null==e)throw new Error("ArgumentNullException:streamWriter");var o=!1;return e.setColorAndSpace(this.pdfColor,n,!(o=!0)),o},yt.prototype.resetChanges=function(t){t.setColorAndSpace(new f(0,0,0),Y.PdfColorSpace.Rgb,!1)};var ft,gt,mt=yt;function yt(t){var e=gt.call(this)||this;return e.pdfColor=t,e}(i=Y.PdfFontStyle||(Y.PdfFontStyle={}))[i.Regular=0]="Regular",i[i.Bold=1]="Bold",i[i.Italic=2]="Italic",i[i.Underline=4]="Underline",i[i.Strikeout=8]="Strikeout",(i=Y.PdfFontFamily||(Y.PdfFontFamily={}))[i.Helvetica=0]="Helvetica",i[i.Courier=1]="Courier",i[i.TimesRoman=2]="TimesRoman",i[i.Symbol=3]="Symbol",i[i.ZapfDingbats=4]="ZapfDingbats",(i=Y.PdfFontType||(Y.PdfFontType={}))[i.Standard=0]="Standard",i[i.TrueType=1]="TrueType",i[i.TrueTypeEmbedded=2]="TrueTypeEmbedded",(i=Y.PdfWordWrapType||(Y.PdfWordWrapType={}))[i.None=0]="None",i[i.Word=1]="Word",i[i.WordOnly=2]="WordOnly",i[i.Character=3]="Character",(i=Y.PdfSubSuperScript||(Y.PdfSubSuperScript={}))[i.None=0]="None",i[i.SuperScript=1]="SuperScript",i[i.SubScript=2]="SubScript",(i=Y.FontEncoding||(Y.FontEncoding={}))[i.Unknown=0]="Unknown",i[i.StandardEncoding=1]="StandardEncoding",i[i.MacRomanEncoding=2]="MacRomanEncoding",i[i.MacExpertEncoding=3]="MacExpertEncoding",i[i.WinAnsiEncoding=4]="WinAnsiEncoding",i[i.PdfDocEncoding=5]="PdfDocEncoding",i[i.IdentityH=6]="IdentityH",(i=Y.TtfCmapFormat||(Y.TtfCmapFormat={}))[i.Apple=0]="Apple",i[i.Microsoft=4]="Microsoft",i[i.Trimmed=6]="Trimmed",(i=Y.TtfCmapEncoding||(Y.TtfCmapEncoding={}))[i.Unknown=0]="Unknown",i[i.Symbol=1]="Symbol",i[i.Unicode=2]="Unicode",i[i.Macintosh=3]="Macintosh",(i=Y.TtfPlatformID||(Y.TtfPlatformID={}))[i.AppleUnicode=0]="AppleUnicode",i[i.Macintosh=1]="Macintosh",i[i.Iso=2]="Iso",i[i.Microsoft=3]="Microsoft",(i=Y.TtfMicrosoftEncodingID||(Y.TtfMicrosoftEncodingID={}))[i.Undefined=0]="Undefined",i[i.Unicode=1]="Unicode",(i=Y.TtfMacintoshEncodingID||(Y.TtfMacintoshEncodingID={}))[i.Roman=0]="Roman",i[i.Japanese=1]="Japanese",i[i.Chinese=2]="Chinese",(i=Y.FontDescriptorFlags||(Y.FontDescriptorFlags={}))[i.FixedPitch=1]="FixedPitch",i[i.Serif=2]="Serif",i[i.Symbolic=4]="Symbolic",i[i.Script=8]="Script",i[i.Nonsymbolic=32]="Nonsymbolic",i[i.Italic=64]="Italic",i[i.ForceBold=262144]="ForceBold",(i=Y.TtfCompositeGlyphFlags||(Y.TtfCompositeGlyphFlags={}))[i.Arg1And2AreWords=1]="Arg1And2AreWords",i[i.ArgsAreXyValues=2]="ArgsAreXyValues",i[i.RoundXyToGrid=4]="RoundXyToGrid",i[i.WeHaveScale=8]="WeHaveScale",i[i.Reserved=16]="Reserved",i[i.MoreComponents=32]="MoreComponents",i[i.WeHaveAnXyScale=64]="WeHaveAnXyScale",i[i.WeHaveTwoByTwo=128]="WeHaveTwoByTwo",i[i.WeHaveInstructions=256]="WeHaveInstructions",i[i.UseMyMetrics=512]="UseMyMetrics";Object.defineProperty(wt.prototype,"alignment",{get:function(){return this.textAlignment},set:function(t){this.textAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"textDirection",{get:function(){return this.direction},set:function(t){this.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"lineAlignment",{get:function(){return void 0===this.verticalAlignment||null==this.verticalAlignment?Y.PdfVerticalAlignment.Top:this.verticalAlignment},set:function(t){this.verticalAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"rightToLeft",{get:function(){return void 0!==this.isRightToLeft&&null!=this.isRightToLeft&&this.isRightToLeft},set:function(t){this.isRightToLeft=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"characterSpacing",{get:function(){return void 0===this.internalCharacterSpacing||null==this.internalCharacterSpacing?0:this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"wordSpacing",{get:function(){return void 0===this.internalWordSpacing||null==this.internalWordSpacing?0:this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"lineSpacing",{get:function(){return void 0===this.leading||null==this.leading?0:this.leading},set:function(t){this.leading=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"clipPath",{get:function(){return void 0!==this.clip&&null!=this.clip&&this.clip},set:function(t){this.clip=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"subSuperScript",{get:function(){return void 0===this.pdfSubSuperScript||null==this.pdfSubSuperScript?Y.PdfSubSuperScript.None:this.pdfSubSuperScript},set:function(t){this.pdfSubSuperScript=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"paragraphIndent",{get:function(){return void 0===this.internalParagraphIndent||null==this.internalParagraphIndent?0:this.internalParagraphIndent},set:function(t){this.internalParagraphIndent=t,this.firstLineIndent=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"lineLimit",{get:function(){return this.internalLineLimit},set:function(t){this.internalLineLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"measureTrailingSpaces",{get:function(){return void 0!==this.trailingSpaces&&null!=this.trailingSpaces&&this.trailingSpaces},set:function(t){this.trailingSpaces=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"noClip",{get:function(){return void 0!==this.isNoClip&&null!=this.isNoClip&&this.isNoClip},set:function(t){this.isNoClip=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"wordWrap",{get:function(){return this.wordWrapType},set:function(t){this.wordWrapType=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"horizontalScalingFactor",{get:function(){return this.scalingFactor},set:function(t){if(t<=0)throw new Error("ArgumentOutOfRangeException:The scaling factor cant be less of equal to zero, ScalingFactor");this.scalingFactor=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"firstLineIndent",{get:function(){return void 0===this.initialLineIndent||null==this.initialLineIndent?0:this.initialLineIndent},set:function(t){this.initialLineIndent=t},enumerable:!0,configurable:!0}),wt.prototype.clone=function(){return this};var bt=wt;function wt(t,e){this.scalingFactor=100,this.wordWrapType=Y.PdfWordWrapType.Word,this.internalLineLimit=!0,this.wordWrapType=Y.PdfWordWrapType.Word,void 0!==t&&"string"!=typeof t&&(this.textAlignment=t),void 0!==e&&(this.verticalAlignment=e)}Object.defineProperty(St.prototype,"length",{get:function(){return this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(St.prototype,"end",{get:function(){return this.currentPosition===this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(St.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),St.getCharsCount=function(t,e){if("string"==typeof e){if(null==t)throw new Error("ArgumentNullException:wholeText");for(var i=0,r=0;-1!==(r=t.indexOf(e,r));)i++,r++;return i}if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:symbols");for(var n=0,o=0,s=t.length;o<s;o++){var a=t[o];this.contains(e,a)&&n++}return n},St.prototype.readLine=function(){for(var t,e=this.currentPosition;e<this.length;){var i=this.text[e];switch(i){case"\r":case"\n":var r=this.text.substr(this.currentPosition,e-this.currentPosition);return this.currentPosition=e+1,"\r"===i&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,r}e++}return e>this.currentPosition?(t=this.text.substr(this.currentPosition,e-this.currentPosition),this.currentPosition=e,t):null},St.prototype.peekLine=function(){var t=this.currentPosition,e=this.readLine();return this.currentPosition=t,e},St.prototype.readWord=function(){for(var t,e=this.currentPosition;e<this.length;){var i=this.text[e];switch(i){case"\r":case"\n":var r=this.text.substr(this.currentPosition,e-this.currentPosition);return this.currentPosition=e+1,"\r"===i&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,r;case" ":case"\t":e===this.currentPosition&&e++;r=this.text.substr(this.currentPosition,e-this.currentPosition);return this.currentPosition=e,r}e++}return e>this.currentPosition?(t=this.text.substr(this.currentPosition,e-this.currentPosition),this.currentPosition=e,t):null},St.prototype.peekWord=function(){var t=this.currentPosition,e=this.readWord();return this.currentPosition=t,e},St.prototype.read=function(t){if(void 0===t)return e="0",this.end||(e=this.text[this.currentPosition],this.currentPosition++),e;for(var e,i=0,r="";!this.end&&i<t;)r+=e=this.read(),i++;return r},St.prototype.peek=function(){var t="0";return t=this.end?t:this.text[this.currentPosition]},St.prototype.close=function(){this.text=null},St.prototype.readToEnd=function(){var t=0===this.currentPosition?this.text:this.text.substr(this.currentPosition,this.length-this.currentPosition);return this.currentPosition=this.length,t},St.contains=function(t,e){for(var i=!1,r=0;r<t.length;r++)if(t[r]===e){i=!0;break}return i},St.spaces=[St.whiteSpace=" ",St.tab="\t"],St.whiteSpacePattern="^[ \t]+$";var Pt=St;function St(t){if(this.currentPosition=0,null==t)throw new Error("ArgumentNullException:text");this.text=t}Ct.prototype.layout=function(t,e,i,r,n,o,s){return s=(r instanceof Z?(this.initialize(t,e,i,r,n),this.isOverloadWithPosition=o,this.clientSize=s):(this.initialize(t,e,i,r),this.isOverloadWithPosition=n,this.clientSize=o),this.doLayout()),this.clear(),s},Ct.prototype.initialize=function(t,e,i,r,n){if("number"==typeof n){if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:font");this.text=t,this.font=e,this.format=i,this.size=new J(r.width,r.height),this.rectangle=r,this.pageHeight=n,this.reader=new Pt(t)}else this.initialize(t,e,i,new Z(new X(0,0),r),0)},Ct.prototype.clear=function(){this.font=null,this.format=null,this.reader.close(),this.reader=null,this.text=null},Ct.prototype.doLayout=function(){for(var t=new Bt,e=(new Bt,[]),i=this.reader.peekLine(),r=this.getLineIndent(!0);null!=i;){if(null!==(n=this.layoutLine(i,r))||void 0!==n){var n=this.copyToResult(t,n,e,0),o=n.success,n=n.numInserted;if(!o){this.reader.read(n);break}}this.reader.readLine(),i=this.reader.peekLine(),r=this.getLineIndent(!1)}return this.finalizeResult(t,e),t},Ct.prototype.getLineIndent=function(t){var e=0;return null!=this.format&&(e=t?this.format.firstLineIndent:this.format.paragraphIndent,e=0<this.size.width?Math.min(this.size.width,e):e),e},Ct.prototype.getLineHeight=function(){var t=this.font.height;return t=null!=this.format&&0!==this.format.lineSpacing?this.format.lineSpacing+this.font.height:t},Ct.prototype.getLineWidth=function(t){return this.font.getLineWidth(t,this.format)},Ct.prototype.layoutLine=function(t,e){var i=new Bt,r=(i.layoutLineHeight=this.getLineHeight(),[]),n=this.size.width,o=this.getLineWidth(t)+e,s=Y.LineType.FirstParagraphLine,a=!0;if(n<=0||Math.round(o)<=Math.round(n))this.addToLineResult(i,r,t,o,Y.LineType.NewLineBreak|s);else{var h="",l="",o=e,u=e,c=new Pt(t),p=c.peekWord();for(p.length!==c.length&&" "===p&&(l+=p,h+=p,c.position+=1,p=c.peekWord());null!=p;){l+=p;var d,f=this.getLineWidth(l.toString())+u;if(" "===l.toString()&&(l="",f=0),n<f){if(this.getWrapType()===Y.PdfWordWrapType.None)break;if(l.length===p.length){if(this.getWrapType()===Y.PdfWordWrapType.WordOnly){i.textRemainder=t.substring(c.position);break}if(1===l.length){h+=p;break}a=!1,l="",p=c.peek().toString()}else this.getLineWidth(p.toString())>n?this.format.wordWrap=Y.PdfWordWrapType.Character:void 0!==this.format&&null!==this.format&&(this.format.wordWrap=Y.PdfWordWrapType.Word),this.getWrapType()===Y.PdfWordWrapType.Character&&a?(a=!1,l="",l+=h.toString(),p=c.peek().toString()):(" "!==(d=h.toString())&&this.addToLineResult(i,r,d,o,Y.LineType.LayoutBreak|s),this.isOverloadWithPosition&&(n=this.clientSize.width),h=l="",f=u=o=0,s=Y.LineType.None,p=a?p:c.peekWord(),a=!0)}else h+=p,o=f,p=a?(c.readWord(),c.peekWord()):(c.read(),c.peek().toString())}0<h.length&&(d=h.toString(),this.addToLineResult(i,r,d,o,Y.LineType.NewLineBreak|Y.LineType.LastParagraphLine)),c.close()}i.layoutLines=[];for(var g=0;g<r.length;g++)i.layoutLines.push(r[g]);return r=[],i},Ct.prototype.addToLineResult=function(t,e,i,r,n){var o=new xt,i=(o.text=i,o.width=r,o.lineType=n,e.push(o),t.actualSize);i.height+=this.getLineHeight(),i.width=Math.max(i.width,r),t.size=i},Ct.prototype.copyToResult=function(t,e,i,r){var n,o=!0,s=null!=this.format&&!this.format.lineLimit,a=t.actualSize.height,h=this.size.height;if(0<this.pageHeight&&h+this.rectangle.y>this.pageHeight&&(h=this.rectangle.y-this.pageHeight,h=Math.max(h,-h)),r=0,null!=e.lines)for(var l=0,u=e.lines.length;l<u;l++){var c=a+e.lineHeight;if(!(c<=h||h<=0||s)){o=!1;break}var p=e.lines[l],d=(r+=p.text.length,p=this.trimLine(p,0===i.length),i.push(p),t.actualSize);d.width=Math.max(d.width,p.width),t.size=d,a=c}return a!=t.size.height&&((n=t.actualSize).height=a,t.size=n),{success:o,numInserted:r}},Ct.prototype.finalizeResult=function(t,e){t.layoutLines=[];for(var i=0;i<e.length;i++)t.layoutLines.push(e[i]);t.layoutLineHeight=this.getLineHeight(),this.reader.end||(t.textRemainder=this.reader.readToEnd())},Ct.prototype.trimLine=function(t,e){var i=t.text,r=t.width;t.lineType,Y.LineType.FirstParagraphLine,null!=this.format&&this.format.rightToLeft;return(i=i.trim()).length!==t.text.length&&(r=this.getLineWidth(i),0<(t.lineType&Y.LineType.FirstParagraphLine))&&(r+=this.getLineIndent(e)),t.text=i,t.width=r,t},Ct.prototype.getWrapType=function(){return null!=this.format?this.format.wordWrap:Y.PdfWordWrapType.Word};var vt=Ct;function Ct(){this.isOverloadWithPosition=!1}Object.defineProperty(Ot.prototype,"remainder",{get:function(){return this.textRemainder},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"actualSize",{get:function(){return void 0===this.size&&(this.size=new J(0,0)),this.size},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"lines",{get:function(){return this.layoutLines},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"lineHeight",{get:function(){return this.layoutLineHeight},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"empty",{get:function(){return null==this.layoutLines||0===this.layoutLines.length},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"lineCount",{get:function(){return this.empty?0:this.layoutLines.length},enumerable:!0,configurable:!0});var Bt=Ot;function Ot(){}Object.defineProperty(Lt.prototype,"lineType",{get:function(){return this.type},set:function(t){this.type=t},enumerable:!0,configurable:!0}),Object.defineProperty(Lt.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(Lt.prototype,"width",{get:function(){return this.lineWidth},set:function(t){this.lineWidth=t},enumerable:!0,configurable:!0});var xt=Lt;function Lt(){}(i=Y.LineType||(Y.LineType={}))[i.None=0]="None",i[i.NewLineBreak=1]="NewLineBreak",i[i.LayoutBreak=2]="LayoutBreak",i[i.FirstParagraphLine=4]="FirstParagraphLine",i[i.LastParagraphLine=8]="LastParagraphLine";Object.defineProperty(jt.prototype,"name",{get:function(){return this.metrics.name},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"size",{get:function(){return this.fontSize},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"height",{get:function(){return this.metrics.getHeight(null)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"style",{get:function(){return this.fontStyle},set:function(t){this.fontStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"bold",{get:function(){return 0<(this.style&Y.PdfFontStyle.Bold)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"italic",{get:function(){return 0<(this.style&Y.PdfFontStyle.Italic)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"strikeout",{get:function(){return 0<(this.style&Y.PdfFontStyle.Strikeout)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"underline",{get:function(){return 0<(this.style&Y.PdfFontStyle.Underline)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"metrics",{get:function(){return this.fontMetrics},set:function(t){this.fontMetrics=t},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"element",{get:function(){return this.pdfFontInternals},enumerable:!0,configurable:!0}),jt.prototype.measureString=function(t,e,i,r,n){if("string"==typeof t&&void 0===e)return this.measureString(t,null);if("string"==typeof t&&(e instanceof bt||null==e)&&void 0===i&&void 0===r)return this.measureString(t,o=e,0,0);if("string"==typeof t&&(e instanceof bt||null==e)&&"number"==typeof i&&"number"==typeof r)return this.measureString(t,0,o=e,i,r);if("string"==typeof t&&"number"==typeof e&&(i instanceof bt||null==i)&&"number"==typeof r&&"number"==typeof n)return s=new J(e,0),this.measureString(t,s,s=i,r,n);if(null==t)throw Error('ArgumentNullException("text")');var o=e,s=i,e=(new vt).layout(t,this,s,o,!1,new J(0,0));return r=t.length,n=e.empty?0:e.lines.length,e.actualSize},jt.prototype.equalsTo=function(t){return this.equalsToFont(t)},jt.prototype.getInternals=function(){return this.pdfFontInternals},jt.prototype.setInternals=function(t){if(null==t)throw new Error("ArgumentNullException:internals");this.pdfFontInternals=t},jt.prototype.setStyle=function(t){this.fontStyle=t},jt.prototype.applyFormatSettings=function(t,e,i){var r=i;return null!=e&&0<i&&(0!==e.characterSpacing&&(r+=(t.length-1)*e.characterSpacing),0!==e.wordSpacing)&&(i=Pt.spaces,r+=Pt.getCharsCount(t,i)*e.wordSpacing),r},jt.charSizeMultiplier=.001,jt.syncObject=new Object;var Tt=jt;function jt(t,e){this.fontStyle=Y.PdfFontStyle.Regular,"number"==typeof t&&void 0===e?this.fontSize=t:(this.fontSize=t,this.setStyle(e))}Object.defineProperty(Vt.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),Object.defineProperty(Vt.prototype,"position",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(Vt.prototype,"length",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(Vt.prototype,"stream",{get:function(){return this.streamWriter},enumerable:!0,configurable:!0}),Vt.prototype.write=function(t){this.streamWriter.write(t)};var kt=Vt;function Vt(t){this.streamWriter=t}Mt.prototype.write=function(t){this.buffer.write(t)},Mt.prototype.destroy=function(){this.buffer&&(this.buffer.destroy(),this.buffer=void 0)};var Rt=Mt;function Mt(){this.buffer=new Dt}Object.defineProperty(At.prototype,"size",{get:function(){return this.buffer.length},enumerable:!0,configurable:!0}),At.prototype.write=function(t){for(var e=0;e<t.length;e++)this.buffer.push(255&t.charCodeAt(e))},At.prototype.destroy=function(){this.buffer&&(this.buffer=[],this.buffer=void 0)};var Dt=At;function At(){this.buffer=[]}(i=Y.ObjectStatus||(Y.ObjectStatus={}))[i.None=0]="None",i[i.Registered=1]="Registered";Object.defineProperty(It.prototype,"count",{get:function(){return this.objectCollections.length},enumerable:!0,configurable:!0}),It.prototype.items=function(t){return this.objectCollections[t]},Object.defineProperty(It.prototype,"outIsNew",{get:function(){return this.isNew},enumerable:!0,configurable:!0}),It.prototype.add=function(t){var e=new Ft(t);this.objectCollections.push(e),this.primitiveObjectCollection.containsKey(t)||this.primitiveObjectCollection.setValue(t,this.objectCollections.length-1),t.position=this.index=this.objectCollections.length-1,t.status=Y.ObjectStatus.Registered},It.prototype.lookFor=function(t){var e=-1;if(-1!==t.position)return t.position;if(this.primitiveObjectCollection.containsKey(t)&&this.count===this.primitiveObjectCollection.size())e=this.primitiveObjectCollection.getValue(t);else for(var i=this.count-1;0<=i;i--)if(this.objectCollections[i].object===t){e=i;break}return e},It.prototype.getReference=function(t,e){return this.index=this.lookFor(t),this.isNew=!1,{reference:this.objectCollections[this.index].reference,wasNew:e}},It.prototype.trySetReference=function(t,e,i){return this.index=this.lookFor(t),this.objectCollections[this.index].setReference(e),!0},It.prototype.destroy=function(){for(var t=0,e=this.objectCollections;t<e.length;t++){var i=e[t];void 0!==i&&(i.pdfObject.position=-1,i.pdfObject.isSaving=void 0,i.pdfObject.objectCollectionIndex=void 0,i.pdfObject.position=void 0)}this.objectCollections=[],this.mainObjectCollection=new a,this.primitiveObjectCollection=new a};var Nt=It;function It(){this.objectCollections=[],this.mainObjectCollection=new a,this.primitiveObjectCollection=new a}Object.defineProperty(Et.prototype,"object",{get:function(){return this.pdfObject},set:function(t){this.pdfObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(Et.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Et.prototype.setReference=function(t){this.pdfReference=t};var Ft=Et;function Et(t,e){this.pdfObject=t,this.pdfReference=e}Object.defineProperty(Gt.prototype,"pdfObjects",{get:function(){return this.objects},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"crossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"currentSavingObj",{get:function(){return this.currentSavingObject},set:function(t){this.currentSavingObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"catalog",{get:function(){return this.pdfCatalog},set:function(t){this.pdfCatalog=t},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"viewerPreferences",{get:function(){return this.pdfCatalog.viewerPreferences},enumerable:!0,configurable:!0}),Gt.prototype.setMainObjectCollection=function(t){this.objects=t},Gt.prototype.setCrossTable=function(t){this.pdfCrossTable=t},Gt.prototype.setCatalog=function(t){this.pdfCatalog=t},Gt.prototype.save=function(t){var e,r,n=this,i=new R.Encoding(!0),i=new R.StreamWriter(i);if(void 0===t)return e=new R.Encoding(!0),r=new R.StreamWriter(e),new Promise(function(t,e){var i={};i.blobData=new Blob([n.document.docSave(r,!0)],{type:"application/pdf"}),t(i)});this.document.docSave(i,t,!0)},Gt.prototype.clone=function(){return this.document},Gt.prototype._save=function(){return this.document._docSave()};var i=Gt;function Gt(t){this.isStreamCopied=!1,t instanceof Tr&&(this.document=t)}(w=Y.ObjectType||(Y.ObjectType={}))[w.Free=0]="Free",w[w.Normal=1]="Normal",w[w.Packed=2]="Packed";Object.defineProperty(Wt.prototype,"status",{get:function(){return this.objectStatus},set:function(t){this.objectStatus=t},enumerable:!0,configurable:!0}),Object.defineProperty(Wt.prototype,"isSaving",{get:function(){return this.saving},set:function(t){this.saving=t},enumerable:!0,configurable:!0}),Object.defineProperty(Wt.prototype,"objectCollectionIndex",{get:function(){return this.index},set:function(t){this.index=t},enumerable:!0,configurable:!0}),Object.defineProperty(Wt.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),Object.defineProperty(Wt.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Wt.prototype.save=function(t){t.write(this.boolToStr(this.value))},Wt.prototype.clone=function(t){return new Wt(this.value)},Wt.prototype.boolToStr=function(t){return t?"true":"false"};var zt=Wt;function Wt(t){this.currentPosition=-1,this.value=t}Object.defineProperty(Ht.prototype,"centerWindow",{get:function(){return this._centerWindow},set:function(t){this._centerWindow=t,this._dictionary.items.setValue(this._dictionaryProperties.centerWindow,new zt(this._centerWindow))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"displayTitle",{get:function(){return this._displayTitle},set:function(t){this._displayTitle=t,this._dictionary.items.setValue(this._dictionaryProperties.displayTitle,new zt(this._displayTitle))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"fitWindow",{get:function(){return this._fitWindow},set:function(t){this._fitWindow=t,this._dictionary.items.setValue(this._dictionaryProperties.fitWindow,new zt(this._fitWindow))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"hideMenuBar",{get:function(){return this._hideMenuBar},set:function(t){this._hideMenuBar=t,this._dictionary.items.setValue(this._dictionaryProperties.hideMenuBar,new zt(this._hideMenuBar))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"hideToolBar",{get:function(){return this._hideToolBar},set:function(t){this._hideToolBar=t,this._dictionary.items.setValue(this._dictionaryProperties.hideToolBar,new zt(this._hideToolBar))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"hideWindowUI",{get:function(){return this._hideWindowUI},set:function(t){this._hideWindowUI=t,this._dictionary.items.setValue(this._dictionaryProperties.hideWindowUI,new zt(this._hideWindowUI))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"pageMode",{get:function(){return this._pageMode},set:function(t){this._pageMode=t,this._catalog.items.setValue(this._dictionaryProperties.pageMode,new o(this._mapPageMode(this._pageMode)))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"duplex",{get:function(){return this._duplex},set:function(t){this._duplex=t,this._catalog.items.setValue(this._dictionaryProperties.duplex,new o(this._mapDuplexMode(this._duplex)))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"pageLayout",{get:function(){return this._pageLayout},set:function(t){this._pageLayout=t,this._catalog.items.setValue(this._dictionaryProperties.pageLayout,new o(this._mapPageLayout(this._pageLayout)))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"pageScaling",{get:function(){return this._pageScaling},set:function(t){this._pageScaling=t,this._pageScaling===Y.PageScalingMode.AppDefault&&this._dictionary.items.containsKey(this._dictionaryProperties.printScaling)?this._dictionary.items.remove(this._dictionaryProperties.printScaling):this._pageScaling===Y.PageScalingMode.None&&this._dictionary.items.setValue(this._dictionaryProperties.printScaling,new o("None"))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"element",{get:function(){return this._dictionary},enumerable:!0,configurable:!0}),Ht.prototype._mapDuplexMode=function(t){switch(t){case Y.DuplexMode.Simplex:return"Simplex";case Y.DuplexMode.DuplexFlipShortEdge:return"DuplexFlipShortEdge";case Y.DuplexMode.DuplexFlipLongEdge:return"DuplexFlipLongEdge";case Y.DuplexMode.None:return"None"}},Ht.prototype._mapPageMode=function(t){switch(t){case Y.PdfPageMode.UseNone:return"UseNone";case Y.PdfPageMode.UseOutlines:return"UseOutlines";case Y.PdfPageMode.UseThumbs:return"UseThumbs";case Y.PdfPageMode.FullScreen:return"FullScreen";case Y.PdfPageMode.UseOC:return"UseOC";case Y.PdfPageMode.UseAttachments:return"UseAttachments"}},Ht.prototype._mapPageLayout=function(t){switch(t){case Y.PdfPageLayout.SinglePage:return"SinglePage";case Y.PdfPageLayout.OneColumn:return"OneColumn";case Y.PdfPageLayout.TwoColumnLeft:return"TwoColumnLeft";case Y.PdfPageLayout.TwoColumnRight:return"TwoColumnRight";case Y.PdfPageLayout.TwoPageLeft:return"TwoPageLeft";case Y.PdfPageLayout.TwoPageRight:return"TwoPageRight"}};var _t=Ht;function Ht(t){this._dictionaryProperties=new l,this._centerWindow=!1,this._fitWindow=!1,this._displayTitle=!1,this._splitWindow=!1,this._hideMenuBar=!1,this._hideToolBar=!1,this._hideWindowUI=!1,this._pageMode=Y.PdfPageMode.UseNone,this._pageLayout=Y.PdfPageLayout.SinglePage,this._dictionary=new c,this._duplex=Y.DuplexMode.None,this._catalog=t}(w=Y.PdfPageMode||(Y.PdfPageMode={}))[w.UseNone=0]="UseNone",w[w.UseOutlines=1]="UseOutlines",w[w.UseThumbs=2]="UseThumbs",w[w.FullScreen=3]="FullScreen",w[w.UseOC=4]="UseOC",w[w.UseAttachments=5]="UseAttachments",(w=Y.PdfPageLayout||(Y.PdfPageLayout={}))[w.SinglePage=0]="SinglePage",w[w.OneColumn=1]="OneColumn",w[w.TwoColumnLeft=2]="TwoColumnLeft",w[w.TwoColumnRight=3]="TwoColumnRight",w[w.TwoPageLeft=4]="TwoPageLeft",w[w.TwoPageRight=5]="TwoPageRight",(w=Y.DuplexMode||(Y.DuplexMode={}))[w.Simplex=0]="Simplex",w[w.DuplexFlipShortEdge=1]="DuplexFlipShortEdge",w[w.DuplexFlipLongEdge=2]="DuplexFlipLongEdge",w[w.None=3]="None",(w=Y.PageScalingMode||(Y.PageScalingMode={}))[w.AppDefault=0]="AppDefault",w[w.None=1]="None",Ut=function(t,e){return(Ut=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ut(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Yt,Kt=c),Object.defineProperty(Yt.prototype,"pages",{get:function(){return this.sections},set:function(t){t.element;this.sections=t,this.items.setValue(this.tempDictionaryProperties.pages,new d(t))},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"viewerPreferences",{get:function(){return null!==this._viewerPreferences&&void 0!==this._viewerPreferences||(this._viewerPreferences=new _t(this),this.items.setValue(this.tempDictionaryProperties.viewerPreferences,new d(this._viewerPreferences.element))),this._viewerPreferences},enumerable:!0,configurable:!0});var Ut,Kt,qt=Yt;function Yt(){var t=Kt.call(this)||this;return t.sections=null,t.tempDictionaryProperties=new l,t.items.setValue((new l).type,new o("Catalog")),t}Object.defineProperty(n.prototype,"isMerging",{get:function(){return this.merging},set:function(t){this.merging=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trailer",{get:function(){return null==this.internalTrailer&&(this.internalTrailer=new U),this.internalTrailer},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t,this.items=this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pdfObjects",{get:function(){return this.items},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"objectCollection",{get:function(){return this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){return this.objectCount},set:function(t){this.objectCount=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"nextObjNumber",{get:function(){return this.count=this.count+1,this.count},enumerable:!0,configurable:!0}),n.prototype.save=function(t,e){if(this._saveProcess(t),void 0===e)return t.stream.buffer;t.stream.save(e)},n.prototype._saveProcess=function(t){this.saveHead(t),this.mappedReferences=null,this.objects.clear(),this.markTrailerReferences(),this.saveObjects(t);var e=this.count,i=t.position;this.registerObject(0,new et(0,-1),!0);t.write(h.xref),t.write(h.newLine),this.saveSections(t),this.saveTrailer(t,this.count,0),this.saveTheEndess(t,i),this.count=e;for(var r=0;r<this.objectCollection.count;++r)this.objectCollection.items(r).object.isSaving=!1},n.prototype._save=function(t){return this._saveProcess(t),new Uint8Array(t.stream.buffer.buffer)},n.prototype.saveTheEndess=function(t,e){t.write(h.newLine+h.startxref+h.newLine),t.write(e.toString()+h.newLine),t.write(h.eof+h.newLine)},n.prototype.saveTrailer=function(t,e,i){t.write(h.trailer+h.newLine);var r=this.trailer;r.items.setValue(this.dictionaryProperties.size,new u(this.objectCount+1)),(r=new c(r)).setEncrypt(!1),r.save(t)},n.prototype.saveSections=function(t){for(var e,i=0;e=this.prepareSubsection(i),this.saveSubsection(t,i,e),i+=e,0!==e;);},n.prototype.saveSubsection=function(t,e,i){if(!(i<=0||e>=this.count)){t.write(e+" "+(i+1)+h.newLine);for(var r=e;r<=e+i;++r){var n=this.objects.getValue(r),o="",o=n.type===Y.ObjectType.Free?this.getItem(n.offset,65535,!0):this.getItem(n.offset,n.generation,!1);t.write(o)}}},n.prototype.getItem=function(t,e,i){for(var r="",n=10-t.toString().length,o=5-(e=e<=0?0:e).toString().length<=0?0:5-e.toString().length,s=0;s<n;s++)r+="0";for(r=r+t.toString()+" ",s=0;s<o;s++)r+="0";return r=(r=r+e.toString()+" ")+(i?h.f:h.n)+h.newLine},n.prototype.prepareSubsection=function(t){for(var e,i=0,r=this.count,n=0;n<this.document.pdfObjects.count;n++)this.document.pdfObjects.items(n).reference.toString().split(" ");if(!(r<=t))for(t=e=t;e<r;++e)++i;return i},n.prototype.markTrailerReferences=function(){this.trailer.items.keys(),this.trailer.items.values()},n.prototype.saveHead=function(t){var e=this.generateFileVersion(t.document);t.write("%PDF-"+e),t.write(h.newLine)},n.prototype.generateFileVersion=function(t){return"1."+4..toString()},n.prototype.getReference=function(t,e){return void 0===e?this.getReference(t,!1):this.getSubReference(t,e)},n.prototype.getSubReference=function(t,e){var i,r,n=!1,o=null;return 0<this.items.count&&0<t.objectCollectionIndex&&this.items.count>t.objectCollectionIndex-1&&(o=(r=this.document.pdfObjects.getReference(t,i)).reference,i=r.wasNew),i=null==o&&t.status!==Y.ObjectStatus.Registered,null==o&&(r=this.nextObjNumber,o=new et(r,0),i?(this.document.pdfObjects.add(t),this.document.pdfObjects.trySetReference(t,o,void 0),r=this.document.pdfObjects.count-1,i=this.document.pdfObjects.objectCollections[r].reference.objNumber,r=this.document.pdfObjects.objectCollections[this.document.pdfObjects.count-1],this.document.pdfObjects.mainObjectCollection.setValue(i,r),t.position=-1):this.document.pdfObjects.trySetReference(t,o,void 0),t.objectCollectionIndex=o.objNumber,t.status=Y.ObjectStatus.None,n=!0),n||this.bForceNew,o},n.prototype.saveObjects=function(t){for(var e=this.objectCollection,i=0;i<e.count;++i){var r=e.items(i).object;r.isSaving=!0,this.saveIndirectObject(r,t)}},n.prototype.saveIndirectObject=function(t,e){var i=this.getReference(t);t instanceof qt&&this.trailer.items.setValue(this.dictionaryProperties.root,i),this.pdfDocument.currentSavingObj=i,t.getArchive();this.registerObject(e.position,i),this.doSaveObject(t,i,e)},n.prototype.doSaveObject=function(t,e,i){i.write(e.objNumber.toString()),i.write(h.whiteSpace),i.write(e.genNumber.toString()),i.write(h.whiteSpace),i.write(h.obj),i.write(h.newLine),t.save(i),i.write(h.endObj),i.write(h.newLine)},n.prototype.registerObject=function(t,e,i){"boolean"==typeof i?(this.objects.setValue(e.objNumber,new Jt(t,e,i)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber)):void 0===i&&(this.objects.setValue(e.objNumber,new Jt(t,e)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber))},n.dereference=function(t){return t=null!=t?t.object:t};var Xt=n;function n(){this.objects=new a,this.maxGenNumIndex=0,this.objectCount=0,this.dictionaryProperties=new l}Object.defineProperty(Zt.prototype,"objectNumber",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(Zt.prototype,"offset",{get:function(){return this.offsetNumber},enumerable:!0,configurable:!0});var Jt=Zt;function Zt(t,e,i){this.offsetNumber=t;t=e;this.generation=t.genNumber,this.object=t.objNumber,this.type=void 0===i?Y.ObjectType.Normal:Y.ObjectType.Free}m.letter=new J(612,792),m.note=new J(540,720),m.legal=new J(612,1008),m.a0=new J(2380,3368),m.a1=new J(1684,2380),m.a2=new J(1190,1684),m.a3=new J(842,1190),m.a4=new J(595,842),m.a5=new J(421,595),m.a6=new J(297,421),m.a7=new J(210,297),m.a8=new J(148,210),m.a9=new J(105,148),m.a10=new J(74,105),m.b0=new J(2836,4008),m.b1=new J(2004,2836),m.b2=new J(1418,2004),m.b3=new J(1002,1418),m.b4=new J(709,1002),m.b5=new J(501,709),m.archE=new J(2592,3456),m.archD=new J(1728,2592),m.archC=new J(1296,1728),m.archB=new J(864,1296),m.archA=new J(648,864),m.flsa=new J(612,936),m.halfLetter=new J(396,612),m.letter11x17=new J(792,1224),m.ledger=new J(1224,792);var $t=m;function m(){}(w=Y.PdfPageOrientation||(Y.PdfPageOrientation={}))[w.Portrait=0]="Portrait",w[w.Landscape=1]="Landscape",(w=Y.PdfPageRotateAngle||(Y.PdfPageRotateAngle={}))[w.RotateAngle0=0]="RotateAngle0",w[w.RotateAngle90=1]="RotateAngle90",w[w.RotateAngle180=2]="RotateAngle180",w[w.RotateAngle270=3]="RotateAngle270",(w=Y.PdfNumberStyle||(Y.PdfNumberStyle={}))[w.None=0]="None",w[w.Numeric=1]="Numeric",w[w.LowerLatin=2]="LowerLatin",w[w.LowerRoman=3]="LowerRoman",w[w.UpperLatin=4]="UpperLatin",w[w.UpperRoman=5]="UpperRoman",(w=Y.PdfDockStyle||(Y.PdfDockStyle={}))[w.None=0]="None",w[w.Bottom=1]="Bottom",w[w.Top=2]="Top",w[w.Left=3]="Left",w[w.Right=4]="Right",w[w.Fill=5]="Fill",(w=Y.PdfAlignmentStyle||(Y.PdfAlignmentStyle={}))[w.None=0]="None",w[w.TopLeft=1]="TopLeft",w[w.TopCenter=2]="TopCenter",w[w.TopRight=3]="TopRight",w[w.MiddleLeft=4]="MiddleLeft",w[w.MiddleCenter=5]="MiddleCenter",w[w.MiddleRight=6]="MiddleRight",w[w.BottomLeft=7]="BottomLeft",w[w.BottomCenter=8]="BottomCenter",w[w.BottomRight=9]="BottomRight",(w=Y.TemplateType||(Y.TemplateType={}))[w.None=0]="None",w[w.Top=1]="Top",w[w.Bottom=2]="Bottom",w[w.Left=3]="Left",w[w.Right=4]="Right";Object.defineProperty(te.prototype,"left",{get:function(){return this.leftMargin},set:function(t){this.leftMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(te.prototype,"top",{get:function(){return this.topMargin},set:function(t){this.topMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(te.prototype,"right",{get:function(){return this.rightMargin},set:function(t){this.rightMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(te.prototype,"bottom",{get:function(){return this.bottomMargin},set:function(t){this.bottomMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(te.prototype,"all",{set:function(t){this.setMargins(t)},enumerable:!0,configurable:!0}),te.prototype.setMargins=function(t,e,i,r){void 0===e?this.leftMargin=this.topMargin=this.rightMargin=this.bottomMargin=t:void 0===i?(this.leftMargin=this.rightMargin=t,this.bottomMargin=this.topMargin=e):(this.leftMargin=t,this.topMargin=e,this.rightMargin=i,this.bottomMargin=r)},te.prototype.clone=function(){return this};var Qt=te;function te(){this.pdfMargin=40,this.setMargins(this.pdfMargin)}Object.defineProperty(ie.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.setSize(t)},enumerable:!0,configurable:!0}),Object.defineProperty(ie.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation!==t&&(this.pageOrientation=t,this.updateSize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(ie.prototype,"margins",{get:function(){return this.pageMargins},set:function(t){this.pageMargins=t},enumerable:!0,configurable:!0}),Object.defineProperty(ie.prototype,"width",{get:function(){return this.pageSize.width},set:function(t){this.pageSize.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(ie.prototype,"height",{get:function(){return this.pageSize.height},set:function(t){this.pageSize.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(ie.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0}),Object.defineProperty(ie.prototype,"rotate",{get:function(){return this.rotateAngle},set:function(t){this.rotateAngle=t,this.isRotation=!0},enumerable:!0,configurable:!0}),ie.prototype.updateSize=function(t){var e=Math.min(this.pageSize.width,this.pageSize.height),i=Math.max(this.pageSize.width,this.pageSize.height);switch(t){case Y.PdfPageOrientation.Portrait:this.pageSize=new J(e,i);break;case Y.PdfPageOrientation.Landscape:this.pageSize=new J(i,e)}},ie.prototype.clone=function(){return this.pageMargins=this.pageMargins.clone(),this},ie.prototype.getActualSize=function(){var t=this.width-(this.margins.left+this.margins.right),e=this.height-(this.margins.top+this.margins.bottom);return new J(t,e)},ie.prototype.setSize=function(t){var e=Math.min(t.width,t.height),t=Math.max(t.width,t.height);this.orientation===Y.PdfPageOrientation.Portrait?this.pageSize=new J(e,t):this.pageSize=new J(t,e)};var ee=ie;function ie(t){this.pageMargins=new Qt,this.pageSize=$t.a4,this.rotateAngle=Y.PdfPageRotateAngle.RotateAngle0,this.pageOrientation=Y.PdfPageOrientation.Portrait,this.pageOrigin=new X(0,0),this.isRotation=!1,"number"==typeof t&&this.pageMargins.setMargins(t)}y.prototype.clear=function(){this.stream.clearStream()},y.prototype.setGraphicsState=function(t){t instanceof o?this.stream.write(t.toString()):(this.stream.write(h.slash),this.stream.write(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setGraphicsState)},y.prototype.executeObject=function(t){this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.paintXObject),this.stream.write(h.newLine)},y.prototype.closePath=function(){this.writeOperator(h.closePath)},y.prototype.clipPath=function(t){this.stream.write(h.clipPath),t&&this.stream.write(h.evenOdd),this.stream.write(h.whiteSpace),this.stream.write(h.endPath),this.stream.write(h.newLine)},y.prototype.closeFillStrokePath=function(t){this.stream.write(h.closeFillStrokePath),t&&this.stream.write(h.evenOdd),this.stream.write(h.newLine)},y.prototype.fillStrokePath=function(t){this.stream.write(h.fillStroke),t&&this.stream.write(h.evenOdd),this.stream.write(h.newLine)},y.prototype.fillPath=function(t){this.stream.write(h.fill),t&&this.stream.write(h.evenOdd),this.stream.write(h.newLine)},y.prototype.endPath=function(){this.writeOperator(h.n)},y.prototype.closeFillPath=function(t){this.writeOperator(h.closePath),this.stream.write(h.fill),t&&this.stream.write(h.evenOdd),this.stream.write(h.newLine)},y.prototype.closeStrokePath=function(){this.writeOperator(h.closeStrokePath)},y.prototype.setTextScaling=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setTextScaling)},y.prototype.strokePath=function(){this.writeOperator(h.stroke)},y.prototype.restoreGraphicsState=function(){this.writeOperator(h.restoreState)},y.prototype.saveGraphicsState=function(){this.writeOperator(h.saveState)},y.prototype.startNextLine=function(t,e){void 0===t?this.writeOperator(h.goToNextLine):(t instanceof X?this.writePoint(t):this.writePoint(t,e),this.writeOperator(h.setCoords))},y.prototype.showText=function(t){this.checkTextParam(t),this.writeText(t),this.writeOperator(h.setText)},y.prototype.setLeading=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setTextLeading)},y.prototype.beginPath=function(t,e){this.writePoint(t,e),this.writeOperator(h.beginPath)},y.prototype.beginText=function(){this.writeOperator(h.beginText)},y.prototype.endText=function(){this.writeOperator(h.endText)},y.prototype.appendRectangle=function(t,e,i,r){t instanceof Z?this.appendRectangle(t.x,t.y,t.width,t.height):(this.writePoint(t,e),this.writePoint(i,r),this.writeOperator(h.appendRectangle))},y.prototype.appendLineSegment=function(t,e){t instanceof X?this.appendLineSegment(t.x,t.y):(this.writePoint(t,e),this.writeOperator(h.appendLineSegment))},y.prototype.setTextRenderingMode=function(t){this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.setRenderingMode)},y.prototype.setCharacterSpacing=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.stream.write(h.setCharacterSpace),this.stream.write(h.newLine)},y.prototype.setWordSpacing=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setWordSpace)},y.prototype.showNextLineText=function(t,e){t instanceof tt?(this.checkTextParam(t),this.writeText(t)):(this.checkTextParam(t),this.writeText(t,e)),this.writeOperator(h.setTextOnNewLine)},y.prototype.setColorSpace=function(t,e){var i,r;t instanceof o&&"boolean"==typeof e?(i=(r=e)?h.selectcolorspaceforstroking:h.selectcolorspacefornonstroking,this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.stream.write(i),this.stream.write(h.newLine)):(r=e,this.setColorSpace(new o(t),r))},y.prototype.modifyCtm=function(t){if(null==t)throw new Error("ArgumentNullException:matrix");this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.modifyCtm)},y.prototype.setFont=function(t,e,i){if("string"==typeof e)this.setFont(t,new o(e),i);else{if(null==t)throw new Error("ArgumentNullException:font");this.stream.write(e.toString()),this.stream.write(h.whiteSpace),this.stream.write(u.floatToString(i)),this.stream.write(h.whiteSpace),this.writeOperator(h.setFont)}},y.prototype.writeOperator=function(t){this.stream.write(t),this.stream.write(h.newLine)},y.prototype.checkTextParam=function(t){if(null==t)throw new Error("ArgumentNullException:text");if("string"==typeof t&&""===t)throw new Error("ArgumentException:The text can not be an empty string, text")},y.prototype.writeText=function(t,e){var i,r;t instanceof tt&&void 0===e?this.stream.write(t.pdfEncode()):(r=i=void 0,r=(e?(i=tt.hexStringMark[0],tt.hexStringMark):(i=tt.stringMark[0],tt.stringMark))[1],this.stream.write(i),this.stream.write(t),this.stream.write(r))},y.prototype.writePoint=function(t,e){t instanceof X&&void 0===e?this.writePoint(t.x,t.y):(this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),e=this.updateY(e),this.stream.write(u.floatToString(e)),this.stream.write(h.whiteSpace))},y.prototype.updateY=function(t){return-t},y.prototype.write=function(t){var e="";this.writeOperator(e+t+h.newLine)},y.prototype.writeComment=function(t){if(!(null!=t&&0<t.length))throw new Error("Invalid comment");var e="";this.writeOperator((e+=h.comment)+h.whiteSpace+t)},y.prototype.setColorAndSpace=function(t,e,i){t.isEmpty||(this.stream.write(t.toString(e,i)),this.stream.write(h.newLine))},y.prototype.setLineDashPattern=function(t,e){this.setLineDashPatternHelper(t,e)},y.prototype.setLineDashPatternHelper=function(t,e){var i="[";if(1<t.length)for(var r=0;r<t.length;r++)r===t.length-1?i+=t[r].toString():i+=t[r].toString()+" ";i=(i+="] ")+e.toString(),this.stream.write(i+=" "+h.setDashPattern),this.stream.write(h.newLine)},y.prototype.setMiterLimit=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setMiterLimit)},y.prototype.setLineWidth=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setLineWidth)},y.prototype.setLineCap=function(t){this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.setLineCapStyle)},y.prototype.setLineJoin=function(t){this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.setLineJoinStyle)},Object.defineProperty(y.prototype,"position",{get:function(){return this.stream.position},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"length",{get:function(){var t=0;if(0!==this.stream.data.length&&-1!==this.stream.data.length)for(var e=0;e<this.stream.data.length;e++)t+=this.stream.data[e].length;return t},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"document",{get:function(){return null},enumerable:!0,configurable:!0}),y.prototype.appendBezierSegment=function(t,e,i,r,n,o){t instanceof X&&e instanceof X&&i instanceof X?(this.writePoint(t.x,t.y),this.writePoint(e.x,e.y),this.writePoint(i.x,i.y)):(this.writePoint(t,e),this.writePoint(i,r),this.writePoint(n,o)),this.writeOperator(h.appendbeziercurve)},y.prototype.setColourWithPattern=function(t,e,i){if(null!=t)for(var r=t.length,n=0,n=0;n<r;++n)this.stream.write(t[n].toString()),this.stream.write(h.whiteSpace);null!=e&&(this.stream.write(e.toString()),this.stream.write(h.whiteSpace)),i?this.writeOperator(h.setColorAndPatternStroking):this.writeOperator(h.setColorAndPattern)};var re=y;function y(t){if(null==t)throw new Error("ArgumentNullException:stream");this.stream=t}Object.defineProperty(oe.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"dashOffset",{get:function(){return void 0===this.dashOffsetValue||null==this.dashOffsetValue?0:this.dashOffsetValue},set:function(t){this.dashOffsetValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"dashPattern",{get:function(){return this.penDashPattern},set:function(t){this.penDashPattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"dashStyle",{get:function(){return this.pdfDashStyle},set:function(t){if(this.pdfDashStyle!==t)switch(this.pdfDashStyle=t,this.pdfDashStyle){case Y.PdfDashStyle.Custom:break;case Y.PdfDashStyle.Dash:this.penDashPattern=[3,1];break;case Y.PdfDashStyle.Dot:this.penDashPattern=[1,1];break;case Y.PdfDashStyle.DashDot:this.penDashPattern=[3,1,1,1];break;case Y.PdfDashStyle.DashDotDot:this.penDashPattern=[3,1,1,1,1,1];break;case Y.PdfDashStyle.Solid:break;default:this.pdfDashStyle=Y.PdfDashStyle.Solid,this.penDashPattern=[0]}},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"lineCap",{get:function(){return this.pdfLineCap},set:function(t){this.pdfLineCap=t},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"lineJoin",{get:function(){return this.pdfLineJoin},set:function(t){this.pdfLineJoin=t},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"miterLimit",{get:function(){return this.internalMiterLimit},set:function(t){this.internalMiterLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"width",{get:function(){return this.penWidth},set:function(t){this.penWidth=t},enumerable:!0,configurable:!0}),oe.prototype.clone=function(){return this},oe.prototype.setBrush=function(t){null!=t&&t instanceof mt&&(this.color=t.color,this.pdfBrush=t),this.color=t.color,this.pdfBrush=t},oe.prototype.monitorChanges=function(t,e,i,r,n,o){this.dashControl(t,!0,e),e.setLineWidth(this.width),e.setLineJoin(this.lineJoin),e.setLineCap(this.lineCap);t=this.miterLimit;0<t&&e.setMiterLimit(t),this.pdfBrush;return e.setColorAndSpace(this.color,n,!0),!0},oe.prototype.dashControl=function(t,e,i){var r=this.width,n=this.getPattern();return i.setLineDashPattern(n,this.dashOffset*r),!0},oe.prototype.getPattern=function(){for(var t=this.dashPattern,e=0;e<t.length;++e)t[e]*=this.width;return t};var ne=oe;function oe(t,e){this.pdfColor=new f(0,0,0),this.dashOffsetValue=0,this.penDashPattern=[0],this.pdfDashStyle=Y.PdfDashStyle.Solid,this.pdfLineCap=0,this.pdfLineJoin=0,this.penWidth=1,this.internalMiterLimit=0,this.colorSpace=Y.PdfColorSpace.Rgb,t instanceof pt?this.setBrush(t):t instanceof f&&(this.color=t),"number"==typeof e&&(this.width=e)}Object.defineProperty(ae.prototype,"matrix",{get:function(){return this.transformationMatrix},set:function(t){this.transformationMatrix=t},enumerable:!0,configurable:!0}),ae.prototype.translate=function(t,e){this.transformationMatrix.translate(t,e)},ae.prototype.scale=function(t,e){this.transformationMatrix.elements[0]=t,this.transformationMatrix.elements[3]=e},ae.prototype.rotate=function(t){t=t*Math.PI/180,this.transformationMatrix.elements[0]=Math.cos(t),this.transformationMatrix.elements[1]=Math.sin(t),this.transformationMatrix.elements[2]=-Math.sin(t),this.transformationMatrix.elements[3]=Math.cos(t)},ae.prototype.toString=function(){for(var t="",e=0,i=this.transformationMatrix.elements.length;e<i;e++)this.matrix.elements[e],t=t+u.floatToString(this.transformationMatrix.elements[e])+" ";return t},ae.prototype.multiply=function(t){this.transformationMatrix.multiply(t.matrix)},ae.degreesToRadians=function(t){return this.degRadFactor*t},ae.prototype.radiansToDegrees=function(t){return this.radDegFactor*t},ae.prototype.clone=function(){return this},ae.degRadFactor=Math.PI/180;var se=ae;function ae(t){this.radDegFactor=180/Math.PI,this.transformationMatrix=new he(1,0,0,void 0===t?1:-1,0,0)}Object.defineProperty(le.prototype,"elements",{get:function(){return this.metrixElements},enumerable:!0,configurable:!0}),Object.defineProperty(le.prototype,"offsetX",{get:function(){return this.metrixElements[4]},enumerable:!0,configurable:!0}),Object.defineProperty(le.prototype,"offsetY",{get:function(){return this.metrixElements[5]},enumerable:!0,configurable:!0}),le.prototype.translate=function(t,e){this.metrixElements[4]=t,this.metrixElements[5]=e},le.prototype.transform=function(t){var e=t.x,t=t.y,i=e*this.elements[0]+t*this.elements[2]+this.offsetX,e=e*this.elements[1]+t*this.elements[3]+this.offsetY;return new X(i,e)},le.prototype.multiply=function(t){var e=[];e.push(this.elements[0]*t.elements[0]+this.elements[1]*t.elements[2]),e[1]=this.elements[0]*t.elements[1]+this.elements[1]*t.elements[3],e[2]=this.elements[2]*t.elements[0]+this.elements[3]*t.elements[2],e[3]=this.elements[2]*t.elements[1]+this.elements[3]*t.elements[3],e[4]=this.offsetX*t.elements[0]+this.offsetY*t.elements[2]+t.offsetX,e[5]=this.offsetX*t.elements[1]+this.offsetY*t.elements[3]+t.offsetY;for(var i=0;i<e.length;i++)this.elements[i]=e[i]},le.prototype.dispose=function(){this.metrixElements=null},le.prototype.clone=function(){return new le(this.metrixElements)};var he=le;function le(t,e,i,r,n,o){void 0===t?this.metrixElements=[]:"number"==typeof t?(this.metrixElements=[],this.metrixElements.push(t),this.metrixElements.push(e),this.metrixElements.push(i),this.metrixElements.push(r),this.metrixElements.push(n),this.metrixElements.push(o)):this.metrixElements=t}var ue=function(){this.pdf="PDF",this.text="Text",this.imageB="ImageB",this.imageC="ImageC",this.imageI="ImageI"},ce=(pe.prototype.size=function(){return this.mKeys.length},pe.prototype.add=function(t,e){if(null==t||null==e)throw new ReferenceError("Provided key or value is not valid.");if(this.mKeys.indexOf(t)<0)return this.mKeys.push(t),this.mValues.push(e),1;throw new RangeError("An item with the same key has already been added.")},pe.prototype.keys=function(){return this.mKeys},pe.prototype.values=function(){return this.mValues},pe.prototype.getValue=function(t){if(null==t)throw new ReferenceError("Provided key is not valid.");t=this.mKeys.indexOf(t);if(t<0)throw new RangeError("No item with the specified key has been added.");return this.mValues[t]},pe.prototype.setValue=function(t,e){if(null==t)throw new ReferenceError("Provided key is not valid.");var i=this.mKeys.indexOf(t);i<0?(this.mKeys.push(t),this.mValues.push(e)):this.mValues[i]=e},pe.prototype.remove=function(t){if(null==t)throw new ReferenceError("Provided key is not valid.");t=this.mKeys.indexOf(t);if(t<0)throw new RangeError("No item with the specified key has been added.");return this.mKeys.splice(t,1),this.mValues.splice(t,1),!0},pe.prototype.containsKey=function(t){if(null==t)throw new ReferenceError("Provided key is not valid.");return!(this.mKeys.indexOf(t)<0)},pe.prototype.clear=function(){this.mKeys=[],this.mValues=[]},pe);function pe(){this.mKeys=[],this.mValues=[]}Object.defineProperty(fe.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0});var de=fe;function fe(t,e,i){this.dictionary=new c,this.dictionaryProperties=new l,this.dictionary.items.setValue(this.dictionaryProperties.CA,new u(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new u(e)),this.dictionary.items.setValue(this.dictionaryProperties.BM,new o(i.toString()))}Object.defineProperty(me.prototype,"automaticFields",{get:function(){return this.automaticFieldsInformation},enumerable:!0,configurable:!0}),me.prototype.add=function(t){return this.automaticFields.push(t)};var ge=me;function me(){this.automaticFieldsInformation=[]}function ye(){}ye.prototype.drawHelper=function(t,e,i){var r=0!==e||0!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},be=function(t,e){return(be=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}be(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Se,we=ye),Object.defineProperty(Se.prototype,"bounds",{get:function(){return this.internalBounds},set:function(t){this.internalBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"size",{get:function(){return new J(this.bounds.width,this.bounds.height)},set:function(t){this.bounds.width=t.width,this.bounds.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"location",{get:function(){return new X(this.bounds.x,this.bounds.y)},set:function(t){this.bounds.x=t.x,this.bounds.y=t.y},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"font",{get:function(){return this.internalFont},set:function(t){this.internalFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"brush",{get:function(){return this.internalBrush},set:function(t){this.internalBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"pen",{get:function(){return this.internalPen},set:function(t){this.internalPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"stringFormat",{get:function(){return this.internalStringFormat},set:function(t){this.internalStringFormat=t},enumerable:!0,configurable:!0}),Se.prototype.performDrawHelper=function(t,e,i,r){0!==this.bounds.height&&0!==this.bounds.width||(t=this.getValue(t),this.internalTemplateSize=this.getFont().measureString(t,this.size,this.stringFormat))},Se.prototype.draw=function(t,e,i){var r;void 0===e?(r=new X(0,0),this.draw(t,r)):e instanceof X?this.draw(t,e.x,e.y):(this.drawHelper(t,e,i),r=new ve(this,new X(e,i)),t.automaticFields.add(r))},Se.prototype.getSize=function(){return 0===this.bounds.height||0===this.bounds.width?this.internalTemplateSize:this.size},Se.prototype.drawInternal=function(t){},Se.prototype.getBrush=function(){return void 0===this.internalBrush||null==this.internalBrush?new mt(new f(0,0,0)):this.internalBrush},Se.prototype.getFont=function(){return void 0===this.internalFont||null==this.internalFont?Tr.defaultFont:this.internalFont},Se.prototype.getPageFromGraphics=function(t){return void 0!==t.page&&null!==t.page?t.page:t.currentPage};var be,we,Pe=Se;function Se(){var t=we.call(this)||this;return t.internalBounds=new Z(0,0,0,0),t.internalTemplateSize=new J(0,0),t}Object.defineProperty(Ce.prototype,"location",{get:function(){return this.pageNumberFieldLocation},set:function(t){this.pageNumberFieldLocation=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ce.prototype,"field",{get:function(){return this.pageNumberField},set:function(t){this.pageNumberField=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ce.prototype,"scalingX",{get:function(){return this.scaleX},set:function(t){this.scaleX=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ce.prototype,"scalingY",{get:function(){return this.scaleY},set:function(t){this.scaleY=t},enumerable:!0,configurable:!0});var ve=Ce;function Ce(t,e,i,r){this.pageNumberFieldLocation=new X,this.pageNumberField=null,this.scaleX=1,this.scaleY=1,void 0===e&&t instanceof Ce?(this.pageNumberField=t.field,this.pageNumberFieldLocation=t.location,this.scaleX=t.scalingX,this.scaleY=t.scalingY):void 0===i&&e instanceof X&&t instanceof Pe?(this.pageNumberField=t,this.pageNumberFieldLocation=e):(this.pageNumberField=t,this.pageNumberFieldLocation=e,this.scaleX=i,this.scaleY=r)}Object.defineProperty(Oe.prototype,"position",{get:function(){return this.mPosition},set:function(t){this.mPosition=t},enumerable:!0,configurable:!0}),Oe.prototype.read=function(t,e,i){for(var r=e;r<i;r++){var n=this.position;t.buffer[r]=this.readByte(n),this.position++}},Oe.prototype.getBuffer=function(t){return this.buffer[t]},Oe.prototype.writeFromBase64String=function(t){t=this.encodedString(t);this.buffer=t},Oe.prototype.encodedString=function(t){for(var e,i,r,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,a=0,h=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4,l=(t.charAt(t.length-1)===o.charAt(64)&&h--,new Uint8Array(0|h));s<t.length;)i=o.indexOf(t.charAt(s++)),e=(15&(r=o.indexOf(t.charAt(s++))))<<4|(n=o.indexOf(t.charAt(s++)))>>2,n=(3&n)<<6|o.indexOf(t.charAt(s++)),l[a++]=i<<2|r>>4,l[a++]=e,l[a++]=n;return l},Oe.prototype.readByte=function(t){return this.buffer[t]},Object.defineProperty(Oe.prototype,"internalBuffer",{get:function(){return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(Oe.prototype,"count",{get:function(){return this.buffer.byteLength},enumerable:!0,configurable:!0}),Oe.prototype.readNextTwoBytes=function(t){var e=t.readByte(this.position);return this.position++,e=(e<<=8)|t.readByte(this.position),this.position++,e};var Be=Oe;function Oe(t){this.mPosition=0,this.buffer=new Uint8Array(t),this.dataView=new DataView(this.buffer.buffer)}(w=Y.ImageFormat||(Y.ImageFormat={}))[w.Unknown=0]="Unknown",w[w.Bmp=1]="Bmp",w[w.Emf=2]="Emf",w[w.Gif=3]="Gif",w[w.Jpeg=4]="Jpeg",w[w.Png=5]="Png",w[w.Wmf=6]="Wmf",w[w.Icon=7]="Icon";Object.defineProperty(Le.prototype,"height",{get:function(){return this.mHeight},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"width",{get:function(){return this.mWidth},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"bitsPerComponent",{get:function(){return this.mbitsPerComponent},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"size",{get:function(){return this.mImageData.count},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"imageData",{get:function(){return this.mImageData},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"imageDataAsNumberArray",{get:function(){return this.mImageData.internalBuffer.buffer},enumerable:!0,configurable:!0}),Le.prototype.initialize=function(){if(this.mFormat!==Y.ImageFormat.Unknown||!this.checkIfJpeg())throw new TypeError("Only the JPEG format is supported");this.mFormat=Y.ImageFormat.Jpeg,this.parseJpegImage(),this.reset(),this.mImageData=new Be(this.mStream.count),this.mStream.read(this.mImageData,0,this.mImageData.count)},Le.prototype.reset=function(){this.mStream.position=0},Le.prototype.parseJpegImage=function(){this.reset();for(var t=new Be(this.mStream.count),e=(this.mStream.read(t,0,t.count),4),i=!1,r=256*t.getBuffer(e)+t.getBuffer(e+1);e<t.count;){if(!((e+=r)<t.count)){i=!0;break}if(192===t.getBuffer(e+1))return this.mHeight=256*t.getBuffer(e+5)+t.getBuffer(e+6),void(this.mWidth=256*t.getBuffer(e+7)+t.getBuffer(e+8));e+=2,r=256*t.getBuffer(e)+t.getBuffer(e+1)}i&&(this.mStream.position=0,this.skip(this.mStream,2),this.readExceededJPGImage(this.mStream))},Object.defineProperty(Le.prototype,"format",{get:function(){return this.mFormat},enumerable:!0,configurable:!0}),Le.prototype.checkIfJpeg=function(){this.reset();for(var t=0;t<Le.mJpegHeader.length;t++){if(Le.mJpegHeader[t]!==this.mStream.readByte(t))return!1;this.mStream.position++}return!0},Le.prototype.getImageDictionary=function(){if(this.mFormat===Y.ImageFormat.Jpeg){this.imageData.internalBuffer.length;this.imageStream=new U,this.imageStream.isResource=!0;for(var t="",e="",i=0;i<this.imageDataAsNumberArray.byteLength;i++)t+=String.fromCharCode(null,this.mStream.readByte(i));for(i=0;i<t.length;i++)i%2!=0&&(e+=t[i]);this.imageStream.data=[e],this.imageStream.compress=!1,this.imageStream.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.xObject)),this.imageStream.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.image)),this.imageStream.items.setValue(this.dictionaryProperties.width,new u(this.width)),this.imageStream.items.setValue(this.dictionaryProperties.height,new u(this.height)),this.imageStream.items.setValue(this.dictionaryProperties.bitsPerComponent,new u(this.bitsPerComponent)),this.imageStream.items.setValue(this.dictionaryProperties.filter,new o(this.dictionaryProperties.dctdecode)),this.imageStream.items.setValue(this.dictionaryProperties.colorSpace,new o(this.getColorSpace())),this.imageStream.items.setValue(this.dictionaryProperties.decodeParms,this.getDecodeParams())}return this.imageStream},Le.prototype.getColorSpace=function(){return this.dictionaryProperties.deviceRgb},Le.prototype.getDecodeParams=function(){var t=new c;return t.items.setValue(this.dictionaryProperties.columns,new u(this.width)),t.items.setValue(this.dictionaryProperties.blackIs1,new zt(!0)),t.items.setValue(this.dictionaryProperties.k,new u(-1)),t.items.setValue(this.dictionaryProperties.predictor,new u(15)),t.items.setValue(this.dictionaryProperties.bitsPerComponent,new u(this.bitsPerComponent)),t},Le.prototype.readExceededJPGImage=function(t){this.mStream=t;for(var e=!0;e;)switch(this.getMarker(t)){case this.sof1Marker:case this.sof2Marker:case this.sof3Marker:case this.sof5Marker:case this.sof6Marker:case this.sof7Marker:case this.sof9Marker:case this.sof10Marker:case this.sof11Marker:case this.sof13Marker:case this.sof14Marker:case this.sof15Marker:t.position+=3,this.mHeight=this.mStream.readNextTwoBytes(t),this.mWidth=this.mStream.readNextTwoBytes(t),e=!1;break;default:this.skipStream(t)}},Le.prototype.skip=function(t,e){this.mStream=t;t=new Be(e);this.mStream.read(t,0,t.count)},Le.prototype.getMarker=function(t){var e=32,e=t.readByte(this.mStream.position);for(t.position++;255!==e;)e=t.readByte(this.mStream.position),t.position++;for(;e=t.readByte(this.mStream.position),t.position++,255===e;);return e},Le.prototype.skipStream=function(t){var e=this.mStream.readNextTwoBytes(t)-2;0<e&&(t.position+=e)},Le.mPngHeader=[137,80,78,71,13,10,26,10],Le.mJpegHeader=[255,216],Le.GIF_HEADER="G,I,F,8",Le.BMP_HEADER="B,M";var xe=Le;function Le(t){this.sof1Marker=193,this.sof2Marker=194,this.sof3Marker=195,this.sof5Marker=197,this.sof6Marker=198,this.sof7Marker=199,this.sof9Marker=201,this.sof10Marker=202,this.sof11Marker=203,this.sof13Marker=205,this.sof14Marker=206,this.sof15Marker=207,this.mFormat=Y.ImageFormat.Unknown,this.mbitsPerComponent=8,this.dictionaryProperties=new l,this.mStream=t,this.initialize()}je.prototype.convertUnits=function(t,e,i){return this.convertFromPixels(this.convertToPixels(t,e),i)},je.prototype.convertToPixels=function(t,e){return t*this.proportions[e]},je.prototype.convertFromPixels=function(t,e){return t/this.proportions[e]},je.prototype.updateProportionsHelper=function(t){this.proportions=[t/2.54,t/6,1,t/72,t,t/300,t/25.4]},je.horizontalResolution=96,je.verticalResolution=96;var Te=je;function je(t){this.updateProportionsHelper(t)}Object.defineProperty(Ve.prototype,"width",{get:function(){return this.imageWidth},set:function(t){this.imageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ve.prototype,"height",{get:function(){return this.imageHeight},set:function(t){this.imageHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ve.prototype,"size",{set:function(t){this.width=t.width,this.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(Ve.prototype,"physicalDimension",{get:function(){return this.imagePhysicalDimension=this.getPointSize(this.width,this.height,this.horizontalResolution,this.verticalResolution),new J(this.width,this.height)},enumerable:!0,configurable:!0}),Object.defineProperty(Ve.prototype,"element",{get:function(){return this.imageStream},enumerable:!0,configurable:!0}),Ve.prototype.getPointSize=function(t,e,i,r){var n,o;return void 0===i?(n=Te.horizontalResolution,o=Te.verticalResolution,this.getPointSize(t,e,n,o)):(n=new Te(i),o=new Te(r),i=n.convertUnits(t,Y.PdfGraphicsUnit.Pixel,Y.PdfGraphicsUnit.Point),r=o.convertUnits(e,Y.PdfGraphicsUnit.Pixel,Y.PdfGraphicsUnit.Point),new J(i,r))};var ke=Ve;function Ve(){}Re=function(t,e){return(Re=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Re(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Ae,Me=ke),Ae.prototype.loadImage=function(t){this.initializeAsync(t)},Ae.prototype.initializeAsync=function(t){var e=new Be(t.length);e.writeFromBase64String(t),this.decoder=new xe(e),this.height=this.decoder.height,this.width=this.decoder.width,this.bitsPerComponent=this.decoder.bitsPerComponent},Ae.prototype.save=function(){this.imageStatus=!0,this.imageStream=this.decoder.getImageDictionary()};var Re,Me,De=Ae;function Ae(t){var e=Me.call(this)||this;return e.imageStatus=!0,e.dictionaryProperties=new l,e.loadImage(t),e}Object.defineProperty(Ie.prototype,"empty",{get:function(){return this.offset===this.length&&this.length===this.checksum&&0===this.checksum},enumerable:!0,configurable:!0});var Ne=Ie;function Ie(){}var Fe=function(){},Ee=function(){},Ge=function(){},ze=(Object.defineProperty(We.prototype,"isItalic",{get:function(){return 0!=(2&this.macStyle)},enumerable:!0,configurable:!0}),Object.defineProperty(We.prototype,"isBold",{get:function(){return 0!=(1&this.macStyle)},enumerable:!0,configurable:!0}),We);function We(){}var _e=function(){},He=function(){},Ue=function(){},Ke=function(){},qe=function(){},Ye=function(){},Xe=(Object.defineProperty(Je.prototype,"empty",{get:function(){return this.index===this.width&&this.width===this.charCode&&0===this.charCode},enumerable:!0,configurable:!0}),Je.prototype.compareTo=function(t){return this.index-t.index},Je);function Je(){}var Ze=function(){},$e=function(){},Qe=function(){},ti=function(){},ei=function(){},ii=(Object.defineProperty(ri.prototype,"data",{get:function(){if(this.buffer.length<this.bufferLength)for(var t=this.bufferLength-this.buffer.length,e=0;e<t;e++)this.buffer.push(0);return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(ri.prototype,"position",{get:function(){return void 0!==this.internalPosition&&null!==this.internalPosition||(this.internalPosition=0),this.internalPosition},enumerable:!0,configurable:!0}),ri.prototype.writeShort=function(t){this.flush([(65280&t)>>8,255&t])},ri.prototype.writeInt=function(t){this.flush([(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t])},ri.prototype.writeUInt=function(t){this.flush([(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t])},ri.prototype.writeString=function(t){if(null==t)throw new Error("Argument Null Exception : value");for(var e=[],i=0;i<t.length;i++)e.push(t.charCodeAt(i));this.flush(e)},ri.prototype.writeBytes=function(t){this.flush(t)},ri.prototype.flush=function(t){if(null===t)throw new Error("Argument Null Exception : buff");for(var e=this.position,i=0;i<t.length;i++)this.buffer[e]=t[i],e++;this.internalPosition+=t.length},ri);function ri(t){this.int32Size=4,this.int16Size=2,this.int64Size=8,this.bufferLength=t,this.buffer=[]}Object.defineProperty(b.prototype,"macintosh",{get:function(){return null!==this.macintoshDictionary&&void 0!==this.macintoshDictionary||(this.macintoshDictionary=new a),this.macintoshDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"microsoft",{get:function(){return null!==this.microsoftDictionary&&void 0!==this.microsoftDictionary||(this.microsoftDictionary=new a),this.microsoftDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"macintoshGlyphs",{get:function(){return null!==this.internalMacintoshGlyphs&&void 0!==this.internalMacintoshGlyphs||(this.internalMacintoshGlyphs=new a),this.internalMacintoshGlyphs},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"microsoftGlyphs",{get:function(){return null!==this.internalMicrosoftGlyphs&&void 0!==this.internalMicrosoftGlyphs||(this.internalMicrosoftGlyphs=new a),this.internalMicrosoftGlyphs},enumerable:!0,configurable:!0}),b.prototype.initialize=function(){void 0===this.metrics&&(this.metrics=new ze),this.readFontDictionary();var t=this.readNameTable(),e=this.readHeadTable();this.initializeFontName(t),this.metrics.macStyle=e.macStyle},b.prototype.readFontDictionary=function(){this.offset=0;this.checkPreambula();var t=this.readInt16(this.offset);this.readInt16(this.offset),this.readInt16(this.offset),this.readInt16(this.offset);void 0===this.tableDirectory&&(this.tableDirectory=new a);for(var e=0;e<t;++e){var i=new Ne,r=this.readString(this.int32Size);i.checksum=this.readInt32(this.offset),i.offset=this.readInt32(this.offset),i.length=this.readInt32(this.offset),this.tableDirectory.setValue(r,i)}this.lowestPosition=this.offset,this.isTtcFont||this.fixOffsets()},b.prototype.fixOffsets=function(){for(var t=Number.MAX_VALUE,e=this.tableDirectory.keys(),i=0;i<e.length;i++){var r=(o=this.tableDirectory.getValue(e[i])).offset;if(r<t&&(t=r)<=this.lowestPosition)break}var n=t-this.lowestPosition;if(0!=n){for(var o,s=new a,i=0;i<e.length;i++)(o=this.tableDirectory.getValue(e[i])).offset-=n,s.setValue(e[i],o);this.tableDirectory=s}},b.prototype.checkPreambula=function(){var t=this.readInt32(this.offset);if(this.isMacTtf=1953658213===t,65536!==t&&1953658213!==t&&1330926671!==t){if(this.isTtcFont=!0,this.offset=0,"ttcf"!==this.readString(4))throw new Error("Can not read TTF font data");if(this.offset+=4,this.readInt32(this.offset)<0)throw new Error("Can not read TTF font data");this.offset=this.readInt32(this.offset),t=this.readInt32(this.offset)}return t},b.prototype.readNameTable=function(){for(var t=this.getTable("name"),e=(this.offset=t.offset,new Fe),i=(e.formatSelector=this.readUInt16(this.offset),e.recordsCount=this.readUInt16(this.offset),e.offset=this.readUInt16(this.offset),e.nameRecords=[],this.offset),r=0;r<e.recordsCount;r++){this.offset=i;var n=new Ee,o=(n.platformID=this.readUInt16(this.offset),n.encodingID=this.readUInt16(this.offset),n.languageID=this.readUInt16(this.offset),n.nameID=this.readUInt16(this.offset),n.length=this.readUInt16(this.offset),n.offset=this.readUInt16(this.offset),this.offset=t.offset+e.offset+n.offset,0===n.platformID||3===n.platformID);n.name=this.readString(n.length,o),e.nameRecords[r]=n,i+=12}return e},b.prototype.readHeadTable=function(){var t=this.getTable("head"),t=(this.offset=t.offset,new Ge);return t.version=this.readFixed(this.offset),t.fontRevision=this.readFixed(this.offset),t.checkSumAdjustment=this.readUInt32(this.offset),t.magicNumber=this.readUInt32(this.offset),t.flags=this.readUInt16(this.offset),t.unitsPerEm=this.readUInt16(this.offset),t.created=this.readInt64(this.offset),t.modified=this.readInt64(this.offset),t.xMin=this.readInt16(this.offset),t.yMin=this.readInt16(this.offset),t.xMax=this.readInt16(this.offset),t.yMax=this.readInt16(this.offset),t.macStyle=this.readUInt16(this.offset),t.lowestReadableSize=this.readUInt16(this.offset),t.fontDirectionHint=this.readInt16(this.offset),t.indexToLocalFormat=this.readInt16(this.offset),t.glyphDataFormat=this.readInt16(this.offset),t},b.prototype.readHorizontalHeaderTable=function(){var t=this.getTable("hhea"),t=(this.offset=t.offset,new _e);return t.version=this.readFixed(this.offset),t.ascender=this.readInt16(this.offset),t.descender=this.readInt16(this.offset),t.lineGap=this.readInt16(this.offset),t.advanceWidthMax=this.readUInt16(this.offset),t.minLeftSideBearing=this.readInt16(this.offset),t.minRightSideBearing=this.readInt16(this.offset),t.xMaxExtent=this.readInt16(this.offset),t.caretSlopeRise=this.readInt16(this.offset),t.caretSlopeRun=this.readInt16(this.offset),this.offset+=10,t.metricDataFormat=this.readInt16(this.offset),t.numberOfHMetrics=this.readUInt16(this.offset),t},b.prototype.readOS2Table=function(){var t=this.getTable("OS/2"),t=(this.offset=t.offset,new He);return t.version=this.readUInt16(this.offset),t.xAvgCharWidth=this.readInt16(this.offset),t.usWeightClass=this.readUInt16(this.offset),t.usWidthClass=this.readUInt16(this.offset),t.fsType=this.readInt16(this.offset),t.ySubscriptXSize=this.readInt16(this.offset),t.ySubscriptYSize=this.readInt16(this.offset),t.ySubscriptXOffset=this.readInt16(this.offset),t.ySubscriptYOffset=this.readInt16(this.offset),t.ySuperscriptXSize=this.readInt16(this.offset),t.ySuperscriptYSize=this.readInt16(this.offset),t.ySuperscriptXOffset=this.readInt16(this.offset),t.ySuperscriptYOffset=this.readInt16(this.offset),t.yStrikeoutSize=this.readInt16(this.offset),t.yStrikeoutPosition=this.readInt16(this.offset),t.sFamilyClass=this.readInt16(this.offset),t.panose=this.readBytes(10),t.ulUnicodeRange1=this.readUInt32(this.offset),t.ulUnicodeRange2=this.readUInt32(this.offset),t.ulUnicodeRange3=this.readUInt32(this.offset),t.ulUnicodeRange4=this.readUInt32(this.offset),t.vendorIdentifier=this.readBytes(4),t.fsSelection=this.readUInt16(this.offset),t.usFirstCharIndex=this.readUInt16(this.offset),t.usLastCharIndex=this.readUInt16(this.offset),t.sTypoAscender=this.readInt16(this.offset),t.sTypoDescender=this.readInt16(this.offset),t.sTypoLineGap=this.readInt16(this.offset),t.usWinAscent=this.readUInt16(this.offset),t.usWinDescent=this.readUInt16(this.offset),t.ulCodePageRange1=this.readUInt32(this.offset),t.ulCodePageRange2=this.readUInt32(this.offset),1<t.version?(t.sxHeight=this.readInt16(this.offset),t.sCapHeight=this.readInt16(this.offset),t.usDefaultChar=this.readUInt16(this.offset),t.usBreakChar=this.readUInt16(this.offset),t.usMaxContext=this.readUInt16(this.offset)):(t.sxHeight=0,t.sCapHeight=0,t.usDefaultChar=0,t.usBreakChar=0,t.usMaxContext=0),t},b.prototype.readPostTable=function(){var t=this.getTable("post"),t=(this.offset=t.offset,new Ue);return t.formatType=this.readFixed(this.offset),t.italicAngle=this.readFixed(this.offset),t.underlinePosition=this.readInt16(this.offset),t.underlineThickness=this.readInt16(this.offset),t.isFixedPitch=this.readUInt32(this.offset),t.minType42=this.readUInt32(this.offset),t.maxType42=this.readUInt32(this.offset),t.minType1=this.readUInt32(this.offset),t.maxType1=this.readUInt32(this.offset),t},b.prototype.readWidthTable=function(t,e){for(var i=this.getTable("hmtx"),r=(this.offset=i.offset,[]),n=0;n<t;n++){var o=new Ke,o=(o.advanceWidth=this.readUInt16(this.offset),o.lsb=this.readInt16(this.offset),1e3*o.advanceWidth/e);r.push(Math.floor(o))}return r},b.prototype.readCmapTable=function(){for(var t=this.getTable("cmap"),e=(this.offset=t.offset,new Ye),i=(e.version=this.readUInt16(this.offset),e.tablesCount=this.readUInt16(this.offset),this.offset),r=[],n=0;n<e.tablesCount;n++){this.offset=i;var o=new qe;o.platformID=this.readUInt16(this.offset),o.encodingID=this.readUInt16(this.offset),o.offset=this.readUInt32(this.offset),i=this.offset,this.readCmapSubTable(o),r[n]=o}return r},b.prototype.readCmapSubTable=function(t){var e=this.getTable("cmap"),e=(this.offset=e.offset+t.offset,this.readUInt16(this.offset)),i=this.getCmapEncoding(t.platformID,t.encodingID);i===Y.TtfCmapEncoding.Macintosh?Y.TtfPlatformID.Macintosh:Y.TtfPlatformID.Microsoft;if(i!==Y.TtfCmapEncoding.Unknown)switch(e){case Y.TtfCmapFormat.Apple:this.readAppleCmapTable(t,i);break;case Y.TtfCmapFormat.Microsoft:this.readMicrosoftCmapTable(t,i);break;case Y.TtfCmapFormat.Trimmed:this.readTrimmedCmapTable(t,i)}},b.prototype.readAppleCmapTable=function(t,e){var i=this.getTable("cmap"),i=(this.offset=i.offset+t.offset,new $e);i.format=this.readUInt16(this.offset),i.length=this.readUInt16(this.offset),i.version=this.readUInt16(this.offset),null!==this.maxMacIndex&&void 0!==this.maxMacIndex||(this.maxMacIndex=0);for(var r=0;r<256;++r){var n=new Xe;n.index=this.readByte(this.offset),n.width=this.getWidth(n.index),n.charCode=r,this.macintosh.setValue(r,n),this.addGlyph(n,e),this.maxMacIndex=Math.max(r,this.maxMacIndex)}},b.prototype.readMicrosoftCmapTable=function(t,e){for(var i=this.getTable("cmap"),r=(this.offset=i.offset+t.offset,e===Y.TtfCmapEncoding.Unicode?this.microsoft:this.macintosh),n=new Qe,o=(n.format=this.readUInt16(this.offset),n.length=this.readUInt16(this.offset),n.version=this.readUInt16(this.offset),n.segCountX2=this.readUInt16(this.offset),n.searchRange=this.readUInt16(this.offset),n.entrySelector=this.readUInt16(this.offset),n.rangeShift=this.readUInt16(this.offset),n.segCountX2/2),i=(n.endCount=this.readUshortArray(o),n.reservedPad=this.readUInt16(this.offset),n.startCount=this.readUshortArray(o),n.idDelta=this.readUshortArray(o),n.idRangeOffset=this.readUshortArray(o),n.length/2-8-4*o),s=(n.glyphID=this.readUshortArray(i),0),a=0;a<o;a++)for(var h=n.startCount[a];h<=n.endCount[a]&&65535!==h;h++){if(0===n.idRangeOffset[a])s=h+n.idDelta[a]&65535;else{if((l=a+n.idRangeOffset[a]/2-o+h-n.startCount[a])>=n.glyphID.length)continue;s=n.glyphID[l]+n.idDelta[a]&65535}var l=new Xe,u=(l.index=s,l.width=this.getWidth(l.index),e===Y.TtfCmapEncoding.Symbol&&61440==(65280&h)?255&h:h);l.charCode=u,r.setValue(u,l),this.addGlyph(l,e)}},b.prototype.readTrimmedCmapTable=function(t,e){var i=this.getTable("cmap"),r=(this.offset=i.offset+t.offset,new ti);r.format=this.readUInt16(this.offset),r.length=this.readUInt16(this.offset),r.version=this.readUInt16(this.offset),r.firstCode=this.readUInt16(this.offset),r.entryCount=this.readUInt16(this.offset);for(var n=0;n<r.entryCount;++n){var o=new Xe;o.index=this.readUInt16(this.offset),o.width=this.getWidth(o.index),o.charCode=n+r.firstCode,this.macintosh.setValue(n,o),this.addGlyph(o,e),this.maxMacIndex=Math.max(n,this.maxMacIndex)}},b.prototype.initializeFontName=function(t){for(var e=0;e<t.recordsCount;e++){var i=t.nameRecords[e];if(1===i.nameID?this.metrics.fontFamily=i.name:6===i.nameID&&(this.metrics.postScriptName=i.name),null!==this.metrics.fontFamily&&void 0!==this.metrics.fontFamily&&null!==this.metrics.postScriptName&&void 0!==this.metrics.postScriptName)break}},b.prototype.getTable=function(t){var e,i=new Ne;return i=null!=(e=this.tableDirectory.containsKey(t)?this.tableDirectory.getValue(t):e)?e:i},b.prototype.getWidth=function(t){return t=t<this.width.length?t:this.width.length-1,this.width[t]},b.prototype.getCmapEncoding=function(t,e){var i=Y.TtfCmapEncoding.Unknown;return t==Y.TtfPlatformID.Microsoft&&e==Y.TtfMicrosoftEncodingID.Undefined?i=Y.TtfCmapEncoding.Symbol:t==Y.TtfPlatformID.Microsoft&&e==Y.TtfMicrosoftEncodingID.Unicode?i=Y.TtfCmapEncoding.Unicode:t==Y.TtfPlatformID.Macintosh&&e==Y.TtfMacintoshEncodingID.Roman&&(i=Y.TtfCmapEncoding.Macintosh),i},b.prototype.addGlyph=function(t,e){var i=null;switch(e){case Y.TtfCmapEncoding.Unicode:i=this.microsoftGlyphs;break;case Y.TtfCmapEncoding.Macintosh:case Y.TtfCmapEncoding.Symbol:i=this.macintoshGlyphs}i.setValue(t.index,t)},b.prototype.initializeMetrics=function(t,e,i,r,n,o){this.initializeFontName(t);for(var s=!1,a=0;a<o.length;a++){var h=o[a];if(this.getCmapEncoding(h.platformID,h.encodingID)===Y.TtfCmapEncoding.Symbol){s=!0;break}}this.metrics.isSymbol=s,this.metrics.macStyle=e.macStyle,this.metrics.isFixedPitch=0!==n.isFixedPitch,this.metrics.italicAngle=n.italicAngle;var t=1e3/e.unitsPerEm,n=(this.metrics.winAscent=r.sTypoAscender*t,this.metrics.macAscent=i.ascender*t,this.metrics.capHeight=0!==r.sCapHeight?r.sCapHeight:.7*e.unitsPerEm*t,this.metrics.winDescent=r.sTypoDescender*t,this.metrics.macDescent=i.descender*t,this.metrics.leading=(r.sTypoAscender-r.sTypoDescender+r.sTypoLineGap)*t,this.metrics.lineGap=Math.ceil(i.lineGap*t),e.xMin*t),i=Math.ceil(this.metrics.macAscent+this.metrics.lineGap),t=e.xMax*t,l=this.metrics.macDescent;this.metrics.fontBox=new ut(n,i,t,l),this.metrics.stemV=80,this.metrics.widthTable=this.updateWidth(),this.metrics.contains=this.tableDirectory.containsKey("CFF"),this.metrics.subScriptSizeFactor=e.unitsPerEm/r.ySubscriptYSize,this.metrics.superscriptSizeFactor=e.unitsPerEm/r.ySuperscriptYSize},b.prototype.updateWidth=function(){var t=[];if(this.metrics.isSymbol)for(var e=0;e<256;e++){var i=this.getGlyph(String.fromCharCode(e));t[e]=i.empty?0:i.width}else for(var r=[],n=String.fromCharCode(32),e=0;e<256;e++){r[0]=e;var o=this.getString(r,0,r.length),o=0<o.length?o[0]:"?";(i=this.getGlyph(o)).empty?(i=this.getGlyph(n),t[e]=i.empty?0:i.width):t[e]=i.width}return t},b.prototype.getDefaultGlyph=function(){return this.getGlyph(Pt.whiteSpace)},b.prototype.getString=function(t,e,i){for(var r="",n=0;n<i;n++)r+=String.fromCharCode(t[n+e]);return r},b.prototype.readLocaTable=function(t){var e=this.getTable("loca"),i=(this.offset=e.offset,new Ze),r=null;if(t)for(var n=e.length/2,r=[],o=0;o<n;o++)r[o]=2*this.readUInt16(this.offset);else{n=e.length/4;r=[];for(o=0;o<n;o++)r[o]=this.readUInt32(this.offset)}return i.offsets=r,i},b.prototype.updateGlyphChars=function(t,e){t.containsKey(0)||t.setValue(0,0);for(var i=new a,r=t.keys(),n=0;n<r.length;n++)i.setValue(r[n],t.getValue(r[n]));for(n=0;n<r.length;n++){var o=r[n];this.processCompositeGlyph(t,o,e)}},b.prototype.processCompositeGlyph=function(t,e,i){if(e<i.offsets.length-1){var r=i.offsets[e];if(r!==i.offsets[e+1]){i=this.getTable("glyf"),e=(this.offset=i.offset+r,new ei);if(e.numberOfContours=this.readInt16(this.offset),e.xMin=this.readInt16(this.offset),e.yMin=this.readInt16(this.offset),e.xMax=this.readInt16(this.offset),e.yMax=this.readInt16(this.offset),e.numberOfContours<0)for(var n=0;;){var o=this.readUInt16(this.offset),s=this.readUInt16(this.offset);if(t.containsKey(s)||t.setValue(s,0),0==(o&Y.TtfCompositeGlyphFlags.MoreComponents))break;n=0!=(o&Y.TtfCompositeGlyphFlags.Arg1And2AreWords)?4:2,0!=(o&Y.TtfCompositeGlyphFlags.WeHaveScale)?n+=2:0!=(o&Y.TtfCompositeGlyphFlags.WeHaveAnXyScale)?n+=4:0!=(o&Y.TtfCompositeGlyphFlags.WeHaveTwoByTwo)&&(n+=8),this.offset+=n}}}},b.prototype.generateGlyphTable=function(t,e,i,r){i=[];for(var n=t.keys(),o=(n.sort(function(t,e){return t-e}),0),s=0;s<n.length;s++){var a=n[s];0<e.offsets.length&&(o+=e.offsets[a+1]-e.offsets[a])}var h=this.align(o);r=[];for(s=0;s<h;s++)r.push(0);for(var l,u,c=0,p=0,d=this.getTable("glyf"),s=0;s<e.offsets.length;s++)i.push(c),p<n.length&&n[p]===s&&(++p,i[s]=c,l=e.offsets[s],0<(u=e.offsets[s+1]-l))&&(this.offset=d.offset+l,r=this.read(r,c,u).buffer,c+=u);return{glyphTableSize:o,newLocaTable:i,newGlyphTable:r}},b.prototype.updateLocaTable=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTable");for(var r=e?2*t.length:4*t.length,n=this.align(r),o=new ii(n),s=0;s<t.length;s++){var a=t[s];e?(a/=2,o.writeShort(a)):o.writeInt(a)}return{newLocaUpdated:o.data,newLocaSize:r}},b.prototype.align=function(t){return t+3&-4},b.prototype.getFontProgram=function(t,e,i,r){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");this.tableNames;var n=this.getFontProgramLength(t,e,0),o=n.fontProgramLength,n=n.numTables,o=new ii(o),s=(o.writeInt(65536),o.writeShort(n),this.entrySelectors[n]);return o.writeShort(16*(1<<(31&s))),o.writeShort(s),o.writeShort(16*(n-(1<<(31&s)))),this.writeCheckSums(o,n,t,e,i,r),this.writeGlyphs(o,t,e),o.data},b.prototype.getFontProgramLength=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");i=2;for(var r=this.tableNames,n=0,o=0;o<r.length;o++){var s=r[o];"glyf"===s||"loca"===s||(s=this.getTable(s)).empty||(++i,n+=this.align(s.length))}return{fontProgramLength:n=(n+=t.length)+e.length+(16*i+12),numTables:i}},b.prototype.writeCheckSums=function(t,e,i,r,n,o){if(null===t)throw new Error("Argument Null Exception : writer");if(null===i)throw new Error("Argument Null Exception : newLocaTableOut");if(null===r)throw new Error("Argument Null Exception : newGlyphTable");for(var s=this.tableNames,a=16*e+12,h=0,l=0;l<s.length;l++){var u,c=s[l],p=this.getTable(c);p.empty||(t.writeString(c),h="glyf"===c?(u=this.calculateCheckSum(r),t.writeInt(u),n):"loca"===c?(u=this.calculateCheckSum(i),t.writeInt(u),o):(t.writeInt(p.checksum),p.length),t.writeUInt(a),t.writeUInt(h),a+=this.align(h))}},b.prototype.calculateCheckSum=function(t){if(null===t)throw new Error("Argument Null Exception : bytes");for(var e=0,i=0,r=0,n=0,o=0,s=0;s<(t.length+1)/4;s++)o+=255&t[e++],n+=255&t[e++],r+=255&t[e++],i+=255&t[e++];var a=i;return(a+=r<<8)+(n<<16)+(o<<24)},b.prototype.writeGlyphs=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : writer");if(null===e)throw new Error("Argument Null Exception : newLocaTableOut");if(null===i)throw new Error("Argument Null Exception : newGlyphTable");for(var r=this.tableNames,n=0;n<r.length;n++){var o=r[n],s=this.getTable(o);if(!s.empty)if("glyf"===o)t.writeBytes(i);else if("loca"===o)t.writeBytes(e);else{for(var a=this.align(s.length),h=[],l=0;l<a;l++)h.push(0);this.offset=s.offset;o=this.read(h,0,s.length);t.writeBytes(o.buffer)}}},b.prototype.setOffset=function(t){this.offset=t},b.prototype.createInternals=function(){this.metrics=new ze;var t=this.readNameTable(),e=this.readHeadTable(),i=(this.bIsLocaShort=0===e.indexToLocalFormat,this.readHorizontalHeaderTable()),r=this.readOS2Table(),n=this.readPostTable(),o=(this.width=this.readWidthTable(i.numberOfHMetrics,e.unitsPerEm),this.readCmapTable());this.initializeMetrics(t,e,i,r,n,o)},b.prototype.getGlyph=function(t){var e,i;return"number"==typeof t?(e=null,this.metrics.isSymbol||null==this.microsoftGlyphs?this.metrics.isSymbol&&null!=this.macintoshGlyphs&&this.macintoshGlyphs.containsKey(t)&&(e=this.macintoshGlyphs.getValue(t)):this.microsoftGlyphs.containsKey(t)&&(e=this.microsoftGlyphs.getValue(t)),null!=e?e:this.getDefaultGlyph()):(e=null,i=t.charCodeAt(0),this.metrics.isSymbol||null===this.microsoft?(this.metrics.isSymbol&&null!==this.macintosh||this.isMacTTF)&&(0!==this.maxMacIndex?i%=this.maxMacIndex+1:i=61440==(65280&i)?255&i:i,this.macintosh.containsKey(i))&&(e=this.macintosh.getValue(i),this.isFontPresent=!0):this.microsoft.containsKey(i)?(e=this.microsoft.getValue(i),i!==Pt.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!0)):i!==Pt.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!1),null!==(e=t===Pt.whiteSpace&&null===e?new Xe:e)?e:this.getDefaultGlyph())},b.prototype.getGlyphChars=function(t){if(null==t)throw new Error("Argument Null Exception : chars");for(var e=new a,i=t.keys(),r=0;r<i.length;r++){var n=i[r],o=this.getGlyph(n);o.empty||e.setValue(o.index,n.charCodeAt(0))}return e},b.prototype.getAllGlyphs=function(){for(var t=[],e=new Xe,i=0,r=0;r<this.width.length;r++){var n=this.width[r];e.index=i,e.width=n,t.push(e),i++}return t},b.prototype.readFontProgram=function(t){var e=this.getGlyphChars(t),i=this.readLocaTable(this.bIsLocaShort),t=(e.size()<t.size()&&(this.missedGlyphs=t.size()-e.size()),this.updateGlyphChars(e,i),this.generateGlyphTable(e,i,null,null)),e=t.glyphTableSize,i=t.newLocaTable,t=t.newGlyphTable,i=this.updateLocaTable(i,this.bIsLocaShort,null),r=i.newLocaSize,i=i.newLocaUpdated;return this.getFontProgram(i,t,e,r)},b.prototype.convertString=function(t){if(null===t)throw new Error("Argument Null Exception : text");for(var e="",i=0;i<t.length;i++){var r=t[i],r=this.getGlyph(r);r.empty||(e+=String.fromCharCode(r.index))}return e},b.prototype.getCharWidth=function(t){t=this.getGlyph(t);return(t=t.empty?this.getDefaultGlyph():t).empty?0:t.width},b.prototype.readString=function(t,e){if(void 0===e)return this.readString(t,!1);var i="";if(e)for(var r=0;r<t;r++)r%2!=0&&(i+=String.fromCharCode(this.fontData[this.offset])),this.offset+=1;else for(r=0;r<t;r++)i+=String.fromCharCode(this.fontData[this.offset]),this.offset+=1;return i},b.prototype.readFixed=function(t){return this.readInt16(t)+this.readInt16(t+2)/16384},b.prototype.readInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],t=this.fontData[t];return this.offset+=4,e+(i<<8)+(r<<16)+(t<<24)},b.prototype.readUInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],t=this.fontData[t];return this.offset+=4,e|i<<8|r<<16|t<<24},b.prototype.readInt16=function(t){t=32768&(t=(this.fontData[t]<<8)+this.fontData[t+1])?t-65536:t;return this.offset+=2,t},b.prototype.readInt64=function(t){var e=this.readInt32(t+4),t=4294967296*this.readInt32(t)+e;return e<0&&(t+=4294967296),t},b.prototype.readUInt16=function(t){t=this.fontData[t]<<8|this.fontData[t+1];return this.offset+=2,t},b.prototype.readUshortArray=function(t){for(var e=[],i=0;i<t;i++)e[i]=this.readUInt16(this.offset);return e},b.prototype.readBytes=function(t){for(var e=[],i=0;i<t;i++)e.push(this.fontData[this.offset]),this.offset+=1;return e},b.prototype.readByte=function(t){t=this.fontData[t];return this.offset+=1,t},b.prototype.read=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : buffer");var r,n=0;do{for(var o=0;o<i-n&&this.offset+o<this.fontData.length;o++)t[e+o]=this.fontData[this.offset+o]}while(this.offset+=r=i-n,(n+=r)<i);return{buffer:t,written:n}};var ni=b;function b(t){this.int32Size=4,this.isTtcFont=!1,this.isMacTtf=!1,this.metricsName="",this.isMacTTF=!1,this.missedGlyphs=0,this.tableNames=["cvt ","fpgm","glyf","head","hhea","hmtx","loca","maxp","prep"],this.entrySelectors=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4],this.fontData=t,this.initialize()}oi=function(t,e){return(oi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var oi,w=function(t,e){function i(){this.constructor=t}oi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},si=(ai.prototype.getAscent=function(t){return this.ascent*Tt.charSizeMultiplier*this.getSize(t)},ai.prototype.getDescent=function(t){return this.descent*Tt.charSizeMultiplier*this.getSize(t)},ai.prototype.getLineGap=function(t){return this.lineGap*Tt.charSizeMultiplier*this.getSize(t)},ai.prototype.getHeight=function(t){t=this.getDescent(t)<0?this.getAscent(t)-this.getDescent(t)+this.getLineGap(t):this.getAscent(t)+this.getDescent(t)+this.getLineGap(t);return t},ai.prototype.getSize=function(t){var e=this.size;if(null!=t)switch(t.subSuperScript){case Y.PdfSubSuperScript.SubScript:e/=this.subScriptSizeFactor;break;case Y.PdfSubSuperScript.SuperScript:e/=this.superscriptSizeFactor}return e},ai.prototype.clone=function(){return this.widthTable=hi.clone(),this},Object.defineProperty(ai.prototype,"widthTable",{get:function(){return this.internalWidthTable},set:function(t){this.internalWidthTable=t},enumerable:!0,configurable:!0}),ai);function ai(){this.lineGap=0}li.clone=function(){return null};var hi=li;function li(){}w(pi,ui=hi),pi.prototype.items=function(t){if(t<0||t>=this.widths.length)throw new Error("ArgumentOutOfRangeException:index, The character is not supported by the font.");return this.widths[t]},Object.defineProperty(pi.prototype,"length",{get:function(){return this.widths.length},enumerable:!0,configurable:!0}),pi.prototype.clone=function(){return this.widths=this.widths,this},pi.prototype.toArray=function(){return new p(this.widths)};var ui,ci=pi;function pi(t){var e=ui.call(this)||this;if(null==t)throw new Error("ArgumentNullException:widths");return e.widths=t,e}P.prototype.getCharWidth=function(t){return this.ttfReader.getCharWidth(t)},P.prototype.getLineWidth=function(t){for(var e=0,i=0,r=t.length;i<r;i++){var n=t[i];e+=this.getCharWidth(n)}return e},P.prototype.Initialize=function(){var t=new Be(this.fontString.length);t.writeFromBase64String(this.fontString),this.fontData=t.internalBuffer,this.ttfReader=new ni(this.fontData),this.ttfMetrics=this.ttfReader.metrics},P.prototype.createInternals=function(){this.fontDictionary=new c,this.fontProgram=new U,this.cmap=new U,this.descendantFont=new c,this.metrics=new si,this.ttfReader.createInternals(),this.ttfMetrics=this.ttfReader.metrics,this.initializeMetrics(),this.subsetName=this.getFontName(),this.createDescendantFont(),this.createCmap(),this.createFontDictionary(),this.createFontProgram()},P.prototype.getInternals=function(){return this.fontDictionary},P.prototype.initializeMetrics=function(){var t=this.ttfReader.metrics;this.metrics.ascent=t.macAscent,this.metrics.descent=t.macDescent,this.metrics.height=t.macAscent-t.macDescent+t.lineGap,this.metrics.name=t.fontFamily,this.metrics.postScriptName=t.postScriptName,this.metrics.size=this.fontSize,this.metrics.widthTable=new ci(t.widthTable),this.metrics.lineGap=t.lineGap,this.metrics.subScriptSizeFactor=t.subScriptSizeFactor,this.metrics.superscriptSizeFactor=t.superscriptSizeFactor,this.metrics.isBold=t.isBold},P.prototype.getFontName=function(){for(var t,e="",i=0;i<6;i++){var r=Math.floor(26*Math.random())+0;e+=this.nameString[r]}return t=(e=e+"+"+this.ttfReader.metrics.postScriptName).toString(),this.formatName(t)},P.prototype.formatName=function(t){t=t.replace("(","#28");return(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(")","#29")).replace("[","#5B")).replace("]","#5D")).replace("<","#3C")).replace(">","#3E")).replace("{","#7B")).replace("}","#7D")).replace("/","#2F")).replace("%","#25")).replace(" ","#20")},P.prototype.createDescendantFont=function(){this.descendantFont.isResource=!0,this.descendantFont.descendantFontBeginSave=new I(this),this.descendantFont.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.descendantFont.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.cIDFontType2)),this.descendantFont.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.descendantFont.items.setValue(this.dictionaryProperties.cIDToGIDMap,new o(this.dictionaryProperties.identity)),this.descendantFont.items.setValue(this.dictionaryProperties.dw,new u(1e3)),this.fontDescriptor=this.createFontDescriptor(),this.descendantFont.items.setValue(this.dictionaryProperties.fontDescriptor,new d(this.fontDescriptor));var t=this.createSystemInfo();this.descendantFont.items.setValue(this.dictionaryProperties.cIDSystemInfo,t)},P.prototype.createFontDescriptor=function(){var t=new c,e=this.ttfReader.metrics;return t.isResource=!0,t.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.fontDescriptor)),t.items.setValue(this.dictionaryProperties.fontName,new o(this.subsetName)),t.items.setValue(this.dictionaryProperties.flags,new u(this.getDescriptorFlags())),t.items.setValue(this.dictionaryProperties.fontBBox,p.fromRectangle(this.getBoundBox())),t.items.setValue(this.dictionaryProperties.missingWidth,new u(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.stemV,new u(e.stemV)),t.items.setValue(this.dictionaryProperties.italicAngle,new u(e.italicAngle)),t.items.setValue(this.dictionaryProperties.capHeight,new u(e.capHeight)),t.items.setValue(this.dictionaryProperties.ascent,new u(e.winAscent)),t.items.setValue(this.dictionaryProperties.descent,new u(e.winDescent)),t.items.setValue(this.dictionaryProperties.leading,new u(e.leading)),t.items.setValue(this.dictionaryProperties.avgWidth,new u(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.fontFile2,new d(this.fontProgram)),t.items.setValue(this.dictionaryProperties.maxWidth,new u(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.xHeight,new u(0)),t.items.setValue(this.dictionaryProperties.stemH,new u(0)),t},P.prototype.createCmap=function(){this.cmap.cmapBeginSave=new q(this)},P.prototype.createFontDictionary=function(){this.fontDictionary.isResource=!0,this.fontDictionary.fontDictionaryBeginSave=new F(this),this.fontDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.fontDictionary.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.fontDictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type0)),this.fontDictionary.items.setValue(this.dictionaryProperties.encoding,new o(this.dictionaryProperties.identityH));var t=new p,e=new d(this.descendantFont);t.isFont=!0,t.add(e),this.fontDictionary.items.setValue(this.dictionaryProperties.descendantFonts,t)},P.prototype.createFontProgram=function(){this.fontProgram.fontProgramBeginSave=new Q(this)},P.prototype.createSystemInfo=function(){var t=new c;return t.items.setValue(this.dictionaryProperties.registry,new tt("Adobe")),t.items.setValue(this.dictionaryProperties.ordering,new tt(this.dictionaryProperties.identity)),t.items.setValue(this.dictionaryProperties.supplement,new u(0)),t},P.prototype.descendantFontBeginSave=function(){var t;null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()&&null!==(t=this.getDescendantWidth())&&this.descendantFont.items.setValue(this.dictionaryProperties.w,t)},P.prototype.cmapBeginSave=function(){this.generateCmap()},P.prototype.fontDictionaryBeginSave=function(){null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()&&!this.fontDictionary.containsKey(this.dictionaryProperties.toUnicode)&&this.fontDictionary.items.setValue(this.dictionaryProperties.toUnicode,new d(this.cmap))},P.prototype.fontProgramBeginSave=function(){this.isCompress=!0,this.generateFontProgram()},P.prototype.getDescendantWidth=function(){var t=new p;if(null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()){for(var e=[],i=this.usedChars.keys(),r=0;r<i.length;r++){var n=i[r];(l=this.ttfReader.getGlyph(n)).empty||e.push(l)}e.sort(function(t,e){return t.index-e.index});for(var o=0,s=0,a=!1,h=new p,r=0;r<e.length;r++){var l=e[r];a||(a=!0,o=l.index,s=l.index-1),(s+1!==l.index||r+1===e.length)&&1<e.length&&(t.add(new u(o)),0!==r&&t.add(h),o=l.index,h=new p),h.add(new u(l.width)),r+1===e.length&&(t.add(new u(o)),t.add(h)),s=l.index}}return t},P.prototype.generateCmap=function(){if(null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()){var t=this.ttfReader.getGlyphChars(this.usedChars);if(0<t.size()){for(var e=t.keys().sort(),i=e[0],r=e[e.length-1],i=this.toHexString(i,!1)+this.toHexString(r,!1)+h.newLine,n="",o=(n=(n+=this.cmapPrefix)+i+this.cmapEndCodespaceRange,0),s=0;s<e.length;s++){0===o&&(0!==s&&(n+=this.cmapEndRange),n=(n=n+(o=Math.min(100,e.length-s))+h.whiteSpace)+this.cmapBeginRange),--o;var a=e[s];n+=this.toHexString(a,!0)+this.toHexString(a,!0)+this.toHexString(t.getValue(a),!0)+"\n"}n+=this.cmapSuffix,this.cmap.clearStream(),this.cmap.isResource=!0,this.cmap.write(n)}}},P.prototype.generateFontProgram=function(){var t;this.usedChars=null===this.usedChars||void 0===this.usedChars?new a:this.usedChars,this.ttfReader.setOffset(0),t=this.ttfReader.readFontProgram(this.usedChars),this.fontProgram.clearStream(),this.fontProgram.isResource=!0,this.fontProgram.writeBytes(t)},P.prototype.getDescriptorFlags=function(){var t=0,e=this.ttfReader.metrics;return e.isFixedPitch&&(t|=Y.FontDescriptorFlags.FixedPitch),e.isSymbol?t|=Y.FontDescriptorFlags.Symbolic:t|=Y.FontDescriptorFlags.Nonsymbolic,e.isItalic&&(t|=Y.FontDescriptorFlags.Italic),e.isBold&&(t|=Y.FontDescriptorFlags.ForceBold),t},P.prototype.getBoundBox=function(){var t=this.ttfReader.metrics.fontBox,e=Math.abs(t.right-t.left),i=Math.abs(t.top-t.bottom);return new Z(t.left,t.bottom,e,i)},P.prototype.toHexString=function(t,e){t=t.toString(16);return e&&(t=t.toUpperCase()),"<0000".substring(0,5-t.length)+t+">"},P.prototype.setSymbols=function(t){if(null===t)throw new Error("Argument Null Exception : text");null!==this.usedChars&&void 0!==this.usedChars||(this.usedChars=new a);for(var e=0;e<t.length;e++){var i=t[e];this.usedChars.setValue(i,String.fromCharCode(0))}!1===this.isEmbedFont&&this.getDescendantWidth()};var di=P;function P(t,e){if(this.nameString="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.dictionaryProperties=new l,this.isCompress=!1,this.isEmbedFont=!1,this.cmapPrefix="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap"+h.newLine+"/CIDSystemInfo << /Registry (Adobe)/Ordering (UCS)/Supplement 0>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange"+h.newLine,this.cmapEndCodespaceRange="endcodespacerange"+h.newLine,this.cmapBeginRange="beginbfrange"+h.newLine,this.cmapEndRange="endbfrange"+h.newLine,this.cmapSuffix="endbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend end"+h.newLine,null==t)throw new Error("ArgumentNullException:base64String");this.fontSize=e,this.fontString=t,this.Initialize()}gi.prototype.getCharacterShape=function(t,e){if(t>=this.hamza&&t<=this.bwhb){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t)[e+1]}else if(t>=this.lwawm&&t<=this.lwa);return t},gi.prototype.shape=function(t,e){for(var i="",r="",n=0;n<t.length;n++){var o=t[n];""<=o&&o<="ۿ"?r+=o:(0<r.length&&(i+=this.doShape(r.toString(),0),r=""),i+=o)}return 0<r.length&&(i+=this.doShape(r.toString(),0)),i.toString()},gi.prototype.doShape=function(t,e){for(var i="",r=0,n=0,o=new mi,s=new mi;n<t.length;){var a,h=t[n++];0===this.ligature(h,s)&&(r=1===(a=this.getShapeCount(h))?0:2,2<o.Shapes&&(r+=1),r%=s.Shapes,s.Value=this.getCharacterShape(s.Value,r),i=this.append(i,o,e),o=s,(s=new mi).Value=h,s.Shapes=a,s.Ligature++)}return r=2<o.Shapes?1:0,r%=s.Shapes,s.Value=this.getCharacterShape(s.Value,r),i=this.append(i,o,e),(i=this.append(i,s,e)).toString()},gi.prototype.append=function(t,e,i){return""!==e.Value&&(t+=e.Value,--e.Ligature,""!==e.Type&&(0==(i&this.vowel)&&(t+=e.Type),--e.Ligature),""!==e.vowel)&&(0==(i&this.vowel)&&(t+=e.vowel),--e.Ligature),t},gi.prototype.ligature=function(t,e){if(""===e.Value)return 0;var i=0;if(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef){if(i=1,""!==e.vowel&&t!==this.shadda&&(i=2),t===this.shadda){if(null!=e.Type)return 0;e.Type=this.shadda}else t===this.hamzaBelow?e.Value===this.alef?(e.Value=this.alefHamzaBelow,i=2):t===this.lwa?(e.Value=this.lwawhb,i=2):e.Type=this.hamzaBelow:t===this.hamzaAbove?e.Value===this.alef?(e.Value=this.alefHamza,i=2):e.Value===this.lwa?(e.Value=this.lwawh,i=2):e.Value===this.waw?(e.Value=this.wawHamza,i=2):e.Value===this.yeh||e.Value===this.alefMaksura||e.Value===this.farsiYeh?(e.Value=this.yehHamza,i=2):e.Type=this.hamzaAbove:t===this.madda?e.Value===this.alef&&(e.Value=this.alefMadda,i=2):e.vowel=t;1===i&&e.Ligature++}else{if(""!==e.vowel)return 0;e.Value===this.lam&&(t===this.alef?(e.Value=this.lwa,e.Shapes=2,i=3):t===this.alefHamza?(e.Value=this.lwawh,e.Shapes=2,i=3):t===this.alefHamzaBelow?(e.Value=this.lwawhb,e.Shapes=2,i=3):t===this.alefMadda&&(e.Value=this.lwawm,e.Shapes=2,i=3))}return i},gi.prototype.getShapeCount=function(t){if(t>=this.hamza&&t<=this.bwhb&&!(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef)){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t).length-1}else if(t===this.zeroWidthJoiner)return 4;return 1};var fi=gi;function gi(){this.arabicCharTable=[["ء","ﺀ"],["آ","ﺁ","ﺂ"],["أ","ﺃ","ﺄ"],["ؤ","ﺅ","ﺆ"],["إ","ﺇ","ﺈ"],["ئ","ﺉ","ﺊ","ﺋ","ﺌ"],["ا","ﺍ","ﺎ"],["ب","ﺏ","ﺐ","ﺑ","ﺒ"],["ة","ﺓ","ﺔ"],["ت","ﺕ","ﺖ","ﺗ","ﺘ"],["ث","ﺙ","ﺚ","ﺛ","ﺜ"],["ج","ﺝ","ﺞ","ﺟ","ﺠ"],["ح","ﺡ","ﺢ","ﺣ","ﺤ"],["خ","ﺥ","ﺦ","ﺧ","ﺨ"],["د","ﺩ","ﺪ"],["ذ","ﺫ","ﺬ"],["ر","ﺭ","ﺮ"],["ز","ﺯ","ﺰ"],["س","ﺱ","ﺲ","ﺳ","ﺴ"],["ش","ﺵ","ﺶ","ﺷ","ﺸ"],["ص","ﺹ","ﺺ","ﺻ","ﺼ"],["ض","ﺽ","ﺾ","ﺿ","ﻀ"],["ط","ﻁ","ﻂ","ﻃ","ﻄ"],["ظ","ﻅ","ﻆ","ﻇ","ﻈ"],["ع","ﻉ","ﻊ","ﻋ","ﻌ"],["غ","ﻍ","ﻎ","ﻏ","ﻐ"],["ـ","ـ","ـ","ـ","ـ"],["ف","ﻑ","ﻒ","ﻓ","ﻔ"],["ق","ﻕ","ﻖ","ﻗ","ﻘ"],["ك","ﻙ","ﻚ","ﻛ","ﻜ"],["ل","ﻝ","ﻞ","ﻟ","ﻠ"],["م","ﻡ","ﻢ","ﻣ","ﻤ"],["ن","ﻥ","ﻦ","ﻧ","ﻨ"],["ه","ﻩ","ﻪ","ﻫ","ﻬ"],["و","ﻭ","ﻮ"],["ى","ﻯ","ﻰ","ﯨ","ﯩ"],["ي","ﻱ","ﻲ","ﻳ","ﻴ"],["ٱ","ﭐ","ﭑ"],["ٹ","ﭦ","ﭧ","ﭨ","ﭩ"],["ٺ","ﭞ","ﭟ","ﭠ","ﭡ"],["ٻ","ﭒ","ﭓ","ﭔ","ﭕ"],["پ","ﭖ","ﭗ","ﭘ","ﭙ"],["ٿ","ﭢ","ﭣ","ﭤ","ﭥ"],["ڀ","ﭚ","ﭛ","ﭜ","ﭝ"],["ڃ","ﭶ","ﭷ","ﭸ","ﭹ"],["ڄ","ﭲ","ﭳ","ﭴ","ﭵ"],["چ","ﭺ","ﭻ","ﭼ","ﭽ"],["ڇ","ﭾ","ﭿ","ﮀ","ﮁ"],["ڈ","ﮈ","ﮉ"],["ڌ","ﮄ","ﮅ"],["ڍ","ﮂ","ﮃ"],["ڎ","ﮆ","ﮇ"],["ڑ","ﮌ","ﮍ"],["ژ","ﮊ","ﮋ"],["ڤ","ﭪ","ﭫ","ﭬ","ﭭ"],["ڦ","ﭮ","ﭯ","ﭰ","ﭱ"],["ک","ﮎ","ﮏ","ﮐ","ﮑ"],["ڭ","ﯓ","ﯔ","ﯕ","ﯖ"],["گ","ﮒ","ﮓ","ﮔ","ﮕ"],["ڱ","ﮚ","ﮛ","ﮜ","ﮝ"],["ڳ","ﮖ","ﮗ","ﮘ","ﮙ"],["ں","ﮞ","ﮟ"],["ڻ","ﮠ","ﮡ","ﮢ","ﮣ"],["ھ","ﮪ","ﮫ","ﮬ","ﮭ"],["ۀ","ﮤ","ﮥ"],["ہ","ﮦ","ﮧ","ﮨ","ﮩ"],["ۅ","ﯠ","ﯡ"],["ۆ","ﯙ","ﯚ"],["ۇ","ﯗ","ﯘ"],["ۈ","ﯛ","ﯜ"],["ۉ","ﯢ","ﯣ"],["ۋ","ﯞ","ﯟ"],["ی","ﯼ","ﯽ","ﯾ","ﯿ"],["ې","ﯤ","ﯥ","ﯦ","ﯧ"],["ے","ﮮ","ﮯ"],["ۓ","ﮰ","ﮱ"]],this.alef="ا",this.alefHamza="أ",this.alefHamzaBelow="إ",this.alefMadda="آ",this.lam="ل",this.hamza="ء",this.zeroWidthJoiner="",this.hamzaAbove="ٔ",this.hamzaBelow="ٕ",this.wawHamza="ؤ",this.yehHamza="ئ",this.waw="و",this.alefMaksura="ى",this.yeh="ي",this.farsiYeh="ی",this.shadda="ّ",this.madda="ٓ",this.lwa="ﻻ",this.lwawh="ﻷ",this.lwawhb="ﻹ",this.lwawm="ﻵ",this.bwhb="ۓ",this.fathatan="ً",this.superScriptalef="ٰ",this.vowel=1,this.arabicMapTable=new a;for(var t=0;t<this.arabicCharTable.length;t++)this.arabicMapTable.setValue(this.arabicCharTable[t][0],this.arabicCharTable[t])}Object.defineProperty(yi.prototype,"Value",{get:function(){return this.shapeValue},set:function(t){this.shapeValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(yi.prototype,"Type",{get:function(){return this.shapeType},set:function(t){this.shapeType=t},enumerable:!0,configurable:!0}),Object.defineProperty(yi.prototype,"vowel",{get:function(){return this.shapeVowel},set:function(t){this.shapeVowel=t},enumerable:!0,configurable:!0}),Object.defineProperty(yi.prototype,"Ligature",{get:function(){return this.shapeLigature},set:function(t){this.shapeLigature=t},enumerable:!0,configurable:!0}),Object.defineProperty(yi.prototype,"Shapes",{get:function(){return this.shapeShapes},set:function(t){this.shapeShapes=t},enumerable:!0,configurable:!0});var mi=yi;function yi(){this.shapeValue="",this.shapeType="",this.shapeVowel="",this.shapeLigature=0,this.shapeShapes=1}wi.prototype.doMirrorShaping=function(t){for(var e=[],i=0;i<t.length;i++)1==(1&this.indexLevels[i])&&this.mirroringShapeCharacters.containsKey(t[i].charCodeAt(0))?e[i]=String.fromCharCode(this.mirroringShapeCharacters.getValue(t[i].charCodeAt(0))):e[i]=t[i].toString();for(var r="",n=0;n<e.length;n++)r+=e[n];return r},wi.prototype.getLogicalToVisualString=function(t,e){for(var i=new Pi,r=(this.indexLevels=i.getVisualOrder(t,e),this.setDefaultIndexLevel(),this.doOrder(0,this.indexLevels.length-1),this.doMirrorShaping(t)),n="",o=0;o<this.indexes.length;o++)n+=r[this.indexes[o]];return n.toString()},wi.prototype.setDefaultIndexLevel=function(){for(var t=0;t<this.indexLevels.length;t++)this.indexes[t]=t},wi.prototype.doOrder=function(t,e){for(var i=this.indexLevels[t],r=i,n=i,o=i,s=t+1;s<=e;++s){var a=this.indexLevels[s];i<a?i=a:a<r&&(r=a),n&=a,o|=a}if(0!=(1&o))if(1==(1&n))this.reArrange(t,e+1);else for(r|=1;r<=i;){for(var h=t;;){for(;h<=e&&!(this.indexLevels[h]>=i);)h+=1;if(e<h)break;for(var l=h+1;l<=e&&!(this.indexLevels[l]<i);)l+=1;this.reArrange(h,l),h=l+1}--i}},wi.prototype.reArrange=function(t,e){var i=(t+e)/2;for(--e;t<i;++t,--e){var r=this.indexes[t];this.indexes[t]=this.indexes[e],this.indexes[e]=r}},wi.prototype.update=function(){this.mirroringShapeCharacters.setValue(40,41),this.mirroringShapeCharacters.setValue(41,40),this.mirroringShapeCharacters.setValue(60,62),this.mirroringShapeCharacters.setValue(62,60),this.mirroringShapeCharacters.setValue(91,93),this.mirroringShapeCharacters.setValue(93,91),this.mirroringShapeCharacters.setValue(123,125),this.mirroringShapeCharacters.setValue(125,123),this.mirroringShapeCharacters.setValue(171,187),this.mirroringShapeCharacters.setValue(187,171),this.mirroringShapeCharacters.setValue(8249,8250),this.mirroringShapeCharacters.setValue(8250,8249),this.mirroringShapeCharacters.setValue(8261,8262),this.mirroringShapeCharacters.setValue(8262,8261),this.mirroringShapeCharacters.setValue(8317,8318),this.mirroringShapeCharacters.setValue(8318,8317),this.mirroringShapeCharacters.setValue(8333,8334),this.mirroringShapeCharacters.setValue(8334,8333),this.mirroringShapeCharacters.setValue(8712,8715),this.mirroringShapeCharacters.setValue(8713,8716),this.mirroringShapeCharacters.setValue(8714,8717),this.mirroringShapeCharacters.setValue(8715,8712),this.mirroringShapeCharacters.setValue(8716,8713),this.mirroringShapeCharacters.setValue(8717,8714),this.mirroringShapeCharacters.setValue(8725,10741),this.mirroringShapeCharacters.setValue(8764,8765),this.mirroringShapeCharacters.setValue(8765,8764),this.mirroringShapeCharacters.setValue(8771,8909),this.mirroringShapeCharacters.setValue(8786,8787),this.mirroringShapeCharacters.setValue(8787,8786),this.mirroringShapeCharacters.setValue(8788,8789),this.mirroringShapeCharacters.setValue(8789,8788),this.mirroringShapeCharacters.setValue(8804,8805),this.mirroringShapeCharacters.setValue(8805,8804),this.mirroringShapeCharacters.setValue(8806,8807),this.mirroringShapeCharacters.setValue(8807,8806),this.mirroringShapeCharacters.setValue(8808,8809),this.mirroringShapeCharacters.setValue(8809,8808),this.mirroringShapeCharacters.setValue(8810,8811),this.mirroringShapeCharacters.setValue(8811,8810),this.mirroringShapeCharacters.setValue(8814,8815),this.mirroringShapeCharacters.setValue(8815,8814),this.mirroringShapeCharacters.setValue(8816,8817),this.mirroringShapeCharacters.setValue(8817,8816),this.mirroringShapeCharacters.setValue(8818,8819),this.mirroringShapeCharacters.setValue(8819,8818),this.mirroringShapeCharacters.setValue(8820,8821),this.mirroringShapeCharacters.setValue(8821,8820),this.mirroringShapeCharacters.setValue(8822,8823),this.mirroringShapeCharacters.setValue(8823,8822),this.mirroringShapeCharacters.setValue(8824,8825),this.mirroringShapeCharacters.setValue(8825,8824),this.mirroringShapeCharacters.setValue(8826,8827),this.mirroringShapeCharacters.setValue(8827,8826),this.mirroringShapeCharacters.setValue(8828,8829),this.mirroringShapeCharacters.setValue(8829,8828),this.mirroringShapeCharacters.setValue(8830,8831),this.mirroringShapeCharacters.setValue(8831,8830),this.mirroringShapeCharacters.setValue(8832,8833),this.mirroringShapeCharacters.setValue(8833,8832),this.mirroringShapeCharacters.setValue(8834,8835),this.mirroringShapeCharacters.setValue(8835,8834),this.mirroringShapeCharacters.setValue(8836,8837),this.mirroringShapeCharacters.setValue(8837,8836),this.mirroringShapeCharacters.setValue(8838,8839),this.mirroringShapeCharacters.setValue(8839,8838),this.mirroringShapeCharacters.setValue(8840,8841),this.mirroringShapeCharacters.setValue(8841,8840),this.mirroringShapeCharacters.setValue(8842,8843),this.mirroringShapeCharacters.setValue(8843,8842),this.mirroringShapeCharacters.setValue(8847,8848),this.mirroringShapeCharacters.setValue(8848,8847),this.mirroringShapeCharacters.setValue(8849,8850),this.mirroringShapeCharacters.setValue(8850,8849),this.mirroringShapeCharacters.setValue(8856,10680),this.mirroringShapeCharacters.setValue(8866,8867),this.mirroringShapeCharacters.setValue(8867,8866),this.mirroringShapeCharacters.setValue(8870,10974),this.mirroringShapeCharacters.setValue(8872,10980),this.mirroringShapeCharacters.setValue(8873,10979),this.mirroringShapeCharacters.setValue(8875,10981),this.mirroringShapeCharacters.setValue(8880,8881),this.mirroringShapeCharacters.setValue(8881,8880),this.mirroringShapeCharacters.setValue(8882,8883),this.mirroringShapeCharacters.setValue(8883,8882),this.mirroringShapeCharacters.setValue(8884,8885),this.mirroringShapeCharacters.setValue(8885,8884),this.mirroringShapeCharacters.setValue(8886,8887),this.mirroringShapeCharacters.setValue(8887,8886),this.mirroringShapeCharacters.setValue(8905,8906),this.mirroringShapeCharacters.setValue(8906,8905),this.mirroringShapeCharacters.setValue(8907,8908),this.mirroringShapeCharacters.setValue(8908,8907),this.mirroringShapeCharacters.setValue(8909,8771),this.mirroringShapeCharacters.setValue(8912,8913),this.mirroringShapeCharacters.setValue(8913,8912),this.mirroringShapeCharacters.setValue(8918,8919),this.mirroringShapeCharacters.setValue(8919,8918),this.mirroringShapeCharacters.setValue(8920,8921),this.mirroringShapeCharacters.setValue(8921,8920),this.mirroringShapeCharacters.setValue(8922,8923),this.mirroringShapeCharacters.setValue(8923,8922),this.mirroringShapeCharacters.setValue(8924,8925),this.mirroringShapeCharacters.setValue(8925,8924),this.mirroringShapeCharacters.setValue(8926,8927),this.mirroringShapeCharacters.setValue(8927,8926),this.mirroringShapeCharacters.setValue(8928,8929),this.mirroringShapeCharacters.setValue(8929,8928),this.mirroringShapeCharacters.setValue(8930,8931),this.mirroringShapeCharacters.setValue(8931,8930),this.mirroringShapeCharacters.setValue(8932,8933),this.mirroringShapeCharacters.setValue(8933,8932),this.mirroringShapeCharacters.setValue(8934,8935),this.mirroringShapeCharacters.setValue(8935,8934),this.mirroringShapeCharacters.setValue(8936,8937),this.mirroringShapeCharacters.setValue(8937,8936),this.mirroringShapeCharacters.setValue(8938,8939),this.mirroringShapeCharacters.setValue(8939,8938),this.mirroringShapeCharacters.setValue(8940,8941),this.mirroringShapeCharacters.setValue(8941,8940),this.mirroringShapeCharacters.setValue(8944,8945),this.mirroringShapeCharacters.setValue(8945,8944),this.mirroringShapeCharacters.setValue(8946,8954),this.mirroringShapeCharacters.setValue(8947,8955),this.mirroringShapeCharacters.setValue(8948,8956),this.mirroringShapeCharacters.setValue(8950,8957),this.mirroringShapeCharacters.setValue(8951,8958),this.mirroringShapeCharacters.setValue(8954,8946),this.mirroringShapeCharacters.setValue(8955,8947),this.mirroringShapeCharacters.setValue(8956,8948),this.mirroringShapeCharacters.setValue(8957,8950),this.mirroringShapeCharacters.setValue(8958,8951),this.mirroringShapeCharacters.setValue(8968,8969),this.mirroringShapeCharacters.setValue(8969,8968),this.mirroringShapeCharacters.setValue(8970,8971),this.mirroringShapeCharacters.setValue(8971,8970),this.mirroringShapeCharacters.setValue(9001,9002),this.mirroringShapeCharacters.setValue(9002,9001),this.mirroringShapeCharacters.setValue(10088,10089),this.mirroringShapeCharacters.setValue(10089,10088),this.mirroringShapeCharacters.setValue(10090,10091),this.mirroringShapeCharacters.setValue(10091,10090),this.mirroringShapeCharacters.setValue(10092,10093),this.mirroringShapeCharacters.setValue(10093,10092),this.mirroringShapeCharacters.setValue(10094,10095),this.mirroringShapeCharacters.setValue(10095,10094),this.mirroringShapeCharacters.setValue(10096,10097),this.mirroringShapeCharacters.setValue(10097,10096),this.mirroringShapeCharacters.setValue(10098,10099),this.mirroringShapeCharacters.setValue(10099,10098),this.mirroringShapeCharacters.setValue(10100,10101),this.mirroringShapeCharacters.setValue(10101,10100),this.mirroringShapeCharacters.setValue(10197,10198),this.mirroringShapeCharacters.setValue(10198,10197),this.mirroringShapeCharacters.setValue(10205,10206),this.mirroringShapeCharacters.setValue(10206,10205),this.mirroringShapeCharacters.setValue(10210,10211),this.mirroringShapeCharacters.setValue(10211,10210),this.mirroringShapeCharacters.setValue(10212,10213),this.mirroringShapeCharacters.setValue(10213,10212),this.mirroringShapeCharacters.setValue(10214,10215),this.mirroringShapeCharacters.setValue(10215,10214),this.mirroringShapeCharacters.setValue(10216,10217),this.mirroringShapeCharacters.setValue(10217,10216),this.mirroringShapeCharacters.setValue(10218,10219),this.mirroringShapeCharacters.setValue(10219,10218),this.mirroringShapeCharacters.setValue(10627,10628),this.mirroringShapeCharacters.setValue(10628,10627),this.mirroringShapeCharacters.setValue(10629,10630),this.mirroringShapeCharacters.setValue(10630,10629),this.mirroringShapeCharacters.setValue(10631,10632),this.mirroringShapeCharacters.setValue(10632,10631),this.mirroringShapeCharacters.setValue(10633,10634),this.mirroringShapeCharacters.setValue(10634,10633),this.mirroringShapeCharacters.setValue(10635,10636),this.mirroringShapeCharacters.setValue(10636,10635),this.mirroringShapeCharacters.setValue(10637,10640),this.mirroringShapeCharacters.setValue(10638,10639),this.mirroringShapeCharacters.setValue(10639,10638),this.mirroringShapeCharacters.setValue(10640,10637),this.mirroringShapeCharacters.setValue(10641,10642),this.mirroringShapeCharacters.setValue(10642,10641),this.mirroringShapeCharacters.setValue(10643,10644),this.mirroringShapeCharacters.setValue(10644,10643),this.mirroringShapeCharacters.setValue(10645,10646),this.mirroringShapeCharacters.setValue(10646,10645),this.mirroringShapeCharacters.setValue(10647,10648),this.mirroringShapeCharacters.setValue(10648,10647),this.mirroringShapeCharacters.setValue(10680,8856),this.mirroringShapeCharacters.setValue(10688,10689),this.mirroringShapeCharacters.setValue(10689,10688),this.mirroringShapeCharacters.setValue(10692,10693),this.mirroringShapeCharacters.setValue(10693,10692),this.mirroringShapeCharacters.setValue(10703,10704),this.mirroringShapeCharacters.setValue(10704,10703),this.mirroringShapeCharacters.setValue(10705,10706),this.mirroringShapeCharacters.setValue(10706,10705),this.mirroringShapeCharacters.setValue(10708,10709),this.mirroringShapeCharacters.setValue(10709,10708),this.mirroringShapeCharacters.setValue(10712,10713),this.mirroringShapeCharacters.setValue(10713,10712),this.mirroringShapeCharacters.setValue(10714,10715),this.mirroringShapeCharacters.setValue(10715,10714),this.mirroringShapeCharacters.setValue(10741,8725),this.mirroringShapeCharacters.setValue(10744,10745),this.mirroringShapeCharacters.setValue(10745,10744),this.mirroringShapeCharacters.setValue(10748,10749),this.mirroringShapeCharacters.setValue(10749,10748),this.mirroringShapeCharacters.setValue(10795,10796),this.mirroringShapeCharacters.setValue(10796,10795),this.mirroringShapeCharacters.setValue(10797,10796),this.mirroringShapeCharacters.setValue(10798,10797),this.mirroringShapeCharacters.setValue(10804,10805),this.mirroringShapeCharacters.setValue(10805,10804),this.mirroringShapeCharacters.setValue(10812,10813),this.mirroringShapeCharacters.setValue(10813,10812),this.mirroringShapeCharacters.setValue(10852,10853),this.mirroringShapeCharacters.setValue(10853,10852),this.mirroringShapeCharacters.setValue(10873,10874),this.mirroringShapeCharacters.setValue(10874,10873),this.mirroringShapeCharacters.setValue(10877,10878),this.mirroringShapeCharacters.setValue(10878,10877),this.mirroringShapeCharacters.setValue(10879,10880),this.mirroringShapeCharacters.setValue(10880,10879),this.mirroringShapeCharacters.setValue(10881,10882),this.mirroringShapeCharacters.setValue(10882,10881),this.mirroringShapeCharacters.setValue(10883,10884),this.mirroringShapeCharacters.setValue(10884,10883),this.mirroringShapeCharacters.setValue(10891,10892),this.mirroringShapeCharacters.setValue(10892,10891),this.mirroringShapeCharacters.setValue(10897,10898),this.mirroringShapeCharacters.setValue(10898,10897),this.mirroringShapeCharacters.setValue(10899,10900),this.mirroringShapeCharacters.setValue(10900,10899),this.mirroringShapeCharacters.setValue(10901,10902),this.mirroringShapeCharacters.setValue(10902,10901),this.mirroringShapeCharacters.setValue(10903,10904),this.mirroringShapeCharacters.setValue(10904,10903),this.mirroringShapeCharacters.setValue(10905,10906),this.mirroringShapeCharacters.setValue(10906,10905),this.mirroringShapeCharacters.setValue(10907,10908),this.mirroringShapeCharacters.setValue(10908,10907),this.mirroringShapeCharacters.setValue(10913,10914),this.mirroringShapeCharacters.setValue(10914,10913),this.mirroringShapeCharacters.setValue(10918,10919),this.mirroringShapeCharacters.setValue(10919,10918),this.mirroringShapeCharacters.setValue(10920,10921),this.mirroringShapeCharacters.setValue(10921,10920),this.mirroringShapeCharacters.setValue(10922,10923),this.mirroringShapeCharacters.setValue(10923,10922),this.mirroringShapeCharacters.setValue(10924,10925),this.mirroringShapeCharacters.setValue(10925,10924),this.mirroringShapeCharacters.setValue(10927,10928),this.mirroringShapeCharacters.setValue(10928,10927),this.mirroringShapeCharacters.setValue(10931,10932),this.mirroringShapeCharacters.setValue(10932,10931),this.mirroringShapeCharacters.setValue(10939,10940),this.mirroringShapeCharacters.setValue(10940,10939),this.mirroringShapeCharacters.setValue(10941,10942),this.mirroringShapeCharacters.setValue(10942,10941),this.mirroringShapeCharacters.setValue(10943,10944),this.mirroringShapeCharacters.setValue(10944,10943),this.mirroringShapeCharacters.setValue(10945,10946),this.mirroringShapeCharacters.setValue(10946,10945),this.mirroringShapeCharacters.setValue(10947,10948),this.mirroringShapeCharacters.setValue(10948,10947),this.mirroringShapeCharacters.setValue(10949,10950),this.mirroringShapeCharacters.setValue(10950,10949),this.mirroringShapeCharacters.setValue(10957,10958),this.mirroringShapeCharacters.setValue(10958,10957),this.mirroringShapeCharacters.setValue(10959,10960),this.mirroringShapeCharacters.setValue(10960,10959),this.mirroringShapeCharacters.setValue(10961,10962),this.mirroringShapeCharacters.setValue(10962,10961),this.mirroringShapeCharacters.setValue(10963,10964),this.mirroringShapeCharacters.setValue(10964,10963),this.mirroringShapeCharacters.setValue(10965,10966),this.mirroringShapeCharacters.setValue(10966,10965),this.mirroringShapeCharacters.setValue(10974,8870),this.mirroringShapeCharacters.setValue(10979,8873),this.mirroringShapeCharacters.setValue(10980,8872),this.mirroringShapeCharacters.setValue(10981,8875),this.mirroringShapeCharacters.setValue(10988,10989),this.mirroringShapeCharacters.setValue(10989,10988),this.mirroringShapeCharacters.setValue(10999,11e3),this.mirroringShapeCharacters.setValue(11e3,10999),this.mirroringShapeCharacters.setValue(11001,11002),this.mirroringShapeCharacters.setValue(11002,11001),this.mirroringShapeCharacters.setValue(12296,12297),this.mirroringShapeCharacters.setValue(12297,12296),this.mirroringShapeCharacters.setValue(12298,12299),this.mirroringShapeCharacters.setValue(12299,12298),this.mirroringShapeCharacters.setValue(12300,12301),this.mirroringShapeCharacters.setValue(12301,12300),this.mirroringShapeCharacters.setValue(12302,12303),this.mirroringShapeCharacters.setValue(12303,12302),this.mirroringShapeCharacters.setValue(12304,12305),this.mirroringShapeCharacters.setValue(12305,12304),this.mirroringShapeCharacters.setValue(12308,12309),this.mirroringShapeCharacters.setValue(12309,12308),this.mirroringShapeCharacters.setValue(12310,12311),this.mirroringShapeCharacters.setValue(12311,12310),this.mirroringShapeCharacters.setValue(12312,12313),this.mirroringShapeCharacters.setValue(12313,12312),this.mirroringShapeCharacters.setValue(12314,12315),this.mirroringShapeCharacters.setValue(12315,12314),this.mirroringShapeCharacters.setValue(65288,65289),this.mirroringShapeCharacters.setValue(65289,65288),this.mirroringShapeCharacters.setValue(65308,65310),this.mirroringShapeCharacters.setValue(65310,65308),this.mirroringShapeCharacters.setValue(65339,65341),this.mirroringShapeCharacters.setValue(65341,65339),this.mirroringShapeCharacters.setValue(65371,65373),this.mirroringShapeCharacters.setValue(65373,65371),this.mirroringShapeCharacters.setValue(65375,65376),this.mirroringShapeCharacters.setValue(65376,65375),this.mirroringShapeCharacters.setValue(65378,65379),this.mirroringShapeCharacters.setValue(65379,65378)};var bi=wi;function wi(){this.indexes=[],this.indexLevels=[],this.mirroringShapeCharacters=new a,this.update()}Si.prototype.getVisualOrder=function(t,e){this.types=this.getCharacterCode(t),this.textOrder=e?this.LRE:this.L,this.doVisualOrder();for(var i=[],r=0;r<this.levels.length;r++)i[r]=this.levels[r];return i},Si.prototype.getCharacterCode=function(t){for(var e=[],i=0;i<t.length;i++)e[i]=this.rtlCharacterTypes[t[i].charCodeAt(0)];return e},Si.prototype.setDefaultLevels=function(){for(var t=0;t<this.length;t++)this.levels[t]=this.textOrder},Si.prototype.setLevels=function(){this.setDefaultLevels();for(var t=0;t<this.length;++t){var e=this.levels[t];0!=(128&e)&&(e&=127,this.result[t]=0==(1&e)?this.L:this.R),this.levels[t]=e}},Si.prototype.updateLevels=function(t,e,i){if(0==(1&e))for(var r=t;r<i;++r)this.result[r]===this.R?this.levels[r]+=1:this.result[r]!==this.L&&(this.levels[r]+=2);else for(r=t;r<i;++r)this.result[r]!==this.R&&(this.levels[r]+=1)},Si.prototype.doVisualOrder=function(){this.length=this.types.length,this.result=this.types,this.levels=[],this.setLevels(),this.length=this.getEmbeddedCharactersLength();for(var t=this.textOrder,e=0;e<this.length;){for(var i=this.levels[e],r=0==(1&Math.max(t,i))?this.L:this.R,n=e+1;n<this.length&&this.levels[n]===i;)++n;var o=n<this.length?this.levels[n]:this.textOrder,o=0==(1&Math.max(o,i))?this.L:this.R;this.checkNSM(e,n,i,r,o),this.updateLevels(e,i,n),t=i,e=n}this.checkEmbeddedCharacters(this.length)},Si.prototype.getEmbeddedCharactersLength=function(){for(var t=0,e=0;e<this.length;++e)this.types[e]!==this.LRE&&this.types[e]!==this.RLE&&this.types[e]!==this.LRO&&this.types[e]!==this.RLO&&this.types[e]!==this.PDF&&this.types[e]!==this.BN&&(this.result[t]=this.result[e],this.levels[t]=this.levels[e],t++);return t},Si.prototype.checkEmbeddedCharacters=function(t){for(var e=this.types.length-1;0<=e;--e)this.types[e]===this.LRE||this.types[e]===this.RLE||this.types[e]===this.LRO||this.types[e]===this.RLO||this.types[e]===this.PDF||this.types[e]===this.BN?(this.result[e]=this.types[e],this.levels[e]=-1):(this.result[e]=this.result[--t],this.levels[e]=this.levels[t]);for(e=0;e<this.types.length;e++)-1===this.levels[e]&&(this.levels[e]=0===e?this.textOrder:this.levels[e-1])},Si.prototype.checkNSM=function(t,e,i,r,n){for(var o=r,s=t;s<e;++s)this.result[s]===this.NSM?this.result[s]=o:o=this.result[s];this.checkEuropeanDigits(t,e,i,r,n)},Si.prototype.checkEuropeanDigits=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN)for(var s=o-1;t<=s;--s)if(this.result[s]===this.L||this.result[s]===this.R||this.result[s]===this.AL){this.result[s]===this.AL&&(this.result[o]=this.AN);break}this.checkArabicCharacters(t,e,i,r,n)},Si.prototype.checkArabicCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]===this.AL&&(this.result[o]=this.R);this.checkEuropeanNumberSeparator(t,e,i,r,n)},Si.prototype.checkEuropeanNumberSeparator=function(t,e,i,r,n){for(var o,s,a=t+1;a<e-1;++a)this.result[a]!==this.ES&&this.result[a]!==this.CS||(o=this.result[a-1],s=this.result[a+1],o===this.EN&&s===this.EN?this.result[a]=this.EN:this.result[a]===this.CS&&o===this.AN&&s===this.AN&&(this.result[a]=this.AN));this.checkEuropeanNumberTerminator(t,e,i,r,n)},Si.prototype.checkEuropeanNumberTerminator=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.ET){var s=o,a=[],h=(a.push(this.ET),this.getLength(s,e,a)),a=s===t?r:this.result[s-1];if((a=a!==this.EN?h===e?n:this.result[h]:a)===this.EN)for(var l=s;l<h;++l)this.result[l]=this.EN;o=h}this.checkOtherNeutrals(t,e,i,r,n)},Si.prototype.checkOtherNeutrals=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]!==this.ES&&this.result[o]!==this.ET&&this.result[o]!==this.CS||(this.result[o]=this.ON);this.checkOtherCharacters(t,e,i,r,n)},Si.prototype.checkOtherCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN){for(var s=r,a=o-1;t<=a;--a)if(this.result[a]===this.L||this.result[a]===this.R){s=this.result[a];break}s===this.L&&(this.result[o]=this.L)}this.checkCommanCharacters(t,e,i,r,n)},Si.prototype.getLength=function(t,e,i){for(--t;++t<e;){for(var r=this.result[t],n=0;n<i.length;++n)r===i[n]&&(t=this.getLength(++t,e,i));return t}return e},Si.prototype.checkCommanCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.WS||this.result[o]===this.ON||this.result[o]===this.B||this.result[o]===this.S){var s=o,a=[this.B,this.S,this.WS,this.ON],h=this.getLength(s,e,a),a=0,l=0,u=0;s===t?a=r:(a=this.result[s-1])!==this.AN&&a!==this.EN||(a=this.R),h===e?l=n:(l=this.result[h])!==this.AN&&l!==this.EN||(l=this.R);for(var u=a===l?a:0==(1&i)?this.L:this.R,c=s;c<h;++c)this.result[c]=u;o=h}};var Pi=Si;function Si(){this.types=[],this.textOrder=-1,this.rtlCharacterTypes=new Array(65536),this.L=0,this.LRE=1,this.LRO=2,this.R=3,this.AL=4,this.RLE=5,this.RLO=6,this.PDF=7,this.EN=8,this.ES=9,this.ET=10,this.AN=11,this.CS=12,this.NSM=13,this.BN=14,this.B=15,this.S=16,this.WS=17,this.ON=18,this.charTypes=[this.L,this.EN,this.BN,this.ES,this.ES,this.S,this.ET,this.ET,this.B,this.AN,this.AN,this.S,this.CS,this.CS,this.WS,this.NSM,this.NSM,this.B,this.BN,27,this.BN,28,30,this.B,31,31,this.S,32,32,this.WS,33,34,this.ON,35,37,this.ET,38,42,this.ON,43,43,this.ET,44,44,this.CS,45,45,this.ET,46,46,this.CS,47,47,this.CS,48,57,this.EN,58,58,this.CS,59,64,this.ON,65,90,this.L,91,96,this.ON,97,122,this.L,123,126,this.ON,127,132,this.BN,133,133,this.B,134,159,this.BN,160,160,this.CS,161,161,this.ON,162,165,this.ET,166,169,this.ON,170,170,this.L,171,175,this.ON,176,177,this.ET,178,179,this.EN,180,180,this.ON,181,181,this.L,182,184,this.ON,185,185,this.EN,186,186,this.L,187,191,this.ON,192,214,this.L,215,215,this.ON,216,246,this.L,247,247,this.ON,248,696,this.L,697,698,this.ON,699,705,this.L,706,719,this.ON,720,721,this.L,722,735,this.ON,736,740,this.L,741,749,this.ON,750,750,this.L,751,767,this.ON,768,855,this.NSM,856,860,this.L,861,879,this.NSM,880,883,this.L,884,885,this.ON,886,893,this.L,894,894,this.ON,895,899,this.L,900,901,this.ON,902,902,this.L,903,903,this.ON,904,1013,this.L,1014,1014,this.ON,1015,1154,this.L,1155,1158,this.NSM,1159,1159,this.L,1160,1161,this.NSM,1162,1417,this.L,1418,1418,this.ON,1419,1424,this.L,1425,1441,this.NSM,1442,1442,this.L,1443,1465,this.NSM,1466,1466,this.L,1467,1469,this.NSM,1470,1470,this.R,1471,1471,this.NSM,1472,1472,this.R,1473,1474,this.NSM,1475,1475,this.R,1476,1476,this.NSM,1477,1487,this.L,1488,1514,this.R,1515,1519,this.L,1520,1524,this.R,1525,1535,this.L,1536,1539,this.AL,1540,1547,this.L,1548,1548,this.CS,1549,1549,this.AL,1550,1551,this.ON,1552,1557,this.NSM,1558,1562,this.L,1563,1563,this.AL,1564,1566,this.L,1567,1567,this.AL,1568,1568,this.L,1569,1594,this.AL,1595,1599,this.L,1600,1610,this.AL,1611,1624,this.NSM,1625,1631,this.L,1632,1641,this.AN,1642,1642,this.ET,1643,1644,this.AN,1645,1647,this.AL,1648,1648,this.NSM,1649,1749,this.AL,1750,1756,this.NSM,1757,1757,this.AL,1758,1764,this.NSM,1765,1766,this.AL,1767,1768,this.NSM,1769,1769,this.ON,1770,1773,this.NSM,1774,1775,this.AL,1776,1785,this.EN,1786,1805,this.AL,1806,1806,this.L,1807,1807,this.BN,1808,1808,this.AL,1809,1809,this.NSM,1810,1839,this.AL,1840,1866,this.NSM,1867,1868,this.L,1869,1871,this.AL,1872,1919,this.L,1920,1957,this.AL,1958,1968,this.NSM,1969,1969,this.AL,1970,2304,this.L,2305,2306,this.NSM,2307,2363,this.L,2364,2364,this.NSM,2365,2368,this.L,2369,2376,this.NSM,2377,2380,this.L,2381,2381,this.NSM,2382,2384,this.L,2385,2388,this.NSM,2389,2401,this.L,2402,2403,this.NSM,2404,2432,this.L,2433,2433,this.NSM,2434,2491,this.L,2492,2492,this.NSM,2493,2496,this.L,2497,2500,this.NSM,2501,2508,this.L,2509,2509,this.NSM,2510,2529,this.L,2530,2531,this.NSM,2532,2545,this.L,2546,2547,this.ET,2548,2560,this.L,2561,2562,this.NSM,2563,2619,this.L,2620,2620,this.NSM,2621,2624,this.L,2625,2626,this.NSM,2627,2630,this.L,2631,2632,this.NSM,2633,2634,this.L,2635,2637,this.NSM,2638,2671,this.L,2672,2673,this.NSM,2674,2688,this.L,2689,2690,this.NSM,2691,2747,this.L,2748,2748,this.NSM,2749,2752,this.L,2753,2757,this.NSM,2758,2758,this.L,2759,2760,this.NSM,2761,2764,this.L,2765,2765,this.NSM,2766,2785,this.L,2786,2787,this.NSM,2788,2800,this.L,2801,2801,this.ET,2802,2816,this.L,2817,2817,this.NSM,2818,2875,this.L,2876,2876,this.NSM,2877,2878,this.L,2879,2879,this.NSM,2880,2880,this.L,2881,2883,this.NSM,2884,2892,this.L,2893,2893,this.NSM,2894,2901,this.L,2902,2902,this.NSM,2903,2945,this.L,2946,2946,this.NSM,2947,3007,this.L,3008,3008,this.NSM,3009,3020,this.L,3021,3021,this.NSM,3022,3058,this.L,3059,3064,this.ON,3065,3065,this.ET,3066,3066,this.ON,3067,3133,this.L,3134,3136,this.NSM,3137,3141,this.L,3142,3144,this.NSM,3145,3145,this.L,3146,3149,this.NSM,3150,3156,this.L,3157,3158,this.NSM,3159,3259,this.L,3260,3260,this.NSM,3261,3275,this.L,3276,3277,this.NSM,3278,3392,this.L,3393,3395,this.NSM,3396,3404,this.L,3405,3405,this.NSM,3406,3529,this.L,3530,3530,this.NSM,3531,3537,this.L,3538,3540,this.NSM,3541,3541,this.L,3542,3542,this.NSM,3543,3632,this.L,3633,3633,this.NSM,3634,3635,this.L,3636,3642,this.NSM,3643,3646,this.L,3647,3647,this.ET,3648,3654,this.L,3655,3662,this.NSM,3663,3760,this.L,3761,3761,this.NSM,3762,3763,this.L,3764,3769,this.NSM,3770,3770,this.L,3771,3772,this.NSM,3773,3783,this.L,3784,3789,this.NSM,3790,3863,this.L,3864,3865,this.NSM,3866,3892,this.L,3893,3893,this.NSM,3894,3894,this.L,3895,3895,this.NSM,3896,3896,this.L,3897,3897,this.NSM,3898,3901,this.ON,3902,3952,this.L,3953,3966,this.NSM,3967,3967,this.L,3968,3972,this.NSM,3973,3973,this.L,3974,3975,this.NSM,3976,3983,this.L,3984,3991,this.NSM,3992,3992,this.L,3993,4028,this.NSM,4029,4037,this.L,4038,4038,this.NSM,4039,4140,this.L,4141,4144,this.NSM,4145,4145,this.L,4146,4146,this.NSM,4147,4149,this.L,4150,4151,this.NSM,4152,4152,this.L,4153,4153,this.NSM,4154,4183,this.L,4184,4185,this.NSM,4186,5759,this.L,5760,5760,this.WS,5761,5786,this.L,5787,5788,this.ON,5789,5905,this.L,5906,5908,this.NSM,5909,5937,this.L,5938,5940,this.NSM,5941,5969,this.L,5970,5971,this.NSM,5972,6001,this.L,6002,6003,this.NSM,6004,6070,this.L,6071,6077,this.NSM,6078,6085,this.L,6086,6086,this.NSM,6087,6088,this.L,6089,6099,this.NSM,6100,6106,this.L,6107,6107,this.ET,6108,6108,this.L,6109,6109,this.NSM,6110,6127,this.L,6128,6137,this.ON,6138,6143,this.L,6144,6154,this.ON,6155,6157,this.NSM,6158,6158,this.WS,6159,6312,this.L,6313,6313,this.NSM,6314,6431,this.L,6432,6434,this.NSM,6435,6438,this.L,6439,6443,this.NSM,6444,6449,this.L,6450,6450,this.NSM,6451,6456,this.L,6457,6459,this.NSM,6460,6463,this.L,6464,6464,this.ON,6465,6467,this.L,6468,6469,this.ON,6470,6623,this.L,6624,6655,this.ON,6656,8124,this.L,8125,8125,this.ON,8126,8126,this.L,8127,8129,this.ON,8130,8140,this.L,8141,8143,this.ON,8144,8156,this.L,8157,8159,this.ON,8160,8172,this.L,8173,8175,this.ON,8176,8188,this.L,8189,8190,this.ON,8191,8191,this.L,8192,8202,this.WS,8203,8205,this.BN,8206,8206,this.L,8207,8207,this.R,8208,8231,this.ON,8232,8232,this.WS,8233,8233,this.B,8234,8234,this.LRE,8235,8235,this.RLE,8236,8236,this.PDF,8237,8237,this.LRO,8238,8238,this.RLO,8239,8239,this.WS,8240,8244,this.ET,8245,8276,this.ON,8277,8278,this.L,8279,8279,this.ON,8280,8286,this.L,8287,8287,this.WS,8288,8291,this.BN,8292,8297,this.L,8298,8303,this.BN,8304,8304,this.EN,8305,8307,this.L,8308,8313,this.EN,8314,8315,this.ET,8316,8318,this.ON,8319,8319,this.L,8320,8329,this.EN,8330,8331,this.ET,8332,8334,this.ON,8335,8351,this.L,8352,8369,this.ET,8370,8399,this.L,8400,8426,this.NSM,8427,8447,this.L,8448,8449,this.ON,8450,8450,this.L,8451,8454,this.ON,8455,8455,this.L,8456,8457,this.ON,8458,8467,this.L,8468,8468,this.ON,8469,8469,this.L,8470,8472,this.ON,8473,8477,this.L,8478,8483,this.ON,8484,8484,this.L,8485,8485,this.ON,8486,8486,this.L,8487,8487,this.ON,8488,8488,this.L,8489,8489,this.ON,8490,8493,this.L,8494,8494,this.ET,8495,8497,this.L,8498,8498,this.ON,8499,8505,this.L,8506,8507,this.ON,8508,8511,this.L,8512,8516,this.ON,8517,8521,this.L,8522,8523,this.ON,8524,8530,this.L,8531,8543,this.ON,8544,8591,this.L,8592,8721,this.ON,8722,8723,this.ET,8724,9013,this.ON,9014,9082,this.L,9083,9108,this.ON,9109,9109,this.L,9110,9168,this.ON,9169,9215,this.L,9216,9254,this.ON,9255,9279,this.L,9280,9290,this.ON,9291,9311,this.L,9312,9371,this.EN,9372,9449,this.L,9450,9450,this.EN,9451,9751,this.ON,9752,9752,this.L,9753,9853,this.ON,9854,9855,this.L,9856,9873,this.ON,9874,9887,this.L,9888,9889,this.ON,9890,9984,this.L,9985,9988,this.ON,9989,9989,this.L,9990,9993,this.ON,9994,9995,this.L,9996,10023,this.ON,10024,10024,this.L,10025,10059,this.ON,10060,10060,this.L,10061,10061,this.ON,10062,10062,this.L,10063,10066,this.ON,10067,10069,this.L,10070,10070,this.ON,10071,10071,this.L,10072,10078,this.ON,10079,10080,this.L,10081,10132,this.ON,10133,10135,this.L,10136,10159,this.ON,10160,10160,this.L,10161,10174,this.ON,10175,10191,this.L,10192,10219,this.ON,10220,10223,this.L,10224,11021,this.ON,11022,11903,this.L,11904,11929,this.ON,11930,11930,this.L,11931,12019,this.ON,12020,12031,this.L,12032,12245,this.ON,12246,12271,this.L,12272,12283,this.ON,12284,12287,this.L,12288,12288,this.WS,12289,12292,this.ON,12293,12295,this.L,12296,12320,this.ON,12321,12329,this.L,12330,12335,this.NSM,12336,12336,this.ON,12337,12341,this.L,12342,12343,this.ON,12344,12348,this.L,12349,12351,this.ON,12352,12440,this.L,12441,12442,this.NSM,12443,12444,this.ON,12445,12447,this.L,12448,12448,this.ON,12449,12538,this.L,12539,12539,this.ON,12540,12828,this.L,12829,12830,this.ON,12831,12879,this.L,12880,12895,this.ON,12896,12923,this.L,12924,12925,this.ON,12926,12976,this.L,12977,12991,this.ON,12992,13003,this.L,13004,13007,this.ON,13008,13174,this.L,13175,13178,this.ON,13179,13277,this.L,13278,13279,this.ON,13280,13310,this.L,13311,13311,this.ON,13312,19903,this.L,19904,19967,this.ON,19968,42127,this.L,42128,42182,this.ON,42183,64284,this.L,64285,64285,this.R,64286,64286,this.NSM,64287,64296,this.R,64297,64297,this.ET,64298,64310,this.R,64311,64311,this.L,64312,64316,this.R,64317,64317,this.L,64318,64318,this.R,64319,64319,this.L,64320,64321,this.R,64322,64322,this.L,64323,64324,this.R,64325,64325,this.L,64326,64335,this.R,64336,64433,this.AL,64434,64466,this.L,64467,64829,this.AL,64830,64831,this.ON,64832,64847,this.L,64848,64911,this.AL,64912,64913,this.L,64914,64967,this.AL,64968,65007,this.L,65008,65020,this.AL,65021,65021,this.ON,65022,65023,this.L,65024,65039,this.NSM,65040,65055,this.L,65056,65059,this.NSM,65060,65071,this.L,65072,65103,this.ON,65104,65104,this.CS,65105,65105,this.ON,65106,65106,this.CS,65107,65107,this.L,65108,65108,this.ON,65109,65109,this.CS,65110,65118,this.ON,65119,65119,this.ET,65120,65121,this.ON,65122,65123,this.ET,65124,65126,this.ON,65127,65127,this.L,65128,65128,this.ON,65129,65130,this.ET,65131,65131,this.ON,65132,65135,this.L,65136,65140,this.AL,65141,65141,this.L,65142,65276,this.AL,65277,65278,this.L,65279,65279,this.BN,65280,65280,this.L,65281,65282,this.ON,65283,65285,this.ET,65286,65290,this.ON,65291,65291,this.ET,65292,65292,this.CS,65293,65293,this.ET,65294,65294,this.CS,65295,65295,this.ES,65296,65305,this.EN,65306,65306,this.CS,65307,65312,this.ON,65313,65338,this.L,65339,65344,this.ON,65345,65370,this.L,65371,65381,this.ON,65382,65503,this.L,65504,65505,this.ET,65506,65508,this.ON,65509,65510,this.ET,65511,65511,this.L,65512,65518,this.ON,65519,65528,this.L,65529,65531,this.BN,65532,65533,this.ON,65534,65535,this.L];for(var t=0;t<this.charTypes.length;++t)for(var e=this.charTypes[t],i=this.charTypes[++t],r=this.charTypes[++t];e<=i;)this.rtlCharacterTypes[e++]=r}Ci.prototype.layout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");var o=[];return e.Unicode?o=this.customLayout(t,i,n,e,r):(o=[])[0]=t,o},Ci.prototype.splitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customSplitLayout(t,e,i,r,n)},Ci.prototype.getGlyphIndex=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");if(r=null,0===t.length)return{success:!1,glyphs:null};for(var o=(new fi).shape(t,0),s=e.fontInternal.ttfReader,a=(r=new Uint16Array(o.length),0),h=0,l=o.length;h<l;h++){var u=o[h],u=s.getGlyph(u);null!=u&&(r[a++]=u.index)}return{success:!0,glyphs:r}},Ci.prototype.customLayout=function(t,e,i,r,n){if(null==n){if(null==t)throw new Error("ArgumentNullException : line");var o=null;return o=null!=i&&i.textDirection!==Y.PdfTextDirection.None?(new bi).getLogicalToVisualString(t,e):o}if(null==t)throw new Error("ArgumentNullException : line");if(null==r)throw new Error("ArgumentNullException : font");var s=null,o=(null!=i&&i.textDirection!==Y.PdfTextDirection.None&&(t=(new fi).shape(t,0),s=this.customLayout(t,e,i)),[]);if(n){for(var a=s.split(""),h=a.length,l=0;l<h;l++)a[l]=this.addChars(r,a[l]);o=a}else(o=[])[0]=this.addChars(r,s);return o},Ci.prototype.addChars=function(t,e){if(null==t)throw new Error("ArgumentNullException : font");if(null==e)throw new Error("ArgumentNullException : line");var i=t.fontInternal.ttfReader,t=(t.setSymbols(e),e=i.convertString(e),tt.toUnicodeArray(e,!1));return tt.byteToString(t)},Ci.prototype.customSplitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customLayout(t,i,n).split("")};var vi=Ci;function Ci(){this.openBracket="(",this.closeBracket=")"}(w=Y.PdfLayoutType||(Y.PdfLayoutType={}))[w.Paginate=0]="Paginate",w[w.OnePage=1]="OnePage",(w=Y.PdfLayoutBreakType||(Y.PdfLayoutBreakType={}))[w.FitPage=0]="FitPage",w[w.FitElement=1]="FitElement",w[w.FitColumnsToPage=2]="FitColumnsToPage",(w=Y.PathPointType||(Y.PathPointType={}))[w.Start=0]="Start",w[w.Line=1]="Line",w[w.Bezier3=3]="Bezier3",w[w.Bezier=3]="Bezier",w[w.PathTypeMask=7]="PathTypeMask",w[w.DashMode=16]="DashMode",w[w.PathMarker=32]="PathMarker",w[w.CloseSubpath=128]="CloseSubpath",Bi=function(t,e){return(Bi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Bi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Li,Oi=pt),Object.defineProperty(Li.prototype,"background",{get:function(){return this.mbackground},set:function(t){this.mbackground=t;var e=this.shading;t.isEmpty?e.remove(this.dictionaryProperties.background):e.items.setValue(this.dictionaryProperties.background,t.toArray(this.colorSpace))},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"antiAlias",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.antiAlias).value},set:function(t){var e=this.shading,i=e.items.getValue(this.dictionaryProperties.antiAlias);null==i&&void 0===i?(i=new zt(t),e.items.setValue(this.dictionaryProperties.antiAlias,i)):i.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"function",{get:function(){return this.mfunction},set:function(t){null!=(this.mfunction=t)&&void 0!==t?this.shading.items.setValue(this.dictionaryProperties.function,new d(this.mfunction)):this.shading.remove(this.dictionaryProperties.function)},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"bBox",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.bBox)},set:function(t){var e=this.shading;null==t&&void 0===t?e.remove(this.dictionaryProperties.bBox):e.items.setValue(this.dictionaryProperties.bBox,t)},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"colorSpace",{get:function(){return this.mcolorSpace},set:function(t){var e=this.shading.items.getValue(this.dictionaryProperties.colorSpace);t===this.mcolorSpace&&null!=e||(this.mcolorSpace=t,e=this.colorSpaceToDeviceName(t),this.shading.items.setValue(this.dictionaryProperties.colorSpace,new o(e)))},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"stroking",{get:function(){return this.mbStroking},set:function(t){this.mbStroking=t},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"patternDictionary",{get:function(){return null==this.mpatternDictionary&&(this.mpatternDictionary=new c),this.mpatternDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"shading",{get:function(){return this.mshading},set:function(t){if(null==t)throw new Error("ArgumentNullException : Shading");t!==this.mshading&&(this.mshading=t,this.patternDictionary.items.setValue(this.dictionaryProperties.shading,new d(this.mshading)))},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"matrix",{get:function(){return this.mmatrix},set:function(t){if(null==t)throw new Error("ArgumentNullException : Matrix");t!==this.mmatrix&&(this.mmatrix=t.clone(),t=new p(this.mmatrix.matrix.elements),this.mpatternDictionary.items.setValue(this.dictionaryProperties.matrix,t))},enumerable:!0,configurable:!0}),Li.prototype.monitorChanges=function(t,e,i,r,n){var o=!1;return t instanceof Li&&(this.colorSpace!==n&&(this.colorSpace=n,this.resetFunction()),e.setColorSpace("Pattern",this.mbStroking),t=i.getResources().getName(this),e.setColourWithPattern(null,t,this.mbStroking),o=!0),o},Li.prototype.resetChanges=function(t){},Li.prototype.colorSpaceToDeviceName=function(t){var e;return e=t===Y.PdfColorSpace.Rgb?"DeviceRGB":e},Li.prototype.resetPatternDictionary=function(t){this.mpatternDictionary=t},Li.prototype.cloneAntiAliasingValue=function(t){if(null==t)throw new Error("ArgumentNullException : brush");var e=this.shading.items.getValue(this.dictionaryProperties.antiAlias);null!=e&&t.shading.items.setValue(this.dictionaryProperties.antiAlias,new zt(e.value))},Li.prototype.cloneBackgroundValue=function(t){var e=this.background;e.isEmpty||(t.background=e)},Object.defineProperty(Li.prototype,"element",{get:function(){return this.patternDictionary},enumerable:!0,configurable:!0});var Bi,Oi,xi=Li;function Li(t){var e=Oi.call(this)||this;return e.mbackground=new f(255,255,255),e.mbStroking=!1,e.mfunction=null,e.dictionaryProperties=new l,e.mpatternDictionary=new c,e.mpatternDictionary.items.setValue(e.dictionaryProperties.type,new o(e.dictionaryProperties.pattern)),e.mpatternDictionary.items.setValue(e.dictionaryProperties.patternType,new u(2)),e.shading=t,e.colorSpace=Y.PdfColorSpace.Rgb,e}Object.defineProperty(ji.prototype,"size",{get:function(){return this.templateSize},enumerable:!0,configurable:!0}),Object.defineProperty(ji.prototype,"width",{get:function(){return this.size.width},enumerable:!0,configurable:!0}),Object.defineProperty(ji.prototype,"height",{get:function(){return this.size.height},enumerable:!0,configurable:!0}),Object.defineProperty(ji.prototype,"graphics",{get:function(){var t;return null!=this.pdfGraphics&&void 0!==this.pdfGraphics||(t=new zi(this),t=new Gi(this.size,t,this.content),this.pdfGraphics=t,this.pdfGraphics.initializeCoordinates()),this.pdfGraphics},enumerable:!0,configurable:!0}),ji.prototype.getResources=function(){return null==this.resources&&(this.resources=new Ri,this.content.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},ji.prototype.initialize=function(){this.addType(),this.addSubType()},ji.prototype.addType=function(){var t=new o(this.dictionaryProperties.xObject);this.content.items.setValue(this.dictionaryProperties.type,t)},ji.prototype.addSubType=function(){var t=new o(this.dictionaryProperties.form);this.content.items.setValue(this.dictionaryProperties.subtype,t)},ji.prototype.reset=function(t){void 0===t?(null!=this.resources&&(this.resources=null,this.content.remove(this.dictionaryProperties.resources)),null!=this.graphics&&this.graphics.reset(this.size)):(this.setSize(t),this.reset())},ji.prototype.setSize=function(t){var e=new Z(new X(0,0),t),e=p.fromRectangle(e);this.content.items.setValue(this.dictionaryProperties.bBox,e),this.templateSize=t},Object.defineProperty(ji.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0});var Ti=ji;function ji(t,e){var i;this.dictionaryProperties=new l,this.writeTransformation=!0,void 0!==t&&(t instanceof J&&void 0===e?(this.content=new U,i=new J(t.width,t.height),this.setSize(i)):(this.content=new U,this.setSize(new J(t,e))),this.initialize())}ki=function(t,e){return(ki=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}ki(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Mi,Vi=c),Object.defineProperty(Mi.prototype,"names",{get:function(){return this.getNames()},enumerable:!0,configurable:!0}),Object.defineProperty(Mi.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),Mi.prototype.getName=function(t){var e,i=t.element,r=null;return null==(r=this.names.containsKey(i)?this.names.getValue(i):r)&&(e=this.generateName(),r=new o(e),this.names.setValue(i,r),t instanceof Tt||t instanceof Ti||t instanceof xi||t instanceof Fi||t instanceof de||t instanceof ke||t instanceof De)&&this.add(t,r),r},Mi.prototype.getNames=function(){null==this.pdfNames&&(this.pdfNames=new ce);var t=this.items.getValue(this.dictionaryProperties.font);return null!=t&&Xt.dereference(t),this.pdfNames},Mi.prototype.requireProcedureSet=function(t){if(null==t)throw new Error("ArgumentNullException:procedureSetName");var e=this.items.getValue(this.dictionaryProperties.procset),t=(null==e&&(e=new p,this.items.setValue(this.dictionaryProperties.procset,e)),new o(t));e.contains(t)||e.add(t)},Mi.prototype.removeFont=function(t){for(var e=null,i=this.pdfNames.keys(),r=0;r<this.pdfNames.size();r++)if(this.pdfNames.getValue(i[r])===new o(t)){e=i[r];break}null!=e&&this.pdfNames.remove(e)},Mi.prototype.generateName=function(){return Di.getNewGuidString()},Mi.prototype.add=function(t,e){if(t instanceof Tt){var i=null,r=this.items.getValue(this.dictionaryProperties.font);null!=r?i=i=s=r:(i=new c,this.items.setValue(this.dictionaryProperties.font,i)),i.items.setValue(e.value,new d(t.element))}else if(t instanceof Ti){var n=void 0;null==(n=this.items.getValue(this.dictionaryProperties.xObject))&&(n=new c,this.items.setValue(this.dictionaryProperties.xObject,n)),n.items.setValue(e.value,new d(t.element))}else if(t instanceof pt)(t instanceof xi||t instanceof Fi)&&null!=(o=t.element)&&(null==(r=this.items.getValue(this.dictionaryProperties.pattern))&&(r=new c,this.items.setValue(this.dictionaryProperties.pattern,r)),r.items.setValue(e.value,new d(o)));else if(t instanceof de){var o=t.element,i=null;null==(i=this.items.getValue(this.dictionaryProperties.extGState))&&(i=new c,this.items.setValue(this.dictionaryProperties.extGState,i)),i.items.setValue(e.value,new d(o))}else{var s,n=this.Dictionary.items.getValue(this.dictionaryProperties.xObject),r=void 0,a=(void 0!==this.pdfDocument&&(r=this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.getValue(this.dictionaryProperties.xObject)),this.Dictionary.items.values(),!1),h=void 0;if(void 0!==this.pdfDocument&&null==r)r=new c,this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.setValue(this.dictionaryProperties.xObject,r);else if(void 0!==this.pdfDocument)for(var l=r.items.values(),u=0;u<l.length;u++)void 0!==l[u]&&void 0!==l[u].element&&l[u].element.data[0]===t.element.data[0]&&(h=l[u],a=!0);null==n&&(n=new c,this.Dictionary.items.setValue(this.dictionaryProperties.xObject,n)),a&&void 0!==h?n.items.setValue(e.value,h):(s=new d(t.element),n.items.setValue(e.value,s),void 0!==this.pdfDocument&&r.items.setValue(e.value,s))}};var ki,Vi,Ri=Mi;function Mi(t){t=Vi.call(this,t)||this;return t.properties=new c,t}Ai.getNewGuidString=function(){return"aaaaaaaa-aaaa-4aaa-baaa-aaaaaaaaaaaa".replace(/[ab]/g,function(t){var e=16*Math.random()|0;return("a"===t?e:3&e|8).toString(16)})};var Di=Ai;function Ai(){}Ni=function(t,e){return(Ni=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ni(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Ei,Ii=pt),Ei.prototype.initialize=function(t,e,i,r){this.mPage=e,this.mLocation=i,this.mTransformationMatrix=r,this.tempBrushStream=this.brushStream,this.brushStream=new U;e=new Ri;return this.brushStream.items.setValue(this.mDictionaryProperties.resources,e),this.setBox(t),this.setObligatoryFields(),this},Object.defineProperty(Ei.prototype,"location",{get:function(){return this.mLocation},set:function(t){this.mLocation=t},enumerable:!0,configurable:!0}),Ei.prototype.setObligatoryFields=function(){var t,e;this.brushStream.items.setValue(this.mDictionaryProperties.patternType,new u(1)),this.brushStream.items.setValue(this.mDictionaryProperties.paintType,new u(1)),this.brushStream.items.setValue(this.mDictionaryProperties.tilingType,new u(1)),this.brushStream.items.setValue(this.mDictionaryProperties.xStep,new u(this.mBox.right-this.mBox.left)),this.brushStream.items.setValue(this.mDictionaryProperties.yStep,new u(this.mBox.bottom-this.mBox.top)),null!=this.mPage&&null!=this.mLocation&&(null==this.mTransformationMatrix&&void 0===this.mTransformationMatrix?(t=this.mPage.size.height%this.rectangle.size.height-this.mLocation.y,this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new p([1,0,0,1,this.mLocation.x,t]))):(t=0,e=this.mTransformationMatrix.matrix.elements,t=this.mPage.size.height>this.rectangle.size.height?this.mTransformationMatrix.matrix.offsetY-this.mPage.size.height%this.rectangle.size.height:this.mPage.size.height%this.rectangle.size.height+this.mTransformationMatrix.matrix.offsetY,this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new p([e[0],e[1],e[2],e[3],e[4],t]))))},Ei.prototype.setBox=function(t){this.mBox=t;t=new Z(this.mBox.left,this.mBox.top,this.mBox.right,this.mBox.bottom);this.brushStream.items.setValue(this.mDictionaryProperties.bBox,p.fromRectangle(t))},Object.defineProperty(Ei.prototype,"rectangle",{get:function(){return this.mBox},enumerable:!0,configurable:!0}),Object.defineProperty(Ei.prototype,"size",{get:function(){return this.mBox.size},enumerable:!0,configurable:!0}),Object.defineProperty(Ei.prototype,"graphics",{get:function(){var t;return null==this.mGraphics&&void 0===this.mGraphics&&(t=new zi(this),t=new Gi(this.size,t,this.brushStream),this.mGraphics=t,this.mResources=this.getResources(),this.mGraphics.initializeCoordinates()),this.mGraphics},enumerable:!0,configurable:!0}),Ei.prototype.getResources=function(){return this.mResources},Object.defineProperty(Ei.prototype,"stroking",{get:function(){return this.mStroking},set:function(t){this.mStroking=t},enumerable:!0,configurable:!0}),Ei.prototype.clone=function(){var t=this.initialize(this.rectangle,this.mPage,this.location,this.mTransformationMatrix);return null!=this.mTransformationMatrix&&null!=this.mTransformationMatrix.matrix&&t.brushStream.items.setValue(this.mDictionaryProperties.matrix,new p(this.mTransformationMatrix.matrix.elements)),t.brushStream.data=this.tempBrushStream.data,t.mResources=new Ri(this.mResources),t.brushStream.items.setValue(this.mDictionaryProperties.resources,t.mResources),t},Ei.prototype.monitorChanges=function(t,e,i,r,n){var o,s=!1;return t!==this?(e.setColorSpace("Pattern",this.mStroking),o=i.getResources().getName(this),e.setColourWithPattern(null,o,this.mStroking),s=!0):t instanceof Ei&&(e.setColorSpace("Pattern",this.mStroking),o=i.getResources().getName(this),e.setColourWithPattern(null,o,this.mStroking),s=!0),s},Ei.prototype.resetChanges=function(t){},Object.defineProperty(Ei.prototype,"element",{get:function(){return this.brushStream},enumerable:!0,configurable:!0});var Ni,Ii,Fi=Ei;function Ei(t,e){var i=Ii.call(this)||this,r=(i.mStroking=!1,i.mLocation=new X(0,0),i.mDictionaryProperties=new l,null);return t instanceof ut?r=t:t instanceof J&&(r=new ut(0,0,t.width,t.height)),null!==e&&e instanceof or&&(i.mPage=e),i.brushStream=new U,i.mResources=new Ri,i.brushStream.items.setValue(i.mDictionaryProperties.resources,i.mResources),i.setBox(r),i.setObligatoryFields(),null!==e&&e instanceof or&&(i.mPage=e,i.graphics.colorSpace=e.document.colorSpace),i}Object.defineProperty(S.prototype,"stringLayoutResult",{get:function(){return this.pdfStringLayoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"size",{get:function(){return this.canvasSize},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"mediaBoxUpperRightBound",{get:function(){return void 0===this.internalMediaBoxUpperRightBound&&(this.internalMediaBoxUpperRightBound=0),this.internalMediaBoxUpperRightBound},set:function(t){this.internalMediaBoxUpperRightBound=t},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"clientSize",{get:function(){return new J(this.clipBounds.width,this.clipBounds.height)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"colorSpace",{get:function(){return this.currentColorSpace},set:function(t){this.currentColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"streamWriter",{get:function(){return this.pdfStreamWriter},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"matrix",{get:function(){return null==this.transformationMatrix&&(this.transformationMatrix=new se),this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"layer",{get:function(){return this.pageLayer},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"page",{get:function(){return this.pageLayer.page},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"automaticFields",{get:function(){return null!=this.internalAutomaticFields&&void 0!==this.internalAutomaticFields||(this.internalAutomaticFields=new ge),this.internalAutomaticFields},enumerable:!0,configurable:!0}),S.prototype.initialize=function(){this.bStateSaved=!1,this.currentPen=null,this.currentBrush=null,this.currentFont=null,this.currentColorSpace=Y.PdfColorSpace.Rgb,this.bCSInitialized=!1,this.transformationMatrix=null,this.previousTextRenderingMode=-1,this.previousCharacterSpacing=-1,this.previousWordSpacing=-1,this.previousTextScaling=-100,this.currentStringFormat=null,this.clipBounds=new Z(new X(0,0),this.size),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf)},S.prototype.drawPdfTemplate=function(t,e,i){if(void 0===i){if(null==t)throw Error("ArgumentNullException-template");this.drawPdfTemplate(t,e,t.size)}else{if(null==t)throw Error("ArgumentNullException-template");var r=0<t.width?i.width/t.width:1,n=0<t.height?i.height/t.height:1,o=!(1==r&&1==n),s=this.save(),a=new se;null!=this.pageLayer&&this.getTranslateTransform(e.x,e.y+i.height,a),o&&this.getScaleTransform(r,n,a),this.pdfStreamWriter.modifyCtm(a);var o=this.getResources.getResources().getName(t),h=(this.pdfStreamWriter.executeObject(o),this.restore(s),t.graphics);if(null!=h)for(var l=0;l<h.automaticFields.automaticFields.length;l++){var u=h.automaticFields.automaticFields[l],c=new X(u.location.x+e.x,u.location.y+e.y),p=0==t.size.width?0:i.width/t.size.width,d=0==t.size.height?0:i.height/t.size.height;this.automaticFields.add(new ve(u.field,c,p,d)),this.page.dictionary.modify()}this.getResources.getResources().requireProcedureSet(this.procedureSets.imageB),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageC),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageI),this.getResources.getResources().requireProcedureSet(this.procedureSets.text)}},S.prototype.drawString=function(t,e,i,r,n,o,s,a,h){var l;"string"==typeof t&&e instanceof Tt&&(i instanceof ne||null===i)&&(r instanceof pt||null===r)&&"number"==typeof n&&"number"==typeof o&&(s instanceof bt||null===s)&&void 0===a?(this.isOverloadWithPosition=!0,this.drawString(t,e,i,r,n,o,this.clientSize.width-n,0,s)):(i=i,r=r,n=n,o=o,s=s,a=a,h=h,(t=(new vt).layout(t,e,h,new J(s,a),this.isOverloadWithPosition,this.clientSize)).empty||(l=this.checkCorrectLayoutRectangle(t.actualSize,n,o,h),s<=0&&(n=l.x,s=l.width),a<=0&&(o=l.y,a=l.height),this.drawStringLayoutResult(t,e,i,r,new Z(n,o,s,a),h),this.isEmfTextScaled=!1,this.emfScalingFactor=new J(0,0)),this.getResources.getResources().requireProcedureSet(this.procedureSets.text),this.isNormalRender=!0,this.pdfStringLayoutResult=t,this.isUseFontSize=!1)},S.prototype.drawLine=function(t,e,i,r,n){var o,s;e instanceof X?this.drawLine(t,(o=e).x,o.y,(s=i).x,s.y):(o=e,s=i,e=r,i=n,this.stateControl(t,null,null),(r=this.streamWriter).beginPath(o,s),r.appendLineSegment(e,i),r.strokePath(),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf))},S.prototype.drawRectangle=function(t,e,i,r,n,o){var s,a;t instanceof ne&&"number"==typeof e?this.drawRectangle(t,null,e,s=i,r,n):t instanceof pt&&"number"==typeof e?this.drawRectangle(null,t,e,s=i,r,n):(s=i,i=r,r=n,n=o,e instanceof Fi?(this.bCSInitialized=!1,o=this.matrix.matrix.offsetX+s,a=void 0,a=null!=this.layer&&null!=this.layer.page?this.layer.page.size.height-this.matrix.matrix.offsetY+i:this.clientSize.height-this.matrix.matrix.offsetY+i,e.location=new X(o,a),e.graphics.colorSpace=this.colorSpace):e instanceof xi&&(e.colorSpace=this.colorSpace),o=t,a=e=e instanceof mt&&e.color.isEmpty?null:e,this.stateControl(o,a,null),this.streamWriter.appendRectangle(s,i,r,n),this.drawPathHelper(o,a,!1))},S.prototype.drawRoundedRectangle=function(t,e,i,r,n,o,s){if(null===t)throw new Error("pen");if(null===e)throw new Error("brush");0===s?this.drawRectangle(t,e,i,r,n,o):(o=[(i=[i,r,n,o])[0],i[1],(n=[r=2*s,r])[0],n[1]],this._pathPoints=[],this._pathTypes=[],s=this._addArc(o[0],o[1],o[2],o[3],180,90,s=!0),o[0]=i[0]+i[2]-r,s=this._addArc(o[0],o[1],o[2],o[3],270,90,s),o[1]=i[1]+i[3]-r,s=this._addArc(o[0],o[1],o[2],o[3],0,90,s),o[0]=i[0],s=this._addArc(o[0],o[1],o[2],o[3],90,90,s),n=this._pathPoints.length-1,r=this._pathTypes[n],r|=Y.PathPointType.CloseSubpath,this._pathTypes[n]=r,this._drawPath(t,e,this._pathPoints,this._pathTypes,Y.PdfFillMode.Alternate),this._pathPoints=[],this._pathTypes=[])},S.prototype._addArc=function(t,e,i,r,n,o,s){for(var a=this._getBezierArcPoints(t,e,t+i,e+r,n,o),h=0;h<a.length;h+=8){var l=[a[h],a[h+1],a[h+2],a[h+3],a[h+4],a[h+5],a[h+6],a[h+7]];s=this._addArcPoints(l,Y.PathPointType.Bezier3,s)}return s},S.prototype._addArcPoints=function(t,e,i){for(var r=0;r<t.length;r++){var n=new X(t[r],t[r+1]);0===r?0===this._pathPoints.length||i?(this._addPoint(n,Y.PathPointType.Start),i=!1):n.x===this._getLastPoint().x&&n.y===this._getLastPoint().y||this._addPoint(n,Y.PathPointType.Line):this._addPoint(n,e),r++}return i},S.prototype._getLastPoint=function(){var t=new X(0,0),e=this._pathPoints.length;return 0<e&&(t.x=this._pathPoints[e-1].x,t.y=this._pathPoints[e-1].y),t},S.prototype._addPoint=function(t,e){this._pathPoints.push(t),this._pathTypes.push(e)},S.prototype._getBezierArcPoints=function(t,e,i,r,n,o){i<t&&(p=void 0,p=t,t=i,i=p),e<r&&(p=void 0,p=e,e=r,r=p),Math.abs(o)<=90?(s=o,a=1):s=o/(a=Math.ceil(Math.abs(o)/90));for(var s,a,h=(t+i)/2,l=(e+r)/2,u=(i-t)/2,c=(r-e)/2,p=s*(Math.PI/360),d=Math.abs(4/3*(1-Math.cos(p))/Math.sin(p)),f=[],g=0;g<a;g++){var m=(n+g*s)*(Math.PI/180),y=(n+(g+1)*s)*(Math.PI/180),b=Math.cos(m),w=Math.cos(y),m=Math.sin(m),y=Math.sin(y);0<s?f.push(h+u*b,l-c*m,h+u*(b-d*m),l-c*(m+d*b),h+u*(w+d*y),l-c*(y-d*w),h+u*w,l-c*y):f.push(h+u*b,l-c*m,h+u*(b+d*m),l-c*(m-d*b),h+u*(w-d*y),l-c*(y+d*w),h+u*w,l-c*y)}return f},S.prototype.drawPathHelper=function(t,e,i,r){"boolean"==typeof i?this.drawPathHelper(t,e,Y.PdfFillMode.Winding,i):(e=null!=e,i=i===Y.PdfFillMode.Alternate,(t=null!=t)&&e?this.streamWriter.fillStrokePath(i):t||e?t?this.streamWriter.strokePath():this.streamWriter.fillPath(i):this.streamWriter.endPath())},S.prototype.drawImage=function(t,e,i,r,n){var o,s;"number"==typeof e&&"number"==typeof i&&void 0===r?(s=t.physicalDimension,this.drawImage(t,e,i,s.width,s.height)):(s=e,e=i,i=n,t.save(),o=new se,this.getTranslateTransform(s,e+i,o),this.getScaleTransform(r,n,o),this.pdfStreamWriter.write("q"),this.pdfStreamWriter.modifyCtm(o),s=this.getResources.getResources(),void 0!==this.pageLayer&&null!=this.page&&(s.document=this.page.document),e=s.getName(t),void 0!==this.pageLayer&&this.page.setResources(s),this.pdfStreamWriter.executeObject(e),this.pdfStreamWriter.write(h.restoreState),this.pdfStreamWriter.write(h.newLine),(i=this.getResources.getResources()).requireProcedureSet(this.procedureSets.imageB),i.requireProcedureSet(this.procedureSets.imageC),i.requireProcedureSet(this.procedureSets.imageI),i.requireProcedureSet(this.procedureSets.text))},S.prototype.getLineBounds=function(t,e,i,r,n){var o,s,a,h;return!e.empty&&t<e.lineCount&&0<=t?(h=e.lines[t],o=this.getTextVerticalAlignShift(e.actualSize.height,r.height,n)+r.y+e.lineHeight*t,s=h.width,a=this.getHorizontalAlignShift(s,r.width,n),t=this.getLineIndent(h,n,r,0===t),a+=this.rightToLeft(n)?0:t,a=r.x+a,h=this.shouldJustify(h,r.width,n)?r.width-t:s-t,n=e.lineHeight,new Z(a,o,h,n)):new Z(0,0,0,0)},S.prototype.checkCorrectLayoutRectangle=function(t,e,i,r){var n=new Z(e,i,t.width,t.width);if(null!=r){switch(r.alignment){case Y.PdfTextAlignment.Center:n.x-=n.width/2;break;case Y.PdfTextAlignment.Right:n.x-=n.width}switch(r.lineAlignment){case Y.PdfVerticalAlignment.Middle:n.y-=n.height/2;break;case Y.PdfVerticalAlignment.Bottom:n.y-=n.height}}return n},S.prototype.setLayer=function(t){t=(this.pageLayer=t).page;null!=t&&void 0!==t&&(t.beginSave=this.pageSave)},S.prototype.pageSave=function(t){if(null!=t.graphics.automaticFields)for(var e=0;e<t.graphics.automaticFields.automaticFields.length;e++){var i=t.graphics.automaticFields.automaticFields[e];i.field.performDraw(t.graphics,i.location,i.scalingX,i.scalingY)}},S.prototype.drawStringLayoutResult=function(t,e,i,r,n,o){if(t.empty)throw new Error("ArgumentNullException:result");this.applyStringSettings(e,i,r,o,n);var s=null!=o?o.horizontalScalingFactor:100,s=(s===this.previousTextScaling||this.isEmfTextScaled||(this.pdfStreamWriter.setTextScaling(s),this.previousTextScaling=s),null==o||0===o.lineSpacing?e.height:o.lineSpacing+e.height),a=null!=o&&o.subSuperScript===Y.PdfSubSuperScript.SubScript?s-(e.height+e.metrics.getDescent(o)):s-e.metrics.getAscent(o);this.shift=a,this.pdfStreamWriter.startNextLine(n.x,n.y-a),this.pdfStreamWriter.setLeading(+s);for(var h=0,l="",u=0;u<t.lines.length;u++)if(h+=t.lineHeight,n.y+h>this.clientSize.height){this.startCutIndex=u;break}for(var c=this.startCutIndex;c<t.lines.length&&0<=c;c++)l+=t.lines[c].text;a=new Z(n.x,n.y,n.width,n.height);this.drawLayoutResult(t,e,o,n),this.underlineStrikeoutText(i,r,t,e,a,o),this.isEmfPlus=!1,this.isUseFontSize=!1,-1!==this.startCutIndex&&this.getNextPage().graphics.drawString(l,e,i,r,n.x,0,n.width,0,o)},S.prototype.getNextPage=function(){var t=this.currentPage.section,e=t.indexOf(this.currentPage);return e===t.count-1?t.add():t.getPages()[e+1]},S.prototype.setClip=function(t,e){void 0===e?this.setClip(t,Y.PdfFillMode.Winding):(this.pdfStreamWriter.appendRectangle(t),this.pdfStreamWriter.clipPath(e===Y.PdfFillMode.Alternate))},S.prototype.applyStringSettings=function(t,e,i,r,n){i instanceof Fi?(this.bCSInitialized=!1,i.graphics.colorSpace=this.colorSpace):i instanceof xi&&(this.bCSInitialized=!1,i.colorSpace=this.colorSpace);var o=this.getTextRenderingMode(e,i,r),e=(this.stateControl(e,i,t,r),this.pdfStreamWriter.beginText(),o!==this.previousTextRenderingMode&&(this.pdfStreamWriter.setTextRenderingMode(o),this.previousTextRenderingMode=o),null!=r?r.characterSpacing:0),i=(e===this.previousCharacterSpacing||this.isEmfTextScaled||(this.pdfStreamWriter.setCharacterSpacing(e),this.previousCharacterSpacing=e),null!=r?r.wordSpacing:0);i!==this.previousWordSpacing&&(this.pdfStreamWriter.setWordSpacing(i),this.previousWordSpacing=i)},S.prototype.getTextVerticalAlignShift=function(t,e,i){var r=0;if(0<=e&&null!=i&&i.lineAlignment!==Y.PdfVerticalAlignment.Top)switch(i.lineAlignment){case Y.PdfVerticalAlignment.Middle:r=(e-t)/2;break;case Y.PdfVerticalAlignment.Bottom:r=e-t}return r},S.prototype.drawLayoutResult=function(t,e,i,r){var n=this.getTextVerticalAlignShift(t.actualSize.height,r.height,i);0!==n&&this.pdfStreamWriter.startNextLine(0,n);for(var o=null!=e&&e.isUnicode,s=(null!=e&&e.isEmbedFont,t.lines),a=0,h=s.length;a<h&&a!==this.startCutIndex;a++){var l=s[a],u=(l.text,l.width),u=this.getHorizontalAlignShift(u,r.width,i),c=this.getLineIndent(l,i,r,0===a);0===(u+=this.rightToLeft(i)?0:c)||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(u,0),o?this.drawUnicodeLine(l,r,e,i):this.drawAsciiLine(l,r,e,i),0===u||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(-u,0),this.isOverloadWithPosition&&1<s.length&&(this.pdfStreamWriter.startNextLine(-r.x,0),r.x=0,r.width=this.clientSize.width,this.isOverloadWithPosition=!1,this.isPointOverload=!0)}this.getResources.getResources().requireProcedureSet(this.procedureSets.text),0!==n&&this.pdfStreamWriter.startNextLine(0,-(n-t.lineHeight)),this.pdfStreamWriter.endText()},S.prototype.drawAsciiLine=function(t,e,i,r){this.justifyLine(t,e.width,r);var n="";if(-1!==t.text.indexOf("(")||-1!==t.text.indexOf(")"))for(var o=0;o<t.text.length;o++)"("===t.text[o]?n+="\\(":")"===t.text[o]?n+="\\)":n+=t.text[o];""===n&&(n=t.text),this.pdfStreamWriter.showNextLineText(new tt("("+n+")"))},S.prototype.drawUnicodeLine=function(t,e,i,r){var n,o,s=t.text,a=(t.width,null!=r&&r.rightToLeft),h=null!=r&&(0!==r.wordSpacing||r.alignment===Y.PdfTextAlignment.Justify),t=this.justifyLine(t,e.width,r),e=new vi;a||null!=r&&r.textDirection!==Y.PdfTextDirection.None?(a=(n=null)!=r&&r.alignment===Y.PdfTextAlignment.Right,o=1<(n=(o=null)!=r&&r.textDirection!==Y.PdfTextDirection.None?e.layout(s,i,r.textDirection===Y.PdfTextDirection.RightToLeft,h,r):e.layout(s,i,a,h,r)).length?null!=r&&r.textDirection!==Y.PdfTextDirection.None?e.splitLayout(s,i,r.textDirection===Y.PdfTextDirection.RightToLeft,h,r):e.splitLayout(s,i,a,h,r):[s],this.drawUnicodeBlocks(n,o,i,r,t)):h?(n=(e=this.breakUnicodeLine(s,i,null)).tokens,o=e.words,this.drawUnicodeBlocks(n,o,i,r,t)):(a=this.convertToUnicode(s,i),h=this.getUnicodeString(a),this.streamWriter.showNextLineText(h))},S.prototype.drawUnicodeBlocks=function(t,e,i,r,n){if(null==t)throw new Error("Argument Null Exception : blocks");if(null==e)throw new Error("Argument Null Exception : words");if(null==i)throw new Error("Argument Null Exception : font");this.streamWriter.startNextLine();var o=0,s=0,a=0,h=0;try{null!=r&&(a=r.firstLineIndent,h=r.paragraphIndent,r.firstLineIndent=0,r.paragraphIndent=0);var l=i.getCharWidth(Pt.whiteSpace,r)+n,u=null!=r?r.characterSpacing:0;l+=u+(null!=r&&0===n?r.wordSpacing:0);for(var c=0;c<t.length;c++){var p,d=t[c],f=e[c],g=0;0!==o&&this.streamWriter.startNextLine(o,0),0<f.length&&(g=g+i.measureString(f,r).width+u,p=this.getUnicodeString(d),this.streamWriter.showText(p)),c!==t.length-1&&(s+=o=g+l)}0<s&&this.streamWriter.startNextLine(-s,0)}finally{null!=r&&(r.firstLineIndent=a,r.paragraphIndent=h)}},S.prototype.breakUnicodeLine=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : line");i=t.split(null);for(var r=[],n=0;n<i.length;n++){var o=i[n],o=this.convertToUnicode(o,e);r[n]=o}return{tokens:r,words:i}},S.prototype.getUnicodeString=function(t){if(null===t)throw new Error("Argument Null Exception : token");t=new tt(t);return t.converted=!0,t.encode=Y.InternalEnum.ForceEncoding.Ascii,t},S.prototype.convertToUnicode=function(t,e){var i,r=null;if(null==t)throw new Error("Argument Null Exception : text");if(null==e)throw new Error("Argument Null Exception : ttfFont");return e.fontInternal instanceof di&&(i=e.fontInternal.ttfReader,e.setSymbols(t),r=i.convertString(t),e=tt.toUnicodeArray(r,!1),r=tt.byteToString(e)),r},S.prototype.justifyLine=function(t,e,i){var r=t.text,n=t.width,t=this.shouldJustify(t,e,i),o=null!=i&&0!==i.wordSpacing,s=Pt.spaces,r=Pt.getCharsCount(r,s),s=0;return t?(o&&(n-=r*i.wordSpacing),this.pdfStreamWriter.setWordSpacing(s=(e-n)/r)):o?this.pdfStreamWriter.setWordSpacing(i.wordSpacing):this.pdfStreamWriter.setWordSpacing(0),s},S.prototype.reset=function(t){this.canvasSize=t,this.streamWriter.clear(),this.initialize(),this.initializeCoordinates()},S.prototype.shouldJustify=function(t,e,i){var r=t.text,n=t.width,o=null!=i&&i.alignment===Y.PdfTextAlignment.Justify,n=0<=e&&n<e,e=Pt.spaces,e=0<Pt.getCharsCount(r,e)&&r[0]!==Pt.whiteSpace,r=0<(t.lineType&Y.LineType.LayoutBreak);return o&&n&&e&&(r||i.alignment===Y.PdfTextAlignment.Justify)},S.prototype.underlineStrikeoutText=function(t,e,i,r,n,o){if(r.underline||r.strikeout){var s=this.createUnderlineStikeoutPen(t,e,r,o);if(null!=s){for(var t=this.getTextVerticalAlignShift(i.actualSize.height,n.height,o),a=0,a=n.y+t+r.metrics.getAscent(o)+1.5*s.width,h=n.y+t+r.metrics.getHeight(o)/2+1.5*s.width,l=i.lines,u=0,c=i.lineCount;u<c;u++){var p,d=l[u],f=(d.text,d.width),g=this.getHorizontalAlignShift(f,n.width,o),m=this.getLineIndent(d,o,n,0===u),g=(g+=this.rightToLeft(o)?0:m,n.x+g),d=this.shouldJustify(d,n.width,o)?g+n.width-m:g+f-m;r.underline&&(p=a,this.drawLine(s,g,p,d,p),a+=i.lineHeight),r.strikeout&&(p=h,this.drawLine(s,g,p,d,p),h+=i.lineHeight),this.isPointOverload&&1<l.length&&(n.x=0,n.width=this.clientSize.width)}this.isPointOverload=!1}}},S.prototype.createUnderlineStikeoutPen=function(t,e,i,r){i=i.metrics.getSize(r)/20,r=null;return null!=t?r=new ne(t.color,i):null!=e&&(r=new ne(e,i)),r},S.prototype.getTextRenderingMode=function(t,e,i){var r=Y.TextRenderingMode.None,r=null!=t&&null!=e?Y.TextRenderingMode.FillStroke:null!=t?Y.TextRenderingMode.Stroke:Y.TextRenderingMode.Fill;return null!=i&&i.clipPath&&(r|=Y.TextRenderingMode.ClipFlag),r},S.prototype.getLineIndent=function(t,e,i,r){var n=0,t=0<(t.lineType&Y.LineType.FirstParagraphLine);return null!=e&&t&&(n=r?e.firstLineIndent:e.paragraphIndent,n=0<i.width?Math.min(i.width,n):n),n},S.prototype.getHorizontalAlignShift=function(t,e,i){var r=0;if(0<=e&&null!=i&&i.alignment!==Y.PdfTextAlignment.Left)switch(i.alignment){case Y.PdfTextAlignment.Center:r=(e-t)/2;break;case Y.PdfTextAlignment.Right:r=e-t}return r},S.prototype.rightToLeft=function(t){var e=null!=t&&t.rightToLeft;return e=null!=t&&t.textDirection!==Y.PdfTextDirection.None&&void 0!==t.textDirection?!0:e},S.prototype.stateControl=function(t,e,i,r){void 0===r?this.stateControl(t,e,i,null):(e instanceof xi&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),e instanceof Fi&&(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace),null!==e?(void 0!==this.pageLayer&&null!=this.pageLayer&&!1===this.colorSpaceChanged&&(this.lastDocumentCS=this.pageLayer.page.document.colorSpace,this.lastGraphicsCS=this.pageLayer.page.graphics.colorSpace,this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace,this.colorSpaceChanged=!0),this.initCurrentColorSpace(this.currentColorSpace)):null!=t&&(void 0!==this.pageLayer&&null!=this.pageLayer&&(this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace),this.initCurrentColorSpace(this.currentColorSpace)),this.penControl(t,!1),this.brushControl(e,!1),this.fontControl(i,r,!1))},S.prototype.initCurrentColorSpace=function(t){this.getResources.getResources();this.bCSInitialized||(this.currentColorSpace!=Y.PdfColorSpace.GrayScale?(this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!0),this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!1)):(this.pdfStreamWriter.setColorSpace("DeviceGray",!0),this.pdfStreamWriter.setColorSpace("DeviceGray",!1)),this.bCSInitialized=!0)},S.prototype.penControl=function(t,e){null!=t&&((this.currentPen=t).monitorChanges(this.currentPen,this.pdfStreamWriter,this.getResources,e,this.colorSpace,this.matrix.clone()),this.currentPen=t.clone())},S.prototype.brushControl=function(t,e){var i,r,n,o;null!=t&&void 0!==t&&(null==(r=i=t.clone())||t instanceof mt||t instanceof Fi||(n=r.matrix,o=this.matrix.clone(),null!=n&&(n.multiply(o),o=n),r.matrix=o),this.currentBrush=r,i.monitorChanges(this.currentBrush,this.pdfStreamWriter,this.getResources,e,this.colorSpace),this.currentBrush=t)},S.prototype.fontControl=function(t,e,i){var r,n;null!=t&&(r=null!=e?e.subSuperScript:Y.PdfSubSuperScript.None,n=null!=this.currentStringFormat?this.currentStringFormat.subSuperScript:Y.PdfSubSuperScript.None,!i&&t===this.currentFont&&r===n||(i=this.getResources.getResources(),this.currentFont=t,this.currentStringFormat=e,r=t.metrics.getSize(e),this.isEmfTextScaled=!1,n=i.getName(t),this.pdfStreamWriter.setFont(t,n,r)))},S.prototype.setTransparency=function(t,e,i){var r,n;void 0===e?(this.istransparencySet=!0,this.setTransparency(t,t,Y.PdfBlendMode.Normal)):"number"==typeof e&&void 0===i?this.setTransparency(t,e,Y.PdfBlendMode.Normal):(null==this.trasparencies&&(this.trasparencies=new ce),r=null,n=new Ui(t,e,i),null==(r=this.trasparencies.containsKey(n)?this.trasparencies.getValue(n):r)&&(r=new de(t,e,i),this.trasparencies.setValue(n,r)),t=this.getResources.getResources().getName(r),this.streamWriter.setGraphicsState(t))},S.prototype.clipTranslateMargins=function(t,e,i,r,n,o){t instanceof Z&&void 0===e?(this.clipBounds=t,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(t),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t.x,t.y)):"number"==typeof t&&(i=new Z(i,r,this.size.width-i-n,this.size.height-r-o),this.clipBounds=i,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(i),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t,e))},S.prototype.updateY=function(t){return-t},S.prototype.translateTransform=function(t,e){var i=new se;this.getTranslateTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},S.prototype.getTranslateTransform=function(t,e,i){return i.translate(t,this.updateY(e)),i},S.prototype.scaleTransform=function(t,e){var i=new se;this.getScaleTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},S.prototype.getScaleTransform=function(t,e,i){return(i=null==i?new se:i).scale(t,e),i},S.prototype.rotateTransform=function(t){var e=new se;this.getRotateTransform(t,e),this.pdfStreamWriter.modifyCtm(e),this.matrix.multiply(e)},S.prototype.initializeCoordinates=function(){this.pdfStreamWriter.writeComment("Change co-ordinate system to left/top."),this.mediaBoxUpperRightBound!==-this.size.height&&null==this.cropBox&&(this.mediaBoxUpperRightBound===this.size.height||0===this.mediaBoxUpperRightBound?this.translateTransform(0,this.updateY(this.size.height)):this.translateTransform(0,this.updateY(this.mediaBoxUpperRightBound)))},S.prototype.getRotateTransform=function(t,e){return(e=null!=e&&void 0!==e?e:new se).rotate(this.updateY(t)),e},S.prototype.save=function(){var t=new _i(this,this.matrix.clone());return t.brush=this.currentBrush,t.pen=this.currentPen,t.font=this.currentFont,t.colorSpace=this.currentColorSpace,t.characterSpacing=this.previousCharacterSpacing,t.wordSpacing=this.previousWordSpacing,t.textScaling=this.previousTextScaling,t.textRenderingMode=this.previousTextRenderingMode,this.graphicsState.push(t),this.pdfStreamWriter.saveGraphicsState(),t},S.prototype.restore=function(t){if(void 0===t)0<this.graphicsState.length&&this.doRestoreState();else if(-1!==this.graphicsState.indexOf(t))for(;0!==this.graphicsState.length;)if(this.doRestoreState()===t)break},S.prototype.doRestoreState=function(){var t=this.graphicsState.pop();return this.transformationMatrix=t.matrix,this.currentBrush=t.brush,this.currentPen=t.pen,this.currentFont=t.font,this.currentColorSpace=t.colorSpace,this.previousCharacterSpacing=t.characterSpacing,this.previousWordSpacing=t.wordSpacing,this.previousTextScaling=t.textScaling,this.previousTextRenderingMode=t.textRenderingMode,this.pdfStreamWriter.restoreGraphicsState(),t},S.prototype.drawPath=function(t,e,i){this._drawPath(t,e,i.pathPoints,i.pathTypes,i.fillMode)},S.prototype._drawPath=function(t,e,i,r,n){e instanceof Fi?(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace):e instanceof xi&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),this.stateControl(t,e,null),this.buildUpPath(i,r),this.drawPathHelper(t,e,n,!1)},S.prototype.drawArc=function(t,e,i,r,n,o,s){e instanceof Z?this.drawArc(t,e.x,e.y,e.width,e.height,i,r):0!==s&&(this.stateControl(t,null,null),this.constructArcPath(e,i,e+r,i+n,o,s),this.drawPathHelper(t,null,!1))},S.prototype.buildUpPath=function(t,e){for(var i=t.length,r=0;r<i;++r){var n,o=t[r];switch(e[r]&S.pathTypesValuesMask){case Y.PathPointType.Start:this.pdfStreamWriter.beginPath(o.x,o.y);break;case Y.PathPointType.Bezier3:var s=new X(0,0),a=new X(0,0),s=this.getBezierPoints(t,e,r,s,a);this.pdfStreamWriter.appendBezierSegment(o,s.p2,s.p3),r=s.i;break;case Y.PathPointType.Line:this.pdfStreamWriter.appendLineSegment(o);break;default:throw new Error("ArithmeticException - Incorrect path formation.")}n=e[r],this.checkFlags(n)}},S.prototype.getBezierPoints=function(t,e,i,r,n){if((e[++i]&S.pathTypesValuesMask)!==Y.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");if(r=t[i],(e[++i]&S.pathTypesValuesMask)!==Y.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");return{i:i,p2:r,p3:t[i]}},S.prototype.checkFlags=function(t){(t&Y.PathPointType.CloseSubpath)===Y.PathPointType.CloseSubpath&&this.pdfStreamWriter.closePath()},S.prototype.constructArcPath=function(t,e,i,r,n,o){var s=this.getBezierArc(t,e,i,r,n,o);if(0!==s.length)for(var a=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]],h=(this.pdfStreamWriter.beginPath(a[0],a[1]),0),h=0;h<s.length;h+=8)a=[s[h],s[h+1],s[h+2],s[h+3],s[h+4],s[h+5],s[h+6],s[h+7]],this.pdfStreamWriter.appendBezierSegment(a[2],a[3],a[4],a[5],a[6],a[7])},S.prototype.getBezierArc=function(t,e,i,r,n,o){i<t&&(p=void 0,p=t,t=i,i=p),e<r&&(p=void 0,p=e,e=r,r=p),Math.abs(o)<=90?(s=o,a=1):s=o/(a=Math.ceil(Math.abs(o)/90));for(var s,a,h=(t+i)/2,l=(e+r)/2,u=(i-t)/2,c=(r-e)/2,p=s*(Math.PI/360),d=Math.abs(4/3*(1-Math.cos(p))/Math.sin(p)),f=[],g=0;g<a;g++){var m=(n+g*s)*(Math.PI/180),y=(n+(g+1)*s)*(Math.PI/180),b=Math.cos(m),w=Math.cos(y),m=Math.sin(m),y=Math.sin(y);0<s?f.push(h+u*b,l-c*m,h+u*(b-d*m),l-c*(m+d*b),h+u*(w+d*y),l-c*(y-d*w),h+u*w,l-c*y):f.push(h+u*b,l-c*m,h+u*(b+d*m),l-c*(m-d*b),h+u*(w-d*y),l-c*(y+d*w),h+u*w,l-c*y)}return f},S.pathTypesValuesMask=15,S.transparencyObject=!1;var Gi=S;function S(t,e,i){this.currentColorSpace=Y.PdfColorSpace.Rgb,this.previousTextRenderingMode=Y.TextRenderingMode.Fill,this.previousCharacterSpacing=0,this.previousWordSpacing=0,this.previousTextScaling=100,this.procedureSets=new ue,this.isNormalRender=!0,this.isUseFontSize=!1,this.isItalic=!1,this.isEmfTextScaled=!1,this.isEmf=!1,this.isEmfPlus=!1,this.isBaselineFormat=!0,this.emfScalingFactor=new J(0,0),this.colorSpaceChanged=!1,this.dictionaryProperties=new l,this.isOverloadWithPosition=!1,this.isPointOverload=!1,this.currentColorSpaces=["RGB","CMYK","GrayScale","Indexed"],this.isImageOptimized=!1,this.graphicsState=[],this.istransparencySet=!1,this.internalAutomaticFields=null,this.startCutIndex=-1,this.getResources=e,this.canvasSize=t,i instanceof re?this.pdfStreamWriter=i:this.pdfStreamWriter=new re(i),this.initialize()}Wi.prototype.getResources=function(){return this.sender.getResources()};var zi=Wi;function Wi(t){this.sender=t}Object.defineProperty(Hi.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"matrix",{get:function(){return this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"characterSpacing",{get:function(){return this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"wordSpacing",{get:function(){return this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"textScaling",{get:function(){return this.internalTextScaling},set:function(t){this.internalTextScaling=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"textRenderingMode",{get:function(){return this.internalTextRenderingMode},set:function(t){this.internalTextRenderingMode=t},enumerable:!0,configurable:!0});var _i=Hi;function Hi(t,e){var i;this.internalTextRenderingMode=Y.TextRenderingMode.Fill,this.internalCharacterSpacing=0,this.internalWordSpacing=0,this.internalTextScaling=100,this.pdfColorSpace=Y.PdfColorSpace.Rgb,void 0!==t&&(this.pdfGraphics=t,i=[],t.matrix.matrix.elements.forEach(function(t){i.push(t)}),this.transformationMatrix=new se,this.transformationMatrix.matrix=new he(i))}var Ui=function(t,e,i){this.alphaPen=t,this.alphaBrush=e,this.blendMode=i},Ki=(Object.defineProperty(qi.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(qi.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(qi.prototype,"layerId",{get:function(){return this.layerid},set:function(t){this.layerid=t},enumerable:!0,configurable:!0}),Object.defineProperty(qi.prototype,"name",{get:function(){return this.layerName},set:function(t){this.layerName=t},enumerable:!0,configurable:!0}),Object.defineProperty(qi.prototype,"visible",{get:function(){return this.isVisible},set:function(t){this.isVisible=t},enumerable:!0,configurable:!0}),Object.defineProperty(qi.prototype,"graphics",{get:function(){return null==this.pdfGraphics&&this.initializeGraphics(this.page),this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(qi.prototype,"layers",{get:function(){return null==this.layer&&(this.layer=new Zi(this.page),this.layer.sublayer=!0),this.layer},enumerable:!0,configurable:!0}),qi.prototype.add=function(){var t=new qi(this.pdfPage);return t.name="",t},qi.prototype.sign=function(t){return 0===t?0:0<t?1:-1},qi.prototype.initializeGraphics=function(t){var e=t,i=new zi(this.page),i=(this.pdfGraphics=new Gi(t.size,i,this.content),this.pdfGraphics.mediaBoxUpperRightBound=0,null!=e&&null!=(i=e.section.parent)&&(this.pdfGraphics.colorSpace=i.document.colorSpace,this.colorSpace=i.document.colorSpace),this.sign(t.origin.y)===this.sign(t.origin.x)),i=((0<=t.origin.x&&0<=t.origin.y||!i)&&this.pdfGraphics.initializeCoordinates(),e.section.getActualBounds(e,!0)),e=e.section.pageSettings.margins;this.clipPageTemplates?0<=t.origin.x&&0<=t.origin.y&&this.pdfGraphics.clipTranslateMargins(i):this.graphics.clipTranslateMargins(i.x,i.y,e.left,e.top,e.right,e.bottom),this.pdfGraphics.setLayer(this)},Object.defineProperty(qi.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0}),qi);function qi(t,e){if(this.pdfColorSpace=Y.PdfColorSpace.Rgb,this.isVisible=!0,this.sublayer=!1,this.contentLength=0,this.dictionaryProperties=new l,null===t)throw new Error("ArgumentNullException:page");if(this.pdfPage=t,this.clipPageTemplates=!0,void 0===e)this.content=new U;else if(e instanceof U||null===e){if(null===e)throw new Error("ArgumentNullException:stream");this.content=e}else this.content=new U,this.clipPageTemplates=e}Object.defineProperty(Yi.prototype,"count",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection.length},enumerable:!0,configurable:!0}),Object.defineProperty(Yi.prototype,"list",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection},enumerable:!0,configurable:!0});w=Yi;function Yi(){}Xi=function(t,e){return(Xi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Xi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})($i,Ji=w),$i.prototype.items=function(t,e){if("number"==typeof t&&void 0===e)return this.list[t];if(null==e)throw new Error("ArgumentNullException: layer");if(e.page!==this.page)throw new Error("ArgumentException: The layer belongs to another page")},$i.prototype.add=function(t,e){var i;return void 0===t?((i=new Ki(this.page)).name="",this.add(i),i):t instanceof Ki?(i=this.list.push(t),this.addLayer(i,t),i):0},$i.prototype.addLayer=function(t,e){e=new d(e);this.page.contents.add(e)},$i.prototype.insert=function(t,e){for(var i=[],r=this.list.length,n=t;n<r;n++)i.push(this.list.pop());this.list.push(e);for(n=0;n<i.length;n++)this.list.push(i[n]);this.insertLayer(t,e)},$i.prototype.insertLayer=function(t,e){if(null==e)throw new Error("ArgumentNullException:layer");e=new d(e);this.page.contents.insert(t,e)},$i.prototype.parseLayers=function(t){var e=this.page.contents,t=(this.page.getResources(),t.crossTable,new U),i=new U,r=[];r.push("q"),t.data=r,e.insert(0,new d(t)),(r=[]).push("Q"),i.data=r,e.insert(e.count,new d(i))},$i.prototype.indexOf=function(t){if(null==t)throw new Error("ArgumentNullException: layer");return this.list.indexOf(t)};var Xi,Ji,Zi=$i;function $i(t){var e=Ji.call(this)||this;return e.parentLayerCount=0,e.sublayer=!1,e.optionalContent=new c,t instanceof Qi&&(e.page=t,e.parseLayers(t)),e}Object.defineProperty(tr.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"dictionary",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"element",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"defaultLayer",{get:function(){var t=this.layers,e=this.defaultLayerIndex;return t.items(e)},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"defaultLayerIndex",{get:function(){var t;return 0!==this.layerCollection.count&&-1!==this.defLayerIndex||(t=this.layerCollection.add(),this.defLayerIndex=this.layerCollection.indexOf(t)),this.defLayerIndex},set:function(t){if(t<0||t>this.layers.count-1)throw new Error("ArgumentOutOfRangeException : value, Index can not be less 0 and greater Layers.Count - 1");this.defLayerIndex=t,this.modified=!0},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"layers",{get:function(){return null!=this.layerCollection&&void 0!==this.layerCollection||(this.layerCollection=new Zi(this)),this.layerCollection},enumerable:!0,configurable:!0}),tr.prototype.getResources=function(){return null==this.resources&&(this.resources=new Ri,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},Object.defineProperty(tr.prototype,"contents",{get:function(){var t=this.pageDictionary.items.getValue(this.dictionaryProperties.contents);return null==t&&(t=new p,this.pageDictionary.items.setValue(this.dictionaryProperties.contents,t)),t},enumerable:!0,configurable:!0}),tr.prototype.setResources=function(t){this.resources=t,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources),this.modified=!0};var Qi=tr;function tr(t){this.defLayerIndex=-1,this.modified=!1,this.dictionaryProperties=new l,this.pageDictionary=t}Object.defineProperty(ir.prototype,"annotations",{get:function(){return this.internalAnnotations},set:function(t){this.internalAnnotations=t},enumerable:!0,configurable:!0}),ir.prototype.add=function(t){this.doAdd(t)},ir.prototype.doAdd=function(t){if(void 0===t.destination)return t.setPage(this.page),this.internalAnnotations.add(new d(t)),this.lists.push(t);var e=(new vt).layout(t.text,t.font,t.stringFormat,new J(t.bounds.width,0),!1,new J(0,0)),i=t.bounds.y;if(1===e.lines.length){var r=t.font.measureString(e.lines[0].text);t.bounds=new Z(new X(t.bounds.x,i),r),t.text=e.lines[0].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,t.bounds.y,t.bounds.width,t.bounds.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new d(t)),this.lists.push(t)}else for(var n=0;n<e.lines.length;n++){var o,r=t.font.measureString(e.lines[n].text);0===n?(t.bounds=new Z(t.bounds.x,i,r.width,r.height),t.text=e.lines[n].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,i,r.width,r.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new d(t)),this.lists.push(t),i+=t.bounds.height):((o=t.clone()).bounds=new Z(new X(t.bounds.x,i),r),o.text=e.lines[n].text,this.page.graphics.drawString(o.text,o.font,null,o.brush,o.bounds.x,o.bounds.y,o.bounds.width,o.bounds.height,null),o.setPage(this.page),this.setColor(o),this.internalAnnotations.add(new d(o)),this.lists.push(o),i+=o.bounds.height)}},ir.prototype.setColor=function(t){var e=Y.PdfColorSpace.Rgb,e=t.color.toArray(e);t.dictionary.items.setValue(this.dictionaryProperties.c,e)},Object.defineProperty(ir.prototype,"element",{get:function(){return this.internalAnnotations},enumerable:!0,configurable:!0});var er=ir;function ir(t){this.alreadyExistsAnnotationError="This annotatation had been already added to page",this.missingAnnotationException="Annotation is not contained in collection.",this.dictionaryProperties=new l,this.internalAnnotations=new p,this.lists=[],void 0!==t&&(this.page=t)}rr=function(t,e){return(rr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}rr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(sr,nr=Qi),Object.defineProperty(sr.prototype,"document",{get:function(){return null!==this.section&&null!==this.section.parent?this.section.parent.document:null},enumerable:!0,configurable:!0}),Object.defineProperty(sr.prototype,"graphics",{get:function(){var t=this.defaultLayer.graphics;return t.currentPage=this,t},enumerable:!0,configurable:!0}),Object.defineProperty(sr.prototype,"crossTable",{get:function(){if(null===this.section)throw new Error("PdfDocumentException : Page is not created");return(null===this.section.parent?this.section.parentDocument:this.section.parent.document).crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(sr.prototype,"size",{get:function(){return this.section.pageSettings.size},enumerable:!0,configurable:!0}),Object.defineProperty(sr.prototype,"origin",{get:function(){return this.section.pageSettings.origin},enumerable:!0,configurable:!0}),Object.defineProperty(sr.prototype,"annotations",{get:function(){return null==this.annotationCollection&&(this.annotationCollection=new er(this),this.dictionary.items.setValue(this.dictionaryProperties.annots,this.annotationCollection.element),this.annotationCollection.annotations=this.dictionary.items.getValue(this.dictionaryProperties.annots)),this.annotationCollection},enumerable:!0,configurable:!0}),sr.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o("Page")),this.dictionary.pageBeginDrawTemplate=new z(this)},sr.prototype.setSection=function(t){this.section=t,this.dictionary.items.setValue(this.dictionaryProperties.parent,new d(t))},sr.prototype.resetProgress=function(){this.isProgressOn=!1},sr.prototype.getClientSize=function(){var t=this.section.getActualBounds(this,!0);return new J(t.width,t.height)},sr.prototype.pageBeginSave=function(){var t=this.document;null!=t&&this.drawPageTemplates(t),null!=this.beginSave&&void 0!==this.beginSave&&this.beginSave(this)},sr.prototype.drawPageTemplates=function(t){var e;if(this.section.containsTemplates(t,this,!1)){var i=new Ki(this,!1);if(this.layers.insert(0,i),this.section.drawTemplates(this,i,t,!1),null!==i.graphics&&void 0!==i.graphics)for(var r=0;r<i.graphics.automaticFields.automaticFields.length;r++){var n=i.graphics.automaticFields.automaticFields[r];n.field.performDraw(i.graphics,n.location,n.scalingX,n.scalingY)}}this.section.containsTemplates(t,this,!0)&&(e=new Ki(this,!1),this.layers.add(e),this.section.drawTemplates(this,e,t,!0))};var rr,nr,or=sr;function sr(){var t=nr.call(this,new c)||this;return t.annotationCollection=null,t.beginSave=null,t.initialize(),t}Object.defineProperty(hr.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0});var ar=hr;function hr(t){this.pdfPage=void 0!==t?t:null}Object.defineProperty(ur.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),ur.prototype.contains=function(t){return this.section.contains(t)},ur.prototype.remove=function(t){this.section.remove(t)},ur.prototype.add=function(){return this.section.add()};var lr=ur;function ur(t){if((this.pdfSection=null)==t)throw Error('ArgumentNullException("section")');this.section=t}Object.defineProperty(pr.prototype,"left",{get:function(){return this.leftTemplate},set:function(t){this.leftTemplate=this.checkElement(t,Y.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"top",{get:function(){return this.topTemplate},set:function(t){this.topTemplate=this.checkElement(t,Y.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"right",{get:function(){return this.rightTemplate},set:function(t){this.rightTemplate=this.checkElement(t,Y.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"bottom",{get:function(){return this.bottomTemplate},set:function(t){this.bottomTemplate=this.checkElement(t,Y.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"EvenLeft",{get:function(){return this.evenLeft},set:function(t){this.evenLeft=this.checkElement(t,Y.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"EvenTop",{get:function(){return this.evenTop},set:function(t){this.evenTop=this.checkElement(t,Y.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"EvenRight",{get:function(){return this.evenRight},set:function(t){this.evenRight=this.checkElement(t,Y.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"EvenBottom",{get:function(){return this.evenBottom},set:function(t){this.evenBottom=this.checkElement(t,Y.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"OddLeft",{get:function(){return this.oddLeft},set:function(t){this.oddLeft=this.checkElement(t,Y.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"OddTop",{get:function(){return this.oddTop},set:function(t){this.oddTop=this.checkElement(t,Y.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"OddRight",{get:function(){return this.oddRight},set:function(t){this.oddRight=this.checkElement(t,Y.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"OddBottom",{get:function(){return this.oddBottom},set:function(t){this.oddBottom=this.checkElement(t,Y.TemplateType.Bottom)},enumerable:!0,configurable:!0}),pr.prototype.getLeft=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenLeft?this.EvenLeft:this.left:null!=this.OddLeft?this.OddLeft:this.left},pr.prototype.getTop=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenTop?this.EvenTop:this.top:null!=this.OddTop?this.OddTop:this.top},pr.prototype.getRight=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenRight?this.EvenRight:this.right:null!=this.OddRight?this.OddRight:this.right},pr.prototype.getBottom=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenBottom?this.EvenBottom:this.bottom:null!=this.OddBottom?this.OddBottom:this.bottom},pr.prototype.isEven=function(t){var e=t.section.document.pages;return(e.pageCollectionIndex.containsKey(t)?e.pageCollectionIndex.getValue(t)+1:e.indexOf(t)+1)%2==0},pr.prototype.checkElement=function(t,e){if(null!=t){if(void 0!==t.type&&t.type!==Y.TemplateType.None)throw new Error("NotSupportedException:Can not reassign the template element. Please, create new one.");t.type=e}return t};var cr=pr;function pr(){}dr=function(t,e){return(dr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}dr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(mr,fr=cr),Object.defineProperty(mr.prototype,"applyDocumentLeftTemplate",{get:function(){return this.leftValue},set:function(t){this.leftValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(mr.prototype,"applyDocumentTopTemplate",{get:function(){return this.topValue},set:function(t){this.topValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(mr.prototype,"applyDocumentRightTemplate",{get:function(){return this.rightValue},set:function(t){this.rightValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(mr.prototype,"applyDocumentBottomTemplate",{get:function(){return this.bottomValue},set:function(t){this.bottomValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(mr.prototype,"applyDocumentStamps",{get:function(){return this.stampValue},set:function(t){this.stampValue=t},enumerable:!0,configurable:!0});var dr,fr,gr=mr;function mr(){var t=fr.call(this)||this;return t.leftValue=t.topValue=t.rightValue=t.bottomValue=t.stampValue=!0,t}Object.defineProperty(v.prototype,"parent",{get:function(){return this.sectionCollection},set:function(t){this.sectionCollection=t,this.section.items.setValue(this.dictionaryProperties.parent,new d(t))},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"parentDocument",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"pageSettings",{get:function(){return this.settings},set:function(t){if(null==t)throw Error("Value can not be null.");this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"element",{get:function(){return this.section},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"count",{get:function(){return this.pagesReferences.count},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new gr),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"document",{get:function(){return this.sectionCollection.document},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"pages",{get:function(){return null!=this.pagesCollection&&void 0!==this.pagesCollection||(this.pagesCollection=new lr(this)),this.pagesCollection},enumerable:!0,configurable:!0}),v.prototype.getPages=function(){return this.pdfPages},v.prototype.pointToNativePdf=function(t,e){t=this.getActualBounds(t,!0);return e.x+=t.x,e.y=this.pageSettings.height-e.y,e},v.prototype.setPageSettings=function(t){this.settings=t,this.state.orientation=t.orientation,this.state.rotate=t.rotate,this.state.size=t.size,this.state.origin=t.origin},v.prototype.initialize=function(){this.pagesReferences=new p,this.section=new c,this.state=new br(this.pdfDocument),this.section.sectionBeginSave=new G(this,this.state),this.pageCount=new u(0),this.section.items.setValue(this.dictionaryProperties.count,this.pageCount),this.section.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.pages)),this.section.items.setValue(this.dictionaryProperties.kids,this.pagesReferences)},v.prototype.containsTemplates=function(t,e,i){t=this.getDocumentTemplates(t,e,i),e=this.getSectionTemplates(e,i);return 0<t.length||0<e.length},v.prototype.getDocumentTemplates=function(t,e,i){var r=[];return this.template.applyDocumentTopTemplate&&null!=t.template.getTop(e)&&(!t.template.getTop(e).foreground&&!i||t.template.getTop(e).foreground&&i)&&r.push(t.template.getTop(e)),this.template.applyDocumentBottomTemplate&&null!=t.template.getBottom(e)&&(!t.template.getBottom(e).foreground&&!i||t.template.getBottom(e).foreground&&i)&&r.push(t.template.getBottom(e)),this.template.applyDocumentLeftTemplate&&null!=t.template.getLeft(e)&&(!t.template.getLeft(e).foreground&&!i||t.template.getLeft(e).foreground&&i)&&r.push(t.template.getLeft(e)),this.template.applyDocumentRightTemplate&&null!=t.template.getRight(e)&&(!t.template.getRight(e).foreground&&!i||t.template.getRight(e).foreground&&i)&&r.push(t.template.getRight(e)),r},v.prototype.getSectionTemplates=function(t,e){var i,r=[];return null!=this.template.getTop(t)&&(!(i=this.template.getTop(t)).foreground&&!e||i.foreground&&e)&&r.push(i),null!=this.template.getBottom(t)&&(!(i=this.template.getBottom(t)).foreground&&!e||i.foreground&&e)&&r.push(i),null!=this.template.getLeft(t)&&(!(i=this.template.getLeft(t)).foreground&&!e||i.foreground&&e)&&r.push(i),null!=this.template.getRight(t)&&(!(i=this.template.getRight(t)).foreground&&!e||i.foreground&&e)&&r.push(i),r},v.prototype.add=function(t){var e;if(void 0===t)return e=new or,this.add(e),e;e=this.checkPresence(t),this.pdfPages.push(t),this.pagesReferences.add(e),t.setSection(this),t.resetProgress(),this.pageAddedMethod(t)},v.prototype.checkPresence=function(t){for(var e=new d(t),i=!1,r=this.parent,n=0;n<r.section.length;n++)var o=r.section[n],i=i||o.contains(t);return e},v.prototype.contains=function(t){return 0<=this.indexOf(t)},v.prototype.indexOf=function(t){for(var e=0;e<this.pdfPages.length;e++)if(this.pdfPages[e]===t)return this.pdfPages.indexOf(t);var i=new d(t);return this.pagesReferences.indexOf(i)},v.prototype.pageAddedMethod=function(t){t=new ar(t);this.onPageAdded(t),this.parent.document.pages.onPageAdded(t),this.pageCount.intValue=this.count},v.prototype.onPageAdded=function(t){},v.prototype.getActualBounds=function(t,e,i){var r,n,o,s;return t instanceof or&&"boolean"==typeof e?(r=this.parent.document,this.getActualBounds(r,t,e)):((r=new Z(0,0,0,0)).height=(i?this.pageSettings.size:this.pageSettings.getActualSize()).height,r.width=(i?this.pageSettings.size:this.pageSettings.getActualSize()).width,n=this.getLeftIndentWidth(t,e,i),o=this.getTopIndentHeight(t,e,i),s=this.getRightIndentWidth(t,e,i),t=this.getBottomIndentHeight(t,e,i),r.x+=n,r.y+=o,r.width-=n+s,r.height-=o+t,r)},v.prototype.getLeftIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.left:0,r=null!=this.template.getLeft(e)?this.template.getLeft(e).width:0,t=null!=t.template.getLeft(e)?t.template.getLeft(e).width:0;return i+=this.template.applyDocumentLeftTemplate?Math.max(r,t):r},v.prototype.getTopIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.top:0,r=null!=this.template.getTop(e)?this.template.getTop(e).height:0,t=null!=t.template.getTop(e)?t.template.getTop(e).height:0;return i+=this.template.applyDocumentTopTemplate?Math.max(r,t):r},v.prototype.getRightIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.right:0,r=null!=this.template.getRight(e)?this.template.getRight(e).width:0,t=null!=t.template.getRight(e)?t.template.getRight(e).width:0;return i+=this.template.applyDocumentRightTemplate?Math.max(r,t):r},v.prototype.getBottomIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.bottom:0,r=null!=this.template.getBottom(e)?this.template.getBottom(e).height:0,t=null!=t.template.getBottom(e)?t.template.getBottom(e).height:0;return i+=this.template.applyDocumentBottomTemplate?Math.max(r,t):r},v.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');for(var e=this.pdfPages.indexOf(t),i=(this.pagesReferences.removeAt(e),[]),r=0;r<e;r++)i.push(this.pdfPages[r]);for(r=e+1;r<this.pdfPages.length;r++)i.push(this.pdfPages[r]);this.pdfPages=i},v.prototype.applyPageSettings=function(t,e,i){var r=new Z(i.origin,i.size),r=(t.items.setValue(this.dictionaryProperties.mediaBox,p.fromRectangle(r)),Pr.rotateFactor*i.rotate),i=new u(r);t.items.setValue(this.dictionaryProperties.rotate,i)},v.prototype.beginSave=function(t,e){e=e.document;this.applyPageSettings(this.section,e.pageSettings,t)},v.prototype.drawTemplates=function(t,e,i,r){var n=this.getDocumentTemplates(i,t,r),t=this.getSectionTemplates(t,r);this.drawTemplatesHelper(e,i,n),this.drawTemplatesHelper(e,i,t)},v.prototype.drawTemplatesHelper=function(t,e,i){if(null!=i&&0<i.length)for(var r=i.length,n=0;n<r;n++)i[n].draw(t,e)};var yr=v;function v(t,e){this.pageAdded=new ar,this.pdfPages=[],this.dictionaryProperties=new l,this.pdfDocument=t,this.settings=(void 0===e?t.pageSettings:e).clone(),this.initialSettings=this.settings.clone(),this.initialize()}Object.defineProperty(wr.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation=t},enumerable:!0,configurable:!0}),Object.defineProperty(wr.prototype,"rotate",{get:function(){return this.pageRotate},set:function(t){this.pageRotate=t},enumerable:!0,configurable:!0}),Object.defineProperty(wr.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.pageSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(wr.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0});var br=wr;function wr(t){this.pageOrientation=t.pageSettings.orientation,this.pageRotate=t.pageSettings.rotate,this.pageSize=t.pageSettings.size,this.pageOrigin=t.pageSettings.origin}Object.defineProperty(Sr.prototype,"section",{get:function(){return this.sections},enumerable:!0,configurable:!0}),Object.defineProperty(Sr.prototype,"document",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(Sr.prototype,"count",{get:function(){return this.sections.length},enumerable:!0,configurable:!0}),Object.defineProperty(Sr.prototype,"element",{get:function(){return this.pages},enumerable:!0,configurable:!0}),Sr.prototype.initialize=function(){this.sectionCount=new u(0),this.sectionCollection=new p,this.pages=new c,this.pages.beginSave=new N(this),this.pages.items.setValue(this.dictionaryProperties.type,new o("Pages")),this.pages.items.setValue(this.dictionaryProperties.kids,this.sectionCollection),this.pages.items.setValue(this.dictionaryProperties.count,this.sectionCount),this.pages.items.setValue(this.dictionaryProperties.resources,new c),this.setPageSettings(this.pages,this.pdfDocument.pageSettings)},Sr.prototype.pdfSectionCollection=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException()");return this.sections[t]},Sr.prototype.setPageSettings=function(t,e){e=new Z(new X,e.size);t.items.setValue(this.dictionaryProperties.mediaBox,p.fromRectangle(e))},Sr.prototype.add=function(t){var e;return void 0===t?(e=new yr(this.pdfDocument),this.add(e),e):(e=this.checkSection(t),this.sections.push(t),(t.parent=this).sectionCollection.add(e),this.sections.indexOf(t))},Sr.prototype.checkSection=function(t){t=new d(t);this.sectionCollection.contains(t);return t},Sr.prototype.countPages=function(){var e=0;return this.sections.forEach(function(t){return e+=t.count}),e},Sr.prototype.beginSave=function(){this.sectionCount.intValue=this.countPages()},Sr.rotateFactor=90;var Pr=Sr;function Sr(t){this.sections=[],this.dictionaryProperties=new l,this.pdfDocument=t.clone(),this.initialize()}Object.defineProperty(Cr.prototype,"count",{get:function(){return this.countPages()},enumerable:!0,configurable:!0}),Object.defineProperty(Cr.prototype,"pageCollectionIndex",{get:function(){return this.pdfPageCollectionIndex},enumerable:!0,configurable:!0}),Cr.prototype.add=function(t){var e;if(void 0===t)return e=new or,this.add(e),e;this.getLastSection().add(t)},Cr.prototype.getLastSection=function(){var t=this.document.sections;return 0===t.section.length&&t.add(),t.section[t.section.length-1]},Cr.prototype.onPageAdded=function(t){},Cr.prototype.countPages=function(){for(var t=this.document.sections,e=0,i=0;i<t.section.length;i++)e+=t.section[i].count;return e},Cr.prototype.getPageByIndex=function(t){return this.getPage(t)},Cr.prototype.getPage=function(t){if(t<0||t>=this.count)throw Error('ArgumentOutOfRangeException("index", "Value can not be less 0")');for(var e=null,i=0,r=this.document.sections.count,n=0;n<r;n++){var o=this.document.sections.section[n],s=o.count,a=t-i;if(i<=t&&a<s){e=o.getPages()[a];break}i+=s}return e},Cr.prototype.indexOf=function(t){var e=-1;if(null==t)throw new Error("ArgumentNullException: page");for(var i=0,r=0,n=this.document.sections.count;r<n;r++){var o=this.document.sections.pdfSectionCollection(r);if(0<=(e=o.indexOf(t))){e+=i;break}e=-1,i+=o.count}return e},Cr.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');for(var e=null,i=0,r=this.document.sections.count;i<r;i++)if((e=this.document.sections.pdfSectionCollection(i)).pages.contains(t)){e.pages.remove(t);break}return e};var vr=Cr;function Cr(t){this.pdfPageCollectionIndex=new a,this.document=t}Or.prototype.search=function(t){var e=null,i=this.getGroup(t);return null==i?i=this.createNewGroup():0<i.length&&(e=i[0]),i.push(t),e},Or.prototype.createNewGroup=function(){var t=[];return this.referenceObjects.push(t),t},Or.prototype.getGroup=function(t){var e=null;if(null!==t)for(var i=this.referenceObjects.length,r=0;r<i;r++){if(0<this.referenceObjects.length){var n=this.referenceObjects[r];if(0<n.length){var o=n[0];if(t.equalsTo(o)){e=n;break}}else this.removeGroup(n)}i=this.referenceObjects.length}return e},Or.prototype.removeGroup=function(t){null!==t&&(t=this.referenceObjects.indexOf(t),this.referenceObjects.slice(t,t+1))},Or.prototype.destroy=function(){this.pdfFontCollection=void 0,this.referenceObjects=void 0};var Br=Or;function Or(){this.referenceObjects=[],this.pdfFontCollection=new a}xr=function(t,e){return(xr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}xr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(jr,Lr=i),Object.defineProperty(jr,"defaultFont",{get:function(){return null==this.defaultStandardFont&&(this.defaultStandardFont=new Mr(Y.PdfFontFamily.Helvetica,8)),this.defaultStandardFont},enumerable:!0,configurable:!0}),Object.defineProperty(jr.prototype,"sections",{get:function(){return this.sectionCollection},enumerable:!0,configurable:!0}),Object.defineProperty(jr.prototype,"pageSettings",{get:function(){return null==this.settings&&(this.settings=new ee(this.defaultMargin)),this.settings},set:function(t){this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(jr.prototype,"pages",{get:function(){return this.documentPageCollection},enumerable:!0,configurable:!0}),Object.defineProperty(jr,"cache",{get:function(){return void 0===jr.cacheCollection||null==jr.cacheCollection?new Br:jr.cacheCollection},set:function(t){this.cacheCollection=t},enumerable:!0,configurable:!0}),Object.defineProperty(jr,"enableCache",{get:function(){return this.isCacheEnabled},set:function(t){this.isCacheEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(jr.prototype,"colorSpace",{get:function(){return this.pdfColorSpace===Y.PdfColorSpace.Rgb||this.pdfColorSpace===Y.PdfColorSpace.Cmyk||this.pdfColorSpace===Y.PdfColorSpace.GrayScale?this.pdfColorSpace:Y.PdfColorSpace.Rgb},set:function(t){t===Y.PdfColorSpace.Rgb||t===Y.PdfColorSpace.Cmyk||t===Y.PdfColorSpace.GrayScale?this.pdfColorSpace=t:this.pdfColorSpace=Y.PdfColorSpace.Rgb},enumerable:!0,configurable:!0}),Object.defineProperty(jr.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new cr),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),jr.prototype.docSave=function(t,e,i){if(this.checkPagesPresence(),null===t)throw new Error("ArgumentNullException : stream");this.streamWriter=t;t=new kt(t);if(t.document=this,"boolean"==typeof e&&void 0===i)return this.crossTable.save(t);this.crossTable.save(t,e)},jr.prototype._docSave=function(){var t=new Rt;if(this.checkPagesPresence(),null===t)throw new Error("ArgumentNullException : stream");this.streamWriter=t;t=new kt(t);return(t.document=this).crossTable._save(t)},jr.prototype.checkPagesPresence=function(){0===this.pages.count&&this.pages.add()},jr.prototype.destroy=function(){this.catalog=void 0,this.colorSpace=void 0,this.currentSavingObj=void 0,this.documentPageCollection=void 0,this.isStreamCopied=void 0,this.pageSettings=void 0,this.pageTemplate=void 0,this.pdfColorSpace=void 0,this.sectionCollection=void 0,jr.cache.destroy(),this.crossTable.pdfObjects.destroy(),jr.cache=void 0,this.streamWriter&&this.streamWriter.destroy()},jr.defaultStandardFont=null,jr.isCacheEnabled=!0;var xr,Lr,Tr=jr;function jr(t){var e=Lr.call(this)||this,i=(e.defaultMargin=40,e.streamWriter=null,e.document=e,!1),i=void 0===t?(jr.cacheCollection=new Br,!1):t,t=new Nt,r=(e.setMainObjectCollection(t),new Xt),i=(r.isMerging=i,(r.document=e).setCrossTable(r),new qt);return e.setCatalog(i),t.add(i),i.position=-1,e.sectionCollection=new Pr(e),e.documentPageCollection=new vr(e),i.pages=e.sectionCollection,e}C.getMetrics=function(t,e,i){var r=null;switch(t){case Y.PdfFontFamily.Helvetica:r=this.getHelveticaMetrics(t,e,i);break;case Y.PdfFontFamily.Courier:r=this.getCourierMetrics(t,e,i);break;case Y.PdfFontFamily.TimesRoman:r=this.getTimesMetrics(t,e,i);break;case Y.PdfFontFamily.Symbol:r=this.getSymbolMetrics(t,e,i);break;case Y.PdfFontFamily.ZapfDingbats:r=this.getZapfDingbatsMetrics(t,e,i);break;default:r=this.getHelveticaMetrics(Y.PdfFontFamily.Helvetica,e,i)}return r.name=t.toString(),r.subScriptSizeFactor=this.subSuperScriptFactor,r.superscriptSizeFactor=this.subSuperScriptFactor,r},C.getHelveticaMetrics=function(t,e,i){var r=new si;return 0<(e&Y.PdfFontStyle.Bold)&&0<(e&Y.PdfFontStyle.Italic)?(r.ascent=this.helveticaBoldItalicAscent,r.descent=this.helveticaBoldItalicDescent,r.postScriptName=this.helveticaBoldItalicName,r.size=i,r.widthTable=new ci(this.arialBoldWidth)):0<(e&Y.PdfFontStyle.Bold)?(r.ascent=this.helveticaBoldAscent,r.descent=this.helveticaBoldDescent,r.postScriptName=this.helveticaBoldName,r.size=i,r.widthTable=new ci(this.arialBoldWidth)):(0<(e&Y.PdfFontStyle.Italic)?(r.ascent=this.helveticaItalicAscent,r.descent=this.helveticaItalicDescent,r.postScriptName=this.helveticaItalicName):(r.ascent=this.helveticaAscent,r.descent=this.helveticaDescent,r.postScriptName=this.helveticaName),r.size=i,r.widthTable=new ci(this.arialWidth)),r.height=r.ascent-r.descent,r},C.getCourierMetrics=function(t,e,i){var r=new si;return 0<(e&Y.PdfFontStyle.Bold)&&0<(e&Y.PdfFontStyle.Italic)?(r.ascent=this.courierBoldItalicAscent,r.descent=this.courierBoldItalicDescent,r.postScriptName=this.courierBoldItalicName):0<(e&Y.PdfFontStyle.Bold)?(r.ascent=this.courierBoldAscent,r.descent=this.courierBoldDescent,r.postScriptName=this.courierBoldName):0<(e&Y.PdfFontStyle.Italic)?(r.ascent=this.courierItalicAscent,r.descent=this.courierItalicDescent,r.postScriptName=this.courierItalicName):(r.ascent=this.courierAscent,r.descent=this.courierDescent,r.postScriptName=this.courierName),r.size=i,r.widthTable=new ci(this.fixedWidth),r.height=r.ascent-r.descent,r},C.getTimesMetrics=function(t,e,i){var r=new si;return 0<(e&Y.PdfFontStyle.Bold)&&0<(e&Y.PdfFontStyle.Italic)?(r.ascent=this.timesBoldItalicAscent,r.descent=this.timesBoldItalicDescent,r.postScriptName=this.timesBoldItalicName,r.size=i,r.widthTable=new ci(this.timesRomanBoldItalicWidths)):0<(e&Y.PdfFontStyle.Bold)?(r.ascent=this.timesBoldAscent,r.descent=this.timesBoldDescent,r.postScriptName=this.timesBoldName,r.size=i,r.widthTable=new ci(this.timesRomanBoldWidth)):0<(e&Y.PdfFontStyle.Italic)?(r.ascent=this.timesItalicAscent,r.descent=this.timesItalicDescent,r.postScriptName=this.timesItalicName,r.size=i,r.widthTable=new ci(this.timesRomanItalicWidth)):(r.ascent=this.timesAscent,r.descent=this.timesDescent,r.postScriptName=this.timesName,r.size=i,r.widthTable=new ci(this.timesRomanWidth)),r.height=r.ascent-r.descent,r},C.getSymbolMetrics=function(t,e,i){var r=new si;return r.ascent=this.symbolAscent,r.descent=this.symbolDescent,r.postScriptName=this.symbolName,r.size=i,r.widthTable=new ci(this.symbolWidth),r.height=r.ascent-r.descent,r},C.getZapfDingbatsMetrics=function(t,e,i){var r=new si;return r.ascent=this.zapfDingbatsAscent,r.descent=this.zapfDingbatsDescent,r.postScriptName=this.zapfDingbatsName,r.size=i,r.widthTable=new ci(this.zapfDingbatsWidth),r.height=r.ascent-r.descent,r},C.subSuperScriptFactor=1.52,C.helveticaAscent=931,C.helveticaDescent=-225,C.helveticaName="Helvetica",C.helveticaBoldAscent=962,C.helveticaBoldDescent=-228,C.helveticaBoldName="Helvetica-Bold",C.helveticaItalicAscent=931,C.helveticaItalicDescent=-225,C.helveticaItalicName="Helvetica-Oblique",C.helveticaBoldItalicAscent=962,C.helveticaBoldItalicDescent=-228,C.helveticaBoldItalicName="Helvetica-BoldOblique",C.courierAscent=805,C.courierDescent=-250,C.courierName="Courier",C.courierBoldAscent=801,C.courierBoldDescent=-250,C.courierBoldName="Courier-Bold",C.courierItalicAscent=805,C.courierItalicDescent=-250,C.courierItalicName="Courier-Oblique",C.courierBoldItalicAscent=801,C.courierBoldItalicDescent=-250,C.courierBoldItalicName="Courier-BoldOblique",C.timesAscent=898,C.timesDescent=-218,C.timesName="Times-Roman",C.timesBoldAscent=935,C.timesBoldDescent=-218,C.timesBoldName="Times-Bold",C.timesItalicAscent=883,C.timesItalicDescent=-217,C.timesItalicName="Times-Italic",C.timesBoldItalicAscent=921,C.timesBoldItalicDescent=-218,C.timesBoldItalicName="Times-BoldItalic",C.symbolAscent=1010,C.symbolDescent=-293,C.symbolName="Symbol",C.zapfDingbatsAscent=820,C.zapfDingbatsDescent=-143,C.zapfDingbatsName="ZapfDingbats",C.arialWidth=[278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,0,556,0,222,556,333,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,222,222,333,333,350,556,1e3,333,1e3,500,333,944,0,500,667,0,333,556,556,556,556,260,556,333,737,370,556,584,0,737,333,400,584,333,333,333,556,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,584,611,556,556,556,556,500,556,500],C.arialBoldWidth=[278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,0,556,0,278,556,500,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,278,278,500,500,350,556,1e3,333,1e3,556,333,944,0,500,667,0,333,556,556,556,556,280,556,333,737,370,556,584,0,737,333,400,584,333,333,333,611,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,584,611,611,611,611,611,556,611,556],C.fixedWidth=[600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600],C.timesRomanWidth=[250,333,408,500,500,833,778,180,333,333,500,564,250,333,250,278,500,500,500,500,500,500,500,500,500,500,278,278,564,564,564,444,921,722,667,667,722,611,556,722,722,333,389,722,611,889,722,722,556,722,667,556,611,722,722,944,722,722,611,333,278,333,469,500,333,444,500,444,500,444,333,500,500,278,278,500,278,778,500,500,500,500,333,389,278,500,500,722,500,500,444,480,200,480,541,0,500,0,333,500,444,1e3,500,500,333,1e3,556,333,889,0,611,0,0,333,333,444,444,350,500,1e3,333,980,389,333,722,0,444,722,0,333,500,500,500,500,200,500,333,760,276,500,564,0,760,333,400,564,300,300,333,500,453,250,333,300,310,500,750,750,750,444,722,722,722,722,722,722,889,667,611,611,611,611,333,333,333,333,722,722,722,722,722,722,722,564,722,722,722,722,722,722,556,500,444,444,444,444,444,444,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,564,500,500,500,500,500,500,500,500],C.timesRomanBoldWidth=[250,333,555,500,500,1e3,833,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,930,722,667,722,722,667,611,778,778,389,500,778,667,944,722,778,611,778,722,556,667,722,722,1e3,722,722,667,333,278,333,581,500,333,500,556,444,556,444,333,500,556,278,333,556,278,833,556,500,556,556,444,389,333,556,500,722,500,500,444,394,220,394,520,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,1e3,0,667,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,444,722,0,333,500,500,500,500,220,500,333,747,300,500,570,0,747,333,400,570,300,300,333,556,540,250,333,300,330,500,750,750,750,500,722,722,722,722,722,722,1e3,722,667,667,667,667,389,389,389,389,722,722,778,778,778,778,778,570,778,722,722,722,722,722,611,556,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,500,556,500],C.timesRomanItalicWidth=[250,333,420,500,500,833,778,214,333,333,500,675,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,675,675,675,500,920,611,611,667,722,611,611,722,722,333,444,667,556,833,667,722,611,722,611,500,556,722,611,833,611,556,556,389,278,389,422,500,333,500,500,444,500,444,278,500,500,278,278,444,278,722,500,500,500,500,389,389,278,500,444,667,444,444,389,400,275,400,541,0,500,0,333,500,556,889,500,500,333,1e3,500,333,944,0,556,0,0,333,333,556,556,350,500,889,333,980,389,333,667,0,389,556,0,389,500,500,500,500,275,500,333,760,276,500,675,0,760,333,400,675,300,300,333,500,523,250,333,300,310,500,750,750,750,500,611,611,611,611,611,611,889,667,611,611,611,611,333,333,333,333,722,667,722,722,722,722,722,675,722,722,722,722,722,556,611,500,500,500,500,500,500,500,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,675,500,500,500,500,500,444,500,444],C.timesRomanBoldItalicWidths=[250,389,555,500,500,833,778,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,832,667,667,667,722,667,667,722,778,389,500,667,611,889,722,722,611,722,667,556,611,722,667,889,667,611,611,333,278,333,570,500,333,500,500,444,500,444,333,500,556,278,278,500,278,778,556,500,500,500,389,389,278,556,444,667,500,444,389,348,220,348,570,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,944,0,611,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,389,611,0,389,500,500,500,500,220,500,333,747,266,500,606,0,747,333,400,570,300,300,333,576,500,250,333,300,300,500,750,750,750,500,667,667,667,667,667,667,944,667,667,667,667,667,389,389,389,389,722,722,722,722,722,722,722,570,722,722,722,722,722,611,611,500,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,444,500,444],C.symbolWidth=[250,333,713,500,549,833,778,439,333,333,500,549,250,549,250,278,500,500,500,500,500,500,500,500,500,500,278,278,549,549,549,444,549,722,667,722,612,611,763,603,722,333,631,722,686,889,722,722,768,741,556,592,611,690,439,768,645,795,611,333,863,333,658,500,500,631,549,549,494,439,521,411,603,329,603,549,549,576,521,549,549,521,549,603,439,576,713,686,493,686,494,480,200,480,549,750,620,247,549,167,713,500,753,753,753,753,1042,987,603,987,603,400,549,411,549,549,713,494,460,549,549,549,549,1e3,603,1e3,658,823,686,795,987,768,768,823,768,768,713,713,713,713,713,713,713,768,713,790,790,890,823,549,250,713,603,603,1042,987,603,987,603,494,329,790,790,786,713,384,384,384,384,384,384,494,494,494,494,329,274,686,686,686,384,384,384,384,384,384,494,494,494,-1],C.zapfDingbatsWidth=[278,974,961,974,980,719,789,790,791,690,960,939,549,855,911,933,911,945,974,755,846,762,761,571,677,763,760,759,754,494,552,537,577,692,786,788,788,790,793,794,816,823,789,841,823,833,816,831,923,744,723,749,790,792,695,776,768,792,759,707,708,682,701,826,815,789,789,707,687,696,689,786,787,713,791,785,791,873,761,762,762,759,759,892,892,788,784,438,138,277,415,392,392,668,668,390,390,317,317,276,276,509,509,410,410,234,234,334,334,732,544,544,910,667,760,760,776,595,694,626,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,894,838,1016,458,748,924,748,918,927,928,928,834,873,828,924,924,917,930,931,463,883,836,836,867,867,696,696,874,874,760,946,771,865,771,888,967,888,831,873,927,970,918];var kr=C;function C(){}Vr=function(t,e){return(Vr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Vr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Dr,Rr=Tt),Object.defineProperty(Dr.prototype,"fontFamily",{get:function(){return this.pdfFontFamily},enumerable:!0,configurable:!0}),Dr.prototype.checkStyle=function(){var t;this.fontFamily!==Y.PdfFontFamily.Symbol&&this.fontFamily!==Y.PdfFontFamily.ZapfDingbats||(t=this.style,t&=~(Y.PdfFontStyle.Bold|Y.PdfFontStyle.Italic),this.setStyle(t))},Dr.prototype.getLineWidth=function(t,e){if(null==t)throw new Error("ArgumentNullException:line");for(var i=0,r=(this.name,0),n=(t=Dr.convert(t)).length;r<n;r++){var o=t[r];i+=this.getCharWidthInternal(o,e)}var s=this.metrics.getSize(e);return i=this.applyFormatSettings(t,e,i*=Tt.charSizeMultiplier*s)},Dr.prototype.equalsToFont=function(t){var e,i,r=!1;return null!=t&&(e=this.fontFamily===t.fontFamily,i=~(Y.PdfFontStyle.Underline|Y.PdfFontStyle.Strikeout),t=(this.style&i)==(t.style&i),r=e&&t),r},Dr.prototype.initializeInternals=function(){Tr.cache.search(this);var t=kr.getMetrics(this.pdfFontFamily,this.style,this.size);this.metrics=t,t=this.createInternals(),this.setInternals(t)},Dr.prototype.createInternals=function(){var t,e=new c;return e.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),e.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type1)),e.items.setValue(this.dictionaryProperties.baseFont,new o(this.metrics.postScriptName)),this.fontFamily!==Y.PdfFontFamily.Symbol&&this.fontFamily!==Y.PdfFontFamily.ZapfDingbats&&(t=this.encodings[Y.FontEncoding.WinAnsiEncoding],e.items.setValue(this.dictionaryProperties.encoding,new o(t))),e},Dr.prototype.getCharWidthInternal=function(t,e){var i=0,i=t.charCodeAt(0);return"0"!==this.name&&"1"!==this.name&&"2"!==this.name&&"3"!==this.name&&"4"!==this.name||(i-=Dr.charOffset),this.metrics.widthTable.items(i=0<=i&&128!==i?i:0)},Dr.convert=function(t){return t},Dr.charOffset=32;var Vr,Rr,Mr=Dr;function Dr(t,e,i){e=Rr.call(this,e,void 0===i?t instanceof Dr?t.style:Y.PdfFontStyle.Regular:i)||this;return e.dictionaryProperties=new l,e.encodings=["Unknown","StandardEncoding","MacRomanEncoding","MacExpertEncoding","WinAnsiEncoding","PDFDocEncoding","IdentityH"],e.pdfFontFamily=void 0===t?Y.PdfFontFamily.Helvetica:t instanceof Dr?t.fontFamily:t,e.checkStyle(),e.initializeInternals(),e}Object.defineProperty(Nr.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"innerColor",{get:function(){return this.internalColor},set:function(t){this.internalColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"bounds",{get:function(){return this.rectangle},set:function(t){this.rectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"font",{get:function(){return this.textFont},set:function(t){this.textFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"brush",{get:function(){return this.textBrush},set:function(t){this.textBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t,this.dictionary.items.setValue(this.dictionaryProperties.contents,new tt(this.content))},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"dictionary",{get:function(){return this.pdfDictionary},set:function(t){this.pdfDictionary=t},enumerable:!0,configurable:!0}),Nr.prototype.initialize=function(){this.pdfDictionary.annotationBeginSave=new E(this),this.pdfDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.annot))},Nr.prototype.setPage=function(t){this.pdfPage=t,this.pdfDictionary.items.setValue(this.dictionaryProperties.p,new d(this.pdfPage))},Nr.prototype.beginSave=function(){this.save()},Nr.prototype.save=function(){var t=new Z(this.rectangle.x,this.rectangle.y,this.rectangle.width,this.rectangle.height),e=this.pdfPage.section,i=t.height,e=e.pointToNativePdf(this.page,new X(t.x,t.y));t.x=e.x,t.width=e.x+t.width,t.y=e.y-this.page.document.pageSettings.margins.top,t.height=t.y-i,this.pdfDictionary.items.setValue(this.dictionaryProperties.rect,p.fromRectangle(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new u(this.darkness))},Object.defineProperty(Nr.prototype,"element",{get:function(){return this.pdfDictionary},enumerable:!0,configurable:!0});var Ar=Nr;function Nr(t){this.dictionaryProperties=new l,this.pdfColor=new f(255,255,255),this.rectangle=new Z(0,0,0,0),this.pdfPage=null,this.textBrush=new mt(new f(0,0,0)),this.textFont=new Mr(Y.PdfFontFamily.TimesRoman,10),this.format=new bt(Y.PdfTextAlignment.Left),this.content="",this.pdfDictionary=new c,this.internalColor=new f,this.darkness=1,void 0===t?this.initialize():(this.initialize(),this.bounds=t)}Ir=function(t,e){return(Ir=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ir(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Gr,Fr=Ar),Gr.prototype.initialize=function(){Fr.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link))};var Ir,Fr,Er=Gr;function Gr(t){return Fr.call(this,t)||this}zr=function(t,e){return(zr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}zr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Hr,Wr=Er),Hr.prototype.getSetAction=function(t){if(void 0===t)return this.pdfAction;this.pdfAction=t};var zr,Wr,_r=Hr;function Hr(t){t=Wr.call(this,t)||this;return t.pdfAction=null,t}Ur=function(t,e){return(Ur=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ur(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Yr,Kr=Er),Object.defineProperty(Yr.prototype,"destination",{get:function(){return this.pdfDestination},set:function(t){this.pdfDestination=t},enumerable:!0,configurable:!0}),Yr.prototype.save=function(){Kr.prototype.save.call(this),null!=this.pdfDestination&&this.dictionary.items.setValue(this.dictionaryProperties.dest,this.pdfDestination.element)},Yr.prototype.clone=function(){var t=new Yr(this.bounds,this.destination);return t.color=this.color,t.brush=this.brush,t.destination=this.destination,t.font=this.font,t};var Ur,Kr,qr=Yr;function Yr(t,e){t=Kr.call(this,t)||this;return t.pdfDestination=null,void 0!==e&&(t.destination=e),t}Object.defineProperty(Jr.prototype,"elements",{get:function(){return this.layoutElement},enumerable:!0,configurable:!0}),Jr.prototype.getElement=function(){return this.layoutElement},Jr.prototype.layout=function(t){return this.layoutInternal(t)},Jr.prototype.Layouter=function(t){return this.layoutInternal(t)},Jr.prototype.getNextPage=function(t){return t.section.add()},Jr.prototype.getPaginateBounds=function(t){if(null==t)throw new Error("ArgumentNullException : param");return t.format.usePaginateBounds?t.format.paginateBounds:new Z(t.bounds.x,0,t.bounds.width,t.bounds.height)};var Xr=Jr;function Jr(t){this.layoutElement=t}Object.defineProperty($r.prototype,"layout",{get:function(){return this.layoutType},set:function(t){this.layoutType=t},enumerable:!0,configurable:!0}),Object.defineProperty($r.prototype,"break",{get:function(){return this.breakType},set:function(t){this.breakType=t},enumerable:!0,configurable:!0}),Object.defineProperty($r.prototype,"paginateBounds",{get:function(){return void 0===this.layoutPaginateBounds&&null==this.layoutPaginateBounds&&(this.layoutPaginateBounds=new Z(0,0,0,0)),this.layoutPaginateBounds},set:function(t){this.layoutPaginateBounds=t,this.boundsSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty($r.prototype,"usePaginateBounds",{get:function(){return this.boundsSet},enumerable:!0,configurable:!0});var Zr=$r;function $r(t){void 0!==t&&(this.break=t.break,this.layout=t.layout,this.paginateBounds=t.paginateBounds,this.boundsSet=t.usePaginateBounds)}Object.defineProperty(tn.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t},enumerable:!0,configurable:!0}),Object.defineProperty(tn.prototype,"bounds",{get:function(){return new Z(this.layoutBounds.x,this.layoutBounds.y,this.layoutBounds.width,this.layoutBounds.height)},set:function(t){this.layoutBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(tn.prototype,"format",{get:function(){return this.layoutFormat},set:function(t){this.layoutFormat=t},enumerable:!0,configurable:!0});var Qr=tn;function tn(){}Object.defineProperty(rn.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(rn.prototype,"bounds",{get:function(){return this.layoutBounds},enumerable:!0,configurable:!0});var en=rn;function rn(t,e){this.pdfPage=t,this.layoutBounds=e}Object.defineProperty(on.prototype,"left",{get:function(){return this.leftPen},set:function(t){this.leftPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(on.prototype,"right",{get:function(){return this.rightPen},set:function(t){this.rightPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(on.prototype,"top",{get:function(){return this.topPen},set:function(t){this.topPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(on.prototype,"bottom",{get:function(){return this.bottomPen},set:function(t){this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(on.prototype,"all",{set:function(t){this.leftPen=this.rightPen=this.topPen=this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(on.prototype,"isAll",{get:function(){return this.leftPen===this.rightPen&&this.leftPen===this.topPen&&this.leftPen===this.bottomPen},enumerable:!0,configurable:!0}),Object.defineProperty(on,"default",{get:function(){return new on},enumerable:!0,configurable:!0});var nn=on;function on(){var t=new ne(new f(0,0,0)),e=(t.dashStyle=Y.PdfDashStyle.Solid,new ne(new f(0,0,0))),i=(e.dashStyle=Y.PdfDashStyle.Solid,new ne(new f(0,0,0))),r=(i.dashStyle=Y.PdfDashStyle.Solid,new ne(new f(0,0,0)));r.dashStyle=Y.PdfDashStyle.Solid,this.leftPen=t,this.rightPen=e,this.topPen=i,this.bottomPen=r}Object.defineProperty(an.prototype,"left",{get:function(){return this.leftPad},set:function(t){this.leftPad=t,this.hasLeftPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(an.prototype,"right",{get:function(){return this.rightPad},set:function(t){this.rightPad=t,this.hasRightPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(an.prototype,"top",{get:function(){return this.topPad},set:function(t){this.topPad=t,this.hasTopPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(an.prototype,"bottom",{get:function(){return this.bottomPad},set:function(t){this.bottomPad=t,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(an.prototype,"all",{set:function(t){this.leftPad=this.rightPad=this.topPad=this.bottomPad=t,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0},enumerable:!0,configurable:!0});var sn=an;function an(t,e,i,r){this.hasLeftPad=!1,this.hasRightPad=!1,this.hasTopPad=!1,this.hasBottomPad=!1,void 0===t?this.bottomPad=this.topPad=this.leftPad=this.rightPad=.5:(this.leftPad=t,this.rightPad=e,this.topPad=i,this.bottomPad=r,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0)}Object.defineProperty(ln.prototype,"raiseBeginPageLayout",{get:function(){return void 0!==this.beginPageLayout},enumerable:!0,configurable:!0}),Object.defineProperty(ln.prototype,"raiseEndPageLayout",{get:function(){return void 0!==this.endPageLayout},enumerable:!0,configurable:!0}),ln.prototype.onBeginPageLayout=function(t){this.beginPageLayout&&this.beginPageLayout(this,t)},ln.prototype.onEndPageLayout=function(t){this.endPageLayout&&this.endPageLayout(this,t)},ln.prototype.drawHelper=function(t,e,i,r){var n;return e instanceof X&&void 0===e.width&&void 0===i?this.drawHelper(t,e.x,e.y):"number"==typeof e&&"number"==typeof i&&void 0===r?this.drawHelper(t,e,i,null):e instanceof Z&&void 0!==e.width&&void 0===i?this.drawHelper(t,e,null):e instanceof X&&void 0===e.width&&i instanceof Zr?this.drawHelper(t,e.x,e.y,i):"number"==typeof e&&"number"==typeof i&&(r instanceof Zr||null==r)?(n=t.graphics.clientSize.width-e,n=new Z(e,i,n,0),this.drawHelper(t,n,r)):e instanceof Z&&void 0!==e.width&&"boolean"==typeof i?(this.bEmbedFonts=i,this.drawHelper(t,e,null)):(n=e,r=i,(e=new Qr).page=t,e.bounds=n,null!=e&&(i=e.bounds.x,t=e.bounds.y,0===e.bounds.x&&(i=nn.default.right.width/2),0===e.bounds.y&&(t=nn.default.top.width/2),n=new Z(i,t,e.bounds.width,e.bounds.height),e.bounds=n),e.format=null!=r?r:new Zr,this.layout(e))};var hn=ln;function ln(){}un=function(t,e){return(un=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var un,cn,pn=function(t,e){function i(){this.constructor=t}un(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},dn=(pn(fn,cn=Xr),Object.defineProperty(fn.prototype,"element",{get:function(){return cn.prototype.getElement.call(this)},enumerable:!0,configurable:!0}),fn.prototype.layoutInternal=function(t){this.format=null!==this.element.stringFormat&&void 0!==this.element.stringFormat?this.element.stringFormat:null;var e=t.page,i=t.bounds,r=this.element.value,n=null,o=new mn;for(o.page=e,o.remainder=r;;){o=this.layoutOnPage(r,e,i,t),n=this.getLayoutResult(o);break}return n},fn.prototype.getLayoutResult=function(t){return new yn(t.page,t.bounds,t.remainder,t.lastLineBounds)},fn.prototype.layoutOnPage=function(t,e,i,r){var n=new mn;n.remainder=t,n.page=e,i=this.checkCorrectBounds(e,i);var t=(new vt).layout(t,this.element.font,this.format,i,e.getClientSize().height,!1,new J(0,0)),o=null==t.remainder,r=(r.format.break!==Y.PdfLayoutBreakType.FitElement&&t.empty,e.graphics),s=this.element.getBrush();this.element instanceof Tn&&(s.color=new f(0,0,255)),r.drawStringLayoutResult(t,this.element.font,this.element.pen,s,i,this.format),t.lines[t.lineCount-1];return n.lastLineBounds=r.getLineBounds(t.lineCount-1,t,this.element.font,i,this.format),n.bounds=this.getTextPageBounds(e,i,t),n.remainder=t.remainder,n.end=o,n},fn.prototype.checkCorrectBounds=function(t,e){t=t.graphics.clientSize;return e.height=0<e.height?e.height:t.height-e.y,e},fn.prototype.getTextPageBounds=function(t,e,i){var i=i.actualSize,r=(e.x,e.y),n=(0<e.width?e:i).width,o=i.height,s=t.graphics.checkCorrectLayoutRectangle(i,e.x,e.y,this.format).x,t=t.graphics.getTextVerticalAlignShift(i.height,e.height,this.format);return new Z(s,r+=t,n,o)},fn);function fn(t){return cn.call(this,t)||this}var gn,mn=function(){},yn=(pn(bn,gn=en),Object.defineProperty(bn.prototype,"remainder",{get:function(){return this.remainderText},enumerable:!0,configurable:!0}),Object.defineProperty(bn.prototype,"lastLineBounds",{get:function(){return this.lastLineTextBounds},enumerable:!0,configurable:!0}),bn);function bn(t,e,i,r){t=gn.call(this,t,e)||this;return t.remainderText=i,t.lastLineTextBounds=r,t}wn=function(t,e){return(wn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}wn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Sn,Pn=hn),Object.defineProperty(Sn.prototype,"text",{get:function(){return this.content},set:function(t){this.elementValue=t,this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(Sn.prototype,"value",{get:function(){return this.elementValue},enumerable:!0,configurable:!0}),Object.defineProperty(Sn.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(Sn.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(Sn.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t,this.pdfFont instanceof Mr&&null!=this.content?this.elementValue=Mr.convert(this.content):this.elementValue=this.content},enumerable:!0,configurable:!0}),Object.defineProperty(Sn.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Sn.prototype.getBrush=function(){return null==this.pdfBrush||void 0===this.pdfBrush?new mt(new f(0,0,0)):this.pdfBrush},Sn.prototype.layout=function(t){return new dn(this).layout(t)},Sn.prototype.drawText=function(t,e,i,r){if(e instanceof X&&void 0===e.width&&void 0===i)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.hasPointOverload=!0,this.drawText(t,e,i,null);if(e instanceof Z&&void 0!==e.width&&void 0===i)return this.drawText(t,e,null);if(e instanceof X&&void 0===e.width&&i instanceof Zr)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof Zr||null==r))return this.hasPointOverload=!0,n=t.graphics.clientSize.width-e,n=new Z(e,i,n,0),this.drawText(t,n,r);if(e instanceof Z&&void 0!==e.width&&"boolean"==typeof i)return this.drawText(t,e,null);var n=new vt;if(this.hasPointOverload){var o=n.layout(this.value,this.font,this.stringFormat,new J(t.graphics.clientSize.width-e.x,0),!0,t.graphics.clientSize),s=void 0,a=e,h=i;if((p=new Qr).page=t,p.bounds=a,p.format=null!=h?h:new Zr,1<o.lines.length){if(this.text=o.layoutLines[0].text,p.bounds.y<=p.page.graphics.clientSize.height)for(var l=new X(p.bounds.x,p.bounds.y),u=(s=this.layout(p),new Z(0,s.bounds.y+o.lineHeight,t.graphics.clientSize.width,o.lineHeight)),c=1;c<o.lines.length;c++)p.page=s.page,p.bounds=new Z(new X(u.x,u.y),new J(u.width,u.height)),this.text=o.layoutLines[c].text,u.y+o.lineHeight>s.page.graphics.clientSize.height&&(p.page=p.page.graphics.getNextPage(),u=l.y>s.page.graphics.clientSize.height-s.bounds.height?new Z(0,s.bounds.height,s.page.graphics.clientSize.width,o.lineHeight):new Z(0,0,s.page.graphics.clientSize.width,o.lineHeight),p.bounds=u),s=this.layout(p),c!==o.lines.length-1?u=new Z(0,s.bounds.y+o.lineHeight,s.page.graphics.clientSize.width,o.lineHeight):(g=this.font.measureString(this.text,this.format).width,s=this.calculateResultBounds(s,g,s.page.graphics.clientSize.width,0))}else d=this.font.measureString(this.text,this.format),p.bounds.y<=p.page.graphics.clientSize.height&&(s=this.layout(p),s=this.calculateResultBounds(s,d.width,s.page.graphics.clientSize.width,0));return s}var p,d,s=n.layout(this.value,this.font,this.stringFormat,new J(e.width,0),!1,t.graphics.clientSize),f=void 0,a=e,h=i;if((p=new Qr).page=t,p.bounds=a,p.format=null!=h?h:new Zr,1<s.lines.length){if(this.text=s.layoutLines[0].text,p.bounds.y<=p.page.graphics.clientSize.height)for(var g,l=new X(p.bounds.x,p.bounds.y),u=(f=this.layout(p),new Z(a.x,f.bounds.y+s.lineHeight,a.width,s.lineHeight)),c=1;c<s.lines.length;c++)p.page=f.page,p.bounds=new Z(u.x,u.y,u.width,u.height),this.text=s.layoutLines[c].text,u.y+s.lineHeight>f.page.graphics.clientSize.height&&(p.page=p.page.graphics.getNextPage(),u=l.y>f.page.graphics.clientSize.height-f.bounds.height?new Z(a.x,s.lineHeight,a.width,s.lineHeight):new Z(a.x,0,a.width,s.lineHeight),p.bounds=u),f=this.layout(p),c!==s.lines.length-1?u=new Z(a.x,f.bounds.y+s.lineHeight,a.width,s.lineHeight):(g=this.font.measureString(this.text,this.format).width,f=this.calculateResultBounds(f,g,a.width,a.x))}else d=this.font.measureString(this.text,this.format),p.bounds.y<=p.page.graphics.clientSize.height&&(f=this.layout(p),f=this.calculateResultBounds(f,d.width,a.width,a.x));return f},Sn.prototype.calculateResultBounds=function(t,e,i,r){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Center?(t.bounds.x=r+(i-e)/2,t.bounds.width=e):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Right?(t.bounds.x=r+(i-e),t.bounds.width=e):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Justify?(t.bounds.x=r,t.bounds.width=i):(t.bounds.width=r,t.bounds.width=e),t};var wn,Pn,pn=Sn;function Sn(t,e,i,r,n){var o=Pn.call(this)||this;return o.content="",o.elementValue="",o.hasPointOverload=!1,o.isPdfTextElement=!1,void 0!==t&&("string"==typeof t&&void 0===e?(o.content=t,o.elementValue=t):"string"==typeof t&&e instanceof Tt&&void 0===i?(o.content=t,o.elementValue=t,o.pdfFont=e):"string"==typeof t&&e instanceof Tt&&i instanceof ne&&void 0===r?(o.content=t,o.elementValue=t,o.pdfFont=e,o.pdfPen=i):"string"==typeof t&&e instanceof Tt&&i instanceof pt&&void 0===r?(o.content=t,o.elementValue=t,o.pdfFont=e,o.pdfBrush=i):(o.content=t,o.elementValue=t,o.pdfFont=e,o.pdfPen=i,o.pdfBrush=r,o.format=n)),o}vn=function(t,e){return(vn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}vn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(On,Cn=_r),Object.defineProperty(On.prototype,"uriAction",{get:function(){return void 0===this.pdfUriAction&&(this.pdfUriAction=new ht),this.pdfUriAction},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"uri",{get:function(){return this.uriAction.uri},set:function(t){this.uriAction.uri!==t&&(this.uriAction.uri=t)},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"action",{get:function(){return this.getSetAction()},set:function(t){this.getSetAction(t),this.uriAction.next=t},enumerable:!0,configurable:!0}),On.prototype.initialize=function(){Cn.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link));this.uriAction.element;this.dictionary.items.setValue(this.dictionaryProperties.a,this.uriAction.element)};var vn,Cn,Bn=On;function On(t,e){t=Cn.call(this,t)||this;return void 0!==e&&(t.uri=e),t}xn=function(t,e){return(xn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}xn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(jn,Ln=pn),Object.defineProperty(jn.prototype,"url",{get:function(){return this.uniformResourceLocator},set:function(t){if(0===t.length)throw new Error("ArgumentException : Url - string can not be empty");this.uniformResourceLocator=t},enumerable:!0,configurable:!0}),jn.prototype.draw=function(t,e){var i,r,n,o,s,a;return t instanceof or?(a=new vt,i=this.font.style,e instanceof X?(this.recalculateBounds=!0,this.font.style=Y.PdfFontStyle.Underline,s=1===(r=a.layout(this.value,this.font,this.stringFormat,new J(t.graphics.clientSize.width-e.x,0),!0,t.graphics.clientSize)).lines.length?(n=this.font.measureString(this.value),o=new Z(e,n),o=this.calculateBounds(o,n.width,t.graphics.clientSize.width,e.x),this.uriAnnotation=new Bn(o,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),t.annotations.add(this.uriAnnotation),this.drawText(t,e)):this.drawMultipleLineWithPoint(r,t,e),this.font.style=i,s):(r=a.layout(this.value,this.font,this.stringFormat,new J(e.width,0),!1,new J(0,0)),this.font.style=Y.PdfFontStyle.Underline,s=1===r.lines.length?(n=this.font.measureString(this.value),o=new Z(new X(e.x,e.y),n),o=this.calculateBounds(o,n.width,e.width,e.x),this.uriAnnotation=new Bn(o,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),t.annotations.add(this.uriAnnotation),this.drawText(t,e)):this.drawMultipleLineWithBounds(r,t,e),this.font.style=i,s)):(a=new or,a=t.page,this.draw(a,e))},jn.prototype.drawMultipleLineWithPoint=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new Z(i,o);if(0!==n&&(s.x=0),this.text=t.lines[n].text,s.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),s=new Z(0,0,e.graphics.clientSize.width,o.height),i.y=0}s=this.calculateBounds(s,o.width,e.graphics.clientSize.width,s.x),this.uriAnnotation=new Bn(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=0!==n?this.drawText(e,new X(0,s.y)):this.drawText(e,s.x,s.y),i.y+=o.height}return r},jn.prototype.drawMultipleLineWithBounds=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new Z(new X(i.x,i.y),o),s=this.calculateBounds(s,o.width,i.width,i.x);if(this.text=t.lines[n].text,i.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),i=new Z(i.x,0,i.width,o.height),s.y=0}this.uriAnnotation=new Bn(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=this.drawText(e,i),i.y+=o.height}return r},jn.prototype.calculateBounds=function(t,e,i,r){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Center?(t.x=r+(i-e)/2,t.width=e):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Right?(t.x=r+(i-e),t.width=e):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Justify?(t.x=r,t.width=i):(t.width=r,t.width=e),t};var xn,Ln,Tn=jn;function jn(){var t=Ln.call(this)||this;t.uniformResourceLocator="",t.uriAnnotation=null,t.recalculateBounds=!1,t.defaultBorder=new p;for(var e=0;e<3;e++)t.defaultBorder.add(new u(0));return t}Vn.convert=function(t,e){var i="";switch(e){case Y.PdfNumberStyle.None:i="";break;case Y.PdfNumberStyle.Numeric:i=t.toString();break;case Y.PdfNumberStyle.LowerLatin:i=this.arabicToLetter(t).toLowerCase();break;case Y.PdfNumberStyle.LowerRoman:i=this.arabicToRoman(t).toLowerCase();break;case Y.PdfNumberStyle.UpperLatin:i=this.arabicToLetter(t);break;case Y.PdfNumberStyle.UpperRoman:i=this.arabicToRoman(t)}return i},Vn.arabicToRoman=function(t){var e="",i=this.generateNumber(t,1e3,"M"),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,900,"CM")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,500,"D")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,400,"CD")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,100,"C")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,90,"XC")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,50,"L")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,40,"XL")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,10,"X")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,9,"IX")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,5,"V")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,4,"IV")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,1,"I"));return e+=i.returnValue,t=i.intArabic,e.toString()},Vn.arabicToLetter=function(t){for(var e=this.convertToLetter(t),i="";0<e.length;)var r=e.pop(),i=this.appendChar(i,r);return i.toString()},Vn.generateNumber=function(t,e,i){for(var r="";e<=t;)t-=e,r+=i;return{returnValue:r.toString(),intArabic:t}},Vn.convertToLetter=function(t){if(t<=0)throw Error("ArgumentOutOfRangeException-arabic, Value can not be less 0");for(var e=[];t>this.letterLimit;){var i=t%this.letterLimit;0===i?(t=t/this.letterLimit-1,i=this.letterLimit):t/=this.letterLimit,e.push(i)}return e.push(t),e},Vn.appendChar=function(t,e){return t+=String.fromCharCode(Vn.acsiiStartIndex+e)},Vn.letterLimit=26,Vn.acsiiStartIndex=64;var kn=Vn;function Vn(){}Object.defineProperty(Mn.prototype,"template",{get:function(){return this.pdfTemplate},set:function(t){this.pdfTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(Mn.prototype,"value",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0});var Rn=Mn;function Mn(t,e){this.pdfTemplate=null,this.content="",void 0!==t&&(this.template=t,this.value=e)}Dn=function(t,e){return(Dn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Dn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(In,An=Pe),In.prototype.performDraw=function(t,e,i,r){An.prototype.performDrawHelper.call(this,t,e,i,r);var n=this.getValue(t),o=new Ti(this.getSize()),s=(this.list.setValue(t,new Rn(o,n)),this.getSize()),n=(o.graphics.drawString(n,this.getFont(),this.pen,this.getBrush(),0,0,s.width,s.height,this.stringFormat),new X(e.x+this.location.x,e.y+this.location.y));t.drawPdfTemplate(o,n,new J(o.width*i,o.height*r))};var Dn,An,Nn=In;function In(){var t=An.call(this)||this;return t.list=new ce,t}Fn=function(t,e){return(Fn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Fn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(zn,En=Nn),Object.defineProperty(zn.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),zn.prototype.getValue=function(t){t=this.getPageFromGraphics(t);return this.internalGetValue(t)},zn.prototype.internalGetValue=function(t){t=t.document.pages.indexOf(t)+1;return kn.convert(t,this.numberStyle)};var Fn,En,Gn=zn;function zn(t,e){var i=En.call(this)||this;return i.internalNumberStyle=Y.PdfNumberStyle.Numeric,void 0===e?i.font=t:e instanceof pt?(i.font=t,i.brush=e):(i.font=t,i.bounds=e),i}Wn=function(t,e){return(Wn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Wn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Hn,_n=Nn),Object.defineProperty(Hn.prototype,"text",{get:function(){return this.internalText},set:function(t){this.internalText=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hn.prototype,"automaticFields",{get:function(){return this.internalAutomaticFields},set:function(t){this.internalAutomaticFields=t},enumerable:!0,configurable:!0}),Hn.prototype.getValue=function(t){var e=this.text.toString();if(void 0!==this.automaticFields&&null!=this.automaticFields&&0<this.automaticFields.length)for(var i=0;i<this.automaticFields.length;i++)var r=this.automaticFields[i],e=e.replace("{"+i+"}",r.getValue(t));return e};var Wn,_n,Nn=Hn;function Hn(t,e,i){for(var r=[],n=3;n<arguments.length;n++)r[n-3]=arguments[n];var o=_n.call(this)||this;return o.internalAutomaticFields=null,o.internalText="",o.font=t,o.brush=e,o.text=i,o.automaticFields=r,o}Un=function(t,e){return(Un=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Un(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Yn,Kn=Pe),Yn.prototype.performDraw=function(t,e,i,r){Kn.prototype.performDrawHelper.call(this,t,e,i,r);var n,o,s,a=this.getPageFromGraphics(t).document,h=this.getValue(t);this.list.containsKey(a)?(n=this.list.getValue(a),s=new X(e.x+this.location.x,e.y+this.location.y),t.drawPdfTemplate(n.template,s,new J(n.template.width*i,n.template.height*r))):(n=this.getSize(),o=new Ti(n),this.list.setValue(a,new Rn(o,h)),o.graphics.drawString(h,this.getFont(),this.pen,this.getBrush(),0,0,n.width,n.height,this.stringFormat),s=new X(e.x+this.location.x,e.y+this.location.y),t.drawPdfTemplate(o,s,new J(o.width*i,o.height*r))),this.painterGraphics.push(t)};var Un,Kn,qn=Yn;function Yn(){var t=Kn.call(this)||this;return t.list=new ce,t.painterGraphics=[],t}Xn=function(t,e){return(Xn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Xn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Zn,Jn=qn),Object.defineProperty(Zn.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),Zn.prototype.getValue=function(t){t=this.getPageFromGraphics(t).section.parent.document.pages.count;return kn.convert(t,this.numberStyle)};var Xn,Jn,qn=Zn;function Zn(t,e){var i=Jn.call(this)||this;return i.internalNumberStyle=Y.PdfNumberStyle.Numeric,void 0===e?i.font=t:e instanceof pt?(i.font=t,i.brush=e):(i.font=t,i.bounds=e),i}($n=Y.PdfDestinationMode||(Y.PdfDestinationMode={}))[$n.Location=0]="Location",$n[$n.FitToPage=1]="FitToPage",$n[$n.FitR=2]="FitR";Object.defineProperty(Qn.prototype,"zoom",{get:function(){return this.zoomFactor},set:function(t){this.zoomFactor=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(Qn.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(Qn.prototype,"mode",{get:function(){return this.destinationMode},set:function(t){this.destinationMode=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(Qn.prototype,"location",{get:function(){return this.destinationLocation},set:function(t){this.destinationLocation=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Qn.prototype.pointToNativePdf=function(t,e){return t.section.pointToNativePdf(t,e)},Qn.prototype.initializePrimitive=function(){switch(this.array.clear(),this.array.add(new d(this.pdfPage)),this.destinationMode){case Y.PdfDestinationMode.Location:var t=this.pdfPage,t=(new X,this.pointToNativePdf(t,this.destinationLocation));this.array.add(new o(this.dictionaryProperties.xyz)),this.array.add(new u(t.x)),this.array.add(new u(t.y)),this.array.add(new u(this.zoomFactor));break;case Y.PdfDestinationMode.FitToPage:this.array.add(new o(this.dictionaryProperties.fit))}},Object.defineProperty(Qn.prototype,"element",{get:function(){return this.initializePrimitive(),this.array},enumerable:!0,configurable:!0});var $n=Qn;function Qn(t,e){this.dictionaryProperties=new l,this.destinationMode=Y.PdfDestinationMode.Location,this.zoomFactor=0,this.destinationLocation=new X(0,0),this.bounds=new Z,this.array=new p;Y.PdfPageRotateAngle.RotateAngle0;this.destinationLocation=new X(0,this.destinationLocation.y),this.pdfPage=t,e instanceof X?this.destinationLocation=e:this.bounds=e}Object.defineProperty(eo.prototype,"domain",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.domain)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.domain,t)},enumerable:!0,configurable:!0}),Object.defineProperty(eo.prototype,"range",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.range)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.range,t)},enumerable:!0,configurable:!0}),Object.defineProperty(eo.prototype,"dictionary",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(eo.prototype,"element",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0});var to=eo;function eo(t){this.mDictionary=null,this.mDictionaryProperties=new l,this.mDictionary=t}io=function(t,e){return(io=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}io(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(ho,ro=to),ho.prototype.checkParams=function(t,e,i,r){e.length,t.length,r.length},ho.prototype.setDomainAndRange=function(t,e){this.domain=new p(t),this.range=new p(e)},ho.prototype.setSizeAndValues=function(t,e){var i=this.dictionary;i.isResource=!0,this.dictionary.items.setValue(this.mDictionaryProperties.size,new p(t)),this.dictionary.items.setValue(this.mDictionaryProperties.bitsPerSample,new u(8)),i.writeBytes(e)};var io,ro,no,oo,so,B,ao=ho;function ho(t,e,i,r){var n=ro.call(this,new U)||this;return void 0===t?n.dictionary.items.setValue(n.mDictionaryProperties.functionType,new u(0)):(n.dictionary.items.setValue(n.mDictionaryProperties.functionType,new u(0)),n.checkParams(t,e,i,r),n.setDomainAndRange(t,e),n.setSizeAndValues(i,r)),n}(O=no=no||{})[O.None=0]="None",O[O.Start=1]="Start",O[O.End=2]="End",O[O.Both=3]="Both",(O=oo=oo||{})[O.BackwardDiagonal=0]="BackwardDiagonal",O[O.ForwardDiagonal=1]="ForwardDiagonal",O[O.Horizontal=2]="Horizontal",O[O.Vertical=3]="Vertical",(O=so=so||{})[O.Function=1]="Function",O[O.Axial=2]="Axial",O[O.Radial=3]="Radial",(O=B=B||{})[O.ActiveBorder=1]="ActiveBorder",O[O.ActiveCaption=2]="ActiveCaption",O[O.ActiveCaptionText=3]="ActiveCaptionText",O[O.AppWorkspace=4]="AppWorkspace",O[O.Control=5]="Control",O[O.ControlDark=6]="ControlDark",O[O.ControlDarkDark=7]="ControlDarkDark",O[O.ControlLight=8]="ControlLight",O[O.ControlLightLight=9]="ControlLightLight",O[O.ControlText=10]="ControlText",O[O.Desktop=11]="Desktop",O[O.GrayText=12]="GrayText",O[O.Highlight=13]="Highlight",O[O.HighlightText=14]="HighlightText",O[O.HotTrack=15]="HotTrack",O[O.InactiveBorder=16]="InactiveBorder",O[O.InactiveCaption=17]="InactiveCaption",O[O.InactiveCaptionText=18]="InactiveCaptionText",O[O.Info=19]="Info",O[O.InfoText=20]="InfoText",O[O.Menu=21]="Menu",O[O.MenuText=22]="MenuText",O[O.ScrollBar=23]="ScrollBar",O[O.Window=24]="Window",O[O.WindowFrame=25]="WindowFrame",O[O.WindowText=26]="WindowText",O[O.Transparent=27]="Transparent",O[O.AliceBlue=28]="AliceBlue",O[O.AntiqueWhite=29]="AntiqueWhite",O[O.Aqua=30]="Aqua",O[O.Aquamarine=31]="Aquamarine",O[O.Azure=32]="Azure",O[O.Beige=33]="Beige",O[O.Bisque=34]="Bisque",O[O.Black=35]="Black",O[O.BlanchedAlmond=36]="BlanchedAlmond",O[O.Blue=37]="Blue",O[O.BlueViolet=38]="BlueViolet",O[O.Brown=39]="Brown",O[O.BurlyWood=40]="BurlyWood",O[O.CadetBlue=41]="CadetBlue",O[O.Chartreuse=42]="Chartreuse",O[O.Chocolate=43]="Chocolate",O[O.Coral=44]="Coral",O[O.CornflowerBlue=45]="CornflowerBlue",O[O.Cornsilk=46]="Cornsilk",O[O.Crimson=47]="Crimson",O[O.Cyan=48]="Cyan",O[O.DarkBlue=49]="DarkBlue",O[O.DarkCyan=50]="DarkCyan",O[O.DarkGoldenrod=51]="DarkGoldenrod",O[O.DarkGray=52]="DarkGray",O[O.DarkGreen=53]="DarkGreen",O[O.DarkKhaki=54]="DarkKhaki",O[O.DarkMagenta=55]="DarkMagenta",O[O.DarkOliveGreen=56]="DarkOliveGreen",O[O.DarkOrange=57]="DarkOrange",O[O.DarkOrchid=58]="DarkOrchid",O[O.DarkRed=59]="DarkRed",O[O.DarkSalmon=60]="DarkSalmon",O[O.DarkSeaGreen=61]="DarkSeaGreen",O[O.DarkSlateBlue=62]="DarkSlateBlue",O[O.DarkSlateGray=63]="DarkSlateGray",O[O.DarkTurquoise=64]="DarkTurquoise",O[O.DarkViolet=65]="DarkViolet",O[O.DeepPink=66]="DeepPink",O[O.DeepSkyBlue=67]="DeepSkyBlue",O[O.DimGray=68]="DimGray",O[O.DodgerBlue=69]="DodgerBlue",O[O.Firebrick=70]="Firebrick",O[O.FloralWhite=71]="FloralWhite",O[O.ForestGreen=72]="ForestGreen",O[O.Fuchsia=73]="Fuchsia",O[O.Gainsboro=74]="Gainsboro",O[O.GhostWhite=75]="GhostWhite",O[O.Gold=76]="Gold",O[O.Goldenrod=77]="Goldenrod",O[O.Gray=78]="Gray",O[O.Green=79]="Green",O[O.GreenYellow=80]="GreenYellow",O[O.Honeydew=81]="Honeydew",O[O.HotPink=82]="HotPink",O[O.IndianRed=83]="IndianRed",O[O.Indigo=84]="Indigo",O[O.Ivory=85]="Ivory",O[O.Khaki=86]="Khaki",O[O.Lavender=87]="Lavender",O[O.LavenderBlush=88]="LavenderBlush",O[O.LawnGreen=89]="LawnGreen",O[O.LemonChiffon=90]="LemonChiffon",O[O.LightBlue=91]="LightBlue",O[O.LightCoral=92]="LightCoral",O[O.LightCyan=93]="LightCyan",O[O.LightGoldenrodYellow=94]="LightGoldenrodYellow",O[O.LightGray=95]="LightGray",O[O.LightGreen=96]="LightGreen",O[O.LightPink=97]="LightPink",O[O.LightSalmon=98]="LightSalmon",O[O.LightSeaGreen=99]="LightSeaGreen",O[O.LightSkyBlue=100]="LightSkyBlue",O[O.LightSlateGray=101]="LightSlateGray",O[O.LightSteelBlue=102]="LightSteelBlue",O[O.LightYellow=103]="LightYellow",O[O.Lime=104]="Lime",O[O.LimeGreen=105]="LimeGreen",O[O.Linen=106]="Linen",O[O.Magenta=107]="Magenta",O[O.Maroon=108]="Maroon",O[O.MediumAquamarine=109]="MediumAquamarine",O[O.MediumBlue=110]="MediumBlue",O[O.MediumOrchid=111]="MediumOrchid",O[O.MediumPurple=112]="MediumPurple",O[O.MediumSeaGreen=113]="MediumSeaGreen",O[O.MediumSlateBlue=114]="MediumSlateBlue",O[O.MediumSpringGreen=115]="MediumSpringGreen",O[O.MediumTurquoise=116]="MediumTurquoise",O[O.MediumVioletRed=117]="MediumVioletRed",O[O.MidnightBlue=118]="MidnightBlue",O[O.MintCream=119]="MintCream",O[O.MistyRose=120]="MistyRose",O[O.Moccasin=121]="Moccasin",O[O.NavajoWhite=122]="NavajoWhite",O[O.Navy=123]="Navy",O[O.OldLace=124]="OldLace",O[O.Olive=125]="Olive",O[O.OliveDrab=126]="OliveDrab",O[O.Orange=127]="Orange",O[O.OrangeRed=128]="OrangeRed",O[O.Orchid=129]="Orchid",O[O.PaleGoldenrod=130]="PaleGoldenrod",O[O.PaleGreen=131]="PaleGreen",O[O.PaleTurquoise=132]="PaleTurquoise",O[O.PaleVioletRed=133]="PaleVioletRed",O[O.PapayaWhip=134]="PapayaWhip",O[O.PeachPuff=135]="PeachPuff",O[O.Peru=136]="Peru",O[O.Pink=137]="Pink",O[O.Plum=138]="Plum",O[O.PowderBlue=139]="PowderBlue",O[O.Purple=140]="Purple",O[O.Red=141]="Red",O[O.RosyBrown=142]="RosyBrown",O[O.RoyalBlue=143]="RoyalBlue",O[O.SaddleBrown=144]="SaddleBrown",O[O.Salmon=145]="Salmon",O[O.SandyBrown=146]="SandyBrown",O[O.SeaGreen=147]="SeaGreen",O[O.SeaShell=148]="SeaShell",O[O.Sienna=149]="Sienna",O[O.Silver=150]="Silver",O[O.SkyBlue=151]="SkyBlue",O[O.SlateBlue=152]="SlateBlue",O[O.SlateGray=153]="SlateGray",O[O.Snow=154]="Snow",O[O.SpringGreen=155]="SpringGreen",O[O.SteelBlue=156]="SteelBlue",O[O.Tan=157]="Tan",O[O.Teal=158]="Teal",O[O.Thistle=159]="Thistle",O[O.Tomato=160]="Tomato",O[O.Turquoise=161]="Turquoise",O[O.Violet=162]="Violet",O[O.Wheat=163]="Wheat",O[O.White=164]="White",O[O.WhiteSmoke=165]="WhiteSmoke",O[O.Yellow=166]="Yellow",O[O.YellowGreen=167]="YellowGreen",O[O.ButtonFace=168]="ButtonFace",O[O.ButtonHighlight=169]="ButtonHighlight",O[O.ButtonShadow=170]="ButtonShadow",O[O.GradientActiveCaption=171]="GradientActiveCaption",O[O.GradientInactiveCaption=172]="GradientInactiveCaption",O[O.MenuBar=173]="MenuBar",O[O.MenuHighlight=174]="MenuHighlight";Object.defineProperty(x,"AliceBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.AliceBlue)?this.sBrushes.getValue(B.AliceBlue):t)?this.getBrush(B.AliceBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"AntiqueWhite",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.AntiqueWhite)?this.sBrushes.getValue(B.AntiqueWhite):t)?this.getBrush(B.AntiqueWhite):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Aqua",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Aqua)?this.sBrushes.getValue(B.Aqua):t)?this.getBrush(B.Aqua):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Aquamarine",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Aquamarine)?this.sBrushes.getValue(B.Aquamarine):t)?this.getBrush(B.Aquamarine):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Azure",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Azure)?this.sBrushes.getValue(B.Azure):t)?this.getBrush(B.Azure):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Beige",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Beige)?this.sBrushes.getValue(B.Beige):t)?this.getBrush(B.Beige):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Bisque",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Bisque)?this.sBrushes.getValue(B.Bisque):t)?this.getBrush(B.Bisque):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Black",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Black)?this.sBrushes.getValue(B.Black):t)?this.getBrush(B.Black):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"BlanchedAlmond",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.BlanchedAlmond)?this.sBrushes.getValue(B.BlanchedAlmond):t)?this.getBrush(B.BlanchedAlmond):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Blue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Blue)?this.sBrushes.getValue(B.Blue):t)?this.getBrush(B.Blue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"BlueViolet",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.BlueViolet)?this.sBrushes.getValue(B.BlueViolet):t)?this.getBrush(B.BlueViolet):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Brown",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Brown)?this.sBrushes.getValue(B.Brown):t)?this.getBrush(B.Brown):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"BurlyWood",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.BurlyWood)?this.sBrushes.getValue(B.BurlyWood):t)?this.getBrush(B.BurlyWood):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"CadetBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.CadetBlue)?this.sBrushes.getValue(B.CadetBlue):t)?this.getBrush(B.CadetBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Chartreuse",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Chartreuse)?this.sBrushes.getValue(B.Chartreuse):t)?this.getBrush(B.Chartreuse):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Chocolate",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Chocolate)?this.sBrushes.getValue(B.Chocolate):t)?this.getBrush(B.Chocolate):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Coral",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Coral)?this.sBrushes.getValue(B.Coral):t)?this.getBrush(B.Coral):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"CornflowerBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.CornflowerBlue)?this.sBrushes.getValue(B.CornflowerBlue):t)?this.getBrush(B.CornflowerBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Cornsilk",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Cornsilk)?this.sBrushes.getValue(B.Cornsilk):t)?this.getBrush(B.Cornsilk):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Crimson",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Crimson)?this.sBrushes.getValue(B.Crimson):t)?this.getBrush(B.Crimson):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Cyan",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Cyan)?this.sBrushes.getValue(B.Cyan):t)?this.getBrush(B.Cyan):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkBlue)?this.sBrushes.getValue(B.DarkBlue):t)?this.getBrush(B.DarkBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkCyan",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkCyan)?this.sBrushes.getValue(B.DarkCyan):t)?this.getBrush(B.DarkCyan):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkGoldenrod",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkGoldenrod)?this.sBrushes.getValue(B.DarkGoldenrod):t)?this.getBrush(B.DarkGoldenrod):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkGray)?this.sBrushes.getValue(B.DarkGray):t)?this.getBrush(B.DarkGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkGreen)?this.sBrushes.getValue(B.DarkGreen):t)?this.getBrush(B.DarkGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkKhaki",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkKhaki)?this.sBrushes.getValue(B.DarkKhaki):t)?this.getBrush(B.DarkKhaki):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkMagenta",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkMagenta)?this.sBrushes.getValue(B.DarkMagenta):t)?this.getBrush(B.DarkMagenta):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkOliveGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkOliveGreen)?this.sBrushes.getValue(B.DarkOliveGreen):t)?this.getBrush(B.DarkOliveGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkOrange",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkOrange)?this.sBrushes.getValue(B.DarkOrange):t)?this.getBrush(B.DarkOrange):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkOrchid",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkOrchid)?this.sBrushes.getValue(B.DarkOrchid):t)?this.getBrush(B.DarkOrchid):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkRed)?this.sBrushes.getValue(B.DarkRed):t)?this.getBrush(B.DarkRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkSalmon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkSalmon)?this.sBrushes.getValue(B.DarkSalmon):t)?this.getBrush(B.DarkSalmon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkSeaGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkSeaGreen)?this.sBrushes.getValue(B.DarkSeaGreen):t)?this.getBrush(B.DarkSeaGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkSlateBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkSlateBlue)?this.sBrushes.getValue(B.DarkSlateBlue):t)?this.getBrush(B.DarkSlateBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkSlateGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkSlateGray)?this.sBrushes.getValue(B.DarkSlateGray):t)?this.getBrush(B.DarkSlateGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkTurquoise",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkTurquoise)?this.sBrushes.getValue(B.DarkTurquoise):t)?this.getBrush(B.DarkTurquoise):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkViolet",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkViolet)?this.sBrushes.getValue(B.DarkViolet):t)?this.getBrush(B.DarkViolet):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DeepPink",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DeepPink)?this.sBrushes.getValue(B.DeepPink):t)?this.getBrush(B.DeepPink):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DeepSkyBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DeepSkyBlue)?this.sBrushes.getValue(B.DeepSkyBlue):t)?this.getBrush(B.DeepSkyBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DimGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DimGray)?this.sBrushes.getValue(B.DimGray):t)?this.getBrush(B.DimGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DodgerBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DodgerBlue)?this.sBrushes.getValue(B.DodgerBlue):t)?this.getBrush(B.DodgerBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Firebrick",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Firebrick)?this.sBrushes.getValue(B.Firebrick):t)?this.getBrush(B.Firebrick):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"FloralWhite",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.FloralWhite)?this.sBrushes.getValue(B.FloralWhite):t)?this.getBrush(B.FloralWhite):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"ForestGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.ForestGreen)?this.sBrushes.getValue(B.ForestGreen):t)?this.getBrush(B.ForestGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Fuchsia",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Fuchsia)?this.sBrushes.getValue(B.Fuchsia):t)?this.getBrush(B.Fuchsia):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Gainsboro",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Gainsboro)?this.sBrushes.getValue(B.Gainsboro):t)?this.getBrush(B.Gainsboro):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"GhostWhite",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.GhostWhite)?this.sBrushes.getValue(B.GhostWhite):t)?this.getBrush(B.GhostWhite):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Gold",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Gold)?this.sBrushes.getValue(B.Gold):t)?this.getBrush(B.Gold):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Goldenrod",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Goldenrod)?this.sBrushes.getValue(B.Goldenrod):t)?this.getBrush(B.Goldenrod):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Gray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Gray)?this.sBrushes.getValue(B.Gray):t)?this.getBrush(B.Gray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Green",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Green)?this.sBrushes.getValue(B.Green):t)?this.getBrush(B.Green):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"GreenYellow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.GreenYellow)?this.sBrushes.getValue(B.GreenYellow):t)?this.getBrush(B.GreenYellow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Honeydew",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Honeydew)?this.sBrushes.getValue(B.Honeydew):t)?this.getBrush(B.Honeydew):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"HotPink",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.HotPink)?this.sBrushes.getValue(B.HotPink):t)?this.getBrush(B.HotPink):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"IndianRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.IndianRed)?this.sBrushes.getValue(B.IndianRed):t)?this.getBrush(B.IndianRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Indigo",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Indigo)?this.sBrushes.getValue(B.Indigo):t)?this.getBrush(B.Indigo):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Ivory",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Ivory)?this.sBrushes.getValue(B.Ivory):t)?this.getBrush(B.Ivory):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Khaki",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Khaki)?this.sBrushes.getValue(B.Khaki):t)?this.getBrush(B.Khaki):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Lavender",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Lavender)?this.sBrushes.getValue(B.Lavender):t)?this.getBrush(B.Lavender):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LavenderBlush",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LavenderBlush)?this.sBrushes.getValue(B.LavenderBlush):t)?this.getBrush(B.LavenderBlush):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LawnGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LawnGreen)?this.sBrushes.getValue(B.LawnGreen):t)?this.getBrush(B.LawnGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LemonChiffon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LemonChiffon)?this.sBrushes.getValue(B.LemonChiffon):t)?this.getBrush(B.LemonChiffon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightBlue)?this.sBrushes.getValue(B.LightBlue):t)?this.getBrush(B.LightBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightCoral",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightCoral)?this.sBrushes.getValue(B.LightCoral):t)?this.getBrush(B.LightCoral):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightCyan",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightCyan)?this.sBrushes.getValue(B.LightCyan):t)?this.getBrush(B.LightCyan):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightGoldenrodYellow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightGoldenrodYellow)?this.sBrushes.getValue(B.LightGoldenrodYellow):t)?this.getBrush(B.LightGoldenrodYellow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightGray)?this.sBrushes.getValue(B.LightGray):t)?this.getBrush(B.LightGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightGreen)?this.sBrushes.getValue(B.LightGreen):t)?this.getBrush(B.LightGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightPink",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightPink)?this.sBrushes.getValue(B.LightPink):t)?this.getBrush(B.LightPink):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSalmon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSalmon)?this.sBrushes.getValue(B.LightSalmon):t)?this.getBrush(B.LightSalmon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSeaGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSeaGreen)?this.sBrushes.getValue(B.LightSeaGreen):t)?this.getBrush(B.LightSeaGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSkyBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSkyBlue)?this.sBrushes.getValue(B.LightSkyBlue):t)?this.getBrush(B.LightSkyBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSlateGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSlateGray)?this.sBrushes.getValue(B.LightSlateGray):t)?this.getBrush(B.LightSlateGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSteelBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSteelBlue)?this.sBrushes.getValue(B.LightSteelBlue):t)?this.getBrush(B.LightSteelBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightYellow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightYellow)?this.sBrushes.getValue(B.LightYellow):t)?this.getBrush(B.LightYellow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Lime",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Lime)?this.sBrushes.getValue(B.Lime):t)?this.getBrush(B.Lime):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LimeGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LimeGreen)?this.sBrushes.getValue(B.LimeGreen):t)?this.getBrush(B.LimeGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Linen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Linen)?this.sBrushes.getValue(B.Linen):t)?this.getBrush(B.Linen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Magenta",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Magenta)?this.sBrushes.getValue(B.Magenta):t)?this.getBrush(B.Magenta):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Maroon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Maroon)?this.sBrushes.getValue(B.Maroon):t)?this.getBrush(B.Maroon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumAquamarine",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumAquamarine)?this.sBrushes.getValue(B.MediumAquamarine):t)?this.getBrush(B.MediumAquamarine):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumBlue)?this.sBrushes.getValue(B.MediumBlue):t)?this.getBrush(B.MediumBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumOrchid",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumOrchid)?this.sBrushes.getValue(B.MediumOrchid):t)?this.getBrush(B.MediumOrchid):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumPurple",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumPurple)?this.sBrushes.getValue(B.MediumPurple):t)?this.getBrush(B.MediumPurple):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumSeaGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumSeaGreen)?this.sBrushes.getValue(B.MediumSeaGreen):t)?this.getBrush(B.MediumSeaGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumSlateBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumSlateBlue)?this.sBrushes.getValue(B.MediumSlateBlue):t)?this.getBrush(B.MediumSlateBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumSpringGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumSpringGreen)?this.sBrushes.getValue(B.MediumSpringGreen):t)?this.getBrush(B.MediumSpringGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumTurquoise",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumTurquoise)?this.sBrushes.getValue(B.MediumTurquoise):t)?this.getBrush(B.MediumTurquoise):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumVioletRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumVioletRed)?this.sBrushes.getValue(B.MediumVioletRed):t)?this.getBrush(B.MediumVioletRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MidnightBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MidnightBlue)?this.sBrushes.getValue(B.MidnightBlue):t)?this.getBrush(B.MidnightBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MintCream",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MintCream)?this.sBrushes.getValue(B.MintCream):t)?this.getBrush(B.MintCream):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MistyRose",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MistyRose)?this.sBrushes.getValue(B.MistyRose):t)?this.getBrush(B.MistyRose):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Moccasin",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Moccasin)?this.sBrushes.getValue(B.Moccasin):t)?this.getBrush(B.Moccasin):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"NavajoWhite",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.NavajoWhite)?this.sBrushes.getValue(B.NavajoWhite):t)?this.getBrush(B.NavajoWhite):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Navy",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Navy)?this.sBrushes.getValue(B.Navy):t)?this.getBrush(B.Navy):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"OldLace",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.OldLace)?this.sBrushes.getValue(B.OldLace):t)?this.getBrush(B.OldLace):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Olive",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Olive)?this.sBrushes.getValue(B.Olive):t)?this.getBrush(B.Olive):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"OliveDrab",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.OliveDrab)?this.sBrushes.getValue(B.OliveDrab):t)?this.getBrush(B.OliveDrab):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Orange",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Orange)?this.sBrushes.getValue(B.Orange):t)?this.getBrush(B.Orange):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"OrangeRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.OrangeRed)?this.sBrushes.getValue(B.OrangeRed):t)?this.getBrush(B.OrangeRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Orchid",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Orchid)?this.sBrushes.getValue(B.Orchid):t)?this.getBrush(B.Orchid):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PaleGoldenrod",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PaleGoldenrod)?this.sBrushes.getValue(B.PaleGoldenrod):t)?this.getBrush(B.PaleGoldenrod):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PaleGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PaleGreen)?this.sBrushes.getValue(B.PaleGreen):t)?this.getBrush(B.PaleGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PaleTurquoise",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PaleTurquoise)?this.sBrushes.getValue(B.PaleTurquoise):t)?this.getBrush(B.PaleTurquoise):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PaleVioletRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PaleVioletRed)?this.sBrushes.getValue(B.PaleVioletRed):t)?this.getBrush(B.PaleVioletRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PapayaWhip",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PapayaWhip)?this.sBrushes.getValue(B.PapayaWhip):t)?this.getBrush(B.PapayaWhip):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PeachPuff",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PeachPuff)?this.sBrushes.getValue(B.PeachPuff):t)?this.getBrush(B.PeachPuff):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Peru",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Peru)?this.sBrushes.getValue(B.Peru):t)?this.getBrush(B.Peru):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Pink",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Pink)?this.sBrushes.getValue(B.Pink):t)?this.getBrush(B.Pink):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Plum",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Plum)?this.sBrushes.getValue(B.Plum):t)?this.getBrush(B.Plum):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PowderBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PowderBlue)?this.sBrushes.getValue(B.PowderBlue):t)?this.getBrush(B.PowderBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Purple",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Purple)?this.sBrushes.getValue(B.Purple):t)?this.getBrush(B.Purple):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Red",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Red)?this.sBrushes.getValue(B.Red):t)?this.getBrush(B.Red):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"RosyBrown",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.RosyBrown)?this.sBrushes.getValue(B.RosyBrown):t)?this.getBrush(B.RosyBrown):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"RoyalBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.RoyalBlue)?this.sBrushes.getValue(B.RoyalBlue):t)?this.getBrush(B.RoyalBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SaddleBrown",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SaddleBrown)?this.sBrushes.getValue(B.SaddleBrown):t)?this.getBrush(B.SaddleBrown):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Salmon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Salmon)?this.sBrushes.getValue(B.Salmon):t)?this.getBrush(B.Salmon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SandyBrown",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SandyBrown)?this.sBrushes.getValue(B.SandyBrown):t)?this.getBrush(B.SandyBrown):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SeaGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SeaGreen)?this.sBrushes.getValue(B.SeaGreen):t)?this.getBrush(B.SeaGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SeaShell",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SeaShell)?this.sBrushes.getValue(B.SeaShell):t)?this.getBrush(B.SeaShell):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Sienna",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Sienna)?this.sBrushes.getValue(B.Sienna):t)?this.getBrush(B.Sienna):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Silver",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Silver)?this.sBrushes.getValue(B.Silver):t)?this.getBrush(B.Silver):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SkyBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SkyBlue)?this.sBrushes.getValue(B.SkyBlue):t)?this.getBrush(B.SkyBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SlateBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SlateBlue)?this.sBrushes.getValue(B.SlateBlue):t)?this.getBrush(B.SlateBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SlateGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SlateGray)?this.sBrushes.getValue(B.SlateGray):t)?this.getBrush(B.SlateGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Snow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Snow)?this.sBrushes.getValue(B.Snow):t)?this.getBrush(B.Snow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SpringGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SpringGreen)?this.sBrushes.getValue(B.SpringGreen):t)?this.getBrush(B.SpringGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SteelBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SteelBlue)?this.sBrushes.getValue(B.SteelBlue):t)?this.getBrush(B.SteelBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Tan",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Tan)?this.sBrushes.getValue(B.Tan):t)?this.getBrush(B.Tan):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Teal",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Teal)?this.sBrushes.getValue(B.Teal):t)?this.getBrush(B.Teal):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Thistle",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Thistle)?this.sBrushes.getValue(B.Thistle):t)?this.getBrush(B.Thistle):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Tomato",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Tomato)?this.sBrushes.getValue(B.Tomato):t)?this.getBrush(B.Tomato):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Transparent",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Transparent)?this.sBrushes.getValue(B.Transparent):t)?this.getBrush(B.Transparent):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Turquoise",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Turquoise)?this.sBrushes.getValue(B.Turquoise):t)?this.getBrush(B.Turquoise):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Violet",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Violet)?this.sBrushes.getValue(B.Violet):t)?this.getBrush(B.Violet):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Wheat",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Wheat)?this.sBrushes.getValue(B.Wheat):t)?this.getBrush(B.Wheat):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"White",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.White)?this.sBrushes.getValue(B.White):t)?this.getBrush(B.White):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"WhiteSmoke",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.WhiteSmoke)?this.sBrushes.getValue(B.WhiteSmoke):t)?this.getBrush(B.WhiteSmoke):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Yellow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Yellow)?this.sBrushes.getValue(B.Yellow):t)?this.getBrush(B.Yellow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"YellowGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.YellowGreen)?this.sBrushes.getValue(B.YellowGreen):t)?this.getBrush(B.YellowGreen):t},enumerable:!0,configurable:!0}),x.getBrush=function(t){var e=this.getColorValue(t),e=new mt(e);return this.sBrushes.setValue(t,e),e},x.getColorValue=function(t){var e=new f;switch(t){case B.Transparent:e=new f(0,255,255,255);break;case B.AliceBlue:e=new f(255,240,248,255);break;case B.AntiqueWhite:e=new f(255,250,235,215);break;case B.Aqua:e=new f(255,0,255,255);break;case B.Aquamarine:e=new f(255,127,255,212);break;case B.Azure:e=new f(255,240,255,255);break;case B.Beige:e=new f(255,245,245,220);break;case B.Bisque:e=new f(255,255,228,196);break;case B.Black:e=new f(255,0,0,0);break;case B.BlanchedAlmond:e=new f(255,255,235,205);break;case B.Blue:e=new f(255,0,0,255);break;case B.BlueViolet:e=new f(255,138,43,226);break;case B.Brown:e=new f(255,165,42,42);break;case B.BurlyWood:e=new f(255,222,184,135);break;case B.CadetBlue:e=new f(255,95,158,160);break;case B.Chartreuse:e=new f(255,127,255,0);break;case B.Chocolate:e=new f(255,210,105,30);break;case B.Coral:e=new f(255,255,127,80);break;case B.CornflowerBlue:e=new f(255,100,149,237);break;case B.Cornsilk:e=new f(255,255,248,220);break;case B.Crimson:e=new f(255,220,20,60);break;case B.Cyan:e=new f(255,0,255,255);break;case B.DarkBlue:e=new f(255,0,0,139);break;case B.DarkCyan:e=new f(255,0,139,139);break;case B.DarkGoldenrod:e=new f(255,184,134,11);break;case B.DarkGray:e=new f(255,169,169,169);break;case B.DarkGreen:e=new f(255,0,100,0);break;case B.DarkKhaki:e=new f(255,189,183,107);break;case B.DarkMagenta:e=new f(255,139,0,139);break;case B.DarkOliveGreen:e=new f(255,85,107,47);break;case B.DarkOrange:e=new f(255,255,140,0);break;case B.DarkOrchid:e=new f(255,153,50,204);break;case B.DarkRed:e=new f(255,139,0,0);break;case B.DarkSalmon:e=new f(255,233,150,122);break;case B.DarkSeaGreen:e=new f(255,143,188,139);break;case B.DarkSlateBlue:e=new f(255,72,61,139);break;case B.DarkSlateGray:e=new f(255,47,79,79);break;case B.DarkTurquoise:e=new f(255,0,206,209);break;case B.DarkViolet:e=new f(255,148,0,211);break;case B.DeepPink:e=new f(255,255,20,147);break;case B.DeepSkyBlue:e=new f(255,0,191,255);break;case B.DimGray:e=new f(255,105,105,105);break;case B.DodgerBlue:e=new f(255,30,144,255);break;case B.Firebrick:e=new f(255,178,34,34);break;case B.FloralWhite:e=new f(255,255,250,240);break;case B.ForestGreen:e=new f(255,34,139,34);break;case B.Fuchsia:e=new f(255,255,0,255);break;case B.Gainsboro:e=new f(255,220,220,220);break;case B.GhostWhite:e=new f(255,248,248,255);break;case B.Gold:e=new f(255,255,215,0);break;case B.Goldenrod:e=new f(255,218,165,32);break;case B.Gray:e=new f(255,128,128,128);break;case B.Green:e=new f(255,0,128,0);break;case B.GreenYellow:e=new f(255,173,255,47);break;case B.Honeydew:e=new f(255,240,255,240);break;case B.HotPink:e=new f(255,255,105,180);break;case B.IndianRed:e=new f(255,205,92,92);break;case B.Indigo:e=new f(255,75,0,130);break;case B.Ivory:e=new f(255,255,255,240);break;case B.Khaki:e=new f(255,240,230,140);break;case B.Lavender:e=new f(255,230,230,250);break;case B.LavenderBlush:e=new f(255,255,240,245);break;case B.LawnGreen:e=new f(255,124,252,0);break;case B.LemonChiffon:e=new f(255,255,250,205);break;case B.LightBlue:e=new f(255,173,216,230);break;case B.LightCoral:e=new f(255,240,128,128);break;case B.LightCyan:e=new f(255,224,255,255);break;case B.LightGoldenrodYellow:e=new f(255,250,250,210);break;case B.LightGreen:e=new f(255,144,238,144);break;case B.LightGray:e=new f(255,211,211,211);break;case B.LightPink:e=new f(255,255,182,193);break;case B.LightSalmon:e=new f(255,255,160,122);break;case B.LightSeaGreen:e=new f(255,32,178,170);break;case B.LightSkyBlue:e=new f(255,135,206,250);break;case B.LightSlateGray:e=new f(255,119,136,153);break;case B.LightSteelBlue:e=new f(255,176,196,222);break;case B.LightYellow:e=new f(255,255,255,224);break;case B.Lime:e=new f(255,0,255,0);break;case B.LimeGreen:e=new f(255,50,205,50);break;case B.Linen:e=new f(255,250,240,230);break;case B.Magenta:e=new f(255,255,0,255);break;case B.Maroon:e=new f(255,128,0,0);break;case B.MediumAquamarine:e=new f(255,102,205,170);break;case B.MediumBlue:e=new f(255,0,0,205);break;case B.MediumOrchid:e=new f(255,186,85,211);break;case B.MediumPurple:e=new f(255,147,112,219);break;case B.MediumSeaGreen:e=new f(255,60,179,113);break;case B.MediumSlateBlue:e=new f(255,123,104,238);break;case B.MediumSpringGreen:e=new f(255,0,250,154);break;case B.MediumTurquoise:e=new f(255,72,209,204);break;case B.MediumVioletRed:e=new f(255,199,21,133);break;case B.MidnightBlue:e=new f(255,25,25,112);break;case B.MintCream:e=new f(255,245,255,250);break;case B.MistyRose:e=new f(255,255,228,225);break;case B.Moccasin:e=new f(255,255,228,181);break;case B.NavajoWhite:e=new f(255,255,222,173);break;case B.Navy:e=new f(255,0,0,128);break;case B.OldLace:e=new f(255,253,245,230);break;case B.Olive:e=new f(255,128,128,0);break;case B.OliveDrab:e=new f(255,107,142,35);break;case B.Orange:e=new f(255,255,165,0);break;case B.OrangeRed:e=new f(255,255,69,0);break;case B.Orchid:e=new f(255,218,112,214);break;case B.PaleGoldenrod:e=new f(255,238,232,170);break;case B.PaleGreen:e=new f(255,152,251,152);break;case B.PaleTurquoise:e=new f(255,175,238,238);break;case B.PaleVioletRed:e=new f(255,219,112,147);break;case B.PapayaWhip:e=new f(255,255,239,213);break;case B.PeachPuff:e=new f(255,255,218,185);break;case B.Peru:e=new f(255,205,133,63);break;case B.Pink:e=new f(255,255,192,203);break;case B.Plum:e=new f(255,221,160,221);break;case B.PowderBlue:e=new f(255,176,224,230);break;case B.Purple:e=new f(255,128,0,128);break;case B.Red:e=new f(255,255,0,0);break;case B.RosyBrown:e=new f(255,188,143,143);break;case B.RoyalBlue:e=new f(255,65,105,225);break;case B.SaddleBrown:e=new f(255,139,69,19);break;case B.Salmon:e=new f(255,250,128,114);break;case B.SandyBrown:e=new f(255,244,164,96);break;case B.SeaGreen:e=new f(255,46,139,87);break;case B.SeaShell:e=new f(255,255,245,238);break;case B.Sienna:e=new f(255,160,82,45);break;case B.Silver:e=new f(255,192,192,192);break;case B.SkyBlue:e=new f(255,135,206,235);break;case B.SlateBlue:e=new f(255,106,90,205);break;case B.SlateGray:e=new f(255,112,128,144);break;case B.Snow:e=new f(255,255,250,250);break;case B.SpringGreen:e=new f(255,0,255,127);break;case B.SteelBlue:e=new f(255,70,130,180);break;case B.Tan:e=new f(255,210,180,140);break;case B.Teal:e=new f(255,0,128,128);break;case B.Thistle:e=new f(255,216,191,216);break;case B.Tomato:e=new f(255,255,99,71);break;case B.Turquoise:e=new f(255,64,224,208);break;case B.Violet:e=new f(255,238,130,238);break;case B.Wheat:e=new f(255,245,222,179);break;case B.White:e=new f(255,255,255,255);break;case B.WhiteSmoke:e=new f(255,245,245,245);break;case B.Yellow:e=new f(255,255,255,0);break;case B.YellowGreen:e=new f(255,154,205,50)}return e},x.sBrushes=new a;var O=x;function x(){}Object.defineProperty(uo.prototype,"factors",{get:function(){return this.mFactors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Factors");this.mFactors=t},enumerable:!0,configurable:!0}),Object.defineProperty(uo.prototype,"positions",{get:function(){return this.mPositions},set:function(t){for(var e=t,i=0;i<e.length;i++)(e[i]<0||1<e[i])&&(e[i]=0);this.mPositions=e,this.mPositions=t},enumerable:!0,configurable:!0}),Object.defineProperty(uo.prototype,"count",{get:function(){return this.mCount},enumerable:!0,configurable:!0}),uo.prototype.generateColorBlend=function(t,e){if(null==t)throw new Error("ArgumentNullException : colours");null==this.positions&&(this.positions=[0]);var i=new fo(this.count),r=this.positions,n=null;if(1===r.length)(r=[3])[0]=0,r[1]=this.positions[0],r[2]=1,(n=new Array(3))[0]=t[0],n[1]=t[0],n[2]=t[1];else for(var o=t[0],s=t[1],n=new Array(this.count),a=0,h=this.count,a=0;a<h;++a)n[a]=this.interpolate(this.mFactors[a],o,s,e);return i.positions=r,i.colors=n,i},uo.prototype.clonePdfBlend=function(){return null!=this.mFactors&&(this.factors=this.mFactors),null!=this.positions&&(this.positions=this.positions),this},uo.prototype.gcd=function(t,e){if("number"==typeof t&&"number"==typeof e&&void 0!==e){if(t<0||1<t)throw new Error("ArgumentOutOfRangeException : u");if(e<0||1<e)throw new Error("ArgumentOutOfRangeException : v");var i=Math.max(1,t*this.precision),e=Math.max(1,e*this.precision);return this.gcdInt(i,e)/this.precision}var r=t;if(null==r)throw new Error("ArgumentNullException : values");if(r.length<1)throw new Error("ArgumentException : Not enough values in the array. - values");var n=r[0];if(1<r.length)for(var o=r.length,s=1;s<o&&(n=this.gcd(r[s],n))!==1/this.precision;++s);return n},uo.prototype.gcdInt=function(t,e){if(t<=0)throw new Error("ArgumentOutOfRangeException"+t+"The arguments cannot be less or equal to zero.");if(e<=0)throw new Error("ArgumentOutOfRangeException"+e+"The arguments cannot be less or equal to zero.");if(1===t||1===e)return 1;for(var i,r=0;this.isEven(t,e);)++r,t>>=1,e>>=1;for(;(1&t)<=0;)t>>=1;do{for(;(1&e)<=0;)e>>=1}while(e<t&&(i=e,e=t,t=i),0!==(e-=t));return t<<r},uo.prototype.isEven=function(t,e){return"number"==typeof e&&void 0!==e?(1&t)<=0&&(1&e)<=0:(1&t)<=0},uo.prototype.interpolate=function(t,e,i,r){if(e instanceof f){var n=new f;switch(r){case Y.PdfColorSpace.Rgb:var o=this.interpolate(t,e.red,i.red),s=this.interpolate(t,e.green,i.green),a=this.interpolate(t,e.blue,i.blue),n=new f(o,s,a);break;case Y.PdfColorSpace.GrayScale:o=this.interpolate(t,e.gray,i.gray);n=new f(o);break;case Y.PdfColorSpace.Cmyk:var s=this.interpolate(t,e.c,i.c),a=this.interpolate(t,e.m,i.m),o=this.interpolate(t,e.y,i.y),h=this.interpolate(t,e.k,i.k);n=new f(s,a,o,h)}return n}return 0===t?e:1===t?i:e+ +t*(i-e)};var lo=uo;function uo(t){this.precision=1e3}co=function(t,e){return(co=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}co(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(go,po=lo),Object.defineProperty(go.prototype,"colors",{get:function(){return this.mcolors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Colors");this.mcolors=t},enumerable:!0,configurable:!0}),go.prototype.getFunction=function(t){var e,i,r,n,o=this.getColorComponentsCount(t),s=this.getMaxComponentValue(t),o=this.setRange(o,s),a=null;return null==this.mbrush&&void 0===this.mbrush?(e=[1],r=void 0,i=1,r=2===this.positions.length?2:(n=this.positions,n=this.getIntervals(n),1/(i=this.gcd(n))+1),e[0]=r,n=this.getSamplesValues(t,r,s,i),new ao([0,1],o,e,n)):a},go.prototype.cloneColorBlend=function(){return null!=this.mcolors&&void 0!==this.mcolors&&(this.colors=this.mcolors),null!=this.positions&&void 0!==this.positions&&(this.positions=this.positions),this},go.prototype.setRange=function(t,e){for(var i=[2*t],r=0;r<t;++r)i[2*r]=0,i[2*r+1]=1;return i},go.prototype.getColorComponentsCount=function(t){var e=0;switch(t){case Y.PdfColorSpace.Rgb:e=3;break;case Y.PdfColorSpace.Cmyk:e=4;break;case Y.PdfColorSpace.GrayScale:e=1;break;default:throw new Error("ArgumentException - Unsupported color space: "+t+" colorSpace")}return e},go.prototype.getSamplesValues=function(t,e,i,r){var n;switch(t){case Y.PdfColorSpace.GrayScale:n=this.getGrayscaleSamples(e,i,r);break;case Y.PdfColorSpace.Cmyk:n=this.getCmykSamples(e,i,r);break;case Y.PdfColorSpace.Rgb:n=this.getRgbSamples(e,i,r);break;default:throw new Error("ArgumentException - Unsupported color space: "+t+" colorSpace")}return n},go.prototype.getGrayscaleSamples=function(t,e,i){for(var r=[2*t],n=0;n<t;++n)this.getNextColor(n,i,Y.PdfColorSpace.GrayScale);return r},go.prototype.getRgbSamples=function(t,e,i){for(var r=[3*t],n=0;n<t;++n){var o=this.getNextColor(n,i,Y.PdfColorSpace.Rgb),s=3*n;r[s]=o.r,r[1+s]=o.g,r[2+s]=o.b}return r},go.prototype.getCmykSamples=function(t,e,i){for(var r=[4*t],n=0;n<t;n++){var o=this.getNextColor(n,i,Y.PdfColorSpace.Cmyk),s=4*n;r[s]=o.c*e,r[1+s]=o.m*e,r[2+s]=o.y*e,r[3+s]=o.k*e}return r},go.prototype.getNextColor=function(t,e,i){var r,n,e=e*t,t=this.getIndices(e,void 0,void 0),o=t.indexLow,t=t.indexHi;return o===t?this.mcolors[o]:(r=this.positions[o],n=this.positions[t],o=this.mcolors[o],t=this.mcolors[t],this.interpolate((e-r)/(n-r),o,t,i))},go.prototype.getIndices=function(t,e,i){for(var r=this.positions,n=i=e=0;n<this.mcolors.length;++n){var o=r[n];if(o===t){e=i=n;break}if(t<o){i=n;break}i=e=n}return{indexLow:e,indexHi:i}},go.prototype.getMaxComponentValue=function(t){var e=0;switch(t){case Y.PdfColorSpace.Cmyk:case Y.PdfColorSpace.Rgb:e=255;break;case Y.PdfColorSpace.GrayScale:e=65535;break;default:throw new Error("ArgumentException - Unsupported color space: "+t+"colorSpace")}return e},go.prototype.getIntervals=function(t){for(var e=t.length,i=[e-1],r=t[0],n=1;n<e;++n){var o=t[n];i[n-1]=o-r,r=o}return i};var co,po,fo=go;function go(t){var e=po.call(this)||this;return e="number"==typeof t?po.call(this,t)||this:e}mo=function(t,e){return(mo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}mo(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(wo,yo=xi),wo.prototype.initialize=function(t,e){this.mColours=[t,e],this.mColourBlend=new fo(2),this.mColourBlend.positions=[0,1],this.mColourBlend.colors=this.mColours,this.initShading()},Object.defineProperty(wo.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColours)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"interpolationColors",{get:function(){return this.mColourBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColours=null,this.mColourBlend=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"linearColors",{get:function(){return this.mColours},set:function(t){if(null==t)throw new Error("ArgumentNullException : LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small - LinearColors");null==this.mColours&&void 0===this.mColours?this.mColours=[t[0],t[1]]:(this.mColours[0]=t[0],this.mColours[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlend=new fo(2),this.mColourBlend.colors=this.mColours,this.mColourBlend.positions=[0,1]):this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"rectangle",{get:function(){return this.mBoundaries},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"extend",{get:function(){var t,e=no.None,i=this.shading.items.getValue(this.mDictionaryProperties.extend);return null!=i&&(t=i.items(0),i=i.items(1),t.value&&(e|=no.Start),i.value)&&(e|=no.End),e},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r?(e=new zt(!1),i=new zt(!1),(r=new p).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),r.items(1))},enumerable:!0,configurable:!0}),wo.prototype.addPoints=function(t,e){var i=t.x+e.x,t=t.y+e.y;return new X(i,t)},wo.prototype.subPoints=function(t,e){var i=t.x-e.x,t=t.y-e.y;return new X(i,t)},wo.prototype.mulPoints=function(t,e){return t.x*e.x+t.y*e.y},wo.prototype.mulPoint=function(t,e){return t.x=t.x*e,t.y=t.y*e,t},wo.prototype.choosePoint=function(t){var e=new X(0,0);if(t<90&&0<t)e=new X(this.mBoundaries.right,this.mBoundaries.bottom);else if(t<180&&90<t)e=new X(this.mBoundaries.left,this.mBoundaries.bottom);else if(t<270&&180<t)e=new X(this.mBoundaries.left,this.mBoundaries.top);else{if(!(270<t))throw new Error("PdfException - Internal error.");e=new X(this.mBoundaries.right,this.mBoundaries.top)}return e},wo.prototype.setPoints=function(t,e){var i=new p;i.add(new u(t.x)),i.add(new u(this.updateY(t.y))),i.add(new u(e.x)),i.add(new u(this.updateY(e.y))),this.shading.items.setValue(this.mDictionaryProperties.coords,i)},wo.prototype.updateY=function(t){return 0!==t?-t:t},wo.prototype.initShading=function(){this.colorSpace=Y.PdfColorSpace.Rgb,this.function=this.mColourBlend.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new u(so.Axial))},wo.prototype.clone=function(){var t=this;return t.resetPatternDictionary(new c(this.patternDictionary)),t.shading=new c,t.initShading(),t.setPoints(t.mPointStart,t.mPointEnd),null!==t&&t instanceof wo&&null!=this.matrix&&void 0!==this.matrix&&(t.matrix=this.matrix.clone()),null!=this.mColours&&void 0!==this.mColours&&(t.mColours=this.mColours),null!=this.blend&&void 0!==this.blend?t.blend=this.blend.clonePdfBlend():null!=this.interpolationColors&&void 0!==this.interpolationColors&&(t.interpolationColors=this.interpolationColors.cloneColorBlend()),t.extend=this.extend,this.cloneBackgroundValue(t),this.cloneAntiAliasingValue(t),t},wo.prototype.resetFunction=function(){this.function=this.mColourBlend.getFunction(this.colorSpace)};var mo,yo,bo=wo;function wo(t,e,i,r){var n,o,s,a=yo.call(this,new c)||this;if(a.mDictionaryProperties=new l,t instanceof X&&e instanceof X&&i instanceof f&&r instanceof f)a.initialize(i,r),a.mPointStart=t,a.mPointEnd=e,a.setPoints(a.mPointStart,a.mPointEnd);else if(t instanceof ut)if(a.initialize(e,i),r===oo.BackwardDiagonal||r===oo.ForwardDiagonal||r===oo.Horizontal||r===oo.Vertical){switch(a.mBoundaries=t,r){case oo.BackwardDiagonal:a.mPointStart=new X(t.right,t.top),a.mPointEnd=new X(t.left,t.bottom);break;case oo.ForwardDiagonal:a.mPointStart=new X(t.left,t.top),a.mPointEnd=new X(t.right,t.bottom);break;case oo.Horizontal:a.mPointStart=new X(t.left,t.top),a.mPointEnd=new X(t.right,t.top);break;case oo.Vertical:a.mPointStart=new X(t.left,t.top),a.mPointEnd=new X(t.left,t.bottom);break;default:throw new Error("ArgumentException -- Unsupported linear gradient mode: "+r+" mode")}a.setPoints(a.mPointStart,a.mPointEnd)}else"number"==typeof r&&void 0!==r&&(a.mBoundaries=t,0===(r%=360)?(a.mPointStart=new X(t.left,t.top),a.mPointEnd=new X(t.right,t.top)):90===r?(a.mPointStart=new X(t.left,t.top),a.mPointEnd=new X(t.left,t.bottom)):180===r?(a.mPointEnd=new X(t.left,t.top),a.mPointStart=new X(t.right,t.top)):270===r?(a.mPointEnd=new X(t.left,t.top),a.mPointStart=new X(t.left,t.bottom)):(e=r*(Math.PI/180),i=Math.tan(e),o=a.mBoundaries.left+(a.mBoundaries.right-a.mBoundaries.left)/2,s=a.mBoundaries.top+(a.mBoundaries.bottom-a.mBoundaries.top)/2,n=new X(o,s),s=i*(o=a.mBoundaries.width/(2*Math.cos(e))),o+=n.x,s+=n.y,i=new X(o,s),e=a.subPoints(i,n),o=a.choosePoint(r),s=a.mulPoints(a.subPoints(o,n),e)/a.mulPoints(e,e),a.mPointEnd=a.addPoints(n,a.mulPoint(e,s)),a.mPointStart=a.addPoints(n,a.mulPoint(e,-1*s))),a.setPoints(a.mPointEnd,a.mPointStart));return a}Po=function(t,e){return(Po=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Po(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Co,So=xi),Co.prototype.initialize=function(t,e){this.mColour=[t,e],this.mColourBlends=new fo(2),this.mColourBlends.positions=[0,1],this.mColourBlends.colors=this.mColour,this.initShading()},Object.defineProperty(Co.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColour&&void 0===this.mColour)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(Co.prototype,"interpolationColors",{get:function(){return this.mColourBlends},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColour=null,this.mColourBlends=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(Co.prototype,"linearColors",{get:function(){return this.mColour},set:function(t){if(null==t)throw new Error("ArgumentNullException : radial LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small LinearColors");null==this.mColour&&void 0===this.mColour?this.mColour=[t[0],t[1]]:(this.mColour[0]=t[0],this.mColour[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlends=new fo(2),this.mColourBlends.colors=this.mColour,this.mColourBlends.positions=[0,1]):this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(Co.prototype,"rectangle",{get:function(){return this.mBoundaries},set:function(t){this.mBoundaries=t,this.bBox=p.fromRectangle(t)},enumerable:!0,configurable:!0}),Object.defineProperty(Co.prototype,"extend",{get:function(){var t,e=no.None,i=this.shading.items.getValue(this.mDictionaryProperties.extend);return null!=i&&(t=i.items(0),i=i.items(1),t.value&&(e|=no.Start),i.value)&&(e|=no.End),e},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r&&void 0===r?(e=new zt(!1),i=new zt(!1),(r=new p).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),r.items(1))},enumerable:!0,configurable:!0}),Co.prototype.setPoints=function(t,e,i,r){var n=new p;n.add(new u(t.x)),n.add(new u(this.updateY(t.y))),n.add(new u(i)),n.add(new u(e.x)),n.add(new u(this.updateY(e.y))),i!==r?n.add(new u(r)):n.add(new u(0)),this.shading.items.setValue(this.mDictionaryProperties.coords,n)},Co.prototype.updateY=function(t){return 0!==t?-t:t},Co.prototype.initShading=function(){this.colorSpace=Y.PdfColorSpace.Rgb,this.function=this.mColourBlends.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new u(so.Radial))},Co.prototype.clone=function(){var t=this;return t.resetPatternDictionary(new c(this.patternDictionary)),t.shading=new c,t.initShading(),t.setPoints(this.mPointStart,this.mPointEnd,this.mRadiusStart,this.mRadiusEnd),t instanceof Co&&null!==this.matrix&&void 0!==this.matrix&&(t.matrix=this.matrix.clone()),null!==this.mColour&&void 0!==this.mColour&&(t.mColour=this.mColour),null!==this.blend&&void 0!==this.blend?t.blend=this.blend.clonePdfBlend():null!==this.interpolationColors&&void 0!==this.interpolationColors&&(t.interpolationColors=this.interpolationColors.cloneColorBlend()),t.extend=this.extend,this.cloneBackgroundValue(t),this.cloneAntiAliasingValue(t),t},Co.prototype.resetFunction=function(){this.function=this.mColourBlends.getFunction(this.colorSpace)};var Po,So,vo=Co;function Co(t,e,i,r,n,o){var s=So.call(this,new c)||this;if(s.mDictionaryProperties=new l,s.initialize(n,o),e<0)throw new Error("ArgumentOutOfRangeException : radiusStart - The radius cannot be less then zero.");if(r<0)throw new Error("ArgumentOutOfRangeException : radiusEnd - The radius cannpt be less then zero.");return s.mPointEnd=i,s.mPointStart=t,s.mRadiusStart=e,s.mRadiusEnd=r,s.setPoints(s.mPointStart,s.mPointEnd,s.mRadiusStart,s.mRadiusEnd),s}(L=Y.PdfBorderOverlapStyle||(Y.PdfBorderOverlapStyle={}))[L.Overlap=0]="Overlap",L[L.Inside=1]="Inside";Bo=function(t,e){return(Bo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Bo,L=function(t,e){function i(){this.constructor=t}Bo(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},Oo=(Object.defineProperty(xo.prototype,"backgroundBrush",{get:function(){return this.gridBackgroundBrush},set:function(t){this.gridBackgroundBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(xo.prototype,"textBrush",{get:function(){return this.gridTextBrush},set:function(t){this.gridTextBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(xo.prototype,"textPen",{get:function(){return this.gridTextPen},set:function(t){this.gridTextPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(xo.prototype,"font",{get:function(){return this.gridFont},set:function(t){this.gridFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(xo.prototype,"backgroundImage",{get:function(){return this.gridBackgroundImage},set:function(t){this.gridBackgroundImage=t},enumerable:!0,configurable:!0}),xo);function xo(){}L(jo,Lo=Oo),Object.defineProperty(jo.prototype,"cellSpacing",{get:function(){return void 0===this.gridCellSpacing&&(this.gridCellSpacing=0),this.gridCellSpacing},set:function(t){this.gridCellSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(jo.prototype,"horizontalOverflowType",{get:function(){return this.gridHorizontalOverflowType},set:function(t){this.gridHorizontalOverflowType=t},enumerable:!0,configurable:!0}),Object.defineProperty(jo.prototype,"allowHorizontalOverflow",{get:function(){return this.bAllowHorizontalOverflow},set:function(t){this.bAllowHorizontalOverflow=t},enumerable:!0,configurable:!0}),Object.defineProperty(jo.prototype,"cellPadding",{get:function(){return void 0===this.gridCellPadding&&(this.gridCellPadding=new sn),this.gridCellPadding},set:function(t){void 0===this.gridCellPadding&&(this.gridCellPadding=new sn),this.gridCellPadding=t},enumerable:!0,configurable:!0}),Object.defineProperty(jo.prototype,"borderOverlapStyle",{get:function(){return this.gridBorderOverlapStyle},set:function(t){this.gridBorderOverlapStyle=t},enumerable:!0,configurable:!0});var Lo,To=jo;function jo(){var t=Lo.call(this)||this;return t.gridBorderOverlapStyle=Y.PdfBorderOverlapStyle.Overlap,t.bAllowHorizontalOverflow=!1,t.gridHorizontalOverflowType=Y.PdfHorizontalOverflowType.LastPage,t}L(Ro,ko=Oo),Object.defineProperty(Ro.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ro.prototype,"borders",{get:function(){return this.gridCellBorders},set:function(t){this.gridCellBorders=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ro.prototype,"cellPadding",{get:function(){return this.gridCellPadding},set:function(t){null!=this.gridCellPadding&&void 0!==this.gridCellPadding||(this.gridCellPadding=new sn),this.gridCellPadding=t},enumerable:!0,configurable:!0});var ko,Vo=Ro;function Ro(){var t=ko.call(this)||this;return t.gridCellBorders=nn.default,t}Object.defineProperty(Do.prototype,"backgroundBrush",{get:function(){return this.gridRowBackgroundBrush},enumerable:!0,configurable:!0}),Do.prototype.setBackgroundBrush=function(t){if(this.gridRowBackgroundBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.backgroundBrush=t},Object.defineProperty(Do.prototype,"textBrush",{get:function(){return this.gridRowTextBrush},enumerable:!0,configurable:!0}),Do.prototype.setTextBrush=function(t){if(this.gridRowTextBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textBrush=t},Object.defineProperty(Do.prototype,"textPen",{get:function(){return this.gridRowTextPen},enumerable:!0,configurable:!0}),Do.prototype.setTextPen=function(t){if(this.gridRowTextPen=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textPen=t},Object.defineProperty(Do.prototype,"font",{get:function(){return this.gridRowFont},enumerable:!0,configurable:!0}),Do.prototype.setFont=function(t){if(this.gridRowFont=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.font=t},Object.defineProperty(Do.prototype,"border",{get:function(){return void 0===this.gridRowBorder&&this.setBorder(new nn),this.gridRowBorder},enumerable:!0,configurable:!0}),Do.prototype.setBorder=function(t){if(this.gridRowBorder=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.borders=t},Do.prototype.setParent=function(t){this.parent=t},Object.defineProperty(Do.prototype,"backgroundImage",{get:function(){return this.gridRowBackgroundImage},enumerable:!0,configurable:!0}),Do.prototype.setBackgroundImage=function(t){this.gridRowBackgroundImage=t};var Mo=Do;function Do(){}(L=Y.PdfHorizontalOverflowType||(Y.PdfHorizontalOverflowType={}))[L.NextPage=0]="NextPage",L[L.LastPage=1]="LastPage";Object.defineProperty(T.prototype,"isCellMergeContinue",{get:function(){return this.internalIsCellMergeContinue},set:function(t){this.internalIsCellMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"isRowMergeContinue",{get:function(){return this.internalIsRowMergeContinue},set:function(t){this.internalIsRowMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"isCellMergeStart",{get:function(){return this.internalIsCellMergeStart},set:function(t){this.internalIsCellMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"isRowMergeStart",{get:function(){return this.internalIsRowMergeStart},set:function(t){this.internalIsRowMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"remainingString",{get:function(){return this.remaining},set:function(t){this.remaining=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"FinishedDrawingCell",{get:function(){return this.isFinish},set:function(t){this.isFinish=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"stringFormat",{get:function(){return null==this.format&&(this.format=new bt),this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"row",{get:function(){return this.gridRow},set:function(t){this.gridRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"value",{get:function(){return this.objectValue},set:function(t){if(this.objectValue=t,this.objectValue instanceof Jo){this.row.grid.isSingleGrid=!1;(this.objectValue.ParentCell=this).objectValue.isChildGrid=!0;for(var e=this.row.grid.rows.count,i=0;i<e;i++)for(var r=this.row.grid.rows.getRow(i),n=r.cells.count,o=0;o<n;o++)r.cells.getCell(o).parent=this}},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"rowSpan",{get:function(){return this.gridRowSpan},set:function(t){if(t<1)throw new Error("ArgumentException : Invalid span specified, must be greater than or equal to 1");this.gridRowSpan=t,this.row.rowSpanExists=!0,this.row.grid.hasRowSpanSpan=!0},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"style",{get:function(){return null==this.cellStyle&&(this.cellStyle=new Vo),this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(t){this.cellHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"columnSpan",{get:function(){return this.colSpan},set:function(t){if(t<1)throw Error("Invalid span specified, must be greater than or equal to 1");this.colSpan=t,this.row.columnSpanExists=!0},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"width",{get:function(){return 0!==this.cellWidth&&!this.row.grid.isComplete||(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(t){this.cellWidth=t},enumerable:!0,configurable:!0}),T.prototype.measureWidth=function(){var t,e=0,i=new vt;return"string"==typeof this.objectValue?e=(e+=i.layout(this.objectValue,this.getTextFont(),this.stringFormat,new J(Number.MAX_VALUE,Number.MAX_VALUE),!1,new J(0,0)).actualSize.width)+2*(this.style.borders.left.width+this.style.borders.right.width):this.objectValue instanceof Jo?e=this.objectValue.size.width:this.objectValue instanceof ke||this.objectValue instanceof De?e+=this.objectValue.width:this.objectValue instanceof Tn&&(t=this.objectValue,e=(e+=i.layout(t.text,t.font,t.stringFormat,new J(0,0),!1,new J(0,0)).actualSize.width)+2*(this.style.borders.left.width+this.style.borders.right.width)),this.objectValue instanceof Jo?null!=this.style.cellPadding||void 0!==this.style.cellPadding?(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(e+=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(e+=this.style.cellPadding.right)):(void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(e+=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(e+=this.row.grid.style.cellPadding.right)):null!=this.style.cellPadding?e+=this.style.cellPadding.left+this.style.cellPadding.right:e+=this.row.grid.style.cellPadding.left+this.row.grid.style.cellPadding.right,e+=this.row.grid.style.cellSpacing},T.prototype.drawCellBackground=function(t,e){var i=this.getBackgroundBrush();null!=i&&(t.save(),t.drawRectangle(i,e.x,e.y,e.width,e.height),t.restore()),null!=this.style.backgroundImage&&(this.getBackgroundImage(),t.drawImage(this.style.backgroundImage,e.x,e.y,e.width,e.height))},T.prototype.adjustContentLayoutArea=function(t){var e,i,r,n,t=new Z(t.x,t.y,t.width,t.height);return this.objectValue instanceof Jo?(null==this.style.cellPadding||void 0===this.style.cellPadding?null!==this.gridRow.grid.style.cellPadding&&void 0!==this.gridRow.grid.style.cellPadding&&(n=this.gridRow.grid.style.cellPadding.hasLeftPad,e=this.gridRow.grid.style.cellPadding.hasTopPad,i=this.gridRow.grid.style.cellPadding.hasRightPad,r=this.gridRow.grid.style.cellPadding.hasBottomPad,n||e||i||r)?(void 0!==this.gridRow.grid.style.cellPadding.left&&n&&(t.x+=this.gridRow.grid.style.cellPadding.left+this.cellStyle.borders.left.width,t.width-=this.gridRow.grid.style.cellPadding.left),void 0!==this.gridRow.grid.style.cellPadding.top&&e&&(t.y+=this.gridRow.grid.style.cellPadding.top+this.cellStyle.borders.top.width,t.height-=this.gridRow.grid.style.cellPadding.top),void 0!==this.gridRow.grid.style.cellPadding.right&&i&&(t.width-=this.gridRow.grid.style.cellPadding.right),void 0!==this.gridRow.grid.style.cellPadding.bottom&&r&&(t.height-=this.gridRow.grid.style.cellPadding.bottom)):null!==(n=this.getStringFormat()).alignment&&void 0!==n.alignment||(t.x+=this.row.grid.style.cellPadding.left,t.y+=this.row.grid.style.cellPadding.top):(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(t.x+=this.style.cellPadding.left+this.cellStyle.borders.left.width,t.width-=this.style.cellPadding.left),void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(t.y+=this.style.cellPadding.top+this.cellStyle.borders.top.width,t.height-=this.style.cellPadding.top),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(t.width-=this.style.cellPadding.right),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(t.height-=this.style.cellPadding.bottom)),t.width-=this.cellStyle.borders.left.width+this.cellStyle.borders.right.width,t.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width):(void 0===this.style.cellPadding||null==this.style.cellPadding?(t.x+=this.gridRow.grid.style.cellPadding.left,t.y+=this.gridRow.grid.style.cellPadding.top,t.width-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left,t.height-=this.gridRow.grid.style.cellPadding.bottom+this.gridRow.grid.style.cellPadding.top):(t.x+=this.style.cellPadding.left,t.y+=this.style.cellPadding.top,t.width-=this.style.cellPadding.right+this.style.cellPadding.left,t.height-=this.style.cellPadding.bottom+this.style.cellPadding.top,1===this.rowSpan&&(t.width-=this.style.borders.left.width)),void 0===this.style.borders||null==this.style.borders?(t.x+=this.gridRow.style.border.left.width,t.y+=this.gridRow.style.border.top.width,t.width-=this.gridRow.style.border.left.width+this.gridRow.style.border.right.width,t.height-=this.gridRow.style.border.top.width+this.gridRow.style.border.bottom.width):(t.x+=this.style.borders.left.width,t.y+=this.style.borders.top.width,t.width-=this.style.borders.left.width+this.style.borders.right.width,t.height-=this.style.borders.top.width+this.style.borders.bottom.width,1===this.rowSpan&&(t.width-=this.style.borders.left.width))),t},T.prototype.draw=function(t,e,i){var r=null;if(this.internalIsCellMergeContinue||this.internalIsRowMergeContinue){if(!this.internalIsCellMergeContinue||!this.row.grid.style.allowHorizontalOverflow)return r;if(0<this.row.rowOverflowIndex&&this.row.cells.indexOf(this)!=this.row.rowOverflowIndex+1||0==this.row.rowOverflowIndex&&this.internalIsCellMergeContinue)return r}e=this.adjustOuterLayoutArea(e,t),this.drawCellBackground(t,e);var n,o,s,a,h,l=this.getTextPen(),u=this.getTextBrush(),c=(void 0===l&&void 0===u&&(u=new mt(new f(0,0,0))),this.getTextFont()),p=this.getStringFormat(),d=e;return d.height>=t.clientSize.height&&this.row.grid.allowRowBreakAcrossPages&&(d.height-=d.y,void 0!==this._rowHeight)&&null!==this._rowHeight&&d.height>this._rowHeight&&(d.height=this._rowHeight),d=this.adjustContentLayoutArea(d),"string"==typeof this.objectValue||"string"==typeof this.remaining?(h=s=void 0,h=d.height<c.height?new Z(d.x,d.y,d.width,c.height):d,d.height<c.height&&this.row.grid.isChildGrid&&null!=this.row.grid.ParentCell&&(n=h.height-this.row.grid.ParentCell.row.grid.style.cellPadding.bottom-this.row.grid.style.cellPadding.bottom,-1!=this.row.grid.splitChildRowIndex&&(this.fontSpilt=!0,this.row.rowFontSplit=!0),0<n)&&n<c.height&&(h.height=n),0!=this.gridRow.grid.style.cellSpacing&&(h.width-=this.gridRow.grid.style.cellSpacing,e.width-=this.gridRow.grid.style.cellSpacing),this.isFinish?(s=""===this.remaining?this.remaining:this.objectValue,t.drawString(s,c,l,u,h.x,h.y,h.width,h.height,p),-1==this.row.grid.splitChildRowIndex||this.row.grid.isChildGrid||void 0!==this.remaining||(this.remaining="")):(void 0!==this.remaining&&null!==this.remaining||(this.remaining=""),this.row.repeatFlag&&t.drawString(this.remaining,c,l,u,h.x,h.y,h.width,h.height,p),this.isFinish=!0),r=t.stringLayoutResult):this.objectValue instanceof Jo?(s=void((n=this.objectValue).isChildGrid=!0),s=d,0!=(n.ParentCell=this).gridRow.grid.style.cellSpacing&&(e.width-=this.gridRow.grid.style.cellSpacing),h=new ts(n),a=new os,null!=this.row.grid.LayoutFormat?a=this.row.grid.LayoutFormat:a.layout=Y.PdfLayoutType.Paginate,o=new Qr,null!=t.layer&&(o.page=t.page,o.bounds=s,o.format=a,n.setSpan(),n.checkSpan(),s=h.Layouter(o),this.value=n,-1!==this.row.grid.splitChildRowIndex&&(this.height=this.row.rowBreakHeightValue),o.page!=s.page)&&(null!==this.row.rowBreakHeightValue&&void 0!==this.row.rowBreakHeightValue&&(s.bounds.height=this.row.rowBreakHeightValue),0==this.row.rowBreakHeight?this.row.NestedGridLayoutResult=s:this.row.rowBreakHeight=this.row.rowBreakHeightValue)):this.objectValue instanceof ke||this.objectValue instanceof De?(a=new Z(d.x,d.y,d.width,d.height),(h=this.objectValue).width<=d.width&&(a.width=h.width),h.height<=d.height&&(a.height=h.height),t.drawImage(this.objectValue,a.x,a.y,a.width,a.height)):this.objectValue instanceof Tn?this.objectValue.draw(t.currentPage,d):void 0===this.objectValue&&(this.objectValue="",t.drawString(this.objectValue,c,l,u,d.x,d.y,d.width,d.height,p),null!=this.style.cellPadding&&0==this.style.cellPadding.bottom&&0==this.style.cellPadding.left&&0==this.style.cellPadding.right&&0==this.style.cellPadding.top&&(e.width-=this.style.borders.left.width+this.style.borders.right.width),0!=this.gridRow.grid.style.cellSpacing)&&(e.width-=this.gridRow.grid.style.cellSpacing),null!=this.style.borders&&(this.fontSpilt?-1!=this.row.grid.ParentCell.row.grid.splitChildRowIndex&&(this.row.rowFontSplit=!1,this.drawCellBorders(t,e)):this.drawCellBorders(t,e)),r},T.prototype.drawCellBorders=function(t,e){this.row.grid.style.borderOverlapStyle===Y.PdfBorderOverlapStyle.Inside&&(e.x+=this.style.borders.left.width,e.y+=this.style.borders.top.width,e.width-=this.style.borders.right.width,e.height-=this.style.borders.bottom.width);var i=new X(e.x,e.y+e.height),r=new X(e.x,e.y),n=this.cellStyle.borders.left;this.cellStyle.borders.left.dashStyle===Y.PdfDashStyle.Solid&&(n.lineCap=Y.PdfLineCap.Square),0!==n.width&&t.drawLine(n,i,r),i=new X(e.x+e.width,e.y),r=new X(e.x+e.width,e.y+e.height),n=this.cellStyle.borders.right,e.x+e.width>t.clientSize.width-n.width/2&&(i=new X(t.clientSize.width-n.width/2,e.y),r=new X(t.clientSize.width-n.width/2,e.y+e.height)),this.cellStyle.borders.right.dashStyle===Y.PdfDashStyle.Solid&&(n.lineCap=Y.PdfLineCap.Square),0!==n.width&&t.drawLine(n,i,r),i=new X(e.x,e.y),r=new X(e.x+e.width,e.y),n=this.cellStyle.borders.top,this.cellStyle.borders.top.dashStyle===Y.PdfDashStyle.Solid&&(n.lineCap=Y.PdfLineCap.Square),0!==n.width&&t.drawLine(n,i,r),i=new X(e.x+e.width,e.y+e.height),r=new X(e.x,e.y+e.height),n=this.cellStyle.borders.bottom,e.y+e.height>t.clientSize.height-n.width/2&&(i=new X(e.x+e.width,t.clientSize.height-n.width/2),r=new X(e.x,t.clientSize.height-n.width/2)),this.cellStyle.borders.bottom.dashStyle===Y.PdfDashStyle.Solid&&(n.lineCap=Y.PdfLineCap.Square),0!==n.width&&t.drawLine(n,i,r)},T.prototype.adjustOuterLayoutArea=function(t,e){var i=!1,r=this.row.grid.style.cellSpacing,n=(0<r&&(t=new Z(t.x+r,t.y+r,t.width-r,t.height-r)),this.row.cells.indexOf(this));if(1<this.columnSpan||0<this.row.rowOverflowIndex&&n==this.row.rowOverflowIndex+1&&this.isCellMergeContinue){if(1==(h=this.columnSpan)&&this.isCellMergeContinue)for(var o=n+1;o<this.row.grid.columns.count&&this.row.cells.getCell(o).isCellMergeContinue;o++)h++;for(var s=0,a=n;a<n+h;a++){if(this.row.grid.style.allowHorizontalOverflow)if((this.row.grid.size.width<e.clientSize.width?this.row.grid.size:e.clientSize).width<(this.row.grid.size.width>e.clientSize.width?t.x+s+this.row.grid.columns.getColumn(a).width:s+this.row.grid.columns.getColumn(a).width))break;s+=this.row.grid.columns.getColumn(a).width}s-=this.row.grid.style.cellSpacing,t.width=s}if(1<this.rowSpan||this.row.rowSpanExists){for(var h=this.rowSpan,l=this.row.grid.rows.rowCollection.indexOf(this.row),u=(-1==l&&-1!=(l=this.row.grid.headers.indexOf(this.row))&&(i=!0),0),a=l;a<l+h;a++){u+=(i?this.row.grid.headers.getHeader(a):this.row.grid.rows.getRow(a)).height;var c=this.row.grid.rows.getRow(a);this.row.grid.rows.rowCollection.indexOf(c)}this.row.cells.indexOf(this);u-=this.row.grid.style.cellSpacing,t.height=u,this.row.rowMergeComplete||(t.height=u)}return t},T.prototype.getTextFont=function(){return void 0!==this.style.font&&null!=this.style.font?this.style.font:void 0!==this.row.style.font&&null!=this.row.style.font?this.row.style.font:void 0!==this.row.grid.style.font&&null!=this.row.grid.style.font?this.row.grid.style.font:Tr.defaultFont},T.prototype.getTextBrush=function(){return(void 0!==this.style.textBrush&&null!=this.style.textBrush?this:void 0!==this.row.style.textBrush&&null!=this.row.style.textBrush?this.row:this.row.grid).style.textBrush},T.prototype.getTextPen=function(){return(void 0!==this.style.textPen&&null!=this.style.textPen?this:void 0!==this.row.style.textPen&&null!=this.row.style.textPen?this.row:this.row.grid).style.textPen},T.prototype.getBackgroundBrush=function(){return(void 0!==this.style.backgroundBrush&&null!=this.style.backgroundBrush?this:void 0!==this.row.style.backgroundBrush&&null!=this.row.style.backgroundBrush?this.row:this.row.grid).style.backgroundBrush},T.prototype.getBackgroundImage=function(){return(void 0!==this.style.backgroundImage&&null!=this.style.backgroundImage?this:void 0!==this.row.style.backgroundImage&&null!=this.row.style.backgroundImage?this.row:this.row.grid).style.backgroundImage},T.prototype.getStringFormat=function(){return(void 0!==this.style.stringFormat&&null!=this.style.stringFormat?this.style:this).stringFormat},T.prototype.measureHeight=function(){var t,e,i=this.calculateWidth(),r=(null==this.style.cellPadding||void 0===this.style.cellPadding?i-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:i=(i-=this.style.cellPadding.right+this.style.cellPadding.left)-(this.style.borders.left.width+this.style.borders.right.width),0),n=new vt;return"string"==typeof this.objectValue||"string"==typeof this.remaining?(e=this.objectValue,this.isFinish||(e=null!==this.remaining&&""!==this.remaining&&void 0!==this.remaining?this.remaining:this.objectValue),t=this.row.cells.indexOf(this),0!=this.gridRow.grid.style.cellSpacing&&(i-=2*this.gridRow.grid.style.cellSpacing),this.row.cells.getCell(t).hasColSpan||this.row.cells.getCell(t).hasRowSpan||(this.gridRow.grid.isChildGrid?(i<0?(this.tempval=i,null==this.style.cellPadding||void 0===this.style.cellPadding?this.tempval+=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(this.tempval+=this.style.cellPadding.right+this.style.cellPadding.left,this.tempval+=this.style.borders.left.width+this.style.borders.right.width)):this.tempval=i,r+=n.layout(e,this.getTextFont(),this.stringFormat,new J(this.tempval,0),!1,new J(0,0)).actualSize.height):r+=n.layout(e,this.getTextFont(),this.stringFormat,new J(i,0),!1,new J(0,0)).actualSize.height),r+=2*(this.style.borders.top.width+this.style.borders.bottom.width)):this.objectValue instanceof Jo?(t=this.row.cells.indexOf(this),e=0,null!=this.style.cellPadding||void 0!==this.style.cellPadding?(e=this.calculateWidth(),void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(e-=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(e-=this.style.cellPadding.right)):null!=this.row.grid.style.cellPadding||void 0!==this.row.grid.style.cellPadding?(e=this.calculateWidth(),void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(e-=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(e-=this.row.grid.style.cellPadding.right)):e=this.calculateWidth(),this.objectValue.tempWidth=e,this.row.cells.getCell(t).hasColSpan||this.row.cells.getCell(t).hasRowSpan?r+=2*(this.style.borders.top.width+this.style.borders.bottom.width):r=this.objectValue.size.height,0!==this.gridRow.grid.style.cellSpacing&&(i-=2*this.gridRow.grid.style.cellSpacing),null==this.style.cellPadding&&void 0===this.style.cellPadding||(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(r+=this.row.grid.style.cellPadding.top),this.row.grid.style.cellPadding.hasBottomPad&&void 0!==this.row.grid.style.cellPadding.bottom&&(r+=this.row.grid.style.cellPadding.bottom)),r+=this.objectValue.style.cellSpacing):this.objectValue instanceof ke||this.objectValue instanceof De?r+=this.objectValue.height:this.objectValue instanceof Tn?(e=this.objectValue,r=(r+=n.layout(e.text,e.font,e.stringFormat,new J(i,0),!1,new J(0,0)).actualSize.height)+2*(this.style.borders.top.width+this.style.borders.bottom.width)):void 0===this.objectValue&&(null==this.style.cellPadding||void 0===this.style.cellPadding?i-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:i=(i-=this.style.cellPadding.right+this.style.cellPadding.left)-(this.style.borders.left.width+this.style.borders.right.width),r+=2*(this.style.borders.top.width+this.style.borders.bottom.width)),this.objectValue instanceof Jo?null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(r+=this.row.grid.style.cellPadding.top),void 0!==this.row.grid.style.cellPadding.bottom&&this.row.grid.style.cellPadding.hasBottomPad&&(r+=this.row.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(r+=this.style.cellPadding.top),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(r+=this.style.cellPadding.bottom)):null==this.style.cellPadding||void 0===this.style.cellPadding?r+=this.row.grid.style.cellPadding.top+this.row.grid.style.cellPadding.bottom:r+=this.style.cellPadding.top+this.style.cellPadding.bottom,r+=this.row.grid.style.cellSpacing},T.prototype.calculateWidth=function(){var t=this.row.cells.indexOf(this),e=(this.row.grid.rows.rowCollection.indexOf(this.row),this.columnSpan),i=0;if(1===e)for(var r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width;else if(1<e)for(r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width,r+1<e&&(this.row.cells.getCell(t+r+1).hasColSpan=!0);if(null!=this.parent&&0<this.parent.row.width&&this.row.grid.isChildGrid&&null!=this.parent&&this.row.width>this.parent.row.width){for(var i=0,n=0;n<this.parent.columnSpan;n++)i+=this.parent.row.grid.columns.getColumn(n).width;i/=this.row.cells.count}return i};var Ao=T;function T(t){this.cellWidth=0,this.cellHeight=0,this.tempval=0,this.fontSpilt=!1,this.finsh=!0,this.rowSpanRemainingHeight=0,this.hasRowSpan=!1,this.hasColSpan=!1,this.isFinish=!0,this.present=!1,this.gridRowSpan=1,this.colSpan=1,void 0!==t&&(this.gridRow=t)}Io.prototype.getCell=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException");return this.cells[t]},Object.defineProperty(Io.prototype,"count",{get:function(){return this.cells.length},enumerable:!0,configurable:!0}),Io.prototype.add=function(t){var e;if(void 0===t)return e=new Ao,this.add(e),t;t.row=this.gridRow,this.cells.push(t)},Io.prototype.indexOf=function(t){return this.cells.indexOf(t)};var No=Io;function Io(t){this.cells=[],this.gridRow=t}Object.defineProperty(Eo.prototype,"width",{get:function(){return this.columnWidth},set:function(t){this.isCustomWidth=!0,this.columnWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"format",{get:function(){return null==this.stringFormat&&(this.stringFormat=new bt),this.stringFormat},set:function(t){this.stringFormat=t},enumerable:!0,configurable:!0});var Fo=Eo;function Eo(t){this.columnWidth=0,this.grid=t}zo.prototype.add=function(t){for(var e=0;e<t;e++){this.internalColumns.push(new Fo(this.grid));for(var i=0;i<this.grid.rows.count;i++){var r=this.grid.rows.getRow(i),n=new Ao;n.value="",r.cells.add(n)}}},Object.defineProperty(zo.prototype,"count",{get:function(){return this.internalColumns.length},enumerable:!0,configurable:!0}),Object.defineProperty(zo.prototype,"width",{get:function(){return 0===this.columnWidth&&(this.columnWidth=this.measureColumnsWidth()),0===this.grid.initialWidth||this.columnWidth===this.grid.initialWidth||this.grid.style.allowHorizontalOverflow||(this.columnWidth=this.grid.initialWidth,this.grid.isPageWidth=!0),this.columnWidth},enumerable:!0,configurable:!0}),Object.defineProperty(zo.prototype,"columns",{get:function(){return this.internalColumns},enumerable:!0,configurable:!0}),zo.prototype.getColumn=function(t){if(0<=t&&t<=this.columns.length)return this.columns[t];throw Error("can not get the column from the index: "+t)},zo.prototype.measureColumnsWidth=function(){var t=0;this.grid.measureColumnsWidth();for(var e=0,i=this.internalColumns.length;e<i;e++)t+=this.internalColumns[e].width;return t},zo.prototype.getDefaultWidths=function(t){for(var e=[],i=this.count,r=0;r<this.count;r++)this.grid.isPageWidth&&0<=t&&!this.internalColumns[r].isCustomWidth?this.internalColumns[r].width=0:(e[r]=this.internalColumns[r].width,0<this.internalColumns[r].width&&this.internalColumns[r].isCustomWidth?(t-=this.internalColumns[r].width,i--):e[r]=0);for(r=0;r<this.count;r++)e[r]<=0&&(e[r]=t/i);return e};var Go=zo;function zo(t){this.internalColumns=[],this.columnWidth=0,this.grid=t,this.internalColumns=[]}Object.defineProperty(_o.prototype,"rowSpanExists",{get:function(){return this.bRowSpanExists},set:function(t){this.bRowSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"cells",{get:function(){return null==this.gridCells&&(this.gridCells=new No(this)),this.gridCells},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"grid",{get:function(){return this.pdfGrid},set:function(t){this.pdfGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"style",{get:function(){return void 0===this.rowStyle&&(this.rowStyle=new Mo,this.rowStyle.setParent(this)),this.rowStyle},set:function(t){this.rowStyle=t;for(var e=0;e<this.cells.count;e++)this.cells.getCell(e).style.borders=t.border,void 0!==t.font&&(this.cells.getCell(e).style.font=t.font),void 0!==t.backgroundBrush&&(this.cells.getCell(e).style.backgroundBrush=t.backgroundBrush),void 0!==t.backgroundImage&&(this.cells.getCell(e).style.backgroundImage=t.backgroundImage),void 0!==t.textBrush&&(this.cells.getCell(e).style.textBrush=t.textBrush),void 0!==t.textPen&&(this.cells.getCell(e).style.textPen=t.textPen)},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"rowBreakHeight",{get:function(){return void 0===this.gridRowBreakHeight&&(this.gridRowBreakHeight=0),this.gridRowBreakHeight},set:function(t){this.gridRowBreakHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"rowOverflowIndex",{get:function(){return this.gridRowOverflowIndex},set:function(t){this.gridRowOverflowIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"height",{get:function(){return this.isRowHeightSet||(this.rowHeight=this.measureHeight()),this.rowHeight},set:function(t){this.rowHeight=t,this.isRowHeightSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"width",{get:function(){return 0!==this.rowWidth&&void 0!==this.rowWidth||(this.rowWidth=this.measureWidth()),this.rowWidth},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"NestedGridLayoutResult",{get:function(){return this.gridResult},set:function(t){this.gridResult=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"columnSpanExists",{get:function(){return this.bColumnSpanExists},set:function(t){this.bColumnSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"rowMergeComplete",{get:function(){return this.isRowMergeComplete},set:function(t){this.isRowMergeComplete=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"rowIndex",{get:function(){return this.grid.rows.rowCollection.indexOf(this)},enumerable:!0,configurable:!0}),_o.prototype.measureHeight=function(){for(var t=0,e=0,i=1<this.cells.getCell(0).rowSpan?0:this.cells.getCell(0).height,r=0;r<this.cells.count;r++){var n=this.cells.getCell(r);if(n.rowSpanRemainingHeight>t&&(t=n.rowSpanRemainingHeight),this.rowMergeComplete=!1,1<n.rowSpan){for(var o=r,s=(this.isHeaderRow?this.grid.headers:this.grid.rows.rowCollection).indexOf(this),a=0;a<n.rowSpan;a++)a+1<n.rowSpan&&((this.isHeaderRow?this.grid.headers.getHeader(s+a+1):this.grid.rows.getRow(s+a+1)).cells.getCell(o).hasRowSpan=!0);e<n.height&&(e=n.height)}else i=Math.max(i,n.height)}return 0===(i=i<e?e:i)?i=e:0<t&&(i+=t),i},_o.prototype.measureWidth=function(){for(var t=0,e=0;e<this.grid.columns.count;e++)t+=this.grid.columns.getColumn(e).width;return t};var Wo=_o;function _o(t){this.gridRowOverflowIndex=0,this.rowHeight=0,this.rowWidth=0,this.isrowFinish=!1,this.isRowSpanRowHeightSet=!1,this.noOfPageCount=0,this.isRowHeightSet=!1,this.isPageBreakRowSpanApplied=!1,this.isRowMergeComplete=!0,this.repeatFlag=!1,this.rowFontSplit=!1,this.isHeaderRow=!1,this.pdfGrid=t}Object.defineProperty(Uo.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Object.defineProperty(Uo.prototype,"rowCollection",{get:function(){return this.rows},enumerable:!0,configurable:!0}),Uo.prototype.addRow=function(t){var e;if(void 0===t)return e=new Wo(this.grid),this.addRow(e),e;if(t.style.setBackgroundBrush(this.grid.style.backgroundBrush),t.style.setFont(this.grid.style.font),t.style.setTextBrush(this.grid.style.textBrush),t.style.setTextPen(this.grid.style.textPen),0===t.cells.count)for(var i=0;i<this.grid.columns.count;i++)t.cells.add(new Ao);this.rows.push(t)},Uo.prototype.getRow=function(t){return this.rows[t]};var Ho=Uo;function Uo(t){this.rows=[],this.grid=t}qo.prototype.getHeader=function(t){return this.rows[t]},Object.defineProperty(qo.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),qo.prototype.add=function(t){if("number"==typeof t){for(var e=void 0,i=0;i<t;i++){(e=new Wo(this.grid)).isHeaderRow=!0;for(var r=0;r<this.grid.columns.count;r++)e.cells.add(new Ao);this.rows.push(e)}return this.rows}this.rows.push(t)},qo.prototype.indexOf=function(t){return this.rows.indexOf(t)};var Ko=qo;function qo(t){this.rows=[],this.grid=t,this.rows=[]}Yo=function(t,e){return(Yo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Yo(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Zo,Xo=hn),Object.defineProperty(Zo.prototype,"raiseBeginCellDraw",{get:function(){return void 0!==this.beginCellDraw&&null!==typeof this.beginCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"raiseEndCellDraw",{get:function(){return void 0!==this.endCellDraw&&null!==typeof this.endCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"repeatHeader",{get:function(){return null!=this.bRepeatHeader&&void 0!==this.bRepeatHeader||(this.bRepeatHeader=!1),this.bRepeatHeader},set:function(t){this.bRepeatHeader=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"allowRowBreakAcrossPages",{get:function(){return this.breakRow},set:function(t){this.breakRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"columns",{get:function(){return null!=this.gridColumns&&void 0!==this.gridColumns||(this.gridColumns=new Go(this)),this.gridColumns},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"rows",{get:function(){return null==this.gridRows&&(this.gridRows=new Ho(this)),this.gridRows},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"headers",{get:function(){return null!=this.gridHeaders&&void 0!==this.gridHeaders||(this.gridHeaders=new Ko(this)),this.gridHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"initialWidth",{get:function(){return this.gridInitialWidth},set:function(t){this.gridInitialWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"style",{get:function(){return null==this.gridStyle&&(this.gridStyle=new To),this.gridStyle},set:function(t){null==this.gridStyle&&(this.gridStyle=t)},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"isPageWidth",{get:function(){return this.ispageWidth},set:function(t){this.ispageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"isChildGrid",{get:function(){return this.ischildGrid},set:function(t){this.ischildGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"size",{get:function(){return 0!==this.gridSize.width&&void 0!==this.gridSize.width||0!==this.gridSize.height||(this.gridSize=this.measure()),this.gridSize},set:function(t){this.gridSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"ParentCell",{get:function(){return this.parentCell},set:function(t){this.parentCell=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"LayoutFormat",{get:function(){return this.layoutFormat},enumerable:!0,configurable:!0}),Zo.prototype.draw=function(t,e,i,r){var n;return e instanceof X&&void 0===e.width&&void 0===i?this.drawHelper(t,e.x,e.y):"number"==typeof e&&"number"==typeof i&&void 0===r?this.drawHelper(t,e,i,null):e instanceof Z&&void 0!==e.width&&void 0===i?this.drawHelper(t,e,null):e instanceof X&&void 0===e.width&&i instanceof Zr?this.drawHelper(t,e.x,e.y,i):"number"==typeof e&&"number"==typeof i&&(r instanceof Zr||null==r)?(n=t.graphics.clientSize.width-e,n=new Z(e,i,n,0),this.drawHelper(t,n,r)):e instanceof Z&&void 0!==e.width&&"boolean"==typeof i?this.drawHelper(t,e,null):this.drawHelper(t,e,i)},Zo.prototype.measure=function(){for(var t=0,e=this.columns.width,i=0;i<this.headers.count;i++)t+=this.headers.getHeader(i).height;for(i=0;i<this.rows.count;i++)t+=this.rows.getRow(i).height;return new J(e,t)},Zo.prototype.onBeginCellDraw=function(t){this.raiseBeginCellDraw&&this.beginCellDraw(this,t)},Zo.prototype.onEndCellDraw=function(t){this.raiseEndCellDraw&&this.endCellDraw(this,t)},Zo.prototype.layout=function(t){var e=t.bounds.width,i=t.bounds.height,r=!1;return void 0!==t.bounds.width&&0!==t.bounds.width||(e=t.page.getClientSize().width-t.bounds.x,r=!0),void 0!==t.bounds.height&&0!==t.bounds.height||(i=t.page.getClientSize().height-t.bounds.y,r=!0),r&&(t.bounds=new Z(t.bounds.x,t.bounds.y,e,i)),0!==this.rows.count&&null!=(r=this.rows.getRow(0).cells.getCell(0).style).borders&&(null!=r.borders.left&&1!==r.borders.left.width||null!=r.borders.top&&1!==r.borders.top.width)&&(e=r.borders.left.width/2,i=r.borders.top.width/2,t.bounds.x===nn.default.right.width/2)&&t.bounds.y===nn.default.right.width/2&&(r=new Z(e,i,this.gridSize.width,this.gridSize.height),t.bounds=r),this.setSpan(),this.checkSpan(),this.layoutFormat=t.format,this.gridLocation=t.bounds,new ts(this).Layouter(t)},Zo.prototype.setSpan=function(){for(var t=1,e=1,i=0,r=0,n=0,o=this.headers.count,s=0;s<o;s++){for(var a=this.headers.getHeader(s),h=a.cells.count,l=n=0;l<h;l++){var u=a.cells.getCell(l),n=Math.max(n,u.rowSpan);if(!u.isCellMergeContinue&&!u.isRowMergeContinue&&(1<u.columnSpan||1<u.rowSpan)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.headers.count)throw new Error("Invalid span specified at Header "+l.toString()+" column "+s.toString());if(1<u.columnSpan&&1<u.rowSpan){for(t=u.columnSpan,e=u.rowSpan,i=l,r=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;1<t;)i++,a.cells.getCell(i).isCellMergeContinue=!0,a.cells.getCell(i).isRowMergeContinue=!0,a.cells.getCell(i).rowSpan=e,t--;for(i=l,t=u.columnSpan;1<e;){for(r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,e--;1<t;)i++,this.headers.getHeader(r).cells.getCell(i).isCellMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,t--;t=u.columnSpan,i=l}}else if(1<u.columnSpan&&1===u.rowSpan)for(t=u.columnSpan,i=l,u.isCellMergeStart=!0;1<t;)i++,a.cells.getCell(i).isCellMergeContinue=!0,t--;else if(1===u.columnSpan&&1<u.rowSpan)for(e=u.rowSpan,r=s;1<e;)r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,e--}}a.maximumRowSpan=n}},Zo.prototype.checkSpan=function(){var t=1,e=0,i=0,r=t=1,n=i=0;if(this.hasRowSpanSpan||this.hasColumnSpan)for(var o=this.rows.count,s=0;s<o;s++){for(var a=this.rows.getRow(s),h=a.cells.count,l=e=0;l<h;l++){var u=a.cells.getCell(l),e=Math.max(e,u.rowSpan);if(!u.isCellMergeContinue&&!u.isRowMergeContinue&&(1<u.columnSpan||1<u.rowSpan)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.rows.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(1<u.columnSpan&&1<u.rowSpan){for(r=u.columnSpan,t=u.rowSpan,n=l,i=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;1<r;)n++,a.cells.getCell(n).isCellMergeContinue=!0,a.cells.getCell(n).isRowMergeContinue=!0,r--;for(n=l,r=u.columnSpan;1<t;){for(i++,this.rows.getRow(i).cells.getCell(l).isRowMergeContinue=!0,this.rows.getRow(i).cells.getCell(n).isRowMergeContinue=!0,t--;1<r;)n++,this.rows.getRow(i).cells.getCell(n).isCellMergeContinue=!0,this.rows.getRow(i).cells.getCell(n).isRowMergeContinue=!0,r--;r=u.columnSpan,n=l}}else if(1<u.columnSpan&&1===u.rowSpan)for(r=u.columnSpan,n=l,u.isCellMergeStart=!0;1<r;)n++,a.cells.getCell(n).isCellMergeContinue=!0,r--;else if(1===u.columnSpan&&1<u.rowSpan)for(t=u.rowSpan,i=s;1<t;)i++,this.rows.getRow(i).cells.getCell(l).isRowMergeContinue=!0,t--}}a.maximumRowSpan=e}},Zo.prototype.measureColumnsWidth=function(t){if(void 0!==t){this.isPageWidth=!1;for(var e=this.columns.getDefaultWidths(t.width-t.x),i=0,r=this.columns.count;i<r;i++)this.columns.getColumn(i).columnWidth=e[i],this.tempWidth=e[i];if(null!=this.ParentCell&&0==this.style.allowHorizontalOverflow&&0==this.ParentCell.row.grid.style.allowHorizontalOverflow){var n,o=0,s=0,a=this.columns.count;null==this.ParentCell.style.cellPadding&&void 0===this.ParentCell.style.cellPadding||(void 0!==this.ParentCell.style.cellPadding.left&&this.ParentCell.style.cellPadding.hasLeftPad&&(o+=this.ParentCell.style.cellPadding.left),void 0!==this.ParentCell.style.cellPadding.right&&this.ParentCell.style.cellPadding.hasRightPad&&(o+=this.ParentCell.style.cellPadding.right));for(i=0;i<this.ParentCell.columnSpan;i++)s+=this.ParentCell.row.grid.columns.getColumn(this.parentCellIndex+i).width;for(var h=0;h<this.columns.count;h++)0<this.gridColumns.getColumn(h).width&&this.gridColumns.getColumn(h).isCustomWidth&&(s-=this.gridColumns.getColumn(h).width,a--);if(null==this.ParentCell.row.grid.style.cellPadding&&void 0===this.ParentCell.row.grid.style.cellPadding||(void 0!==this.ParentCell.row.grid.style.cellPadding.top&&this.ParentCell.row.grid.style.cellPadding.hasTopPad&&(o+=this.ParentCell.row.grid.style.cellPadding.top),void 0!==this.ParentCell.row.grid.style.cellPadding.bottom&&this.ParentCell.row.grid.style.cellPadding.hasBottomPad&&(o+=this.ParentCell.row.grid.style.cellPadding.bottom)),0!=this.ParentCell.row.grid.style.cellSpacing&&(s-=2*this.ParentCell.row.grid.style.cellSpacing),o<s&&(this.tempWidth=n=(s-o)/a,null!=this.ParentCell))for(h=0;h<this.columns.count;h++)this.columns.getColumn(h).isCustomWidth||(this.columns.getColumn(h).columnWidth=n)}}else{for(var e=[this.columns.count],l=0;l<this.columns.count;l++)e[l]=0;var u=0;if((void 0===this.isChildGrid&&void 0!==this.gridLocation||null===this.isChildGrid&&void 0!==this.gridLocation)&&(this.initialWidth=this.gridLocation.width),0<this.headers.count)for(var c=this.headers.getHeader(0).cells.count,p=this.headers.count,i=0;i<c;i++){for(h=u=0;h<p;h++)var d=Math.min(this.initialWidth,this.headers.getHeader(h).cells.getCell(i).width),u=Math.max(u,d);e[i]=u}for(var i=u=0,f=this.columns.count;i<f;i++){for(h=0,p=this.rows.count;h<p;h++)(1!=this.rows.getRow(h).cells.getCell(i).columnSpan||this.rows.getRow(h).cells.getCell(i).isCellMergeContinue)&&null==this.rows.getRow(h).cells.getCell(i).value||(null==this.rows.getRow(h).cells.getCell(i).value||this.rows.getRow(h).grid.style.allowHorizontalOverflow||(this.rows.getRow(h).grid.style.cellPadding.right,this.rows.getRow(h).grid.style.cellPadding.left,this.rows.getRow(h).cells.getCell(i).style.borders.left.width),d=(d=0)<this.initialWidth?Math.min(this.initialWidth,this.rows.getRow(h).cells.getCell(i).width):this.rows.getRow(h).cells.getCell(i).width,u=Math.max(e[i],Math.max(u,d)),u=Math.max(this.columns.getColumn(i).width,u));0!=this.rows.count&&(e[i]=u),u=0}for(var i=0,g=this.rows.count;i<g;i++)for(var h=0,m=this.columns.count;h<m;h++)if(1<this.rows.getRow(i).cells.getCell(h).columnSpan){e[h];for(var y=1;y<this.rows.getRow(i).cells.getCell(h).columnSpan;y++)e[h+y]}for(i=0,r=this.columns.count;i<r;i++)(this.columns.getColumn(i).width<=0||0<this.columns.getColumn(i).width&&!this.columns.getColumn(i).isCustomWidth)&&(this.columns.getColumn(i).columnWidth=e[i]);for(var b,o=0,w=0,P=this.columns.count,w=this.tempWidth,h=0;h<this.columns.count;h++)0<this.gridColumns.getColumn(h).width&&this.gridColumns.getColumn(h).isCustomWidth&&(w-=this.gridColumns.getColumn(h).width,P--);if(0<w&&0!=this.ParentCell.row.grid.style.cellSpacing&&(w-=2*this.ParentCell.row.grid.style.cellSpacing),o<w&&(b=w/P,null!=this.ParentCell))for(h=0;h<this.columns.count;h++)this.columns.getColumn(h).isCustomWidth||(this.columns.getColumn(h).columnWidth=b)}};var Yo,Xo,Jo=Zo;function Zo(){var t=Xo.call(this)||this;return t.gridSize=new J(0,0),t.isGridSplit=!1,t.isRearranged=!1,t.pageBounds=new Z,t.listOfNavigatePages=[],t.parentCellIndex=0,t.tempWidth=0,t.breakRow=!0,t.splitChildRowIndex=-1,t.hasRowSpanSpan=!1,t.hasColumnSpan=!1,t.isSingleGrid=!0,t}$o=function(t,e){return($o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var $o,Qo,L=function(t,e){function i(){this.constructor=t}$o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},ts=(L($,Qo=Xr),Object.defineProperty($.prototype,"Grid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),$.prototype.getFormat=function(t){return t},$.prototype.layoutInternal=function(t){var e=this.getFormat(t.format);if(this.gridLayoutFormat=this.getFormat(t.format),this.currentPage=t.page,null===this.currentPage)throw Error("Can not set page as null");this.currentPage.getClientSize().height,this.currentPage.getClientSize().width,this.currentPageBounds=this.currentPage.getClientSize(),this.currentGraphics=this.currentPage.graphics;var i=this.currentGraphics.page.section.indexOf(this.currentGraphics.page);if(this.listOfNavigatePages.push(i),null!=e&&e.break===Y.PdfLayoutBreakType.FitColumnsToPage?this.currentBounds=new Z(new X(t.bounds.x,t.bounds.y),new J(this.Grid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new Z(new X(t.bounds.x,t.bounds.y),this.currentGraphics.clientSize),0!==this.Grid.rows.count)this.currentBounds.width=0<t.bounds.width?t.bounds.width:this.currentBounds.width-this.Grid.rows.getRow(0).cells.getCell(0).style.borders.left.width/2;else{if(0===this.Grid.headers.count)throw Error("Please add row or header into grid");this.currentBounds.width=t.bounds.width}if(this.startLocation=new X(t.bounds.x,t.bounds.y),0<t.bounds.height&&!this.Grid.isChildGrid&&(this.currentBounds.height=t.bounds.height),this.Grid.isChildGrid||(this.hType=this.Grid.style.horizontalOverflowType),this.Grid.style.allowHorizontalOverflow?(this.Grid.measureColumnsWidth(),this.determineColumnDrawRanges()):(this.columnRanges=[],void 0!==this.Grid.isChildGrid&&(this.Grid.isChildGrid,1)?this.Grid.measureColumnsWidth(this.currentBounds):this.Grid.measureColumnsWidth(new Z(this.currentBounds.x,this.currentBounds.y,this.currentBounds.x+this.currentBounds.width,this.currentBounds.height)),this.columnRanges.push([0,this.Grid.columns.count-1])),this.Grid.hasRowSpanSpan)for(var r=0;r<this.Grid.rows.count;r++)-1===this.Grid.rows.getRow(r).height||this.Grid.rows.getRow(r).isRowHeightSet||(this.Grid.rows.getRow(r).isRowHeightSet=!0);return this.layoutOnPage(t)},$.prototype.determineColumnDrawRanges=function(){for(var t=0,e=0,i=0,r=this.currentGraphics.clientSize.width-this.currentBounds.x,n=0;n<this.Grid.columns.count;n++)if(r<=(i+=this.Grid.columns.getColumn(n).width)){for(var o=0,s=t;s<=n&&!(r<(o+=this.Grid.columns.getColumn(s).width));s++)e=s;this.columnRanges.push([t,e]),i=(e=t=e+1)<=n?this.Grid.columns.getColumn(n).width:0}this.columnRanges.push([t,this.Grid.columns.count-1])},$.prototype.layoutOnPage=function(t){this.pageBounds.x=t.bounds.x,this.pageBounds.y=t.bounds.y,this.pageBounds.height=t.bounds.height;for(var e,i=this.getFormat(t.format),r=new ce,n=t.page,o=[],s=0;s<this.columnRanges.length;s++){for(var a=this.columnRanges[s],h=(this.cellStartIndex=a[0],this.cellEndIndex=a[1],this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex)),l=(this.currentBounds=h.currentBounds,this.currentRowIndex=h.currentRowIndex,void 0),u=0;u<this.Grid.headers.count;u++){var c=this.Grid.headers.getHeader(u),N=this.currentBounds.y;if(this.isHeader=!0,n!=this.currentPage)for(var p=this.cellStartIndex;p<=this.cellEndIndex;p++)c.cells.getCell(p).isCellMergeContinue&&(c.cells.getCell(p).isCellMergeContinue=!1,c.cells.getCell(p).value="");var I=this.drawRow(c);N===this.currentBounds.y?(l=!0,-1===$.repeatRowIndex&&($.repeatRowIndex=u)):l=!1,!I.isFinish&&null!==n&&i.layout!==Y.PdfLayoutType.OnePage&&l&&(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(i),this.startLocation.y=this.currentBounds.y,void 0!==i.paginateBounds&&0===i.paginateBounds.x&&0===i.paginateBounds.y&&0===i.paginateBounds.width&&0===i.paginateBounds.height&&(this.currentBounds.x+=this.startLocation.x),this.drawRow(c)),this.isHeader=!1}for(var d=0,f=(this.Grid.rows.count,void 0),F=!0,o=[],g=0;g<this.Grid.rows.count;g++){var c=this.Grid.rows.getRow(g),m=(d++,this.currentRowIndex=d-1,this.currentBounds.y),n=this.currentPage,y=($.repeatRowIndex=-1,F&&c.grid.isChildGrid&&(F=!1),null);if(-1!=this.Grid.splitChildRowIndex&&!(c.grid.ParentCell.row.grid.isGridSplit&&this.Grid.splitChildRowIndex<=c.rowIndex)){if(c.isrowFinish)continue;break}for(y=this.drawRow(c),c.isrowFinish=!0,o.push(y.bounds.width),m===this.currentBounds.y?(f=!0,$.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(c)):(f=!1,$.repeatRowIndex=-1);!y.isFinish&&null!=n;){var b=this.getLayoutResult();if(this.raisePageLayouted(b).cancel||f)break;if(this.Grid.allowRowBreakAcrossPages){this.currentPage=this.getNextPageformat(i);this.currentBounds.y;var E,b=new X(nn.default.right.width/2,nn.default.top.width/2);if(0===i.paginateBounds.x&&0===i.paginateBounds.y&&0===i.paginateBounds.width&&0===i.paginateBounds.height&&this.startLocation.x===b.x&&this.startLocation.y===b.y&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y),this.isPaginate&&(this.startLocation.y=this.currentBounds.y,this.isPaginate=!1),this.Grid.isChildGrid&&null!=c.grid.ParentCell&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&c.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top<this.currentBounds.height&&(this.currentBounds.y=this.Grid.ParentCell.row.grid.style.cellPadding.top),null!=c.grid.ParentCell){c.grid.ParentCell.row.isRowBreaksNextPage=!0,c.grid.ParentCell.row.rowBreakHeightValue=c.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top+this.Grid.ParentCell.row.grid.style.cellPadding.bottom;for(var w=c.rowIndex+1;w<c.grid.rows.count;w++)c.grid.ParentCell.row.rowBreakHeightValue+=c.grid.rows.getRow(w).height}if(c.grid.isChildGrid){c.isrowFinish=!1,c.grid.splitChildRowIndex=c.rowIndex,c.grid.ParentCell.row.grid.splitChildRowIndex=c.grid.ParentCell.row.rowIndex,c.grid.ParentCell.row.grid.isGridSplit&&(c.grid.ParentCell.row.noOfPageCount+=1,c.grid.ParentCell.row.grid.isGridSplit=!1);break}if(c.noOfPageCount<1){if(-1!=c.grid.splitChildRowIndex&&(c.grid.isGridSplit=!0),null!=c.style.border&&(null!=c.style.border.left&&1!==c.style.border.left.width||null!=c.style.border.top&&1!==c.style.border.top.width)&&(b=c.style.border.left.width/2,E=c.style.border.top.width/2,this.currentBounds.x===nn.default.right.width/2)&&this.currentBounds.y===nn.default.right.width/2&&(b=new Z(b,E,this.currentBounds.width,this.currentBounds.height),this.currentBounds=b),this.Grid.repeatHeader)for(var P=0;P<this.Grid.headers.count;P++){var G=this.Grid.headers.getHeader(P);this.drawRow(G)}if(y=this.drawRow(c),1<=c.noOfPageCount){c.rowBreakHeightValue;for(var z=0;z<c.noOfPageCount;z++){var W=this.getLayoutResult();this.raisePageLayouted(W);if(this.currentPage=this.getNextPageformat(i),this.currentBounds.y,-1!=c.grid.splitChildRowIndex&&(c.grid.isGridSplit=!0),this.currentBounds.y=.5,this.Grid.repeatHeader)for(var S=0;S<this.Grid.headers.count;S++){var v=this.Grid.headers.getHeader(S);this.drawRow(v)}this.drawRow(c)}}c.grid.splitChildRowIndex=-1,c.grid.isGridSplit=!1,y.isFinish=this.checkIsFisished(c);for(var C=0;C<c.cells.count;C++)c.cells.getCell(C).value instanceof Jo&&(c.cells.getCell(C).value.splitChildRowIndex=-1)}}}if(!y.isFinish&&null!==n&&i.layout!==Y.PdfLayoutType.OnePage&&f){if(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(i),this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex).returnValue)break;if(null!==t.format&&!t.format.usePaginateBounds&&null!==t.bounds&&0<t.bounds.height&&!this.Grid.isChildGrid&&(this.currentBounds.height=t.bounds.height),void 0===t.format||null==t.format||void 0===t.format.usePaginateBounds||t.format.usePaginateBounds||0===t.format.paginateBounds.x&&0===t.format.paginateBounds.y&&0===t.format.paginateBounds.width&&0===t.format.paginateBounds.height||0!==t.format.paginateBounds.y?(this.currentBounds.y=null==i?0:i.paginateBounds.y,null==i||0===i.paginateBounds.x&&0===i.paginateBounds.y&&0===i.paginateBounds.height&&0===i.paginateBounds.width||(this.currentBounds.x=i.paginateBounds.x,this.currentBounds.width=i.paginateBounds.width,this.currentBounds.height=i.paginateBounds.height)):this.currentBounds.y=nn.default.top.width/2,void 0!==t.format&&null!==t.format&&void 0!==t.format.usePaginateBounds&&!t.format.usePaginateBounds&&null!==t.bounds&&0<t.bounds.y&&!this.Grid.isChildGrid&&(this.currentBounds.y=t.bounds.y),this.startLocation.y=this.currentBounds.y,i.paginateBounds.x===i.paginateBounds.y&&i.paginateBounds.y===i.paginateBounds.height&&i.paginateBounds.height===i.paginateBounds.width&&0===i.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===nn.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.Grid.repeatHeader)for(var B=0;B<this.Grid.headers.count;B++){v=this.Grid.headers.getHeader(B);this.drawRow(v)}this.drawRow(c),null===this.currentPage||r.containsKey(this.currentPage)||r.add(this.currentPage,a)}if(null!=c.NestedGridLayoutResult){this.currentPage=c.NestedGridLayoutResult.page,this.currentGraphics=this.currentPage.graphics,this.startLocation=new X(c.NestedGridLayoutResult.bounds.x,c.NestedGridLayoutResult.bounds.y);m=this.ReCalculateHeight(c,c.NestedGridLayoutResult.bounds.height);if(this.currentBounds.y=m,n!=this.currentPage){for(var m=(D=this.currentPage.section).indexOf(n)+1,_=D.indexOf(this.currentPage),O=m;O<_+1;O++){var x=D.getPages()[O].graphics,L=new X(i.paginateBounds.x,i.paginateBounds.y),T=O==_?c.NestedGridLayoutResult.bounds.height-t.bounds.y:this.currentBounds.height-L.y;T<=x.clientSize.height&&(T+=t.bounds.y),L.y=null==i?.5:i.paginateBounds.y;for(var j=0;j<c.cells.count;j++){var k=c.cells.getCell(j),V=0,H=0,R=void 0;if(k.value instanceof Jo)for(var R=R||k,U=0;U<k.value.columns.count;U++)H+=k.value.columns.getColumn(U).columnWidth;else H=k.width;if(1<k.columnSpan)for(;j<k.columnSpan;j++)V+=c.grid.columns.getColumn(j).width;else V=Math.max(H,c.grid.columns.getColumn(j).width);var M=void 0,R=("number"==typeof(M=(R&&R.style&&R.style.cellPadding?R:this.Grid).style.cellPadding.bottom)&&T+M<x.clientSize.height&&(T+=M,this.currentBounds.y+=M),k.drawCellBorders(x,new Z(L,new J(V,T))),this.Grid.rows.getRow(this.Grid.rows.count-1).width);V!==R&&k.drawCellBorders(x,new Z(L,new J(R,T))),L.x+=V,j+=k.columnSpan-1}}n=this.currentPage}}}for(var K,D,q=!1,A=0,h=(0<o.length&&(A=o[0]),[[1,2]]),j=0;j<this.Grid.rows.count;j++)-1!=this.cellEndIndex&&this.Grid.rows.getRow(j).cells.getCell(this.cellEndIndex).value instanceof Jo&&(K=this.Grid.rows.getRow(j).cells.getCell(this.cellEndIndex).value,this.rowLayoutBoundsWidth=K.rowLayoutBoundsWidth,q=!0);if(!q&&0<o.length){for(j=0;j<d-1;j++)A<o[j]&&(A=o[j]);this.rowLayoutBoundsWidth=A}else this.rowLayoutBoundsWidth=h[0][1];this.columnRanges.indexOf(a)<this.columnRanges.length-1&&null!=n&&i.layout!=Y.PdfLayoutType.OnePage&&(this.Grid.isChildGrid,0!=h[0][0]?((D=this.currentPage.section).indexOf(this.currentPage),this.currentGraphics=this.currentPage.graphics,this.currentBounds=new Z(new X(0,0),this.currentPage.getClientSize()),this.currentGraphics.page.section.indexOf(this.currentGraphics.page)):this.currentPage=this.getNextPageformat(i)),this.columnRanges.length-1!==s&&1<this.columnRanges.length&&i.layout!==Y.PdfLayoutType.OnePage&&(this.currentPage=this.getNextPageformat(i),i.paginateBounds.x===i.paginateBounds.y)&&i.paginateBounds.y===i.paginateBounds.height&&i.paginateBounds.height===i.paginateBounds.width&&0===i.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y)}return e=this.getLayoutResult(),this.Grid.style.allowHorizontalOverflow&&this.Grid.style.horizontalOverflowType==Y.PdfHorizontalOverflowType.NextPage&&this.reArrangePages(r),this.raisePageLayouted(e),e},$.prototype.checkIsFisished=function(t){for(var e=!0,i=0;i<t.cells.count;i++)t.cells.getCell(i).FinishedDrawingCell||(e=!1);return e},$.prototype.getNextPageformat=function(t){var e=this.currentPage.section,i=null,r=e.indexOf(this.currentPage),e=(this.flag=!1,i=r===e.count-1?e.add():e.getPages()[r+1],this.currentGraphics=i.graphics,this.currentGraphics.page.section.indexOf(this.currentGraphics.page));return-1===this.listOfNavigatePages.indexOf(e)&&this.listOfNavigatePages.push(e),this.currentBounds=new Z(new X(0,0),i.getClientSize()),void 0!==t&&null!=t&&t.usePaginateBounds&&void 0!==t.paginateBounds&&null!=t.paginateBounds&&t.paginateBounds.x!==t.paginateBounds.y&&t.paginateBounds.y!==t.paginateBounds.height&&t.paginateBounds.height!==t.paginateBounds.width&&0!==t.paginateBounds.width&&(this.currentBounds.x=t.paginateBounds.x,this.currentBounds.y=t.paginateBounds.y,this.currentBounds.height=t.paginateBounds.height),i},$.prototype.CheckIfDefaultFormat=function(t){var e=new bt;return t.alignment===e.alignment&&t.characterSpacing===e.characterSpacing&&t.clipPath===e.clipPath&&t.firstLineIndent===e.firstLineIndent&&t.horizontalScalingFactor===e.horizontalScalingFactor&&t.lineAlignment===e.lineAlignment&&t.lineLimit===e.lineLimit&&t.lineSpacing===e.lineSpacing&&t.measureTrailingSpaces===e.measureTrailingSpaces&&t.noClip===e.noClip&&t.paragraphIndent===e.paragraphIndent&&t.rightToLeft===e.rightToLeft&&t.subSuperScript===e.subSuperScript&&t.wordSpacing===e.wordSpacing&&t.wordWrap===e.wordWrap},$.prototype.RaiseBeforeCellDraw=function(t,e,i,r,n,o){return this.Grid.raiseBeginCellDraw&&(t=new us(t,e,i,r,n,o),this.Grid.onBeginCellDraw(t),o=t.style),o},$.prototype.raiseAfterCellDraw=function(t,e,i,r,n,o){this.Grid.raiseEndCellDraw&&(t=new ds(t,e,i,r,n,o),this.Grid.onEndCellDraw(t))},$.prototype.reArrangePages=function(t){for(var e=this.currentPage.document,i=[],r=t.keys(),n=(t.values(),0);n<r.length;n++)(o=r[n]).section=null,i.push(o),e.pages.remove(o);for(n=0;n<t.size();n++)for(var o,s=n,a=t.size()/this.columnRanges.length;s<t.size();s+=a)void 0!==(o=i[s])&&-1===e.pages.indexOf(o)&&e.pages.add(o)},$.prototype.getLayoutResult=function(){if(this.Grid.isChildGrid&&this.Grid.allowRowBreakAcrossPages)for(var t=0;t<this.Grid.rows.count;t++){var e=this.Grid.rows.getRow(t);0<e.rowBreakHeight&&e.repeatFlag&&(this.startLocation.y=this.currentPage.origin.y)}var i;return this.isChanged||(i=new Z(this.startLocation,new J(this.currentBounds.width,this.currentBounds.y-this.startLocation.y))),new is(this.currentPage,i)},$.prototype.ReCalculateHeight=function(t,e){for(var i=0,r=this.cellStartIndex;r<=this.cellEndIndex;r++)null!==t.cells.getCell(r).remainingString&&""!==t.cells.getCell(r).remainingString&&void 0!==t.cells.getCell(r).remainingString&&(i=Math.max(i,t.cells.getCell(r).measureHeight()));return Math.max(e,i)},$.prototype.raiseBeforePageLayout=function(t,e,i){var r=!1;return this.Grid.raiseBeginPageLayout&&(t=new Bs(e,t,i),this.Grid.onBeginPageLayout(t),r=void 0!==t.cancel&&t.cancel,e=t.bounds,i=t.startRowIndex),{returnValue:r,currentBounds:e,currentRowIndex:i}},$.prototype.raisePageLayouted=function(t){t=new Ls(t);return this.Grid.raiseEndPageLayout&&this.Grid.onEndPageLayout(t),t},$.prototype.drawRow=function(t,e,i){if(void 0===e){var r=new js,n=0,o=new J(0,0),s=!1;if(t.rowSpanExists){var a=0,h=this.Grid.rows.rowCollection.indexOf(t);-1===h&&-1!==(h=this.Grid.headers.indexOf(t))&&(s=!0);for(var l=0;l<t.cells.count;l++)var u=t.cells.getCell(l),a=Math.max(a,u.rowSpan);for(l=h;l<h+a;l++)n+=(s?this.Grid.headers.getHeader(l):this.Grid.rows.getRow(l)).height}var c,p=0<t.rowBreakHeight?t.rowBreakHeight:t.height;return void 0!==this.Grid.isChildGrid&&this.Grid.isChildGrid&&void 0!==this.Grid.ParentCell&&null!=this.Grid.ParentCell?this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+p>this.currentPageBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+p>this.currentBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+n>this.currentPageBounds.height?(void 0!==this.Grid.ParentCell.row.grid.LayoutFormat&&this.Grid.ParentCell.row.grid.LayoutFormat.break===Y.PdfLayoutBreakType.FitPage&&($.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(t),this.Grid.splitChildRowIndex=this.Grid.rows.rowCollection.indexOf(t)),-1<$.repeatRowIndex&&$.repeatRowIndex===t.rowIndex&&this.Grid.allowRowBreakAcrossPages&&(r.isFinish=!0,r.bounds=this.currentBounds,this.drawRowWithBreak(r,t,p),t.repeatFlag=!0,t.repeatRowNumber=$.repeatRowIndex)):(r.isFinish=!0,0<t.grid.ParentCell.row.rowBreakHeightValue?t.repeatFlag=!0:(t.repeatFlag=!1,p=t.height),this.Grid.isChildGrid&&0<t.rowBreakHeight&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&(p+=this.Grid.ParentCell.row.grid.style.cellPadding.bottom),this.drawRow(t,r,p)):p>this.currentPageBounds.height?this.Grid.allowRowBreakAcrossPages&&(r.isFinish=!0,this.drawRowWithBreak(r,t,p),t.isrowFinish=!0,t.repeatFlag=!0,-1!==t.grid.splitChildRowIndex)&&(r.isFinish=!1):this.currentBounds.y+p>this.currentPageBounds.height||this.currentBounds.y+p>this.currentBounds.height+this.startLocation.y||this.currentBounds.y+n>this.currentPageBounds.height?(c=!1,!this.Grid.allowRowBreakAcrossPages||this.Grid.repeatHeader||t.isRowHeightSet||t.rowMergeComplete?this.Grid.allowRowBreakAcrossPages&&null!=this.Grid.LayoutFormat&&this.Grid.LayoutFormat.layout==Y.PdfLayoutType.Paginate&&this.Grid.LayoutFormat.break!=Y.PdfLayoutBreakType.FitElement&&t.isRowHeightSet&&this.currentBounds.y+i>this.currentPageBounds.height&&((c=(c=this.isFitToCell(this.currentPageBounds.height-this.currentBounds.y,this.Grid,t))||!(null!==this.slr&&0==this.slr.actualSize.height&&null!=this.slr.remainder&&0<this.slr.remainder.length&&this.remainderText==this.slr.remainder))&&null!=this.slr&&1<this.slr.lineCount&&(c=!1),this.remainderText=null):(c=null!==this.Grid.LayoutFormat&&0<this.Grid.LayoutFormat.paginateBounds.height?this.isFitToCell(this.currentBounds.height+this.startLocation.y-this.currentBounds.y,this.Grid,t):this.isFitToCell(this.currentPageBounds.height-this.currentBounds.y,this.Grid,t))&&(this.isPaginate=!0),-1<$.repeatRowIndex&&$.repeatRowIndex===t.rowIndex||c?this.Grid.allowRowBreakAcrossPages?(r.isFinish=!0,this.drawRowWithBreak(r,t,p),t.repeatFlag=!0,t.repeatRowNumber=$.repeatRowIndex,-1!==t.grid.splitChildRowIndex&&(r.isFinish=!1)):(r.isFinish=!1,this.drawRow(t,r,p)):r.isFinish=!1):(r.isFinish=!0,this.drawRow(t,r,p),t.repeatFlag=!1),r}var d=new X(this.currentBounds.x,this.currentBounds.y);e.bounds=new Z(d,new J(0,0)),i=this.ReCalculateHeight(t,i);for(l=this.cellStartIndex;l<=this.cellEndIndex;l++){var f=l>this.cellEndIndex+1&&1<t.cells.getCell(l).columnSpan;if(!f)for(var g=1;g<t.cells.getCell(l).columnSpan;g++)t.cells.getCell(l+g).isCellMergeContinue=!0;var o=new J(this.Grid.columns.getColumn(l).width,i),m=(!this.CheckIfDefaultFormat(this.Grid.columns.getColumn(l).format)&&this.CheckIfDefaultFormat(t.cells.getCell(l).stringFormat)&&(t.cells.getCell(l).stringFormat=this.Grid.columns.getColumn(l).format),t.cells.getCell(l).style),y="string"==typeof t.cells.getCell(l).value&&null!==t.cells.getCell(l).value?t.cells.getCell(l).value:"";t.cells.getCell(l).style=this.RaiseBeforeCellDraw(this.currentGraphics,this.currentRowIndex,l,new Z(d,o),y,m);t.cells.getCell(l).value instanceof Jo&&((b=t.cells.getCell(l).value).parentCellIndex=l);var b,m=t.cells.getCell(l).draw(this.currentGraphics,new Z(d,o),f);t.grid.style.allowHorizontalOverflow&&(t.cells.getCell(l).columnSpan>this.cellEndIndex||l+t.cells.getCell(l).columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<t.cells.count-1&&(t.rowOverflowIndex=this.cellEndIndex),t.grid.style.allowHorizontalOverflow&&0<t.rowOverflowIndex&&(t.cells.getCell(l).columnSpan>this.cellEndIndex||l+t.cells.getCell(l).columnSpan>this.cellEndIndex+1)&&0<t.cells.getCell(l).columnSpan-this.cellEndIndex+l-1&&(t.cells.getCell(t.rowOverflowIndex+1).value=null!==m&&void 0!==m.remainder?m.remainder:"",t.cells.getCell(t.rowOverflowIndex+1).stringFormat=t.cells.getCell(l).stringFormat,t.cells.getCell(t.rowOverflowIndex+1).style=t.cells.getCell(l).style,t.cells.getCell(t.rowOverflowIndex+1).columnSpan=t.cells.getCell(l).columnSpan-this.cellEndIndex+l-1),y="string"==typeof t.cells.getCell(l).value&&null!==t.cells.getCell(l).value?t.cells.getCell(l).value:"",f||this.raiseAfterCellDraw(this.currentGraphics,this.currentRowIndex,l,new Z(d,o),y,t.cells.getCell(l).style),t.cells.getCell(l).value instanceof Jo&&(b=t.cells.getCell(l).value,this.Grid.columns.getColumn(l).width>=this.currentGraphics.clientSize.width)?(d.x=b.rowLayoutBoundsWidth,d.x+=b.style.cellSpacing):d.x+=this.Grid.columns.getColumn(l).width}t.rowMergeComplete&&!t.isRowHeightSet||(this.currentBounds.y+=i),e.bounds=new Z(new X(e.bounds.x,e.bounds.y),new J(d.x,d.y))},$.prototype.isFitToCell=function(t,e,i){for(var r=!1,n=new vt,o=0;o<i.cells.count;o++){var s=i.cells.getCell(o);if(void 0!==s.value&&null!==s.value&&"string"==typeof s.value){var a=null,a=void 0!==s.style.font&&null!=s.style.font?s.style.font:void 0!==s.row.style.font&&null!=s.row.style.font?s.row.style.font:void 0!==s.row.grid.style.font&&null!=s.row.grid.style.font?s.row.grid.style.font:Tr.defaultFont,h=(this.remainderText=s.value,s.width),l=e.columns.getColumn(o),l=(l.isCustomWidth&&s.width>l.width&&(h=l.width),this.slr=n.layout(s.value,a,s.stringFormat,new J(h,t),!1,this.currentPageBounds),this.slr.actualSize.height);if(""!==s.value&&0===l){r=!1;break}if(null!==s.style&&null!==s.style.borders&&null!==s.style.borders.top&&null!==s.style.borders.bottom&&(l+=2*(s.style.borders.top.width+s.style.borders.bottom.width)),1<this.slr.lineCount&&null!=s.stringFormat&&0!=s.stringFormat.lineSpacing&&(l+=(this.slr.lineCount-1)*s.style.stringFormat.lineSpacing),s.style.cellPadding,(l=(l+=e.style.cellPadding.top+e.style.cellPadding.bottom)+e.style.cellSpacing)<t||void 0!==this.slr.remainder&&null!==this.slr.remainder){r=!0;break}}}return r},$.prototype.drawRowWithBreak=function(t,e,i){var r=new X(this.currentBounds.x,this.currentBounds.y);e.grid.isChildGrid&&e.grid.allowRowBreakAcrossPages&&this.startLocation.x!==this.currentBounds.x&&(r.x=this.startLocation.x),t.bounds=new Z(r,new J(0,0)),this.gridHeight=0<e.rowBreakHeight?this.currentPageBounds.height:0,e.grid.style.cellPadding.top+this.currentBounds.y+e.grid.style.cellPadding.bottom<this.currentPageBounds.height&&(e.rowBreakHeight=this.currentBounds.y+i-this.currentPageBounds.height);for(var n=0;n<e.cells.count;n++){var o=e.cells.getCell(n);o.measureHeight()===i&&o.value instanceof Jo&&(e.rowBreakHeight=0)}for(n=this.cellStartIndex;n<=this.cellEndIndex;n++){var s=this.Grid.columns.getColumn(n).width,a=e.cells.getCell(n).columnSpan+n>this.cellEndIndex+1&&1<e.cells.getCell(n).columnSpan;if(!a)for(var h=1;h<e.cells.getCell(n).columnSpan;h++)e.cells.getCell(n+h).isCellMergeContinue=!0,s+=this.Grid.columns.getColumn(n+h).width;var l=new J(s,0<this.gridHeight?this.gridHeight:this.currentPageBounds.height),u=e.cells.getCell(n).style,u=(e.cells.getCell(n).style=u,null);e.cells.getCell(n)._rowHeight=e.height,u=e.cells.getCell(n).draw(this.currentGraphics,new Z(r,l),a),0<e.rowBreakHeight&&null!=u&&void 0!==u.remainder&&(e.cells.getCell(n).FinishedDrawingCell=!1,e.cells.getCell(n).remainingString=null==u.remainder?" ":u.remainder,e.rowBreakHeight=i-u.actualSize.height),t.isFinish=t.isFinish&&e.cells.getCell(n).FinishedDrawingCell,e.cells.getCell(n).value instanceof Jo&&(l=e.cells.getCell(n).value,this.rowBreakPageHeightCellIndex=n,this.Grid.columns.getColumn(n).width>=this.currentGraphics.clientSize.width)?(r.x=this.rowLayoutBoundsWidth,r.x+=l.style.cellSpacing):r.x+=this.Grid.columns.getColumn(n).width}this.currentBounds.y+=0<this.gridHeight?this.gridHeight:i,t.bounds=new Z(new X(t.bounds.x,t.bounds.y),new J(r.x,r.y))},$.repeatRowIndex=-1,$);function $(t){t=Qo.call(this,t)||this;return t.gridInitialWidth=0,t.gridSize=new J(0,0),t.parentCellIndex=0,t.tempWidth=0,t.childheight=0,t.isChildGrid=!1,t.hasRowSpanSpan=!1,t.isRearranged=!1,t.pageBounds=new Z,t.listOfNavigatePages=[],t.flag=!0,t.columnRanges=[],t.currentLocation=new X(0,0),t.breakRow=!0,t.slr=null,t.remainderText=null,t.isPaginate=!1,t.isOverloadWithPosition=!1,t}L(rs,es=en);var es,is=rs;function rs(t,e){return es.call(this,t,e)||this}L(ss,ns=Zr);var ns,os=ss;function ss(t){return ns.call(this,t)||this}Object.defineProperty(hs.prototype,"rowIndex",{get:function(){return this.gridRowIndex},enumerable:!0,configurable:!0}),Object.defineProperty(hs.prototype,"cellIndex",{get:function(){return this.gridCellIndex},enumerable:!0,configurable:!0}),Object.defineProperty(hs.prototype,"value",{get:function(){return this.internalValue},enumerable:!0,configurable:!0}),Object.defineProperty(hs.prototype,"bounds",{get:function(){return this.gridBounds},enumerable:!0,configurable:!0}),Object.defineProperty(hs.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0});var as=hs;function hs(t,e,i,r,n){this.gridRowIndex=e,this.gridCellIndex=i,this.internalValue=n,this.gridBounds=r,this.pdfGraphics=t}L(cs,ls=as),Object.defineProperty(cs.prototype,"skip",{get:function(){return this.bSkip},set:function(t){this.bSkip=t},enumerable:!0,configurable:!0}),Object.defineProperty(cs.prototype,"style",{get:function(){return this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0});var ls,us=cs;function cs(t,e,i,r,n,o){t=ls.call(this,t,e,i,r,n)||this;return t.style=o,t}L(fs,ps=as),Object.defineProperty(fs.prototype,"style",{get:function(){return this.cellStyle},enumerable:!0,configurable:!0});var ps,ds=fs;function fs(t,e,i,r,n,o){t=ps.call(this,t,e,i,r,n)||this;return t.cellStyle=o,t}Object.defineProperty(ms.prototype,"cancel",{get:function(){return this.isCancel},set:function(t){this.isCancel=t},enumerable:!0,configurable:!0});var gs=ms;function ms(){}L(ws,ys=gs),Object.defineProperty(ws.prototype,"bounds",{get:function(){return this.cellBounds},set:function(t){this.cellBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(ws.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0});var ys,bs=ws;function ws(t,e){var i=ys.call(this)||this;return i.bounds=t,i.pdfPage=e,i}L(vs,Ps=gs),Object.defineProperty(vs.prototype,"result",{get:function(){return this.layoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(vs.prototype,"nextPage",{get:function(){return this.nextPdfPage},set:function(t){this.nextPdfPage=t},enumerable:!0,configurable:!0});var Ps,Ss=vs;function vs(t){var e=Ps.call(this)||this;return e.layoutResult=t,e}L(Os,Cs=bs),Object.defineProperty(Os.prototype,"startRowIndex",{get:function(){return this.startRow},enumerable:!0,configurable:!0});var Cs,Bs=Os;function Os(t,e,i){t=Cs.call(this,t,e)||this;return t.startRow=i,t}L(Ts,xs=Ss);var xs,Ls=Ts;function Ts(t){return xs.call(this,t)||this}Object.defineProperty(ks.prototype,"isFinish",{get:function(){return this.bIsFinished},set:function(t){this.bIsFinished=t},enumerable:!0,configurable:!0}),Object.defineProperty(ks.prototype,"bounds",{get:function(){return this.layoutedBounds},set:function(t){this.layoutedBounds=t},enumerable:!0,configurable:!0});var js=ks;function ks(){this.layoutedBounds=new Z(0,0,0,0)}Vs=function(t,e){return(Vs=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Vs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Ds,Rs=Xr),Object.defineProperty(Ds.prototype,"element",{get:function(){return this.elements},enumerable:!0,configurable:!0}),Ds.prototype.layoutInternal=function(t){var e=t.page,i=t.bounds,r=this.element.getBounds(),n=(r.x=0,r.y=0,this.shapeBounds.x===this.shapeBounds.y&&this.shapeBounds.y===this.shapeBounds.width&&this.shapeBounds.width===this.shapeBounds.height&&0===this.shapeBounds.height),o=(this.isPdfGrid&&!n&&(r=this.shapeBounds),null),s=new As;for(s.page=e;;){var a=this.raiseBeforePageLayout(e,i),i=a.currentBounds,h=null;if(a.cancel||(s=this.layoutOnPage(e,i,r,t),h=this.raiseEndPageLayout(s),a.cancel=null!==h&&h.cancel),s.end||a.cancel){o=this.getLayoutResult(s);break}if(i=this.getPaginateBounds(t),r=this.getNextShapeBounds(r,s),e=null===h||null===h.nextPage?this.getNextPage(e):h.nextPage,this.isPdfGrid){o=this.getLayoutResult(s);break}}return o},Ds.prototype.raiseBeforePageLayout=function(t,e){var i=!1;return this.element.raiseBeginPageLayout&&(t=new bs(e,t),this.element.onBeginPageLayout(t),i=t.cancel,e=t.bounds),{currentBounds:e,cancel:i}},Ds.prototype.raiseEndPageLayout=function(t){var e=null;return this.element.raiseEndPageLayout&&(t=this.getLayoutResult(t),e=new Ss(t),this.element.onEndPageLayout(e)),e},Ds.prototype.getLayoutResult=function(t){return new en(t.page,t.bounds)},Ds.prototype.getNextShapeBounds=function(t,e){e=e.bounds;return t.y=t.y+e.height,t.height=t.height-e.height,t},Ds.prototype.layoutOnPage=function(t,e,i,r){var n=new As,o=(e=this.checkCorrectCurrentBounds(t,e,r),this.fitsToBounds(e,i)),s=!1;return!(r.format.break===Y.PdfLayoutBreakType.FitElement&&!o&&t===r.page)&&(o=this.getDrawBounds(e,i),this.drawShape(t.graphics,e,o),n.bounds=this.getPageResultBounds(e,i),s=e.height>=i.height),n.end=s||r.format.layout===Y.PdfLayoutType.OnePage,n.page=t,n},Ds.prototype.getDrawBounds=function(t,e){return t.y=t.y-e.y,t.height=t.height+e.y,t},Ds.prototype.drawShape=function(t,e,i){var r=t.save();try{t.setClip(e),this.element.drawGraphicsHelper(t,new X(i.x,i.y))}finally{t.restore(r)}},Ds.prototype.checkCorrectCurrentBounds=function(t,e,i){t=t.graphics.clientSize;return e.width=0<e.width?e.width:t.width-e.x,e.height=0<e.height?e.height:t.height-e.y,this.isPdfGrid&&(e.height=e.height-this.bottomCellPadding),e},Ds.prototype.getPageResultBounds=function(t,e){return t.height=Math.min(t.height,e.height),t},Ds.prototype.fitsToBounds=function(t,e){return e.height<=t.height},Ds.index=0,Ds.splitDiff=0,Ds.last=!1,Ds.borderWidth=0;var Vs,Rs,Ms=Ds;function Ds(t){t=Rs.call(this,t)||this;return t.olderPdfForm=0,t.shapeBounds=new Z,t.totalPageSize=0,t}var As=function(){};Ns=function(t,e){return(Ns=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ns(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Fs,Is=hn),Fs.prototype.getBounds=function(){return this.getBoundsInternal()},Fs.prototype.drawGraphicsHelper=function(t,e){if(null==t)throw new Error("ArgumentNullException :graphics");this.drawShapeHelper(t,e.x,e.y)},Fs.prototype.drawShapeHelper=function(t,e,i){var r=.5!==e||.5!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},Fs.prototype.layout=function(t){return new Ms(this).layout(t)};var Ns,Is,L=Fs;function Fs(){return null!==Is&&Is.apply(this,arguments)||this}Es=function(t,e){return(Es=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Es(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(zs,Gs=L),Object.defineProperty(zs.prototype,"pen",{get:function(){return this.mpen},set:function(t){this.mpen=t},enumerable:!0,configurable:!0});var Es,Gs,L=zs;function zs(t){var e=Gs.call(this)||this;return void 0!==t&&(e.mpen=t),e}Ws=function(t,e){return(Ws=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ws(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Hs,_s=L),Object.defineProperty(Hs.prototype,"brush",{get:function(){return this.mbrush},set:function(t){this.mbrush=t},enumerable:!0,configurable:!0}),Hs.prototype.obtainPen=function(){return null==this.mbrush&&null==this.pen?new ne(new f(0,0,0)):this.pen};var Ws,_s,L=Hs;function Hs(t,e){var i=_s.call(this)||this;return i.mbrush=null,void 0!==t&&(t instanceof ne?i=_s.call(this,t)||this:i.mbrush=e),i}Us=function(t,e){return(Us=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Us(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(j,Ks=L),Object.defineProperty(j.prototype,"fillMode",{get:function(){return this.mfillMode},set:function(t){this.mfillMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"pathPoints",{get:function(){return this.points},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"pathTypes",{get:function(){return this.types},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"pointCount",{get:function(){var t=0;return t=null!=this.mpoints?this.mpoints.length:t},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"lastPoint",{get:function(){return this.getLastPoint()},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"points",{get:function(){return null==this.mpoints&&(this.mpoints=[]),this.mpoints},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"types",{get:function(){return null==this.mpathTypes&&(this.mpathTypes=[]),this.mpathTypes},enumerable:!0,configurable:!0}),j.prototype.draw=function(t,e,i,r){var n;return e instanceof X&&void 0===e.width&&void 0===i?this.drawHelper(t,e.x,e.y):e instanceof Z&&void 0!==e.width&&void 0===i?this.drawHelper(t,e,null):"number"==typeof e&&"number"==typeof i&&void 0===r?this.drawHelper(t,e,i,null):e instanceof X&&i instanceof Zr?this.drawHelper(t,e.x,e.y,i):"number"==typeof e&&(r instanceof Zr||null==r)&&"number"==typeof i?(n=t.graphics.clientSize.width-e,n=new Z(e,i,n,0),this.drawHelper(t,n,r)):(e instanceof Z&&0 instanceof Zr,this.drawHelper(t,e,i))},j.prototype.addArc=function(t,e,i,r,n,o){if(t instanceof Z)this.addArc(t.x,t.y,t.width,t.height,e,i);else for(var s=this.getBezierArcPoints(t,e,e+i,e+r,n,o),a=0;a<s.length;a+=8){var h=[s[a],s[a+1],s[a+2],s[a+3],s[a+4],s[a+5],s[a+6],s[a+7]];this.addPoints(h,Y.PathPointType.Bezier3)}},j.prototype.addBezier=function(t,e,i,r,n,o,s,a){var h;t instanceof X&&e instanceof X&&i instanceof X&&r instanceof X?this.addBezier(t.x,t.y,e.x,e.y,i.x,i.y,r.x,r.y):((h=[]).push(t),h.push(e),h.push(i),h.push(r),h.push(n),h.push(o),h.push(s),h.push(a),this.addPoints(h,Y.PathPointType.Bezier3))},j.prototype.addEllipse=function(t,e,i,r){t instanceof Z?this.addEllipse(t.x,t.y,t.width,t.height):(this.startFigure(),this.addArc(t,e,i,r,0,360),this.closeFigure())},j.prototype.addLine=function(t,e,i,r){var n;t instanceof X&&e instanceof X?this.addLine(t.x,t.y,e.x,e.y):((n=[]).push(t),n.push(e),n.push(i),n.push(r),this.addPoints(n,Y.PathPointType.Line))},j.prototype.addPath=function(t,e){if(t instanceof j)this.addPath(t.pathPoints,t.pathTypes);else{if(null==t)throw new Error("ArgumentNullException:pathPoints");if(null==e)throw new Error("ArgumentNullException:pathTypes");if(t.length!==e.length)throw new Error("The argument arrays should be of equal length.")}},j.prototype.addPie=function(t,e,i,r,n,o){t instanceof Z?this.addPie(t.x,t.y,t.width,t.height,e,i):(this.startFigure(),this.addArc(t,e,i,r,n,o),this.addPoint(new X(t+i/2,e+r/2),Y.PathPointType.Line),this.closeFigure())},j.prototype.addPolygon=function(t){t.length;var e=[];this.startFigure();for(var i=0;i<t.length;i++)e.push(t[i].x),e.push(t[i].y);this.addPoints(e,Y.PathPointType.Line),this.closeFigure()},j.prototype.addRectangle=function(t,e,i,r){var n;t instanceof Z?this.addRectangle(t.x,t.y,t.width,t.height):(n=[],this.startFigure(),n.push(t),n.push(e),n.push(t+i),n.push(e),n.push(t+i),n.push(e+r),n.push(t),n.push(e+r),this.addPoints(n,Y.PathPointType.Line),this.closeFigure())},j.prototype.startFigure=function(){this.mStartFigure=!0},j.prototype.closeAllFigures=function(){for(var t=this.pathPoints[0],e=0;e<this.mpathTypes.length;e++){var i=this.types[e],r=!1;0!==e&&i===Y.PathPointType.Start?(this.closeFigure(e-1),r=!0):e===this.mpathTypes.length-1&&!r&&this.isXps&&t.x===this.pathPoints[e].y&&this.closeFigure(e)}},j.prototype.getLastPoint=function(){var t=new X(0,0),e=this.pointCount;return 0<e&&null!=this.mpoints&&(t.x=this.mpoints[e-1].x,t.y=this.mpoints[e-1].y),t},j.prototype.getBezierArcPoints=function(t,e,i,r,n,o){i<t&&(p=void 0,p=t,t=i,i=p),e<r&&(p=void 0,p=e,e=r,r=p),Math.abs(o)<=90?(s=o,a=1):s=o/(a=Math.ceil(Math.abs(o)/90));for(var s,a,h=(t+i)/2,l=(e+r)/2,u=(i-t)/2,c=(r-e)/2,p=s*(Math.PI/360),d=Math.abs(4/3*(1-Math.cos(p))/Math.sin(p)),f=[],g=0;g<a;g++){var m=(n+g*s)*(Math.PI/180),y=(n+(g+1)*s)*(Math.PI/180),b=Math.cos(m),w=Math.cos(y),m=Math.sin(m),y=Math.sin(y);0<s?f.push(h+u*b,l-c*m,h+u*(b-d*m),l-c*(m+d*b),h+u*(w+d*y),l-c*(y-d*w),h+u*w,l-c*y):f.push(h+u*b,l-c*m,h+u*(b+d*m),l-c*(m-d*b),h+u*(w-d*y),l-c*(y+d*w),h+u*w,l-c*y)}return f},j.prototype.getBoundsInternal=function(){var t=this.pathPoints,e=new Z(0,0,0,0);if(0<t.length){for(var i=t[0].x,r=t[0].x,n=t[0].y,o=t[0].y,s=1;s<t.length;s++)var a=t[s],i=Math.min(a.x,i),r=Math.max(a.x,r),n=Math.min(a.y,n),o=Math.max(a.y,o);e=new Z(i,n,r-i,o-n)}return e},j.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException :graphics");t.drawPath(this.obtainPen(),this.brush,this)},j.prototype.addPoints=function(t,e,i,r){if(void 0===i&&void 0===r)this.addPoints(t,e,0,t.length);else for(var n=i;n<r;n++){var o=new X(t[n],t[n+1]);n===i?this.pointCount<=0||this.mStartFigure?(this.addPoint(o,Y.PathPointType.Start),this.mStartFigure=!1):o.x===this.lastPoint.x||o.y===this.lastPoint.y||this.isBeziers3?o.x!==this.lastPoint.x&&o.y!==this.lastPoint.y&&this.addPoint(o,Y.PathPointType.Bezier3):this.addPoint(o,Y.PathPointType.Line):this.addPoint(o,e),n++}},j.prototype.addPoint=function(t,e){this.points.push(t),this.types.push(e)},j.prototype.closeFigure=function(t){if(void 0===t)0<this.pointCount&&this.closeFigure(this.pointCount-1),this.startFigure();else{if(t<0)throw new Error("IndexOutOfRangeException()");var e=this.types[t];e|=Y.PathPointType.CloseSubpath,this.types[t]=e}};var Us,Ks,qs=j;function j(t,e,i,r){var n=Ks.call(this)||this;return n.mpoints=null,n.mpathTypes=null,n.mStartFigure=!0,n.mfillMode=Y.PdfFillMode.Alternate,n.isBeziers3=!1,n.isXps=!1,void 0!==t&&(t instanceof ne?(n=Ks.call(this,t)||this,e instanceof pt?(n=Ks.call(this,t,e)||this).fillMode=i:null!=e&&null!=i&&n.addPath(e,i)):t instanceof pt?(n=Ks.call(this,t)||this,null!=e&&(n.fillMode=e),null!=i&&null!=r&&n.addPath(i,r)):n.addPath(t,e)),n}Ys=function(t,e){return(Ys=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ys(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Js,Xs=L),Object.defineProperty(Js.prototype,"x",{get:function(){return this.bounds.x},set:function(t){this.bounds.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(Js.prototype,"y",{get:function(){return this.bounds.y},set:function(t){this.bounds.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(Js.prototype,"width",{get:function(){return this.bounds.width},set:function(t){this.bounds.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(Js.prototype,"height",{get:function(){return this.bounds.height},set:function(t){this.bounds.height=t},enumerable:!0,configurable:!0}),Js.prototype.getBoundsInternal=function(){return this.bounds};var Ys,Xs,L=Js;function Js(t,e,i,r,n,o){var s=Xs.call(this)||this;return s.bounds=new Z(0,0,0,0),void 0!==t&&(t instanceof ne?(s=Xs.call(this,t,e)||this,i instanceof Z?s.bounds=i:s.bounds=new Z(i,r,n,o)):t instanceof Z?s.bounds=t:s.bounds=new Z(t,e,i,r)),s}Zs=function(t,e){return(Zs=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Zs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Qs,$s=L);var Zs,$s,L=Qs;function Qs(t,e,i,r,n,o,s,a){var h=$s.call(this)||this;return h.startAngle=0,void(h.sweepAngle=0)!==t&&(t instanceof Z&&void 0!==e&&void 0!==i?((h=$s.call(this,t)||this).startAngle=e,h.sweepAngle=i):t instanceof ne?i instanceof Z?((h=$s.call(this,t,e,i)||this).startAngle=r,h.sweepAngle=n):((h=$s.call(this,t,e,i,r,n,o)||this).startAngle=s,h.sweepAngle=a):((h=$s.call(this,t,e,i,r)||this).startAngle=n,h.sweepAngle=o)),h}ta=function(t,e){return(ta=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}ta(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(ia,ea=L),ia.prototype.draw=function(t,e,i,r){var n;return e instanceof X&&void 0===e.width&&void 0===i?this.drawHelper(t,e.x,e.y):e instanceof Z&&void 0!==e.width&&void 0===i?this.drawHelper(t,e,null):"number"==typeof e&&"number"==typeof i&&void 0===r?this.drawHelper(t,e,i,null):e instanceof X&&i instanceof Zr?this.drawHelper(t,e.x,e.y,i):"number"==typeof e&&(r instanceof Zr||null==r)&&"number"==typeof i?(n=t.graphics.clientSize.width-e,n=new Z(e,i,n,0),this.drawHelper(t,n,r)):this.drawHelper(t,e,i)},ia.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException : graphics");t.drawArc(this.obtainPen(),this.bounds,this.startAngle,this.sweepAngle)};var ta,ea,L=ia;function ia(t,e,i,r,n,o,s){var a=this;return void 0===t?a=ea.call(this)||this:t instanceof Z?a=ea.call(this,t,e,i)||this:t instanceof ne?e instanceof Z?a=ea.call(this,t,null,e,i,r)||this:void 0===o&&void 0===s?a=ea.call(this,t,null,0,0,e,i,r,n)||this:void 0!==o&&void 0!==s&&(a=ea.call(this,t,null,e,i,r,n,o,s)||this):void 0!==t&&void 0===n&&void 0===o?a=ea.call(this,0,0,t,e,i,r)||this:void 0!==t&&void 0!==n&&void 0!==o&&(a=ea.call(this,t,e,i,r,n,o)||this),a}ra=function(t,e){return(ra=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}ra(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(sa,na=Tt),sa.prototype.equalsToFont=function(t){return!1},sa.prototype.getLineWidth=function(t,e){var i=0,r=(i=null!=e&&e.textDirection!==Y.PdfTextDirection.None?this.getUnicodeLineWidth(t,i,e).width:this.fontInternal.getLineWidth(t),this.metrics.getSize(e));return i=this.applyFormatSettings(t,e,i*=Tt.charSizeMultiplier*r)},sa.prototype.getCharWidth=function(t,e){t=this.fontInternal.getCharWidth(t);return t*=.001*this.metrics.getSize(e)},sa.prototype.createFontInternal=function(t,e){this.fontInternal=new di(t,this.size),this.calculateStyle(e),this.initializeInternals()},sa.prototype.calculateStyle=function(t){var e=this.fontInternal.ttfMetrics.macStyle;0!=(t&Y.PdfFontStyle.Underline)&&(e|=Y.PdfFontStyle.Underline),0!=(t&Y.PdfFontStyle.Strikeout)&&(e|=Y.PdfFontStyle.Strikeout),this.setStyle(e)},sa.prototype.initializeInternals=function(){var t,e=null,i=null;null!=(e=Tr.enableCache?Tr.cache.search(this):e)?(i=e.getInternals(),(t=(t=e.metrics).clone()).size=this.size,this.metrics=t,this.fontInternal=e.fontInternal):null==e&&(this.fontInternal instanceof di&&(this.fontInternal.isEmbed=this.isEmbedFont),this.fontInternal.createInternals(),i=this.fontInternal.getInternals(),this.metrics=this.fontInternal.metrics),this.metrics.isUnicodeFont=!0,this.setInternals(i)},sa.prototype.setSymbols=function(t){var e=this.fontInternal;null!=e&&e.setSymbols(t)},Object.defineProperty(sa.prototype,"Unicode",{get:function(){return this.isUnicode},enumerable:!0,configurable:!0}),sa.prototype.getUnicodeLineWidth=function(t,e,i){e=0;var t=(new vi).getGlyphIndex(t,this,i.textDirection===Y.PdfTextDirection.RightToLeft,null,!0),i=t.success,r=t.glyphs;if(i&&null!==r)for(var n=this.fontInternal.ttfReader,o=0,s=r.length;o<s;o++){var a=r[o],a=n.getGlyph(a);null!=a&&(e+=a.width)}return{success:i,width:e}};var ra,na,oa=sa;function sa(t,e,i){e=na.call(this,e)||this;return e.isEmbedFont=!1,e.isUnicode=!0,void 0!==i?e.createFontInternal(t,i):e.createFontInternal(t,Y.PdfFontStyle.Regular),e}Object.defineProperty(k.prototype,"dock",{get:function(){return this.dockStyle},set:function(t){this.dockStyle=t,this.resetAlignment()},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"alignment",{get:function(){return this.alignmentStyle},set:function(t){this.setAlignment(t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"foreground",{get:function(){return this.isForeground},set:function(t){this.isForeground=t},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"background",{get:function(){return!this.isForeground},set:function(t){this.isForeground=!t},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"location",{get:function(){return this.currentLocation},set:function(t){this.type===Y.TemplateType.None&&(this.currentLocation=t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"x",{get:function(){return void 0!==this.currentLocation?this.currentLocation.x:0},set:function(t){this.type===Y.TemplateType.None&&(this.currentLocation.x=t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"y",{get:function(){return void 0!==this.currentLocation?this.currentLocation.y:0},set:function(t){this.type===Y.TemplateType.None&&(this.currentLocation.y=t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"size",{get:function(){return this.template.size},set:function(t){this.type===Y.TemplateType.None&&this.template.reset(t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"width",{get:function(){return this.template.width},set:function(t){var e;this.template.width!==t&&this.type===Y.TemplateType.None&&((e=this.template.size).width=t,this.template.reset(e))},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"height",{get:function(){return this.template.height},set:function(t){var e;this.template.height!==t&&this.type===Y.TemplateType.None&&((e=this.template.size).height=t,this.template.reset(e))},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"graphics",{get:function(){return this.template.graphics},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"template",{get:function(){return this.pdfTemplate},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"type",{get:function(){return this.templateType},set:function(t){this.updateDocking(t),this.templateType=t},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"bounds",{get:function(){return new Z(new X(this.x,this.y),this.size)},set:function(t){this.type===Y.TemplateType.None&&(this.location=new X(t.x,t.y),this.size=new J(t.width,t.height))},enumerable:!0,configurable:!0}),k.prototype.InitiateBounds=function(t,e,i,r,n){this.x=t,this.y=e,this.pdfTemplate=new Ti(i,r)},k.prototype.updateDocking=function(t){if(t!==Y.TemplateType.None){switch(t){case Y.TemplateType.Top:this.dock=Y.PdfDockStyle.Top;break;case Y.TemplateType.Bottom:this.dock=Y.PdfDockStyle.Bottom;break;case Y.TemplateType.Left:this.dock=Y.PdfDockStyle.Left;break;case Y.TemplateType.Right:this.dock=Y.PdfDockStyle.Right}this.resetAlignment()}},k.prototype.resetAlignment=function(){this.alignment=Y.PdfAlignmentStyle.None},k.prototype.setAlignment=function(t){if(this.dock===Y.PdfDockStyle.None)this.alignmentStyle=t;else{var e=!1;switch(this.dock){case Y.PdfDockStyle.Left:e=t===Y.PdfAlignmentStyle.TopLeft||t===Y.PdfAlignmentStyle.MiddleLeft||t===Y.PdfAlignmentStyle.BottomLeft||t===Y.PdfAlignmentStyle.None;break;case Y.PdfDockStyle.Top:e=t===Y.PdfAlignmentStyle.TopLeft||t===Y.PdfAlignmentStyle.TopCenter||t===Y.PdfAlignmentStyle.TopRight||t===Y.PdfAlignmentStyle.None;break;case Y.PdfDockStyle.Right:e=t===Y.PdfAlignmentStyle.TopRight||t===Y.PdfAlignmentStyle.MiddleRight||t===Y.PdfAlignmentStyle.BottomRight||t===Y.PdfAlignmentStyle.None;break;case Y.PdfDockStyle.Bottom:e=t===Y.PdfAlignmentStyle.BottomLeft||t===Y.PdfAlignmentStyle.BottomCenter||t===Y.PdfAlignmentStyle.BottomRight||t===Y.PdfAlignmentStyle.None;break;case Y.PdfDockStyle.Fill:e=t===Y.PdfAlignmentStyle.MiddleCenter||t===Y.PdfAlignmentStyle.None}e&&(this.alignmentStyle=t)}},k.prototype.draw=function(t,e){var i=t.page,i=this.calculateBounds(i,e);t.graphics.drawPdfTemplate(this.template,new X(i.x,i.y),new J(i.width,i.height))},k.prototype.calculateBounds=function(t,e){var i=this.bounds;return this.alignmentStyle!==Y.PdfAlignmentStyle.None?i=this.getAlignmentBounds(t,e):this.dockStyle!==Y.PdfDockStyle.None&&(i=this.getDockBounds(t,e)),i},k.prototype.getAlignmentBounds=function(t,e){this.bounds;return this.type===Y.TemplateType.None?this.getSimpleAlignmentBounds(t,e):this.getTemplateAlignmentBounds(t,e)},k.prototype.getSimpleAlignmentBounds=function(t,e){var i=this.bounds,r=t.section.getActualBounds(e,t,!1),n=this.x,o=this.y;switch(this.alignmentStyle){case Y.PdfAlignmentStyle.TopLeft:o=n=0;break;case Y.PdfAlignmentStyle.TopCenter:n=(r.width-this.width)/2,o=0;break;case Y.PdfAlignmentStyle.TopRight:n=r.width-this.width,o=0;break;case Y.PdfAlignmentStyle.MiddleLeft:n=0,o=(r.height-this.height)/2;break;case Y.PdfAlignmentStyle.MiddleCenter:n=(r.width-this.width)/2,o=(r.height-this.height)/2;break;case Y.PdfAlignmentStyle.MiddleRight:n=r.width-this.width,o=(r.height-this.height)/2;break;case Y.PdfAlignmentStyle.BottomLeft:n=0,o=r.height-this.height;break;case Y.PdfAlignmentStyle.BottomCenter:n=(r.width-this.width)/2,o=r.height-this.height;break;case Y.PdfAlignmentStyle.BottomRight:n=r.width-this.width,o=r.height-this.height}return i.x=n,i.y=o,i},k.prototype.getTemplateAlignmentBounds=function(t,e){var i=this.bounds,r=t.section,n=r.getActualBounds(e,t,!1),o=this.x,s=this.y;switch(this.alignmentStyle){case Y.PdfAlignmentStyle.TopLeft:this.type===Y.TemplateType.Left?(o=this.convertSign(n.x),s=0):this.type===Y.TemplateType.Top&&(o=this.convertSign(n.x),s=this.convertSign(n.y));break;case Y.PdfAlignmentStyle.TopCenter:o=(n.width-this.width)/2,s=this.convertSign(n.y);break;case Y.PdfAlignmentStyle.TopRight:this.type===Y.TemplateType.Right?(o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=0):this.type===Y.TemplateType.Top&&(o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=this.convertSign(n.y));break;case Y.PdfAlignmentStyle.MiddleLeft:o=this.convertSign(n.x),s=(n.height-this.height)/2;break;case Y.PdfAlignmentStyle.MiddleCenter:o=(n.width-this.width)/2,s=(n.height-this.height)/2;break;case Y.PdfAlignmentStyle.MiddleRight:o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=(n.height-this.height)/2;break;case Y.PdfAlignmentStyle.BottomLeft:this.type===Y.TemplateType.Left?(o=this.convertSign(n.x),s=n.height-this.height):this.type===Y.TemplateType.Bottom&&(o=this.convertSign(n.x),s=n.height+r.getBottomIndentHeight(e,t,!1)-this.height);break;case Y.PdfAlignmentStyle.BottomCenter:o=(n.width-this.width)/2,s=n.height+r.getBottomIndentHeight(e,t,!1)-this.height;break;case Y.PdfAlignmentStyle.BottomRight:this.type===Y.TemplateType.Right?(o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=n.height-this.height):this.type===Y.TemplateType.Bottom&&(o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=n.height+r.getBottomIndentHeight(e,t,!1)-this.height)}return i.x=o,i.y=s,i},k.prototype.getDockBounds=function(t,e){this.bounds;return this.type===Y.TemplateType.None?this.getSimpleDockBounds(t,e):this.getTemplateDockBounds(t,e)},k.prototype.getSimpleDockBounds=function(t,e){this.bounds;var i=t.section.getActualBounds(e,t,!1),r=this.x,n=this.y,o=this.width,s=this.height;switch(this.dockStyle){case Y.PdfDockStyle.Left:n=r=0,o=this.width,s=i.height;break;case Y.PdfDockStyle.Top:n=r=0,o=i.width,s=this.height;break;case Y.PdfDockStyle.Right:r=i.width-this.width,n=0,o=this.width,s=i.height;break;case Y.PdfDockStyle.Bottom:r=0,n=i.height-this.height,o=i.width,s=this.height;break;case Y.PdfDockStyle.Fill:r=r=0,o=i.width,s=i.height}return new Z(r,n,o,s)},k.prototype.getTemplateDockBounds=function(t,e){this.bounds;var i=t.section,r=i.getActualBounds(e,t,!1),n=i.pageSettings.getActualSize(),o=this.x,s=this.y,a=this.width,h=this.height;switch(this.dockStyle){case Y.PdfDockStyle.Left:o=this.convertSign(r.x),s=0,a=this.width,h=r.height;break;case Y.PdfDockStyle.Top:o=this.convertSign(r.x),s=this.convertSign(r.y),a=n.width,h=this.height,r.height<0&&(s=n.height-r.y);break;case Y.PdfDockStyle.Right:o=r.width+i.getRightIndentWidth(e,t,!1)-this.width,s=0,a=this.width,h=r.height;break;case Y.PdfDockStyle.Bottom:o=this.convertSign(r.x),s=r.height+i.getBottomIndentHeight(e,t,!1)-this.height,a=n.width,h=this.height,r.height<0&&(s-=n.height);break;case Y.PdfDockStyle.Fill:o=o=0,a=r.width,h=r.height}return new Z(o,s,a,h)},k.prototype.convertSign=function(t){return 0!==t||0===t&&1/t==-1/0?-t:t};var aa=k;function k(t,e,i,r,n){t instanceof Z&&void 0===e?this.InitiateBounds(t.x,t.y,t.width,t.height,null):t instanceof Z&&e instanceof or&&void 0===i?this.InitiateBounds(t.x,t.y,t.width,t.height,e):t instanceof X&&e instanceof J&&void 0===i?this.InitiateBounds(t.x,t.y,e.width,e.height,null):t instanceof X&&e instanceof J&&i instanceof or&&void 0===r?this.InitiateBounds(t.x,t.y,e.width,e.height,i):t instanceof J&&void 0===e?this.InitiateBounds(0,0,t.width,t.height,null):"number"==typeof t&&"number"==typeof e&&void 0===i?this.InitiateBounds(0,0,t,e,null):"number"==typeof t&&"number"==typeof e&&i instanceof or&&void 0===r?this.InitiateBounds(0,0,t,e,i):this.InitiateBounds(t,e,i,r,null)}Y.ArabicShape=mi,Y.ArabicShapeRenderer=fi,Y.BeginPageLayoutEventArgs=bs,Y.Bidi=bi,Y.ByteArray=Be,Y.Dictionary=a,Y.DictionaryProperties=l,Y.ElementLayouter=Xr,Y.EndPageLayoutEventArgs=Ss,Y.GetResourceEventHandler=zi,Y.GridCellEventArgs=as,Y.Guid=Di,Y.ImageDecoder=xe,Y.LineInfo=xt,Y.Matrix=he,Y.ObjectInfo=Ft,Y.Operators=h,Y.PageAddedEventArgs=ar,Y.PageSettingsState=br,Y.PdfAction=nt,Y.PdfActionLinkAnnotation=_r,Y.PdfAnnotation=Ar,Y.PdfAnnotationCollection=er,Y.PdfArc=L,Y.PdfArray=p,Y.PdfArrayBuffer=Dt,Y.PdfBitmap=De,Y.PdfBlend=lo,Y.PdfBorders=nn,Y.PdfBrush=pt,Y.PdfBrushes=O,Y.PdfCacheCollection=Br,Y.PdfCancelEventArgs=gs,Y.PdfCatalog=qt,Y.PdfCollection=w,Y.PdfColor=f,Y.PdfColorBlend=fo,Y.PdfCompositeField=Nn,Y.PdfCrossTable=Xt,Y.PdfDestination=$n,Y.PdfDictionary=c,Y.PdfDocument=Tr,Y.PdfDocumentBase=i,Y.PdfDocumentLinkAnnotation=qr,Y.PdfDocumentPageCollection=vr,Y.PdfDocumentTemplate=cr,Y.PdfFont=Tt,Y.PdfFontMetrics=si,Y.PdfFunction=to,Y.PdfGradientBrush=xi,Y.PdfGraphics=Gi,Y.PdfGraphicsState=_i,Y.PdfGrid=Jo,Y.PdfGridBeginCellDrawEventArgs=us,Y.PdfGridBeginPageLayoutEventArgs=Bs,Y.PdfGridCell=Ao,Y.PdfGridCellCollection=No,Y.PdfGridCellStyle=Vo,Y.PdfGridColumn=Fo,Y.PdfGridColumnCollection=Go,Y.PdfGridEndCellDrawEventArgs=ds,Y.PdfGridEndPageLayoutEventArgs=Ls,Y.PdfGridHeaderCollection=Ko,Y.PdfGridLayoutFormat=os,Y.PdfGridLayoutResult=is,Y.PdfGridLayouter=ts,Y.PdfGridRow=Wo,Y.PdfGridRowCollection=Ho,Y.PdfGridRowStyle=Mo,Y.PdfGridStyle=To,Y.PdfGridStyleBase=Oo,Y.PdfImage=ke,Y.PdfLayoutElement=hn,Y.PdfLayoutFormat=Zr,Y.PdfLayoutParams=Qr,Y.PdfLayoutResult=en,Y.PdfLinearGradientBrush=bo,Y.PdfLinkAnnotation=Er,Y.PdfMainObjectCollection=Nt,Y.PdfMargins=Qt,Y.PdfName=o,Y.PdfNumber=u,Y.PdfPaddings=sn,Y.PdfPage=or,Y.PdfPageBase=Qi,Y.PdfPageCountField=qn,Y.PdfPageLayer=Ki,Y.PdfPageLayerCollection=Zi,Y.PdfPageNumberField=Gn,Y.PdfPageSettings=ee,Y.PdfPageSize=$t,Y.PdfPageTemplateElement=aa,Y.PdfPath=qs,Y.PdfPen=ne,Y.PdfRadialGradientBrush=vo,Y.PdfReference=et,Y.PdfReferenceHolder=d,Y.PdfResources=Ri,Y.PdfSampledFunction=ao,Y.PdfSection=yr,Y.PdfSectionCollection=Pr,Y.PdfSectionPageCollection=lr,Y.PdfSectionTemplate=gr,Y.PdfSolidBrush=mt,Y.PdfStandardFont=Mr,Y.PdfStandardFontMetricsFactory=kr,Y.PdfStream=U,Y.PdfStreamWriter=re,Y.PdfString=tt,Y.PdfStringFormat=bt,Y.PdfStringLayoutResult=Bt,Y.PdfStringLayouter=vt,Y.PdfTemplate=Ti,Y.PdfTextElement=pn,Y.PdfTextLayoutResult=yn,Y.PdfTextWebLink=Tn,Y.PdfTilingBrush=Fi,Y.PdfTransformationMatrix=se,Y.PdfTransparency=de,Y.PdfTrueTypeFont=oa,Y.PdfUriAction=ht,Y.PdfUriAnnotation=Bn,Y.PdfViewerPreferences=_t,Y.PdfWriter=kt,Y.PdfWriterHelper=Rt,Y.PointF=X,Y.ProcedureSets=ue,Y.Rectangle=ut,Y.RectangleF=Z,Y.RegisteredObject=Jt,Y.RowLayoutResult=js,Y.RtlCharacters=Pi,Y.RtlRenderer=vi,Y.SaveAnnotationEventHandler=E,Y.SaveCmapEventHandler=q,Y.SaveDescendantFontEventHandler=I,Y.SaveFontDictionaryEventHandler=F,Y.SaveFontProgramEventHandler=Q,Y.SaveSectionCollectionEventHandler=N,Y.SaveSectionEventHandler=G,Y.SaveTemplateEventHandler=z,Y.SizeF=J,Y.StandardWidthTable=ci,Y.StringTokenizer=Pt,Y.TextLayouter=dn,Y.TextPageLayoutResult=mn,Y.WidthTable=hi,Y.defaultToString=M,Object.defineProperty(Y,"__esModule",{value:!0})});
|
|
10
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-compression"),require("@syncfusion/ej2-file-utils")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-compression","@syncfusion/ej2-file-utils"],e):e((t=t||self).ej={},t.ej2Compression,t.ej2FileUtils)}(this,function(Y,V,R){"use strict";function M(t){return"[object String]"===Object.prototype.toString.call(t)?"$s"+t:"$o"+t.toString()}A.prototype.getValue=function(t){t=this.table["$"+this.toStr(t)];if(void 0!==t)return t.value},A.prototype.setValue=function(t,e){var i="$"+this.toStr(t);this.table[i];this.nElements++,this.table[i]={key:t,value:e}},A.prototype.remove=function(t){var t="$"+this.toStr(t),e=this.table[t];return delete this.table[t],this.nElements--,e.value},A.prototype.keys=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.key)}return t},A.prototype.values=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.value)}return t},A.prototype.containsKey=function(t){return!(void 0===this.getValue(t))},A.prototype.clear=function(){this.table={},this.nElements=0},A.prototype.size=function(){return this.nElements};var a=A;function A(t){this.table={},this.nElements=0,this.toStr=t||M}Object.defineProperty(D.prototype,"status",{get:function(){return this.status6},set:function(t){this.status6=t},enumerable:!0,configurable:!0}),Object.defineProperty(D.prototype,"isSaving",{get:function(){return this.isSaving6},set:function(t){this.isSaving6=t},enumerable:!0,configurable:!0}),Object.defineProperty(D.prototype,"objectCollectionIndex",{get:function(){return this.index6},set:function(t){this.index6=t},enumerable:!0,configurable:!0}),Object.defineProperty(D.prototype,"position",{get:function(){return this.position6},set:function(t){this.position6=t},enumerable:!0,configurable:!0}),Object.defineProperty(D.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(D.prototype,"value",{get:function(){return this.internalValue},set:function(t){var e=t;null!==t&&0<t.length?this.internalValue=this.normalizeValue(e=t):this.internalValue=e},enumerable:!0,configurable:!0}),D.prototype.save=function(t){t.write(this.toString())},D.prototype.toString=function(){return this.stringStartMark+this.escapeString(this.value)},D.prototype.clone=function(t){var e=new D;return e.value=this.internalValue,e},D.prototype.escapeString=function(t){for(var e="",i=0,r=t.length;i<r;i++){var n=t[i];D.delimiters.indexOf(n);e+=n}return e},D.prototype.normalizeValue=function(t,e){return t},D.delimiters="()<>[]{}/%}",D.replacements=[" ","\t","\n","\r"];var o=D;function D(t){this.stringStartMark="/",this.internalValue="",this.isSaving6=!1,this.position6=-1,this.internalValue=this.normalizeValue(t)}t.obj="obj",t.endObj="endobj",t.r="R",t.whiteSpace=" ",t.slash="/",t.newLine="\r\n",t.stream="stream",t.endStream="endstream",t.xref="xref",t.f="f",t.n="n",t.trailer="trailer",t.startxref="startxref",t.eof="%%EOF",t.header="%PDF-1.5",t.beginText="BT",t.endText="ET",t.beginPath="m",t.appendLineSegment="l",t.stroke="S",t.fill="f",t.fillEvenOdd="f*",t.fillStroke="B",t.fillStrokeEvenOdd="B*",t.appendbeziercurve="c",t.appendRectangle="re",t.saveState="q",t.restoreState="Q",t.paintXObject="Do",t.modifyCtm="cm",t.modifyTM="Tm",t.setLineWidth="w",t.setLineCapStyle="J",t.setLineJoinStyle="j",t.setDashPattern="d",t.setFlatnessTolerance="i",t.closePath="h",t.closeStrokePath="s",t.closeFillStrokePath="b",t.setCharacterSpace="Tc",t.setWordSpace="Tw",t.setHorizontalScaling="Tz",t.setTextLeading="TL",t.setFont="Tf",t.setRenderingMode="Tr",t.setTextRise="Ts",t.setTextScaling="Tz",t.setCoords="Td",t.goToNextLine="T*",t.setText="Tj",t.setTextWithFormatting="TJ",t.setTextOnNewLine="'",t.selectcolorspaceforstroking="CS",t.selectcolorspacefornonstroking="cs",t.setrbgcolorforstroking="RG",t.setrbgcolorfornonstroking="rg",t.setcmykcolorforstroking="K",t.setcmykcolorfornonstroking="k",t.setgraycolorforstroking="G",t.setgraycolorfornonstroking="g",t.clipPath="W",t.clipPathEvenOdd="W*",t.endPath="n",t.setGraphicsState="gs",t.comment="%",t.evenOdd="*",t.setMiterLimit="M",t.setColorAndPattern="scn",t.setColorAndPatternStroking="SCN";var h=t;function t(){this.forTest="test",this.forTest=t.obj}var l=function(){this.pages="Pages",this.kids="Kids",this.count="Count",this.resources="Resources",this.type="Type",this.size="Size",this.mediaBox="MediaBox",this.parent="Parent",this.root="Root",this.decodeParms="DecodeParms",this.filter="Filter",this.font="Font",this.type1="Type1",this.baseFont="BaseFont",this.encoding="Encoding",this.subtype="Subtype",this.contents="Contents",this.procset="ProcSet",this.colorSpace="ColorSpace",this.extGState="ExtGState",this.pattern="Pattern",this.xObject="XObject",this.length="Length",this.width="Width",this.height="Height",this.bitsPerComponent="BitsPerComponent",this.image="Image",this.dctdecode="DCTDecode",this.columns="Columns",this.blackIs1="BlackIs1",this.k="K",this.s="S",this.predictor="Predictor",this.deviceRgb="DeviceRGB",this.next="Next",this.action="Action",this.link="Link",this.a="A",this.annot="Annot",this.p="P",this.c="C",this.rect="Rect",this.uri="URI",this.annots="Annots",this.ca="ca",this.CA="CA",this.xyz="XYZ",this.fit="Fit",this.dest="Dest",this.BM="BM",this.flatedecode="FlateDecode",this.rotate="Rotate",this.bBox="BBox",this.form="Form",this.w="W",this.cIDFontType2="CIDFontType2",this.cIDToGIDMap="CIDToGIDMap",this.identity="Identity",this.dw="DW",this.fontDescriptor="FontDescriptor",this.cIDSystemInfo="CIDSystemInfo",this.fontName="FontName",this.flags="Flags",this.fontBBox="FontBBox",this.missingWidth="MissingWidth",this.stemV="StemV",this.italicAngle="ItalicAngle",this.capHeight="CapHeight",this.ascent="Ascent",this.descent="Descent",this.leading="Leading",this.avgWidth="AvgWidth",this.fontFile2="FontFile2",this.maxWidth="MaxWidth",this.xHeight="XHeight",this.stemH="StemH",this.registry="Registry",this.ordering="Ordering",this.supplement="Supplement",this.type0="Type0",this.identityH="Identity-H",this.toUnicode="ToUnicode",this.descendantFonts="DescendantFonts",this.background="Background",this.shading="Shading",this.matrix="Matrix",this.antiAlias="AntiAlias",this.function="Function",this.extend="Extend",this.shadingType="ShadingType",this.coords="Coords",this.domain="Domain",this.range="Range",this.functionType="FunctionType",this.bitsPerSample="BitsPerSample",this.patternType="PatternType",this.paintType="PaintType",this.tilingType="TilingType",this.xStep="XStep",this.yStep="YStep",this.viewerPreferences="ViewerPreferences",this.centerWindow="CenterWindow",this.displayTitle="DisplayTitle",this.fitWindow="FitWindow",this.hideMenuBar="HideMenubar",this.hideToolBar="HideToolbar",this.hideWindowUI="HideWindowUI",this.pageMode="PageMode",this.pageLayout="PageLayout",this.duplex="Duplex",this.printScaling="PrintScaling"},c=(Object.defineProperty(e.prototype,"items",{get:function(){return this.primitiveItems},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.status7},set:function(t){this.status7=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSaving",{get:function(){return this.isSaving7},set:function(t){this.isSaving7=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objectCollectionIndex",{get:function(){return this.index7},set:function(t){this.index7=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clonedObject",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.position7},set:function(t){this.position7=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Count",{get:function(){return this.primitiveItems.size()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Dictionary",{get:function(){return this},enumerable:!0,configurable:!0}),e.prototype.getArchive=function(){return this.archive},e.prototype.setArchive=function(t){this.archive=t},e.prototype.setEncrypt=function(t){this.encrypt=t,this.modify()},e.prototype.getEncrypt=function(){return this.encrypt},e.prototype.freezeChanges=function(t){this.bChanged=!1},e.prototype.clone=function(t){return new e},e.prototype.modify=function(){this.bChanged=!0},e.prototype.remove=function(t){"string"!=typeof t?(this.primitiveItems.remove(t.value),this.modify()):this.remove(new o(t))},e.prototype.containsKey=function(t){return this.primitiveItems.containsKey(t.toString())},e.prototype.onBeginSave=function(){this.beginSave.sender.beginSave()},e.prototype.onFontDictionaryBeginSave=function(){this.fontDictionaryBeginSave.sender.fontDictionaryBeginSave()},e.prototype.onDescendantFontBeginSave=function(){this.descendantFontBeginSave.sender.descendantFontBeginSave()},e.prototype.onTemplateBeginSave=function(){this.pageBeginDrawTemplate.sender.pageBeginSave()},e.prototype.onBeginAnnotationSave=function(){this.annotationBeginSave.sender.beginSave()},e.prototype.onSectionBeginSave=function(t){var e=this.sectionBeginSave;e.sender.beginSave(e.state,t)},e.prototype.save=function(t,e){void 0===e?this.save(t,!0):(t.write(this.prefix),void 0!==this.beginSave&&this.onBeginSave(),void 0!==this.descendantFontBeginSave&&this.onDescendantFontBeginSave(),void 0!==this.fontDictionaryBeginSave&&this.onFontDictionaryBeginSave(),void 0!==this.annotationBeginSave&&this.onBeginAnnotationSave(),void 0!==this.sectionBeginSave&&this.onSectionBeginSave(t),void 0!==this.pageBeginDrawTemplate&&this.onTemplateBeginSave(),0<this.Count&&this.saveItems(t),t.write(this.suffix),t.write(h.newLine))},e.prototype.saveItems=function(t){t.write(h.newLine);for(var e=this.primitiveItems.keys(),i=this.primitiveItems.values(),r=0;r<e.length;r++){var n=e[r];new o(n).save(t),t.write(h.whiteSpace),i[r].save(t),t.write(h.newLine)}},e);function e(t){if(this.position7=-1,this.primitiveItems=new a,this.prefix="<<",this.suffix=">>",this.resources=[],this.object=null,this.archive=!0,this.isResource=!1,void 0===t)this.primitiveItems=new a;else{this.primitiveItems=new a;for(var e=t.items.keys(),i=t.items.values(),r=0;r<t.items.size();r++)this.primitiveItems.setValue(e[r],i[r]);this.status=t.status,this.freezeChanges(this)}this.encrypt=!0,this.dictionaryProperties=new l}var N=function(t){this.sender=t},F=function(t){this.sender=t},I=function(t){this.sender=t},E=function(t){this.sender=t},G=function(t,e){this.sender=t,this.state=e},z=function(t){this.sender=t},u=(Object.defineProperty(W.prototype,"intValue",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"isInteger",{get:function(){return this.integer},set:function(t){this.integer=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"status",{get:function(){return this.status5},set:function(t){this.status5=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"isSaving",{get:function(){return this.isSaving5},set:function(t){this.isSaving5=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"objectCollectionIndex",{get:function(){return this.index5},set:function(t){this.index5=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"position",{get:function(){return this.position5},set:function(t){this.position5=t},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),W.prototype.save=function(t){t.write(this.intValue.toString())},W.prototype.clone=function(t){return new W(this.value)},W.floatToString=function(t){t=t.toFixed(2);return t="0.00"===t?".00":t},W.min=function(t,e,i){t=Math.min(t,e);return Math.min(i,t)},W);function W(t){this.position5=-1,this.value=t}s.prototype.items=function(t){return this.internalElements[t]},Object.defineProperty(s.prototype,"count",{get:function(){return this.internalElements.length},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"status",{get:function(){return this.status9},set:function(t){this.status9=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isSaving",{get:function(){return this.isSaving9},set:function(t){this.isSaving9=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"clonedObject",{get:function(){return this.clonedObject9},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"position",{get:function(){return this.position9},set:function(t){this.position9=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"objectCollectionIndex",{get:function(){return this.index9},set:function(t){this.index9=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"CrossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"elements",{get:function(){return this.internalElements},enumerable:!0,configurable:!0}),s.prototype.add=function(t){void 0===this.internalElements&&(this.internalElements=[]),this.internalElements.push(t),this.markedChange()},s.prototype.markedChange=function(){this.bChanged=!0},s.prototype.contains=function(t){for(var e=0;e<this.internalElements.length;e++){var i=this.internalElements[e],r=t;if(null!=i&&void 0!==i&&null!=r&&void 0!==r&&i.value===r.value)return!0}return!1},s.prototype.getItems=function(t){return this.internalElements[t]},s.prototype.save=function(t){t.write(this.startMark);for(var e=0,i=this.count;e<i;e++)this.getItems(e).save(t),e+1!==i&&t.write(h.whiteSpace);t.write(this.endMark)},s.prototype.clone=function(t){this.clonedObject9=null;for(var e=new s,i=0;i<this.internalElements.length;i++){var r=this.internalElements[i];e.add(r.clone(t))}return e.pdfCrossTable=t,this.clonedObject9=e},s.fromRectangle=function(t){return new s([t.x,t.y,t.width,t.height])},s.prototype.insert=function(t,e){if(t<this.internalElements.length&&0<t){for(var i=[],r=0;r<t;r++)i.push(this.internalElements[r]);i.push(e);for(r=t;r<this.internalElements.length;r++)i.push(this.internalElements[r]);this.internalElements=i}else this.internalElements.push(e);this.markChanged()},s.prototype.indexOf=function(t){return this.internalElements.indexOf(t)},s.prototype.remove=function(t){t=this.internalElements.indexOf(t);this.internalElements[t]=null,this.markChanged()},s.prototype.removeAt=function(t){if(this.internalElements.length>t){for(var e=[],i=0;i<t;i++)e.push(this.internalElements[i]);for(i=t+1;i<this.internalElements.length;i++)e.push(this.internalElements[i]);this.internalElements=e}this.markChanged()},s.prototype.clear=function(){this.internalElements=[],this.markChanged()},s.prototype.markChanged=function(){this.bChanged=!0};var p=s;function s(t){if(this.startMark="[",this.endMark="]",this.position9=-1,this.clonedObject9=null,this.isFont=!1,void 0===t)this.internalElements=[];else if(void 0===t||t instanceof s){var e=t;this.internalElements=[];for(r=0;r<e.elements.length;r++)this.internalElements.push(e.elements[r])}else for(var i=t,r=0;r<i.length;r++){var n=new u(i[r]);this.add(n)}}_=function(t,e){return(_=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(K,H=c),Object.defineProperty(K.prototype,"internalStream",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"compress",{get:function(){return this.bCompress},set:function(t){this.bCompress=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"data",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),K.prototype.clearStream=function(){this.internalStream=[],this.items.containsKey(this.dictionaryProperties.filter)&&this.remove(this.dictionaryProperties.filter),this.bCompress=!0,this.modify()},K.prototype.write=function(t){if(null==t)throw new Error("ArgumentNullException:text");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty string, text");this.dataStream2.push(t),this.modify()},K.prototype.writeBytes=function(t){if(null===t)throw new Error("ArgumentNullException:data");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty bytes, data");for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);this.dataStream2.push(e),this.modify()},K.prototype.onCmapBeginSave=function(){this.cmapBeginSave.sender.cmapBeginSave()},K.prototype.onFontProgramBeginSave=function(){this.fontProgramBeginSave.sender.fontProgramBeginSave()},K.prototype.compressContent=function(t,e){if(this.bCompress){for(var i=[],r=0;r<t.length;r++)i.push(t.charCodeAt(r));var n=new Uint8Array(i),o=new V.CompressedStreamWriter;o.write(n,0,n.length),o.close(),t=o.getCompressedString,this.addFilter(this.dictionaryProperties.flatedecode)}return t},K.prototype.addFilter=function(t){var e=this.items.getValue(this.dictionaryProperties.filter),i=e=e instanceof d?e.object:e;null!=e&&((i=new p).insert(0,e),this.items.setValue(this.dictionaryProperties.filter,i)),e=new o(t),null==i?this.items.setValue(this.dictionaryProperties.filter,e):i.insert(0,e)},K.prototype.save=function(t){void 0!==this.cmapBeginSave&&this.onCmapBeginSave(),void 0!==this.fontProgramBeginSave&&this.onFontProgramBeginSave();for(var e="",i=0;i<this.data.length;i++)e+=this.data[i];1<e.length&&!this.isResource&&(e="q\r\n"+e+"Q\r\n");var r=(e=this.compressContent(e,t)).length;this.items.setValue(this.dictionaryProperties.length,new u(r)),H.prototype.save.call(this,t,!1),t.write(this.dicPrefix),t.write(h.newLine),0<e.length&&t.write(e),t.write(h.newLine),t.write(this.dicSuffix),t.write(h.newLine)},K.bytesToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e};var _,H,U=K;function K(t,e){var i=H.call(this,t)||this;return i.dicPrefix="stream",i.dicSuffix="endstream",i.clonedObject2=null,i.bCompress=!0,void 0!==t||void 0!==e?(i.dataStream2=[],i.dataStream2=e,i.bCompress2=!1):(i.dataStream2=[],i.bCompress2=!0),i}var q=function(t){this.sender=t},Q=function(t){this.sender=t},tt=((nt=(nt=Y.InternalEnum||(Y.InternalEnum={})).ForceEncoding||(nt.ForceEncoding={}))[nt.None=0]="None",nt[nt.Ascii=1]="Ascii",nt[nt.Unicode=2]="Unicode",Object.defineProperty(r.prototype,"hex",{get:function(){return this.bHex},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"value",{get:function(){return this.stringValue},set:function(t){this.stringValue=t,this.data=null},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"status",{get:function(){return this.status1},set:function(t){this.status1=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isSaving",{get:function(){return this.isSaving1},set:function(t){this.isSaving1=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"objectCollectionIndex",{get:function(){return this.index1},set:function(t){this.index1=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"clonedObject",{get:function(){return this.clonedObject1},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"position",{get:function(){return this.position1},set:function(t){this.position1=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"CrossTable",{get:function(){return this.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"converted",{get:function(){return this.bConverted},set:function(t){this.bConverted=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"encode",{get:function(){return this.bForceEncoding},set:function(t){this.bForceEncoding=t},enumerable:!0,configurable:!0}),r.bytesToHex=function(t){return null!=t&&0,""},r.prototype.save=function(t){if(null===t)throw new Error("ArgumentNullException : writer");void 0!==this.encode&&this.encode===Y.InternalEnum.ForceEncoding.Ascii?t.write(this.pdfEncode()):t.write(r.stringMark[0]+this.value+r.stringMark[1])},r.prototype.pdfEncode=function(){var t="";if(void 0!==this.encode&&this.encode===Y.InternalEnum.ForceEncoding.Ascii){for(var e=this.escapeSymbols(this.value),i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);t=r.stringMark[0]+t+r.stringMark[1]}else t=this.value;return t},r.prototype.escapeSymbols=function(t){for(var e=[],i=0;i<t.length;i++){var r=t.charCodeAt(i);switch(r){case 40:case 41:e.push(92),e.push(r);break;case 13:e.push(92),e.push(114);break;case 92:e.push(92),e.push(r);break;default:e.push(r)}}return e},r.prototype.clone=function(t){if(null!==this.clonedObject1&&this.clonedObject1.CrossTable===t)return this.clonedObject1;this.clonedObject1=null;var e=new r(this.stringValue);return e.bHex=this.bHex,e.crossTable=t,e.isColorSpace=this.isColorSpace,this.clonedObject1=e},r.toUnicodeArray=function(t,e){if(null==t)throw new Error("Argument Null Exception : value");for(var i=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);i.push(n/256>>>0),i.push(255&n)}return i},r.byteToString=function(t){if(null==t)throw new Error("Argument Null Exception : stream");for(var e="",i=0;i<t.length;++i)e+=String.fromCharCode(t[i]);return e},r.stringMark="()",r.hexStringMark="<>",r.hexFormatPattern="{0:X2}",r);function r(t){if(this.bHex=!1,this.position1=-1,this.clonedObject1=null,this.bDecrypted=!1,this.isParentDecrypted=!1,this.isPacked=!1,this.isFormField=!1,this.isColorSpace=!1,this.isHexString=!0,void 0===t)this.bHex=!1;else if(!(0<t.length&&"0xfeff"===t[0])){this.stringValue=t,this.data=[];for(var e=0;e<t.length;++e)this.data.push(t.charCodeAt(e))}}Object.defineProperty(it.prototype,"status",{get:function(){return this.status3},set:function(t){this.status3=t},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"isSaving",{get:function(){return this.isSaving3},set:function(t){this.isSaving3=t},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"objectCollectionIndex",{get:function(){return this.index3},set:function(t){this.index3=t},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"position",{get:function(){return this.position3},set:function(t){this.position3=t},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),it.prototype.save=function(t){t.write(this.toString())},it.prototype.toString=function(){return this.objNumber.toString()+" "+this.genNumber.toString()+" R"},it.prototype.clone=function(t){return null};var et=it;function it(t,e){this.index3=-1,this.position3=-1,this.objNumber=0,this.genNumber=0,"number"==typeof t&&"number"==typeof e?(this.objNumber=t,this.genNumber=e):(this.objNumber=Number(t),this.genNumber=Number(e))}Object.defineProperty(rt.prototype,"status",{get:function(){return this.status4},set:function(t){this.status4=t},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"isSaving",{get:function(){return this.isSaving4},set:function(t){this.isSaving4=t},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"objectCollectionIndex",{get:function(){return this.index4},set:function(t){this.index4=t},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"position",{get:function(){return this.position4},set:function(t){this.position4=t},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"object",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"index",{get:function(){return this.objectIndex},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"element",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),rt.prototype.initialize=function(t){t instanceof p||t instanceof c||t instanceof o||t instanceof u||t instanceof U||t instanceof et||t instanceof tt?this.primitiveObject=t:this.initialize(t.element)},rt.prototype.save=function(t){t.position;var e=t.document.crossTable;this.object.isSaving=!0;e.getReference(this.object).save(t)},rt.prototype.clone=function(t){return null};var d=rt;function rt(t,e){this.index4=-1,this.position4=-1,this.objectIndex=-1,this.dictionaryProperties=new l,this.initialize(t)}Object.defineProperty(ot.prototype,"next",{get:function(){return this.action},set:function(t){this.action=t,this.dictionary.items.setValue(this.dictionaryProperties.next,new d(this.action))},enumerable:!0,configurable:!0}),Object.defineProperty(ot.prototype,"dictionary",{get:function(){return void 0===this.pdfDictionary&&(this.pdfDictionary=new c),this.pdfDictionary},enumerable:!0,configurable:!0}),ot.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.action))},Object.defineProperty(ot.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0});var nt=ot;function ot(){this.action=null,this.dictionaryProperties=new l,this.initialize()}st=function(t,e){return(st=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}st(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(lt,at=nt),Object.defineProperty(lt.prototype,"uri",{get:function(){return this.uniformResourceIdentifier},set:function(t){this.uniformResourceIdentifier=t,this.dictionary.items.setValue(this.dictionaryProperties.uri,new tt(this.uniformResourceIdentifier))},enumerable:!0,configurable:!0}),lt.prototype.initialize=function(){at.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.s,new o(this.dictionaryProperties.uri))};var st,at,ht=lt;function lt(t){var e=at.call(this)||this;return e.uniformResourceIdentifier="",e}(i=Y.PdfHorizontalAlignment||(Y.PdfHorizontalAlignment={}))[i.Left=0]="Left",i[i.Center=1]="Center",i[i.Right=2]="Right",(i=Y.PdfVerticalAlignment||(Y.PdfVerticalAlignment={}))[i.Top=0]="Top",i[i.Middle=1]="Middle",i[i.Bottom=2]="Bottom",(i=Y.PdfTextAlignment||(Y.PdfTextAlignment={}))[i.Left=0]="Left",i[i.Center=1]="Center",i[i.Right=2]="Right",i[i.Justify=3]="Justify",(i=Y.TextRenderingMode||(Y.TextRenderingMode={}))[i.Fill=0]="Fill",i[i.Stroke=1]="Stroke",i[i.FillStroke=2]="FillStroke",i[i.None=3]="None",i[i.ClipFlag=4]="ClipFlag",i[i.ClipFill=4]="ClipFill",i[i.ClipStroke=5]="ClipStroke",i[i.ClipFillStroke=6]="ClipFillStroke",i[i.Clip=7]="Clip",(i=Y.PdfLineJoin||(Y.PdfLineJoin={}))[i.Miter=0]="Miter",i[i.Round=1]="Round",i[i.Bevel=2]="Bevel",(i=Y.PdfLineCap||(Y.PdfLineCap={}))[i.Flat=0]="Flat",i[i.Round=1]="Round",i[i.Square=2]="Square",(i=Y.PdfDashStyle||(Y.PdfDashStyle={}))[i.Solid=0]="Solid",i[i.Dash=1]="Dash",i[i.Dot=2]="Dot",i[i.DashDot=3]="DashDot",i[i.DashDotDot=4]="DashDotDot",i[i.Custom=5]="Custom",(i=Y.PdfFillMode||(Y.PdfFillMode={}))[i.Winding=0]="Winding",i[i.Alternate=1]="Alternate",(i=Y.PdfColorSpace||(Y.PdfColorSpace={}))[i.Rgb=0]="Rgb",i[i.Cmyk=1]="Cmyk",i[i.GrayScale=2]="GrayScale",i[i.Indexed=3]="Indexed",(i=Y.PdfBlendMode||(Y.PdfBlendMode={}))[i.Normal=0]="Normal",i[i.Multiply=1]="Multiply",i[i.Screen=2]="Screen",i[i.Overlay=3]="Overlay",i[i.Darken=4]="Darken",i[i.Lighten=5]="Lighten",i[i.ColorDodge=6]="ColorDodge",i[i.ColorBurn=7]="ColorBurn",i[i.HardLight=8]="HardLight",i[i.SoftLight=9]="SoftLight",i[i.Difference=10]="Difference",i[i.Exclusion=11]="Exclusion",i[i.Hue=12]="Hue",i[i.Saturation=13]="Saturation",i[i.Color=14]="Color",i[i.Luminosity=15]="Luminosity",(i=Y.PdfGraphicsUnit||(Y.PdfGraphicsUnit={}))[i.Centimeter=0]="Centimeter",i[i.Pica=1]="Pica",i[i.Pixel=2]="Pixel",i[i.Point=3]="Point",i[i.Inch=4]="Inch",i[i.Document=5]="Document",i[i.Millimeter=6]="Millimeter",(i=Y.PdfGridImagePosition||(Y.PdfGridImagePosition={}))[i.Fit=0]="Fit",i[i.Center=1]="Center",i[i.Stretch=2]="Stretch",i[i.Tile=3]="Tile",(i=Y.PdfTextDirection||(Y.PdfTextDirection={}))[i.None=0]="None",i[i.LeftToRight=1]="LeftToRight",i[i.RightToLeft=2]="RightToLeft";g.prototype.assignRGB=function(t,e,i,r){void 0===t||void 0===e||void 0===i?this.filled=!1:(this.cyanColor=0,this.magentaColor=0,this.yellowColor=0,this.blackColor=0,this.grayColor=0,this.redColor=t,this.greenColor=e,this.blueColor=i,this.alpha=void 0===r?g.maxColourChannelValue:r,this.filled=!0,this.assignCMYK(t,e,i))},g.prototype.assignCMYK=function(t,e,i){var t=t/g.maxColourChannelValue,e=e/g.maxColourChannelValue,i=i/g.maxColourChannelValue,r=u.min(1-t,1-e,1-i),t=1===r?0:(1-t-r)/(1-r),e=1===r?0:(1-e-r)/(1-r),i=1===r?0:(1-i-r)/(1-r);this.blackColor=r,this.cyanColor=t,this.magentaColor=e,this.yellowColor=i},Object.defineProperty(g.prototype,"r",{get:function(){return this.redColor},set:function(t){this.redColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"red",{get:function(){return this.r/g.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"b",{get:function(){return this.blueColor},set:function(t){this.blueColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"blue",{get:function(){return this.b/g.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"c",{get:function(){return this.cyanColor},set:function(t){this.cyanColor=t<0?0:1<t?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"k",{get:function(){return this.blackColor},set:function(t){this.blackColor=t<0?0:1<t?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"m",{get:function(){return this.magentaColor},set:function(t){this.magentaColor=t<0?0:1<t?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"y",{get:function(){return this.yellowColor},set:function(t){this.yellowColor=t<0?0:1<t?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"g",{get:function(){return this.greenColor},set:function(t){this.greenColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"green",{get:function(){return this.g/g.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"gray",{get:function(){return(this.redColor+this.greenColor+this.blueColor)/(3*g.maxColourChannelValue)},set:function(t){this.grayColor=t<0?0:1<t?1:t,this.r=this.grayColor*g.maxColourChannelValue,this.g=this.grayColor*g.maxColourChannelValue,this.b=this.grayColor*g.maxColourChannelValue,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"isEmpty",{get:function(){return!this.filled},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"a",{get:function(){return this.alpha},set:function(t){this.alpha=t<0?0:t,this.filled=!0},enumerable:!0,configurable:!0}),g.prototype.toString=function(t,e){if(this.isEmpty)return"";var i="";switch(t){case Y.PdfColorSpace.Rgb:i=this.rgbToString(e);break;case Y.PdfColorSpace.GrayScale:i=this.grayScaleToString(e);break;case Y.PdfColorSpace.Cmyk:i=this.cmykToString(e)}return i},g.prototype.grayScaleToString=function(t){var e=this.gray,i="",r=null;return null==(r=t?g.grayStringsSroke.containsKey(e)?g.grayStringsSroke.getValue(e):null:g.grayStringsFill.containsKey(e)?g.grayStringsFill.getValue(e):null)?t&&(i=e.toString()+" G",g.grayStringsSroke.setValue(e,i)):i=r.toString(),i+h.newLine},g.prototype.rgbToString=function(t){var e=this.r,i=this.g,r=this.b,n=(e<<16)+(i<<8)+r,o=(t&&(n+=1<<24),""),s=null;return null==(s=g.rgbStrings.containsKey(n)?g.rgbStrings.getValue(n):s)?(e=e/g.maxColourChannelValue,i=i/g.maxColourChannelValue,r=r/g.maxColourChannelValue,o=t?e.toString()+" "+i.toString()+" "+r.toString()+" RG":e.toString()+" "+i.toString()+" "+r.toString()+" rg",g.rgbStrings.setValue(n,o)):o=s.toString(),o+h.newLine},g.prototype.cmykToString=function(t){var e=this.c,i=this.m,r=this.y,n=this.b;return e.toString()+" "+i.toString()+" "+r.toString()+" "+n.toString()+" K"+h.newLine},g.prototype.toArray=function(t){var e=new p;return t===Y.PdfColorSpace.Rgb&&(e.add(new u(this.red)),e.add(new u(this.green)),e.add(new u(this.blue))),e},g.rgbStrings=new a,g.grayStringsSroke=new a,g.grayStringsFill=new a,g.maxColourChannelValue=255;var f=g;function g(t,e,i,r){void 0===t?void 0!==e&&void 0!==i&&void 0!==r?this.assignRGB(e,i,r):this.filled=!1:t instanceof g?(this.redColor=t.r,this.greenColor=t.g,this.blueColor=t.b,this.grayColor=t.gray,this.alpha=t.alpha,this.filled=0!==this.alpha):"number"==typeof t&&void 0===e&&void 0===i&&void 0===r?(this.redColor=(t=1<(t=t<0?0:t)?1:t)*g.maxColourChannelValue,this.greenColor=t*g.maxColourChannelValue,this.blueColor=t*g.maxColourChannelValue,this.cyanColor=t,this.magentaColor=t,this.yellowColor=t,this.blackColor=t,this.grayColor=t,this.alpha=g.maxColourChannelValue,this.filled=!0):void 0===r?this.assignRGB(t,e,i):this.assignRGB(e,i,r,t)}var J=function(t,e){void 0===t?(this.x=0,this.y=0):(this.x=null!==t?t:0,this.y=null!==e?e:0)},X=function(t,e){void 0===e?(this.height=0,this.width=0):(this.height=null!==e?e:0,this.width=null!==t?t:0)},Z=function(t,e,i,r){var n;typeof t==typeof t&&void 0===t?(this.x=0,this.y=0,this.height=0,this.width=0):t instanceof J&&e instanceof X&&void 0===i?(this.x=(n=t).x,this.y=n.y,this.height=(n=e).height,this.width=n.width):(n=e,e=i,i=r,this.x=t,this.y=n,this.height=i,this.width=e)},ut=(Object.defineProperty(ct.prototype,"width",{get:function(){return this.right-this.left},enumerable:!0,configurable:!0}),Object.defineProperty(ct.prototype,"height",{get:function(){return this.bottom-this.top},enumerable:!0,configurable:!0}),Object.defineProperty(ct.prototype,"topLeft",{get:function(){return new J(this.left,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(ct.prototype,"size",{get:function(){return new X(this.width,this.height)},enumerable:!0,configurable:!0}),ct.prototype.toString=function(){return this.topLeft+"x"+this.size},ct);function ct(t,e,i,r){this.left=t,this.top=e,this.right=i,this.bottom=r}dt.prototype.clone=function(){return this};var pt=dt;function dt(){}ft=function(t,e){return(ft=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}ft(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(yt,gt=pt),Object.defineProperty(yt.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),yt.prototype.monitorChanges=function(t,e,i,r,n){if(null==e)throw new Error("ArgumentNullException:streamWriter");var o=!1;return e.setColorAndSpace(this.pdfColor,n,!(o=!0)),o},yt.prototype.resetChanges=function(t){t.setColorAndSpace(new f(0,0,0),Y.PdfColorSpace.Rgb,!1)};var ft,gt,mt=yt;function yt(t){var e=gt.call(this)||this;return e.pdfColor=t,e}(i=Y.PdfFontStyle||(Y.PdfFontStyle={}))[i.Regular=0]="Regular",i[i.Bold=1]="Bold",i[i.Italic=2]="Italic",i[i.Underline=4]="Underline",i[i.Strikeout=8]="Strikeout",(i=Y.PdfFontFamily||(Y.PdfFontFamily={}))[i.Helvetica=0]="Helvetica",i[i.Courier=1]="Courier",i[i.TimesRoman=2]="TimesRoman",i[i.Symbol=3]="Symbol",i[i.ZapfDingbats=4]="ZapfDingbats",(i=Y.PdfFontType||(Y.PdfFontType={}))[i.Standard=0]="Standard",i[i.TrueType=1]="TrueType",i[i.TrueTypeEmbedded=2]="TrueTypeEmbedded",(i=Y.PdfWordWrapType||(Y.PdfWordWrapType={}))[i.None=0]="None",i[i.Word=1]="Word",i[i.WordOnly=2]="WordOnly",i[i.Character=3]="Character",(i=Y.PdfSubSuperScript||(Y.PdfSubSuperScript={}))[i.None=0]="None",i[i.SuperScript=1]="SuperScript",i[i.SubScript=2]="SubScript",(i=Y.FontEncoding||(Y.FontEncoding={}))[i.Unknown=0]="Unknown",i[i.StandardEncoding=1]="StandardEncoding",i[i.MacRomanEncoding=2]="MacRomanEncoding",i[i.MacExpertEncoding=3]="MacExpertEncoding",i[i.WinAnsiEncoding=4]="WinAnsiEncoding",i[i.PdfDocEncoding=5]="PdfDocEncoding",i[i.IdentityH=6]="IdentityH",(i=Y.TtfCmapFormat||(Y.TtfCmapFormat={}))[i.Apple=0]="Apple",i[i.Microsoft=4]="Microsoft",i[i.Trimmed=6]="Trimmed",(i=Y.TtfCmapEncoding||(Y.TtfCmapEncoding={}))[i.Unknown=0]="Unknown",i[i.Symbol=1]="Symbol",i[i.Unicode=2]="Unicode",i[i.Macintosh=3]="Macintosh",(i=Y.TtfPlatformID||(Y.TtfPlatformID={}))[i.AppleUnicode=0]="AppleUnicode",i[i.Macintosh=1]="Macintosh",i[i.Iso=2]="Iso",i[i.Microsoft=3]="Microsoft",(i=Y.TtfMicrosoftEncodingID||(Y.TtfMicrosoftEncodingID={}))[i.Undefined=0]="Undefined",i[i.Unicode=1]="Unicode",(i=Y.TtfMacintoshEncodingID||(Y.TtfMacintoshEncodingID={}))[i.Roman=0]="Roman",i[i.Japanese=1]="Japanese",i[i.Chinese=2]="Chinese",(i=Y.FontDescriptorFlags||(Y.FontDescriptorFlags={}))[i.FixedPitch=1]="FixedPitch",i[i.Serif=2]="Serif",i[i.Symbolic=4]="Symbolic",i[i.Script=8]="Script",i[i.Nonsymbolic=32]="Nonsymbolic",i[i.Italic=64]="Italic",i[i.ForceBold=262144]="ForceBold",(i=Y.TtfCompositeGlyphFlags||(Y.TtfCompositeGlyphFlags={}))[i.Arg1And2AreWords=1]="Arg1And2AreWords",i[i.ArgsAreXyValues=2]="ArgsAreXyValues",i[i.RoundXyToGrid=4]="RoundXyToGrid",i[i.WeHaveScale=8]="WeHaveScale",i[i.Reserved=16]="Reserved",i[i.MoreComponents=32]="MoreComponents",i[i.WeHaveAnXyScale=64]="WeHaveAnXyScale",i[i.WeHaveTwoByTwo=128]="WeHaveTwoByTwo",i[i.WeHaveInstructions=256]="WeHaveInstructions",i[i.UseMyMetrics=512]="UseMyMetrics";Object.defineProperty(wt.prototype,"alignment",{get:function(){return this.textAlignment},set:function(t){this.textAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"textDirection",{get:function(){return this.direction},set:function(t){this.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"lineAlignment",{get:function(){return void 0===this.verticalAlignment||null==this.verticalAlignment?Y.PdfVerticalAlignment.Top:this.verticalAlignment},set:function(t){this.verticalAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"rightToLeft",{get:function(){return void 0!==this.isRightToLeft&&null!=this.isRightToLeft&&this.isRightToLeft},set:function(t){this.isRightToLeft=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"characterSpacing",{get:function(){return void 0===this.internalCharacterSpacing||null==this.internalCharacterSpacing?0:this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"wordSpacing",{get:function(){return void 0===this.internalWordSpacing||null==this.internalWordSpacing?0:this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"lineSpacing",{get:function(){return void 0===this.leading||null==this.leading?0:this.leading},set:function(t){this.leading=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"clipPath",{get:function(){return void 0!==this.clip&&null!=this.clip&&this.clip},set:function(t){this.clip=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"subSuperScript",{get:function(){return void 0===this.pdfSubSuperScript||null==this.pdfSubSuperScript?Y.PdfSubSuperScript.None:this.pdfSubSuperScript},set:function(t){this.pdfSubSuperScript=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"paragraphIndent",{get:function(){return void 0===this.internalParagraphIndent||null==this.internalParagraphIndent?0:this.internalParagraphIndent},set:function(t){this.internalParagraphIndent=t,this.firstLineIndent=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"lineLimit",{get:function(){return this.internalLineLimit},set:function(t){this.internalLineLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"measureTrailingSpaces",{get:function(){return void 0!==this.trailingSpaces&&null!=this.trailingSpaces&&this.trailingSpaces},set:function(t){this.trailingSpaces=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"noClip",{get:function(){return void 0!==this.isNoClip&&null!=this.isNoClip&&this.isNoClip},set:function(t){this.isNoClip=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"wordWrap",{get:function(){return this.wordWrapType},set:function(t){this.wordWrapType=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"horizontalScalingFactor",{get:function(){return this.scalingFactor},set:function(t){if(t<=0)throw new Error("ArgumentOutOfRangeException:The scaling factor cant be less of equal to zero, ScalingFactor");this.scalingFactor=t},enumerable:!0,configurable:!0}),Object.defineProperty(wt.prototype,"firstLineIndent",{get:function(){return void 0===this.initialLineIndent||null==this.initialLineIndent?0:this.initialLineIndent},set:function(t){this.initialLineIndent=t},enumerable:!0,configurable:!0}),wt.prototype.clone=function(){return this};var bt=wt;function wt(t,e){this.scalingFactor=100,this.wordWrapType=Y.PdfWordWrapType.Word,this.internalLineLimit=!0,this.wordWrapType=Y.PdfWordWrapType.Word,void 0!==t&&"string"!=typeof t&&(this.textAlignment=t),void 0!==e&&(this.verticalAlignment=e)}Object.defineProperty(St.prototype,"length",{get:function(){return this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(St.prototype,"end",{get:function(){return this.currentPosition===this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(St.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),St.getCharsCount=function(t,e){if("string"==typeof e){if(null==t)throw new Error("ArgumentNullException:wholeText");for(var i=0,r=0;-1!==(r=t.indexOf(e,r));)i++,r++;return i}if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:symbols");for(var n=0,o=0,s=t.length;o<s;o++){var a=t[o];this.contains(e,a)&&n++}return n},St.prototype.readLine=function(){for(var t,e=this.currentPosition;e<this.length;){var i=this.text[e];switch(i){case"\r":case"\n":var r=this.text.substr(this.currentPosition,e-this.currentPosition);return this.currentPosition=e+1,"\r"===i&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,r}e++}return e>this.currentPosition?(t=this.text.substr(this.currentPosition,e-this.currentPosition),this.currentPosition=e,t):null},St.prototype.peekLine=function(){var t=this.currentPosition,e=this.readLine();return this.currentPosition=t,e},St.prototype.readWord=function(){for(var t,e=this.currentPosition;e<this.length;){var i=this.text[e];switch(i){case"\r":case"\n":var r=this.text.substr(this.currentPosition,e-this.currentPosition);return this.currentPosition=e+1,"\r"===i&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,r;case" ":case"\t":e===this.currentPosition&&e++;r=this.text.substr(this.currentPosition,e-this.currentPosition);return this.currentPosition=e,r}e++}return e>this.currentPosition?(t=this.text.substr(this.currentPosition,e-this.currentPosition),this.currentPosition=e,t):null},St.prototype.peekWord=function(){var t=this.currentPosition,e=this.readWord();return this.currentPosition=t,e},St.prototype.read=function(t){if(void 0===t)return e="0",this.end||(e=this.text[this.currentPosition],this.currentPosition++),e;for(var e,i=0,r="";!this.end&&i<t;)r+=e=this.read(),i++;return r},St.prototype.peek=function(){var t="0";return t=this.end?t:this.text[this.currentPosition]},St.prototype.close=function(){this.text=null},St.prototype.readToEnd=function(){var t=0===this.currentPosition?this.text:this.text.substr(this.currentPosition,this.length-this.currentPosition);return this.currentPosition=this.length,t},St.contains=function(t,e){for(var i=!1,r=0;r<t.length;r++)if(t[r]===e){i=!0;break}return i},St.spaces=[St.whiteSpace=" ",St.tab="\t"],St.whiteSpacePattern="^[ \t]+$";var Pt=St;function St(t){if(this.currentPosition=0,null==t)throw new Error("ArgumentNullException:text");this.text=t}Ct.prototype.layout=function(t,e,i,r,n,o,s){return s=(r instanceof Z?(this.initialize(t,e,i,r,n),this.isOverloadWithPosition=o,this.clientSize=s):(this.initialize(t,e,i,r),this.isOverloadWithPosition=n,this.clientSize=o),this.doLayout()),this.clear(),s},Ct.prototype.initialize=function(t,e,i,r,n){if("number"==typeof n){if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:font");this.text=t,this.font=e,this.format=i,this.size=new X(r.width,r.height),this.rectangle=r,this.pageHeight=n,this.reader=new Pt(t)}else this.initialize(t,e,i,new Z(new J(0,0),r),0)},Ct.prototype.clear=function(){this.font=null,this.format=null,this.reader.close(),this.reader=null,this.text=null},Ct.prototype.doLayout=function(){for(var t=new Bt,e=(new Bt,[]),i=this.reader.peekLine(),r=this.getLineIndent(!0);null!=i;){if(null!==(n=this.layoutLine(i,r))||void 0!==n){var n=this.copyToResult(t,n,e,0),o=n.success,n=n.numInserted;if(!o){this.reader.read(n);break}}this.reader.readLine(),i=this.reader.peekLine(),r=this.getLineIndent(!1)}return this.finalizeResult(t,e),t},Ct.prototype.getLineIndent=function(t){var e=0;return null!=this.format&&(e=t?this.format.firstLineIndent:this.format.paragraphIndent,e=0<this.size.width?Math.min(this.size.width,e):e),e},Ct.prototype.getLineHeight=function(){var t=this.font.height;return t=null!=this.format&&0!==this.format.lineSpacing?this.format.lineSpacing+this.font.height:t},Ct.prototype.getLineWidth=function(t){return this.font.getLineWidth(t,this.format)},Ct.prototype.layoutLine=function(t,e){var i=new Bt,r=(i.layoutLineHeight=this.getLineHeight(),[]),n=this.size.width,o=this.getLineWidth(t)+e,s=Y.LineType.FirstParagraphLine,a=!0;if(n<=0||Math.round(o)<=Math.round(n))this.addToLineResult(i,r,t,o,Y.LineType.NewLineBreak|s);else{var h="",l="",o=e,u=e,c=new Pt(t),p=c.peekWord();for(p.length!==c.length&&" "===p&&(l+=p,h+=p,c.position+=1,p=c.peekWord());null!=p;){l+=p;var d,f=this.getLineWidth(l.toString())+u;if(" "===l.toString()&&(l="",f=0),n<f){if(this.getWrapType()===Y.PdfWordWrapType.None)break;if(l.length===p.length){if(this.getWrapType()===Y.PdfWordWrapType.WordOnly){i.textRemainder=t.substring(c.position);break}if(1===l.length){h+=p;break}a=!1,l="",p=c.peek().toString()}else this.getLineWidth(p.toString())>n?this.format.wordWrap=Y.PdfWordWrapType.Character:void 0!==this.format&&null!==this.format&&(this.format.wordWrap=Y.PdfWordWrapType.Word),this.getWrapType()===Y.PdfWordWrapType.Character&&a?(a=!1,l="",l+=h.toString(),p=c.peek().toString()):(" "!==(d=h.toString())&&this.addToLineResult(i,r,d,o,Y.LineType.LayoutBreak|s),this.isOverloadWithPosition&&(n=this.clientSize.width),h=l="",f=u=o=0,s=Y.LineType.None,p=a?p:c.peekWord(),a=!0)}else h+=p,o=f,p=a?(c.readWord(),c.peekWord()):(c.read(),c.peek().toString())}0<h.length&&(d=h.toString(),this.addToLineResult(i,r,d,o,Y.LineType.NewLineBreak|Y.LineType.LastParagraphLine)),c.close()}i.layoutLines=[];for(var g=0;g<r.length;g++)i.layoutLines.push(r[g]);return r=[],i},Ct.prototype.addToLineResult=function(t,e,i,r,n){var o=new xt,i=(o.text=i,o.width=r,o.lineType=n,e.push(o),t.actualSize);i.height+=this.getLineHeight(),i.width=Math.max(i.width,r),t.size=i},Ct.prototype.copyToResult=function(t,e,i,r){var n,o=!0,s=null!=this.format&&!this.format.lineLimit,a=t.actualSize.height,h=this.size.height;if(0<this.pageHeight&&h+this.rectangle.y>this.pageHeight&&(h=this.rectangle.y-this.pageHeight,h=Math.max(h,-h)),r=0,null!=e.lines)for(var l=0,u=e.lines.length;l<u;l++){var c=a+e.lineHeight;if(!(c<=h||h<=0||s)){o=!1;break}var p=e.lines[l],d=(r+=p.text.length,p=this.trimLine(p,0===i.length),i.push(p),t.actualSize);d.width=Math.max(d.width,p.width),t.size=d,a=c}return a!=t.size.height&&((n=t.actualSize).height=a,t.size=n),{success:o,numInserted:r}},Ct.prototype.finalizeResult=function(t,e){t.layoutLines=[];for(var i=0;i<e.length;i++)t.layoutLines.push(e[i]);t.layoutLineHeight=this.getLineHeight(),this.reader.end||(t.textRemainder=this.reader.readToEnd())},Ct.prototype.trimLine=function(t,e){var i=t.text,r=t.width;t.lineType,Y.LineType.FirstParagraphLine,null!=this.format&&this.format.rightToLeft;return(i=i.trim()).length!==t.text.length&&(r=this.getLineWidth(i),0<(t.lineType&Y.LineType.FirstParagraphLine))&&(r+=this.getLineIndent(e)),t.text=i,t.width=r,t},Ct.prototype.getWrapType=function(){return null!=this.format?this.format.wordWrap:Y.PdfWordWrapType.Word};var vt=Ct;function Ct(){this.isOverloadWithPosition=!1}Object.defineProperty(Ot.prototype,"remainder",{get:function(){return this.textRemainder},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"actualSize",{get:function(){return void 0===this.size&&(this.size=new X(0,0)),this.size},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"lines",{get:function(){return this.layoutLines},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"lineHeight",{get:function(){return this.layoutLineHeight},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"empty",{get:function(){return null==this.layoutLines||0===this.layoutLines.length},enumerable:!0,configurable:!0}),Object.defineProperty(Ot.prototype,"lineCount",{get:function(){return this.empty?0:this.layoutLines.length},enumerable:!0,configurable:!0});var Bt=Ot;function Ot(){}Object.defineProperty(Lt.prototype,"lineType",{get:function(){return this.type},set:function(t){this.type=t},enumerable:!0,configurable:!0}),Object.defineProperty(Lt.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(Lt.prototype,"width",{get:function(){return this.lineWidth},set:function(t){this.lineWidth=t},enumerable:!0,configurable:!0});var xt=Lt;function Lt(){}(i=Y.LineType||(Y.LineType={}))[i.None=0]="None",i[i.NewLineBreak=1]="NewLineBreak",i[i.LayoutBreak=2]="LayoutBreak",i[i.FirstParagraphLine=4]="FirstParagraphLine",i[i.LastParagraphLine=8]="LastParagraphLine";Object.defineProperty(jt.prototype,"name",{get:function(){return this.metrics.name},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"size",{get:function(){return this.fontSize},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"height",{get:function(){return this.metrics.getHeight(null)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"style",{get:function(){return this.fontStyle},set:function(t){this.fontStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"bold",{get:function(){return 0<(this.style&Y.PdfFontStyle.Bold)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"italic",{get:function(){return 0<(this.style&Y.PdfFontStyle.Italic)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"strikeout",{get:function(){return 0<(this.style&Y.PdfFontStyle.Strikeout)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"underline",{get:function(){return 0<(this.style&Y.PdfFontStyle.Underline)},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"metrics",{get:function(){return this.fontMetrics},set:function(t){this.fontMetrics=t},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"element",{get:function(){return this.pdfFontInternals},enumerable:!0,configurable:!0}),jt.prototype.measureString=function(t,e,i,r,n){if("string"==typeof t&&void 0===e)return this.measureString(t,null);if("string"==typeof t&&(e instanceof bt||null==e)&&void 0===i&&void 0===r)return this.measureString(t,o=e,0,0);if("string"==typeof t&&(e instanceof bt||null==e)&&"number"==typeof i&&"number"==typeof r)return this.measureString(t,0,o=e,i,r);if("string"==typeof t&&"number"==typeof e&&(i instanceof bt||null==i)&&"number"==typeof r&&"number"==typeof n)return s=new X(e,0),this.measureString(t,s,s=i,r,n);if(null==t)throw Error('ArgumentNullException("text")');var o=e,s=i,e=(new vt).layout(t,this,s,o,!1,new X(0,0));return r=t.length,n=e.empty?0:e.lines.length,e.actualSize},jt.prototype.equalsTo=function(t){return this.equalsToFont(t)},jt.prototype.getInternals=function(){return this.pdfFontInternals},jt.prototype.setInternals=function(t){if(null==t)throw new Error("ArgumentNullException:internals");this.pdfFontInternals=t},jt.prototype.setStyle=function(t){this.fontStyle=t},jt.prototype.applyFormatSettings=function(t,e,i){var r=i;return null!=e&&0<i&&(0!==e.characterSpacing&&(r+=(t.length-1)*e.characterSpacing),0!==e.wordSpacing)&&(i=Pt.spaces,r+=Pt.getCharsCount(t,i)*e.wordSpacing),r},jt.charSizeMultiplier=.001,jt.syncObject=new Object;var Tt=jt;function jt(t,e){this.fontStyle=Y.PdfFontStyle.Regular,"number"==typeof t&&void 0===e?this.fontSize=t:(this.fontSize=t,this.setStyle(e))}Object.defineProperty(Vt.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),Object.defineProperty(Vt.prototype,"position",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(Vt.prototype,"length",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(Vt.prototype,"stream",{get:function(){return this.streamWriter},enumerable:!0,configurable:!0}),Vt.prototype.write=function(t){this.streamWriter.write(t)};var kt=Vt;function Vt(t){this.streamWriter=t}Mt.prototype.write=function(t){this.buffer.write(t)},Mt.prototype.destroy=function(){this.buffer&&(this.buffer.destroy(),this.buffer=void 0)};var Rt=Mt;function Mt(){this.buffer=new At}Object.defineProperty(Dt.prototype,"size",{get:function(){return this.buffer.length},enumerable:!0,configurable:!0}),Dt.prototype.write=function(t){for(var e=0;e<t.length;e++)this.buffer.push(255&t.charCodeAt(e))},Dt.prototype.destroy=function(){this.buffer&&(this.buffer=[],this.buffer=void 0)};var At=Dt;function Dt(){this.buffer=[]}(i=Y.ObjectStatus||(Y.ObjectStatus={}))[i.None=0]="None",i[i.Registered=1]="Registered";Object.defineProperty(Ft.prototype,"count",{get:function(){return this.objectCollections.length},enumerable:!0,configurable:!0}),Ft.prototype.items=function(t){return this.objectCollections[t]},Object.defineProperty(Ft.prototype,"outIsNew",{get:function(){return this.isNew},enumerable:!0,configurable:!0}),Ft.prototype.add=function(t){var e=new It(t);this.objectCollections.push(e),this.primitiveObjectCollection.containsKey(t)||this.primitiveObjectCollection.setValue(t,this.objectCollections.length-1),t.position=this.index=this.objectCollections.length-1,t.status=Y.ObjectStatus.Registered},Ft.prototype.lookFor=function(t){var e=-1;if(-1!==t.position)return t.position;if(this.primitiveObjectCollection.containsKey(t)&&this.count===this.primitiveObjectCollection.size())e=this.primitiveObjectCollection.getValue(t);else for(var i=this.count-1;0<=i;i--)if(this.objectCollections[i].object===t){e=i;break}return e},Ft.prototype.getReference=function(t,e){return this.index=this.lookFor(t),this.isNew=!1,{reference:this.objectCollections[this.index].reference,wasNew:e}},Ft.prototype.trySetReference=function(t,e,i){return this.index=this.lookFor(t),this.objectCollections[this.index].setReference(e),!0},Ft.prototype.destroy=function(){for(var t=0,e=this.objectCollections;t<e.length;t++){var i=e[t];void 0!==i&&(i.pdfObject.position=-1,i.pdfObject.isSaving=void 0,i.pdfObject.objectCollectionIndex=void 0,i.pdfObject.position=void 0)}this.objectCollections=[],this.mainObjectCollection=new a,this.primitiveObjectCollection=new a};var Nt=Ft;function Ft(){this.objectCollections=[],this.mainObjectCollection=new a,this.primitiveObjectCollection=new a}Object.defineProperty(Et.prototype,"object",{get:function(){return this.pdfObject},set:function(t){this.pdfObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(Et.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Et.prototype.setReference=function(t){this.pdfReference=t};var It=Et;function Et(t,e){this.pdfObject=t,this.pdfReference=e}Object.defineProperty(Gt.prototype,"pdfObjects",{get:function(){return this.objects},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"crossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"currentSavingObj",{get:function(){return this.currentSavingObject},set:function(t){this.currentSavingObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"catalog",{get:function(){return this.pdfCatalog},set:function(t){this.pdfCatalog=t},enumerable:!0,configurable:!0}),Object.defineProperty(Gt.prototype,"viewerPreferences",{get:function(){return this.pdfCatalog.viewerPreferences},enumerable:!0,configurable:!0}),Gt.prototype.setMainObjectCollection=function(t){this.objects=t},Gt.prototype.setCrossTable=function(t){this.pdfCrossTable=t},Gt.prototype.setCatalog=function(t){this.pdfCatalog=t},Gt.prototype.save=function(t){var e,r,n=this,i=new R.Encoding(!0),i=new R.StreamWriter(i);if(void 0===t)return e=new R.Encoding(!0),r=new R.StreamWriter(e),new Promise(function(t,e){var i={};i.blobData=new Blob([n.document.docSave(r,!0)],{type:"application/pdf"}),t(i)});this.document.docSave(i,t,!0)},Gt.prototype.clone=function(){return this.document},Gt.prototype._save=function(){return this.document._docSave()};var i=Gt;function Gt(t){this.isStreamCopied=!1,t instanceof Tr&&(this.document=t)}(w=Y.ObjectType||(Y.ObjectType={}))[w.Free=0]="Free",w[w.Normal=1]="Normal",w[w.Packed=2]="Packed";Object.defineProperty(Wt.prototype,"status",{get:function(){return this.objectStatus},set:function(t){this.objectStatus=t},enumerable:!0,configurable:!0}),Object.defineProperty(Wt.prototype,"isSaving",{get:function(){return this.saving},set:function(t){this.saving=t},enumerable:!0,configurable:!0}),Object.defineProperty(Wt.prototype,"objectCollectionIndex",{get:function(){return this.index},set:function(t){this.index=t},enumerable:!0,configurable:!0}),Object.defineProperty(Wt.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),Object.defineProperty(Wt.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Wt.prototype.save=function(t){t.write(this.boolToStr(this.value))},Wt.prototype.clone=function(t){return new Wt(this.value)},Wt.prototype.boolToStr=function(t){return t?"true":"false"};var zt=Wt;function Wt(t){this.currentPosition=-1,this.value=t}Object.defineProperty(Ht.prototype,"centerWindow",{get:function(){return this._centerWindow},set:function(t){this._centerWindow=t,this._dictionary.items.setValue(this._dictionaryProperties.centerWindow,new zt(this._centerWindow))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"displayTitle",{get:function(){return this._displayTitle},set:function(t){this._displayTitle=t,this._dictionary.items.setValue(this._dictionaryProperties.displayTitle,new zt(this._displayTitle))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"fitWindow",{get:function(){return this._fitWindow},set:function(t){this._fitWindow=t,this._dictionary.items.setValue(this._dictionaryProperties.fitWindow,new zt(this._fitWindow))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"hideMenuBar",{get:function(){return this._hideMenuBar},set:function(t){this._hideMenuBar=t,this._dictionary.items.setValue(this._dictionaryProperties.hideMenuBar,new zt(this._hideMenuBar))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"hideToolBar",{get:function(){return this._hideToolBar},set:function(t){this._hideToolBar=t,this._dictionary.items.setValue(this._dictionaryProperties.hideToolBar,new zt(this._hideToolBar))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"hideWindowUI",{get:function(){return this._hideWindowUI},set:function(t){this._hideWindowUI=t,this._dictionary.items.setValue(this._dictionaryProperties.hideWindowUI,new zt(this._hideWindowUI))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"pageMode",{get:function(){return this._pageMode},set:function(t){this._pageMode=t,this._catalog.items.setValue(this._dictionaryProperties.pageMode,new o(this._mapPageMode(this._pageMode)))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"duplex",{get:function(){return this._duplex},set:function(t){this._duplex=t,this._catalog.items.setValue(this._dictionaryProperties.duplex,new o(this._mapDuplexMode(this._duplex)))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"pageLayout",{get:function(){return this._pageLayout},set:function(t){this._pageLayout=t,this._catalog.items.setValue(this._dictionaryProperties.pageLayout,new o(this._mapPageLayout(this._pageLayout)))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"pageScaling",{get:function(){return this._pageScaling},set:function(t){this._pageScaling=t,this._pageScaling===Y.PageScalingMode.AppDefault&&this._dictionary.items.containsKey(this._dictionaryProperties.printScaling)?this._dictionary.items.remove(this._dictionaryProperties.printScaling):this._pageScaling===Y.PageScalingMode.None&&this._dictionary.items.setValue(this._dictionaryProperties.printScaling,new o("None"))},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.prototype,"element",{get:function(){return this._dictionary},enumerable:!0,configurable:!0}),Ht.prototype._mapDuplexMode=function(t){switch(t){case Y.DuplexMode.Simplex:return"Simplex";case Y.DuplexMode.DuplexFlipShortEdge:return"DuplexFlipShortEdge";case Y.DuplexMode.DuplexFlipLongEdge:return"DuplexFlipLongEdge";case Y.DuplexMode.None:return"None"}},Ht.prototype._mapPageMode=function(t){switch(t){case Y.PdfPageMode.UseNone:return"UseNone";case Y.PdfPageMode.UseOutlines:return"UseOutlines";case Y.PdfPageMode.UseThumbs:return"UseThumbs";case Y.PdfPageMode.FullScreen:return"FullScreen";case Y.PdfPageMode.UseOC:return"UseOC";case Y.PdfPageMode.UseAttachments:return"UseAttachments"}},Ht.prototype._mapPageLayout=function(t){switch(t){case Y.PdfPageLayout.SinglePage:return"SinglePage";case Y.PdfPageLayout.OneColumn:return"OneColumn";case Y.PdfPageLayout.TwoColumnLeft:return"TwoColumnLeft";case Y.PdfPageLayout.TwoColumnRight:return"TwoColumnRight";case Y.PdfPageLayout.TwoPageLeft:return"TwoPageLeft";case Y.PdfPageLayout.TwoPageRight:return"TwoPageRight"}};var _t=Ht;function Ht(t){this._dictionaryProperties=new l,this._centerWindow=!1,this._fitWindow=!1,this._displayTitle=!1,this._splitWindow=!1,this._hideMenuBar=!1,this._hideToolBar=!1,this._hideWindowUI=!1,this._pageMode=Y.PdfPageMode.UseNone,this._pageLayout=Y.PdfPageLayout.SinglePage,this._dictionary=new c,this._duplex=Y.DuplexMode.None,this._catalog=t}(w=Y.PdfPageMode||(Y.PdfPageMode={}))[w.UseNone=0]="UseNone",w[w.UseOutlines=1]="UseOutlines",w[w.UseThumbs=2]="UseThumbs",w[w.FullScreen=3]="FullScreen",w[w.UseOC=4]="UseOC",w[w.UseAttachments=5]="UseAttachments",(w=Y.PdfPageLayout||(Y.PdfPageLayout={}))[w.SinglePage=0]="SinglePage",w[w.OneColumn=1]="OneColumn",w[w.TwoColumnLeft=2]="TwoColumnLeft",w[w.TwoColumnRight=3]="TwoColumnRight",w[w.TwoPageLeft=4]="TwoPageLeft",w[w.TwoPageRight=5]="TwoPageRight",(w=Y.DuplexMode||(Y.DuplexMode={}))[w.Simplex=0]="Simplex",w[w.DuplexFlipShortEdge=1]="DuplexFlipShortEdge",w[w.DuplexFlipLongEdge=2]="DuplexFlipLongEdge",w[w.None=3]="None",(w=Y.PageScalingMode||(Y.PageScalingMode={}))[w.AppDefault=0]="AppDefault",w[w.None=1]="None",Ut=function(t,e){return(Ut=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ut(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Yt,Kt=c),Object.defineProperty(Yt.prototype,"pages",{get:function(){return this.sections},set:function(t){t.element;this.sections=t,this.items.setValue(this.tempDictionaryProperties.pages,new d(t))},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"viewerPreferences",{get:function(){return null!==this._viewerPreferences&&void 0!==this._viewerPreferences||(this._viewerPreferences=new _t(this),this.items.setValue(this.tempDictionaryProperties.viewerPreferences,new d(this._viewerPreferences.element))),this._viewerPreferences},enumerable:!0,configurable:!0});var Ut,Kt,qt=Yt;function Yt(){var t=Kt.call(this)||this;return t.sections=null,t.tempDictionaryProperties=new l,t.items.setValue((new l).type,new o("Catalog")),t}Object.defineProperty(n.prototype,"isMerging",{get:function(){return this.merging},set:function(t){this.merging=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trailer",{get:function(){return null==this.internalTrailer&&(this.internalTrailer=new U),this.internalTrailer},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t,this.items=this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pdfObjects",{get:function(){return this.items},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"objectCollection",{get:function(){return this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){return this.objectCount},set:function(t){this.objectCount=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"nextObjNumber",{get:function(){return this.count=this.count+1,this.count},enumerable:!0,configurable:!0}),n.prototype.save=function(t,e){if(this._saveProcess(t),void 0===e)return t.stream.buffer;t.stream.save(e)},n.prototype._saveProcess=function(t){this.saveHead(t),this.mappedReferences=null,this.objects.clear(),this.markTrailerReferences(),this.saveObjects(t);var e=this.count,i=t.position;this.registerObject(0,new et(0,-1),!0);t.write(h.xref),t.write(h.newLine),this.saveSections(t),this.saveTrailer(t,this.count,0),this.saveTheEndess(t,i),this.count=e;for(var r=0;r<this.objectCollection.count;++r)this.objectCollection.items(r).object.isSaving=!1},n.prototype._save=function(t){return this._saveProcess(t),new Uint8Array(t.stream.buffer.buffer)},n.prototype.saveTheEndess=function(t,e){t.write(h.newLine+h.startxref+h.newLine),t.write(e.toString()+h.newLine),t.write(h.eof+h.newLine)},n.prototype.saveTrailer=function(t,e,i){t.write(h.trailer+h.newLine);var r=this.trailer;r.items.setValue(this.dictionaryProperties.size,new u(this.objectCount+1)),(r=new c(r)).setEncrypt(!1),r.save(t)},n.prototype.saveSections=function(t){for(var e,i=0;e=this.prepareSubsection(i),this.saveSubsection(t,i,e),i+=e,0!==e;);},n.prototype.saveSubsection=function(t,e,i){if(!(i<=0||e>=this.count)){t.write(e+" "+(i+1)+h.newLine);for(var r=e;r<=e+i;++r){var n=this.objects.getValue(r),o="",o=n.type===Y.ObjectType.Free?this.getItem(n.offset,65535,!0):this.getItem(n.offset,n.generation,!1);t.write(o)}}},n.prototype.getItem=function(t,e,i){for(var r="",n=10-t.toString().length,o=5-(e=e<=0?0:e).toString().length<=0?0:5-e.toString().length,s=0;s<n;s++)r+="0";for(r=r+t.toString()+" ",s=0;s<o;s++)r+="0";return r=(r=r+e.toString()+" ")+(i?h.f:h.n)+h.newLine},n.prototype.prepareSubsection=function(t){for(var e,i=0,r=this.count,n=0;n<this.document.pdfObjects.count;n++)this.document.pdfObjects.items(n).reference.toString().split(" ");if(!(r<=t))for(t=e=t;e<r;++e)++i;return i},n.prototype.markTrailerReferences=function(){this.trailer.items.keys(),this.trailer.items.values()},n.prototype.saveHead=function(t){var e=this.generateFileVersion(t.document);t.write("%PDF-"+e),t.write(h.newLine)},n.prototype.generateFileVersion=function(t){return"1."+4..toString()},n.prototype.getReference=function(t,e){return void 0===e?this.getReference(t,!1):this.getSubReference(t,e)},n.prototype.getSubReference=function(t,e){var i,r,n=!1,o=null;return 0<this.items.count&&0<t.objectCollectionIndex&&this.items.count>t.objectCollectionIndex-1&&(o=(r=this.document.pdfObjects.getReference(t,i)).reference,i=r.wasNew),i=null==o&&t.status!==Y.ObjectStatus.Registered,null==o&&(r=this.nextObjNumber,o=new et(r,0),i?(this.document.pdfObjects.add(t),this.document.pdfObjects.trySetReference(t,o,void 0),r=this.document.pdfObjects.count-1,i=this.document.pdfObjects.objectCollections[r].reference.objNumber,r=this.document.pdfObjects.objectCollections[this.document.pdfObjects.count-1],this.document.pdfObjects.mainObjectCollection.setValue(i,r),t.position=-1):this.document.pdfObjects.trySetReference(t,o,void 0),t.objectCollectionIndex=o.objNumber,t.status=Y.ObjectStatus.None,n=!0),n||this.bForceNew,o},n.prototype.saveObjects=function(t){for(var e=this.objectCollection,i=0;i<e.count;++i){var r=e.items(i).object;r.isSaving=!0,this.saveIndirectObject(r,t)}},n.prototype.saveIndirectObject=function(t,e){var i=this.getReference(t);t instanceof qt&&this.trailer.items.setValue(this.dictionaryProperties.root,i),this.pdfDocument.currentSavingObj=i,t.getArchive();this.registerObject(e.position,i),this.doSaveObject(t,i,e)},n.prototype.doSaveObject=function(t,e,i){i.write(e.objNumber.toString()),i.write(h.whiteSpace),i.write(e.genNumber.toString()),i.write(h.whiteSpace),i.write(h.obj),i.write(h.newLine),t.save(i),i.write(h.endObj),i.write(h.newLine)},n.prototype.registerObject=function(t,e,i){"boolean"==typeof i?(this.objects.setValue(e.objNumber,new Xt(t,e,i)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber)):void 0===i&&(this.objects.setValue(e.objNumber,new Xt(t,e)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber))},n.dereference=function(t){return t=null!=t?t.object:t};var Jt=n;function n(){this.objects=new a,this.maxGenNumIndex=0,this.objectCount=0,this.dictionaryProperties=new l}Object.defineProperty(Zt.prototype,"objectNumber",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(Zt.prototype,"offset",{get:function(){return this.offsetNumber},enumerable:!0,configurable:!0});var Xt=Zt;function Zt(t,e,i){this.offsetNumber=t;t=e;this.generation=t.genNumber,this.object=t.objNumber,this.type=void 0===i?Y.ObjectType.Normal:Y.ObjectType.Free}m.letter=new X(612,792),m.note=new X(540,720),m.legal=new X(612,1008),m.a0=new X(2380,3368),m.a1=new X(1684,2380),m.a2=new X(1190,1684),m.a3=new X(842,1190),m.a4=new X(595,842),m.a5=new X(421,595),m.a6=new X(297,421),m.a7=new X(210,297),m.a8=new X(148,210),m.a9=new X(105,148),m.a10=new X(74,105),m.b0=new X(2836,4008),m.b1=new X(2004,2836),m.b2=new X(1418,2004),m.b3=new X(1002,1418),m.b4=new X(709,1002),m.b5=new X(501,709),m.archE=new X(2592,3456),m.archD=new X(1728,2592),m.archC=new X(1296,1728),m.archB=new X(864,1296),m.archA=new X(648,864),m.flsa=new X(612,936),m.halfLetter=new X(396,612),m.letter11x17=new X(792,1224),m.ledger=new X(1224,792);var $t=m;function m(){}(w=Y.PdfPageOrientation||(Y.PdfPageOrientation={}))[w.Portrait=0]="Portrait",w[w.Landscape=1]="Landscape",(w=Y.PdfPageRotateAngle||(Y.PdfPageRotateAngle={}))[w.RotateAngle0=0]="RotateAngle0",w[w.RotateAngle90=1]="RotateAngle90",w[w.RotateAngle180=2]="RotateAngle180",w[w.RotateAngle270=3]="RotateAngle270",(w=Y.PdfNumberStyle||(Y.PdfNumberStyle={}))[w.None=0]="None",w[w.Numeric=1]="Numeric",w[w.LowerLatin=2]="LowerLatin",w[w.LowerRoman=3]="LowerRoman",w[w.UpperLatin=4]="UpperLatin",w[w.UpperRoman=5]="UpperRoman",(w=Y.PdfDockStyle||(Y.PdfDockStyle={}))[w.None=0]="None",w[w.Bottom=1]="Bottom",w[w.Top=2]="Top",w[w.Left=3]="Left",w[w.Right=4]="Right",w[w.Fill=5]="Fill",(w=Y.PdfAlignmentStyle||(Y.PdfAlignmentStyle={}))[w.None=0]="None",w[w.TopLeft=1]="TopLeft",w[w.TopCenter=2]="TopCenter",w[w.TopRight=3]="TopRight",w[w.MiddleLeft=4]="MiddleLeft",w[w.MiddleCenter=5]="MiddleCenter",w[w.MiddleRight=6]="MiddleRight",w[w.BottomLeft=7]="BottomLeft",w[w.BottomCenter=8]="BottomCenter",w[w.BottomRight=9]="BottomRight",(w=Y.TemplateType||(Y.TemplateType={}))[w.None=0]="None",w[w.Top=1]="Top",w[w.Bottom=2]="Bottom",w[w.Left=3]="Left",w[w.Right=4]="Right";Object.defineProperty(te.prototype,"left",{get:function(){return this.leftMargin},set:function(t){this.leftMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(te.prototype,"top",{get:function(){return this.topMargin},set:function(t){this.topMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(te.prototype,"right",{get:function(){return this.rightMargin},set:function(t){this.rightMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(te.prototype,"bottom",{get:function(){return this.bottomMargin},set:function(t){this.bottomMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(te.prototype,"all",{set:function(t){this.setMargins(t)},enumerable:!0,configurable:!0}),te.prototype.setMargins=function(t,e,i,r){void 0===e?this.leftMargin=this.topMargin=this.rightMargin=this.bottomMargin=t:void 0===i?(this.leftMargin=this.rightMargin=t,this.bottomMargin=this.topMargin=e):(this.leftMargin=t,this.topMargin=e,this.rightMargin=i,this.bottomMargin=r)},te.prototype.clone=function(){return this};var Qt=te;function te(){this.pdfMargin=40,this.setMargins(this.pdfMargin)}Object.defineProperty(ie.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.setSize(t)},enumerable:!0,configurable:!0}),Object.defineProperty(ie.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation!==t&&(this.pageOrientation=t,this.updateSize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(ie.prototype,"margins",{get:function(){return this.pageMargins},set:function(t){this.pageMargins=t},enumerable:!0,configurable:!0}),Object.defineProperty(ie.prototype,"width",{get:function(){return this.pageSize.width},set:function(t){this.pageSize.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(ie.prototype,"height",{get:function(){return this.pageSize.height},set:function(t){this.pageSize.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(ie.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0}),Object.defineProperty(ie.prototype,"rotate",{get:function(){return this.rotateAngle},set:function(t){this.rotateAngle=t,this.isRotation=!0},enumerable:!0,configurable:!0}),ie.prototype.updateSize=function(t){var e=Math.min(this.pageSize.width,this.pageSize.height),i=Math.max(this.pageSize.width,this.pageSize.height);switch(t){case Y.PdfPageOrientation.Portrait:this.pageSize=new X(e,i);break;case Y.PdfPageOrientation.Landscape:this.pageSize=new X(i,e)}},ie.prototype.clone=function(){return this.pageMargins=this.pageMargins.clone(),this},ie.prototype.getActualSize=function(){var t=this.width-(this.margins.left+this.margins.right),e=this.height-(this.margins.top+this.margins.bottom);return new X(t,e)},ie.prototype.setSize=function(t){var e=Math.min(t.width,t.height),t=Math.max(t.width,t.height);this.orientation===Y.PdfPageOrientation.Portrait?this.pageSize=new X(e,t):this.pageSize=new X(t,e)};var ee=ie;function ie(t){this.pageMargins=new Qt,this.pageSize=$t.a4,this.rotateAngle=Y.PdfPageRotateAngle.RotateAngle0,this.pageOrientation=Y.PdfPageOrientation.Portrait,this.pageOrigin=new J(0,0),this.isRotation=!1,"number"==typeof t&&this.pageMargins.setMargins(t)}y.prototype.clear=function(){this.stream.clearStream()},y.prototype.setGraphicsState=function(t){t instanceof o?this.stream.write(t.toString()):(this.stream.write(h.slash),this.stream.write(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setGraphicsState)},y.prototype.executeObject=function(t){this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.paintXObject),this.stream.write(h.newLine)},y.prototype.closePath=function(){this.writeOperator(h.closePath)},y.prototype.clipPath=function(t){this.stream.write(h.clipPath),t&&this.stream.write(h.evenOdd),this.stream.write(h.whiteSpace),this.stream.write(h.endPath),this.stream.write(h.newLine)},y.prototype.closeFillStrokePath=function(t){this.stream.write(h.closeFillStrokePath),t&&this.stream.write(h.evenOdd),this.stream.write(h.newLine)},y.prototype.fillStrokePath=function(t){this.stream.write(h.fillStroke),t&&this.stream.write(h.evenOdd),this.stream.write(h.newLine)},y.prototype.fillPath=function(t){this.stream.write(h.fill),t&&this.stream.write(h.evenOdd),this.stream.write(h.newLine)},y.prototype.endPath=function(){this.writeOperator(h.n)},y.prototype.closeFillPath=function(t){this.writeOperator(h.closePath),this.stream.write(h.fill),t&&this.stream.write(h.evenOdd),this.stream.write(h.newLine)},y.prototype.closeStrokePath=function(){this.writeOperator(h.closeStrokePath)},y.prototype.setTextScaling=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setTextScaling)},y.prototype.strokePath=function(){this.writeOperator(h.stroke)},y.prototype.restoreGraphicsState=function(){this.writeOperator(h.restoreState)},y.prototype.saveGraphicsState=function(){this.writeOperator(h.saveState)},y.prototype.startNextLine=function(t,e){void 0===t?this.writeOperator(h.goToNextLine):(t instanceof J?this.writePoint(t):this.writePoint(t,e),this.writeOperator(h.setCoords))},y.prototype.showText=function(t){this.checkTextParam(t),this.writeText(t),this.writeOperator(h.setText)},y.prototype.setLeading=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setTextLeading)},y.prototype.beginPath=function(t,e){this.writePoint(t,e),this.writeOperator(h.beginPath)},y.prototype.beginText=function(){this.writeOperator(h.beginText)},y.prototype.endText=function(){this.writeOperator(h.endText)},y.prototype.appendRectangle=function(t,e,i,r){t instanceof Z?this.appendRectangle(t.x,t.y,t.width,t.height):(this.writePoint(t,e),this.writePoint(i,r),this.writeOperator(h.appendRectangle))},y.prototype.appendLineSegment=function(t,e){t instanceof J?this.appendLineSegment(t.x,t.y):(this.writePoint(t,e),this.writeOperator(h.appendLineSegment))},y.prototype.setTextRenderingMode=function(t){this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.setRenderingMode)},y.prototype.setCharacterSpacing=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.stream.write(h.setCharacterSpace),this.stream.write(h.newLine)},y.prototype.setWordSpacing=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setWordSpace)},y.prototype.showNextLineText=function(t,e){t instanceof tt?(this.checkTextParam(t),this.writeText(t)):(this.checkTextParam(t),this.writeText(t,e)),this.writeOperator(h.setTextOnNewLine)},y.prototype.setColorSpace=function(t,e){var i,r;t instanceof o&&"boolean"==typeof e?(i=(r=e)?h.selectcolorspaceforstroking:h.selectcolorspacefornonstroking,this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.stream.write(i),this.stream.write(h.newLine)):(r=e,this.setColorSpace(new o(t),r))},y.prototype.modifyCtm=function(t){if(null==t)throw new Error("ArgumentNullException:matrix");this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.modifyCtm)},y.prototype.setFont=function(t,e,i){if("string"==typeof e)this.setFont(t,new o(e),i);else{if(null==t)throw new Error("ArgumentNullException:font");this.stream.write(e.toString()),this.stream.write(h.whiteSpace),this.stream.write(u.floatToString(i)),this.stream.write(h.whiteSpace),this.writeOperator(h.setFont)}},y.prototype.writeOperator=function(t){this.stream.write(t),this.stream.write(h.newLine)},y.prototype.checkTextParam=function(t){if(null==t)throw new Error("ArgumentNullException:text");if("string"==typeof t&&""===t)throw new Error("ArgumentException:The text can not be an empty string, text")},y.prototype.writeText=function(t,e){var i,r;t instanceof tt&&void 0===e?this.stream.write(t.pdfEncode()):(r=i=void 0,r=(e?(i=tt.hexStringMark[0],tt.hexStringMark):(i=tt.stringMark[0],tt.stringMark))[1],this.stream.write(i),this.stream.write(t),this.stream.write(r))},y.prototype.writePoint=function(t,e){t instanceof J&&void 0===e?this.writePoint(t.x,t.y):(this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),e=this.updateY(e),this.stream.write(u.floatToString(e)),this.stream.write(h.whiteSpace))},y.prototype.updateY=function(t){return-t},y.prototype.write=function(t){var e="";this.writeOperator(e+t+h.newLine)},y.prototype.writeComment=function(t){if(!(null!=t&&0<t.length))throw new Error("Invalid comment");var e="";this.writeOperator((e+=h.comment)+h.whiteSpace+t)},y.prototype.setColorAndSpace=function(t,e,i){t.isEmpty||(this.stream.write(t.toString(e,i)),this.stream.write(h.newLine))},y.prototype.setLineDashPattern=function(t,e){this.setLineDashPatternHelper(t,e)},y.prototype.setLineDashPatternHelper=function(t,e){var i="[";if(1<t.length)for(var r=0;r<t.length;r++)r===t.length-1?i+=t[r].toString():i+=t[r].toString()+" ";i=(i+="] ")+e.toString(),this.stream.write(i+=" "+h.setDashPattern),this.stream.write(h.newLine)},y.prototype.setMiterLimit=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setMiterLimit)},y.prototype.setLineWidth=function(t){this.stream.write(u.floatToString(t)),this.stream.write(h.whiteSpace),this.writeOperator(h.setLineWidth)},y.prototype.setLineCap=function(t){this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.setLineCapStyle)},y.prototype.setLineJoin=function(t){this.stream.write(t.toString()),this.stream.write(h.whiteSpace),this.writeOperator(h.setLineJoinStyle)},Object.defineProperty(y.prototype,"position",{get:function(){return this.stream.position},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"length",{get:function(){var t=0;if(0!==this.stream.data.length&&-1!==this.stream.data.length)for(var e=0;e<this.stream.data.length;e++)t+=this.stream.data[e].length;return t},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"document",{get:function(){return null},enumerable:!0,configurable:!0}),y.prototype.appendBezierSegment=function(t,e,i,r,n,o){t instanceof J&&e instanceof J&&i instanceof J?(this.writePoint(t.x,t.y),this.writePoint(e.x,e.y),this.writePoint(i.x,i.y)):(this.writePoint(t,e),this.writePoint(i,r),this.writePoint(n,o)),this.writeOperator(h.appendbeziercurve)},y.prototype.setColourWithPattern=function(t,e,i){if(null!=t)for(var r=t.length,n=0,n=0;n<r;++n)this.stream.write(t[n].toString()),this.stream.write(h.whiteSpace);null!=e&&(this.stream.write(e.toString()),this.stream.write(h.whiteSpace)),i?this.writeOperator(h.setColorAndPatternStroking):this.writeOperator(h.setColorAndPattern)};var re=y;function y(t){if(null==t)throw new Error("ArgumentNullException:stream");this.stream=t}Object.defineProperty(oe.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"dashOffset",{get:function(){return void 0===this.dashOffsetValue||null==this.dashOffsetValue?0:this.dashOffsetValue},set:function(t){this.dashOffsetValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"dashPattern",{get:function(){return this.penDashPattern},set:function(t){this.penDashPattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"dashStyle",{get:function(){return this.pdfDashStyle},set:function(t){if(this.pdfDashStyle!==t)switch(this.pdfDashStyle=t,this.pdfDashStyle){case Y.PdfDashStyle.Custom:break;case Y.PdfDashStyle.Dash:this.penDashPattern=[3,1];break;case Y.PdfDashStyle.Dot:this.penDashPattern=[1,1];break;case Y.PdfDashStyle.DashDot:this.penDashPattern=[3,1,1,1];break;case Y.PdfDashStyle.DashDotDot:this.penDashPattern=[3,1,1,1,1,1];break;case Y.PdfDashStyle.Solid:break;default:this.pdfDashStyle=Y.PdfDashStyle.Solid,this.penDashPattern=[0]}},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"lineCap",{get:function(){return this.pdfLineCap},set:function(t){this.pdfLineCap=t},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"lineJoin",{get:function(){return this.pdfLineJoin},set:function(t){this.pdfLineJoin=t},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"miterLimit",{get:function(){return this.internalMiterLimit},set:function(t){this.internalMiterLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(oe.prototype,"width",{get:function(){return this.penWidth},set:function(t){this.penWidth=t},enumerable:!0,configurable:!0}),oe.prototype.clone=function(){return this},oe.prototype.setBrush=function(t){null!=t&&t instanceof mt&&(this.color=t.color,this.pdfBrush=t),this.color=t.color,this.pdfBrush=t},oe.prototype.monitorChanges=function(t,e,i,r,n,o){this.dashControl(t,!0,e),e.setLineWidth(this.width),e.setLineJoin(this.lineJoin),e.setLineCap(this.lineCap);t=this.miterLimit;0<t&&e.setMiterLimit(t),this.pdfBrush;return e.setColorAndSpace(this.color,n,!0),!0},oe.prototype.dashControl=function(t,e,i){var r=this.width,n=this.getPattern();return i.setLineDashPattern(n,this.dashOffset*r),!0},oe.prototype.getPattern=function(){for(var t=this.dashPattern,e=0;e<t.length;++e)t[e]*=this.width;return t};var ne=oe;function oe(t,e){this.pdfColor=new f(0,0,0),this.dashOffsetValue=0,this.penDashPattern=[0],this.pdfDashStyle=Y.PdfDashStyle.Solid,this.pdfLineCap=0,this.pdfLineJoin=0,this.penWidth=1,this.internalMiterLimit=0,this.colorSpace=Y.PdfColorSpace.Rgb,t instanceof pt?this.setBrush(t):t instanceof f&&(this.color=t),"number"==typeof e&&(this.width=e)}Object.defineProperty(ae.prototype,"matrix",{get:function(){return this.transformationMatrix},set:function(t){this.transformationMatrix=t},enumerable:!0,configurable:!0}),ae.prototype.translate=function(t,e){this.transformationMatrix.translate(t,e)},ae.prototype.scale=function(t,e){this.transformationMatrix.elements[0]=t,this.transformationMatrix.elements[3]=e},ae.prototype.rotate=function(t){t=t*Math.PI/180,this.transformationMatrix.elements[0]=Math.cos(t),this.transformationMatrix.elements[1]=Math.sin(t),this.transformationMatrix.elements[2]=-Math.sin(t),this.transformationMatrix.elements[3]=Math.cos(t)},ae.prototype.toString=function(){for(var t="",e=0,i=this.transformationMatrix.elements.length;e<i;e++)this.matrix.elements[e],t=t+u.floatToString(this.transformationMatrix.elements[e])+" ";return t},ae.prototype.multiply=function(t){this.transformationMatrix.multiply(t.matrix)},ae.degreesToRadians=function(t){return this.degRadFactor*t},ae.prototype.radiansToDegrees=function(t){return this.radDegFactor*t},ae.prototype.clone=function(){return this},ae.degRadFactor=Math.PI/180;var se=ae;function ae(t){this.radDegFactor=180/Math.PI,this.transformationMatrix=new he(1,0,0,void 0===t?1:-1,0,0)}Object.defineProperty(le.prototype,"elements",{get:function(){return this.metrixElements},enumerable:!0,configurable:!0}),Object.defineProperty(le.prototype,"offsetX",{get:function(){return this.metrixElements[4]},enumerable:!0,configurable:!0}),Object.defineProperty(le.prototype,"offsetY",{get:function(){return this.metrixElements[5]},enumerable:!0,configurable:!0}),le.prototype.translate=function(t,e){this.metrixElements[4]=t,this.metrixElements[5]=e},le.prototype.transform=function(t){var e=t.x,t=t.y,i=e*this.elements[0]+t*this.elements[2]+this.offsetX,e=e*this.elements[1]+t*this.elements[3]+this.offsetY;return new J(i,e)},le.prototype.multiply=function(t){var e=[];e.push(this.elements[0]*t.elements[0]+this.elements[1]*t.elements[2]),e[1]=this.elements[0]*t.elements[1]+this.elements[1]*t.elements[3],e[2]=this.elements[2]*t.elements[0]+this.elements[3]*t.elements[2],e[3]=this.elements[2]*t.elements[1]+this.elements[3]*t.elements[3],e[4]=this.offsetX*t.elements[0]+this.offsetY*t.elements[2]+t.offsetX,e[5]=this.offsetX*t.elements[1]+this.offsetY*t.elements[3]+t.offsetY;for(var i=0;i<e.length;i++)this.elements[i]=e[i]},le.prototype.dispose=function(){this.metrixElements=null},le.prototype.clone=function(){return new le(this.metrixElements)};var he=le;function le(t,e,i,r,n,o){void 0===t?this.metrixElements=[]:"number"==typeof t?(this.metrixElements=[],this.metrixElements.push(t),this.metrixElements.push(e),this.metrixElements.push(i),this.metrixElements.push(r),this.metrixElements.push(n),this.metrixElements.push(o)):this.metrixElements=t}var ue=function(){this.pdf="PDF",this.text="Text",this.imageB="ImageB",this.imageC="ImageC",this.imageI="ImageI"},ce=(pe.prototype.size=function(){return this.mKeys.length},pe.prototype.add=function(t,e){if(null==t||null==e)throw new ReferenceError("Provided key or value is not valid.");if(this.mKeys.indexOf(t)<0)return this.mKeys.push(t),this.mValues.push(e),1;throw new RangeError("An item with the same key has already been added.")},pe.prototype.keys=function(){return this.mKeys},pe.prototype.values=function(){return this.mValues},pe.prototype.getValue=function(t){if(null==t)throw new ReferenceError("Provided key is not valid.");t=this.mKeys.indexOf(t);if(t<0)throw new RangeError("No item with the specified key has been added.");return this.mValues[t]},pe.prototype.setValue=function(t,e){if(null==t)throw new ReferenceError("Provided key is not valid.");var i=this.mKeys.indexOf(t);i<0?(this.mKeys.push(t),this.mValues.push(e)):this.mValues[i]=e},pe.prototype.remove=function(t){if(null==t)throw new ReferenceError("Provided key is not valid.");t=this.mKeys.indexOf(t);if(t<0)throw new RangeError("No item with the specified key has been added.");return this.mKeys.splice(t,1),this.mValues.splice(t,1),!0},pe.prototype.containsKey=function(t){if(null==t)throw new ReferenceError("Provided key is not valid.");return!(this.mKeys.indexOf(t)<0)},pe.prototype.clear=function(){this.mKeys=[],this.mValues=[]},pe);function pe(){this.mKeys=[],this.mValues=[]}Object.defineProperty(fe.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0});var de=fe;function fe(t,e,i){this.dictionary=new c,this.dictionaryProperties=new l,this.dictionary.items.setValue(this.dictionaryProperties.CA,new u(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new u(e)),this.dictionary.items.setValue(this.dictionaryProperties.BM,new o(i.toString()))}Object.defineProperty(me.prototype,"automaticFields",{get:function(){return this.automaticFieldsInformation},enumerable:!0,configurable:!0}),me.prototype.add=function(t){return this.automaticFields.push(t)};var ge=me;function me(){this.automaticFieldsInformation=[]}function ye(){}ye.prototype.drawHelper=function(t,e,i){var r=0!==e||0!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},be=function(t,e){return(be=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}be(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Se,we=ye),Object.defineProperty(Se.prototype,"bounds",{get:function(){return this.internalBounds},set:function(t){this.internalBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"size",{get:function(){return new X(this.bounds.width,this.bounds.height)},set:function(t){this.bounds.width=t.width,this.bounds.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"location",{get:function(){return new J(this.bounds.x,this.bounds.y)},set:function(t){this.bounds.x=t.x,this.bounds.y=t.y},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"font",{get:function(){return this.internalFont},set:function(t){this.internalFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"brush",{get:function(){return this.internalBrush},set:function(t){this.internalBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"pen",{get:function(){return this.internalPen},set:function(t){this.internalPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(Se.prototype,"stringFormat",{get:function(){return this.internalStringFormat},set:function(t){this.internalStringFormat=t},enumerable:!0,configurable:!0}),Se.prototype.performDrawHelper=function(t,e,i,r){0!==this.bounds.height&&0!==this.bounds.width||(t=this.getValue(t),this.internalTemplateSize=this.getFont().measureString(t,this.size,this.stringFormat))},Se.prototype.draw=function(t,e,i){var r;void 0===e?(r=new J(0,0),this.draw(t,r)):e instanceof J?this.draw(t,e.x,e.y):(this.drawHelper(t,e,i),r=new ve(this,new J(e,i)),t.automaticFields.add(r))},Se.prototype.getSize=function(){return 0===this.bounds.height||0===this.bounds.width?this.internalTemplateSize:this.size},Se.prototype.drawInternal=function(t){},Se.prototype.getBrush=function(){return void 0===this.internalBrush||null==this.internalBrush?new mt(new f(0,0,0)):this.internalBrush},Se.prototype.getFont=function(){return void 0===this.internalFont||null==this.internalFont?Tr.defaultFont:this.internalFont},Se.prototype.getPageFromGraphics=function(t){return void 0!==t.page&&null!==t.page?t.page:t.currentPage};var be,we,Pe=Se;function Se(){var t=we.call(this)||this;return t.internalBounds=new Z(0,0,0,0),t.internalTemplateSize=new X(0,0),t}Object.defineProperty(Ce.prototype,"location",{get:function(){return this.pageNumberFieldLocation},set:function(t){this.pageNumberFieldLocation=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ce.prototype,"field",{get:function(){return this.pageNumberField},set:function(t){this.pageNumberField=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ce.prototype,"scalingX",{get:function(){return this.scaleX},set:function(t){this.scaleX=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ce.prototype,"scalingY",{get:function(){return this.scaleY},set:function(t){this.scaleY=t},enumerable:!0,configurable:!0});var ve=Ce;function Ce(t,e,i,r){this.pageNumberFieldLocation=new J,this.pageNumberField=null,this.scaleX=1,this.scaleY=1,void 0===e&&t instanceof Ce?(this.pageNumberField=t.field,this.pageNumberFieldLocation=t.location,this.scaleX=t.scalingX,this.scaleY=t.scalingY):void 0===i&&e instanceof J&&t instanceof Pe?(this.pageNumberField=t,this.pageNumberFieldLocation=e):(this.pageNumberField=t,this.pageNumberFieldLocation=e,this.scaleX=i,this.scaleY=r)}Object.defineProperty(Oe.prototype,"position",{get:function(){return this.mPosition},set:function(t){this.mPosition=t},enumerable:!0,configurable:!0}),Oe.prototype.read=function(t,e,i){for(var r=e;r<i;r++){var n=this.position;t.buffer[r]=this.readByte(n),this.position++}},Oe.prototype.getBuffer=function(t){return this.buffer[t]},Oe.prototype.writeFromBase64String=function(t){t=this.encodedString(t);this.buffer=t},Oe.prototype.encodedString=function(t){for(var e,i,r,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,a=0,h=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4,l=(t.charAt(t.length-1)===o.charAt(64)&&h--,new Uint8Array(0|h));s<t.length;)i=o.indexOf(t.charAt(s++)),e=(15&(r=o.indexOf(t.charAt(s++))))<<4|(n=o.indexOf(t.charAt(s++)))>>2,n=(3&n)<<6|o.indexOf(t.charAt(s++)),l[a++]=i<<2|r>>4,l[a++]=e,l[a++]=n;return l},Oe.prototype.readByte=function(t){return this.buffer[t]},Object.defineProperty(Oe.prototype,"internalBuffer",{get:function(){return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(Oe.prototype,"count",{get:function(){return this.buffer.byteLength},enumerable:!0,configurable:!0}),Oe.prototype.readNextTwoBytes=function(t){var e=t.readByte(this.position);return this.position++,e=(e<<=8)|t.readByte(this.position),this.position++,e};var Be=Oe;function Oe(t){this.mPosition=0,this.buffer=new Uint8Array(t),this.dataView=new DataView(this.buffer.buffer)}(w=Y.ImageFormat||(Y.ImageFormat={}))[w.Unknown=0]="Unknown",w[w.Bmp=1]="Bmp",w[w.Emf=2]="Emf",w[w.Gif=3]="Gif",w[w.Jpeg=4]="Jpeg",w[w.Png=5]="Png",w[w.Wmf=6]="Wmf",w[w.Icon=7]="Icon";Object.defineProperty(Le.prototype,"height",{get:function(){return this.mHeight},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"width",{get:function(){return this.mWidth},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"bitsPerComponent",{get:function(){return this.mbitsPerComponent},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"size",{get:function(){return this.mImageData.count},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"imageData",{get:function(){return this.mImageData},enumerable:!0,configurable:!0}),Object.defineProperty(Le.prototype,"imageDataAsNumberArray",{get:function(){return this.mImageData.internalBuffer.buffer},enumerable:!0,configurable:!0}),Le.prototype.initialize=function(){if(this.mFormat!==Y.ImageFormat.Unknown||!this.checkIfJpeg())throw new TypeError("Only the JPEG format is supported");this.mFormat=Y.ImageFormat.Jpeg,this.parseJpegImage(),this.reset(),this.mImageData=new Be(this.mStream.count),this.mStream.read(this.mImageData,0,this.mImageData.count)},Le.prototype.reset=function(){this.mStream.position=0},Le.prototype.parseJpegImage=function(){this.reset();for(var t=new Be(this.mStream.count),e=(this.mStream.read(t,0,t.count),4),i=!1,r=256*t.getBuffer(e)+t.getBuffer(e+1);e<t.count;){if(!((e+=r)<t.count)){i=!0;break}if(192===t.getBuffer(e+1))return this.mHeight=256*t.getBuffer(e+5)+t.getBuffer(e+6),void(this.mWidth=256*t.getBuffer(e+7)+t.getBuffer(e+8));e+=2,r=256*t.getBuffer(e)+t.getBuffer(e+1)}i&&(this.mStream.position=0,this.skip(this.mStream,2),this.readExceededJPGImage(this.mStream))},Object.defineProperty(Le.prototype,"format",{get:function(){return this.mFormat},enumerable:!0,configurable:!0}),Le.prototype.checkIfJpeg=function(){this.reset();for(var t=0;t<Le.mJpegHeader.length;t++){if(Le.mJpegHeader[t]!==this.mStream.readByte(t))return!1;this.mStream.position++}return!0},Le.prototype.getImageDictionary=function(){if(this.mFormat===Y.ImageFormat.Jpeg){this.imageData.internalBuffer.length;this.imageStream=new U,this.imageStream.isResource=!0;for(var t="",e="",i=0;i<this.imageDataAsNumberArray.byteLength;i++)t+=String.fromCharCode(null,this.mStream.readByte(i));for(i=0;i<t.length;i++)i%2!=0&&(e+=t[i]);this.imageStream.data=[e],this.imageStream.compress=!1,this.imageStream.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.xObject)),this.imageStream.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.image)),this.imageStream.items.setValue(this.dictionaryProperties.width,new u(this.width)),this.imageStream.items.setValue(this.dictionaryProperties.height,new u(this.height)),this.imageStream.items.setValue(this.dictionaryProperties.bitsPerComponent,new u(this.bitsPerComponent)),this.imageStream.items.setValue(this.dictionaryProperties.filter,new o(this.dictionaryProperties.dctdecode)),this.imageStream.items.setValue(this.dictionaryProperties.colorSpace,new o(this.getColorSpace())),this.imageStream.items.setValue(this.dictionaryProperties.decodeParms,this.getDecodeParams())}return this.imageStream},Le.prototype.getColorSpace=function(){return this.dictionaryProperties.deviceRgb},Le.prototype.getDecodeParams=function(){var t=new c;return t.items.setValue(this.dictionaryProperties.columns,new u(this.width)),t.items.setValue(this.dictionaryProperties.blackIs1,new zt(!0)),t.items.setValue(this.dictionaryProperties.k,new u(-1)),t.items.setValue(this.dictionaryProperties.predictor,new u(15)),t.items.setValue(this.dictionaryProperties.bitsPerComponent,new u(this.bitsPerComponent)),t},Le.prototype.readExceededJPGImage=function(t){this.mStream=t;for(var e=!0;e;)switch(this.getMarker(t)){case this.sof1Marker:case this.sof2Marker:case this.sof3Marker:case this.sof5Marker:case this.sof6Marker:case this.sof7Marker:case this.sof9Marker:case this.sof10Marker:case this.sof11Marker:case this.sof13Marker:case this.sof14Marker:case this.sof15Marker:t.position+=3,this.mHeight=this.mStream.readNextTwoBytes(t),this.mWidth=this.mStream.readNextTwoBytes(t),e=!1;break;default:this.skipStream(t)}},Le.prototype.skip=function(t,e){this.mStream=t;t=new Be(e);this.mStream.read(t,0,t.count)},Le.prototype.getMarker=function(t){var e=32,e=t.readByte(this.mStream.position);for(t.position++;255!==e;)e=t.readByte(this.mStream.position),t.position++;for(;e=t.readByte(this.mStream.position),t.position++,255===e;);return e},Le.prototype.skipStream=function(t){var e=this.mStream.readNextTwoBytes(t)-2;0<e&&(t.position+=e)},Le.mPngHeader=[137,80,78,71,13,10,26,10],Le.mJpegHeader=[255,216],Le.GIF_HEADER="G,I,F,8",Le.BMP_HEADER="B,M";var xe=Le;function Le(t){this.sof1Marker=193,this.sof2Marker=194,this.sof3Marker=195,this.sof5Marker=197,this.sof6Marker=198,this.sof7Marker=199,this.sof9Marker=201,this.sof10Marker=202,this.sof11Marker=203,this.sof13Marker=205,this.sof14Marker=206,this.sof15Marker=207,this.mFormat=Y.ImageFormat.Unknown,this.mbitsPerComponent=8,this.dictionaryProperties=new l,this.mStream=t,this.initialize()}je.prototype.convertUnits=function(t,e,i){return this.convertFromPixels(this.convertToPixels(t,e),i)},je.prototype.convertToPixels=function(t,e){return t*this.proportions[e]},je.prototype.convertFromPixels=function(t,e){return t/this.proportions[e]},je.prototype.updateProportionsHelper=function(t){this.proportions=[t/2.54,t/6,1,t/72,t,t/300,t/25.4]},je.horizontalResolution=96,je.verticalResolution=96;var Te=je;function je(t){this.updateProportionsHelper(t)}Object.defineProperty(Ve.prototype,"width",{get:function(){return this.imageWidth},set:function(t){this.imageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ve.prototype,"height",{get:function(){return this.imageHeight},set:function(t){this.imageHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ve.prototype,"size",{set:function(t){this.width=t.width,this.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(Ve.prototype,"physicalDimension",{get:function(){return this.imagePhysicalDimension=this.getPointSize(this.width,this.height,this.horizontalResolution,this.verticalResolution),new X(this.width,this.height)},enumerable:!0,configurable:!0}),Object.defineProperty(Ve.prototype,"element",{get:function(){return this.imageStream},enumerable:!0,configurable:!0}),Ve.prototype.getPointSize=function(t,e,i,r){var n,o;return void 0===i?(n=Te.horizontalResolution,o=Te.verticalResolution,this.getPointSize(t,e,n,o)):(n=new Te(i),o=new Te(r),i=n.convertUnits(t,Y.PdfGraphicsUnit.Pixel,Y.PdfGraphicsUnit.Point),r=o.convertUnits(e,Y.PdfGraphicsUnit.Pixel,Y.PdfGraphicsUnit.Point),new X(i,r))};var ke=Ve;function Ve(){}Re=function(t,e){return(Re=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Re(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(De,Me=ke),De.prototype.loadImage=function(t){this.initializeAsync(t)},De.prototype.initializeAsync=function(t){var e=new Be(t.length);e.writeFromBase64String(t),this.decoder=new xe(e),this.height=this.decoder.height,this.width=this.decoder.width,this.bitsPerComponent=this.decoder.bitsPerComponent},De.prototype.save=function(){this.imageStatus=!0,this.imageStream=this.decoder.getImageDictionary()};var Re,Me,Ae=De;function De(t){var e=Me.call(this)||this;return e.imageStatus=!0,e.dictionaryProperties=new l,e.loadImage(t),e}Object.defineProperty(Fe.prototype,"empty",{get:function(){return this.offset===this.length&&this.length===this.checksum&&0===this.checksum},enumerable:!0,configurable:!0});var Ne=Fe;function Fe(){}var Ie=function(){},Ee=function(){},Ge=function(){},ze=(Object.defineProperty(We.prototype,"isItalic",{get:function(){return 0!=(2&this.macStyle)},enumerable:!0,configurable:!0}),Object.defineProperty(We.prototype,"isBold",{get:function(){return 0!=(1&this.macStyle)},enumerable:!0,configurable:!0}),We);function We(){}var _e=function(){},He=function(){},Ue=function(){},Ke=function(){},qe=function(){},Ye=function(){},Je=(Object.defineProperty(Xe.prototype,"empty",{get:function(){return this.index===this.width&&this.width===this.charCode&&0===this.charCode},enumerable:!0,configurable:!0}),Xe.prototype.compareTo=function(t){return this.index-t.index},Xe);function Xe(){}var Ze=function(){},$e=function(){},Qe=function(){},ti=function(){},ei=function(){},ii=(Object.defineProperty(ri.prototype,"data",{get:function(){if(this.buffer.length<this.bufferLength)for(var t=this.bufferLength-this.buffer.length,e=0;e<t;e++)this.buffer.push(0);return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(ri.prototype,"position",{get:function(){return void 0!==this.internalPosition&&null!==this.internalPosition||(this.internalPosition=0),this.internalPosition},enumerable:!0,configurable:!0}),ri.prototype.writeShort=function(t){this.flush([(65280&t)>>8,255&t])},ri.prototype.writeInt=function(t){this.flush([(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t])},ri.prototype.writeUInt=function(t){this.flush([(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t])},ri.prototype.writeString=function(t){if(null==t)throw new Error("Argument Null Exception : value");for(var e=[],i=0;i<t.length;i++)e.push(t.charCodeAt(i));this.flush(e)},ri.prototype.writeBytes=function(t){this.flush(t)},ri.prototype.flush=function(t){if(null===t)throw new Error("Argument Null Exception : buff");for(var e=this.position,i=0;i<t.length;i++)this.buffer[e]=t[i],e++;this.internalPosition+=t.length},ri);function ri(t){this.int32Size=4,this.int16Size=2,this.int64Size=8,this.bufferLength=t,this.buffer=[]}Object.defineProperty(b.prototype,"macintosh",{get:function(){return null!==this.macintoshDictionary&&void 0!==this.macintoshDictionary||(this.macintoshDictionary=new a),this.macintoshDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"microsoft",{get:function(){return null!==this.microsoftDictionary&&void 0!==this.microsoftDictionary||(this.microsoftDictionary=new a),this.microsoftDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"macintoshGlyphs",{get:function(){return null!==this.internalMacintoshGlyphs&&void 0!==this.internalMacintoshGlyphs||(this.internalMacintoshGlyphs=new a),this.internalMacintoshGlyphs},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"microsoftGlyphs",{get:function(){return null!==this.internalMicrosoftGlyphs&&void 0!==this.internalMicrosoftGlyphs||(this.internalMicrosoftGlyphs=new a),this.internalMicrosoftGlyphs},enumerable:!0,configurable:!0}),b.prototype.initialize=function(){void 0===this.metrics&&(this.metrics=new ze),this.readFontDictionary();var t=this.readNameTable(),e=this.readHeadTable();this.initializeFontName(t),this.metrics.macStyle=e.macStyle},b.prototype.readFontDictionary=function(){this.offset=0;this.checkPreambula();var t=this.readInt16(this.offset);this.readInt16(this.offset),this.readInt16(this.offset),this.readInt16(this.offset);void 0===this.tableDirectory&&(this.tableDirectory=new a);for(var e=0;e<t;++e){var i=new Ne,r=this.readString(this.int32Size);i.checksum=this.readInt32(this.offset),i.offset=this.readInt32(this.offset),i.length=this.readInt32(this.offset),this.tableDirectory.setValue(r,i)}this.lowestPosition=this.offset,this.isTtcFont||this.fixOffsets()},b.prototype.fixOffsets=function(){for(var t=Number.MAX_VALUE,e=this.tableDirectory.keys(),i=0;i<e.length;i++){var r=(o=this.tableDirectory.getValue(e[i])).offset;if(r<t&&(t=r)<=this.lowestPosition)break}var n=t-this.lowestPosition;if(0!=n){for(var o,s=new a,i=0;i<e.length;i++)(o=this.tableDirectory.getValue(e[i])).offset-=n,s.setValue(e[i],o);this.tableDirectory=s}},b.prototype.checkPreambula=function(){var t=this.readInt32(this.offset);if(this.isMacTtf=1953658213===t,65536!==t&&1953658213!==t&&1330926671!==t){if(this.isTtcFont=!0,this.offset=0,"ttcf"!==this.readString(4))throw new Error("Can not read TTF font data");if(this.offset+=4,this.readInt32(this.offset)<0)throw new Error("Can not read TTF font data");this.offset=this.readInt32(this.offset),t=this.readInt32(this.offset)}return t},b.prototype.readNameTable=function(){for(var t=this.getTable("name"),e=(this.offset=t.offset,new Ie),i=(e.formatSelector=this.readUInt16(this.offset),e.recordsCount=this.readUInt16(this.offset),e.offset=this.readUInt16(this.offset),e.nameRecords=[],this.offset),r=0;r<e.recordsCount;r++){this.offset=i;var n=new Ee,o=(n.platformID=this.readUInt16(this.offset),n.encodingID=this.readUInt16(this.offset),n.languageID=this.readUInt16(this.offset),n.nameID=this.readUInt16(this.offset),n.length=this.readUInt16(this.offset),n.offset=this.readUInt16(this.offset),this.offset=t.offset+e.offset+n.offset,0===n.platformID||3===n.platformID);n.name=this.readString(n.length,o),e.nameRecords[r]=n,i+=12}return e},b.prototype.readHeadTable=function(){var t=this.getTable("head"),t=(this.offset=t.offset,new Ge);return t.version=this.readFixed(this.offset),t.fontRevision=this.readFixed(this.offset),t.checkSumAdjustment=this.readUInt32(this.offset),t.magicNumber=this.readUInt32(this.offset),t.flags=this.readUInt16(this.offset),t.unitsPerEm=this.readUInt16(this.offset),t.created=this.readInt64(this.offset),t.modified=this.readInt64(this.offset),t.xMin=this.readInt16(this.offset),t.yMin=this.readInt16(this.offset),t.xMax=this.readInt16(this.offset),t.yMax=this.readInt16(this.offset),t.macStyle=this.readUInt16(this.offset),t.lowestReadableSize=this.readUInt16(this.offset),t.fontDirectionHint=this.readInt16(this.offset),t.indexToLocalFormat=this.readInt16(this.offset),t.glyphDataFormat=this.readInt16(this.offset),t},b.prototype.readHorizontalHeaderTable=function(){var t=this.getTable("hhea"),t=(this.offset=t.offset,new _e);return t.version=this.readFixed(this.offset),t.ascender=this.readInt16(this.offset),t.descender=this.readInt16(this.offset),t.lineGap=this.readInt16(this.offset),t.advanceWidthMax=this.readUInt16(this.offset),t.minLeftSideBearing=this.readInt16(this.offset),t.minRightSideBearing=this.readInt16(this.offset),t.xMaxExtent=this.readInt16(this.offset),t.caretSlopeRise=this.readInt16(this.offset),t.caretSlopeRun=this.readInt16(this.offset),this.offset+=10,t.metricDataFormat=this.readInt16(this.offset),t.numberOfHMetrics=this.readUInt16(this.offset),t},b.prototype.readOS2Table=function(){var t=this.getTable("OS/2"),t=(this.offset=t.offset,new He);return t.version=this.readUInt16(this.offset),t.xAvgCharWidth=this.readInt16(this.offset),t.usWeightClass=this.readUInt16(this.offset),t.usWidthClass=this.readUInt16(this.offset),t.fsType=this.readInt16(this.offset),t.ySubscriptXSize=this.readInt16(this.offset),t.ySubscriptYSize=this.readInt16(this.offset),t.ySubscriptXOffset=this.readInt16(this.offset),t.ySubscriptYOffset=this.readInt16(this.offset),t.ySuperscriptXSize=this.readInt16(this.offset),t.ySuperscriptYSize=this.readInt16(this.offset),t.ySuperscriptXOffset=this.readInt16(this.offset),t.ySuperscriptYOffset=this.readInt16(this.offset),t.yStrikeoutSize=this.readInt16(this.offset),t.yStrikeoutPosition=this.readInt16(this.offset),t.sFamilyClass=this.readInt16(this.offset),t.panose=this.readBytes(10),t.ulUnicodeRange1=this.readUInt32(this.offset),t.ulUnicodeRange2=this.readUInt32(this.offset),t.ulUnicodeRange3=this.readUInt32(this.offset),t.ulUnicodeRange4=this.readUInt32(this.offset),t.vendorIdentifier=this.readBytes(4),t.fsSelection=this.readUInt16(this.offset),t.usFirstCharIndex=this.readUInt16(this.offset),t.usLastCharIndex=this.readUInt16(this.offset),t.sTypoAscender=this.readInt16(this.offset),t.sTypoDescender=this.readInt16(this.offset),t.sTypoLineGap=this.readInt16(this.offset),t.usWinAscent=this.readUInt16(this.offset),t.usWinDescent=this.readUInt16(this.offset),t.ulCodePageRange1=this.readUInt32(this.offset),t.ulCodePageRange2=this.readUInt32(this.offset),1<t.version?(t.sxHeight=this.readInt16(this.offset),t.sCapHeight=this.readInt16(this.offset),t.usDefaultChar=this.readUInt16(this.offset),t.usBreakChar=this.readUInt16(this.offset),t.usMaxContext=this.readUInt16(this.offset)):(t.sxHeight=0,t.sCapHeight=0,t.usDefaultChar=0,t.usBreakChar=0,t.usMaxContext=0),t},b.prototype.readPostTable=function(){var t=this.getTable("post"),t=(this.offset=t.offset,new Ue);return t.formatType=this.readFixed(this.offset),t.italicAngle=this.readFixed(this.offset),t.underlinePosition=this.readInt16(this.offset),t.underlineThickness=this.readInt16(this.offset),t.isFixedPitch=this.readUInt32(this.offset),t.minType42=this.readUInt32(this.offset),t.maxType42=this.readUInt32(this.offset),t.minType1=this.readUInt32(this.offset),t.maxType1=this.readUInt32(this.offset),t},b.prototype.readWidthTable=function(t,e){for(var i=this.getTable("hmtx"),r=(this.offset=i.offset,[]),n=0;n<t;n++){var o=new Ke,o=(o.advanceWidth=this.readUInt16(this.offset),o.lsb=this.readInt16(this.offset),1e3*o.advanceWidth/e);r.push(Math.floor(o))}return r},b.prototype.readCmapTable=function(){for(var t=this.getTable("cmap"),e=(this.offset=t.offset,new Ye),i=(e.version=this.readUInt16(this.offset),e.tablesCount=this.readUInt16(this.offset),this.offset),r=[],n=0;n<e.tablesCount;n++){this.offset=i;var o=new qe;o.platformID=this.readUInt16(this.offset),o.encodingID=this.readUInt16(this.offset),o.offset=this.readUInt32(this.offset),i=this.offset,this.readCmapSubTable(o),r[n]=o}return r},b.prototype.readCmapSubTable=function(t){var e=this.getTable("cmap"),e=(this.offset=e.offset+t.offset,this.readUInt16(this.offset)),i=this.getCmapEncoding(t.platformID,t.encodingID);i===Y.TtfCmapEncoding.Macintosh?Y.TtfPlatformID.Macintosh:Y.TtfPlatformID.Microsoft;if(i!==Y.TtfCmapEncoding.Unknown)switch(e){case Y.TtfCmapFormat.Apple:this.readAppleCmapTable(t,i);break;case Y.TtfCmapFormat.Microsoft:this.readMicrosoftCmapTable(t,i);break;case Y.TtfCmapFormat.Trimmed:this.readTrimmedCmapTable(t,i)}},b.prototype.readAppleCmapTable=function(t,e){var i=this.getTable("cmap"),i=(this.offset=i.offset+t.offset,new $e);i.format=this.readUInt16(this.offset),i.length=this.readUInt16(this.offset),i.version=this.readUInt16(this.offset),null!==this.maxMacIndex&&void 0!==this.maxMacIndex||(this.maxMacIndex=0);for(var r=0;r<256;++r){var n=new Je;n.index=this.readByte(this.offset),n.width=this.getWidth(n.index),n.charCode=r,this.macintosh.setValue(r,n),this.addGlyph(n,e),this.maxMacIndex=Math.max(r,this.maxMacIndex)}},b.prototype.readMicrosoftCmapTable=function(t,e){for(var i=this.getTable("cmap"),r=(this.offset=i.offset+t.offset,e===Y.TtfCmapEncoding.Unicode?this.microsoft:this.macintosh),n=new Qe,o=(n.format=this.readUInt16(this.offset),n.length=this.readUInt16(this.offset),n.version=this.readUInt16(this.offset),n.segCountX2=this.readUInt16(this.offset),n.searchRange=this.readUInt16(this.offset),n.entrySelector=this.readUInt16(this.offset),n.rangeShift=this.readUInt16(this.offset),n.segCountX2/2),i=(n.endCount=this.readUshortArray(o),n.reservedPad=this.readUInt16(this.offset),n.startCount=this.readUshortArray(o),n.idDelta=this.readUshortArray(o),n.idRangeOffset=this.readUshortArray(o),n.length/2-8-4*o),s=(n.glyphID=this.readUshortArray(i),0),a=0;a<o;a++)for(var h=n.startCount[a];h<=n.endCount[a]&&65535!==h;h++){if(0===n.idRangeOffset[a])s=h+n.idDelta[a]&65535;else{if((l=a+n.idRangeOffset[a]/2-o+h-n.startCount[a])>=n.glyphID.length)continue;s=n.glyphID[l]+n.idDelta[a]&65535}var l=new Je,u=(l.index=s,l.width=this.getWidth(l.index),e===Y.TtfCmapEncoding.Symbol&&61440==(65280&h)?255&h:h);l.charCode=u,r.setValue(u,l),this.addGlyph(l,e)}},b.prototype.readTrimmedCmapTable=function(t,e){var i=this.getTable("cmap"),r=(this.offset=i.offset+t.offset,new ti);r.format=this.readUInt16(this.offset),r.length=this.readUInt16(this.offset),r.version=this.readUInt16(this.offset),r.firstCode=this.readUInt16(this.offset),r.entryCount=this.readUInt16(this.offset);for(var n=0;n<r.entryCount;++n){var o=new Je;o.index=this.readUInt16(this.offset),o.width=this.getWidth(o.index),o.charCode=n+r.firstCode,this.macintosh.setValue(n,o),this.addGlyph(o,e),this.maxMacIndex=Math.max(n,this.maxMacIndex)}},b.prototype.initializeFontName=function(t){for(var e=0;e<t.recordsCount;e++){var i=t.nameRecords[e];if(1===i.nameID?this.metrics.fontFamily=i.name:6===i.nameID&&(this.metrics.postScriptName=i.name),null!==this.metrics.fontFamily&&void 0!==this.metrics.fontFamily&&null!==this.metrics.postScriptName&&void 0!==this.metrics.postScriptName)break}},b.prototype.getTable=function(t){var e,i=new Ne;return i=null!=(e=this.tableDirectory.containsKey(t)?this.tableDirectory.getValue(t):e)?e:i},b.prototype.getWidth=function(t){return t=t<this.width.length?t:this.width.length-1,this.width[t]},b.prototype.getCmapEncoding=function(t,e){var i=Y.TtfCmapEncoding.Unknown;return t==Y.TtfPlatformID.Microsoft&&e==Y.TtfMicrosoftEncodingID.Undefined?i=Y.TtfCmapEncoding.Symbol:t==Y.TtfPlatformID.Microsoft&&e==Y.TtfMicrosoftEncodingID.Unicode?i=Y.TtfCmapEncoding.Unicode:t==Y.TtfPlatformID.Macintosh&&e==Y.TtfMacintoshEncodingID.Roman&&(i=Y.TtfCmapEncoding.Macintosh),i},b.prototype.addGlyph=function(t,e){var i=null;switch(e){case Y.TtfCmapEncoding.Unicode:i=this.microsoftGlyphs;break;case Y.TtfCmapEncoding.Macintosh:case Y.TtfCmapEncoding.Symbol:i=this.macintoshGlyphs}i.setValue(t.index,t)},b.prototype.initializeMetrics=function(t,e,i,r,n,o){this.initializeFontName(t);for(var s=!1,a=0;a<o.length;a++){var h=o[a];if(this.getCmapEncoding(h.platformID,h.encodingID)===Y.TtfCmapEncoding.Symbol){s=!0;break}}this.metrics.isSymbol=s,this.metrics.macStyle=e.macStyle,this.metrics.isFixedPitch=0!==n.isFixedPitch,this.metrics.italicAngle=n.italicAngle;var t=1e3/e.unitsPerEm,n=(this.metrics.winAscent=r.sTypoAscender*t,this.metrics.macAscent=i.ascender*t,this.metrics.capHeight=0!==r.sCapHeight?r.sCapHeight:.7*e.unitsPerEm*t,this.metrics.winDescent=r.sTypoDescender*t,this.metrics.macDescent=i.descender*t,this.metrics.leading=(r.sTypoAscender-r.sTypoDescender+r.sTypoLineGap)*t,this.metrics.lineGap=Math.ceil(i.lineGap*t),e.xMin*t),i=Math.ceil(this.metrics.macAscent+this.metrics.lineGap),t=e.xMax*t,l=this.metrics.macDescent;this.metrics.fontBox=new ut(n,i,t,l),this.metrics.stemV=80,this.metrics.widthTable=this.updateWidth(),this.metrics.contains=this.tableDirectory.containsKey("CFF"),this.metrics.subScriptSizeFactor=e.unitsPerEm/r.ySubscriptYSize,this.metrics.superscriptSizeFactor=e.unitsPerEm/r.ySuperscriptYSize},b.prototype.updateWidth=function(){var t=[];if(this.metrics.isSymbol)for(var e=0;e<256;e++){var i=this.getGlyph(String.fromCharCode(e));t[e]=i.empty?0:i.width}else for(var r=[],n=String.fromCharCode(32),e=0;e<256;e++){r[0]=e;var o=this.getString(r,0,r.length),o=0<o.length?o[0]:"?";(i=this.getGlyph(o)).empty?(i=this.getGlyph(n),t[e]=i.empty?0:i.width):t[e]=i.width}return t},b.prototype.getDefaultGlyph=function(){return this.getGlyph(Pt.whiteSpace)},b.prototype.getString=function(t,e,i){for(var r="",n=0;n<i;n++)r+=String.fromCharCode(t[n+e]);return r},b.prototype.readLocaTable=function(t){var e=this.getTable("loca"),i=(this.offset=e.offset,new Ze),r=null;if(t)for(var n=e.length/2,r=[],o=0;o<n;o++)r[o]=2*this.readUInt16(this.offset);else{n=e.length/4;r=[];for(o=0;o<n;o++)r[o]=this.readUInt32(this.offset)}return i.offsets=r,i},b.prototype.updateGlyphChars=function(t,e){t.containsKey(0)||t.setValue(0,0);for(var i=new a,r=t.keys(),n=0;n<r.length;n++)i.setValue(r[n],t.getValue(r[n]));for(n=0;n<r.length;n++){var o=r[n];this.processCompositeGlyph(t,o,e)}},b.prototype.processCompositeGlyph=function(t,e,i){if(e<i.offsets.length-1){var r=i.offsets[e];if(r!==i.offsets[e+1]){i=this.getTable("glyf"),e=(this.offset=i.offset+r,new ei);if(e.numberOfContours=this.readInt16(this.offset),e.xMin=this.readInt16(this.offset),e.yMin=this.readInt16(this.offset),e.xMax=this.readInt16(this.offset),e.yMax=this.readInt16(this.offset),e.numberOfContours<0)for(var n=0;;){var o=this.readUInt16(this.offset),s=this.readUInt16(this.offset);if(t.containsKey(s)||t.setValue(s,0),0==(o&Y.TtfCompositeGlyphFlags.MoreComponents))break;n=0!=(o&Y.TtfCompositeGlyphFlags.Arg1And2AreWords)?4:2,0!=(o&Y.TtfCompositeGlyphFlags.WeHaveScale)?n+=2:0!=(o&Y.TtfCompositeGlyphFlags.WeHaveAnXyScale)?n+=4:0!=(o&Y.TtfCompositeGlyphFlags.WeHaveTwoByTwo)&&(n+=8),this.offset+=n}}}},b.prototype.generateGlyphTable=function(t,e,i,r){i=[];for(var n=t.keys(),o=(n.sort(function(t,e){return t-e}),0),s=0;s<n.length;s++){var a=n[s];0<e.offsets.length&&(o+=e.offsets[a+1]-e.offsets[a])}var h=this.align(o);r=[];for(s=0;s<h;s++)r.push(0);for(var l,u,c=0,p=0,d=this.getTable("glyf"),s=0;s<e.offsets.length;s++)i.push(c),p<n.length&&n[p]===s&&(++p,i[s]=c,l=e.offsets[s],0<(u=e.offsets[s+1]-l))&&(this.offset=d.offset+l,r=this.read(r,c,u).buffer,c+=u);return{glyphTableSize:o,newLocaTable:i,newGlyphTable:r}},b.prototype.updateLocaTable=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTable");for(var r=e?2*t.length:4*t.length,n=this.align(r),o=new ii(n),s=0;s<t.length;s++){var a=t[s];e?(a/=2,o.writeShort(a)):o.writeInt(a)}return{newLocaUpdated:o.data,newLocaSize:r}},b.prototype.align=function(t){return t+3&-4},b.prototype.getFontProgram=function(t,e,i,r){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");this.tableNames;var n=this.getFontProgramLength(t,e,0),o=n.fontProgramLength,n=n.numTables,o=new ii(o),s=(o.writeInt(65536),o.writeShort(n),this.entrySelectors[n]);return o.writeShort(16*(1<<(31&s))),o.writeShort(s),o.writeShort(16*(n-(1<<(31&s)))),this.writeCheckSums(o,n,t,e,i,r),this.writeGlyphs(o,t,e),o.data},b.prototype.getFontProgramLength=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");i=2;for(var r=this.tableNames,n=0,o=0;o<r.length;o++){var s=r[o];"glyf"===s||"loca"===s||(s=this.getTable(s)).empty||(++i,n+=this.align(s.length))}return{fontProgramLength:n=(n+=t.length)+e.length+(16*i+12),numTables:i}},b.prototype.writeCheckSums=function(t,e,i,r,n,o){if(null===t)throw new Error("Argument Null Exception : writer");if(null===i)throw new Error("Argument Null Exception : newLocaTableOut");if(null===r)throw new Error("Argument Null Exception : newGlyphTable");for(var s=this.tableNames,a=16*e+12,h=0,l=0;l<s.length;l++){var u,c=s[l],p=this.getTable(c);p.empty||(t.writeString(c),h="glyf"===c?(u=this.calculateCheckSum(r),t.writeInt(u),n):"loca"===c?(u=this.calculateCheckSum(i),t.writeInt(u),o):(t.writeInt(p.checksum),p.length),t.writeUInt(a),t.writeUInt(h),a+=this.align(h))}},b.prototype.calculateCheckSum=function(t){if(null===t)throw new Error("Argument Null Exception : bytes");for(var e=0,i=0,r=0,n=0,o=0,s=0;s<(t.length+1)/4;s++)o+=255&t[e++],n+=255&t[e++],r+=255&t[e++],i+=255&t[e++];var a=i;return(a+=r<<8)+(n<<16)+(o<<24)},b.prototype.writeGlyphs=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : writer");if(null===e)throw new Error("Argument Null Exception : newLocaTableOut");if(null===i)throw new Error("Argument Null Exception : newGlyphTable");for(var r=this.tableNames,n=0;n<r.length;n++){var o=r[n],s=this.getTable(o);if(!s.empty)if("glyf"===o)t.writeBytes(i);else if("loca"===o)t.writeBytes(e);else{for(var a=this.align(s.length),h=[],l=0;l<a;l++)h.push(0);this.offset=s.offset;o=this.read(h,0,s.length);t.writeBytes(o.buffer)}}},b.prototype.setOffset=function(t){this.offset=t},b.prototype.createInternals=function(){this.metrics=new ze;var t=this.readNameTable(),e=this.readHeadTable(),i=(this.bIsLocaShort=0===e.indexToLocalFormat,this.readHorizontalHeaderTable()),r=this.readOS2Table(),n=this.readPostTable(),o=(this.width=this.readWidthTable(i.numberOfHMetrics,e.unitsPerEm),this.readCmapTable());this.initializeMetrics(t,e,i,r,n,o)},b.prototype.getGlyph=function(t){var e,i;return"number"==typeof t?(e=null,this.metrics.isSymbol||null==this.microsoftGlyphs?this.metrics.isSymbol&&null!=this.macintoshGlyphs&&this.macintoshGlyphs.containsKey(t)&&(e=this.macintoshGlyphs.getValue(t)):this.microsoftGlyphs.containsKey(t)&&(e=this.microsoftGlyphs.getValue(t)),null!=e?e:this.getDefaultGlyph()):(e=null,i=t.charCodeAt(0),this.metrics.isSymbol||null===this.microsoft?(this.metrics.isSymbol&&null!==this.macintosh||this.isMacTTF)&&(0!==this.maxMacIndex?i%=this.maxMacIndex+1:i=61440==(65280&i)?255&i:i,this.macintosh.containsKey(i))&&(e=this.macintosh.getValue(i),this.isFontPresent=!0):this.microsoft.containsKey(i)?(e=this.microsoft.getValue(i),i!==Pt.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!0)):i!==Pt.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!1),null!==(e=t===Pt.whiteSpace&&null===e?new Je:e)?e:this.getDefaultGlyph())},b.prototype.getGlyphChars=function(t){if(null==t)throw new Error("Argument Null Exception : chars");for(var e=new a,i=t.keys(),r=0;r<i.length;r++){var n=i[r],o=this.getGlyph(n);o.empty||e.setValue(o.index,n.charCodeAt(0))}return e},b.prototype.getAllGlyphs=function(){for(var t=[],e=new Je,i=0,r=0;r<this.width.length;r++){var n=this.width[r];e.index=i,e.width=n,t.push(e),i++}return t},b.prototype.readFontProgram=function(t){var e=this.getGlyphChars(t),i=this.readLocaTable(this.bIsLocaShort),t=(e.size()<t.size()&&(this.missedGlyphs=t.size()-e.size()),this.updateGlyphChars(e,i),this.generateGlyphTable(e,i,null,null)),e=t.glyphTableSize,i=t.newLocaTable,t=t.newGlyphTable,i=this.updateLocaTable(i,this.bIsLocaShort,null),r=i.newLocaSize,i=i.newLocaUpdated;return this.getFontProgram(i,t,e,r)},b.prototype.convertString=function(t){if(null===t)throw new Error("Argument Null Exception : text");for(var e="",i=0;i<t.length;i++){var r=t[i],r=this.getGlyph(r);r.empty||(e+=String.fromCharCode(r.index))}return e},b.prototype.getCharWidth=function(t){t=this.getGlyph(t);return(t=t.empty?this.getDefaultGlyph():t).empty?0:t.width},b.prototype.readString=function(t,e){if(void 0===e)return this.readString(t,!1);var i="";if(e)for(var r=0;r<t;r++)r%2!=0&&(i+=String.fromCharCode(this.fontData[this.offset])),this.offset+=1;else for(r=0;r<t;r++)i+=String.fromCharCode(this.fontData[this.offset]),this.offset+=1;return i},b.prototype.readFixed=function(t){return this.readInt16(t)+this.readInt16(t+2)/16384},b.prototype.readInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],t=this.fontData[t];return this.offset+=4,e+(i<<8)+(r<<16)+(t<<24)},b.prototype.readUInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],t=this.fontData[t];return this.offset+=4,e|i<<8|r<<16|t<<24},b.prototype.readInt16=function(t){t=32768&(t=(this.fontData[t]<<8)+this.fontData[t+1])?t-65536:t;return this.offset+=2,t},b.prototype.readInt64=function(t){var e=this.readInt32(t+4),t=4294967296*this.readInt32(t)+e;return e<0&&(t+=4294967296),t},b.prototype.readUInt16=function(t){t=this.fontData[t]<<8|this.fontData[t+1];return this.offset+=2,t},b.prototype.readUshortArray=function(t){for(var e=[],i=0;i<t;i++)e[i]=this.readUInt16(this.offset);return e},b.prototype.readBytes=function(t){for(var e=[],i=0;i<t;i++)e.push(this.fontData[this.offset]),this.offset+=1;return e},b.prototype.readByte=function(t){t=this.fontData[t];return this.offset+=1,t},b.prototype.read=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : buffer");var r,n=0;do{for(var o=0;o<i-n&&this.offset+o<this.fontData.length;o++)t[e+o]=this.fontData[this.offset+o]}while(this.offset+=r=i-n,(n+=r)<i);return{buffer:t,written:n}};var ni=b;function b(t){this.int32Size=4,this.isTtcFont=!1,this.isMacTtf=!1,this.metricsName="",this.isMacTTF=!1,this.missedGlyphs=0,this.tableNames=["cvt ","fpgm","glyf","head","hhea","hmtx","loca","maxp","prep"],this.entrySelectors=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4],this.fontData=t,this.initialize()}oi=function(t,e){return(oi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var oi,w=function(t,e){function i(){this.constructor=t}oi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},si=(ai.prototype.getAscent=function(t){return this.ascent*Tt.charSizeMultiplier*this.getSize(t)},ai.prototype.getDescent=function(t){return this.descent*Tt.charSizeMultiplier*this.getSize(t)},ai.prototype.getLineGap=function(t){return this.lineGap*Tt.charSizeMultiplier*this.getSize(t)},ai.prototype.getHeight=function(t){t=this.getDescent(t)<0?this.getAscent(t)-this.getDescent(t)+this.getLineGap(t):this.getAscent(t)+this.getDescent(t)+this.getLineGap(t);return t},ai.prototype.getSize=function(t){var e=this.size;if(null!=t)switch(t.subSuperScript){case Y.PdfSubSuperScript.SubScript:e/=this.subScriptSizeFactor;break;case Y.PdfSubSuperScript.SuperScript:e/=this.superscriptSizeFactor}return e},ai.prototype.clone=function(){return this.widthTable=hi.clone(),this},Object.defineProperty(ai.prototype,"widthTable",{get:function(){return this.internalWidthTable},set:function(t){this.internalWidthTable=t},enumerable:!0,configurable:!0}),ai);function ai(){this.lineGap=0}li.clone=function(){return null};var hi=li;function li(){}w(pi,ui=hi),pi.prototype.items=function(t){if(t<0||t>=this.widths.length)throw new Error("ArgumentOutOfRangeException:index, The character is not supported by the font.");return this.widths[t]},Object.defineProperty(pi.prototype,"length",{get:function(){return this.widths.length},enumerable:!0,configurable:!0}),pi.prototype.clone=function(){return this.widths=this.widths,this},pi.prototype.toArray=function(){return new p(this.widths)};var ui,ci=pi;function pi(t){var e=ui.call(this)||this;if(null==t)throw new Error("ArgumentNullException:widths");return e.widths=t,e}P.prototype.getCharWidth=function(t){return this.ttfReader.getCharWidth(t)},P.prototype.getLineWidth=function(t){for(var e=0,i=0,r=t.length;i<r;i++){var n=t[i];e+=this.getCharWidth(n)}return e},P.prototype.Initialize=function(){var t=new Be(this.fontString.length);t.writeFromBase64String(this.fontString),this.fontData=t.internalBuffer,this.ttfReader=new ni(this.fontData),this.ttfMetrics=this.ttfReader.metrics},P.prototype.createInternals=function(){this.fontDictionary=new c,this.fontProgram=new U,this.cmap=new U,this.descendantFont=new c,this.metrics=new si,this.ttfReader.createInternals(),this.ttfMetrics=this.ttfReader.metrics,this.initializeMetrics(),this.subsetName=this.getFontName(),this.createDescendantFont(),this.createCmap(),this.createFontDictionary(),this.createFontProgram()},P.prototype.getInternals=function(){return this.fontDictionary},P.prototype.initializeMetrics=function(){var t=this.ttfReader.metrics;this.metrics.ascent=t.macAscent,this.metrics.descent=t.macDescent,this.metrics.height=t.macAscent-t.macDescent+t.lineGap,this.metrics.name=t.fontFamily,this.metrics.postScriptName=t.postScriptName,this.metrics.size=this.fontSize,this.metrics.widthTable=new ci(t.widthTable),this.metrics.lineGap=t.lineGap,this.metrics.subScriptSizeFactor=t.subScriptSizeFactor,this.metrics.superscriptSizeFactor=t.superscriptSizeFactor,this.metrics.isBold=t.isBold},P.prototype.getFontName=function(){for(var t,e="",i=0;i<6;i++){var r=Math.floor(26*Math.random())+0;e+=this.nameString[r]}return t=(e=e+"+"+this.ttfReader.metrics.postScriptName).toString(),this.formatName(t)},P.prototype.formatName=function(t){t=t.replace("(","#28");return(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(")","#29")).replace("[","#5B")).replace("]","#5D")).replace("<","#3C")).replace(">","#3E")).replace("{","#7B")).replace("}","#7D")).replace("/","#2F")).replace("%","#25")).replace(" ","#20")},P.prototype.createDescendantFont=function(){this.descendantFont.isResource=!0,this.descendantFont.descendantFontBeginSave=new F(this),this.descendantFont.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.descendantFont.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.cIDFontType2)),this.descendantFont.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.descendantFont.items.setValue(this.dictionaryProperties.cIDToGIDMap,new o(this.dictionaryProperties.identity)),this.descendantFont.items.setValue(this.dictionaryProperties.dw,new u(1e3)),this.fontDescriptor=this.createFontDescriptor(),this.descendantFont.items.setValue(this.dictionaryProperties.fontDescriptor,new d(this.fontDescriptor));var t=this.createSystemInfo();this.descendantFont.items.setValue(this.dictionaryProperties.cIDSystemInfo,t)},P.prototype.createFontDescriptor=function(){var t=new c,e=this.ttfReader.metrics;return t.isResource=!0,t.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.fontDescriptor)),t.items.setValue(this.dictionaryProperties.fontName,new o(this.subsetName)),t.items.setValue(this.dictionaryProperties.flags,new u(this.getDescriptorFlags())),t.items.setValue(this.dictionaryProperties.fontBBox,p.fromRectangle(this.getBoundBox())),t.items.setValue(this.dictionaryProperties.missingWidth,new u(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.stemV,new u(e.stemV)),t.items.setValue(this.dictionaryProperties.italicAngle,new u(e.italicAngle)),t.items.setValue(this.dictionaryProperties.capHeight,new u(e.capHeight)),t.items.setValue(this.dictionaryProperties.ascent,new u(e.winAscent)),t.items.setValue(this.dictionaryProperties.descent,new u(e.winDescent)),t.items.setValue(this.dictionaryProperties.leading,new u(e.leading)),t.items.setValue(this.dictionaryProperties.avgWidth,new u(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.fontFile2,new d(this.fontProgram)),t.items.setValue(this.dictionaryProperties.maxWidth,new u(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.xHeight,new u(0)),t.items.setValue(this.dictionaryProperties.stemH,new u(0)),t},P.prototype.createCmap=function(){this.cmap.cmapBeginSave=new q(this)},P.prototype.createFontDictionary=function(){this.fontDictionary.isResource=!0,this.fontDictionary.fontDictionaryBeginSave=new I(this),this.fontDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.fontDictionary.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.fontDictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type0)),this.fontDictionary.items.setValue(this.dictionaryProperties.encoding,new o(this.dictionaryProperties.identityH));var t=new p,e=new d(this.descendantFont);t.isFont=!0,t.add(e),this.fontDictionary.items.setValue(this.dictionaryProperties.descendantFonts,t)},P.prototype.createFontProgram=function(){this.fontProgram.fontProgramBeginSave=new Q(this)},P.prototype.createSystemInfo=function(){var t=new c;return t.items.setValue(this.dictionaryProperties.registry,new tt("Adobe")),t.items.setValue(this.dictionaryProperties.ordering,new tt(this.dictionaryProperties.identity)),t.items.setValue(this.dictionaryProperties.supplement,new u(0)),t},P.prototype.descendantFontBeginSave=function(){var t;null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()&&null!==(t=this.getDescendantWidth())&&this.descendantFont.items.setValue(this.dictionaryProperties.w,t)},P.prototype.cmapBeginSave=function(){this.generateCmap()},P.prototype.fontDictionaryBeginSave=function(){null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()&&!this.fontDictionary.containsKey(this.dictionaryProperties.toUnicode)&&this.fontDictionary.items.setValue(this.dictionaryProperties.toUnicode,new d(this.cmap))},P.prototype.fontProgramBeginSave=function(){this.isCompress=!0,this.generateFontProgram()},P.prototype.getDescendantWidth=function(){var t=new p;if(null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()){for(var e=[],i=this.usedChars.keys(),r=0;r<i.length;r++){var n=i[r];(l=this.ttfReader.getGlyph(n)).empty||e.push(l)}e.sort(function(t,e){return t.index-e.index});for(var o=0,s=0,a=!1,h=new p,r=0;r<e.length;r++){var l=e[r];a||(a=!0,o=l.index,s=l.index-1),(s+1!==l.index||r+1===e.length)&&1<e.length&&(t.add(new u(o)),0!==r&&t.add(h),o=l.index,h=new p),h.add(new u(l.width)),r+1===e.length&&(t.add(new u(o)),t.add(h)),s=l.index}}return t},P.prototype.generateCmap=function(){if(null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()){var t=this.ttfReader.getGlyphChars(this.usedChars);if(0<t.size()){for(var e=t.keys().sort(),i=e[0],r=e[e.length-1],i=this.toHexString(i,!1)+this.toHexString(r,!1)+h.newLine,n="",o=(n=(n+=this.cmapPrefix)+i+this.cmapEndCodespaceRange,0),s=0;s<e.length;s++){0===o&&(0!==s&&(n+=this.cmapEndRange),n=(n=n+(o=Math.min(100,e.length-s))+h.whiteSpace)+this.cmapBeginRange),--o;var a=e[s];n+=this.toHexString(a,!0)+this.toHexString(a,!0)+this.toHexString(t.getValue(a),!0)+"\n"}n+=this.cmapSuffix,this.cmap.clearStream(),this.cmap.isResource=!0,this.cmap.write(n)}}},P.prototype.generateFontProgram=function(){var t;this.usedChars=null===this.usedChars||void 0===this.usedChars?new a:this.usedChars,this.ttfReader.setOffset(0),t=this.ttfReader.readFontProgram(this.usedChars),this.fontProgram.clearStream(),this.fontProgram.isResource=!0,this.fontProgram.writeBytes(t)},P.prototype.getDescriptorFlags=function(){var t=0,e=this.ttfReader.metrics;return e.isFixedPitch&&(t|=Y.FontDescriptorFlags.FixedPitch),e.isSymbol?t|=Y.FontDescriptorFlags.Symbolic:t|=Y.FontDescriptorFlags.Nonsymbolic,e.isItalic&&(t|=Y.FontDescriptorFlags.Italic),e.isBold&&(t|=Y.FontDescriptorFlags.ForceBold),t},P.prototype.getBoundBox=function(){var t=this.ttfReader.metrics.fontBox,e=Math.abs(t.right-t.left),i=Math.abs(t.top-t.bottom);return new Z(t.left,t.bottom,e,i)},P.prototype.toHexString=function(t,e){t=t.toString(16);return e&&(t=t.toUpperCase()),"<0000".substring(0,5-t.length)+t+">"},P.prototype.setSymbols=function(t){if(null===t)throw new Error("Argument Null Exception : text");null!==this.usedChars&&void 0!==this.usedChars||(this.usedChars=new a);for(var e=0;e<t.length;e++){var i=t[e];this.usedChars.setValue(i,String.fromCharCode(0))}!1===this.isEmbedFont&&this.getDescendantWidth()};var di=P;function P(t,e){if(this.nameString="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.dictionaryProperties=new l,this.isCompress=!1,this.isEmbedFont=!1,this.cmapPrefix="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap"+h.newLine+"/CIDSystemInfo << /Registry (Adobe)/Ordering (UCS)/Supplement 0>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange"+h.newLine,this.cmapEndCodespaceRange="endcodespacerange"+h.newLine,this.cmapBeginRange="beginbfrange"+h.newLine,this.cmapEndRange="endbfrange"+h.newLine,this.cmapSuffix="endbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend end"+h.newLine,null==t)throw new Error("ArgumentNullException:base64String");this.fontSize=e,this.fontString=t,this.Initialize()}gi.prototype.getCharacterShape=function(t,e){if(t>=this.hamza&&t<=this.bwhb){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t)[e+1]}else if(t>=this.lwawm&&t<=this.lwa);return t},gi.prototype.shape=function(t,e){for(var i="",r="",n=0;n<t.length;n++){var o=t[n];""<=o&&o<="ۿ"?r+=o:(0<r.length&&(i+=this.doShape(r.toString(),0),r=""),i+=o)}return 0<r.length&&(i+=this.doShape(r.toString(),0)),i.toString()},gi.prototype.doShape=function(t,e){for(var i="",r=0,n=0,o=new mi,s=new mi;n<t.length;){var a,h=t[n++];0===this.ligature(h,s)&&(r=1===(a=this.getShapeCount(h))?0:2,2<o.Shapes&&(r+=1),r%=s.Shapes,s.Value=this.getCharacterShape(s.Value,r),i=this.append(i,o,e),o=s,(s=new mi).Value=h,s.Shapes=a,s.Ligature++)}return r=2<o.Shapes?1:0,r%=s.Shapes,s.Value=this.getCharacterShape(s.Value,r),i=this.append(i,o,e),(i=this.append(i,s,e)).toString()},gi.prototype.append=function(t,e,i){return""!==e.Value&&(t+=e.Value,--e.Ligature,""!==e.Type&&(0==(i&this.vowel)&&(t+=e.Type),--e.Ligature),""!==e.vowel)&&(0==(i&this.vowel)&&(t+=e.vowel),--e.Ligature),t},gi.prototype.ligature=function(t,e){if(""===e.Value)return 0;var i=0;if(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef){if(i=1,""!==e.vowel&&t!==this.shadda&&(i=2),t===this.shadda){if(null!=e.Type)return 0;e.Type=this.shadda}else t===this.hamzaBelow?e.Value===this.alef?(e.Value=this.alefHamzaBelow,i=2):t===this.lwa?(e.Value=this.lwawhb,i=2):e.Type=this.hamzaBelow:t===this.hamzaAbove?e.Value===this.alef?(e.Value=this.alefHamza,i=2):e.Value===this.lwa?(e.Value=this.lwawh,i=2):e.Value===this.waw?(e.Value=this.wawHamza,i=2):e.Value===this.yeh||e.Value===this.alefMaksura||e.Value===this.farsiYeh?(e.Value=this.yehHamza,i=2):e.Type=this.hamzaAbove:t===this.madda?e.Value===this.alef&&(e.Value=this.alefMadda,i=2):e.vowel=t;1===i&&e.Ligature++}else{if(""!==e.vowel)return 0;e.Value===this.lam&&(t===this.alef?(e.Value=this.lwa,e.Shapes=2,i=3):t===this.alefHamza?(e.Value=this.lwawh,e.Shapes=2,i=3):t===this.alefHamzaBelow?(e.Value=this.lwawhb,e.Shapes=2,i=3):t===this.alefMadda&&(e.Value=this.lwawm,e.Shapes=2,i=3))}return i},gi.prototype.getShapeCount=function(t){if(t>=this.hamza&&t<=this.bwhb&&!(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef)){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t).length-1}else if(t===this.zeroWidthJoiner)return 4;return 1};var fi=gi;function gi(){this.arabicCharTable=[["ء","ﺀ"],["آ","ﺁ","ﺂ"],["أ","ﺃ","ﺄ"],["ؤ","ﺅ","ﺆ"],["إ","ﺇ","ﺈ"],["ئ","ﺉ","ﺊ","ﺋ","ﺌ"],["ا","ﺍ","ﺎ"],["ب","ﺏ","ﺐ","ﺑ","ﺒ"],["ة","ﺓ","ﺔ"],["ت","ﺕ","ﺖ","ﺗ","ﺘ"],["ث","ﺙ","ﺚ","ﺛ","ﺜ"],["ج","ﺝ","ﺞ","ﺟ","ﺠ"],["ح","ﺡ","ﺢ","ﺣ","ﺤ"],["خ","ﺥ","ﺦ","ﺧ","ﺨ"],["د","ﺩ","ﺪ"],["ذ","ﺫ","ﺬ"],["ر","ﺭ","ﺮ"],["ز","ﺯ","ﺰ"],["س","ﺱ","ﺲ","ﺳ","ﺴ"],["ش","ﺵ","ﺶ","ﺷ","ﺸ"],["ص","ﺹ","ﺺ","ﺻ","ﺼ"],["ض","ﺽ","ﺾ","ﺿ","ﻀ"],["ط","ﻁ","ﻂ","ﻃ","ﻄ"],["ظ","ﻅ","ﻆ","ﻇ","ﻈ"],["ع","ﻉ","ﻊ","ﻋ","ﻌ"],["غ","ﻍ","ﻎ","ﻏ","ﻐ"],["ـ","ـ","ـ","ـ","ـ"],["ف","ﻑ","ﻒ","ﻓ","ﻔ"],["ق","ﻕ","ﻖ","ﻗ","ﻘ"],["ك","ﻙ","ﻚ","ﻛ","ﻜ"],["ل","ﻝ","ﻞ","ﻟ","ﻠ"],["م","ﻡ","ﻢ","ﻣ","ﻤ"],["ن","ﻥ","ﻦ","ﻧ","ﻨ"],["ه","ﻩ","ﻪ","ﻫ","ﻬ"],["و","ﻭ","ﻮ"],["ى","ﻯ","ﻰ","ﯨ","ﯩ"],["ي","ﻱ","ﻲ","ﻳ","ﻴ"],["ٱ","ﭐ","ﭑ"],["ٹ","ﭦ","ﭧ","ﭨ","ﭩ"],["ٺ","ﭞ","ﭟ","ﭠ","ﭡ"],["ٻ","ﭒ","ﭓ","ﭔ","ﭕ"],["پ","ﭖ","ﭗ","ﭘ","ﭙ"],["ٿ","ﭢ","ﭣ","ﭤ","ﭥ"],["ڀ","ﭚ","ﭛ","ﭜ","ﭝ"],["ڃ","ﭶ","ﭷ","ﭸ","ﭹ"],["ڄ","ﭲ","ﭳ","ﭴ","ﭵ"],["چ","ﭺ","ﭻ","ﭼ","ﭽ"],["ڇ","ﭾ","ﭿ","ﮀ","ﮁ"],["ڈ","ﮈ","ﮉ"],["ڌ","ﮄ","ﮅ"],["ڍ","ﮂ","ﮃ"],["ڎ","ﮆ","ﮇ"],["ڑ","ﮌ","ﮍ"],["ژ","ﮊ","ﮋ"],["ڤ","ﭪ","ﭫ","ﭬ","ﭭ"],["ڦ","ﭮ","ﭯ","ﭰ","ﭱ"],["ک","ﮎ","ﮏ","ﮐ","ﮑ"],["ڭ","ﯓ","ﯔ","ﯕ","ﯖ"],["گ","ﮒ","ﮓ","ﮔ","ﮕ"],["ڱ","ﮚ","ﮛ","ﮜ","ﮝ"],["ڳ","ﮖ","ﮗ","ﮘ","ﮙ"],["ں","ﮞ","ﮟ"],["ڻ","ﮠ","ﮡ","ﮢ","ﮣ"],["ھ","ﮪ","ﮫ","ﮬ","ﮭ"],["ۀ","ﮤ","ﮥ"],["ہ","ﮦ","ﮧ","ﮨ","ﮩ"],["ۅ","ﯠ","ﯡ"],["ۆ","ﯙ","ﯚ"],["ۇ","ﯗ","ﯘ"],["ۈ","ﯛ","ﯜ"],["ۉ","ﯢ","ﯣ"],["ۋ","ﯞ","ﯟ"],["ی","ﯼ","ﯽ","ﯾ","ﯿ"],["ې","ﯤ","ﯥ","ﯦ","ﯧ"],["ے","ﮮ","ﮯ"],["ۓ","ﮰ","ﮱ"]],this.alef="ا",this.alefHamza="أ",this.alefHamzaBelow="إ",this.alefMadda="آ",this.lam="ل",this.hamza="ء",this.zeroWidthJoiner="",this.hamzaAbove="ٔ",this.hamzaBelow="ٕ",this.wawHamza="ؤ",this.yehHamza="ئ",this.waw="و",this.alefMaksura="ى",this.yeh="ي",this.farsiYeh="ی",this.shadda="ّ",this.madda="ٓ",this.lwa="ﻻ",this.lwawh="ﻷ",this.lwawhb="ﻹ",this.lwawm="ﻵ",this.bwhb="ۓ",this.fathatan="ً",this.superScriptalef="ٰ",this.vowel=1,this.arabicMapTable=new a;for(var t=0;t<this.arabicCharTable.length;t++)this.arabicMapTable.setValue(this.arabicCharTable[t][0],this.arabicCharTable[t])}Object.defineProperty(yi.prototype,"Value",{get:function(){return this.shapeValue},set:function(t){this.shapeValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(yi.prototype,"Type",{get:function(){return this.shapeType},set:function(t){this.shapeType=t},enumerable:!0,configurable:!0}),Object.defineProperty(yi.prototype,"vowel",{get:function(){return this.shapeVowel},set:function(t){this.shapeVowel=t},enumerable:!0,configurable:!0}),Object.defineProperty(yi.prototype,"Ligature",{get:function(){return this.shapeLigature},set:function(t){this.shapeLigature=t},enumerable:!0,configurable:!0}),Object.defineProperty(yi.prototype,"Shapes",{get:function(){return this.shapeShapes},set:function(t){this.shapeShapes=t},enumerable:!0,configurable:!0});var mi=yi;function yi(){this.shapeValue="",this.shapeType="",this.shapeVowel="",this.shapeLigature=0,this.shapeShapes=1}wi.prototype.doMirrorShaping=function(t){for(var e=[],i=0;i<t.length;i++)1==(1&this.indexLevels[i])&&this.mirroringShapeCharacters.containsKey(t[i].charCodeAt(0))?e[i]=String.fromCharCode(this.mirroringShapeCharacters.getValue(t[i].charCodeAt(0))):e[i]=t[i].toString();for(var r="",n=0;n<e.length;n++)r+=e[n];return r},wi.prototype.getLogicalToVisualString=function(t,e){for(var i=new Pi,r=(this.indexLevels=i.getVisualOrder(t,e),this.setDefaultIndexLevel(),this.doOrder(0,this.indexLevels.length-1),this.doMirrorShaping(t)),n="",o=0;o<this.indexes.length;o++)n+=r[this.indexes[o]];return n.toString()},wi.prototype.setDefaultIndexLevel=function(){for(var t=0;t<this.indexLevels.length;t++)this.indexes[t]=t},wi.prototype.doOrder=function(t,e){for(var i=this.indexLevels[t],r=i,n=i,o=i,s=t+1;s<=e;++s){var a=this.indexLevels[s];i<a?i=a:a<r&&(r=a),n&=a,o|=a}if(0!=(1&o))if(1==(1&n))this.reArrange(t,e+1);else for(r|=1;r<=i;){for(var h=t;;){for(;h<=e&&!(this.indexLevels[h]>=i);)h+=1;if(e<h)break;for(var l=h+1;l<=e&&!(this.indexLevels[l]<i);)l+=1;this.reArrange(h,l),h=l+1}--i}},wi.prototype.reArrange=function(t,e){var i=(t+e)/2;for(--e;t<i;++t,--e){var r=this.indexes[t];this.indexes[t]=this.indexes[e],this.indexes[e]=r}},wi.prototype.update=function(){this.mirroringShapeCharacters.setValue(40,41),this.mirroringShapeCharacters.setValue(41,40),this.mirroringShapeCharacters.setValue(60,62),this.mirroringShapeCharacters.setValue(62,60),this.mirroringShapeCharacters.setValue(91,93),this.mirroringShapeCharacters.setValue(93,91),this.mirroringShapeCharacters.setValue(123,125),this.mirroringShapeCharacters.setValue(125,123),this.mirroringShapeCharacters.setValue(171,187),this.mirroringShapeCharacters.setValue(187,171),this.mirroringShapeCharacters.setValue(8249,8250),this.mirroringShapeCharacters.setValue(8250,8249),this.mirroringShapeCharacters.setValue(8261,8262),this.mirroringShapeCharacters.setValue(8262,8261),this.mirroringShapeCharacters.setValue(8317,8318),this.mirroringShapeCharacters.setValue(8318,8317),this.mirroringShapeCharacters.setValue(8333,8334),this.mirroringShapeCharacters.setValue(8334,8333),this.mirroringShapeCharacters.setValue(8712,8715),this.mirroringShapeCharacters.setValue(8713,8716),this.mirroringShapeCharacters.setValue(8714,8717),this.mirroringShapeCharacters.setValue(8715,8712),this.mirroringShapeCharacters.setValue(8716,8713),this.mirroringShapeCharacters.setValue(8717,8714),this.mirroringShapeCharacters.setValue(8725,10741),this.mirroringShapeCharacters.setValue(8764,8765),this.mirroringShapeCharacters.setValue(8765,8764),this.mirroringShapeCharacters.setValue(8771,8909),this.mirroringShapeCharacters.setValue(8786,8787),this.mirroringShapeCharacters.setValue(8787,8786),this.mirroringShapeCharacters.setValue(8788,8789),this.mirroringShapeCharacters.setValue(8789,8788),this.mirroringShapeCharacters.setValue(8804,8805),this.mirroringShapeCharacters.setValue(8805,8804),this.mirroringShapeCharacters.setValue(8806,8807),this.mirroringShapeCharacters.setValue(8807,8806),this.mirroringShapeCharacters.setValue(8808,8809),this.mirroringShapeCharacters.setValue(8809,8808),this.mirroringShapeCharacters.setValue(8810,8811),this.mirroringShapeCharacters.setValue(8811,8810),this.mirroringShapeCharacters.setValue(8814,8815),this.mirroringShapeCharacters.setValue(8815,8814),this.mirroringShapeCharacters.setValue(8816,8817),this.mirroringShapeCharacters.setValue(8817,8816),this.mirroringShapeCharacters.setValue(8818,8819),this.mirroringShapeCharacters.setValue(8819,8818),this.mirroringShapeCharacters.setValue(8820,8821),this.mirroringShapeCharacters.setValue(8821,8820),this.mirroringShapeCharacters.setValue(8822,8823),this.mirroringShapeCharacters.setValue(8823,8822),this.mirroringShapeCharacters.setValue(8824,8825),this.mirroringShapeCharacters.setValue(8825,8824),this.mirroringShapeCharacters.setValue(8826,8827),this.mirroringShapeCharacters.setValue(8827,8826),this.mirroringShapeCharacters.setValue(8828,8829),this.mirroringShapeCharacters.setValue(8829,8828),this.mirroringShapeCharacters.setValue(8830,8831),this.mirroringShapeCharacters.setValue(8831,8830),this.mirroringShapeCharacters.setValue(8832,8833),this.mirroringShapeCharacters.setValue(8833,8832),this.mirroringShapeCharacters.setValue(8834,8835),this.mirroringShapeCharacters.setValue(8835,8834),this.mirroringShapeCharacters.setValue(8836,8837),this.mirroringShapeCharacters.setValue(8837,8836),this.mirroringShapeCharacters.setValue(8838,8839),this.mirroringShapeCharacters.setValue(8839,8838),this.mirroringShapeCharacters.setValue(8840,8841),this.mirroringShapeCharacters.setValue(8841,8840),this.mirroringShapeCharacters.setValue(8842,8843),this.mirroringShapeCharacters.setValue(8843,8842),this.mirroringShapeCharacters.setValue(8847,8848),this.mirroringShapeCharacters.setValue(8848,8847),this.mirroringShapeCharacters.setValue(8849,8850),this.mirroringShapeCharacters.setValue(8850,8849),this.mirroringShapeCharacters.setValue(8856,10680),this.mirroringShapeCharacters.setValue(8866,8867),this.mirroringShapeCharacters.setValue(8867,8866),this.mirroringShapeCharacters.setValue(8870,10974),this.mirroringShapeCharacters.setValue(8872,10980),this.mirroringShapeCharacters.setValue(8873,10979),this.mirroringShapeCharacters.setValue(8875,10981),this.mirroringShapeCharacters.setValue(8880,8881),this.mirroringShapeCharacters.setValue(8881,8880),this.mirroringShapeCharacters.setValue(8882,8883),this.mirroringShapeCharacters.setValue(8883,8882),this.mirroringShapeCharacters.setValue(8884,8885),this.mirroringShapeCharacters.setValue(8885,8884),this.mirroringShapeCharacters.setValue(8886,8887),this.mirroringShapeCharacters.setValue(8887,8886),this.mirroringShapeCharacters.setValue(8905,8906),this.mirroringShapeCharacters.setValue(8906,8905),this.mirroringShapeCharacters.setValue(8907,8908),this.mirroringShapeCharacters.setValue(8908,8907),this.mirroringShapeCharacters.setValue(8909,8771),this.mirroringShapeCharacters.setValue(8912,8913),this.mirroringShapeCharacters.setValue(8913,8912),this.mirroringShapeCharacters.setValue(8918,8919),this.mirroringShapeCharacters.setValue(8919,8918),this.mirroringShapeCharacters.setValue(8920,8921),this.mirroringShapeCharacters.setValue(8921,8920),this.mirroringShapeCharacters.setValue(8922,8923),this.mirroringShapeCharacters.setValue(8923,8922),this.mirroringShapeCharacters.setValue(8924,8925),this.mirroringShapeCharacters.setValue(8925,8924),this.mirroringShapeCharacters.setValue(8926,8927),this.mirroringShapeCharacters.setValue(8927,8926),this.mirroringShapeCharacters.setValue(8928,8929),this.mirroringShapeCharacters.setValue(8929,8928),this.mirroringShapeCharacters.setValue(8930,8931),this.mirroringShapeCharacters.setValue(8931,8930),this.mirroringShapeCharacters.setValue(8932,8933),this.mirroringShapeCharacters.setValue(8933,8932),this.mirroringShapeCharacters.setValue(8934,8935),this.mirroringShapeCharacters.setValue(8935,8934),this.mirroringShapeCharacters.setValue(8936,8937),this.mirroringShapeCharacters.setValue(8937,8936),this.mirroringShapeCharacters.setValue(8938,8939),this.mirroringShapeCharacters.setValue(8939,8938),this.mirroringShapeCharacters.setValue(8940,8941),this.mirroringShapeCharacters.setValue(8941,8940),this.mirroringShapeCharacters.setValue(8944,8945),this.mirroringShapeCharacters.setValue(8945,8944),this.mirroringShapeCharacters.setValue(8946,8954),this.mirroringShapeCharacters.setValue(8947,8955),this.mirroringShapeCharacters.setValue(8948,8956),this.mirroringShapeCharacters.setValue(8950,8957),this.mirroringShapeCharacters.setValue(8951,8958),this.mirroringShapeCharacters.setValue(8954,8946),this.mirroringShapeCharacters.setValue(8955,8947),this.mirroringShapeCharacters.setValue(8956,8948),this.mirroringShapeCharacters.setValue(8957,8950),this.mirroringShapeCharacters.setValue(8958,8951),this.mirroringShapeCharacters.setValue(8968,8969),this.mirroringShapeCharacters.setValue(8969,8968),this.mirroringShapeCharacters.setValue(8970,8971),this.mirroringShapeCharacters.setValue(8971,8970),this.mirroringShapeCharacters.setValue(9001,9002),this.mirroringShapeCharacters.setValue(9002,9001),this.mirroringShapeCharacters.setValue(10088,10089),this.mirroringShapeCharacters.setValue(10089,10088),this.mirroringShapeCharacters.setValue(10090,10091),this.mirroringShapeCharacters.setValue(10091,10090),this.mirroringShapeCharacters.setValue(10092,10093),this.mirroringShapeCharacters.setValue(10093,10092),this.mirroringShapeCharacters.setValue(10094,10095),this.mirroringShapeCharacters.setValue(10095,10094),this.mirroringShapeCharacters.setValue(10096,10097),this.mirroringShapeCharacters.setValue(10097,10096),this.mirroringShapeCharacters.setValue(10098,10099),this.mirroringShapeCharacters.setValue(10099,10098),this.mirroringShapeCharacters.setValue(10100,10101),this.mirroringShapeCharacters.setValue(10101,10100),this.mirroringShapeCharacters.setValue(10197,10198),this.mirroringShapeCharacters.setValue(10198,10197),this.mirroringShapeCharacters.setValue(10205,10206),this.mirroringShapeCharacters.setValue(10206,10205),this.mirroringShapeCharacters.setValue(10210,10211),this.mirroringShapeCharacters.setValue(10211,10210),this.mirroringShapeCharacters.setValue(10212,10213),this.mirroringShapeCharacters.setValue(10213,10212),this.mirroringShapeCharacters.setValue(10214,10215),this.mirroringShapeCharacters.setValue(10215,10214),this.mirroringShapeCharacters.setValue(10216,10217),this.mirroringShapeCharacters.setValue(10217,10216),this.mirroringShapeCharacters.setValue(10218,10219),this.mirroringShapeCharacters.setValue(10219,10218),this.mirroringShapeCharacters.setValue(10627,10628),this.mirroringShapeCharacters.setValue(10628,10627),this.mirroringShapeCharacters.setValue(10629,10630),this.mirroringShapeCharacters.setValue(10630,10629),this.mirroringShapeCharacters.setValue(10631,10632),this.mirroringShapeCharacters.setValue(10632,10631),this.mirroringShapeCharacters.setValue(10633,10634),this.mirroringShapeCharacters.setValue(10634,10633),this.mirroringShapeCharacters.setValue(10635,10636),this.mirroringShapeCharacters.setValue(10636,10635),this.mirroringShapeCharacters.setValue(10637,10640),this.mirroringShapeCharacters.setValue(10638,10639),this.mirroringShapeCharacters.setValue(10639,10638),this.mirroringShapeCharacters.setValue(10640,10637),this.mirroringShapeCharacters.setValue(10641,10642),this.mirroringShapeCharacters.setValue(10642,10641),this.mirroringShapeCharacters.setValue(10643,10644),this.mirroringShapeCharacters.setValue(10644,10643),this.mirroringShapeCharacters.setValue(10645,10646),this.mirroringShapeCharacters.setValue(10646,10645),this.mirroringShapeCharacters.setValue(10647,10648),this.mirroringShapeCharacters.setValue(10648,10647),this.mirroringShapeCharacters.setValue(10680,8856),this.mirroringShapeCharacters.setValue(10688,10689),this.mirroringShapeCharacters.setValue(10689,10688),this.mirroringShapeCharacters.setValue(10692,10693),this.mirroringShapeCharacters.setValue(10693,10692),this.mirroringShapeCharacters.setValue(10703,10704),this.mirroringShapeCharacters.setValue(10704,10703),this.mirroringShapeCharacters.setValue(10705,10706),this.mirroringShapeCharacters.setValue(10706,10705),this.mirroringShapeCharacters.setValue(10708,10709),this.mirroringShapeCharacters.setValue(10709,10708),this.mirroringShapeCharacters.setValue(10712,10713),this.mirroringShapeCharacters.setValue(10713,10712),this.mirroringShapeCharacters.setValue(10714,10715),this.mirroringShapeCharacters.setValue(10715,10714),this.mirroringShapeCharacters.setValue(10741,8725),this.mirroringShapeCharacters.setValue(10744,10745),this.mirroringShapeCharacters.setValue(10745,10744),this.mirroringShapeCharacters.setValue(10748,10749),this.mirroringShapeCharacters.setValue(10749,10748),this.mirroringShapeCharacters.setValue(10795,10796),this.mirroringShapeCharacters.setValue(10796,10795),this.mirroringShapeCharacters.setValue(10797,10796),this.mirroringShapeCharacters.setValue(10798,10797),this.mirroringShapeCharacters.setValue(10804,10805),this.mirroringShapeCharacters.setValue(10805,10804),this.mirroringShapeCharacters.setValue(10812,10813),this.mirroringShapeCharacters.setValue(10813,10812),this.mirroringShapeCharacters.setValue(10852,10853),this.mirroringShapeCharacters.setValue(10853,10852),this.mirroringShapeCharacters.setValue(10873,10874),this.mirroringShapeCharacters.setValue(10874,10873),this.mirroringShapeCharacters.setValue(10877,10878),this.mirroringShapeCharacters.setValue(10878,10877),this.mirroringShapeCharacters.setValue(10879,10880),this.mirroringShapeCharacters.setValue(10880,10879),this.mirroringShapeCharacters.setValue(10881,10882),this.mirroringShapeCharacters.setValue(10882,10881),this.mirroringShapeCharacters.setValue(10883,10884),this.mirroringShapeCharacters.setValue(10884,10883),this.mirroringShapeCharacters.setValue(10891,10892),this.mirroringShapeCharacters.setValue(10892,10891),this.mirroringShapeCharacters.setValue(10897,10898),this.mirroringShapeCharacters.setValue(10898,10897),this.mirroringShapeCharacters.setValue(10899,10900),this.mirroringShapeCharacters.setValue(10900,10899),this.mirroringShapeCharacters.setValue(10901,10902),this.mirroringShapeCharacters.setValue(10902,10901),this.mirroringShapeCharacters.setValue(10903,10904),this.mirroringShapeCharacters.setValue(10904,10903),this.mirroringShapeCharacters.setValue(10905,10906),this.mirroringShapeCharacters.setValue(10906,10905),this.mirroringShapeCharacters.setValue(10907,10908),this.mirroringShapeCharacters.setValue(10908,10907),this.mirroringShapeCharacters.setValue(10913,10914),this.mirroringShapeCharacters.setValue(10914,10913),this.mirroringShapeCharacters.setValue(10918,10919),this.mirroringShapeCharacters.setValue(10919,10918),this.mirroringShapeCharacters.setValue(10920,10921),this.mirroringShapeCharacters.setValue(10921,10920),this.mirroringShapeCharacters.setValue(10922,10923),this.mirroringShapeCharacters.setValue(10923,10922),this.mirroringShapeCharacters.setValue(10924,10925),this.mirroringShapeCharacters.setValue(10925,10924),this.mirroringShapeCharacters.setValue(10927,10928),this.mirroringShapeCharacters.setValue(10928,10927),this.mirroringShapeCharacters.setValue(10931,10932),this.mirroringShapeCharacters.setValue(10932,10931),this.mirroringShapeCharacters.setValue(10939,10940),this.mirroringShapeCharacters.setValue(10940,10939),this.mirroringShapeCharacters.setValue(10941,10942),this.mirroringShapeCharacters.setValue(10942,10941),this.mirroringShapeCharacters.setValue(10943,10944),this.mirroringShapeCharacters.setValue(10944,10943),this.mirroringShapeCharacters.setValue(10945,10946),this.mirroringShapeCharacters.setValue(10946,10945),this.mirroringShapeCharacters.setValue(10947,10948),this.mirroringShapeCharacters.setValue(10948,10947),this.mirroringShapeCharacters.setValue(10949,10950),this.mirroringShapeCharacters.setValue(10950,10949),this.mirroringShapeCharacters.setValue(10957,10958),this.mirroringShapeCharacters.setValue(10958,10957),this.mirroringShapeCharacters.setValue(10959,10960),this.mirroringShapeCharacters.setValue(10960,10959),this.mirroringShapeCharacters.setValue(10961,10962),this.mirroringShapeCharacters.setValue(10962,10961),this.mirroringShapeCharacters.setValue(10963,10964),this.mirroringShapeCharacters.setValue(10964,10963),this.mirroringShapeCharacters.setValue(10965,10966),this.mirroringShapeCharacters.setValue(10966,10965),this.mirroringShapeCharacters.setValue(10974,8870),this.mirroringShapeCharacters.setValue(10979,8873),this.mirroringShapeCharacters.setValue(10980,8872),this.mirroringShapeCharacters.setValue(10981,8875),this.mirroringShapeCharacters.setValue(10988,10989),this.mirroringShapeCharacters.setValue(10989,10988),this.mirroringShapeCharacters.setValue(10999,11e3),this.mirroringShapeCharacters.setValue(11e3,10999),this.mirroringShapeCharacters.setValue(11001,11002),this.mirroringShapeCharacters.setValue(11002,11001),this.mirroringShapeCharacters.setValue(12296,12297),this.mirroringShapeCharacters.setValue(12297,12296),this.mirroringShapeCharacters.setValue(12298,12299),this.mirroringShapeCharacters.setValue(12299,12298),this.mirroringShapeCharacters.setValue(12300,12301),this.mirroringShapeCharacters.setValue(12301,12300),this.mirroringShapeCharacters.setValue(12302,12303),this.mirroringShapeCharacters.setValue(12303,12302),this.mirroringShapeCharacters.setValue(12304,12305),this.mirroringShapeCharacters.setValue(12305,12304),this.mirroringShapeCharacters.setValue(12308,12309),this.mirroringShapeCharacters.setValue(12309,12308),this.mirroringShapeCharacters.setValue(12310,12311),this.mirroringShapeCharacters.setValue(12311,12310),this.mirroringShapeCharacters.setValue(12312,12313),this.mirroringShapeCharacters.setValue(12313,12312),this.mirroringShapeCharacters.setValue(12314,12315),this.mirroringShapeCharacters.setValue(12315,12314),this.mirroringShapeCharacters.setValue(65288,65289),this.mirroringShapeCharacters.setValue(65289,65288),this.mirroringShapeCharacters.setValue(65308,65310),this.mirroringShapeCharacters.setValue(65310,65308),this.mirroringShapeCharacters.setValue(65339,65341),this.mirroringShapeCharacters.setValue(65341,65339),this.mirroringShapeCharacters.setValue(65371,65373),this.mirroringShapeCharacters.setValue(65373,65371),this.mirroringShapeCharacters.setValue(65375,65376),this.mirroringShapeCharacters.setValue(65376,65375),this.mirroringShapeCharacters.setValue(65378,65379),this.mirroringShapeCharacters.setValue(65379,65378)};var bi=wi;function wi(){this.indexes=[],this.indexLevels=[],this.mirroringShapeCharacters=new a,this.update()}Si.prototype.getVisualOrder=function(t,e){this.types=this.getCharacterCode(t),this.textOrder=e?this.LRE:this.L,this.doVisualOrder();for(var i=[],r=0;r<this.levels.length;r++)i[r]=this.levels[r];return i},Si.prototype.getCharacterCode=function(t){for(var e=[],i=0;i<t.length;i++)e[i]=this.rtlCharacterTypes[t[i].charCodeAt(0)];return e},Si.prototype.setDefaultLevels=function(){for(var t=0;t<this.length;t++)this.levels[t]=this.textOrder},Si.prototype.setLevels=function(){this.setDefaultLevels();for(var t=0;t<this.length;++t){var e=this.levels[t];0!=(128&e)&&(e&=127,this.result[t]=0==(1&e)?this.L:this.R),this.levels[t]=e}},Si.prototype.updateLevels=function(t,e,i){if(0==(1&e))for(var r=t;r<i;++r)this.result[r]===this.R?this.levels[r]+=1:this.result[r]!==this.L&&(this.levels[r]+=2);else for(r=t;r<i;++r)this.result[r]!==this.R&&(this.levels[r]+=1)},Si.prototype.doVisualOrder=function(){this.length=this.types.length,this.result=this.types,this.levels=[],this.setLevels(),this.length=this.getEmbeddedCharactersLength();for(var t=this.textOrder,e=0;e<this.length;){for(var i=this.levels[e],r=0==(1&Math.max(t,i))?this.L:this.R,n=e+1;n<this.length&&this.levels[n]===i;)++n;var o=n<this.length?this.levels[n]:this.textOrder,o=0==(1&Math.max(o,i))?this.L:this.R;this.checkNSM(e,n,i,r,o),this.updateLevels(e,i,n),t=i,e=n}this.checkEmbeddedCharacters(this.length)},Si.prototype.getEmbeddedCharactersLength=function(){for(var t=0,e=0;e<this.length;++e)this.types[e]!==this.LRE&&this.types[e]!==this.RLE&&this.types[e]!==this.LRO&&this.types[e]!==this.RLO&&this.types[e]!==this.PDF&&this.types[e]!==this.BN&&(this.result[t]=this.result[e],this.levels[t]=this.levels[e],t++);return t},Si.prototype.checkEmbeddedCharacters=function(t){for(var e=this.types.length-1;0<=e;--e)this.types[e]===this.LRE||this.types[e]===this.RLE||this.types[e]===this.LRO||this.types[e]===this.RLO||this.types[e]===this.PDF||this.types[e]===this.BN?(this.result[e]=this.types[e],this.levels[e]=-1):(this.result[e]=this.result[--t],this.levels[e]=this.levels[t]);for(e=0;e<this.types.length;e++)-1===this.levels[e]&&(this.levels[e]=0===e?this.textOrder:this.levels[e-1])},Si.prototype.checkNSM=function(t,e,i,r,n){for(var o=r,s=t;s<e;++s)this.result[s]===this.NSM?this.result[s]=o:o=this.result[s];this.checkEuropeanDigits(t,e,i,r,n)},Si.prototype.checkEuropeanDigits=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN)for(var s=o-1;t<=s;--s)if(this.result[s]===this.L||this.result[s]===this.R||this.result[s]===this.AL){this.result[s]===this.AL&&(this.result[o]=this.AN);break}this.checkArabicCharacters(t,e,i,r,n)},Si.prototype.checkArabicCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]===this.AL&&(this.result[o]=this.R);this.checkEuropeanNumberSeparator(t,e,i,r,n)},Si.prototype.checkEuropeanNumberSeparator=function(t,e,i,r,n){for(var o,s,a=t+1;a<e-1;++a)this.result[a]!==this.ES&&this.result[a]!==this.CS||(o=this.result[a-1],s=this.result[a+1],o===this.EN&&s===this.EN?this.result[a]=this.EN:this.result[a]===this.CS&&o===this.AN&&s===this.AN&&(this.result[a]=this.AN));this.checkEuropeanNumberTerminator(t,e,i,r,n)},Si.prototype.checkEuropeanNumberTerminator=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.ET){var s=o,a=[],h=(a.push(this.ET),this.getLength(s,e,a)),a=s===t?r:this.result[s-1];if((a=a!==this.EN?h===e?n:this.result[h]:a)===this.EN)for(var l=s;l<h;++l)this.result[l]=this.EN;o=h}this.checkOtherNeutrals(t,e,i,r,n)},Si.prototype.checkOtherNeutrals=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]!==this.ES&&this.result[o]!==this.ET&&this.result[o]!==this.CS||(this.result[o]=this.ON);this.checkOtherCharacters(t,e,i,r,n)},Si.prototype.checkOtherCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN){for(var s=r,a=o-1;t<=a;--a)if(this.result[a]===this.L||this.result[a]===this.R){s=this.result[a];break}s===this.L&&(this.result[o]=this.L)}this.checkCommanCharacters(t,e,i,r,n)},Si.prototype.getLength=function(t,e,i){for(--t;++t<e;){for(var r=this.result[t],n=0;n<i.length;++n)r===i[n]&&(t=this.getLength(++t,e,i));return t}return e},Si.prototype.checkCommanCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.WS||this.result[o]===this.ON||this.result[o]===this.B||this.result[o]===this.S){var s=o,a=[this.B,this.S,this.WS,this.ON],h=this.getLength(s,e,a),a=0,l=0,u=0;s===t?a=r:(a=this.result[s-1])!==this.AN&&a!==this.EN||(a=this.R),h===e?l=n:(l=this.result[h])!==this.AN&&l!==this.EN||(l=this.R);for(var u=a===l?a:0==(1&i)?this.L:this.R,c=s;c<h;++c)this.result[c]=u;o=h}};var Pi=Si;function Si(){this.types=[],this.textOrder=-1,this.rtlCharacterTypes=new Array(65536),this.L=0,this.LRE=1,this.LRO=2,this.R=3,this.AL=4,this.RLE=5,this.RLO=6,this.PDF=7,this.EN=8,this.ES=9,this.ET=10,this.AN=11,this.CS=12,this.NSM=13,this.BN=14,this.B=15,this.S=16,this.WS=17,this.ON=18,this.charTypes=[this.L,this.EN,this.BN,this.ES,this.ES,this.S,this.ET,this.ET,this.B,this.AN,this.AN,this.S,this.CS,this.CS,this.WS,this.NSM,this.NSM,this.B,this.BN,27,this.BN,28,30,this.B,31,31,this.S,32,32,this.WS,33,34,this.ON,35,37,this.ET,38,42,this.ON,43,43,this.ET,44,44,this.CS,45,45,this.ET,46,46,this.CS,47,47,this.CS,48,57,this.EN,58,58,this.CS,59,64,this.ON,65,90,this.L,91,96,this.ON,97,122,this.L,123,126,this.ON,127,132,this.BN,133,133,this.B,134,159,this.BN,160,160,this.CS,161,161,this.ON,162,165,this.ET,166,169,this.ON,170,170,this.L,171,175,this.ON,176,177,this.ET,178,179,this.EN,180,180,this.ON,181,181,this.L,182,184,this.ON,185,185,this.EN,186,186,this.L,187,191,this.ON,192,214,this.L,215,215,this.ON,216,246,this.L,247,247,this.ON,248,696,this.L,697,698,this.ON,699,705,this.L,706,719,this.ON,720,721,this.L,722,735,this.ON,736,740,this.L,741,749,this.ON,750,750,this.L,751,767,this.ON,768,855,this.NSM,856,860,this.L,861,879,this.NSM,880,883,this.L,884,885,this.ON,886,893,this.L,894,894,this.ON,895,899,this.L,900,901,this.ON,902,902,this.L,903,903,this.ON,904,1013,this.L,1014,1014,this.ON,1015,1154,this.L,1155,1158,this.NSM,1159,1159,this.L,1160,1161,this.NSM,1162,1417,this.L,1418,1418,this.ON,1419,1424,this.L,1425,1441,this.NSM,1442,1442,this.L,1443,1465,this.NSM,1466,1466,this.L,1467,1469,this.NSM,1470,1470,this.R,1471,1471,this.NSM,1472,1472,this.R,1473,1474,this.NSM,1475,1475,this.R,1476,1476,this.NSM,1477,1487,this.L,1488,1514,this.R,1515,1519,this.L,1520,1524,this.R,1525,1535,this.L,1536,1539,this.AL,1540,1547,this.L,1548,1548,this.CS,1549,1549,this.AL,1550,1551,this.ON,1552,1557,this.NSM,1558,1562,this.L,1563,1563,this.AL,1564,1566,this.L,1567,1567,this.AL,1568,1568,this.L,1569,1594,this.AL,1595,1599,this.L,1600,1610,this.AL,1611,1624,this.NSM,1625,1631,this.L,1632,1641,this.AN,1642,1642,this.ET,1643,1644,this.AN,1645,1647,this.AL,1648,1648,this.NSM,1649,1749,this.AL,1750,1756,this.NSM,1757,1757,this.AL,1758,1764,this.NSM,1765,1766,this.AL,1767,1768,this.NSM,1769,1769,this.ON,1770,1773,this.NSM,1774,1775,this.AL,1776,1785,this.EN,1786,1805,this.AL,1806,1806,this.L,1807,1807,this.BN,1808,1808,this.AL,1809,1809,this.NSM,1810,1839,this.AL,1840,1866,this.NSM,1867,1868,this.L,1869,1871,this.AL,1872,1919,this.L,1920,1957,this.AL,1958,1968,this.NSM,1969,1969,this.AL,1970,2304,this.L,2305,2306,this.NSM,2307,2363,this.L,2364,2364,this.NSM,2365,2368,this.L,2369,2376,this.NSM,2377,2380,this.L,2381,2381,this.NSM,2382,2384,this.L,2385,2388,this.NSM,2389,2401,this.L,2402,2403,this.NSM,2404,2432,this.L,2433,2433,this.NSM,2434,2491,this.L,2492,2492,this.NSM,2493,2496,this.L,2497,2500,this.NSM,2501,2508,this.L,2509,2509,this.NSM,2510,2529,this.L,2530,2531,this.NSM,2532,2545,this.L,2546,2547,this.ET,2548,2560,this.L,2561,2562,this.NSM,2563,2619,this.L,2620,2620,this.NSM,2621,2624,this.L,2625,2626,this.NSM,2627,2630,this.L,2631,2632,this.NSM,2633,2634,this.L,2635,2637,this.NSM,2638,2671,this.L,2672,2673,this.NSM,2674,2688,this.L,2689,2690,this.NSM,2691,2747,this.L,2748,2748,this.NSM,2749,2752,this.L,2753,2757,this.NSM,2758,2758,this.L,2759,2760,this.NSM,2761,2764,this.L,2765,2765,this.NSM,2766,2785,this.L,2786,2787,this.NSM,2788,2800,this.L,2801,2801,this.ET,2802,2816,this.L,2817,2817,this.NSM,2818,2875,this.L,2876,2876,this.NSM,2877,2878,this.L,2879,2879,this.NSM,2880,2880,this.L,2881,2883,this.NSM,2884,2892,this.L,2893,2893,this.NSM,2894,2901,this.L,2902,2902,this.NSM,2903,2945,this.L,2946,2946,this.NSM,2947,3007,this.L,3008,3008,this.NSM,3009,3020,this.L,3021,3021,this.NSM,3022,3058,this.L,3059,3064,this.ON,3065,3065,this.ET,3066,3066,this.ON,3067,3133,this.L,3134,3136,this.NSM,3137,3141,this.L,3142,3144,this.NSM,3145,3145,this.L,3146,3149,this.NSM,3150,3156,this.L,3157,3158,this.NSM,3159,3259,this.L,3260,3260,this.NSM,3261,3275,this.L,3276,3277,this.NSM,3278,3392,this.L,3393,3395,this.NSM,3396,3404,this.L,3405,3405,this.NSM,3406,3529,this.L,3530,3530,this.NSM,3531,3537,this.L,3538,3540,this.NSM,3541,3541,this.L,3542,3542,this.NSM,3543,3632,this.L,3633,3633,this.NSM,3634,3635,this.L,3636,3642,this.NSM,3643,3646,this.L,3647,3647,this.ET,3648,3654,this.L,3655,3662,this.NSM,3663,3760,this.L,3761,3761,this.NSM,3762,3763,this.L,3764,3769,this.NSM,3770,3770,this.L,3771,3772,this.NSM,3773,3783,this.L,3784,3789,this.NSM,3790,3863,this.L,3864,3865,this.NSM,3866,3892,this.L,3893,3893,this.NSM,3894,3894,this.L,3895,3895,this.NSM,3896,3896,this.L,3897,3897,this.NSM,3898,3901,this.ON,3902,3952,this.L,3953,3966,this.NSM,3967,3967,this.L,3968,3972,this.NSM,3973,3973,this.L,3974,3975,this.NSM,3976,3983,this.L,3984,3991,this.NSM,3992,3992,this.L,3993,4028,this.NSM,4029,4037,this.L,4038,4038,this.NSM,4039,4140,this.L,4141,4144,this.NSM,4145,4145,this.L,4146,4146,this.NSM,4147,4149,this.L,4150,4151,this.NSM,4152,4152,this.L,4153,4153,this.NSM,4154,4183,this.L,4184,4185,this.NSM,4186,5759,this.L,5760,5760,this.WS,5761,5786,this.L,5787,5788,this.ON,5789,5905,this.L,5906,5908,this.NSM,5909,5937,this.L,5938,5940,this.NSM,5941,5969,this.L,5970,5971,this.NSM,5972,6001,this.L,6002,6003,this.NSM,6004,6070,this.L,6071,6077,this.NSM,6078,6085,this.L,6086,6086,this.NSM,6087,6088,this.L,6089,6099,this.NSM,6100,6106,this.L,6107,6107,this.ET,6108,6108,this.L,6109,6109,this.NSM,6110,6127,this.L,6128,6137,this.ON,6138,6143,this.L,6144,6154,this.ON,6155,6157,this.NSM,6158,6158,this.WS,6159,6312,this.L,6313,6313,this.NSM,6314,6431,this.L,6432,6434,this.NSM,6435,6438,this.L,6439,6443,this.NSM,6444,6449,this.L,6450,6450,this.NSM,6451,6456,this.L,6457,6459,this.NSM,6460,6463,this.L,6464,6464,this.ON,6465,6467,this.L,6468,6469,this.ON,6470,6623,this.L,6624,6655,this.ON,6656,8124,this.L,8125,8125,this.ON,8126,8126,this.L,8127,8129,this.ON,8130,8140,this.L,8141,8143,this.ON,8144,8156,this.L,8157,8159,this.ON,8160,8172,this.L,8173,8175,this.ON,8176,8188,this.L,8189,8190,this.ON,8191,8191,this.L,8192,8202,this.WS,8203,8205,this.BN,8206,8206,this.L,8207,8207,this.R,8208,8231,this.ON,8232,8232,this.WS,8233,8233,this.B,8234,8234,this.LRE,8235,8235,this.RLE,8236,8236,this.PDF,8237,8237,this.LRO,8238,8238,this.RLO,8239,8239,this.WS,8240,8244,this.ET,8245,8276,this.ON,8277,8278,this.L,8279,8279,this.ON,8280,8286,this.L,8287,8287,this.WS,8288,8291,this.BN,8292,8297,this.L,8298,8303,this.BN,8304,8304,this.EN,8305,8307,this.L,8308,8313,this.EN,8314,8315,this.ET,8316,8318,this.ON,8319,8319,this.L,8320,8329,this.EN,8330,8331,this.ET,8332,8334,this.ON,8335,8351,this.L,8352,8369,this.ET,8370,8399,this.L,8400,8426,this.NSM,8427,8447,this.L,8448,8449,this.ON,8450,8450,this.L,8451,8454,this.ON,8455,8455,this.L,8456,8457,this.ON,8458,8467,this.L,8468,8468,this.ON,8469,8469,this.L,8470,8472,this.ON,8473,8477,this.L,8478,8483,this.ON,8484,8484,this.L,8485,8485,this.ON,8486,8486,this.L,8487,8487,this.ON,8488,8488,this.L,8489,8489,this.ON,8490,8493,this.L,8494,8494,this.ET,8495,8497,this.L,8498,8498,this.ON,8499,8505,this.L,8506,8507,this.ON,8508,8511,this.L,8512,8516,this.ON,8517,8521,this.L,8522,8523,this.ON,8524,8530,this.L,8531,8543,this.ON,8544,8591,this.L,8592,8721,this.ON,8722,8723,this.ET,8724,9013,this.ON,9014,9082,this.L,9083,9108,this.ON,9109,9109,this.L,9110,9168,this.ON,9169,9215,this.L,9216,9254,this.ON,9255,9279,this.L,9280,9290,this.ON,9291,9311,this.L,9312,9371,this.EN,9372,9449,this.L,9450,9450,this.EN,9451,9751,this.ON,9752,9752,this.L,9753,9853,this.ON,9854,9855,this.L,9856,9873,this.ON,9874,9887,this.L,9888,9889,this.ON,9890,9984,this.L,9985,9988,this.ON,9989,9989,this.L,9990,9993,this.ON,9994,9995,this.L,9996,10023,this.ON,10024,10024,this.L,10025,10059,this.ON,10060,10060,this.L,10061,10061,this.ON,10062,10062,this.L,10063,10066,this.ON,10067,10069,this.L,10070,10070,this.ON,10071,10071,this.L,10072,10078,this.ON,10079,10080,this.L,10081,10132,this.ON,10133,10135,this.L,10136,10159,this.ON,10160,10160,this.L,10161,10174,this.ON,10175,10191,this.L,10192,10219,this.ON,10220,10223,this.L,10224,11021,this.ON,11022,11903,this.L,11904,11929,this.ON,11930,11930,this.L,11931,12019,this.ON,12020,12031,this.L,12032,12245,this.ON,12246,12271,this.L,12272,12283,this.ON,12284,12287,this.L,12288,12288,this.WS,12289,12292,this.ON,12293,12295,this.L,12296,12320,this.ON,12321,12329,this.L,12330,12335,this.NSM,12336,12336,this.ON,12337,12341,this.L,12342,12343,this.ON,12344,12348,this.L,12349,12351,this.ON,12352,12440,this.L,12441,12442,this.NSM,12443,12444,this.ON,12445,12447,this.L,12448,12448,this.ON,12449,12538,this.L,12539,12539,this.ON,12540,12828,this.L,12829,12830,this.ON,12831,12879,this.L,12880,12895,this.ON,12896,12923,this.L,12924,12925,this.ON,12926,12976,this.L,12977,12991,this.ON,12992,13003,this.L,13004,13007,this.ON,13008,13174,this.L,13175,13178,this.ON,13179,13277,this.L,13278,13279,this.ON,13280,13310,this.L,13311,13311,this.ON,13312,19903,this.L,19904,19967,this.ON,19968,42127,this.L,42128,42182,this.ON,42183,64284,this.L,64285,64285,this.R,64286,64286,this.NSM,64287,64296,this.R,64297,64297,this.ET,64298,64310,this.R,64311,64311,this.L,64312,64316,this.R,64317,64317,this.L,64318,64318,this.R,64319,64319,this.L,64320,64321,this.R,64322,64322,this.L,64323,64324,this.R,64325,64325,this.L,64326,64335,this.R,64336,64433,this.AL,64434,64466,this.L,64467,64829,this.AL,64830,64831,this.ON,64832,64847,this.L,64848,64911,this.AL,64912,64913,this.L,64914,64967,this.AL,64968,65007,this.L,65008,65020,this.AL,65021,65021,this.ON,65022,65023,this.L,65024,65039,this.NSM,65040,65055,this.L,65056,65059,this.NSM,65060,65071,this.L,65072,65103,this.ON,65104,65104,this.CS,65105,65105,this.ON,65106,65106,this.CS,65107,65107,this.L,65108,65108,this.ON,65109,65109,this.CS,65110,65118,this.ON,65119,65119,this.ET,65120,65121,this.ON,65122,65123,this.ET,65124,65126,this.ON,65127,65127,this.L,65128,65128,this.ON,65129,65130,this.ET,65131,65131,this.ON,65132,65135,this.L,65136,65140,this.AL,65141,65141,this.L,65142,65276,this.AL,65277,65278,this.L,65279,65279,this.BN,65280,65280,this.L,65281,65282,this.ON,65283,65285,this.ET,65286,65290,this.ON,65291,65291,this.ET,65292,65292,this.CS,65293,65293,this.ET,65294,65294,this.CS,65295,65295,this.ES,65296,65305,this.EN,65306,65306,this.CS,65307,65312,this.ON,65313,65338,this.L,65339,65344,this.ON,65345,65370,this.L,65371,65381,this.ON,65382,65503,this.L,65504,65505,this.ET,65506,65508,this.ON,65509,65510,this.ET,65511,65511,this.L,65512,65518,this.ON,65519,65528,this.L,65529,65531,this.BN,65532,65533,this.ON,65534,65535,this.L];for(var t=0;t<this.charTypes.length;++t)for(var e=this.charTypes[t],i=this.charTypes[++t],r=this.charTypes[++t];e<=i;)this.rtlCharacterTypes[e++]=r}Ci.prototype.layout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");var o=[];return e.Unicode?o=this.customLayout(t,i,n,e,r):(o=[])[0]=t,o},Ci.prototype.splitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customSplitLayout(t,e,i,r,n)},Ci.prototype.getGlyphIndex=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");if(r=null,0===t.length)return{success:!1,glyphs:null};for(var o=(new fi).shape(t,0),s=e.fontInternal.ttfReader,a=(r=new Uint16Array(o.length),0),h=0,l=o.length;h<l;h++){var u=o[h],u=s.getGlyph(u);null!=u&&(r[a++]=u.index)}return{success:!0,glyphs:r}},Ci.prototype.customLayout=function(t,e,i,r,n){if(null==n){if(null==t)throw new Error("ArgumentNullException : line");var o=null;return o=null!=i&&i.textDirection!==Y.PdfTextDirection.None?(new bi).getLogicalToVisualString(t,e):o}if(null==t)throw new Error("ArgumentNullException : line");if(null==r)throw new Error("ArgumentNullException : font");var s=null,o=(null!=i&&i.textDirection!==Y.PdfTextDirection.None&&(t=(new fi).shape(t,0),s=this.customLayout(t,e,i)),[]);if(n){for(var a=s.split(""),h=a.length,l=0;l<h;l++)a[l]=this.addChars(r,a[l]);o=a}else(o=[])[0]=this.addChars(r,s);return o},Ci.prototype.addChars=function(t,e){if(null==t)throw new Error("ArgumentNullException : font");if(null==e)throw new Error("ArgumentNullException : line");var i=t.fontInternal.ttfReader,t=(t.setSymbols(e),e=i.convertString(e),tt.toUnicodeArray(e,!1));return tt.byteToString(t)},Ci.prototype.customSplitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customLayout(t,i,n).split("")};var vi=Ci;function Ci(){this.openBracket="(",this.closeBracket=")"}(w=Y.PdfLayoutType||(Y.PdfLayoutType={}))[w.Paginate=0]="Paginate",w[w.OnePage=1]="OnePage",(w=Y.PdfLayoutBreakType||(Y.PdfLayoutBreakType={}))[w.FitPage=0]="FitPage",w[w.FitElement=1]="FitElement",w[w.FitColumnsToPage=2]="FitColumnsToPage",(w=Y.PathPointType||(Y.PathPointType={}))[w.Start=0]="Start",w[w.Line=1]="Line",w[w.Bezier3=3]="Bezier3",w[w.Bezier=3]="Bezier",w[w.PathTypeMask=7]="PathTypeMask",w[w.DashMode=16]="DashMode",w[w.PathMarker=32]="PathMarker",w[w.CloseSubpath=128]="CloseSubpath",Bi=function(t,e){return(Bi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Bi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Li,Oi=pt),Object.defineProperty(Li.prototype,"background",{get:function(){return this.mbackground},set:function(t){this.mbackground=t;var e=this.shading;t.isEmpty?e.remove(this.dictionaryProperties.background):e.items.setValue(this.dictionaryProperties.background,t.toArray(this.colorSpace))},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"antiAlias",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.antiAlias).value},set:function(t){var e=this.shading,i=e.items.getValue(this.dictionaryProperties.antiAlias);null==i&&void 0===i?(i=new zt(t),e.items.setValue(this.dictionaryProperties.antiAlias,i)):i.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"function",{get:function(){return this.mfunction},set:function(t){null!=(this.mfunction=t)&&void 0!==t?this.shading.items.setValue(this.dictionaryProperties.function,new d(this.mfunction)):this.shading.remove(this.dictionaryProperties.function)},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"bBox",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.bBox)},set:function(t){var e=this.shading;null==t&&void 0===t?e.remove(this.dictionaryProperties.bBox):e.items.setValue(this.dictionaryProperties.bBox,t)},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"colorSpace",{get:function(){return this.mcolorSpace},set:function(t){var e=this.shading.items.getValue(this.dictionaryProperties.colorSpace);t===this.mcolorSpace&&null!=e||(this.mcolorSpace=t,e=this.colorSpaceToDeviceName(t),this.shading.items.setValue(this.dictionaryProperties.colorSpace,new o(e)))},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"stroking",{get:function(){return this.mbStroking},set:function(t){this.mbStroking=t},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"patternDictionary",{get:function(){return null==this.mpatternDictionary&&(this.mpatternDictionary=new c),this.mpatternDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"shading",{get:function(){return this.mshading},set:function(t){if(null==t)throw new Error("ArgumentNullException : Shading");t!==this.mshading&&(this.mshading=t,this.patternDictionary.items.setValue(this.dictionaryProperties.shading,new d(this.mshading)))},enumerable:!0,configurable:!0}),Object.defineProperty(Li.prototype,"matrix",{get:function(){return this.mmatrix},set:function(t){if(null==t)throw new Error("ArgumentNullException : Matrix");t!==this.mmatrix&&(this.mmatrix=t.clone(),t=new p(this.mmatrix.matrix.elements),this.mpatternDictionary.items.setValue(this.dictionaryProperties.matrix,t))},enumerable:!0,configurable:!0}),Li.prototype.monitorChanges=function(t,e,i,r,n){var o=!1;return t instanceof Li&&(this.colorSpace!==n&&(this.colorSpace=n,this.resetFunction()),e.setColorSpace("Pattern",this.mbStroking),t=i.getResources().getName(this),e.setColourWithPattern(null,t,this.mbStroking),o=!0),o},Li.prototype.resetChanges=function(t){},Li.prototype.colorSpaceToDeviceName=function(t){var e;return e=t===Y.PdfColorSpace.Rgb?"DeviceRGB":e},Li.prototype.resetPatternDictionary=function(t){this.mpatternDictionary=t},Li.prototype.cloneAntiAliasingValue=function(t){if(null==t)throw new Error("ArgumentNullException : brush");var e=this.shading.items.getValue(this.dictionaryProperties.antiAlias);null!=e&&t.shading.items.setValue(this.dictionaryProperties.antiAlias,new zt(e.value))},Li.prototype.cloneBackgroundValue=function(t){var e=this.background;e.isEmpty||(t.background=e)},Object.defineProperty(Li.prototype,"element",{get:function(){return this.patternDictionary},enumerable:!0,configurable:!0});var Bi,Oi,xi=Li;function Li(t){var e=Oi.call(this)||this;return e.mbackground=new f(255,255,255),e.mbStroking=!1,e.mfunction=null,e.dictionaryProperties=new l,e.mpatternDictionary=new c,e.mpatternDictionary.items.setValue(e.dictionaryProperties.type,new o(e.dictionaryProperties.pattern)),e.mpatternDictionary.items.setValue(e.dictionaryProperties.patternType,new u(2)),e.shading=t,e.colorSpace=Y.PdfColorSpace.Rgb,e}Object.defineProperty(ji.prototype,"size",{get:function(){return this.templateSize},enumerable:!0,configurable:!0}),Object.defineProperty(ji.prototype,"width",{get:function(){return this.size.width},enumerable:!0,configurable:!0}),Object.defineProperty(ji.prototype,"height",{get:function(){return this.size.height},enumerable:!0,configurable:!0}),Object.defineProperty(ji.prototype,"graphics",{get:function(){var t;return null!=this.pdfGraphics&&void 0!==this.pdfGraphics||(t=new zi(this),t=new Gi(this.size,t,this.content),this.pdfGraphics=t,this.pdfGraphics.initializeCoordinates()),this.pdfGraphics},enumerable:!0,configurable:!0}),ji.prototype.getResources=function(){return null==this.resources&&(this.resources=new Ri,this.content.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},ji.prototype.initialize=function(){this.addType(),this.addSubType()},ji.prototype.addType=function(){var t=new o(this.dictionaryProperties.xObject);this.content.items.setValue(this.dictionaryProperties.type,t)},ji.prototype.addSubType=function(){var t=new o(this.dictionaryProperties.form);this.content.items.setValue(this.dictionaryProperties.subtype,t)},ji.prototype.reset=function(t){void 0===t?(null!=this.resources&&(this.resources=null,this.content.remove(this.dictionaryProperties.resources)),null!=this.graphics&&this.graphics.reset(this.size)):(this.setSize(t),this.reset())},ji.prototype.setSize=function(t){var e=new Z(new J(0,0),t),e=p.fromRectangle(e);this.content.items.setValue(this.dictionaryProperties.bBox,e),this.templateSize=t},Object.defineProperty(ji.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0});var Ti=ji;function ji(t,e){var i;this.dictionaryProperties=new l,this.writeTransformation=!0,void 0!==t&&(t instanceof X&&void 0===e?(this.content=new U,i=new X(t.width,t.height),this.setSize(i)):(this.content=new U,this.setSize(new X(t,e))),this.initialize())}ki=function(t,e){return(ki=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}ki(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Mi,Vi=c),Object.defineProperty(Mi.prototype,"names",{get:function(){return this.getNames()},enumerable:!0,configurable:!0}),Object.defineProperty(Mi.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),Mi.prototype.getName=function(t){var e,i=t.element,r=null;return null==(r=this.names.containsKey(i)?this.names.getValue(i):r)&&(e=this.generateName(),r=new o(e),this.names.setValue(i,r),t instanceof Tt||t instanceof Ti||t instanceof xi||t instanceof Ii||t instanceof de||t instanceof ke||t instanceof Ae)&&this.add(t,r),r},Mi.prototype.getNames=function(){null==this.pdfNames&&(this.pdfNames=new ce);var t=this.items.getValue(this.dictionaryProperties.font);return null!=t&&Jt.dereference(t),this.pdfNames},Mi.prototype.requireProcedureSet=function(t){if(null==t)throw new Error("ArgumentNullException:procedureSetName");var e=this.items.getValue(this.dictionaryProperties.procset),t=(null==e&&(e=new p,this.items.setValue(this.dictionaryProperties.procset,e)),new o(t));e.contains(t)||e.add(t)},Mi.prototype.removeFont=function(t){for(var e=null,i=this.pdfNames.keys(),r=0;r<this.pdfNames.size();r++)if(this.pdfNames.getValue(i[r])===new o(t)){e=i[r];break}null!=e&&this.pdfNames.remove(e)},Mi.prototype.generateName=function(){return Ai.getNewGuidString()},Mi.prototype.add=function(t,e){if(t instanceof Tt){var i=null,r=this.items.getValue(this.dictionaryProperties.font);null!=r?i=i=s=r:(i=new c,this.items.setValue(this.dictionaryProperties.font,i)),i.items.setValue(e.value,new d(t.element))}else if(t instanceof Ti){var n=void 0;null==(n=this.items.getValue(this.dictionaryProperties.xObject))&&(n=new c,this.items.setValue(this.dictionaryProperties.xObject,n)),n.items.setValue(e.value,new d(t.element))}else if(t instanceof pt)(t instanceof xi||t instanceof Ii)&&null!=(o=t.element)&&(null==(r=this.items.getValue(this.dictionaryProperties.pattern))&&(r=new c,this.items.setValue(this.dictionaryProperties.pattern,r)),r.items.setValue(e.value,new d(o)));else if(t instanceof de){var o=t.element,i=null;null==(i=this.items.getValue(this.dictionaryProperties.extGState))&&(i=new c,this.items.setValue(this.dictionaryProperties.extGState,i)),i.items.setValue(e.value,new d(o))}else{var s,n=this.Dictionary.items.getValue(this.dictionaryProperties.xObject),r=void 0,a=(void 0!==this.pdfDocument&&(r=this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.getValue(this.dictionaryProperties.xObject)),this.Dictionary.items.values(),!1),h=void 0;if(void 0!==this.pdfDocument&&null==r)r=new c,this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.setValue(this.dictionaryProperties.xObject,r);else if(void 0!==this.pdfDocument)for(var l=r.items.values(),u=0;u<l.length;u++)void 0!==l[u]&&void 0!==l[u].element&&l[u].element.data[0]===t.element.data[0]&&(h=l[u],a=!0);null==n&&(n=new c,this.Dictionary.items.setValue(this.dictionaryProperties.xObject,n)),a&&void 0!==h?n.items.setValue(e.value,h):(s=new d(t.element),n.items.setValue(e.value,s),void 0!==this.pdfDocument&&r.items.setValue(e.value,s))}};var ki,Vi,Ri=Mi;function Mi(t){t=Vi.call(this,t)||this;return t.properties=new c,t}Di.getNewGuidString=function(){return"aaaaaaaa-aaaa-4aaa-baaa-aaaaaaaaaaaa".replace(/[ab]/g,function(t){var e=16*Math.random()|0;return("a"===t?e:3&e|8).toString(16)})};var Ai=Di;function Di(){}Ni=function(t,e){return(Ni=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ni(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Ei,Fi=pt),Ei.prototype.initialize=function(t,e,i,r){this.mPage=e,this.mLocation=i,this.mTransformationMatrix=r,this.tempBrushStream=this.brushStream,this.brushStream=new U;e=new Ri;return this.brushStream.items.setValue(this.mDictionaryProperties.resources,e),this.setBox(t),this.setObligatoryFields(),this},Object.defineProperty(Ei.prototype,"location",{get:function(){return this.mLocation},set:function(t){this.mLocation=t},enumerable:!0,configurable:!0}),Ei.prototype.setObligatoryFields=function(){var t,e;this.brushStream.items.setValue(this.mDictionaryProperties.patternType,new u(1)),this.brushStream.items.setValue(this.mDictionaryProperties.paintType,new u(1)),this.brushStream.items.setValue(this.mDictionaryProperties.tilingType,new u(1)),this.brushStream.items.setValue(this.mDictionaryProperties.xStep,new u(this.mBox.right-this.mBox.left)),this.brushStream.items.setValue(this.mDictionaryProperties.yStep,new u(this.mBox.bottom-this.mBox.top)),null!=this.mPage&&null!=this.mLocation&&(null==this.mTransformationMatrix&&void 0===this.mTransformationMatrix?(t=this.mPage.size.height%this.rectangle.size.height-this.mLocation.y,this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new p([1,0,0,1,this.mLocation.x,t]))):(t=0,e=this.mTransformationMatrix.matrix.elements,t=this.mPage.size.height>this.rectangle.size.height?this.mTransformationMatrix.matrix.offsetY-this.mPage.size.height%this.rectangle.size.height:this.mPage.size.height%this.rectangle.size.height+this.mTransformationMatrix.matrix.offsetY,this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new p([e[0],e[1],e[2],e[3],e[4],t]))))},Ei.prototype.setBox=function(t){this.mBox=t;t=new Z(this.mBox.left,this.mBox.top,this.mBox.right,this.mBox.bottom);this.brushStream.items.setValue(this.mDictionaryProperties.bBox,p.fromRectangle(t))},Object.defineProperty(Ei.prototype,"rectangle",{get:function(){return this.mBox},enumerable:!0,configurable:!0}),Object.defineProperty(Ei.prototype,"size",{get:function(){return this.mBox.size},enumerable:!0,configurable:!0}),Object.defineProperty(Ei.prototype,"graphics",{get:function(){var t;return null==this.mGraphics&&void 0===this.mGraphics&&(t=new zi(this),t=new Gi(this.size,t,this.brushStream),this.mGraphics=t,this.mResources=this.getResources(),this.mGraphics.initializeCoordinates()),this.mGraphics},enumerable:!0,configurable:!0}),Ei.prototype.getResources=function(){return this.mResources},Object.defineProperty(Ei.prototype,"stroking",{get:function(){return this.mStroking},set:function(t){this.mStroking=t},enumerable:!0,configurable:!0}),Ei.prototype.clone=function(){var t=this.initialize(this.rectangle,this.mPage,this.location,this.mTransformationMatrix);return null!=this.mTransformationMatrix&&null!=this.mTransformationMatrix.matrix&&t.brushStream.items.setValue(this.mDictionaryProperties.matrix,new p(this.mTransformationMatrix.matrix.elements)),t.brushStream.data=this.tempBrushStream.data,t.mResources=new Ri(this.mResources),t.brushStream.items.setValue(this.mDictionaryProperties.resources,t.mResources),t},Ei.prototype.monitorChanges=function(t,e,i,r,n){var o,s=!1;return t!==this?(e.setColorSpace("Pattern",this.mStroking),o=i.getResources().getName(this),e.setColourWithPattern(null,o,this.mStroking),s=!0):t instanceof Ei&&(e.setColorSpace("Pattern",this.mStroking),o=i.getResources().getName(this),e.setColourWithPattern(null,o,this.mStroking),s=!0),s},Ei.prototype.resetChanges=function(t){},Object.defineProperty(Ei.prototype,"element",{get:function(){return this.brushStream},enumerable:!0,configurable:!0});var Ni,Fi,Ii=Ei;function Ei(t,e){var i=Fi.call(this)||this,r=(i.mStroking=!1,i.mLocation=new J(0,0),i.mDictionaryProperties=new l,null);return t instanceof ut?r=t:t instanceof X&&(r=new ut(0,0,t.width,t.height)),null!==e&&e instanceof or&&(i.mPage=e),i.brushStream=new U,i.mResources=new Ri,i.brushStream.items.setValue(i.mDictionaryProperties.resources,i.mResources),i.setBox(r),i.setObligatoryFields(),null!==e&&e instanceof or&&(i.mPage=e,i.graphics.colorSpace=e.document.colorSpace),i}Object.defineProperty(S.prototype,"stringLayoutResult",{get:function(){return this.pdfStringLayoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"size",{get:function(){return this.canvasSize},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"mediaBoxUpperRightBound",{get:function(){return void 0===this.internalMediaBoxUpperRightBound&&(this.internalMediaBoxUpperRightBound=0),this.internalMediaBoxUpperRightBound},set:function(t){this.internalMediaBoxUpperRightBound=t},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"clientSize",{get:function(){return new X(this.clipBounds.width,this.clipBounds.height)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"colorSpace",{get:function(){return this.currentColorSpace},set:function(t){this.currentColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"streamWriter",{get:function(){return this.pdfStreamWriter},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"matrix",{get:function(){return null==this.transformationMatrix&&(this.transformationMatrix=new se),this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"layer",{get:function(){return this.pageLayer},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"page",{get:function(){return this.pageLayer.page},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"automaticFields",{get:function(){return null!=this.internalAutomaticFields&&void 0!==this.internalAutomaticFields||(this.internalAutomaticFields=new ge),this.internalAutomaticFields},enumerable:!0,configurable:!0}),S.prototype.initialize=function(){this.bStateSaved=!1,this.currentPen=null,this.currentBrush=null,this.currentFont=null,this.currentColorSpace=Y.PdfColorSpace.Rgb,this.bCSInitialized=!1,this.transformationMatrix=null,this.previousTextRenderingMode=-1,this.previousCharacterSpacing=-1,this.previousWordSpacing=-1,this.previousTextScaling=-100,this.currentStringFormat=null,this.clipBounds=new Z(new J(0,0),this.size),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf)},S.prototype.drawPdfTemplate=function(t,e,i){if(void 0===i){if(null==t)throw Error("ArgumentNullException-template");this.drawPdfTemplate(t,e,t.size)}else{if(null==t)throw Error("ArgumentNullException-template");var r=0<t.width?i.width/t.width:1,n=0<t.height?i.height/t.height:1,o=!(1==r&&1==n),s=this.save(),a=new se;null!=this.pageLayer&&this.getTranslateTransform(e.x,e.y+i.height,a),o&&this.getScaleTransform(r,n,a),this.pdfStreamWriter.modifyCtm(a);var o=this.getResources.getResources().getName(t),h=(this.pdfStreamWriter.executeObject(o),this.restore(s),t.graphics);if(null!=h)for(var l=0;l<h.automaticFields.automaticFields.length;l++){var u=h.automaticFields.automaticFields[l],c=new J(u.location.x+e.x,u.location.y+e.y),p=0==t.size.width?0:i.width/t.size.width,d=0==t.size.height?0:i.height/t.size.height;this.automaticFields.add(new ve(u.field,c,p,d)),this.page.dictionary.modify()}this.getResources.getResources().requireProcedureSet(this.procedureSets.imageB),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageC),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageI),this.getResources.getResources().requireProcedureSet(this.procedureSets.text)}},S.prototype.drawString=function(t,e,i,r,n,o,s,a,h){var l;"string"==typeof t&&e instanceof Tt&&(i instanceof ne||null===i)&&(r instanceof pt||null===r)&&"number"==typeof n&&"number"==typeof o&&(s instanceof bt||null===s)&&void 0===a?(this.isOverloadWithPosition=!0,this.drawString(t,e,i,r,n,o,this.clientSize.width-n,0,s)):(i=i,r=r,n=n,o=o,s=s,a=a,h=h,(t=(new vt).layout(t,e,h,new X(s,a),this.isOverloadWithPosition,this.clientSize)).empty||(l=this.checkCorrectLayoutRectangle(t.actualSize,n,o,h),s<=0&&(n=l.x,s=l.width),a<=0&&(o=l.y,a=l.height),this.drawStringLayoutResult(t,e,i,r,new Z(n,o,s,a),h),this.isEmfTextScaled=!1,this.emfScalingFactor=new X(0,0)),this.getResources.getResources().requireProcedureSet(this.procedureSets.text),this.isNormalRender=!0,this.pdfStringLayoutResult=t,this.isUseFontSize=!1)},S.prototype.drawLine=function(t,e,i,r,n){var o,s;e instanceof J?this.drawLine(t,(o=e).x,o.y,(s=i).x,s.y):(o=e,s=i,e=r,i=n,this.stateControl(t,null,null),(r=this.streamWriter).beginPath(o,s),r.appendLineSegment(e,i),r.strokePath(),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf))},S.prototype.drawRectangle=function(t,e,i,r,n,o){var s,a;t instanceof ne&&"number"==typeof e?this.drawRectangle(t,null,e,s=i,r,n):t instanceof pt&&"number"==typeof e?this.drawRectangle(null,t,e,s=i,r,n):(s=i,i=r,r=n,n=o,e instanceof Ii?(this.bCSInitialized=!1,o=this.matrix.matrix.offsetX+s,a=void 0,a=null!=this.layer&&null!=this.layer.page?this.layer.page.size.height-this.matrix.matrix.offsetY+i:this.clientSize.height-this.matrix.matrix.offsetY+i,e.location=new J(o,a),e.graphics.colorSpace=this.colorSpace):e instanceof xi&&(e.colorSpace=this.colorSpace),o=t,a=e=e instanceof mt&&e.color.isEmpty?null:e,this.stateControl(o,a,null),this.streamWriter.appendRectangle(s,i,r,n),this.drawPathHelper(o,a,!1))},S.prototype.drawRoundedRectangle=function(t,e,i,r,n,o,s){if(null===t)throw new Error("pen");if(null===e)throw new Error("brush");0===s?this.drawRectangle(t,e,i,r,n,o):(o=[(i=[i,r,n,o])[0],i[1],(n=[r=2*s,r])[0],n[1]],this._pathPoints=[],this._pathTypes=[],s=this._addArc(o[0],o[1],o[2],o[3],180,90,s=!0),o[0]=i[0]+i[2]-r,s=this._addArc(o[0],o[1],o[2],o[3],270,90,s),o[1]=i[1]+i[3]-r,s=this._addArc(o[0],o[1],o[2],o[3],0,90,s),o[0]=i[0],s=this._addArc(o[0],o[1],o[2],o[3],90,90,s),n=this._pathPoints.length-1,r=this._pathTypes[n],r|=Y.PathPointType.CloseSubpath,this._pathTypes[n]=r,this._drawPath(t,e,this._pathPoints,this._pathTypes,Y.PdfFillMode.Alternate),this._pathPoints=[],this._pathTypes=[])},S.prototype._addArc=function(t,e,i,r,n,o,s){for(var a=this._getBezierArcPoints(t,e,t+i,e+r,n,o),h=0;h<a.length;h+=8){var l=[a[h],a[h+1],a[h+2],a[h+3],a[h+4],a[h+5],a[h+6],a[h+7]];s=this._addArcPoints(l,Y.PathPointType.Bezier3,s)}return s},S.prototype._addArcPoints=function(t,e,i){for(var r=0;r<t.length;r++){var n=new J(t[r],t[r+1]);0===r?0===this._pathPoints.length||i?(this._addPoint(n,Y.PathPointType.Start),i=!1):n.x===this._getLastPoint().x&&n.y===this._getLastPoint().y||this._addPoint(n,Y.PathPointType.Line):this._addPoint(n,e),r++}return i},S.prototype._getLastPoint=function(){var t=new J(0,0),e=this._pathPoints.length;return 0<e&&(t.x=this._pathPoints[e-1].x,t.y=this._pathPoints[e-1].y),t},S.prototype._addPoint=function(t,e){this._pathPoints.push(t),this._pathTypes.push(e)},S.prototype._getBezierArcPoints=function(t,e,i,r,n,o){i<t&&(p=void 0,p=t,t=i,i=p),e<r&&(p=void 0,p=e,e=r,r=p),Math.abs(o)<=90?(s=o,a=1):s=o/(a=Math.ceil(Math.abs(o)/90));for(var s,a,h=(t+i)/2,l=(e+r)/2,u=(i-t)/2,c=(r-e)/2,p=s*(Math.PI/360),d=Math.abs(4/3*(1-Math.cos(p))/Math.sin(p)),f=[],g=0;g<a;g++){var m=(n+g*s)*(Math.PI/180),y=(n+(g+1)*s)*(Math.PI/180),b=Math.cos(m),w=Math.cos(y),m=Math.sin(m),y=Math.sin(y);0<s?f.push(h+u*b,l-c*m,h+u*(b-d*m),l-c*(m+d*b),h+u*(w+d*y),l-c*(y-d*w),h+u*w,l-c*y):f.push(h+u*b,l-c*m,h+u*(b+d*m),l-c*(m-d*b),h+u*(w-d*y),l-c*(y+d*w),h+u*w,l-c*y)}return f},S.prototype.drawPathHelper=function(t,e,i,r){"boolean"==typeof i?this.drawPathHelper(t,e,Y.PdfFillMode.Winding,i):(e=null!=e,i=i===Y.PdfFillMode.Alternate,(t=null!=t)&&e?this.streamWriter.fillStrokePath(i):t||e?t?this.streamWriter.strokePath():this.streamWriter.fillPath(i):this.streamWriter.endPath())},S.prototype.drawImage=function(t,e,i,r,n){var o,s;"number"==typeof e&&"number"==typeof i&&void 0===r?(s=t.physicalDimension,this.drawImage(t,e,i,s.width,s.height)):(s=e,e=i,i=n,t.save(),o=new se,this.getTranslateTransform(s,e+i,o),this.getScaleTransform(r,n,o),this.pdfStreamWriter.write("q"),this.pdfStreamWriter.modifyCtm(o),s=this.getResources.getResources(),void 0!==this.pageLayer&&null!=this.page&&(s.document=this.page.document),e=s.getName(t),void 0!==this.pageLayer&&this.page.setResources(s),this.pdfStreamWriter.executeObject(e),this.pdfStreamWriter.write(h.restoreState),this.pdfStreamWriter.write(h.newLine),(i=this.getResources.getResources()).requireProcedureSet(this.procedureSets.imageB),i.requireProcedureSet(this.procedureSets.imageC),i.requireProcedureSet(this.procedureSets.imageI),i.requireProcedureSet(this.procedureSets.text))},S.prototype.getLineBounds=function(t,e,i,r,n){var o,s,a,h;return!e.empty&&t<e.lineCount&&0<=t?(h=e.lines[t],o=this.getTextVerticalAlignShift(e.actualSize.height,r.height,n)+r.y+e.lineHeight*t,s=h.width,a=this.getHorizontalAlignShift(s,r.width,n),t=this.getLineIndent(h,n,r,0===t),a+=this.rightToLeft(n)?0:t,a=r.x+a,h=this.shouldJustify(h,r.width,n)?r.width-t:s-t,n=e.lineHeight,new Z(a,o,h,n)):new Z(0,0,0,0)},S.prototype.checkCorrectLayoutRectangle=function(t,e,i,r){var n=new Z(e,i,t.width,t.width);if(null!=r){switch(r.alignment){case Y.PdfTextAlignment.Center:n.x-=n.width/2;break;case Y.PdfTextAlignment.Right:n.x-=n.width}switch(r.lineAlignment){case Y.PdfVerticalAlignment.Middle:n.y-=n.height/2;break;case Y.PdfVerticalAlignment.Bottom:n.y-=n.height}}return n},S.prototype.setLayer=function(t){t=(this.pageLayer=t).page;null!=t&&void 0!==t&&(t.beginSave=this.pageSave)},S.prototype.pageSave=function(t){if(null!=t.graphics.automaticFields)for(var e=0;e<t.graphics.automaticFields.automaticFields.length;e++){var i=t.graphics.automaticFields.automaticFields[e];i.field.performDraw(t.graphics,i.location,i.scalingX,i.scalingY)}},S.prototype.drawStringLayoutResult=function(t,e,i,r,n,o){if(t.empty)throw new Error("ArgumentNullException:result");this.applyStringSettings(e,i,r,o,n);var s=null!=o?o.horizontalScalingFactor:100,s=(s===this.previousTextScaling||this.isEmfTextScaled||(this.pdfStreamWriter.setTextScaling(s),this.previousTextScaling=s),null==o||0===o.lineSpacing?e.height:o.lineSpacing+e.height),a=null!=o&&o.subSuperScript===Y.PdfSubSuperScript.SubScript?s-(e.height+e.metrics.getDescent(o)):s-e.metrics.getAscent(o);this.shift=a,this.pdfStreamWriter.startNextLine(n.x,n.y-a),this.pdfStreamWriter.setLeading(+s);for(var h=0,l="",u=0;u<t.lines.length;u++)if(h+=t.lineHeight,n.y+h>this.clientSize.height){this.startCutIndex=u;break}for(var c=this.startCutIndex;c<t.lines.length&&0<=c;c++)l+=t.lines[c].text;a=new Z(n.x,n.y,n.width,n.height);this.drawLayoutResult(t,e,o,n),this.underlineStrikeoutText(i,r,t,e,a,o),this.isEmfPlus=!1,this.isUseFontSize=!1,-1!==this.startCutIndex&&this.getNextPage().graphics.drawString(l,e,i,r,n.x,0,n.width,0,o)},S.prototype.getNextPage=function(){var t=this.currentPage.section,e=t.indexOf(this.currentPage);return e===t.count-1?t.add():t.getPages()[e+1]},S.prototype.setClip=function(t,e){void 0===e?this.setClip(t,Y.PdfFillMode.Winding):(this.pdfStreamWriter.appendRectangle(t),this.pdfStreamWriter.clipPath(e===Y.PdfFillMode.Alternate))},S.prototype.applyStringSettings=function(t,e,i,r,n){i instanceof Ii?(this.bCSInitialized=!1,i.graphics.colorSpace=this.colorSpace):i instanceof xi&&(this.bCSInitialized=!1,i.colorSpace=this.colorSpace);var o=this.getTextRenderingMode(e,i,r),e=(this.stateControl(e,i,t,r),this.pdfStreamWriter.beginText(),o!==this.previousTextRenderingMode&&(this.pdfStreamWriter.setTextRenderingMode(o),this.previousTextRenderingMode=o),null!=r?r.characterSpacing:0),i=(e===this.previousCharacterSpacing||this.isEmfTextScaled||(this.pdfStreamWriter.setCharacterSpacing(e),this.previousCharacterSpacing=e),null!=r?r.wordSpacing:0);i!==this.previousWordSpacing&&(this.pdfStreamWriter.setWordSpacing(i),this.previousWordSpacing=i)},S.prototype.getTextVerticalAlignShift=function(t,e,i){var r=0;if(0<=e&&null!=i&&i.lineAlignment!==Y.PdfVerticalAlignment.Top)switch(i.lineAlignment){case Y.PdfVerticalAlignment.Middle:r=(e-t)/2;break;case Y.PdfVerticalAlignment.Bottom:r=e-t}return r},S.prototype.drawLayoutResult=function(t,e,i,r){var n=this.getTextVerticalAlignShift(t.actualSize.height,r.height,i);0!==n&&this.pdfStreamWriter.startNextLine(0,n);for(var o=null!=e&&e.isUnicode,s=(null!=e&&e.isEmbedFont,t.lines),a=0,h=s.length;a<h&&a!==this.startCutIndex;a++){var l=s[a],u=(l.text,l.width),u=this.getHorizontalAlignShift(u,r.width,i),c=this.getLineIndent(l,i,r,0===a);0===(u+=this.rightToLeft(i)?0:c)||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(u,0),o?this.drawUnicodeLine(l,r,e,i):this.drawAsciiLine(l,r,e,i),0===u||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(-u,0),this.isOverloadWithPosition&&1<s.length&&(this.pdfStreamWriter.startNextLine(-r.x,0),r.x=0,r.width=this.clientSize.width,this.isOverloadWithPosition=!1,this.isPointOverload=!0)}this.getResources.getResources().requireProcedureSet(this.procedureSets.text),0!==n&&this.pdfStreamWriter.startNextLine(0,-(n-t.lineHeight)),this.pdfStreamWriter.endText()},S.prototype.drawAsciiLine=function(t,e,i,r){this.justifyLine(t,e.width,r);var n="";if(-1!==t.text.indexOf("(")||-1!==t.text.indexOf(")"))for(var o=0;o<t.text.length;o++)"("===t.text[o]?n+="\\(":")"===t.text[o]?n+="\\)":n+=t.text[o];""===n&&(n=t.text),this.pdfStreamWriter.showNextLineText(new tt("("+n+")"))},S.prototype.drawUnicodeLine=function(t,e,i,r){var n,o,s=t.text,a=(t.width,null!=r&&r.rightToLeft),h=null!=r&&(0!==r.wordSpacing||r.alignment===Y.PdfTextAlignment.Justify),t=this.justifyLine(t,e.width,r),e=new vi;a||null!=r&&r.textDirection!==Y.PdfTextDirection.None?(a=(n=null)!=r&&r.alignment===Y.PdfTextAlignment.Right,o=1<(n=(o=null)!=r&&r.textDirection!==Y.PdfTextDirection.None?e.layout(s,i,r.textDirection===Y.PdfTextDirection.RightToLeft,h,r):e.layout(s,i,a,h,r)).length?null!=r&&r.textDirection!==Y.PdfTextDirection.None?e.splitLayout(s,i,r.textDirection===Y.PdfTextDirection.RightToLeft,h,r):e.splitLayout(s,i,a,h,r):[s],this.drawUnicodeBlocks(n,o,i,r,t)):h?(n=(e=this.breakUnicodeLine(s,i,null)).tokens,o=e.words,this.drawUnicodeBlocks(n,o,i,r,t)):(a=this.convertToUnicode(s,i),h=this.getUnicodeString(a),this.streamWriter.showNextLineText(h))},S.prototype.drawUnicodeBlocks=function(t,e,i,r,n){if(null==t)throw new Error("Argument Null Exception : blocks");if(null==e)throw new Error("Argument Null Exception : words");if(null==i)throw new Error("Argument Null Exception : font");this.streamWriter.startNextLine();var o=0,s=0,a=0,h=0;try{null!=r&&(a=r.firstLineIndent,h=r.paragraphIndent,r.firstLineIndent=0,r.paragraphIndent=0);var l=i.getCharWidth(Pt.whiteSpace,r)+n,u=null!=r?r.characterSpacing:0;l+=u+(null!=r&&0===n?r.wordSpacing:0);for(var c=0;c<t.length;c++){var p,d=t[c],f=e[c],g=0;0!==o&&this.streamWriter.startNextLine(o,0),0<f.length&&(g=g+i.measureString(f,r).width+u,p=this.getUnicodeString(d),this.streamWriter.showText(p)),c!==t.length-1&&(s+=o=g+l)}0<s&&this.streamWriter.startNextLine(-s,0)}finally{null!=r&&(r.firstLineIndent=a,r.paragraphIndent=h)}},S.prototype.breakUnicodeLine=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : line");i=t.split(null);for(var r=[],n=0;n<i.length;n++){var o=i[n],o=this.convertToUnicode(o,e);r[n]=o}return{tokens:r,words:i}},S.prototype.getUnicodeString=function(t){if(null===t)throw new Error("Argument Null Exception : token");t=new tt(t);return t.converted=!0,t.encode=Y.InternalEnum.ForceEncoding.Ascii,t},S.prototype.convertToUnicode=function(t,e){var i,r=null;if(null==t)throw new Error("Argument Null Exception : text");if(null==e)throw new Error("Argument Null Exception : ttfFont");return e.fontInternal instanceof di&&(i=e.fontInternal.ttfReader,e.setSymbols(t),r=i.convertString(t),e=tt.toUnicodeArray(r,!1),r=tt.byteToString(e)),r},S.prototype.justifyLine=function(t,e,i){var r=t.text,n=t.width,t=this.shouldJustify(t,e,i),o=null!=i&&0!==i.wordSpacing,s=Pt.spaces,r=Pt.getCharsCount(r,s),s=0;return t?(o&&(n-=r*i.wordSpacing),this.pdfStreamWriter.setWordSpacing(s=(e-n)/r)):o?this.pdfStreamWriter.setWordSpacing(i.wordSpacing):this.pdfStreamWriter.setWordSpacing(0),s},S.prototype.reset=function(t){this.canvasSize=t,this.streamWriter.clear(),this.initialize(),this.initializeCoordinates()},S.prototype.shouldJustify=function(t,e,i){var r=t.text,n=t.width,o=null!=i&&i.alignment===Y.PdfTextAlignment.Justify,n=0<=e&&n<e,e=Pt.spaces,e=0<Pt.getCharsCount(r,e)&&r[0]!==Pt.whiteSpace,r=0<(t.lineType&Y.LineType.LayoutBreak)||i&&i.wordWrap===Y.PdfWordWrapType.None;return o&&n&&e&&r},S.prototype.underlineStrikeoutText=function(t,e,i,r,n,o){if(r.underline||r.strikeout){var s=this.createUnderlineStikeoutPen(t,e,r,o);if(null!=s){for(var t=this.getTextVerticalAlignShift(i.actualSize.height,n.height,o),a=0,a=n.y+t+r.metrics.getAscent(o)+1.5*s.width,h=n.y+t+r.metrics.getHeight(o)/2+1.5*s.width,l=i.lines,u=0,c=i.lineCount;u<c;u++){var p,d=l[u],f=(d.text,d.width),g=this.getHorizontalAlignShift(f,n.width,o),m=this.getLineIndent(d,o,n,0===u),g=(g+=this.rightToLeft(o)?0:m,n.x+g),d=this.shouldJustify(d,n.width,o)?g+n.width-m:g+f-m;r.underline&&(p=a,this.drawLine(s,g,p,d,p),a+=i.lineHeight),r.strikeout&&(p=h,this.drawLine(s,g,p,d,p),h+=i.lineHeight),this.isPointOverload&&1<l.length&&(n.x=0,n.width=this.clientSize.width)}this.isPointOverload=!1}}},S.prototype.createUnderlineStikeoutPen=function(t,e,i,r){i=i.metrics.getSize(r)/20,r=null;return null!=t?r=new ne(t.color,i):null!=e&&(r=new ne(e,i)),r},S.prototype.getTextRenderingMode=function(t,e,i){var r=Y.TextRenderingMode.None,r=null!=t&&null!=e?Y.TextRenderingMode.FillStroke:null!=t?Y.TextRenderingMode.Stroke:Y.TextRenderingMode.Fill;return null!=i&&i.clipPath&&(r|=Y.TextRenderingMode.ClipFlag),r},S.prototype.getLineIndent=function(t,e,i,r){var n=0,t=0<(t.lineType&Y.LineType.FirstParagraphLine);return null!=e&&t&&(n=r?e.firstLineIndent:e.paragraphIndent,n=0<i.width?Math.min(i.width,n):n),n},S.prototype.getHorizontalAlignShift=function(t,e,i){var r=0;if(0<=e&&null!=i&&i.alignment!==Y.PdfTextAlignment.Left)switch(i.alignment){case Y.PdfTextAlignment.Center:r=(e-t)/2;break;case Y.PdfTextAlignment.Right:r=e-t}return r},S.prototype.rightToLeft=function(t){var e=null!=t&&t.rightToLeft;return e=null!=t&&t.textDirection!==Y.PdfTextDirection.None&&void 0!==t.textDirection?!0:e},S.prototype.stateControl=function(t,e,i,r){void 0===r?this.stateControl(t,e,i,null):(e instanceof xi&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),e instanceof Ii&&(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace),null!==e?(void 0!==this.pageLayer&&null!=this.pageLayer&&!1===this.colorSpaceChanged&&(this.lastDocumentCS=this.pageLayer.page.document.colorSpace,this.lastGraphicsCS=this.pageLayer.page.graphics.colorSpace,this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace,this.colorSpaceChanged=!0),this.initCurrentColorSpace(this.currentColorSpace)):null!=t&&(void 0!==this.pageLayer&&null!=this.pageLayer&&(this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace),this.initCurrentColorSpace(this.currentColorSpace)),this.penControl(t,!1),this.brushControl(e,!1),this.fontControl(i,r,!1))},S.prototype.initCurrentColorSpace=function(t){this.getResources.getResources();this.bCSInitialized||(this.currentColorSpace!=Y.PdfColorSpace.GrayScale?(this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!0),this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!1)):(this.pdfStreamWriter.setColorSpace("DeviceGray",!0),this.pdfStreamWriter.setColorSpace("DeviceGray",!1)),this.bCSInitialized=!0)},S.prototype.penControl=function(t,e){null!=t&&((this.currentPen=t).monitorChanges(this.currentPen,this.pdfStreamWriter,this.getResources,e,this.colorSpace,this.matrix.clone()),this.currentPen=t.clone())},S.prototype.brushControl=function(t,e){var i,r,n,o;null!=t&&void 0!==t&&(null==(r=i=t.clone())||t instanceof mt||t instanceof Ii||(n=r.matrix,o=this.matrix.clone(),null!=n&&(n.multiply(o),o=n),r.matrix=o),this.currentBrush=r,i.monitorChanges(this.currentBrush,this.pdfStreamWriter,this.getResources,e,this.colorSpace),this.currentBrush=t)},S.prototype.fontControl=function(t,e,i){var r,n;null!=t&&(r=null!=e?e.subSuperScript:Y.PdfSubSuperScript.None,n=null!=this.currentStringFormat?this.currentStringFormat.subSuperScript:Y.PdfSubSuperScript.None,!i&&t===this.currentFont&&r===n||(i=this.getResources.getResources(),this.currentFont=t,this.currentStringFormat=e,r=t.metrics.getSize(e),this.isEmfTextScaled=!1,n=i.getName(t),this.pdfStreamWriter.setFont(t,n,r)))},S.prototype.setTransparency=function(t,e,i){var r,n;void 0===e?(this.istransparencySet=!0,this.setTransparency(t,t,Y.PdfBlendMode.Normal)):"number"==typeof e&&void 0===i?this.setTransparency(t,e,Y.PdfBlendMode.Normal):(null==this.trasparencies&&(this.trasparencies=new ce),r=null,n=new Ui(t,e,i),null==(r=this.trasparencies.containsKey(n)?this.trasparencies.getValue(n):r)&&(r=new de(t,e,i),this.trasparencies.setValue(n,r)),t=this.getResources.getResources().getName(r),this.streamWriter.setGraphicsState(t))},S.prototype.clipTranslateMargins=function(t,e,i,r,n,o){t instanceof Z&&void 0===e?(this.clipBounds=t,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(t),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t.x,t.y)):"number"==typeof t&&(i=new Z(i,r,this.size.width-i-n,this.size.height-r-o),this.clipBounds=i,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(i),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t,e))},S.prototype.updateY=function(t){return-t},S.prototype.translateTransform=function(t,e){var i=new se;this.getTranslateTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},S.prototype.getTranslateTransform=function(t,e,i){return i.translate(t,this.updateY(e)),i},S.prototype.scaleTransform=function(t,e){var i=new se;this.getScaleTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},S.prototype.getScaleTransform=function(t,e,i){return(i=null==i?new se:i).scale(t,e),i},S.prototype.rotateTransform=function(t){var e=new se;this.getRotateTransform(t,e),this.pdfStreamWriter.modifyCtm(e),this.matrix.multiply(e)},S.prototype.initializeCoordinates=function(){this.pdfStreamWriter.writeComment("Change co-ordinate system to left/top."),this.mediaBoxUpperRightBound!==-this.size.height&&null==this.cropBox&&(this.mediaBoxUpperRightBound===this.size.height||0===this.mediaBoxUpperRightBound?this.translateTransform(0,this.updateY(this.size.height)):this.translateTransform(0,this.updateY(this.mediaBoxUpperRightBound)))},S.prototype.getRotateTransform=function(t,e){return(e=null!=e&&void 0!==e?e:new se).rotate(this.updateY(t)),e},S.prototype.save=function(){var t=new _i(this,this.matrix.clone());return t.brush=this.currentBrush,t.pen=this.currentPen,t.font=this.currentFont,t.colorSpace=this.currentColorSpace,t.characterSpacing=this.previousCharacterSpacing,t.wordSpacing=this.previousWordSpacing,t.textScaling=this.previousTextScaling,t.textRenderingMode=this.previousTextRenderingMode,this.graphicsState.push(t),this.pdfStreamWriter.saveGraphicsState(),t},S.prototype.restore=function(t){if(void 0===t)0<this.graphicsState.length&&this.doRestoreState();else if(-1!==this.graphicsState.indexOf(t))for(;0!==this.graphicsState.length;)if(this.doRestoreState()===t)break},S.prototype.doRestoreState=function(){var t=this.graphicsState.pop();return this.transformationMatrix=t.matrix,this.currentBrush=t.brush,this.currentPen=t.pen,this.currentFont=t.font,this.currentColorSpace=t.colorSpace,this.previousCharacterSpacing=t.characterSpacing,this.previousWordSpacing=t.wordSpacing,this.previousTextScaling=t.textScaling,this.previousTextRenderingMode=t.textRenderingMode,this.pdfStreamWriter.restoreGraphicsState(),t},S.prototype.drawPath=function(t,e,i){this._drawPath(t,e,i.pathPoints,i.pathTypes,i.fillMode)},S.prototype._drawPath=function(t,e,i,r,n){e instanceof Ii?(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace):e instanceof xi&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),this.stateControl(t,e,null),this.buildUpPath(i,r),this.drawPathHelper(t,e,n,!1)},S.prototype.drawArc=function(t,e,i,r,n,o,s){e instanceof Z?this.drawArc(t,e.x,e.y,e.width,e.height,i,r):0!==s&&(this.stateControl(t,null,null),this.constructArcPath(e,i,e+r,i+n,o,s),this.drawPathHelper(t,null,!1))},S.prototype.buildUpPath=function(t,e){for(var i=t.length,r=0;r<i;++r){var n,o=t[r];switch(e[r]&S.pathTypesValuesMask){case Y.PathPointType.Start:this.pdfStreamWriter.beginPath(o.x,o.y);break;case Y.PathPointType.Bezier3:var s=new J(0,0),a=new J(0,0),s=this.getBezierPoints(t,e,r,s,a);this.pdfStreamWriter.appendBezierSegment(o,s.p2,s.p3),r=s.i;break;case Y.PathPointType.Line:this.pdfStreamWriter.appendLineSegment(o);break;default:throw new Error("ArithmeticException - Incorrect path formation.")}n=e[r],this.checkFlags(n)}},S.prototype.getBezierPoints=function(t,e,i,r,n){if((e[++i]&S.pathTypesValuesMask)!==Y.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");if(r=t[i],(e[++i]&S.pathTypesValuesMask)!==Y.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");return{i:i,p2:r,p3:t[i]}},S.prototype.checkFlags=function(t){(t&Y.PathPointType.CloseSubpath)===Y.PathPointType.CloseSubpath&&this.pdfStreamWriter.closePath()},S.prototype.constructArcPath=function(t,e,i,r,n,o){var s=this.getBezierArc(t,e,i,r,n,o);if(0!==s.length)for(var a=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]],h=(this.pdfStreamWriter.beginPath(a[0],a[1]),0),h=0;h<s.length;h+=8)a=[s[h],s[h+1],s[h+2],s[h+3],s[h+4],s[h+5],s[h+6],s[h+7]],this.pdfStreamWriter.appendBezierSegment(a[2],a[3],a[4],a[5],a[6],a[7])},S.prototype.getBezierArc=function(t,e,i,r,n,o){i<t&&(p=void 0,p=t,t=i,i=p),e<r&&(p=void 0,p=e,e=r,r=p),Math.abs(o)<=90?(s=o,a=1):s=o/(a=Math.ceil(Math.abs(o)/90));for(var s,a,h=(t+i)/2,l=(e+r)/2,u=(i-t)/2,c=(r-e)/2,p=s*(Math.PI/360),d=Math.abs(4/3*(1-Math.cos(p))/Math.sin(p)),f=[],g=0;g<a;g++){var m=(n+g*s)*(Math.PI/180),y=(n+(g+1)*s)*(Math.PI/180),b=Math.cos(m),w=Math.cos(y),m=Math.sin(m),y=Math.sin(y);0<s?f.push(h+u*b,l-c*m,h+u*(b-d*m),l-c*(m+d*b),h+u*(w+d*y),l-c*(y-d*w),h+u*w,l-c*y):f.push(h+u*b,l-c*m,h+u*(b+d*m),l-c*(m-d*b),h+u*(w-d*y),l-c*(y+d*w),h+u*w,l-c*y)}return f},S.pathTypesValuesMask=15,S.transparencyObject=!1;var Gi=S;function S(t,e,i){this.currentColorSpace=Y.PdfColorSpace.Rgb,this.previousTextRenderingMode=Y.TextRenderingMode.Fill,this.previousCharacterSpacing=0,this.previousWordSpacing=0,this.previousTextScaling=100,this.procedureSets=new ue,this.isNormalRender=!0,this.isUseFontSize=!1,this.isItalic=!1,this.isEmfTextScaled=!1,this.isEmf=!1,this.isEmfPlus=!1,this.isBaselineFormat=!0,this.emfScalingFactor=new X(0,0),this.colorSpaceChanged=!1,this.dictionaryProperties=new l,this.isOverloadWithPosition=!1,this.isPointOverload=!1,this.currentColorSpaces=["RGB","CMYK","GrayScale","Indexed"],this.isImageOptimized=!1,this.graphicsState=[],this.istransparencySet=!1,this.internalAutomaticFields=null,this.startCutIndex=-1,this.getResources=e,this.canvasSize=t,i instanceof re?this.pdfStreamWriter=i:this.pdfStreamWriter=new re(i),this.initialize()}Wi.prototype.getResources=function(){return this.sender.getResources()};var zi=Wi;function Wi(t){this.sender=t}Object.defineProperty(Hi.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"matrix",{get:function(){return this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"characterSpacing",{get:function(){return this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"wordSpacing",{get:function(){return this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"textScaling",{get:function(){return this.internalTextScaling},set:function(t){this.internalTextScaling=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hi.prototype,"textRenderingMode",{get:function(){return this.internalTextRenderingMode},set:function(t){this.internalTextRenderingMode=t},enumerable:!0,configurable:!0});var _i=Hi;function Hi(t,e){var i;this.internalTextRenderingMode=Y.TextRenderingMode.Fill,this.internalCharacterSpacing=0,this.internalWordSpacing=0,this.internalTextScaling=100,this.pdfColorSpace=Y.PdfColorSpace.Rgb,void 0!==t&&(this.pdfGraphics=t,i=[],t.matrix.matrix.elements.forEach(function(t){i.push(t)}),this.transformationMatrix=new se,this.transformationMatrix.matrix=new he(i))}var Ui=function(t,e,i){this.alphaPen=t,this.alphaBrush=e,this.blendMode=i},Ki=(Object.defineProperty(qi.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(qi.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(qi.prototype,"layerId",{get:function(){return this.layerid},set:function(t){this.layerid=t},enumerable:!0,configurable:!0}),Object.defineProperty(qi.prototype,"name",{get:function(){return this.layerName},set:function(t){this.layerName=t},enumerable:!0,configurable:!0}),Object.defineProperty(qi.prototype,"visible",{get:function(){return this.isVisible},set:function(t){this.isVisible=t},enumerable:!0,configurable:!0}),Object.defineProperty(qi.prototype,"graphics",{get:function(){return null==this.pdfGraphics&&this.initializeGraphics(this.page),this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(qi.prototype,"layers",{get:function(){return null==this.layer&&(this.layer=new Zi(this.page),this.layer.sublayer=!0),this.layer},enumerable:!0,configurable:!0}),qi.prototype.add=function(){var t=new qi(this.pdfPage);return t.name="",t},qi.prototype.sign=function(t){return 0===t?0:0<t?1:-1},qi.prototype.initializeGraphics=function(t){var e=t,i=new zi(this.page),i=(this.pdfGraphics=new Gi(t.size,i,this.content),this.pdfGraphics.mediaBoxUpperRightBound=0,null!=e&&null!=(i=e.section.parent)&&(this.pdfGraphics.colorSpace=i.document.colorSpace,this.colorSpace=i.document.colorSpace),this.sign(t.origin.y)===this.sign(t.origin.x)),i=((0<=t.origin.x&&0<=t.origin.y||!i)&&this.pdfGraphics.initializeCoordinates(),e.section.getActualBounds(e,!0)),e=e.section.pageSettings.margins;this.clipPageTemplates?0<=t.origin.x&&0<=t.origin.y&&this.pdfGraphics.clipTranslateMargins(i):this.graphics.clipTranslateMargins(i.x,i.y,e.left,e.top,e.right,e.bottom),this.pdfGraphics.setLayer(this)},Object.defineProperty(qi.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0}),qi);function qi(t,e){if(this.pdfColorSpace=Y.PdfColorSpace.Rgb,this.isVisible=!0,this.sublayer=!1,this.contentLength=0,this.dictionaryProperties=new l,null===t)throw new Error("ArgumentNullException:page");if(this.pdfPage=t,this.clipPageTemplates=!0,void 0===e)this.content=new U;else if(e instanceof U||null===e){if(null===e)throw new Error("ArgumentNullException:stream");this.content=e}else this.content=new U,this.clipPageTemplates=e}Object.defineProperty(Yi.prototype,"count",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection.length},enumerable:!0,configurable:!0}),Object.defineProperty(Yi.prototype,"list",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection},enumerable:!0,configurable:!0});w=Yi;function Yi(){}Ji=function(t,e){return(Ji=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ji(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})($i,Xi=w),$i.prototype.items=function(t,e){if("number"==typeof t&&void 0===e)return this.list[t];if(null==e)throw new Error("ArgumentNullException: layer");if(e.page!==this.page)throw new Error("ArgumentException: The layer belongs to another page")},$i.prototype.add=function(t,e){var i;return void 0===t?((i=new Ki(this.page)).name="",this.add(i),i):t instanceof Ki?(i=this.list.push(t),this.addLayer(i,t),i):0},$i.prototype.addLayer=function(t,e){e=new d(e);this.page.contents.add(e)},$i.prototype.insert=function(t,e){for(var i=[],r=this.list.length,n=t;n<r;n++)i.push(this.list.pop());this.list.push(e);for(n=0;n<i.length;n++)this.list.push(i[n]);this.insertLayer(t,e)},$i.prototype.insertLayer=function(t,e){if(null==e)throw new Error("ArgumentNullException:layer");e=new d(e);this.page.contents.insert(t,e)},$i.prototype.parseLayers=function(t){var e=this.page.contents,t=(this.page.getResources(),t.crossTable,new U),i=new U,r=[];r.push("q"),t.data=r,e.insert(0,new d(t)),(r=[]).push("Q"),i.data=r,e.insert(e.count,new d(i))},$i.prototype.indexOf=function(t){if(null==t)throw new Error("ArgumentNullException: layer");return this.list.indexOf(t)};var Ji,Xi,Zi=$i;function $i(t){var e=Xi.call(this)||this;return e.parentLayerCount=0,e.sublayer=!1,e.optionalContent=new c,t instanceof Qi&&(e.page=t,e.parseLayers(t)),e}Object.defineProperty(tr.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"dictionary",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"element",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"defaultLayer",{get:function(){var t=this.layers,e=this.defaultLayerIndex;return t.items(e)},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"defaultLayerIndex",{get:function(){var t;return 0!==this.layerCollection.count&&-1!==this.defLayerIndex||(t=this.layerCollection.add(),this.defLayerIndex=this.layerCollection.indexOf(t)),this.defLayerIndex},set:function(t){if(t<0||t>this.layers.count-1)throw new Error("ArgumentOutOfRangeException : value, Index can not be less 0 and greater Layers.Count - 1");this.defLayerIndex=t,this.modified=!0},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"layers",{get:function(){return null!=this.layerCollection&&void 0!==this.layerCollection||(this.layerCollection=new Zi(this)),this.layerCollection},enumerable:!0,configurable:!0}),tr.prototype.getResources=function(){return null==this.resources&&(this.resources=new Ri,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},Object.defineProperty(tr.prototype,"contents",{get:function(){var t=this.pageDictionary.items.getValue(this.dictionaryProperties.contents);return null==t&&(t=new p,this.pageDictionary.items.setValue(this.dictionaryProperties.contents,t)),t},enumerable:!0,configurable:!0}),tr.prototype.setResources=function(t){this.resources=t,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources),this.modified=!0};var Qi=tr;function tr(t){this.defLayerIndex=-1,this.modified=!1,this.dictionaryProperties=new l,this.pageDictionary=t}Object.defineProperty(ir.prototype,"annotations",{get:function(){return this.internalAnnotations},set:function(t){this.internalAnnotations=t},enumerable:!0,configurable:!0}),ir.prototype.add=function(t){this.doAdd(t)},ir.prototype.doAdd=function(t){if(void 0===t.destination)return t.setPage(this.page),this.internalAnnotations.add(new d(t)),this.lists.push(t);var e=(new vt).layout(t.text,t.font,t.stringFormat,new X(t.bounds.width,0),!1,new X(0,0)),i=t.bounds.y;if(1===e.lines.length){var r=t.font.measureString(e.lines[0].text);t.bounds=new Z(new J(t.bounds.x,i),r),t.text=e.lines[0].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,t.bounds.y,t.bounds.width,t.bounds.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new d(t)),this.lists.push(t)}else for(var n=0;n<e.lines.length;n++){var o,r=t.font.measureString(e.lines[n].text);0===n?(t.bounds=new Z(t.bounds.x,i,r.width,r.height),t.text=e.lines[n].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,i,r.width,r.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new d(t)),this.lists.push(t),i+=t.bounds.height):((o=t.clone()).bounds=new Z(new J(t.bounds.x,i),r),o.text=e.lines[n].text,this.page.graphics.drawString(o.text,o.font,null,o.brush,o.bounds.x,o.bounds.y,o.bounds.width,o.bounds.height,null),o.setPage(this.page),this.setColor(o),this.internalAnnotations.add(new d(o)),this.lists.push(o),i+=o.bounds.height)}},ir.prototype.setColor=function(t){var e=Y.PdfColorSpace.Rgb,e=t.color.toArray(e);t.dictionary.items.setValue(this.dictionaryProperties.c,e)},Object.defineProperty(ir.prototype,"element",{get:function(){return this.internalAnnotations},enumerable:!0,configurable:!0});var er=ir;function ir(t){this.alreadyExistsAnnotationError="This annotatation had been already added to page",this.missingAnnotationException="Annotation is not contained in collection.",this.dictionaryProperties=new l,this.internalAnnotations=new p,this.lists=[],void 0!==t&&(this.page=t)}rr=function(t,e){return(rr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}rr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(sr,nr=Qi),Object.defineProperty(sr.prototype,"document",{get:function(){return null!==this.section&&null!==this.section.parent?this.section.parent.document:null},enumerable:!0,configurable:!0}),Object.defineProperty(sr.prototype,"graphics",{get:function(){var t=this.defaultLayer.graphics;return t.currentPage=this,t},enumerable:!0,configurable:!0}),Object.defineProperty(sr.prototype,"crossTable",{get:function(){if(null===this.section)throw new Error("PdfDocumentException : Page is not created");return(null===this.section.parent?this.section.parentDocument:this.section.parent.document).crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(sr.prototype,"size",{get:function(){return this.section.pageSettings.size},enumerable:!0,configurable:!0}),Object.defineProperty(sr.prototype,"origin",{get:function(){return this.section.pageSettings.origin},enumerable:!0,configurable:!0}),Object.defineProperty(sr.prototype,"annotations",{get:function(){return null==this.annotationCollection&&(this.annotationCollection=new er(this),this.dictionary.items.setValue(this.dictionaryProperties.annots,this.annotationCollection.element),this.annotationCollection.annotations=this.dictionary.items.getValue(this.dictionaryProperties.annots)),this.annotationCollection},enumerable:!0,configurable:!0}),sr.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o("Page")),this.dictionary.pageBeginDrawTemplate=new z(this)},sr.prototype.setSection=function(t){this.section=t,this.dictionary.items.setValue(this.dictionaryProperties.parent,new d(t))},sr.prototype.resetProgress=function(){this.isProgressOn=!1},sr.prototype.getClientSize=function(){var t=this.section.getActualBounds(this,!0);return new X(t.width,t.height)},sr.prototype.pageBeginSave=function(){var t=this.document;null!=t&&this.drawPageTemplates(t),null!=this.beginSave&&void 0!==this.beginSave&&this.beginSave(this)},sr.prototype.drawPageTemplates=function(t){var e;if(this.section.containsTemplates(t,this,!1)){var i=new Ki(this,!1);if(this.layers.insert(0,i),this.section.drawTemplates(this,i,t,!1),null!==i.graphics&&void 0!==i.graphics)for(var r=0;r<i.graphics.automaticFields.automaticFields.length;r++){var n=i.graphics.automaticFields.automaticFields[r];n.field.performDraw(i.graphics,n.location,n.scalingX,n.scalingY)}}this.section.containsTemplates(t,this,!0)&&(e=new Ki(this,!1),this.layers.add(e),this.section.drawTemplates(this,e,t,!0))};var rr,nr,or=sr;function sr(){var t=nr.call(this,new c)||this;return t.annotationCollection=null,t.beginSave=null,t.initialize(),t}Object.defineProperty(hr.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0});var ar=hr;function hr(t){this.pdfPage=void 0!==t?t:null}Object.defineProperty(ur.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),ur.prototype.contains=function(t){return this.section.contains(t)},ur.prototype.remove=function(t){this.section.remove(t)},ur.prototype.add=function(){return this.section.add()};var lr=ur;function ur(t){if((this.pdfSection=null)==t)throw Error('ArgumentNullException("section")');this.section=t}Object.defineProperty(pr.prototype,"left",{get:function(){return this.leftTemplate},set:function(t){this.leftTemplate=this.checkElement(t,Y.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"top",{get:function(){return this.topTemplate},set:function(t){this.topTemplate=this.checkElement(t,Y.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"right",{get:function(){return this.rightTemplate},set:function(t){this.rightTemplate=this.checkElement(t,Y.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"bottom",{get:function(){return this.bottomTemplate},set:function(t){this.bottomTemplate=this.checkElement(t,Y.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"EvenLeft",{get:function(){return this.evenLeft},set:function(t){this.evenLeft=this.checkElement(t,Y.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"EvenTop",{get:function(){return this.evenTop},set:function(t){this.evenTop=this.checkElement(t,Y.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"EvenRight",{get:function(){return this.evenRight},set:function(t){this.evenRight=this.checkElement(t,Y.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"EvenBottom",{get:function(){return this.evenBottom},set:function(t){this.evenBottom=this.checkElement(t,Y.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"OddLeft",{get:function(){return this.oddLeft},set:function(t){this.oddLeft=this.checkElement(t,Y.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"OddTop",{get:function(){return this.oddTop},set:function(t){this.oddTop=this.checkElement(t,Y.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"OddRight",{get:function(){return this.oddRight},set:function(t){this.oddRight=this.checkElement(t,Y.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(pr.prototype,"OddBottom",{get:function(){return this.oddBottom},set:function(t){this.oddBottom=this.checkElement(t,Y.TemplateType.Bottom)},enumerable:!0,configurable:!0}),pr.prototype.getLeft=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenLeft?this.EvenLeft:this.left:null!=this.OddLeft?this.OddLeft:this.left},pr.prototype.getTop=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenTop?this.EvenTop:this.top:null!=this.OddTop?this.OddTop:this.top},pr.prototype.getRight=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenRight?this.EvenRight:this.right:null!=this.OddRight?this.OddRight:this.right},pr.prototype.getBottom=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenBottom?this.EvenBottom:this.bottom:null!=this.OddBottom?this.OddBottom:this.bottom},pr.prototype.isEven=function(t){var e=t.section.document.pages;return(e.pageCollectionIndex.containsKey(t)?e.pageCollectionIndex.getValue(t)+1:e.indexOf(t)+1)%2==0},pr.prototype.checkElement=function(t,e){if(null!=t){if(void 0!==t.type&&t.type!==Y.TemplateType.None)throw new Error("NotSupportedException:Can not reassign the template element. Please, create new one.");t.type=e}return t};var cr=pr;function pr(){}dr=function(t,e){return(dr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}dr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(mr,fr=cr),Object.defineProperty(mr.prototype,"applyDocumentLeftTemplate",{get:function(){return this.leftValue},set:function(t){this.leftValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(mr.prototype,"applyDocumentTopTemplate",{get:function(){return this.topValue},set:function(t){this.topValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(mr.prototype,"applyDocumentRightTemplate",{get:function(){return this.rightValue},set:function(t){this.rightValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(mr.prototype,"applyDocumentBottomTemplate",{get:function(){return this.bottomValue},set:function(t){this.bottomValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(mr.prototype,"applyDocumentStamps",{get:function(){return this.stampValue},set:function(t){this.stampValue=t},enumerable:!0,configurable:!0});var dr,fr,gr=mr;function mr(){var t=fr.call(this)||this;return t.leftValue=t.topValue=t.rightValue=t.bottomValue=t.stampValue=!0,t}Object.defineProperty(v.prototype,"parent",{get:function(){return this.sectionCollection},set:function(t){this.sectionCollection=t,this.section.items.setValue(this.dictionaryProperties.parent,new d(t))},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"parentDocument",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"pageSettings",{get:function(){return this.settings},set:function(t){if(null==t)throw Error("Value can not be null.");this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"element",{get:function(){return this.section},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"count",{get:function(){return this.pagesReferences.count},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new gr),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"document",{get:function(){return this.sectionCollection.document},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"pages",{get:function(){return null!=this.pagesCollection&&void 0!==this.pagesCollection||(this.pagesCollection=new lr(this)),this.pagesCollection},enumerable:!0,configurable:!0}),v.prototype.getPages=function(){return this.pdfPages},v.prototype.pointToNativePdf=function(t,e){t=this.getActualBounds(t,!0);return e.x+=t.x,e.y=this.pageSettings.height-e.y,e},v.prototype.setPageSettings=function(t){this.settings=t,this.state.orientation=t.orientation,this.state.rotate=t.rotate,this.state.size=t.size,this.state.origin=t.origin},v.prototype.initialize=function(){this.pagesReferences=new p,this.section=new c,this.state=new br(this.pdfDocument),this.section.sectionBeginSave=new G(this,this.state),this.pageCount=new u(0),this.section.items.setValue(this.dictionaryProperties.count,this.pageCount),this.section.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.pages)),this.section.items.setValue(this.dictionaryProperties.kids,this.pagesReferences)},v.prototype.containsTemplates=function(t,e,i){t=this.getDocumentTemplates(t,e,i),e=this.getSectionTemplates(e,i);return 0<t.length||0<e.length},v.prototype.getDocumentTemplates=function(t,e,i){var r=[];return this.template.applyDocumentTopTemplate&&null!=t.template.getTop(e)&&(!t.template.getTop(e).foreground&&!i||t.template.getTop(e).foreground&&i)&&r.push(t.template.getTop(e)),this.template.applyDocumentBottomTemplate&&null!=t.template.getBottom(e)&&(!t.template.getBottom(e).foreground&&!i||t.template.getBottom(e).foreground&&i)&&r.push(t.template.getBottom(e)),this.template.applyDocumentLeftTemplate&&null!=t.template.getLeft(e)&&(!t.template.getLeft(e).foreground&&!i||t.template.getLeft(e).foreground&&i)&&r.push(t.template.getLeft(e)),this.template.applyDocumentRightTemplate&&null!=t.template.getRight(e)&&(!t.template.getRight(e).foreground&&!i||t.template.getRight(e).foreground&&i)&&r.push(t.template.getRight(e)),r},v.prototype.getSectionTemplates=function(t,e){var i,r=[];return null!=this.template.getTop(t)&&(!(i=this.template.getTop(t)).foreground&&!e||i.foreground&&e)&&r.push(i),null!=this.template.getBottom(t)&&(!(i=this.template.getBottom(t)).foreground&&!e||i.foreground&&e)&&r.push(i),null!=this.template.getLeft(t)&&(!(i=this.template.getLeft(t)).foreground&&!e||i.foreground&&e)&&r.push(i),null!=this.template.getRight(t)&&(!(i=this.template.getRight(t)).foreground&&!e||i.foreground&&e)&&r.push(i),r},v.prototype.add=function(t){var e;if(void 0===t)return e=new or,this.add(e),e;e=this.checkPresence(t),this.pdfPages.push(t),this.pagesReferences.add(e),t.setSection(this),t.resetProgress(),this.pageAddedMethod(t)},v.prototype.checkPresence=function(t){for(var e=new d(t),i=!1,r=this.parent,n=0;n<r.section.length;n++)var o=r.section[n],i=i||o.contains(t);return e},v.prototype.contains=function(t){return 0<=this.indexOf(t)},v.prototype.indexOf=function(t){for(var e=0;e<this.pdfPages.length;e++)if(this.pdfPages[e]===t)return this.pdfPages.indexOf(t);var i=new d(t);return this.pagesReferences.indexOf(i)},v.prototype.pageAddedMethod=function(t){t=new ar(t);this.onPageAdded(t),this.parent.document.pages.onPageAdded(t),this.pageCount.intValue=this.count},v.prototype.onPageAdded=function(t){},v.prototype.getActualBounds=function(t,e,i){var r,n,o,s;return t instanceof or&&"boolean"==typeof e?(r=this.parent.document,this.getActualBounds(r,t,e)):((r=new Z(0,0,0,0)).height=(i?this.pageSettings.size:this.pageSettings.getActualSize()).height,r.width=(i?this.pageSettings.size:this.pageSettings.getActualSize()).width,n=this.getLeftIndentWidth(t,e,i),o=this.getTopIndentHeight(t,e,i),s=this.getRightIndentWidth(t,e,i),t=this.getBottomIndentHeight(t,e,i),r.x+=n,r.y+=o,r.width-=n+s,r.height-=o+t,r)},v.prototype.getLeftIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.left:0,r=null!=this.template.getLeft(e)?this.template.getLeft(e).width:0,t=null!=t.template.getLeft(e)?t.template.getLeft(e).width:0;return i+=this.template.applyDocumentLeftTemplate?Math.max(r,t):r},v.prototype.getTopIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.top:0,r=null!=this.template.getTop(e)?this.template.getTop(e).height:0,t=null!=t.template.getTop(e)?t.template.getTop(e).height:0;return i+=this.template.applyDocumentTopTemplate?Math.max(r,t):r},v.prototype.getRightIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.right:0,r=null!=this.template.getRight(e)?this.template.getRight(e).width:0,t=null!=t.template.getRight(e)?t.template.getRight(e).width:0;return i+=this.template.applyDocumentRightTemplate?Math.max(r,t):r},v.prototype.getBottomIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.bottom:0,r=null!=this.template.getBottom(e)?this.template.getBottom(e).height:0,t=null!=t.template.getBottom(e)?t.template.getBottom(e).height:0;return i+=this.template.applyDocumentBottomTemplate?Math.max(r,t):r},v.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');for(var e=this.pdfPages.indexOf(t),i=(this.pagesReferences.removeAt(e),[]),r=0;r<e;r++)i.push(this.pdfPages[r]);for(r=e+1;r<this.pdfPages.length;r++)i.push(this.pdfPages[r]);this.pdfPages=i},v.prototype.applyPageSettings=function(t,e,i){var r=new Z(i.origin,i.size),r=(t.items.setValue(this.dictionaryProperties.mediaBox,p.fromRectangle(r)),Pr.rotateFactor*i.rotate),i=new u(r);t.items.setValue(this.dictionaryProperties.rotate,i)},v.prototype.beginSave=function(t,e){e=e.document;this.applyPageSettings(this.section,e.pageSettings,t)},v.prototype.drawTemplates=function(t,e,i,r){var n=this.getDocumentTemplates(i,t,r),t=this.getSectionTemplates(t,r);this.drawTemplatesHelper(e,i,n),this.drawTemplatesHelper(e,i,t)},v.prototype.drawTemplatesHelper=function(t,e,i){if(null!=i&&0<i.length)for(var r=i.length,n=0;n<r;n++)i[n].draw(t,e)};var yr=v;function v(t,e){this.pageAdded=new ar,this.pdfPages=[],this.dictionaryProperties=new l,this.pdfDocument=t,this.settings=(void 0===e?t.pageSettings:e).clone(),this.initialSettings=this.settings.clone(),this.initialize()}Object.defineProperty(wr.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation=t},enumerable:!0,configurable:!0}),Object.defineProperty(wr.prototype,"rotate",{get:function(){return this.pageRotate},set:function(t){this.pageRotate=t},enumerable:!0,configurable:!0}),Object.defineProperty(wr.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.pageSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(wr.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0});var br=wr;function wr(t){this.pageOrientation=t.pageSettings.orientation,this.pageRotate=t.pageSettings.rotate,this.pageSize=t.pageSettings.size,this.pageOrigin=t.pageSettings.origin}Object.defineProperty(Sr.prototype,"section",{get:function(){return this.sections},enumerable:!0,configurable:!0}),Object.defineProperty(Sr.prototype,"document",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(Sr.prototype,"count",{get:function(){return this.sections.length},enumerable:!0,configurable:!0}),Object.defineProperty(Sr.prototype,"element",{get:function(){return this.pages},enumerable:!0,configurable:!0}),Sr.prototype.initialize=function(){this.sectionCount=new u(0),this.sectionCollection=new p,this.pages=new c,this.pages.beginSave=new N(this),this.pages.items.setValue(this.dictionaryProperties.type,new o("Pages")),this.pages.items.setValue(this.dictionaryProperties.kids,this.sectionCollection),this.pages.items.setValue(this.dictionaryProperties.count,this.sectionCount),this.pages.items.setValue(this.dictionaryProperties.resources,new c),this.setPageSettings(this.pages,this.pdfDocument.pageSettings)},Sr.prototype.pdfSectionCollection=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException()");return this.sections[t]},Sr.prototype.setPageSettings=function(t,e){e=new Z(new J,e.size);t.items.setValue(this.dictionaryProperties.mediaBox,p.fromRectangle(e))},Sr.prototype.add=function(t){var e;return void 0===t?(e=new yr(this.pdfDocument),this.add(e),e):(e=this.checkSection(t),this.sections.push(t),(t.parent=this).sectionCollection.add(e),this.sections.indexOf(t))},Sr.prototype.checkSection=function(t){t=new d(t);this.sectionCollection.contains(t);return t},Sr.prototype.countPages=function(){var e=0;return this.sections.forEach(function(t){return e+=t.count}),e},Sr.prototype.beginSave=function(){this.sectionCount.intValue=this.countPages()},Sr.rotateFactor=90;var Pr=Sr;function Sr(t){this.sections=[],this.dictionaryProperties=new l,this.pdfDocument=t.clone(),this.initialize()}Object.defineProperty(Cr.prototype,"count",{get:function(){return this.countPages()},enumerable:!0,configurable:!0}),Object.defineProperty(Cr.prototype,"pageCollectionIndex",{get:function(){return this.pdfPageCollectionIndex},enumerable:!0,configurable:!0}),Cr.prototype.add=function(t){var e;if(void 0===t)return e=new or,this.add(e),e;this.getLastSection().add(t)},Cr.prototype.getLastSection=function(){var t=this.document.sections;return 0===t.section.length&&t.add(),t.section[t.section.length-1]},Cr.prototype.onPageAdded=function(t){},Cr.prototype.countPages=function(){for(var t=this.document.sections,e=0,i=0;i<t.section.length;i++)e+=t.section[i].count;return e},Cr.prototype.getPageByIndex=function(t){return this.getPage(t)},Cr.prototype.getPage=function(t){if(t<0||t>=this.count)throw Error('ArgumentOutOfRangeException("index", "Value can not be less 0")');for(var e=null,i=0,r=this.document.sections.count,n=0;n<r;n++){var o=this.document.sections.section[n],s=o.count,a=t-i;if(i<=t&&a<s){e=o.getPages()[a];break}i+=s}return e},Cr.prototype.indexOf=function(t){var e=-1;if(null==t)throw new Error("ArgumentNullException: page");for(var i=0,r=0,n=this.document.sections.count;r<n;r++){var o=this.document.sections.pdfSectionCollection(r);if(0<=(e=o.indexOf(t))){e+=i;break}e=-1,i+=o.count}return e},Cr.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');for(var e=null,i=0,r=this.document.sections.count;i<r;i++)if((e=this.document.sections.pdfSectionCollection(i)).pages.contains(t)){e.pages.remove(t);break}return e};var vr=Cr;function Cr(t){this.pdfPageCollectionIndex=new a,this.document=t}Or.prototype.search=function(t){var e=null,i=this.getGroup(t);return null==i?i=this.createNewGroup():0<i.length&&(e=i[0]),i.push(t),e},Or.prototype.createNewGroup=function(){var t=[];return this.referenceObjects.push(t),t},Or.prototype.getGroup=function(t){var e=null;if(null!==t)for(var i=this.referenceObjects.length,r=0;r<i;r++){if(0<this.referenceObjects.length){var n=this.referenceObjects[r];if(0<n.length){var o=n[0];if(t.equalsTo(o)){e=n;break}}else this.removeGroup(n)}i=this.referenceObjects.length}return e},Or.prototype.removeGroup=function(t){null!==t&&(t=this.referenceObjects.indexOf(t),this.referenceObjects.slice(t,t+1))},Or.prototype.destroy=function(){this.pdfFontCollection=void 0,this.referenceObjects=void 0};var Br=Or;function Or(){this.referenceObjects=[],this.pdfFontCollection=new a}xr=function(t,e){return(xr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}xr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(jr,Lr=i),Object.defineProperty(jr,"defaultFont",{get:function(){return null==this.defaultStandardFont&&(this.defaultStandardFont=new Mr(Y.PdfFontFamily.Helvetica,8)),this.defaultStandardFont},enumerable:!0,configurable:!0}),Object.defineProperty(jr.prototype,"sections",{get:function(){return this.sectionCollection},enumerable:!0,configurable:!0}),Object.defineProperty(jr.prototype,"pageSettings",{get:function(){return null==this.settings&&(this.settings=new ee(this.defaultMargin)),this.settings},set:function(t){this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(jr.prototype,"pages",{get:function(){return this.documentPageCollection},enumerable:!0,configurable:!0}),Object.defineProperty(jr,"cache",{get:function(){return void 0===jr.cacheCollection||null==jr.cacheCollection?new Br:jr.cacheCollection},set:function(t){this.cacheCollection=t},enumerable:!0,configurable:!0}),Object.defineProperty(jr,"enableCache",{get:function(){return this.isCacheEnabled},set:function(t){this.isCacheEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(jr.prototype,"colorSpace",{get:function(){return this.pdfColorSpace===Y.PdfColorSpace.Rgb||this.pdfColorSpace===Y.PdfColorSpace.Cmyk||this.pdfColorSpace===Y.PdfColorSpace.GrayScale?this.pdfColorSpace:Y.PdfColorSpace.Rgb},set:function(t){t===Y.PdfColorSpace.Rgb||t===Y.PdfColorSpace.Cmyk||t===Y.PdfColorSpace.GrayScale?this.pdfColorSpace=t:this.pdfColorSpace=Y.PdfColorSpace.Rgb},enumerable:!0,configurable:!0}),Object.defineProperty(jr.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new cr),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),jr.prototype.docSave=function(t,e,i){if(this.checkPagesPresence(),null===t)throw new Error("ArgumentNullException : stream");this.streamWriter=t;t=new kt(t);if(t.document=this,"boolean"==typeof e&&void 0===i)return this.crossTable.save(t);this.crossTable.save(t,e)},jr.prototype._docSave=function(){var t=new Rt;if(this.checkPagesPresence(),null===t)throw new Error("ArgumentNullException : stream");this.streamWriter=t;t=new kt(t);return(t.document=this).crossTable._save(t)},jr.prototype.checkPagesPresence=function(){0===this.pages.count&&this.pages.add()},jr.prototype.destroy=function(){this.catalog=void 0,this.colorSpace=void 0,this.currentSavingObj=void 0,this.documentPageCollection=void 0,this.isStreamCopied=void 0,this.pageSettings=void 0,this.pageTemplate=void 0,this.pdfColorSpace=void 0,this.sectionCollection=void 0,jr.cache.destroy(),this.crossTable.pdfObjects.destroy(),jr.cache=void 0,this.streamWriter&&this.streamWriter.destroy()},jr.defaultStandardFont=null,jr.isCacheEnabled=!0;var xr,Lr,Tr=jr;function jr(t){var e=Lr.call(this)||this,i=(e.defaultMargin=40,e.streamWriter=null,e.document=e,!1),i=void 0===t?(jr.cacheCollection=new Br,!1):t,t=new Nt,r=(e.setMainObjectCollection(t),new Jt),i=(r.isMerging=i,(r.document=e).setCrossTable(r),new qt);return e.setCatalog(i),t.add(i),i.position=-1,e.sectionCollection=new Pr(e),e.documentPageCollection=new vr(e),i.pages=e.sectionCollection,e}C.getMetrics=function(t,e,i){var r=null;switch(t){case Y.PdfFontFamily.Helvetica:r=this.getHelveticaMetrics(t,e,i);break;case Y.PdfFontFamily.Courier:r=this.getCourierMetrics(t,e,i);break;case Y.PdfFontFamily.TimesRoman:r=this.getTimesMetrics(t,e,i);break;case Y.PdfFontFamily.Symbol:r=this.getSymbolMetrics(t,e,i);break;case Y.PdfFontFamily.ZapfDingbats:r=this.getZapfDingbatsMetrics(t,e,i);break;default:r=this.getHelveticaMetrics(Y.PdfFontFamily.Helvetica,e,i)}return r.name=t.toString(),r.subScriptSizeFactor=this.subSuperScriptFactor,r.superscriptSizeFactor=this.subSuperScriptFactor,r},C.getHelveticaMetrics=function(t,e,i){var r=new si;return 0<(e&Y.PdfFontStyle.Bold)&&0<(e&Y.PdfFontStyle.Italic)?(r.ascent=this.helveticaBoldItalicAscent,r.descent=this.helveticaBoldItalicDescent,r.postScriptName=this.helveticaBoldItalicName,r.size=i,r.widthTable=new ci(this.arialBoldWidth)):0<(e&Y.PdfFontStyle.Bold)?(r.ascent=this.helveticaBoldAscent,r.descent=this.helveticaBoldDescent,r.postScriptName=this.helveticaBoldName,r.size=i,r.widthTable=new ci(this.arialBoldWidth)):(0<(e&Y.PdfFontStyle.Italic)?(r.ascent=this.helveticaItalicAscent,r.descent=this.helveticaItalicDescent,r.postScriptName=this.helveticaItalicName):(r.ascent=this.helveticaAscent,r.descent=this.helveticaDescent,r.postScriptName=this.helveticaName),r.size=i,r.widthTable=new ci(this.arialWidth)),r.height=r.ascent-r.descent,r},C.getCourierMetrics=function(t,e,i){var r=new si;return 0<(e&Y.PdfFontStyle.Bold)&&0<(e&Y.PdfFontStyle.Italic)?(r.ascent=this.courierBoldItalicAscent,r.descent=this.courierBoldItalicDescent,r.postScriptName=this.courierBoldItalicName):0<(e&Y.PdfFontStyle.Bold)?(r.ascent=this.courierBoldAscent,r.descent=this.courierBoldDescent,r.postScriptName=this.courierBoldName):0<(e&Y.PdfFontStyle.Italic)?(r.ascent=this.courierItalicAscent,r.descent=this.courierItalicDescent,r.postScriptName=this.courierItalicName):(r.ascent=this.courierAscent,r.descent=this.courierDescent,r.postScriptName=this.courierName),r.size=i,r.widthTable=new ci(this.fixedWidth),r.height=r.ascent-r.descent,r},C.getTimesMetrics=function(t,e,i){var r=new si;return 0<(e&Y.PdfFontStyle.Bold)&&0<(e&Y.PdfFontStyle.Italic)?(r.ascent=this.timesBoldItalicAscent,r.descent=this.timesBoldItalicDescent,r.postScriptName=this.timesBoldItalicName,r.size=i,r.widthTable=new ci(this.timesRomanBoldItalicWidths)):0<(e&Y.PdfFontStyle.Bold)?(r.ascent=this.timesBoldAscent,r.descent=this.timesBoldDescent,r.postScriptName=this.timesBoldName,r.size=i,r.widthTable=new ci(this.timesRomanBoldWidth)):0<(e&Y.PdfFontStyle.Italic)?(r.ascent=this.timesItalicAscent,r.descent=this.timesItalicDescent,r.postScriptName=this.timesItalicName,r.size=i,r.widthTable=new ci(this.timesRomanItalicWidth)):(r.ascent=this.timesAscent,r.descent=this.timesDescent,r.postScriptName=this.timesName,r.size=i,r.widthTable=new ci(this.timesRomanWidth)),r.height=r.ascent-r.descent,r},C.getSymbolMetrics=function(t,e,i){var r=new si;return r.ascent=this.symbolAscent,r.descent=this.symbolDescent,r.postScriptName=this.symbolName,r.size=i,r.widthTable=new ci(this.symbolWidth),r.height=r.ascent-r.descent,r},C.getZapfDingbatsMetrics=function(t,e,i){var r=new si;return r.ascent=this.zapfDingbatsAscent,r.descent=this.zapfDingbatsDescent,r.postScriptName=this.zapfDingbatsName,r.size=i,r.widthTable=new ci(this.zapfDingbatsWidth),r.height=r.ascent-r.descent,r},C.subSuperScriptFactor=1.52,C.helveticaAscent=931,C.helveticaDescent=-225,C.helveticaName="Helvetica",C.helveticaBoldAscent=962,C.helveticaBoldDescent=-228,C.helveticaBoldName="Helvetica-Bold",C.helveticaItalicAscent=931,C.helveticaItalicDescent=-225,C.helveticaItalicName="Helvetica-Oblique",C.helveticaBoldItalicAscent=962,C.helveticaBoldItalicDescent=-228,C.helveticaBoldItalicName="Helvetica-BoldOblique",C.courierAscent=805,C.courierDescent=-250,C.courierName="Courier",C.courierBoldAscent=801,C.courierBoldDescent=-250,C.courierBoldName="Courier-Bold",C.courierItalicAscent=805,C.courierItalicDescent=-250,C.courierItalicName="Courier-Oblique",C.courierBoldItalicAscent=801,C.courierBoldItalicDescent=-250,C.courierBoldItalicName="Courier-BoldOblique",C.timesAscent=898,C.timesDescent=-218,C.timesName="Times-Roman",C.timesBoldAscent=935,C.timesBoldDescent=-218,C.timesBoldName="Times-Bold",C.timesItalicAscent=883,C.timesItalicDescent=-217,C.timesItalicName="Times-Italic",C.timesBoldItalicAscent=921,C.timesBoldItalicDescent=-218,C.timesBoldItalicName="Times-BoldItalic",C.symbolAscent=1010,C.symbolDescent=-293,C.symbolName="Symbol",C.zapfDingbatsAscent=820,C.zapfDingbatsDescent=-143,C.zapfDingbatsName="ZapfDingbats",C.arialWidth=[278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,0,556,0,222,556,333,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,222,222,333,333,350,556,1e3,333,1e3,500,333,944,0,500,667,0,333,556,556,556,556,260,556,333,737,370,556,584,0,737,333,400,584,333,333,333,556,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,584,611,556,556,556,556,500,556,500],C.arialBoldWidth=[278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,0,556,0,278,556,500,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,278,278,500,500,350,556,1e3,333,1e3,556,333,944,0,500,667,0,333,556,556,556,556,280,556,333,737,370,556,584,0,737,333,400,584,333,333,333,611,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,584,611,611,611,611,611,556,611,556],C.fixedWidth=[600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600],C.timesRomanWidth=[250,333,408,500,500,833,778,180,333,333,500,564,250,333,250,278,500,500,500,500,500,500,500,500,500,500,278,278,564,564,564,444,921,722,667,667,722,611,556,722,722,333,389,722,611,889,722,722,556,722,667,556,611,722,722,944,722,722,611,333,278,333,469,500,333,444,500,444,500,444,333,500,500,278,278,500,278,778,500,500,500,500,333,389,278,500,500,722,500,500,444,480,200,480,541,0,500,0,333,500,444,1e3,500,500,333,1e3,556,333,889,0,611,0,0,333,333,444,444,350,500,1e3,333,980,389,333,722,0,444,722,0,333,500,500,500,500,200,500,333,760,276,500,564,0,760,333,400,564,300,300,333,500,453,250,333,300,310,500,750,750,750,444,722,722,722,722,722,722,889,667,611,611,611,611,333,333,333,333,722,722,722,722,722,722,722,564,722,722,722,722,722,722,556,500,444,444,444,444,444,444,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,564,500,500,500,500,500,500,500,500],C.timesRomanBoldWidth=[250,333,555,500,500,1e3,833,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,930,722,667,722,722,667,611,778,778,389,500,778,667,944,722,778,611,778,722,556,667,722,722,1e3,722,722,667,333,278,333,581,500,333,500,556,444,556,444,333,500,556,278,333,556,278,833,556,500,556,556,444,389,333,556,500,722,500,500,444,394,220,394,520,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,1e3,0,667,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,444,722,0,333,500,500,500,500,220,500,333,747,300,500,570,0,747,333,400,570,300,300,333,556,540,250,333,300,330,500,750,750,750,500,722,722,722,722,722,722,1e3,722,667,667,667,667,389,389,389,389,722,722,778,778,778,778,778,570,778,722,722,722,722,722,611,556,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,500,556,500],C.timesRomanItalicWidth=[250,333,420,500,500,833,778,214,333,333,500,675,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,675,675,675,500,920,611,611,667,722,611,611,722,722,333,444,667,556,833,667,722,611,722,611,500,556,722,611,833,611,556,556,389,278,389,422,500,333,500,500,444,500,444,278,500,500,278,278,444,278,722,500,500,500,500,389,389,278,500,444,667,444,444,389,400,275,400,541,0,500,0,333,500,556,889,500,500,333,1e3,500,333,944,0,556,0,0,333,333,556,556,350,500,889,333,980,389,333,667,0,389,556,0,389,500,500,500,500,275,500,333,760,276,500,675,0,760,333,400,675,300,300,333,500,523,250,333,300,310,500,750,750,750,500,611,611,611,611,611,611,889,667,611,611,611,611,333,333,333,333,722,667,722,722,722,722,722,675,722,722,722,722,722,556,611,500,500,500,500,500,500,500,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,675,500,500,500,500,500,444,500,444],C.timesRomanBoldItalicWidths=[250,389,555,500,500,833,778,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,832,667,667,667,722,667,667,722,778,389,500,667,611,889,722,722,611,722,667,556,611,722,667,889,667,611,611,333,278,333,570,500,333,500,500,444,500,444,333,500,556,278,278,500,278,778,556,500,500,500,389,389,278,556,444,667,500,444,389,348,220,348,570,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,944,0,611,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,389,611,0,389,500,500,500,500,220,500,333,747,266,500,606,0,747,333,400,570,300,300,333,576,500,250,333,300,300,500,750,750,750,500,667,667,667,667,667,667,944,667,667,667,667,667,389,389,389,389,722,722,722,722,722,722,722,570,722,722,722,722,722,611,611,500,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,444,500,444],C.symbolWidth=[250,333,713,500,549,833,778,439,333,333,500,549,250,549,250,278,500,500,500,500,500,500,500,500,500,500,278,278,549,549,549,444,549,722,667,722,612,611,763,603,722,333,631,722,686,889,722,722,768,741,556,592,611,690,439,768,645,795,611,333,863,333,658,500,500,631,549,549,494,439,521,411,603,329,603,549,549,576,521,549,549,521,549,603,439,576,713,686,493,686,494,480,200,480,549,750,620,247,549,167,713,500,753,753,753,753,1042,987,603,987,603,400,549,411,549,549,713,494,460,549,549,549,549,1e3,603,1e3,658,823,686,795,987,768,768,823,768,768,713,713,713,713,713,713,713,768,713,790,790,890,823,549,250,713,603,603,1042,987,603,987,603,494,329,790,790,786,713,384,384,384,384,384,384,494,494,494,494,329,274,686,686,686,384,384,384,384,384,384,494,494,494,-1],C.zapfDingbatsWidth=[278,974,961,974,980,719,789,790,791,690,960,939,549,855,911,933,911,945,974,755,846,762,761,571,677,763,760,759,754,494,552,537,577,692,786,788,788,790,793,794,816,823,789,841,823,833,816,831,923,744,723,749,790,792,695,776,768,792,759,707,708,682,701,826,815,789,789,707,687,696,689,786,787,713,791,785,791,873,761,762,762,759,759,892,892,788,784,438,138,277,415,392,392,668,668,390,390,317,317,276,276,509,509,410,410,234,234,334,334,732,544,544,910,667,760,760,776,595,694,626,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,894,838,1016,458,748,924,748,918,927,928,928,834,873,828,924,924,917,930,931,463,883,836,836,867,867,696,696,874,874,760,946,771,865,771,888,967,888,831,873,927,970,918];var kr=C;function C(){}Vr=function(t,e){return(Vr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Vr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Ar,Rr=Tt),Object.defineProperty(Ar.prototype,"fontFamily",{get:function(){return this.pdfFontFamily},enumerable:!0,configurable:!0}),Ar.prototype.checkStyle=function(){var t;this.fontFamily!==Y.PdfFontFamily.Symbol&&this.fontFamily!==Y.PdfFontFamily.ZapfDingbats||(t=this.style,t&=~(Y.PdfFontStyle.Bold|Y.PdfFontStyle.Italic),this.setStyle(t))},Ar.prototype.getLineWidth=function(t,e){if(null==t)throw new Error("ArgumentNullException:line");for(var i=0,r=(this.name,0),n=(t=Ar.convert(t)).length;r<n;r++){var o=t[r];i+=this.getCharWidthInternal(o,e)}var s=this.metrics.getSize(e);return i=this.applyFormatSettings(t,e,i*=Tt.charSizeMultiplier*s)},Ar.prototype.equalsToFont=function(t){var e,i,r=!1;return null!=t&&(e=this.fontFamily===t.fontFamily,i=~(Y.PdfFontStyle.Underline|Y.PdfFontStyle.Strikeout),t=(this.style&i)==(t.style&i),r=e&&t),r},Ar.prototype.initializeInternals=function(){Tr.cache.search(this);var t=kr.getMetrics(this.pdfFontFamily,this.style,this.size);this.metrics=t,t=this.createInternals(),this.setInternals(t)},Ar.prototype.createInternals=function(){var t,e=new c;return e.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),e.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type1)),e.items.setValue(this.dictionaryProperties.baseFont,new o(this.metrics.postScriptName)),this.fontFamily!==Y.PdfFontFamily.Symbol&&this.fontFamily!==Y.PdfFontFamily.ZapfDingbats&&(t=this.encodings[Y.FontEncoding.WinAnsiEncoding],e.items.setValue(this.dictionaryProperties.encoding,new o(t))),e},Ar.prototype.getCharWidthInternal=function(t,e){var i=0,i=t.charCodeAt(0);return"0"!==this.name&&"1"!==this.name&&"2"!==this.name&&"3"!==this.name&&"4"!==this.name||(i-=Ar.charOffset),this.metrics.widthTable.items(i=0<=i&&128!==i?i:0)},Ar.convert=function(t){return t},Ar.charOffset=32;var Vr,Rr,Mr=Ar;function Ar(t,e,i){e=Rr.call(this,e,void 0===i?t instanceof Ar?t.style:Y.PdfFontStyle.Regular:i)||this;return e.dictionaryProperties=new l,e.encodings=["Unknown","StandardEncoding","MacRomanEncoding","MacExpertEncoding","WinAnsiEncoding","PDFDocEncoding","IdentityH"],e.pdfFontFamily=void 0===t?Y.PdfFontFamily.Helvetica:t instanceof Ar?t.fontFamily:t,e.checkStyle(),e.initializeInternals(),e}Object.defineProperty(Nr.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"innerColor",{get:function(){return this.internalColor},set:function(t){this.internalColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"bounds",{get:function(){return this.rectangle},set:function(t){this.rectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"font",{get:function(){return this.textFont},set:function(t){this.textFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"brush",{get:function(){return this.textBrush},set:function(t){this.textBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t,this.dictionary.items.setValue(this.dictionaryProperties.contents,new tt(this.content))},enumerable:!0,configurable:!0}),Object.defineProperty(Nr.prototype,"dictionary",{get:function(){return this.pdfDictionary},set:function(t){this.pdfDictionary=t},enumerable:!0,configurable:!0}),Nr.prototype.initialize=function(){this.pdfDictionary.annotationBeginSave=new E(this),this.pdfDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.annot))},Nr.prototype.setPage=function(t){this.pdfPage=t,this.pdfDictionary.items.setValue(this.dictionaryProperties.p,new d(this.pdfPage))},Nr.prototype.beginSave=function(){this.save()},Nr.prototype.save=function(){var t=new Z(this.rectangle.x,this.rectangle.y,this.rectangle.width,this.rectangle.height),e=this.pdfPage.section,i=t.height,e=e.pointToNativePdf(this.page,new J(t.x,t.y));t.x=e.x,t.width=e.x+t.width,t.y=e.y-this.page.document.pageSettings.margins.top,t.height=t.y-i,this.pdfDictionary.items.setValue(this.dictionaryProperties.rect,p.fromRectangle(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new u(this.darkness))},Object.defineProperty(Nr.prototype,"element",{get:function(){return this.pdfDictionary},enumerable:!0,configurable:!0});var Dr=Nr;function Nr(t){this.dictionaryProperties=new l,this.pdfColor=new f(255,255,255),this.rectangle=new Z(0,0,0,0),this.pdfPage=null,this.textBrush=new mt(new f(0,0,0)),this.textFont=new Mr(Y.PdfFontFamily.TimesRoman,10),this.format=new bt(Y.PdfTextAlignment.Left),this.content="",this.pdfDictionary=new c,this.internalColor=new f,this.darkness=1,void 0===t?this.initialize():(this.initialize(),this.bounds=t)}Fr=function(t,e){return(Fr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Fr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Gr,Ir=Dr),Gr.prototype.initialize=function(){Ir.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link))};var Fr,Ir,Er=Gr;function Gr(t){return Ir.call(this,t)||this}zr=function(t,e){return(zr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}zr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Hr,Wr=Er),Hr.prototype.getSetAction=function(t){if(void 0===t)return this.pdfAction;this.pdfAction=t};var zr,Wr,_r=Hr;function Hr(t){t=Wr.call(this,t)||this;return t.pdfAction=null,t}Ur=function(t,e){return(Ur=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ur(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Yr,Kr=Er),Object.defineProperty(Yr.prototype,"destination",{get:function(){return this.pdfDestination},set:function(t){this.pdfDestination=t},enumerable:!0,configurable:!0}),Yr.prototype.save=function(){Kr.prototype.save.call(this),null!=this.pdfDestination&&this.dictionary.items.setValue(this.dictionaryProperties.dest,this.pdfDestination.element)},Yr.prototype.clone=function(){var t=new Yr(this.bounds,this.destination);return t.color=this.color,t.brush=this.brush,t.destination=this.destination,t.font=this.font,t};var Ur,Kr,qr=Yr;function Yr(t,e){t=Kr.call(this,t)||this;return t.pdfDestination=null,void 0!==e&&(t.destination=e),t}Object.defineProperty(Xr.prototype,"elements",{get:function(){return this.layoutElement},enumerable:!0,configurable:!0}),Xr.prototype.getElement=function(){return this.layoutElement},Xr.prototype.layout=function(t){return this.layoutInternal(t)},Xr.prototype.Layouter=function(t){return this.layoutInternal(t)},Xr.prototype.getNextPage=function(t){return t.section.add()},Xr.prototype.getPaginateBounds=function(t){if(null==t)throw new Error("ArgumentNullException : param");return t.format.usePaginateBounds?t.format.paginateBounds:new Z(t.bounds.x,0,t.bounds.width,t.bounds.height)};var Jr=Xr;function Xr(t){this.layoutElement=t}Object.defineProperty($r.prototype,"layout",{get:function(){return this.layoutType},set:function(t){this.layoutType=t},enumerable:!0,configurable:!0}),Object.defineProperty($r.prototype,"break",{get:function(){return this.breakType},set:function(t){this.breakType=t},enumerable:!0,configurable:!0}),Object.defineProperty($r.prototype,"paginateBounds",{get:function(){return void 0===this.layoutPaginateBounds&&null==this.layoutPaginateBounds&&(this.layoutPaginateBounds=new Z(0,0,0,0)),this.layoutPaginateBounds},set:function(t){this.layoutPaginateBounds=t,this.boundsSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty($r.prototype,"usePaginateBounds",{get:function(){return this.boundsSet},enumerable:!0,configurable:!0});var Zr=$r;function $r(t){void 0!==t&&(this.break=t.break,this.layout=t.layout,this.paginateBounds=t.paginateBounds,this.boundsSet=t.usePaginateBounds)}Object.defineProperty(tn.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t},enumerable:!0,configurable:!0}),Object.defineProperty(tn.prototype,"bounds",{get:function(){return new Z(this.layoutBounds.x,this.layoutBounds.y,this.layoutBounds.width,this.layoutBounds.height)},set:function(t){this.layoutBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(tn.prototype,"format",{get:function(){return this.layoutFormat},set:function(t){this.layoutFormat=t},enumerable:!0,configurable:!0});var Qr=tn;function tn(){}Object.defineProperty(rn.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(rn.prototype,"bounds",{get:function(){return this.layoutBounds},enumerable:!0,configurable:!0});var en=rn;function rn(t,e){this.pdfPage=t,this.layoutBounds=e}Object.defineProperty(on.prototype,"left",{get:function(){return this.leftPen},set:function(t){this.leftPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(on.prototype,"right",{get:function(){return this.rightPen},set:function(t){this.rightPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(on.prototype,"top",{get:function(){return this.topPen},set:function(t){this.topPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(on.prototype,"bottom",{get:function(){return this.bottomPen},set:function(t){this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(on.prototype,"all",{set:function(t){this.leftPen=this.rightPen=this.topPen=this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(on.prototype,"isAll",{get:function(){return this.leftPen===this.rightPen&&this.leftPen===this.topPen&&this.leftPen===this.bottomPen},enumerable:!0,configurable:!0}),Object.defineProperty(on,"default",{get:function(){return new on},enumerable:!0,configurable:!0});var nn=on;function on(){var t=new ne(new f(0,0,0)),e=(t.dashStyle=Y.PdfDashStyle.Solid,new ne(new f(0,0,0))),i=(e.dashStyle=Y.PdfDashStyle.Solid,new ne(new f(0,0,0))),r=(i.dashStyle=Y.PdfDashStyle.Solid,new ne(new f(0,0,0)));r.dashStyle=Y.PdfDashStyle.Solid,this.leftPen=t,this.rightPen=e,this.topPen=i,this.bottomPen=r}Object.defineProperty(an.prototype,"left",{get:function(){return this.leftPad},set:function(t){this.leftPad=t,this.hasLeftPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(an.prototype,"right",{get:function(){return this.rightPad},set:function(t){this.rightPad=t,this.hasRightPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(an.prototype,"top",{get:function(){return this.topPad},set:function(t){this.topPad=t,this.hasTopPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(an.prototype,"bottom",{get:function(){return this.bottomPad},set:function(t){this.bottomPad=t,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(an.prototype,"all",{set:function(t){this.leftPad=this.rightPad=this.topPad=this.bottomPad=t,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0},enumerable:!0,configurable:!0});var sn=an;function an(t,e,i,r){this.hasLeftPad=!1,this.hasRightPad=!1,this.hasTopPad=!1,this.hasBottomPad=!1,void 0===t?this.bottomPad=this.topPad=this.leftPad=this.rightPad=.5:(this.leftPad=t,this.rightPad=e,this.topPad=i,this.bottomPad=r,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0)}Object.defineProperty(ln.prototype,"raiseBeginPageLayout",{get:function(){return void 0!==this.beginPageLayout},enumerable:!0,configurable:!0}),Object.defineProperty(ln.prototype,"raiseEndPageLayout",{get:function(){return void 0!==this.endPageLayout},enumerable:!0,configurable:!0}),ln.prototype.onBeginPageLayout=function(t){this.beginPageLayout&&this.beginPageLayout(this,t)},ln.prototype.onEndPageLayout=function(t){this.endPageLayout&&this.endPageLayout(this,t)},ln.prototype.drawHelper=function(t,e,i,r){var n;return e instanceof J&&void 0===e.width&&void 0===i?this.drawHelper(t,e.x,e.y):"number"==typeof e&&"number"==typeof i&&void 0===r?this.drawHelper(t,e,i,null):e instanceof Z&&void 0!==e.width&&void 0===i?this.drawHelper(t,e,null):e instanceof J&&void 0===e.width&&i instanceof Zr?this.drawHelper(t,e.x,e.y,i):"number"==typeof e&&"number"==typeof i&&(r instanceof Zr||null==r)?(n=t.graphics.clientSize.width-e,n=new Z(e,i,n,0),this.drawHelper(t,n,r)):e instanceof Z&&void 0!==e.width&&"boolean"==typeof i?(this.bEmbedFonts=i,this.drawHelper(t,e,null)):(n=e,r=i,(e=new Qr).page=t,e.bounds=n,null!=e&&(i=e.bounds.x,t=e.bounds.y,0===e.bounds.x&&(i=nn.default.right.width/2),0===e.bounds.y&&(t=nn.default.top.width/2),n=new Z(i,t,e.bounds.width,e.bounds.height),e.bounds=n),e.format=null!=r?r:new Zr,this.layout(e))};var hn=ln;function ln(){}un=function(t,e){return(un=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var un,cn,pn=function(t,e){function i(){this.constructor=t}un(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},dn=(pn(fn,cn=Jr),Object.defineProperty(fn.prototype,"element",{get:function(){return cn.prototype.getElement.call(this)},enumerable:!0,configurable:!0}),fn.prototype.layoutInternal=function(t){this.format=null!==this.element.stringFormat&&void 0!==this.element.stringFormat?this.element.stringFormat:null;var e=t.page,i=t.bounds,r=this.element.value,n=null,o=new mn;for(o.page=e,o.remainder=r;;){o=this.layoutOnPage(r,e,i,t),n=this.getLayoutResult(o);break}return n},fn.prototype.getLayoutResult=function(t){return new yn(t.page,t.bounds,t.remainder,t.lastLineBounds)},fn.prototype.layoutOnPage=function(t,e,i,r){var n=new mn;n.remainder=t,n.page=e,i=this.checkCorrectBounds(e,i);var t=(new vt).layout(t,this.element.font,this.format,i,e.getClientSize().height,!1,new X(0,0)),o=null==t.remainder,r=(r.format.break!==Y.PdfLayoutBreakType.FitElement&&t.empty,e.graphics),s=this.element.getBrush();this.element instanceof jn&&(s.color=new f(0,0,255),!this.element._isLastElement)&&this.element.stringFormat&&this.element.stringFormat.alignment===Y.PdfTextAlignment.Justify&&(t.layoutLines[0].type=Y.LineType.LayoutBreak|Y.LineType.FirstParagraphLine),this.element&&this.element instanceof Sn&&!this.element._isLastElement&&this.element.stringFormat&&this.element.stringFormat.alignment===Y.PdfTextAlignment.Justify&&(t.layoutLines[0].type=Y.LineType.LayoutBreak|Y.LineType.FirstParagraphLine),r.drawStringLayoutResult(t,this.element.font,this.element.pen,s,i,this.format),t.lines[t.lineCount-1];return n.lastLineBounds=r.getLineBounds(t.lineCount-1,t,this.element.font,i,this.format),n.bounds=this.getTextPageBounds(e,i,t),n.remainder=t.remainder,n.end=o,n},fn.prototype.checkCorrectBounds=function(t,e){t=t.graphics.clientSize;return e.height=0<e.height?e.height:t.height-e.y,e},fn.prototype.getTextPageBounds=function(t,e,i){var i=i.actualSize,r=(e.x,e.y),n=(0<e.width?e:i).width,o=i.height,s=t.graphics.checkCorrectLayoutRectangle(i,e.x,e.y,this.format).x,t=t.graphics.getTextVerticalAlignShift(i.height,e.height,this.format);return new Z(s,r+=t,n,o)},fn);function fn(t){return cn.call(this,t)||this}var gn,mn=function(){},yn=(pn(bn,gn=en),Object.defineProperty(bn.prototype,"remainder",{get:function(){return this.remainderText},enumerable:!0,configurable:!0}),Object.defineProperty(bn.prototype,"lastLineBounds",{get:function(){return this.lastLineTextBounds},enumerable:!0,configurable:!0}),bn);function bn(t,e,i,r){t=gn.call(this,t,e)||this;return t.remainderText=i,t.lastLineTextBounds=r,t}wn=function(t,e){return(wn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}wn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(vn,Pn=hn),Object.defineProperty(vn.prototype,"text",{get:function(){return this.content},set:function(t){this.elementValue=t,this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(vn.prototype,"value",{get:function(){return this.elementValue},enumerable:!0,configurable:!0}),Object.defineProperty(vn.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(vn.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(vn.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t,this.pdfFont instanceof Mr&&null!=this.content?this.elementValue=Mr.convert(this.content):this.elementValue=this.content},enumerable:!0,configurable:!0}),Object.defineProperty(vn.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),vn.prototype.getBrush=function(){return null==this.pdfBrush||void 0===this.pdfBrush?new mt(new f(0,0,0)):this.pdfBrush},vn.prototype.layout=function(t){return new dn(this).layout(t)},vn.prototype.drawText=function(t,e,i,r){if(e instanceof J&&void 0===e.width&&void 0===i)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.hasPointOverload=!0,this.drawText(t,e,i,null);if(e instanceof Z&&void 0!==e.width&&void 0===i)return this.drawText(t,e,null);if(e instanceof J&&void 0===e.width&&i instanceof Zr)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof Zr||null==r))return this.hasPointOverload=!0,n=t.graphics.clientSize.width-e,n=new Z(e,i,n,0),this.drawText(t,n,r);if(e instanceof Z&&void 0!==e.width&&"boolean"==typeof i)return this.drawText(t,e,null);var n=new vt;if(this.hasPointOverload){var o=n.layout(this.value,this.font,this.stringFormat,new X(t.graphics.clientSize.width-e.x,0),!0,t.graphics.clientSize),s=void 0,a=e,h=i;if((p=new Qr).page=t,p.bounds=a,p.format=null!=h?h:new Zr,1<o.lines.length){if(this.text=o.layoutLines[0].text,p.bounds.y<=p.page.graphics.clientSize.height)for(var l=new J(p.bounds.x,p.bounds.y),u=(s=this.layout(p),new Z(0,s.bounds.y+o.lineHeight,t.graphics.clientSize.width,o.lineHeight)),c=1;c<o.lines.length;c++)p.page=s.page,p.bounds=new Z(new J(u.x,u.y),new X(u.width,u.height)),this.text=o.layoutLines[c].text,u.y+o.lineHeight>s.page.graphics.clientSize.height&&(p.page=p.page.graphics.getNextPage(),u=l.y>s.page.graphics.clientSize.height-s.bounds.height?new Z(0,s.bounds.height,s.page.graphics.clientSize.width,o.lineHeight):new Z(0,0,s.page.graphics.clientSize.width,o.lineHeight),p.bounds=u),c===o.lines.length-1&&(this._isLastElement=!0),s=this.layout(p),c!==o.lines.length-1?u=new Z(0,s.bounds.y+o.lineHeight,s.page.graphics.clientSize.width,o.lineHeight):(g=this.font.measureString(this.text,this.format).width,s=this.calculateResultBounds(s,g,s.page.graphics.clientSize.width,0))}else d=this.font.measureString(this.text,this.format),p.bounds.y<=p.page.graphics.clientSize.height&&(s=this.layout(p),s=this.calculateResultBounds(s,d.width,s.page.graphics.clientSize.width,0));return s}var p,d,s=n.layout(this.value,this.font,this.stringFormat,new X(e.width,0),!1,t.graphics.clientSize),f=void 0,a=e,h=i;if((p=new Qr).page=t,p.bounds=a,p.format=null!=h?h:new Zr,1<s.lines.length){if(this.text=s.layoutLines[0].text,p.bounds.y<=p.page.graphics.clientSize.height)for(var g,l=new J(p.bounds.x,p.bounds.y),u=(f=this.layout(p),new Z(a.x,f.bounds.y+s.lineHeight,a.width,s.lineHeight)),c=1;c<s.lines.length;c++)p.page=f.page,p.bounds=new Z(u.x,u.y,u.width,u.height),this.text=s.layoutLines[c].text,u.y+s.lineHeight>f.page.graphics.clientSize.height&&(p.page=p.page.graphics.getNextPage(),u=l.y>f.page.graphics.clientSize.height-f.bounds.height?new Z(a.x,s.lineHeight,a.width,s.lineHeight):new Z(a.x,0,a.width,s.lineHeight),p.bounds=u),f=this.layout(p),c!==s.lines.length-1?u=new Z(a.x,f.bounds.y+s.lineHeight,a.width,s.lineHeight):(g=this.font.measureString(this.text,this.format).width,f=this.calculateResultBounds(f,g,a.width,a.x))}else d=this.font.measureString(this.text,this.format),p.bounds.y<=p.page.graphics.clientSize.height&&(f=this.layout(p),f=this.calculateResultBounds(f,d.width,a.width,a.x));return f},vn.prototype.calculateResultBounds=function(t,e,i,r){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Center?(t.bounds.x=r+(i-e)/2,t.bounds.width=e):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Right?(t.bounds.x=r+(i-e),t.bounds.width=e):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Justify?(t.bounds.x=r,t.bounds.width=i):(t.bounds.width=r,t.bounds.width=e),t};var wn,Pn,Sn=vn;function vn(t,e,i,r,n){var o=Pn.call(this)||this;return o.content="",o.elementValue="",o.hasPointOverload=!1,o._isLastElement=!1,o.isPdfTextElement=!1,void 0!==t&&("string"==typeof t&&void 0===e?(o.content=t,o.elementValue=t):"string"==typeof t&&e instanceof Tt&&void 0===i?(o.content=t,o.elementValue=t,o.pdfFont=e):"string"==typeof t&&e instanceof Tt&&i instanceof ne&&void 0===r?(o.content=t,o.elementValue=t,o.pdfFont=e,o.pdfPen=i):"string"==typeof t&&e instanceof Tt&&i instanceof pt&&void 0===r?(o.content=t,o.elementValue=t,o.pdfFont=e,o.pdfBrush=i):(o.content=t,o.elementValue=t,o.pdfFont=e,o.pdfPen=i,o.pdfBrush=r,o.format=n)),o}Cn=function(t,e){return(Cn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Cn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(xn,Bn=_r),Object.defineProperty(xn.prototype,"uriAction",{get:function(){return void 0===this.pdfUriAction&&(this.pdfUriAction=new ht),this.pdfUriAction},enumerable:!0,configurable:!0}),Object.defineProperty(xn.prototype,"uri",{get:function(){return this.uriAction.uri},set:function(t){this.uriAction.uri!==t&&(this.uriAction.uri=t)},enumerable:!0,configurable:!0}),Object.defineProperty(xn.prototype,"action",{get:function(){return this.getSetAction()},set:function(t){this.getSetAction(t),this.uriAction.next=t},enumerable:!0,configurable:!0}),xn.prototype.initialize=function(){Bn.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link));this.uriAction.element;this.dictionary.items.setValue(this.dictionaryProperties.a,this.uriAction.element)};var Cn,Bn,On=xn;function xn(t,e){t=Bn.call(this,t)||this;return void 0!==e&&(t.uri=e),t}Ln=function(t,e){return(Ln=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ln(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(kn,Tn=Sn),Object.defineProperty(kn.prototype,"url",{get:function(){return this.uniformResourceLocator},set:function(t){if(0===t.length)throw new Error("ArgumentException : Url - string can not be empty");this.uniformResourceLocator=t},enumerable:!0,configurable:!0}),kn.prototype.draw=function(t,e){var i,r,n,o,s,a;return t instanceof or?(a=new vt,i=this.font.style,e instanceof J?(this.recalculateBounds=!0,this.font.style=Y.PdfFontStyle.Underline,s=1===(r=a.layout(this.value,this.font,this.stringFormat,new X(t.graphics.clientSize.width-e.x,0),!0,t.graphics.clientSize)).lines.length?(n=this.font.measureString(this.value),o=new Z(e,n),o=this.calculateBounds(o,n.width,t.graphics.clientSize.width,e.x),this.uriAnnotation=new On(o,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),t.annotations.add(this.uriAnnotation),this.drawText(t,e)):this.drawMultipleLineWithPoint(r,t,e),this.font.style=i,s):(r=a.layout(this.value,this.font,this.stringFormat,new X(e.width,0),!1,new X(0,0)),this.font.style=Y.PdfFontStyle.Underline,s=1===r.lines.length?(n=this.font.measureString(this.value),o=new Z(new J(e.x,e.y),n),o=this.calculateBounds(o,n.width,e.width,e.x),this.uriAnnotation=new On(o,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),t.annotations.add(this.uriAnnotation),this.drawText(t,e)):this.drawMultipleLineWithBounds(r,t,e),this.font.style=i,s)):(a=new or,a=t.page,this.draw(a,e))},kn.prototype.drawMultipleLineWithPoint=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=(n===t.layoutLines.length-1&&this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Justify&&(this._isLastElement=!0),new Z(i,o));if(0!==n&&(s.x=0),this.text=t.lines[n].text,s.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),s=new Z(0,0,e.graphics.clientSize.width,o.height),i.y=0}s=this.calculateBounds(s,o.width,e.graphics.clientSize.width,s.x),this.uriAnnotation=new On(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=0!==n?this.drawText(e,new J(0,s.y)):this.drawText(e,s.x,s.y),i.y+=o.height}return r},kn.prototype.drawMultipleLineWithBounds=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new Z(new J(i.x,i.y),o),s=this.calculateBounds(s,o.width,i.width,i.x);if(this.text=t.lines[n].text,i.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),i=new Z(i.x,0,i.width,o.height),s.y=0}this.uriAnnotation=new On(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=this.drawText(e,i),i.y+=o.height}return r},kn.prototype.calculateBounds=function(t,e,i,r){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Center?(t.x=r+(i-e)/2,t.width=e):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Right?(t.x=r+(i-e),t.width=e):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Y.PdfTextAlignment.Justify?(t.x=r,t.width=i):(t.width=r,t.width=e),t};var Ln,Tn,jn=kn;function kn(){var t=Tn.call(this)||this;t.uniformResourceLocator="",t.uriAnnotation=null,t.recalculateBounds=!1,t.defaultBorder=new p;for(var e=0;e<3;e++)t.defaultBorder.add(new u(0));return t}Rn.convert=function(t,e){var i="";switch(e){case Y.PdfNumberStyle.None:i="";break;case Y.PdfNumberStyle.Numeric:i=t.toString();break;case Y.PdfNumberStyle.LowerLatin:i=this.arabicToLetter(t).toLowerCase();break;case Y.PdfNumberStyle.LowerRoman:i=this.arabicToRoman(t).toLowerCase();break;case Y.PdfNumberStyle.UpperLatin:i=this.arabicToLetter(t);break;case Y.PdfNumberStyle.UpperRoman:i=this.arabicToRoman(t)}return i},Rn.arabicToRoman=function(t){var e="",i=this.generateNumber(t,1e3,"M"),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,900,"CM")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,500,"D")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,400,"CD")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,100,"C")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,90,"XC")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,50,"L")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,40,"XL")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,10,"X")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,9,"IX")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,5,"V")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,4,"IV")),i=(e+=i.returnValue,t=i.intArabic,this.generateNumber(t,1,"I"));return e+=i.returnValue,t=i.intArabic,e.toString()},Rn.arabicToLetter=function(t){for(var e=this.convertToLetter(t),i="";0<e.length;)var r=e.pop(),i=this.appendChar(i,r);return i.toString()},Rn.generateNumber=function(t,e,i){for(var r="";e<=t;)t-=e,r+=i;return{returnValue:r.toString(),intArabic:t}},Rn.convertToLetter=function(t){if(t<=0)throw Error("ArgumentOutOfRangeException-arabic, Value can not be less 0");for(var e=[];t>this.letterLimit;){var i=t%this.letterLimit;0===i?(t=t/this.letterLimit-1,i=this.letterLimit):t/=this.letterLimit,e.push(i)}return e.push(t),e},Rn.appendChar=function(t,e){return t+=String.fromCharCode(Rn.acsiiStartIndex+e)},Rn.letterLimit=26,Rn.acsiiStartIndex=64;var Vn=Rn;function Rn(){}Object.defineProperty(An.prototype,"template",{get:function(){return this.pdfTemplate},set:function(t){this.pdfTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(An.prototype,"value",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0});var Mn=An;function An(t,e){this.pdfTemplate=null,this.content="",void 0!==t&&(this.template=t,this.value=e)}Dn=function(t,e){return(Dn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Dn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Fn,Nn=Pe),Fn.prototype.performDraw=function(t,e,i,r){Nn.prototype.performDrawHelper.call(this,t,e,i,r);var n=this.getValue(t),o=new Ti(this.getSize()),s=(this.list.setValue(t,new Mn(o,n)),this.getSize()),n=(o.graphics.drawString(n,this.getFont(),this.pen,this.getBrush(),0,0,s.width,s.height,this.stringFormat),new J(e.x+this.location.x,e.y+this.location.y));t.drawPdfTemplate(o,n,new X(o.width*i,o.height*r))};var Dn,Nn,pn=Fn;function Fn(){var t=Nn.call(this)||this;return t.list=new ce,t}In=function(t,e){return(In=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}In(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(zn,En=pn),Object.defineProperty(zn.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),zn.prototype.getValue=function(t){t=this.getPageFromGraphics(t);return this.internalGetValue(t)},zn.prototype.internalGetValue=function(t){t=t.document.pages.indexOf(t)+1;return Vn.convert(t,this.numberStyle)};var In,En,Gn=zn;function zn(t,e){var i=En.call(this)||this;return i.internalNumberStyle=Y.PdfNumberStyle.Numeric,void 0===e?i.font=t:e instanceof pt?(i.font=t,i.brush=e):(i.font=t,i.bounds=e),i}Wn=function(t,e){return(Wn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Wn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Hn,_n=pn),Object.defineProperty(Hn.prototype,"text",{get:function(){return this.internalText},set:function(t){this.internalText=t},enumerable:!0,configurable:!0}),Object.defineProperty(Hn.prototype,"automaticFields",{get:function(){return this.internalAutomaticFields},set:function(t){this.internalAutomaticFields=t},enumerable:!0,configurable:!0}),Hn.prototype.getValue=function(t){var e=this.text.toString();if(void 0!==this.automaticFields&&null!=this.automaticFields&&0<this.automaticFields.length)for(var i=0;i<this.automaticFields.length;i++)var r=this.automaticFields[i],e=e.replace("{"+i+"}",r.getValue(t));return e};var Wn,_n,pn=Hn;function Hn(t,e,i){for(var r=[],n=3;n<arguments.length;n++)r[n-3]=arguments[n];var o=_n.call(this)||this;return o.internalAutomaticFields=null,o.internalText="",o.font=t,o.brush=e,o.text=i,o.automaticFields=r,o}Un=function(t,e){return(Un=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Un(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Yn,Kn=Pe),Yn.prototype.performDraw=function(t,e,i,r){Kn.prototype.performDrawHelper.call(this,t,e,i,r);var n,o,s,a=this.getPageFromGraphics(t).document,h=this.getValue(t);this.list.containsKey(a)?(n=this.list.getValue(a),s=new J(e.x+this.location.x,e.y+this.location.y),t.drawPdfTemplate(n.template,s,new X(n.template.width*i,n.template.height*r))):(n=this.getSize(),o=new Ti(n),this.list.setValue(a,new Mn(o,h)),o.graphics.drawString(h,this.getFont(),this.pen,this.getBrush(),0,0,n.width,n.height,this.stringFormat),s=new J(e.x+this.location.x,e.y+this.location.y),t.drawPdfTemplate(o,s,new X(o.width*i,o.height*r))),this.painterGraphics.push(t)};var Un,Kn,qn=Yn;function Yn(){var t=Kn.call(this)||this;return t.list=new ce,t.painterGraphics=[],t}Jn=function(t,e){return(Jn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Jn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Zn,Xn=qn),Object.defineProperty(Zn.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),Zn.prototype.getValue=function(t){t=this.getPageFromGraphics(t).section.parent.document.pages.count;return Vn.convert(t,this.numberStyle)};var Jn,Xn,qn=Zn;function Zn(t,e){var i=Xn.call(this)||this;return i.internalNumberStyle=Y.PdfNumberStyle.Numeric,void 0===e?i.font=t:e instanceof pt?(i.font=t,i.brush=e):(i.font=t,i.bounds=e),i}($n=Y.PdfDestinationMode||(Y.PdfDestinationMode={}))[$n.Location=0]="Location",$n[$n.FitToPage=1]="FitToPage",$n[$n.FitR=2]="FitR";Object.defineProperty(Qn.prototype,"zoom",{get:function(){return this.zoomFactor},set:function(t){this.zoomFactor=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(Qn.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(Qn.prototype,"mode",{get:function(){return this.destinationMode},set:function(t){this.destinationMode=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(Qn.prototype,"location",{get:function(){return this.destinationLocation},set:function(t){this.destinationLocation=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Qn.prototype.pointToNativePdf=function(t,e){return t.section.pointToNativePdf(t,e)},Qn.prototype.initializePrimitive=function(){switch(this.array.clear(),this.array.add(new d(this.pdfPage)),this.destinationMode){case Y.PdfDestinationMode.Location:var t=this.pdfPage,t=(new J,this.pointToNativePdf(t,this.destinationLocation));this.array.add(new o(this.dictionaryProperties.xyz)),this.array.add(new u(t.x)),this.array.add(new u(t.y)),this.array.add(new u(this.zoomFactor));break;case Y.PdfDestinationMode.FitToPage:this.array.add(new o(this.dictionaryProperties.fit))}},Object.defineProperty(Qn.prototype,"element",{get:function(){return this.initializePrimitive(),this.array},enumerable:!0,configurable:!0});var $n=Qn;function Qn(t,e){this.dictionaryProperties=new l,this.destinationMode=Y.PdfDestinationMode.Location,this.zoomFactor=0,this.destinationLocation=new J(0,0),this.bounds=new Z,this.array=new p;Y.PdfPageRotateAngle.RotateAngle0;this.destinationLocation=new J(0,this.destinationLocation.y),this.pdfPage=t,e instanceof J?this.destinationLocation=e:this.bounds=e}Object.defineProperty(eo.prototype,"domain",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.domain)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.domain,t)},enumerable:!0,configurable:!0}),Object.defineProperty(eo.prototype,"range",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.range)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.range,t)},enumerable:!0,configurable:!0}),Object.defineProperty(eo.prototype,"dictionary",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(eo.prototype,"element",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0});var to=eo;function eo(t){this.mDictionary=null,this.mDictionaryProperties=new l,this.mDictionary=t}io=function(t,e){return(io=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}io(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(ho,ro=to),ho.prototype.checkParams=function(t,e,i,r){e.length,t.length,r.length},ho.prototype.setDomainAndRange=function(t,e){this.domain=new p(t),this.range=new p(e)},ho.prototype.setSizeAndValues=function(t,e){var i=this.dictionary;i.isResource=!0,this.dictionary.items.setValue(this.mDictionaryProperties.size,new p(t)),this.dictionary.items.setValue(this.mDictionaryProperties.bitsPerSample,new u(8)),i.writeBytes(e)};var io,ro,no,oo,so,B,ao=ho;function ho(t,e,i,r){var n=ro.call(this,new U)||this;return void 0===t?n.dictionary.items.setValue(n.mDictionaryProperties.functionType,new u(0)):(n.dictionary.items.setValue(n.mDictionaryProperties.functionType,new u(0)),n.checkParams(t,e,i,r),n.setDomainAndRange(t,e),n.setSizeAndValues(i,r)),n}(O=no=no||{})[O.None=0]="None",O[O.Start=1]="Start",O[O.End=2]="End",O[O.Both=3]="Both",(O=oo=oo||{})[O.BackwardDiagonal=0]="BackwardDiagonal",O[O.ForwardDiagonal=1]="ForwardDiagonal",O[O.Horizontal=2]="Horizontal",O[O.Vertical=3]="Vertical",(O=so=so||{})[O.Function=1]="Function",O[O.Axial=2]="Axial",O[O.Radial=3]="Radial",(O=B=B||{})[O.ActiveBorder=1]="ActiveBorder",O[O.ActiveCaption=2]="ActiveCaption",O[O.ActiveCaptionText=3]="ActiveCaptionText",O[O.AppWorkspace=4]="AppWorkspace",O[O.Control=5]="Control",O[O.ControlDark=6]="ControlDark",O[O.ControlDarkDark=7]="ControlDarkDark",O[O.ControlLight=8]="ControlLight",O[O.ControlLightLight=9]="ControlLightLight",O[O.ControlText=10]="ControlText",O[O.Desktop=11]="Desktop",O[O.GrayText=12]="GrayText",O[O.Highlight=13]="Highlight",O[O.HighlightText=14]="HighlightText",O[O.HotTrack=15]="HotTrack",O[O.InactiveBorder=16]="InactiveBorder",O[O.InactiveCaption=17]="InactiveCaption",O[O.InactiveCaptionText=18]="InactiveCaptionText",O[O.Info=19]="Info",O[O.InfoText=20]="InfoText",O[O.Menu=21]="Menu",O[O.MenuText=22]="MenuText",O[O.ScrollBar=23]="ScrollBar",O[O.Window=24]="Window",O[O.WindowFrame=25]="WindowFrame",O[O.WindowText=26]="WindowText",O[O.Transparent=27]="Transparent",O[O.AliceBlue=28]="AliceBlue",O[O.AntiqueWhite=29]="AntiqueWhite",O[O.Aqua=30]="Aqua",O[O.Aquamarine=31]="Aquamarine",O[O.Azure=32]="Azure",O[O.Beige=33]="Beige",O[O.Bisque=34]="Bisque",O[O.Black=35]="Black",O[O.BlanchedAlmond=36]="BlanchedAlmond",O[O.Blue=37]="Blue",O[O.BlueViolet=38]="BlueViolet",O[O.Brown=39]="Brown",O[O.BurlyWood=40]="BurlyWood",O[O.CadetBlue=41]="CadetBlue",O[O.Chartreuse=42]="Chartreuse",O[O.Chocolate=43]="Chocolate",O[O.Coral=44]="Coral",O[O.CornflowerBlue=45]="CornflowerBlue",O[O.Cornsilk=46]="Cornsilk",O[O.Crimson=47]="Crimson",O[O.Cyan=48]="Cyan",O[O.DarkBlue=49]="DarkBlue",O[O.DarkCyan=50]="DarkCyan",O[O.DarkGoldenrod=51]="DarkGoldenrod",O[O.DarkGray=52]="DarkGray",O[O.DarkGreen=53]="DarkGreen",O[O.DarkKhaki=54]="DarkKhaki",O[O.DarkMagenta=55]="DarkMagenta",O[O.DarkOliveGreen=56]="DarkOliveGreen",O[O.DarkOrange=57]="DarkOrange",O[O.DarkOrchid=58]="DarkOrchid",O[O.DarkRed=59]="DarkRed",O[O.DarkSalmon=60]="DarkSalmon",O[O.DarkSeaGreen=61]="DarkSeaGreen",O[O.DarkSlateBlue=62]="DarkSlateBlue",O[O.DarkSlateGray=63]="DarkSlateGray",O[O.DarkTurquoise=64]="DarkTurquoise",O[O.DarkViolet=65]="DarkViolet",O[O.DeepPink=66]="DeepPink",O[O.DeepSkyBlue=67]="DeepSkyBlue",O[O.DimGray=68]="DimGray",O[O.DodgerBlue=69]="DodgerBlue",O[O.Firebrick=70]="Firebrick",O[O.FloralWhite=71]="FloralWhite",O[O.ForestGreen=72]="ForestGreen",O[O.Fuchsia=73]="Fuchsia",O[O.Gainsboro=74]="Gainsboro",O[O.GhostWhite=75]="GhostWhite",O[O.Gold=76]="Gold",O[O.Goldenrod=77]="Goldenrod",O[O.Gray=78]="Gray",O[O.Green=79]="Green",O[O.GreenYellow=80]="GreenYellow",O[O.Honeydew=81]="Honeydew",O[O.HotPink=82]="HotPink",O[O.IndianRed=83]="IndianRed",O[O.Indigo=84]="Indigo",O[O.Ivory=85]="Ivory",O[O.Khaki=86]="Khaki",O[O.Lavender=87]="Lavender",O[O.LavenderBlush=88]="LavenderBlush",O[O.LawnGreen=89]="LawnGreen",O[O.LemonChiffon=90]="LemonChiffon",O[O.LightBlue=91]="LightBlue",O[O.LightCoral=92]="LightCoral",O[O.LightCyan=93]="LightCyan",O[O.LightGoldenrodYellow=94]="LightGoldenrodYellow",O[O.LightGray=95]="LightGray",O[O.LightGreen=96]="LightGreen",O[O.LightPink=97]="LightPink",O[O.LightSalmon=98]="LightSalmon",O[O.LightSeaGreen=99]="LightSeaGreen",O[O.LightSkyBlue=100]="LightSkyBlue",O[O.LightSlateGray=101]="LightSlateGray",O[O.LightSteelBlue=102]="LightSteelBlue",O[O.LightYellow=103]="LightYellow",O[O.Lime=104]="Lime",O[O.LimeGreen=105]="LimeGreen",O[O.Linen=106]="Linen",O[O.Magenta=107]="Magenta",O[O.Maroon=108]="Maroon",O[O.MediumAquamarine=109]="MediumAquamarine",O[O.MediumBlue=110]="MediumBlue",O[O.MediumOrchid=111]="MediumOrchid",O[O.MediumPurple=112]="MediumPurple",O[O.MediumSeaGreen=113]="MediumSeaGreen",O[O.MediumSlateBlue=114]="MediumSlateBlue",O[O.MediumSpringGreen=115]="MediumSpringGreen",O[O.MediumTurquoise=116]="MediumTurquoise",O[O.MediumVioletRed=117]="MediumVioletRed",O[O.MidnightBlue=118]="MidnightBlue",O[O.MintCream=119]="MintCream",O[O.MistyRose=120]="MistyRose",O[O.Moccasin=121]="Moccasin",O[O.NavajoWhite=122]="NavajoWhite",O[O.Navy=123]="Navy",O[O.OldLace=124]="OldLace",O[O.Olive=125]="Olive",O[O.OliveDrab=126]="OliveDrab",O[O.Orange=127]="Orange",O[O.OrangeRed=128]="OrangeRed",O[O.Orchid=129]="Orchid",O[O.PaleGoldenrod=130]="PaleGoldenrod",O[O.PaleGreen=131]="PaleGreen",O[O.PaleTurquoise=132]="PaleTurquoise",O[O.PaleVioletRed=133]="PaleVioletRed",O[O.PapayaWhip=134]="PapayaWhip",O[O.PeachPuff=135]="PeachPuff",O[O.Peru=136]="Peru",O[O.Pink=137]="Pink",O[O.Plum=138]="Plum",O[O.PowderBlue=139]="PowderBlue",O[O.Purple=140]="Purple",O[O.Red=141]="Red",O[O.RosyBrown=142]="RosyBrown",O[O.RoyalBlue=143]="RoyalBlue",O[O.SaddleBrown=144]="SaddleBrown",O[O.Salmon=145]="Salmon",O[O.SandyBrown=146]="SandyBrown",O[O.SeaGreen=147]="SeaGreen",O[O.SeaShell=148]="SeaShell",O[O.Sienna=149]="Sienna",O[O.Silver=150]="Silver",O[O.SkyBlue=151]="SkyBlue",O[O.SlateBlue=152]="SlateBlue",O[O.SlateGray=153]="SlateGray",O[O.Snow=154]="Snow",O[O.SpringGreen=155]="SpringGreen",O[O.SteelBlue=156]="SteelBlue",O[O.Tan=157]="Tan",O[O.Teal=158]="Teal",O[O.Thistle=159]="Thistle",O[O.Tomato=160]="Tomato",O[O.Turquoise=161]="Turquoise",O[O.Violet=162]="Violet",O[O.Wheat=163]="Wheat",O[O.White=164]="White",O[O.WhiteSmoke=165]="WhiteSmoke",O[O.Yellow=166]="Yellow",O[O.YellowGreen=167]="YellowGreen",O[O.ButtonFace=168]="ButtonFace",O[O.ButtonHighlight=169]="ButtonHighlight",O[O.ButtonShadow=170]="ButtonShadow",O[O.GradientActiveCaption=171]="GradientActiveCaption",O[O.GradientInactiveCaption=172]="GradientInactiveCaption",O[O.MenuBar=173]="MenuBar",O[O.MenuHighlight=174]="MenuHighlight";Object.defineProperty(x,"AliceBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.AliceBlue)?this.sBrushes.getValue(B.AliceBlue):t)?this.getBrush(B.AliceBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"AntiqueWhite",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.AntiqueWhite)?this.sBrushes.getValue(B.AntiqueWhite):t)?this.getBrush(B.AntiqueWhite):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Aqua",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Aqua)?this.sBrushes.getValue(B.Aqua):t)?this.getBrush(B.Aqua):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Aquamarine",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Aquamarine)?this.sBrushes.getValue(B.Aquamarine):t)?this.getBrush(B.Aquamarine):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Azure",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Azure)?this.sBrushes.getValue(B.Azure):t)?this.getBrush(B.Azure):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Beige",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Beige)?this.sBrushes.getValue(B.Beige):t)?this.getBrush(B.Beige):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Bisque",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Bisque)?this.sBrushes.getValue(B.Bisque):t)?this.getBrush(B.Bisque):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Black",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Black)?this.sBrushes.getValue(B.Black):t)?this.getBrush(B.Black):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"BlanchedAlmond",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.BlanchedAlmond)?this.sBrushes.getValue(B.BlanchedAlmond):t)?this.getBrush(B.BlanchedAlmond):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Blue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Blue)?this.sBrushes.getValue(B.Blue):t)?this.getBrush(B.Blue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"BlueViolet",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.BlueViolet)?this.sBrushes.getValue(B.BlueViolet):t)?this.getBrush(B.BlueViolet):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Brown",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Brown)?this.sBrushes.getValue(B.Brown):t)?this.getBrush(B.Brown):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"BurlyWood",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.BurlyWood)?this.sBrushes.getValue(B.BurlyWood):t)?this.getBrush(B.BurlyWood):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"CadetBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.CadetBlue)?this.sBrushes.getValue(B.CadetBlue):t)?this.getBrush(B.CadetBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Chartreuse",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Chartreuse)?this.sBrushes.getValue(B.Chartreuse):t)?this.getBrush(B.Chartreuse):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Chocolate",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Chocolate)?this.sBrushes.getValue(B.Chocolate):t)?this.getBrush(B.Chocolate):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Coral",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Coral)?this.sBrushes.getValue(B.Coral):t)?this.getBrush(B.Coral):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"CornflowerBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.CornflowerBlue)?this.sBrushes.getValue(B.CornflowerBlue):t)?this.getBrush(B.CornflowerBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Cornsilk",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Cornsilk)?this.sBrushes.getValue(B.Cornsilk):t)?this.getBrush(B.Cornsilk):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Crimson",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Crimson)?this.sBrushes.getValue(B.Crimson):t)?this.getBrush(B.Crimson):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Cyan",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Cyan)?this.sBrushes.getValue(B.Cyan):t)?this.getBrush(B.Cyan):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkBlue)?this.sBrushes.getValue(B.DarkBlue):t)?this.getBrush(B.DarkBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkCyan",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkCyan)?this.sBrushes.getValue(B.DarkCyan):t)?this.getBrush(B.DarkCyan):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkGoldenrod",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkGoldenrod)?this.sBrushes.getValue(B.DarkGoldenrod):t)?this.getBrush(B.DarkGoldenrod):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkGray)?this.sBrushes.getValue(B.DarkGray):t)?this.getBrush(B.DarkGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkGreen)?this.sBrushes.getValue(B.DarkGreen):t)?this.getBrush(B.DarkGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkKhaki",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkKhaki)?this.sBrushes.getValue(B.DarkKhaki):t)?this.getBrush(B.DarkKhaki):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkMagenta",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkMagenta)?this.sBrushes.getValue(B.DarkMagenta):t)?this.getBrush(B.DarkMagenta):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkOliveGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkOliveGreen)?this.sBrushes.getValue(B.DarkOliveGreen):t)?this.getBrush(B.DarkOliveGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkOrange",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkOrange)?this.sBrushes.getValue(B.DarkOrange):t)?this.getBrush(B.DarkOrange):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkOrchid",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkOrchid)?this.sBrushes.getValue(B.DarkOrchid):t)?this.getBrush(B.DarkOrchid):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkRed)?this.sBrushes.getValue(B.DarkRed):t)?this.getBrush(B.DarkRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkSalmon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkSalmon)?this.sBrushes.getValue(B.DarkSalmon):t)?this.getBrush(B.DarkSalmon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkSeaGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkSeaGreen)?this.sBrushes.getValue(B.DarkSeaGreen):t)?this.getBrush(B.DarkSeaGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkSlateBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkSlateBlue)?this.sBrushes.getValue(B.DarkSlateBlue):t)?this.getBrush(B.DarkSlateBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkSlateGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkSlateGray)?this.sBrushes.getValue(B.DarkSlateGray):t)?this.getBrush(B.DarkSlateGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkTurquoise",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkTurquoise)?this.sBrushes.getValue(B.DarkTurquoise):t)?this.getBrush(B.DarkTurquoise):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DarkViolet",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DarkViolet)?this.sBrushes.getValue(B.DarkViolet):t)?this.getBrush(B.DarkViolet):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DeepPink",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DeepPink)?this.sBrushes.getValue(B.DeepPink):t)?this.getBrush(B.DeepPink):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DeepSkyBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DeepSkyBlue)?this.sBrushes.getValue(B.DeepSkyBlue):t)?this.getBrush(B.DeepSkyBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DimGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DimGray)?this.sBrushes.getValue(B.DimGray):t)?this.getBrush(B.DimGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"DodgerBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.DodgerBlue)?this.sBrushes.getValue(B.DodgerBlue):t)?this.getBrush(B.DodgerBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Firebrick",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Firebrick)?this.sBrushes.getValue(B.Firebrick):t)?this.getBrush(B.Firebrick):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"FloralWhite",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.FloralWhite)?this.sBrushes.getValue(B.FloralWhite):t)?this.getBrush(B.FloralWhite):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"ForestGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.ForestGreen)?this.sBrushes.getValue(B.ForestGreen):t)?this.getBrush(B.ForestGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Fuchsia",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Fuchsia)?this.sBrushes.getValue(B.Fuchsia):t)?this.getBrush(B.Fuchsia):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Gainsboro",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Gainsboro)?this.sBrushes.getValue(B.Gainsboro):t)?this.getBrush(B.Gainsboro):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"GhostWhite",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.GhostWhite)?this.sBrushes.getValue(B.GhostWhite):t)?this.getBrush(B.GhostWhite):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Gold",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Gold)?this.sBrushes.getValue(B.Gold):t)?this.getBrush(B.Gold):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Goldenrod",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Goldenrod)?this.sBrushes.getValue(B.Goldenrod):t)?this.getBrush(B.Goldenrod):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Gray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Gray)?this.sBrushes.getValue(B.Gray):t)?this.getBrush(B.Gray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Green",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Green)?this.sBrushes.getValue(B.Green):t)?this.getBrush(B.Green):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"GreenYellow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.GreenYellow)?this.sBrushes.getValue(B.GreenYellow):t)?this.getBrush(B.GreenYellow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Honeydew",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Honeydew)?this.sBrushes.getValue(B.Honeydew):t)?this.getBrush(B.Honeydew):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"HotPink",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.HotPink)?this.sBrushes.getValue(B.HotPink):t)?this.getBrush(B.HotPink):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"IndianRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.IndianRed)?this.sBrushes.getValue(B.IndianRed):t)?this.getBrush(B.IndianRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Indigo",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Indigo)?this.sBrushes.getValue(B.Indigo):t)?this.getBrush(B.Indigo):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Ivory",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Ivory)?this.sBrushes.getValue(B.Ivory):t)?this.getBrush(B.Ivory):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Khaki",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Khaki)?this.sBrushes.getValue(B.Khaki):t)?this.getBrush(B.Khaki):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Lavender",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Lavender)?this.sBrushes.getValue(B.Lavender):t)?this.getBrush(B.Lavender):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LavenderBlush",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LavenderBlush)?this.sBrushes.getValue(B.LavenderBlush):t)?this.getBrush(B.LavenderBlush):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LawnGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LawnGreen)?this.sBrushes.getValue(B.LawnGreen):t)?this.getBrush(B.LawnGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LemonChiffon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LemonChiffon)?this.sBrushes.getValue(B.LemonChiffon):t)?this.getBrush(B.LemonChiffon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightBlue)?this.sBrushes.getValue(B.LightBlue):t)?this.getBrush(B.LightBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightCoral",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightCoral)?this.sBrushes.getValue(B.LightCoral):t)?this.getBrush(B.LightCoral):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightCyan",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightCyan)?this.sBrushes.getValue(B.LightCyan):t)?this.getBrush(B.LightCyan):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightGoldenrodYellow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightGoldenrodYellow)?this.sBrushes.getValue(B.LightGoldenrodYellow):t)?this.getBrush(B.LightGoldenrodYellow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightGray)?this.sBrushes.getValue(B.LightGray):t)?this.getBrush(B.LightGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightGreen)?this.sBrushes.getValue(B.LightGreen):t)?this.getBrush(B.LightGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightPink",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightPink)?this.sBrushes.getValue(B.LightPink):t)?this.getBrush(B.LightPink):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSalmon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSalmon)?this.sBrushes.getValue(B.LightSalmon):t)?this.getBrush(B.LightSalmon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSeaGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSeaGreen)?this.sBrushes.getValue(B.LightSeaGreen):t)?this.getBrush(B.LightSeaGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSkyBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSkyBlue)?this.sBrushes.getValue(B.LightSkyBlue):t)?this.getBrush(B.LightSkyBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSlateGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSlateGray)?this.sBrushes.getValue(B.LightSlateGray):t)?this.getBrush(B.LightSlateGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightSteelBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightSteelBlue)?this.sBrushes.getValue(B.LightSteelBlue):t)?this.getBrush(B.LightSteelBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LightYellow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LightYellow)?this.sBrushes.getValue(B.LightYellow):t)?this.getBrush(B.LightYellow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Lime",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Lime)?this.sBrushes.getValue(B.Lime):t)?this.getBrush(B.Lime):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"LimeGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.LimeGreen)?this.sBrushes.getValue(B.LimeGreen):t)?this.getBrush(B.LimeGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Linen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Linen)?this.sBrushes.getValue(B.Linen):t)?this.getBrush(B.Linen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Magenta",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Magenta)?this.sBrushes.getValue(B.Magenta):t)?this.getBrush(B.Magenta):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Maroon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Maroon)?this.sBrushes.getValue(B.Maroon):t)?this.getBrush(B.Maroon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumAquamarine",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumAquamarine)?this.sBrushes.getValue(B.MediumAquamarine):t)?this.getBrush(B.MediumAquamarine):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumBlue)?this.sBrushes.getValue(B.MediumBlue):t)?this.getBrush(B.MediumBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumOrchid",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumOrchid)?this.sBrushes.getValue(B.MediumOrchid):t)?this.getBrush(B.MediumOrchid):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumPurple",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumPurple)?this.sBrushes.getValue(B.MediumPurple):t)?this.getBrush(B.MediumPurple):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumSeaGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumSeaGreen)?this.sBrushes.getValue(B.MediumSeaGreen):t)?this.getBrush(B.MediumSeaGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumSlateBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumSlateBlue)?this.sBrushes.getValue(B.MediumSlateBlue):t)?this.getBrush(B.MediumSlateBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumSpringGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumSpringGreen)?this.sBrushes.getValue(B.MediumSpringGreen):t)?this.getBrush(B.MediumSpringGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumTurquoise",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumTurquoise)?this.sBrushes.getValue(B.MediumTurquoise):t)?this.getBrush(B.MediumTurquoise):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MediumVioletRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MediumVioletRed)?this.sBrushes.getValue(B.MediumVioletRed):t)?this.getBrush(B.MediumVioletRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MidnightBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MidnightBlue)?this.sBrushes.getValue(B.MidnightBlue):t)?this.getBrush(B.MidnightBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MintCream",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MintCream)?this.sBrushes.getValue(B.MintCream):t)?this.getBrush(B.MintCream):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"MistyRose",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.MistyRose)?this.sBrushes.getValue(B.MistyRose):t)?this.getBrush(B.MistyRose):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Moccasin",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Moccasin)?this.sBrushes.getValue(B.Moccasin):t)?this.getBrush(B.Moccasin):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"NavajoWhite",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.NavajoWhite)?this.sBrushes.getValue(B.NavajoWhite):t)?this.getBrush(B.NavajoWhite):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Navy",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Navy)?this.sBrushes.getValue(B.Navy):t)?this.getBrush(B.Navy):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"OldLace",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.OldLace)?this.sBrushes.getValue(B.OldLace):t)?this.getBrush(B.OldLace):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Olive",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Olive)?this.sBrushes.getValue(B.Olive):t)?this.getBrush(B.Olive):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"OliveDrab",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.OliveDrab)?this.sBrushes.getValue(B.OliveDrab):t)?this.getBrush(B.OliveDrab):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Orange",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Orange)?this.sBrushes.getValue(B.Orange):t)?this.getBrush(B.Orange):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"OrangeRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.OrangeRed)?this.sBrushes.getValue(B.OrangeRed):t)?this.getBrush(B.OrangeRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Orchid",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Orchid)?this.sBrushes.getValue(B.Orchid):t)?this.getBrush(B.Orchid):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PaleGoldenrod",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PaleGoldenrod)?this.sBrushes.getValue(B.PaleGoldenrod):t)?this.getBrush(B.PaleGoldenrod):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PaleGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PaleGreen)?this.sBrushes.getValue(B.PaleGreen):t)?this.getBrush(B.PaleGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PaleTurquoise",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PaleTurquoise)?this.sBrushes.getValue(B.PaleTurquoise):t)?this.getBrush(B.PaleTurquoise):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PaleVioletRed",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PaleVioletRed)?this.sBrushes.getValue(B.PaleVioletRed):t)?this.getBrush(B.PaleVioletRed):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PapayaWhip",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PapayaWhip)?this.sBrushes.getValue(B.PapayaWhip):t)?this.getBrush(B.PapayaWhip):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PeachPuff",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PeachPuff)?this.sBrushes.getValue(B.PeachPuff):t)?this.getBrush(B.PeachPuff):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Peru",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Peru)?this.sBrushes.getValue(B.Peru):t)?this.getBrush(B.Peru):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Pink",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Pink)?this.sBrushes.getValue(B.Pink):t)?this.getBrush(B.Pink):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Plum",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Plum)?this.sBrushes.getValue(B.Plum):t)?this.getBrush(B.Plum):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"PowderBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.PowderBlue)?this.sBrushes.getValue(B.PowderBlue):t)?this.getBrush(B.PowderBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Purple",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Purple)?this.sBrushes.getValue(B.Purple):t)?this.getBrush(B.Purple):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Red",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Red)?this.sBrushes.getValue(B.Red):t)?this.getBrush(B.Red):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"RosyBrown",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.RosyBrown)?this.sBrushes.getValue(B.RosyBrown):t)?this.getBrush(B.RosyBrown):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"RoyalBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.RoyalBlue)?this.sBrushes.getValue(B.RoyalBlue):t)?this.getBrush(B.RoyalBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SaddleBrown",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SaddleBrown)?this.sBrushes.getValue(B.SaddleBrown):t)?this.getBrush(B.SaddleBrown):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Salmon",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Salmon)?this.sBrushes.getValue(B.Salmon):t)?this.getBrush(B.Salmon):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SandyBrown",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SandyBrown)?this.sBrushes.getValue(B.SandyBrown):t)?this.getBrush(B.SandyBrown):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SeaGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SeaGreen)?this.sBrushes.getValue(B.SeaGreen):t)?this.getBrush(B.SeaGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SeaShell",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SeaShell)?this.sBrushes.getValue(B.SeaShell):t)?this.getBrush(B.SeaShell):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Sienna",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Sienna)?this.sBrushes.getValue(B.Sienna):t)?this.getBrush(B.Sienna):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Silver",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Silver)?this.sBrushes.getValue(B.Silver):t)?this.getBrush(B.Silver):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SkyBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SkyBlue)?this.sBrushes.getValue(B.SkyBlue):t)?this.getBrush(B.SkyBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SlateBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SlateBlue)?this.sBrushes.getValue(B.SlateBlue):t)?this.getBrush(B.SlateBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SlateGray",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SlateGray)?this.sBrushes.getValue(B.SlateGray):t)?this.getBrush(B.SlateGray):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Snow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Snow)?this.sBrushes.getValue(B.Snow):t)?this.getBrush(B.Snow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SpringGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SpringGreen)?this.sBrushes.getValue(B.SpringGreen):t)?this.getBrush(B.SpringGreen):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"SteelBlue",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.SteelBlue)?this.sBrushes.getValue(B.SteelBlue):t)?this.getBrush(B.SteelBlue):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Tan",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Tan)?this.sBrushes.getValue(B.Tan):t)?this.getBrush(B.Tan):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Teal",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Teal)?this.sBrushes.getValue(B.Teal):t)?this.getBrush(B.Teal):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Thistle",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Thistle)?this.sBrushes.getValue(B.Thistle):t)?this.getBrush(B.Thistle):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Tomato",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Tomato)?this.sBrushes.getValue(B.Tomato):t)?this.getBrush(B.Tomato):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Transparent",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Transparent)?this.sBrushes.getValue(B.Transparent):t)?this.getBrush(B.Transparent):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Turquoise",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Turquoise)?this.sBrushes.getValue(B.Turquoise):t)?this.getBrush(B.Turquoise):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Violet",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Violet)?this.sBrushes.getValue(B.Violet):t)?this.getBrush(B.Violet):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Wheat",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Wheat)?this.sBrushes.getValue(B.Wheat):t)?this.getBrush(B.Wheat):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"White",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.White)?this.sBrushes.getValue(B.White):t)?this.getBrush(B.White):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"WhiteSmoke",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.WhiteSmoke)?this.sBrushes.getValue(B.WhiteSmoke):t)?this.getBrush(B.WhiteSmoke):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"Yellow",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.Yellow)?this.sBrushes.getValue(B.Yellow):t)?this.getBrush(B.Yellow):t},enumerable:!0,configurable:!0}),Object.defineProperty(x,"YellowGreen",{get:function(){var t=null;return t=null==(t=this.sBrushes.containsKey(B.YellowGreen)?this.sBrushes.getValue(B.YellowGreen):t)?this.getBrush(B.YellowGreen):t},enumerable:!0,configurable:!0}),x.getBrush=function(t){var e=this.getColorValue(t),e=new mt(e);return this.sBrushes.setValue(t,e),e},x.getColorValue=function(t){var e=new f;switch(t){case B.Transparent:e=new f(0,255,255,255);break;case B.AliceBlue:e=new f(255,240,248,255);break;case B.AntiqueWhite:e=new f(255,250,235,215);break;case B.Aqua:e=new f(255,0,255,255);break;case B.Aquamarine:e=new f(255,127,255,212);break;case B.Azure:e=new f(255,240,255,255);break;case B.Beige:e=new f(255,245,245,220);break;case B.Bisque:e=new f(255,255,228,196);break;case B.Black:e=new f(255,0,0,0);break;case B.BlanchedAlmond:e=new f(255,255,235,205);break;case B.Blue:e=new f(255,0,0,255);break;case B.BlueViolet:e=new f(255,138,43,226);break;case B.Brown:e=new f(255,165,42,42);break;case B.BurlyWood:e=new f(255,222,184,135);break;case B.CadetBlue:e=new f(255,95,158,160);break;case B.Chartreuse:e=new f(255,127,255,0);break;case B.Chocolate:e=new f(255,210,105,30);break;case B.Coral:e=new f(255,255,127,80);break;case B.CornflowerBlue:e=new f(255,100,149,237);break;case B.Cornsilk:e=new f(255,255,248,220);break;case B.Crimson:e=new f(255,220,20,60);break;case B.Cyan:e=new f(255,0,255,255);break;case B.DarkBlue:e=new f(255,0,0,139);break;case B.DarkCyan:e=new f(255,0,139,139);break;case B.DarkGoldenrod:e=new f(255,184,134,11);break;case B.DarkGray:e=new f(255,169,169,169);break;case B.DarkGreen:e=new f(255,0,100,0);break;case B.DarkKhaki:e=new f(255,189,183,107);break;case B.DarkMagenta:e=new f(255,139,0,139);break;case B.DarkOliveGreen:e=new f(255,85,107,47);break;case B.DarkOrange:e=new f(255,255,140,0);break;case B.DarkOrchid:e=new f(255,153,50,204);break;case B.DarkRed:e=new f(255,139,0,0);break;case B.DarkSalmon:e=new f(255,233,150,122);break;case B.DarkSeaGreen:e=new f(255,143,188,139);break;case B.DarkSlateBlue:e=new f(255,72,61,139);break;case B.DarkSlateGray:e=new f(255,47,79,79);break;case B.DarkTurquoise:e=new f(255,0,206,209);break;case B.DarkViolet:e=new f(255,148,0,211);break;case B.DeepPink:e=new f(255,255,20,147);break;case B.DeepSkyBlue:e=new f(255,0,191,255);break;case B.DimGray:e=new f(255,105,105,105);break;case B.DodgerBlue:e=new f(255,30,144,255);break;case B.Firebrick:e=new f(255,178,34,34);break;case B.FloralWhite:e=new f(255,255,250,240);break;case B.ForestGreen:e=new f(255,34,139,34);break;case B.Fuchsia:e=new f(255,255,0,255);break;case B.Gainsboro:e=new f(255,220,220,220);break;case B.GhostWhite:e=new f(255,248,248,255);break;case B.Gold:e=new f(255,255,215,0);break;case B.Goldenrod:e=new f(255,218,165,32);break;case B.Gray:e=new f(255,128,128,128);break;case B.Green:e=new f(255,0,128,0);break;case B.GreenYellow:e=new f(255,173,255,47);break;case B.Honeydew:e=new f(255,240,255,240);break;case B.HotPink:e=new f(255,255,105,180);break;case B.IndianRed:e=new f(255,205,92,92);break;case B.Indigo:e=new f(255,75,0,130);break;case B.Ivory:e=new f(255,255,255,240);break;case B.Khaki:e=new f(255,240,230,140);break;case B.Lavender:e=new f(255,230,230,250);break;case B.LavenderBlush:e=new f(255,255,240,245);break;case B.LawnGreen:e=new f(255,124,252,0);break;case B.LemonChiffon:e=new f(255,255,250,205);break;case B.LightBlue:e=new f(255,173,216,230);break;case B.LightCoral:e=new f(255,240,128,128);break;case B.LightCyan:e=new f(255,224,255,255);break;case B.LightGoldenrodYellow:e=new f(255,250,250,210);break;case B.LightGreen:e=new f(255,144,238,144);break;case B.LightGray:e=new f(255,211,211,211);break;case B.LightPink:e=new f(255,255,182,193);break;case B.LightSalmon:e=new f(255,255,160,122);break;case B.LightSeaGreen:e=new f(255,32,178,170);break;case B.LightSkyBlue:e=new f(255,135,206,250);break;case B.LightSlateGray:e=new f(255,119,136,153);break;case B.LightSteelBlue:e=new f(255,176,196,222);break;case B.LightYellow:e=new f(255,255,255,224);break;case B.Lime:e=new f(255,0,255,0);break;case B.LimeGreen:e=new f(255,50,205,50);break;case B.Linen:e=new f(255,250,240,230);break;case B.Magenta:e=new f(255,255,0,255);break;case B.Maroon:e=new f(255,128,0,0);break;case B.MediumAquamarine:e=new f(255,102,205,170);break;case B.MediumBlue:e=new f(255,0,0,205);break;case B.MediumOrchid:e=new f(255,186,85,211);break;case B.MediumPurple:e=new f(255,147,112,219);break;case B.MediumSeaGreen:e=new f(255,60,179,113);break;case B.MediumSlateBlue:e=new f(255,123,104,238);break;case B.MediumSpringGreen:e=new f(255,0,250,154);break;case B.MediumTurquoise:e=new f(255,72,209,204);break;case B.MediumVioletRed:e=new f(255,199,21,133);break;case B.MidnightBlue:e=new f(255,25,25,112);break;case B.MintCream:e=new f(255,245,255,250);break;case B.MistyRose:e=new f(255,255,228,225);break;case B.Moccasin:e=new f(255,255,228,181);break;case B.NavajoWhite:e=new f(255,255,222,173);break;case B.Navy:e=new f(255,0,0,128);break;case B.OldLace:e=new f(255,253,245,230);break;case B.Olive:e=new f(255,128,128,0);break;case B.OliveDrab:e=new f(255,107,142,35);break;case B.Orange:e=new f(255,255,165,0);break;case B.OrangeRed:e=new f(255,255,69,0);break;case B.Orchid:e=new f(255,218,112,214);break;case B.PaleGoldenrod:e=new f(255,238,232,170);break;case B.PaleGreen:e=new f(255,152,251,152);break;case B.PaleTurquoise:e=new f(255,175,238,238);break;case B.PaleVioletRed:e=new f(255,219,112,147);break;case B.PapayaWhip:e=new f(255,255,239,213);break;case B.PeachPuff:e=new f(255,255,218,185);break;case B.Peru:e=new f(255,205,133,63);break;case B.Pink:e=new f(255,255,192,203);break;case B.Plum:e=new f(255,221,160,221);break;case B.PowderBlue:e=new f(255,176,224,230);break;case B.Purple:e=new f(255,128,0,128);break;case B.Red:e=new f(255,255,0,0);break;case B.RosyBrown:e=new f(255,188,143,143);break;case B.RoyalBlue:e=new f(255,65,105,225);break;case B.SaddleBrown:e=new f(255,139,69,19);break;case B.Salmon:e=new f(255,250,128,114);break;case B.SandyBrown:e=new f(255,244,164,96);break;case B.SeaGreen:e=new f(255,46,139,87);break;case B.SeaShell:e=new f(255,255,245,238);break;case B.Sienna:e=new f(255,160,82,45);break;case B.Silver:e=new f(255,192,192,192);break;case B.SkyBlue:e=new f(255,135,206,235);break;case B.SlateBlue:e=new f(255,106,90,205);break;case B.SlateGray:e=new f(255,112,128,144);break;case B.Snow:e=new f(255,255,250,250);break;case B.SpringGreen:e=new f(255,0,255,127);break;case B.SteelBlue:e=new f(255,70,130,180);break;case B.Tan:e=new f(255,210,180,140);break;case B.Teal:e=new f(255,0,128,128);break;case B.Thistle:e=new f(255,216,191,216);break;case B.Tomato:e=new f(255,255,99,71);break;case B.Turquoise:e=new f(255,64,224,208);break;case B.Violet:e=new f(255,238,130,238);break;case B.Wheat:e=new f(255,245,222,179);break;case B.White:e=new f(255,255,255,255);break;case B.WhiteSmoke:e=new f(255,245,245,245);break;case B.Yellow:e=new f(255,255,255,0);break;case B.YellowGreen:e=new f(255,154,205,50)}return e},x.sBrushes=new a;var O=x;function x(){}Object.defineProperty(uo.prototype,"factors",{get:function(){return this.mFactors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Factors");this.mFactors=t},enumerable:!0,configurable:!0}),Object.defineProperty(uo.prototype,"positions",{get:function(){return this.mPositions},set:function(t){for(var e=t,i=0;i<e.length;i++)(e[i]<0||1<e[i])&&(e[i]=0);this.mPositions=e,this.mPositions=t},enumerable:!0,configurable:!0}),Object.defineProperty(uo.prototype,"count",{get:function(){return this.mCount},enumerable:!0,configurable:!0}),uo.prototype.generateColorBlend=function(t,e){if(null==t)throw new Error("ArgumentNullException : colours");null==this.positions&&(this.positions=[0]);var i=new fo(this.count),r=this.positions,n=null;if(1===r.length)(r=[3])[0]=0,r[1]=this.positions[0],r[2]=1,(n=new Array(3))[0]=t[0],n[1]=t[0],n[2]=t[1];else for(var o=t[0],s=t[1],n=new Array(this.count),a=0,h=this.count,a=0;a<h;++a)n[a]=this.interpolate(this.mFactors[a],o,s,e);return i.positions=r,i.colors=n,i},uo.prototype.clonePdfBlend=function(){return null!=this.mFactors&&(this.factors=this.mFactors),null!=this.positions&&(this.positions=this.positions),this},uo.prototype.gcd=function(t,e){if("number"==typeof t&&"number"==typeof e&&void 0!==e){if(t<0||1<t)throw new Error("ArgumentOutOfRangeException : u");if(e<0||1<e)throw new Error("ArgumentOutOfRangeException : v");var i=Math.max(1,t*this.precision),e=Math.max(1,e*this.precision);return this.gcdInt(i,e)/this.precision}var r=t;if(null==r)throw new Error("ArgumentNullException : values");if(r.length<1)throw new Error("ArgumentException : Not enough values in the array. - values");var n=r[0];if(1<r.length)for(var o=r.length,s=1;s<o&&(n=this.gcd(r[s],n))!==1/this.precision;++s);return n},uo.prototype.gcdInt=function(t,e){if(t<=0)throw new Error("ArgumentOutOfRangeException"+t+"The arguments cannot be less or equal to zero.");if(e<=0)throw new Error("ArgumentOutOfRangeException"+e+"The arguments cannot be less or equal to zero.");if(1===t||1===e)return 1;for(var i,r=0;this.isEven(t,e);)++r,t>>=1,e>>=1;for(;(1&t)<=0;)t>>=1;do{for(;(1&e)<=0;)e>>=1}while(e<t&&(i=e,e=t,t=i),0!==(e-=t));return t<<r},uo.prototype.isEven=function(t,e){return"number"==typeof e&&void 0!==e?(1&t)<=0&&(1&e)<=0:(1&t)<=0},uo.prototype.interpolate=function(t,e,i,r){if(e instanceof f){var n=new f;switch(r){case Y.PdfColorSpace.Rgb:var o=this.interpolate(t,e.red,i.red),s=this.interpolate(t,e.green,i.green),a=this.interpolate(t,e.blue,i.blue),n=new f(o,s,a);break;case Y.PdfColorSpace.GrayScale:o=this.interpolate(t,e.gray,i.gray);n=new f(o);break;case Y.PdfColorSpace.Cmyk:var s=this.interpolate(t,e.c,i.c),a=this.interpolate(t,e.m,i.m),o=this.interpolate(t,e.y,i.y),h=this.interpolate(t,e.k,i.k);n=new f(s,a,o,h)}return n}return 0===t?e:1===t?i:e+ +t*(i-e)};var lo=uo;function uo(t){this.precision=1e3}co=function(t,e){return(co=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}co(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(go,po=lo),Object.defineProperty(go.prototype,"colors",{get:function(){return this.mcolors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Colors");this.mcolors=t},enumerable:!0,configurable:!0}),go.prototype.getFunction=function(t){var e,i,r,n,o=this.getColorComponentsCount(t),s=this.getMaxComponentValue(t),o=this.setRange(o,s),a=null;return null==this.mbrush&&void 0===this.mbrush?(e=[1],r=void 0,i=1,r=2===this.positions.length?2:(n=this.positions,n=this.getIntervals(n),1/(i=this.gcd(n))+1),e[0]=r,n=this.getSamplesValues(t,r,s,i),new ao([0,1],o,e,n)):a},go.prototype.cloneColorBlend=function(){return null!=this.mcolors&&void 0!==this.mcolors&&(this.colors=this.mcolors),null!=this.positions&&void 0!==this.positions&&(this.positions=this.positions),this},go.prototype.setRange=function(t,e){for(var i=[2*t],r=0;r<t;++r)i[2*r]=0,i[2*r+1]=1;return i},go.prototype.getColorComponentsCount=function(t){var e=0;switch(t){case Y.PdfColorSpace.Rgb:e=3;break;case Y.PdfColorSpace.Cmyk:e=4;break;case Y.PdfColorSpace.GrayScale:e=1;break;default:throw new Error("ArgumentException - Unsupported color space: "+t+" colorSpace")}return e},go.prototype.getSamplesValues=function(t,e,i,r){var n;switch(t){case Y.PdfColorSpace.GrayScale:n=this.getGrayscaleSamples(e,i,r);break;case Y.PdfColorSpace.Cmyk:n=this.getCmykSamples(e,i,r);break;case Y.PdfColorSpace.Rgb:n=this.getRgbSamples(e,i,r);break;default:throw new Error("ArgumentException - Unsupported color space: "+t+" colorSpace")}return n},go.prototype.getGrayscaleSamples=function(t,e,i){for(var r=[2*t],n=0;n<t;++n)this.getNextColor(n,i,Y.PdfColorSpace.GrayScale);return r},go.prototype.getRgbSamples=function(t,e,i){for(var r=[3*t],n=0;n<t;++n){var o=this.getNextColor(n,i,Y.PdfColorSpace.Rgb),s=3*n;r[s]=o.r,r[1+s]=o.g,r[2+s]=o.b}return r},go.prototype.getCmykSamples=function(t,e,i){for(var r=[4*t],n=0;n<t;n++){var o=this.getNextColor(n,i,Y.PdfColorSpace.Cmyk),s=4*n;r[s]=o.c*e,r[1+s]=o.m*e,r[2+s]=o.y*e,r[3+s]=o.k*e}return r},go.prototype.getNextColor=function(t,e,i){var r,n,e=e*t,t=this.getIndices(e,void 0,void 0),o=t.indexLow,t=t.indexHi;return o===t?this.mcolors[o]:(r=this.positions[o],n=this.positions[t],o=this.mcolors[o],t=this.mcolors[t],this.interpolate((e-r)/(n-r),o,t,i))},go.prototype.getIndices=function(t,e,i){for(var r=this.positions,n=i=e=0;n<this.mcolors.length;++n){var o=r[n];if(o===t){e=i=n;break}if(t<o){i=n;break}i=e=n}return{indexLow:e,indexHi:i}},go.prototype.getMaxComponentValue=function(t){var e=0;switch(t){case Y.PdfColorSpace.Cmyk:case Y.PdfColorSpace.Rgb:e=255;break;case Y.PdfColorSpace.GrayScale:e=65535;break;default:throw new Error("ArgumentException - Unsupported color space: "+t+"colorSpace")}return e},go.prototype.getIntervals=function(t){for(var e=t.length,i=[e-1],r=t[0],n=1;n<e;++n){var o=t[n];i[n-1]=o-r,r=o}return i};var co,po,fo=go;function go(t){var e=po.call(this)||this;return e="number"==typeof t?po.call(this,t)||this:e}mo=function(t,e){return(mo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}mo(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(wo,yo=xi),wo.prototype.initialize=function(t,e){this.mColours=[t,e],this.mColourBlend=new fo(2),this.mColourBlend.positions=[0,1],this.mColourBlend.colors=this.mColours,this.initShading()},Object.defineProperty(wo.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColours)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"interpolationColors",{get:function(){return this.mColourBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColours=null,this.mColourBlend=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"linearColors",{get:function(){return this.mColours},set:function(t){if(null==t)throw new Error("ArgumentNullException : LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small - LinearColors");null==this.mColours&&void 0===this.mColours?this.mColours=[t[0],t[1]]:(this.mColours[0]=t[0],this.mColours[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlend=new fo(2),this.mColourBlend.colors=this.mColours,this.mColourBlend.positions=[0,1]):this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"rectangle",{get:function(){return this.mBoundaries},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"extend",{get:function(){var t,e=no.None,i=this.shading.items.getValue(this.mDictionaryProperties.extend);return null!=i&&(t=i.items(0),i=i.items(1),t.value&&(e|=no.Start),i.value)&&(e|=no.End),e},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r?(e=new zt(!1),i=new zt(!1),(r=new p).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),r.items(1))},enumerable:!0,configurable:!0}),wo.prototype.addPoints=function(t,e){var i=t.x+e.x,t=t.y+e.y;return new J(i,t)},wo.prototype.subPoints=function(t,e){var i=t.x-e.x,t=t.y-e.y;return new J(i,t)},wo.prototype.mulPoints=function(t,e){return t.x*e.x+t.y*e.y},wo.prototype.mulPoint=function(t,e){return t.x=t.x*e,t.y=t.y*e,t},wo.prototype.choosePoint=function(t){var e=new J(0,0);if(t<90&&0<t)e=new J(this.mBoundaries.right,this.mBoundaries.bottom);else if(t<180&&90<t)e=new J(this.mBoundaries.left,this.mBoundaries.bottom);else if(t<270&&180<t)e=new J(this.mBoundaries.left,this.mBoundaries.top);else{if(!(270<t))throw new Error("PdfException - Internal error.");e=new J(this.mBoundaries.right,this.mBoundaries.top)}return e},wo.prototype.setPoints=function(t,e){var i=new p;i.add(new u(t.x)),i.add(new u(this.updateY(t.y))),i.add(new u(e.x)),i.add(new u(this.updateY(e.y))),this.shading.items.setValue(this.mDictionaryProperties.coords,i)},wo.prototype.updateY=function(t){return 0!==t?-t:t},wo.prototype.initShading=function(){this.colorSpace=Y.PdfColorSpace.Rgb,this.function=this.mColourBlend.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new u(so.Axial))},wo.prototype.clone=function(){var t=this;return t.resetPatternDictionary(new c(this.patternDictionary)),t.shading=new c,t.initShading(),t.setPoints(t.mPointStart,t.mPointEnd),null!==t&&t instanceof wo&&null!=this.matrix&&void 0!==this.matrix&&(t.matrix=this.matrix.clone()),null!=this.mColours&&void 0!==this.mColours&&(t.mColours=this.mColours),null!=this.blend&&void 0!==this.blend?t.blend=this.blend.clonePdfBlend():null!=this.interpolationColors&&void 0!==this.interpolationColors&&(t.interpolationColors=this.interpolationColors.cloneColorBlend()),t.extend=this.extend,this.cloneBackgroundValue(t),this.cloneAntiAliasingValue(t),t},wo.prototype.resetFunction=function(){this.function=this.mColourBlend.getFunction(this.colorSpace)};var mo,yo,bo=wo;function wo(t,e,i,r){var n,o,s,a=yo.call(this,new c)||this;if(a.mDictionaryProperties=new l,t instanceof J&&e instanceof J&&i instanceof f&&r instanceof f)a.initialize(i,r),a.mPointStart=t,a.mPointEnd=e,a.setPoints(a.mPointStart,a.mPointEnd);else if(t instanceof ut)if(a.initialize(e,i),r===oo.BackwardDiagonal||r===oo.ForwardDiagonal||r===oo.Horizontal||r===oo.Vertical){switch(a.mBoundaries=t,r){case oo.BackwardDiagonal:a.mPointStart=new J(t.right,t.top),a.mPointEnd=new J(t.left,t.bottom);break;case oo.ForwardDiagonal:a.mPointStart=new J(t.left,t.top),a.mPointEnd=new J(t.right,t.bottom);break;case oo.Horizontal:a.mPointStart=new J(t.left,t.top),a.mPointEnd=new J(t.right,t.top);break;case oo.Vertical:a.mPointStart=new J(t.left,t.top),a.mPointEnd=new J(t.left,t.bottom);break;default:throw new Error("ArgumentException -- Unsupported linear gradient mode: "+r+" mode")}a.setPoints(a.mPointStart,a.mPointEnd)}else"number"==typeof r&&void 0!==r&&(a.mBoundaries=t,0===(r%=360)?(a.mPointStart=new J(t.left,t.top),a.mPointEnd=new J(t.right,t.top)):90===r?(a.mPointStart=new J(t.left,t.top),a.mPointEnd=new J(t.left,t.bottom)):180===r?(a.mPointEnd=new J(t.left,t.top),a.mPointStart=new J(t.right,t.top)):270===r?(a.mPointEnd=new J(t.left,t.top),a.mPointStart=new J(t.left,t.bottom)):(e=r*(Math.PI/180),i=Math.tan(e),o=a.mBoundaries.left+(a.mBoundaries.right-a.mBoundaries.left)/2,s=a.mBoundaries.top+(a.mBoundaries.bottom-a.mBoundaries.top)/2,n=new J(o,s),s=i*(o=a.mBoundaries.width/(2*Math.cos(e))),o+=n.x,s+=n.y,i=new J(o,s),e=a.subPoints(i,n),o=a.choosePoint(r),s=a.mulPoints(a.subPoints(o,n),e)/a.mulPoints(e,e),a.mPointEnd=a.addPoints(n,a.mulPoint(e,s)),a.mPointStart=a.addPoints(n,a.mulPoint(e,-1*s))),a.setPoints(a.mPointEnd,a.mPointStart));return a}Po=function(t,e){return(Po=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Po(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Co,So=xi),Co.prototype.initialize=function(t,e){this.mColour=[t,e],this.mColourBlends=new fo(2),this.mColourBlends.positions=[0,1],this.mColourBlends.colors=this.mColour,this.initShading()},Object.defineProperty(Co.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColour&&void 0===this.mColour)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(Co.prototype,"interpolationColors",{get:function(){return this.mColourBlends},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColour=null,this.mColourBlends=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(Co.prototype,"linearColors",{get:function(){return this.mColour},set:function(t){if(null==t)throw new Error("ArgumentNullException : radial LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small LinearColors");null==this.mColour&&void 0===this.mColour?this.mColour=[t[0],t[1]]:(this.mColour[0]=t[0],this.mColour[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlends=new fo(2),this.mColourBlends.colors=this.mColour,this.mColourBlends.positions=[0,1]):this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(Co.prototype,"rectangle",{get:function(){return this.mBoundaries},set:function(t){this.mBoundaries=t,this.bBox=p.fromRectangle(t)},enumerable:!0,configurable:!0}),Object.defineProperty(Co.prototype,"extend",{get:function(){var t,e=no.None,i=this.shading.items.getValue(this.mDictionaryProperties.extend);return null!=i&&(t=i.items(0),i=i.items(1),t.value&&(e|=no.Start),i.value)&&(e|=no.End),e},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r&&void 0===r?(e=new zt(!1),i=new zt(!1),(r=new p).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),r.items(1))},enumerable:!0,configurable:!0}),Co.prototype.setPoints=function(t,e,i,r){var n=new p;n.add(new u(t.x)),n.add(new u(this.updateY(t.y))),n.add(new u(i)),n.add(new u(e.x)),n.add(new u(this.updateY(e.y))),i!==r?n.add(new u(r)):n.add(new u(0)),this.shading.items.setValue(this.mDictionaryProperties.coords,n)},Co.prototype.updateY=function(t){return 0!==t?-t:t},Co.prototype.initShading=function(){this.colorSpace=Y.PdfColorSpace.Rgb,this.function=this.mColourBlends.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new u(so.Radial))},Co.prototype.clone=function(){var t=this;return t.resetPatternDictionary(new c(this.patternDictionary)),t.shading=new c,t.initShading(),t.setPoints(this.mPointStart,this.mPointEnd,this.mRadiusStart,this.mRadiusEnd),t instanceof Co&&null!==this.matrix&&void 0!==this.matrix&&(t.matrix=this.matrix.clone()),null!==this.mColour&&void 0!==this.mColour&&(t.mColour=this.mColour),null!==this.blend&&void 0!==this.blend?t.blend=this.blend.clonePdfBlend():null!==this.interpolationColors&&void 0!==this.interpolationColors&&(t.interpolationColors=this.interpolationColors.cloneColorBlend()),t.extend=this.extend,this.cloneBackgroundValue(t),this.cloneAntiAliasingValue(t),t},Co.prototype.resetFunction=function(){this.function=this.mColourBlends.getFunction(this.colorSpace)};var Po,So,vo=Co;function Co(t,e,i,r,n,o){var s=So.call(this,new c)||this;if(s.mDictionaryProperties=new l,s.initialize(n,o),e<0)throw new Error("ArgumentOutOfRangeException : radiusStart - The radius cannot be less then zero.");if(r<0)throw new Error("ArgumentOutOfRangeException : radiusEnd - The radius cannpt be less then zero.");return s.mPointEnd=i,s.mPointStart=t,s.mRadiusStart=e,s.mRadiusEnd=r,s.setPoints(s.mPointStart,s.mPointEnd,s.mRadiusStart,s.mRadiusEnd),s}(L=Y.PdfBorderOverlapStyle||(Y.PdfBorderOverlapStyle={}))[L.Overlap=0]="Overlap",L[L.Inside=1]="Inside";Bo=function(t,e){return(Bo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Bo,L=function(t,e){function i(){this.constructor=t}Bo(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},Oo=(Object.defineProperty(xo.prototype,"backgroundBrush",{get:function(){return this.gridBackgroundBrush},set:function(t){this.gridBackgroundBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(xo.prototype,"textBrush",{get:function(){return this.gridTextBrush},set:function(t){this.gridTextBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(xo.prototype,"textPen",{get:function(){return this.gridTextPen},set:function(t){this.gridTextPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(xo.prototype,"font",{get:function(){return this.gridFont},set:function(t){this.gridFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(xo.prototype,"backgroundImage",{get:function(){return this.gridBackgroundImage},set:function(t){this.gridBackgroundImage=t},enumerable:!0,configurable:!0}),xo);function xo(){}L(jo,Lo=Oo),Object.defineProperty(jo.prototype,"cellSpacing",{get:function(){return void 0===this.gridCellSpacing&&(this.gridCellSpacing=0),this.gridCellSpacing},set:function(t){this.gridCellSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(jo.prototype,"horizontalOverflowType",{get:function(){return this.gridHorizontalOverflowType},set:function(t){this.gridHorizontalOverflowType=t},enumerable:!0,configurable:!0}),Object.defineProperty(jo.prototype,"allowHorizontalOverflow",{get:function(){return this.bAllowHorizontalOverflow},set:function(t){this.bAllowHorizontalOverflow=t},enumerable:!0,configurable:!0}),Object.defineProperty(jo.prototype,"cellPadding",{get:function(){return void 0===this.gridCellPadding&&(this.gridCellPadding=new sn),this.gridCellPadding},set:function(t){void 0===this.gridCellPadding&&(this.gridCellPadding=new sn),this.gridCellPadding=t},enumerable:!0,configurable:!0}),Object.defineProperty(jo.prototype,"borderOverlapStyle",{get:function(){return this.gridBorderOverlapStyle},set:function(t){this.gridBorderOverlapStyle=t},enumerable:!0,configurable:!0});var Lo,To=jo;function jo(){var t=Lo.call(this)||this;return t.gridBorderOverlapStyle=Y.PdfBorderOverlapStyle.Overlap,t.bAllowHorizontalOverflow=!1,t.gridHorizontalOverflowType=Y.PdfHorizontalOverflowType.LastPage,t}L(Ro,ko=Oo),Object.defineProperty(Ro.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ro.prototype,"borders",{get:function(){return this.gridCellBorders},set:function(t){this.gridCellBorders=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ro.prototype,"cellPadding",{get:function(){return this.gridCellPadding},set:function(t){null!=this.gridCellPadding&&void 0!==this.gridCellPadding||(this.gridCellPadding=new sn),this.gridCellPadding=t},enumerable:!0,configurable:!0});var ko,Vo=Ro;function Ro(){var t=ko.call(this)||this;return t.gridCellBorders=nn.default,t}Object.defineProperty(Ao.prototype,"backgroundBrush",{get:function(){return this.gridRowBackgroundBrush},enumerable:!0,configurable:!0}),Ao.prototype.setBackgroundBrush=function(t){if(this.gridRowBackgroundBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.backgroundBrush=t},Object.defineProperty(Ao.prototype,"textBrush",{get:function(){return this.gridRowTextBrush},enumerable:!0,configurable:!0}),Ao.prototype.setTextBrush=function(t){if(this.gridRowTextBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textBrush=t},Object.defineProperty(Ao.prototype,"textPen",{get:function(){return this.gridRowTextPen},enumerable:!0,configurable:!0}),Ao.prototype.setTextPen=function(t){if(this.gridRowTextPen=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textPen=t},Object.defineProperty(Ao.prototype,"font",{get:function(){return this.gridRowFont},enumerable:!0,configurable:!0}),Ao.prototype.setFont=function(t){if(this.gridRowFont=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.font=t},Object.defineProperty(Ao.prototype,"border",{get:function(){return void 0===this.gridRowBorder&&this.setBorder(new nn),this.gridRowBorder},enumerable:!0,configurable:!0}),Ao.prototype.setBorder=function(t){if(this.gridRowBorder=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.borders=t},Ao.prototype.setParent=function(t){this.parent=t},Object.defineProperty(Ao.prototype,"backgroundImage",{get:function(){return this.gridRowBackgroundImage},enumerable:!0,configurable:!0}),Ao.prototype.setBackgroundImage=function(t){this.gridRowBackgroundImage=t};var Mo=Ao;function Ao(){}(L=Y.PdfHorizontalOverflowType||(Y.PdfHorizontalOverflowType={}))[L.NextPage=0]="NextPage",L[L.LastPage=1]="LastPage";Object.defineProperty(T.prototype,"isCellMergeContinue",{get:function(){return this.internalIsCellMergeContinue},set:function(t){this.internalIsCellMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"isRowMergeContinue",{get:function(){return this.internalIsRowMergeContinue},set:function(t){this.internalIsRowMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"isCellMergeStart",{get:function(){return this.internalIsCellMergeStart},set:function(t){this.internalIsCellMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"isRowMergeStart",{get:function(){return this.internalIsRowMergeStart},set:function(t){this.internalIsRowMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"remainingString",{get:function(){return this.remaining},set:function(t){this.remaining=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"FinishedDrawingCell",{get:function(){return this.isFinish},set:function(t){this.isFinish=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"stringFormat",{get:function(){return null==this.format&&(this.format=new bt),this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"row",{get:function(){return this.gridRow},set:function(t){this.gridRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"value",{get:function(){return this.objectValue},set:function(t){if(this.objectValue=t,this.objectValue instanceof Xo){this.row.grid.isSingleGrid=!1;(this.objectValue.ParentCell=this).objectValue.isChildGrid=!0;for(var e=this.row.grid.rows.count,i=0;i<e;i++)for(var r=this.row.grid.rows.getRow(i),n=r.cells.count,o=0;o<n;o++)r.cells.getCell(o).parent=this}},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"rowSpan",{get:function(){return this.gridRowSpan},set:function(t){if(t<1)throw new Error("ArgumentException : Invalid span specified, must be greater than or equal to 1");this.gridRowSpan=t,this.row.rowSpanExists=!0,this.row.grid.hasRowSpanSpan=!0},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"style",{get:function(){return null==this.cellStyle&&(this.cellStyle=new Vo),this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(t){this.cellHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"columnSpan",{get:function(){return this.colSpan},set:function(t){if(t<1)throw Error("Invalid span specified, must be greater than or equal to 1");this.colSpan=t,this.row.columnSpanExists=!0},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"width",{get:function(){return 0!==this.cellWidth&&!this.row.grid.isComplete||(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(t){this.cellWidth=t},enumerable:!0,configurable:!0}),T.prototype.measureWidth=function(){var t,e=0,i=new vt;return"string"==typeof this.objectValue?e=(e+=i.layout(this.objectValue,this.getTextFont(),this.stringFormat,new X(Number.MAX_VALUE,Number.MAX_VALUE),!1,new X(0,0)).actualSize.width)+2*(this.style.borders.left.width+this.style.borders.right.width):this.objectValue instanceof Xo?e=this.objectValue.size.width:this.objectValue instanceof ke||this.objectValue instanceof Ae?e+=this.objectValue.width:this.objectValue instanceof jn&&(t=this.objectValue,e=(e+=i.layout(t.text,t.font,t.stringFormat,new X(0,0),!1,new X(0,0)).actualSize.width)+2*(this.style.borders.left.width+this.style.borders.right.width)),this.objectValue instanceof Xo?null!=this.style.cellPadding||void 0!==this.style.cellPadding?(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(e+=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(e+=this.style.cellPadding.right)):(void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(e+=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(e+=this.row.grid.style.cellPadding.right)):null!=this.style.cellPadding?e+=this.style.cellPadding.left+this.style.cellPadding.right:e+=this.row.grid.style.cellPadding.left+this.row.grid.style.cellPadding.right,e+=this.row.grid.style.cellSpacing},T.prototype.drawCellBackground=function(t,e){var i=this.getBackgroundBrush();null!=i&&(t.save(),t.drawRectangle(i,e.x,e.y,e.width,e.height),t.restore()),null!=this.style.backgroundImage&&(this.getBackgroundImage(),t.drawImage(this.style.backgroundImage,e.x,e.y,e.width,e.height))},T.prototype.adjustContentLayoutArea=function(t){var e,i,r,n,t=new Z(t.x,t.y,t.width,t.height);return this.objectValue instanceof Xo?(null==this.style.cellPadding||void 0===this.style.cellPadding?null!==this.gridRow.grid.style.cellPadding&&void 0!==this.gridRow.grid.style.cellPadding&&(n=this.gridRow.grid.style.cellPadding.hasLeftPad,e=this.gridRow.grid.style.cellPadding.hasTopPad,i=this.gridRow.grid.style.cellPadding.hasRightPad,r=this.gridRow.grid.style.cellPadding.hasBottomPad,n||e||i||r)?(void 0!==this.gridRow.grid.style.cellPadding.left&&n&&(t.x+=this.gridRow.grid.style.cellPadding.left+this.cellStyle.borders.left.width,t.width-=this.gridRow.grid.style.cellPadding.left),void 0!==this.gridRow.grid.style.cellPadding.top&&e&&(t.y+=this.gridRow.grid.style.cellPadding.top+this.cellStyle.borders.top.width,t.height-=this.gridRow.grid.style.cellPadding.top),void 0!==this.gridRow.grid.style.cellPadding.right&&i&&(t.width-=this.gridRow.grid.style.cellPadding.right),void 0!==this.gridRow.grid.style.cellPadding.bottom&&r&&(t.height-=this.gridRow.grid.style.cellPadding.bottom)):null!==(n=this.getStringFormat()).alignment&&void 0!==n.alignment||(t.x+=this.row.grid.style.cellPadding.left,t.y+=this.row.grid.style.cellPadding.top):(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(t.x+=this.style.cellPadding.left+this.cellStyle.borders.left.width,t.width-=this.style.cellPadding.left),void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(t.y+=this.style.cellPadding.top+this.cellStyle.borders.top.width,t.height-=this.style.cellPadding.top),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(t.width-=this.style.cellPadding.right),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(t.height-=this.style.cellPadding.bottom)),t.width-=this.cellStyle.borders.left.width+this.cellStyle.borders.right.width,t.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width):(void 0===this.style.cellPadding||null==this.style.cellPadding?(t.x+=this.gridRow.grid.style.cellPadding.left,t.y+=this.gridRow.grid.style.cellPadding.top,t.width-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left,t.height-=this.gridRow.grid.style.cellPadding.bottom+this.gridRow.grid.style.cellPadding.top):(t.x+=this.style.cellPadding.left,t.y+=this.style.cellPadding.top,t.width-=this.style.cellPadding.right+this.style.cellPadding.left,t.height-=this.style.cellPadding.bottom+this.style.cellPadding.top,1===this.rowSpan&&(t.width-=this.style.borders.left.width)),void 0===this.style.borders||null==this.style.borders?(t.x+=this.gridRow.style.border.left.width,t.y+=this.gridRow.style.border.top.width,t.width-=this.gridRow.style.border.left.width+this.gridRow.style.border.right.width,t.height-=this.gridRow.style.border.top.width+this.gridRow.style.border.bottom.width):(t.x+=this.style.borders.left.width,t.y+=this.style.borders.top.width,t.width-=this.style.borders.left.width+this.style.borders.right.width,t.height-=this.style.borders.top.width+this.style.borders.bottom.width,1===this.rowSpan&&(t.width-=this.style.borders.left.width))),t},T.prototype.draw=function(t,e,i){var r=null;if(this.internalIsCellMergeContinue||this.internalIsRowMergeContinue){if(!this.internalIsCellMergeContinue||!this.row.grid.style.allowHorizontalOverflow)return r;if(0<this.row.rowOverflowIndex&&this.row.cells.indexOf(this)!=this.row.rowOverflowIndex+1||0==this.row.rowOverflowIndex&&this.internalIsCellMergeContinue)return r}e=this.adjustOuterLayoutArea(e,t),this.drawCellBackground(t,e);var n,o,s,a,h,l=this.getTextPen(),u=this.getTextBrush(),c=(void 0===l&&void 0===u&&(u=new mt(new f(0,0,0))),this.getTextFont()),p=this.getStringFormat(),d=e;return d.height>=t.clientSize.height&&this.row.grid.allowRowBreakAcrossPages&&(d.height-=d.y,void 0!==this._rowHeight)&&null!==this._rowHeight&&d.height>this._rowHeight&&(d.height=this._rowHeight),d=this.adjustContentLayoutArea(d),"string"==typeof this.objectValue||"string"==typeof this.remaining?(h=s=void 0,h=d.height<c.height?new Z(d.x,d.y,d.width,c.height):d,d.height<c.height&&this.row.grid.isChildGrid&&null!=this.row.grid.ParentCell&&(n=h.height-this.row.grid.ParentCell.row.grid.style.cellPadding.bottom-this.row.grid.style.cellPadding.bottom,-1!=this.row.grid.splitChildRowIndex&&(this.fontSpilt=!0,this.row.rowFontSplit=!0),0<n)&&n<c.height&&(h.height=n),0!=this.gridRow.grid.style.cellSpacing&&(h.width-=this.gridRow.grid.style.cellSpacing,e.width-=this.gridRow.grid.style.cellSpacing),this.isFinish?(s=""===this.remaining?this.remaining:this.objectValue,t.drawString(s,c,l,u,h.x,h.y,h.width,h.height,p),-1==this.row.grid.splitChildRowIndex||this.row.grid.isChildGrid||void 0!==this.remaining||(this.remaining="")):(void 0!==this.remaining&&null!==this.remaining||(this.remaining=""),this.row.repeatFlag&&t.drawString(this.remaining,c,l,u,h.x,h.y,h.width,h.height,p),this.isFinish=!0),r=t.stringLayoutResult):this.objectValue instanceof Xo?(s=void((n=this.objectValue).isChildGrid=!0),s=d,0!=(n.ParentCell=this).gridRow.grid.style.cellSpacing&&(e.width-=this.gridRow.grid.style.cellSpacing),h=new ts(n),a=new os,null!=this.row.grid.LayoutFormat?a=this.row.grid.LayoutFormat:a.layout=Y.PdfLayoutType.Paginate,o=new Qr,null!=t.layer&&(o.page=t.page,o.bounds=s,o.format=a,n.setSpan(),n.checkSpan(),s=h.Layouter(o),this.value=n,-1!==this.row.grid.splitChildRowIndex&&(this.height=this.row.rowBreakHeightValue),o.page!=s.page)&&(null!==this.row.rowBreakHeightValue&&void 0!==this.row.rowBreakHeightValue&&(s.bounds.height=this.row.rowBreakHeightValue),0==this.row.rowBreakHeight?this.row.NestedGridLayoutResult=s:this.row.rowBreakHeight=this.row.rowBreakHeightValue)):this.objectValue instanceof ke||this.objectValue instanceof Ae?(a=new Z(d.x,d.y,d.width,d.height),(h=this.objectValue).width<=d.width&&(a.width=h.width),h.height<=d.height&&(a.height=h.height),t.drawImage(this.objectValue,a.x,a.y,a.width,a.height)):this.objectValue instanceof jn?this.objectValue.draw(t.currentPage,d):void 0===this.objectValue&&(this.objectValue="",t.drawString(this.objectValue,c,l,u,d.x,d.y,d.width,d.height,p),null!=this.style.cellPadding&&0==this.style.cellPadding.bottom&&0==this.style.cellPadding.left&&0==this.style.cellPadding.right&&0==this.style.cellPadding.top&&(e.width-=this.style.borders.left.width+this.style.borders.right.width),0!=this.gridRow.grid.style.cellSpacing)&&(e.width-=this.gridRow.grid.style.cellSpacing),null!=this.style.borders&&(this.fontSpilt?-1!=this.row.grid.ParentCell.row.grid.splitChildRowIndex&&(this.row.rowFontSplit=!1,this.drawCellBorders(t,e)):this.drawCellBorders(t,e)),r},T.prototype.drawCellBorders=function(t,e){this.row.grid.style.borderOverlapStyle===Y.PdfBorderOverlapStyle.Inside&&(e.x+=this.style.borders.left.width,e.y+=this.style.borders.top.width,e.width-=this.style.borders.right.width,e.height-=this.style.borders.bottom.width);var i=new J(e.x,e.y+e.height),r=new J(e.x,e.y),n=this.cellStyle.borders.left;this.cellStyle.borders.left.dashStyle===Y.PdfDashStyle.Solid&&(n.lineCap=Y.PdfLineCap.Square),0!==n.width&&t.drawLine(n,i,r),i=new J(e.x+e.width,e.y),r=new J(e.x+e.width,e.y+e.height),n=this.cellStyle.borders.right,e.x+e.width>t.clientSize.width-n.width/2&&(i=new J(t.clientSize.width-n.width/2,e.y),r=new J(t.clientSize.width-n.width/2,e.y+e.height)),this.cellStyle.borders.right.dashStyle===Y.PdfDashStyle.Solid&&(n.lineCap=Y.PdfLineCap.Square),0!==n.width&&t.drawLine(n,i,r),i=new J(e.x,e.y),r=new J(e.x+e.width,e.y),n=this.cellStyle.borders.top,this.cellStyle.borders.top.dashStyle===Y.PdfDashStyle.Solid&&(n.lineCap=Y.PdfLineCap.Square),0!==n.width&&t.drawLine(n,i,r),i=new J(e.x+e.width,e.y+e.height),r=new J(e.x,e.y+e.height),n=this.cellStyle.borders.bottom,e.y+e.height>t.clientSize.height-n.width/2&&(i=new J(e.x+e.width,t.clientSize.height-n.width/2),r=new J(e.x,t.clientSize.height-n.width/2)),this.cellStyle.borders.bottom.dashStyle===Y.PdfDashStyle.Solid&&(n.lineCap=Y.PdfLineCap.Square),0!==n.width&&t.drawLine(n,i,r)},T.prototype.adjustOuterLayoutArea=function(t,e){var i=!1,r=this.row.grid.style.cellSpacing,n=(0<r&&(t=new Z(t.x+r,t.y+r,t.width-r,t.height-r)),this.row.cells.indexOf(this));if(1<this.columnSpan||0<this.row.rowOverflowIndex&&n==this.row.rowOverflowIndex+1&&this.isCellMergeContinue){if(1==(h=this.columnSpan)&&this.isCellMergeContinue)for(var o=n+1;o<this.row.grid.columns.count&&this.row.cells.getCell(o).isCellMergeContinue;o++)h++;for(var s=0,a=n;a<n+h;a++){if(this.row.grid.style.allowHorizontalOverflow)if((this.row.grid.size.width<e.clientSize.width?this.row.grid.size:e.clientSize).width<(this.row.grid.size.width>e.clientSize.width?t.x+s+this.row.grid.columns.getColumn(a).width:s+this.row.grid.columns.getColumn(a).width))break;s+=this.row.grid.columns.getColumn(a).width}s-=this.row.grid.style.cellSpacing,t.width=s}if(1<this.rowSpan||this.row.rowSpanExists){for(var h=this.rowSpan,l=this.row.grid.rows.rowCollection.indexOf(this.row),u=(-1==l&&-1!=(l=this.row.grid.headers.indexOf(this.row))&&(i=!0),0),a=l;a<l+h;a++){u+=(i?this.row.grid.headers.getHeader(a):this.row.grid.rows.getRow(a)).height;var c=this.row.grid.rows.getRow(a);this.row.grid.rows.rowCollection.indexOf(c)}this.row.cells.indexOf(this);u-=this.row.grid.style.cellSpacing,t.height=u,this.row.rowMergeComplete||(t.height=u)}return t},T.prototype.getTextFont=function(){return void 0!==this.style.font&&null!=this.style.font?this.style.font:void 0!==this.row.style.font&&null!=this.row.style.font?this.row.style.font:void 0!==this.row.grid.style.font&&null!=this.row.grid.style.font?this.row.grid.style.font:Tr.defaultFont},T.prototype.getTextBrush=function(){return(void 0!==this.style.textBrush&&null!=this.style.textBrush?this:void 0!==this.row.style.textBrush&&null!=this.row.style.textBrush?this.row:this.row.grid).style.textBrush},T.prototype.getTextPen=function(){return(void 0!==this.style.textPen&&null!=this.style.textPen?this:void 0!==this.row.style.textPen&&null!=this.row.style.textPen?this.row:this.row.grid).style.textPen},T.prototype.getBackgroundBrush=function(){return(void 0!==this.style.backgroundBrush&&null!=this.style.backgroundBrush?this:void 0!==this.row.style.backgroundBrush&&null!=this.row.style.backgroundBrush?this.row:this.row.grid).style.backgroundBrush},T.prototype.getBackgroundImage=function(){return(void 0!==this.style.backgroundImage&&null!=this.style.backgroundImage?this:void 0!==this.row.style.backgroundImage&&null!=this.row.style.backgroundImage?this.row:this.row.grid).style.backgroundImage},T.prototype.getStringFormat=function(){return(void 0!==this.style.stringFormat&&null!=this.style.stringFormat?this.style:this).stringFormat},T.prototype.measureHeight=function(){var t,e,i=this.calculateWidth(),r=(null==this.style.cellPadding||void 0===this.style.cellPadding?i-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:i=(i-=this.style.cellPadding.right+this.style.cellPadding.left)-(this.style.borders.left.width+this.style.borders.right.width),0),n=new vt;return"string"==typeof this.objectValue||"string"==typeof this.remaining?(e=this.objectValue,this.isFinish||(e=null!==this.remaining&&""!==this.remaining&&void 0!==this.remaining?this.remaining:this.objectValue),t=this.row.cells.indexOf(this),0!=this.gridRow.grid.style.cellSpacing&&(i-=2*this.gridRow.grid.style.cellSpacing),this.row.cells.getCell(t).hasColSpan||this.row.cells.getCell(t).hasRowSpan||(this.gridRow.grid.isChildGrid?(i<0?(this.tempval=i,null==this.style.cellPadding||void 0===this.style.cellPadding?this.tempval+=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(this.tempval+=this.style.cellPadding.right+this.style.cellPadding.left,this.tempval+=this.style.borders.left.width+this.style.borders.right.width)):this.tempval=i,r+=n.layout(e,this.getTextFont(),this.stringFormat,new X(this.tempval,0),!1,new X(0,0)).actualSize.height):r+=n.layout(e,this.getTextFont(),this.stringFormat,new X(i,0),!1,new X(0,0)).actualSize.height),r+=2*(this.style.borders.top.width+this.style.borders.bottom.width)):this.objectValue instanceof Xo?(t=this.row.cells.indexOf(this),e=0,null!=this.style.cellPadding||void 0!==this.style.cellPadding?(e=this.calculateWidth(),void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(e-=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(e-=this.style.cellPadding.right)):null!=this.row.grid.style.cellPadding||void 0!==this.row.grid.style.cellPadding?(e=this.calculateWidth(),void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(e-=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(e-=this.row.grid.style.cellPadding.right)):e=this.calculateWidth(),this.objectValue.tempWidth=e,this.row.cells.getCell(t).hasColSpan||this.row.cells.getCell(t).hasRowSpan?r+=2*(this.style.borders.top.width+this.style.borders.bottom.width):r=this.objectValue.size.height,0!==this.gridRow.grid.style.cellSpacing&&(i-=2*this.gridRow.grid.style.cellSpacing),null==this.style.cellPadding&&void 0===this.style.cellPadding||(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(r+=this.row.grid.style.cellPadding.top),this.row.grid.style.cellPadding.hasBottomPad&&void 0!==this.row.grid.style.cellPadding.bottom&&(r+=this.row.grid.style.cellPadding.bottom)),r+=this.objectValue.style.cellSpacing):this.objectValue instanceof ke||this.objectValue instanceof Ae?r+=this.objectValue.height:this.objectValue instanceof jn?(e=this.objectValue,r=(r+=n.layout(e.text,e.font,e.stringFormat,new X(i,0),!1,new X(0,0)).actualSize.height)+2*(this.style.borders.top.width+this.style.borders.bottom.width)):void 0===this.objectValue&&(null==this.style.cellPadding||void 0===this.style.cellPadding?i-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:i=(i-=this.style.cellPadding.right+this.style.cellPadding.left)-(this.style.borders.left.width+this.style.borders.right.width),r+=2*(this.style.borders.top.width+this.style.borders.bottom.width)),this.objectValue instanceof Xo?null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(r+=this.row.grid.style.cellPadding.top),void 0!==this.row.grid.style.cellPadding.bottom&&this.row.grid.style.cellPadding.hasBottomPad&&(r+=this.row.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(r+=this.style.cellPadding.top),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(r+=this.style.cellPadding.bottom)):null==this.style.cellPadding||void 0===this.style.cellPadding?r+=this.row.grid.style.cellPadding.top+this.row.grid.style.cellPadding.bottom:r+=this.style.cellPadding.top+this.style.cellPadding.bottom,r+=this.row.grid.style.cellSpacing},T.prototype.calculateWidth=function(){var t=this.row.cells.indexOf(this),e=(this.row.grid.rows.rowCollection.indexOf(this.row),this.columnSpan),i=0;if(1===e)for(var r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width;else if(1<e)for(r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width,r+1<e&&(this.row.cells.getCell(t+r+1).hasColSpan=!0);if(null!=this.parent&&0<this.parent.row.width&&this.row.grid.isChildGrid&&null!=this.parent&&this.row.width>this.parent.row.width){for(var i=0,n=0;n<this.parent.columnSpan;n++)i+=this.parent.row.grid.columns.getColumn(n).width;i/=this.row.cells.count}return i};var Do=T;function T(t){this.cellWidth=0,this.cellHeight=0,this.tempval=0,this.fontSpilt=!1,this.finsh=!0,this.rowSpanRemainingHeight=0,this.hasRowSpan=!1,this.hasColSpan=!1,this.isFinish=!0,this.present=!1,this.gridRowSpan=1,this.colSpan=1,void 0!==t&&(this.gridRow=t)}Fo.prototype.getCell=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException");return this.cells[t]},Object.defineProperty(Fo.prototype,"count",{get:function(){return this.cells.length},enumerable:!0,configurable:!0}),Fo.prototype.add=function(t){var e;if(void 0===t)return e=new Do,this.add(e),t;t.row=this.gridRow,this.cells.push(t)},Fo.prototype.indexOf=function(t){return this.cells.indexOf(t)};var No=Fo;function Fo(t){this.cells=[],this.gridRow=t}Object.defineProperty(Eo.prototype,"width",{get:function(){return this.columnWidth},set:function(t){this.isCustomWidth=!0,this.columnWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(Eo.prototype,"format",{get:function(){return null==this.stringFormat&&(this.stringFormat=new bt),this.stringFormat},set:function(t){this.stringFormat=t},enumerable:!0,configurable:!0});var Io=Eo;function Eo(t){this.columnWidth=0,this.grid=t}zo.prototype.add=function(t){for(var e=0;e<t;e++){this.internalColumns.push(new Io(this.grid));for(var i=0;i<this.grid.rows.count;i++){var r=this.grid.rows.getRow(i),n=new Do;n.value="",r.cells.add(n)}}},Object.defineProperty(zo.prototype,"count",{get:function(){return this.internalColumns.length},enumerable:!0,configurable:!0}),Object.defineProperty(zo.prototype,"width",{get:function(){return 0===this.columnWidth&&(this.columnWidth=this.measureColumnsWidth()),0===this.grid.initialWidth||this.columnWidth===this.grid.initialWidth||this.grid.style.allowHorizontalOverflow||(this.columnWidth=this.grid.initialWidth,this.grid.isPageWidth=!0),this.columnWidth},enumerable:!0,configurable:!0}),Object.defineProperty(zo.prototype,"columns",{get:function(){return this.internalColumns},enumerable:!0,configurable:!0}),zo.prototype.getColumn=function(t){if(0<=t&&t<=this.columns.length)return this.columns[t];throw Error("can not get the column from the index: "+t)},zo.prototype.measureColumnsWidth=function(){var t=0;this.grid.measureColumnsWidth();for(var e=0,i=this.internalColumns.length;e<i;e++)t+=this.internalColumns[e].width;return t},zo.prototype.getDefaultWidths=function(t){for(var e=[],i=this.count,r=0;r<this.count;r++)this.grid.isPageWidth&&0<=t&&!this.internalColumns[r].isCustomWidth?this.internalColumns[r].width=0:(e[r]=this.internalColumns[r].width,0<this.internalColumns[r].width&&this.internalColumns[r].isCustomWidth?(t-=this.internalColumns[r].width,i--):e[r]=0);for(r=0;r<this.count;r++)e[r]<=0&&(e[r]=t/i);return e};var Go=zo;function zo(t){this.internalColumns=[],this.columnWidth=0,this.grid=t,this.internalColumns=[]}Object.defineProperty(_o.prototype,"rowSpanExists",{get:function(){return this.bRowSpanExists},set:function(t){this.bRowSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"cells",{get:function(){return null==this.gridCells&&(this.gridCells=new No(this)),this.gridCells},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"grid",{get:function(){return this.pdfGrid},set:function(t){this.pdfGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"style",{get:function(){return void 0===this.rowStyle&&(this.rowStyle=new Mo,this.rowStyle.setParent(this)),this.rowStyle},set:function(t){this.rowStyle=t;for(var e=0;e<this.cells.count;e++)this.cells.getCell(e).style.borders=t.border,void 0!==t.font&&(this.cells.getCell(e).style.font=t.font),void 0!==t.backgroundBrush&&(this.cells.getCell(e).style.backgroundBrush=t.backgroundBrush),void 0!==t.backgroundImage&&(this.cells.getCell(e).style.backgroundImage=t.backgroundImage),void 0!==t.textBrush&&(this.cells.getCell(e).style.textBrush=t.textBrush),void 0!==t.textPen&&(this.cells.getCell(e).style.textPen=t.textPen)},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"rowBreakHeight",{get:function(){return void 0===this.gridRowBreakHeight&&(this.gridRowBreakHeight=0),this.gridRowBreakHeight},set:function(t){this.gridRowBreakHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"rowOverflowIndex",{get:function(){return this.gridRowOverflowIndex},set:function(t){this.gridRowOverflowIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"height",{get:function(){return this.isRowHeightSet||(this.rowHeight=this.measureHeight()),this.rowHeight},set:function(t){this.rowHeight=t,this.isRowHeightSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"width",{get:function(){return 0!==this.rowWidth&&void 0!==this.rowWidth||(this.rowWidth=this.measureWidth()),this.rowWidth},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"NestedGridLayoutResult",{get:function(){return this.gridResult},set:function(t){this.gridResult=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"columnSpanExists",{get:function(){return this.bColumnSpanExists},set:function(t){this.bColumnSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"rowMergeComplete",{get:function(){return this.isRowMergeComplete},set:function(t){this.isRowMergeComplete=t},enumerable:!0,configurable:!0}),Object.defineProperty(_o.prototype,"rowIndex",{get:function(){return this.grid.rows.rowCollection.indexOf(this)},enumerable:!0,configurable:!0}),_o.prototype.measureHeight=function(){for(var t=0,e=0,i=1<this.cells.getCell(0).rowSpan?0:this.cells.getCell(0).height,r=0;r<this.cells.count;r++){var n=this.cells.getCell(r);if(n.rowSpanRemainingHeight>t&&(t=n.rowSpanRemainingHeight),this.rowMergeComplete=!1,1<n.rowSpan){for(var o=r,s=(this.isHeaderRow?this.grid.headers:this.grid.rows.rowCollection).indexOf(this),a=0;a<n.rowSpan;a++)a+1<n.rowSpan&&((this.isHeaderRow?this.grid.headers.getHeader(s+a+1):this.grid.rows.getRow(s+a+1)).cells.getCell(o).hasRowSpan=!0);e<n.height&&(e=n.height)}else i=Math.max(i,n.height)}return 0===(i=i<e?e:i)?i=e:0<t&&(i+=t),i},_o.prototype.measureWidth=function(){for(var t=0,e=0;e<this.grid.columns.count;e++)t+=this.grid.columns.getColumn(e).width;return t};var Wo=_o;function _o(t){this.gridRowOverflowIndex=0,this.rowHeight=0,this.rowWidth=0,this.isrowFinish=!1,this.isRowSpanRowHeightSet=!1,this.noOfPageCount=0,this.isRowHeightSet=!1,this.isPageBreakRowSpanApplied=!1,this.isRowMergeComplete=!0,this.repeatFlag=!1,this.rowFontSplit=!1,this.isHeaderRow=!1,this.pdfGrid=t}Object.defineProperty(Uo.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Object.defineProperty(Uo.prototype,"rowCollection",{get:function(){return this.rows},enumerable:!0,configurable:!0}),Uo.prototype.addRow=function(t){var e;if(void 0===t)return e=new Wo(this.grid),this.addRow(e),e;if(t.style.setBackgroundBrush(this.grid.style.backgroundBrush),t.style.setFont(this.grid.style.font),t.style.setTextBrush(this.grid.style.textBrush),t.style.setTextPen(this.grid.style.textPen),0===t.cells.count)for(var i=0;i<this.grid.columns.count;i++)t.cells.add(new Do);this.rows.push(t)},Uo.prototype.getRow=function(t){return this.rows[t]};var Ho=Uo;function Uo(t){this.rows=[],this.grid=t}qo.prototype.getHeader=function(t){return this.rows[t]},Object.defineProperty(qo.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),qo.prototype.add=function(t){if("number"==typeof t){for(var e=void 0,i=0;i<t;i++){(e=new Wo(this.grid)).isHeaderRow=!0;for(var r=0;r<this.grid.columns.count;r++)e.cells.add(new Do);this.rows.push(e)}return this.rows}this.rows.push(t)},qo.prototype.indexOf=function(t){return this.rows.indexOf(t)};var Ko=qo;function qo(t){this.rows=[],this.grid=t,this.rows=[]}Yo=function(t,e){return(Yo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Yo(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Zo,Jo=hn),Object.defineProperty(Zo.prototype,"raiseBeginCellDraw",{get:function(){return void 0!==this.beginCellDraw&&null!==typeof this.beginCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"raiseEndCellDraw",{get:function(){return void 0!==this.endCellDraw&&null!==typeof this.endCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"repeatHeader",{get:function(){return null!=this.bRepeatHeader&&void 0!==this.bRepeatHeader||(this.bRepeatHeader=!1),this.bRepeatHeader},set:function(t){this.bRepeatHeader=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"allowRowBreakAcrossPages",{get:function(){return this.breakRow},set:function(t){this.breakRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"columns",{get:function(){return null!=this.gridColumns&&void 0!==this.gridColumns||(this.gridColumns=new Go(this)),this.gridColumns},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"rows",{get:function(){return null==this.gridRows&&(this.gridRows=new Ho(this)),this.gridRows},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"headers",{get:function(){return null!=this.gridHeaders&&void 0!==this.gridHeaders||(this.gridHeaders=new Ko(this)),this.gridHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"initialWidth",{get:function(){return this.gridInitialWidth},set:function(t){this.gridInitialWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"style",{get:function(){return null==this.gridStyle&&(this.gridStyle=new To),this.gridStyle},set:function(t){null==this.gridStyle&&(this.gridStyle=t)},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"isPageWidth",{get:function(){return this.ispageWidth},set:function(t){this.ispageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"isChildGrid",{get:function(){return this.ischildGrid},set:function(t){this.ischildGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"size",{get:function(){return 0!==this.gridSize.width&&void 0!==this.gridSize.width||0!==this.gridSize.height||(this.gridSize=this.measure()),this.gridSize},set:function(t){this.gridSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"ParentCell",{get:function(){return this.parentCell},set:function(t){this.parentCell=t},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"LayoutFormat",{get:function(){return this.layoutFormat},enumerable:!0,configurable:!0}),Zo.prototype.draw=function(t,e,i,r){var n;return e instanceof J&&void 0===e.width&&void 0===i?this.drawHelper(t,e.x,e.y):"number"==typeof e&&"number"==typeof i&&void 0===r?this.drawHelper(t,e,i,null):e instanceof Z&&void 0!==e.width&&void 0===i?this.drawHelper(t,e,null):e instanceof J&&void 0===e.width&&i instanceof Zr?this.drawHelper(t,e.x,e.y,i):"number"==typeof e&&"number"==typeof i&&(r instanceof Zr||null==r)?(n=t.graphics.clientSize.width-e,n=new Z(e,i,n,0),this.drawHelper(t,n,r)):e instanceof Z&&void 0!==e.width&&"boolean"==typeof i?this.drawHelper(t,e,null):this.drawHelper(t,e,i)},Zo.prototype.measure=function(){for(var t=0,e=this.columns.width,i=0;i<this.headers.count;i++)t+=this.headers.getHeader(i).height;for(i=0;i<this.rows.count;i++)t+=this.rows.getRow(i).height;return new X(e,t)},Zo.prototype.onBeginCellDraw=function(t){this.raiseBeginCellDraw&&this.beginCellDraw(this,t)},Zo.prototype.onEndCellDraw=function(t){this.raiseEndCellDraw&&this.endCellDraw(this,t)},Zo.prototype.layout=function(t){var e=t.bounds.width,i=t.bounds.height,r=!1;return void 0!==t.bounds.width&&0!==t.bounds.width||(e=t.page.getClientSize().width-t.bounds.x,r=!0),void 0!==t.bounds.height&&0!==t.bounds.height||(i=t.page.getClientSize().height-t.bounds.y,r=!0),r&&(t.bounds=new Z(t.bounds.x,t.bounds.y,e,i)),0!==this.rows.count&&null!=(r=this.rows.getRow(0).cells.getCell(0).style).borders&&(null!=r.borders.left&&1!==r.borders.left.width||null!=r.borders.top&&1!==r.borders.top.width)&&(e=r.borders.left.width/2,i=r.borders.top.width/2,t.bounds.x===nn.default.right.width/2)&&t.bounds.y===nn.default.right.width/2&&(r=new Z(e,i,this.gridSize.width,this.gridSize.height),t.bounds=r),this.setSpan(),this.checkSpan(),this.layoutFormat=t.format,this.gridLocation=t.bounds,new ts(this).Layouter(t)},Zo.prototype.setSpan=function(){for(var t=1,e=1,i=0,r=0,n=0,o=this.headers.count,s=0;s<o;s++){for(var a=this.headers.getHeader(s),h=a.cells.count,l=n=0;l<h;l++){var u=a.cells.getCell(l),n=Math.max(n,u.rowSpan);if(!u.isCellMergeContinue&&!u.isRowMergeContinue&&(1<u.columnSpan||1<u.rowSpan)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.headers.count)throw new Error("Invalid span specified at Header "+l.toString()+" column "+s.toString());if(1<u.columnSpan&&1<u.rowSpan){for(t=u.columnSpan,e=u.rowSpan,i=l,r=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;1<t;)i++,a.cells.getCell(i).isCellMergeContinue=!0,a.cells.getCell(i).isRowMergeContinue=!0,a.cells.getCell(i).rowSpan=e,t--;for(i=l,t=u.columnSpan;1<e;){for(r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,e--;1<t;)i++,this.headers.getHeader(r).cells.getCell(i).isCellMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,t--;t=u.columnSpan,i=l}}else if(1<u.columnSpan&&1===u.rowSpan)for(t=u.columnSpan,i=l,u.isCellMergeStart=!0;1<t;)i++,a.cells.getCell(i).isCellMergeContinue=!0,t--;else if(1===u.columnSpan&&1<u.rowSpan)for(e=u.rowSpan,r=s;1<e;)r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,e--}}a.maximumRowSpan=n}},Zo.prototype.checkSpan=function(){var t=1,e=0,i=0,r=t=1,n=i=0;if(this.hasRowSpanSpan||this.hasColumnSpan)for(var o=this.rows.count,s=0;s<o;s++){for(var a=this.rows.getRow(s),h=a.cells.count,l=e=0;l<h;l++){var u=a.cells.getCell(l),e=Math.max(e,u.rowSpan);if(!u.isCellMergeContinue&&!u.isRowMergeContinue&&(1<u.columnSpan||1<u.rowSpan)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.rows.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(1<u.columnSpan&&1<u.rowSpan){for(r=u.columnSpan,t=u.rowSpan,n=l,i=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;1<r;)n++,a.cells.getCell(n).isCellMergeContinue=!0,a.cells.getCell(n).isRowMergeContinue=!0,r--;for(n=l,r=u.columnSpan;1<t;){for(i++,this.rows.getRow(i).cells.getCell(l).isRowMergeContinue=!0,this.rows.getRow(i).cells.getCell(n).isRowMergeContinue=!0,t--;1<r;)n++,this.rows.getRow(i).cells.getCell(n).isCellMergeContinue=!0,this.rows.getRow(i).cells.getCell(n).isRowMergeContinue=!0,r--;r=u.columnSpan,n=l}}else if(1<u.columnSpan&&1===u.rowSpan)for(r=u.columnSpan,n=l,u.isCellMergeStart=!0;1<r;)n++,a.cells.getCell(n).isCellMergeContinue=!0,r--;else if(1===u.columnSpan&&1<u.rowSpan)for(t=u.rowSpan,i=s;1<t;)i++,this.rows.getRow(i).cells.getCell(l).isRowMergeContinue=!0,t--}}a.maximumRowSpan=e}},Zo.prototype.measureColumnsWidth=function(t){if(void 0!==t){this.isPageWidth=!1;for(var e=this.columns.getDefaultWidths(t.width-t.x),i=0,r=this.columns.count;i<r;i++)this.columns.getColumn(i).columnWidth=e[i],this.tempWidth=e[i];if(null!=this.ParentCell&&0==this.style.allowHorizontalOverflow&&0==this.ParentCell.row.grid.style.allowHorizontalOverflow){var n,o=0,s=0,a=this.columns.count;null==this.ParentCell.style.cellPadding&&void 0===this.ParentCell.style.cellPadding||(void 0!==this.ParentCell.style.cellPadding.left&&this.ParentCell.style.cellPadding.hasLeftPad&&(o+=this.ParentCell.style.cellPadding.left),void 0!==this.ParentCell.style.cellPadding.right&&this.ParentCell.style.cellPadding.hasRightPad&&(o+=this.ParentCell.style.cellPadding.right));for(i=0;i<this.ParentCell.columnSpan;i++)s+=this.ParentCell.row.grid.columns.getColumn(this.parentCellIndex+i).width;for(var h=0;h<this.columns.count;h++)0<this.gridColumns.getColumn(h).width&&this.gridColumns.getColumn(h).isCustomWidth&&(s-=this.gridColumns.getColumn(h).width,a--);if(null==this.ParentCell.row.grid.style.cellPadding&&void 0===this.ParentCell.row.grid.style.cellPadding||(void 0!==this.ParentCell.row.grid.style.cellPadding.top&&this.ParentCell.row.grid.style.cellPadding.hasTopPad&&(o+=this.ParentCell.row.grid.style.cellPadding.top),void 0!==this.ParentCell.row.grid.style.cellPadding.bottom&&this.ParentCell.row.grid.style.cellPadding.hasBottomPad&&(o+=this.ParentCell.row.grid.style.cellPadding.bottom)),0!=this.ParentCell.row.grid.style.cellSpacing&&(s-=2*this.ParentCell.row.grid.style.cellSpacing),o<s&&(this.tempWidth=n=(s-o)/a,null!=this.ParentCell))for(h=0;h<this.columns.count;h++)this.columns.getColumn(h).isCustomWidth||(this.columns.getColumn(h).columnWidth=n)}}else{for(var e=[this.columns.count],l=0;l<this.columns.count;l++)e[l]=0;var u=0;if((void 0===this.isChildGrid&&void 0!==this.gridLocation||null===this.isChildGrid&&void 0!==this.gridLocation)&&(this.initialWidth=this.gridLocation.width),0<this.headers.count)for(var c=this.headers.getHeader(0).cells.count,p=this.headers.count,i=0;i<c;i++){for(h=u=0;h<p;h++)var d=Math.min(this.initialWidth,this.headers.getHeader(h).cells.getCell(i).width),u=Math.max(u,d);e[i]=u}for(var i=u=0,f=this.columns.count;i<f;i++){for(h=0,p=this.rows.count;h<p;h++)(1!=this.rows.getRow(h).cells.getCell(i).columnSpan||this.rows.getRow(h).cells.getCell(i).isCellMergeContinue)&&null==this.rows.getRow(h).cells.getCell(i).value||(null==this.rows.getRow(h).cells.getCell(i).value||this.rows.getRow(h).grid.style.allowHorizontalOverflow||(this.rows.getRow(h).grid.style.cellPadding.right,this.rows.getRow(h).grid.style.cellPadding.left,this.rows.getRow(h).cells.getCell(i).style.borders.left.width),d=(d=0)<this.initialWidth?Math.min(this.initialWidth,this.rows.getRow(h).cells.getCell(i).width):this.rows.getRow(h).cells.getCell(i).width,u=Math.max(e[i],Math.max(u,d)),u=Math.max(this.columns.getColumn(i).width,u));0!=this.rows.count&&(e[i]=u),u=0}for(var i=0,g=this.rows.count;i<g;i++)for(var h=0,m=this.columns.count;h<m;h++)if(1<this.rows.getRow(i).cells.getCell(h).columnSpan){e[h];for(var y=1;y<this.rows.getRow(i).cells.getCell(h).columnSpan;y++)e[h+y]}for(i=0,r=this.columns.count;i<r;i++)(this.columns.getColumn(i).width<=0||0<this.columns.getColumn(i).width&&!this.columns.getColumn(i).isCustomWidth)&&(this.columns.getColumn(i).columnWidth=e[i]);for(var b,o=0,w=0,P=this.columns.count,w=this.tempWidth,h=0;h<this.columns.count;h++)0<this.gridColumns.getColumn(h).width&&this.gridColumns.getColumn(h).isCustomWidth&&(w-=this.gridColumns.getColumn(h).width,P--);if(0<w&&0!=this.ParentCell.row.grid.style.cellSpacing&&(w-=2*this.ParentCell.row.grid.style.cellSpacing),o<w&&(b=w/P,null!=this.ParentCell))for(h=0;h<this.columns.count;h++)this.columns.getColumn(h).isCustomWidth||(this.columns.getColumn(h).columnWidth=b)}};var Yo,Jo,Xo=Zo;function Zo(){var t=Jo.call(this)||this;return t.gridSize=new X(0,0),t.isGridSplit=!1,t.isRearranged=!1,t.pageBounds=new Z,t.listOfNavigatePages=[],t.parentCellIndex=0,t.tempWidth=0,t.breakRow=!0,t.splitChildRowIndex=-1,t.hasRowSpanSpan=!1,t.hasColumnSpan=!1,t.isSingleGrid=!0,t}$o=function(t,e){return($o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var $o,Qo,L=function(t,e){function i(){this.constructor=t}$o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},ts=(L($,Qo=Jr),Object.defineProperty($.prototype,"Grid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),$.prototype.getFormat=function(t){return t},$.prototype.layoutInternal=function(t){var e=this.getFormat(t.format);if(this.gridLayoutFormat=this.getFormat(t.format),this.currentPage=t.page,null===this.currentPage)throw Error("Can not set page as null");this.currentPage.getClientSize().height,this.currentPage.getClientSize().width,this.currentPageBounds=this.currentPage.getClientSize(),this.currentGraphics=this.currentPage.graphics;var i=this.currentGraphics.page.section.indexOf(this.currentGraphics.page);if(this.listOfNavigatePages.push(i),null!=e&&e.break===Y.PdfLayoutBreakType.FitColumnsToPage?this.currentBounds=new Z(new J(t.bounds.x,t.bounds.y),new X(this.Grid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new Z(new J(t.bounds.x,t.bounds.y),this.currentGraphics.clientSize),0!==this.Grid.rows.count)this.currentBounds.width=0<t.bounds.width?t.bounds.width:this.currentBounds.width-this.Grid.rows.getRow(0).cells.getCell(0).style.borders.left.width/2;else{if(0===this.Grid.headers.count)throw Error("Please add row or header into grid");this.currentBounds.width=t.bounds.width}if(this.startLocation=new J(t.bounds.x,t.bounds.y),0<t.bounds.height&&!this.Grid.isChildGrid&&(this.currentBounds.height=t.bounds.height),this.Grid.isChildGrid||(this.hType=this.Grid.style.horizontalOverflowType),this.Grid.style.allowHorizontalOverflow?(this.Grid.measureColumnsWidth(),this.determineColumnDrawRanges()):(this.columnRanges=[],void 0!==this.Grid.isChildGrid&&(this.Grid.isChildGrid,1)?this.Grid.measureColumnsWidth(this.currentBounds):this.Grid.measureColumnsWidth(new Z(this.currentBounds.x,this.currentBounds.y,this.currentBounds.x+this.currentBounds.width,this.currentBounds.height)),this.columnRanges.push([0,this.Grid.columns.count-1])),this.Grid.hasRowSpanSpan)for(var r=0;r<this.Grid.rows.count;r++)-1===this.Grid.rows.getRow(r).height||this.Grid.rows.getRow(r).isRowHeightSet||(this.Grid.rows.getRow(r).isRowHeightSet=!0);return this.layoutOnPage(t)},$.prototype.determineColumnDrawRanges=function(){for(var t=0,e=0,i=0,r=this.currentGraphics.clientSize.width-this.currentBounds.x,n=0;n<this.Grid.columns.count;n++)if(r<=(i+=this.Grid.columns.getColumn(n).width)){for(var o=0,s=t;s<=n&&!(r<(o+=this.Grid.columns.getColumn(s).width));s++)e=s;this.columnRanges.push([t,e]),i=(e=t=e+1)<=n?this.Grid.columns.getColumn(n).width:0}this.columnRanges.push([t,this.Grid.columns.count-1])},$.prototype.layoutOnPage=function(t){this.pageBounds.x=t.bounds.x,this.pageBounds.y=t.bounds.y,this.pageBounds.height=t.bounds.height;for(var e,i=this.getFormat(t.format),r=new ce,n=t.page,o=[],s=0;s<this.columnRanges.length;s++){for(var a=this.columnRanges[s],h=(this.cellStartIndex=a[0],this.cellEndIndex=a[1],this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex)),l=(this.currentBounds=h.currentBounds,this.currentRowIndex=h.currentRowIndex,void 0),u=0;u<this.Grid.headers.count;u++){var c=this.Grid.headers.getHeader(u),N=this.currentBounds.y;if(this.isHeader=!0,n!=this.currentPage)for(var p=this.cellStartIndex;p<=this.cellEndIndex;p++)c.cells.getCell(p).isCellMergeContinue&&(c.cells.getCell(p).isCellMergeContinue=!1,c.cells.getCell(p).value="");var F=this.drawRow(c);N===this.currentBounds.y?(l=!0,-1===$.repeatRowIndex&&($.repeatRowIndex=u)):l=!1,!F.isFinish&&null!==n&&i.layout!==Y.PdfLayoutType.OnePage&&l&&(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(i),this.startLocation.y=this.currentBounds.y,void 0!==i.paginateBounds&&0===i.paginateBounds.x&&0===i.paginateBounds.y&&0===i.paginateBounds.width&&0===i.paginateBounds.height&&(this.currentBounds.x+=this.startLocation.x),this.drawRow(c)),this.isHeader=!1}for(var d=0,f=(this.Grid.rows.count,void 0),I=!0,o=[],g=0;g<this.Grid.rows.count;g++){var c=this.Grid.rows.getRow(g),m=(d++,this.currentRowIndex=d-1,this.currentBounds.y),n=this.currentPage,y=($.repeatRowIndex=-1,I&&c.grid.isChildGrid&&(I=!1),null);if(-1!=this.Grid.splitChildRowIndex&&!(c.grid.ParentCell.row.grid.isGridSplit&&this.Grid.splitChildRowIndex<=c.rowIndex)){if(c.isrowFinish)continue;break}for(y=this.drawRow(c),c.isrowFinish=!0,o.push(y.bounds.width),m===this.currentBounds.y?(f=!0,$.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(c)):(f=!1,$.repeatRowIndex=-1);!y.isFinish&&null!=n;){var b=this.getLayoutResult();if(this.raisePageLayouted(b).cancel||f)break;if(this.Grid.allowRowBreakAcrossPages){this.currentPage=this.getNextPageformat(i);this.currentBounds.y;var E,b=new J(nn.default.right.width/2,nn.default.top.width/2);if(0===i.paginateBounds.x&&0===i.paginateBounds.y&&0===i.paginateBounds.width&&0===i.paginateBounds.height&&this.startLocation.x===b.x&&this.startLocation.y===b.y&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y),this.isPaginate&&(this.startLocation.y=this.currentBounds.y,this.isPaginate=!1),this.Grid.isChildGrid&&null!=c.grid.ParentCell&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&c.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top<this.currentBounds.height&&(this.currentBounds.y=this.Grid.ParentCell.row.grid.style.cellPadding.top),null!=c.grid.ParentCell){c.grid.ParentCell.row.isRowBreaksNextPage=!0,c.grid.ParentCell.row.rowBreakHeightValue=c.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top+this.Grid.ParentCell.row.grid.style.cellPadding.bottom;for(var w=c.rowIndex+1;w<c.grid.rows.count;w++)c.grid.ParentCell.row.rowBreakHeightValue+=c.grid.rows.getRow(w).height}if(c.grid.isChildGrid){c.isrowFinish=!1,c.grid.splitChildRowIndex=c.rowIndex,c.grid.ParentCell.row.grid.splitChildRowIndex=c.grid.ParentCell.row.rowIndex,c.grid.ParentCell.row.grid.isGridSplit&&(c.grid.ParentCell.row.noOfPageCount+=1,c.grid.ParentCell.row.grid.isGridSplit=!1);break}if(c.noOfPageCount<1){if(-1!=c.grid.splitChildRowIndex&&(c.grid.isGridSplit=!0),null!=c.style.border&&(null!=c.style.border.left&&1!==c.style.border.left.width||null!=c.style.border.top&&1!==c.style.border.top.width)&&(b=c.style.border.left.width/2,E=c.style.border.top.width/2,this.currentBounds.x===nn.default.right.width/2)&&this.currentBounds.y===nn.default.right.width/2&&(b=new Z(b,E,this.currentBounds.width,this.currentBounds.height),this.currentBounds=b),this.Grid.repeatHeader)for(var P=0;P<this.Grid.headers.count;P++){var G=this.Grid.headers.getHeader(P);this.drawRow(G)}if(y=this.drawRow(c),1<=c.noOfPageCount){c.rowBreakHeightValue;for(var z=0;z<c.noOfPageCount;z++){var W=this.getLayoutResult();this.raisePageLayouted(W);if(this.currentPage=this.getNextPageformat(i),this.currentBounds.y,-1!=c.grid.splitChildRowIndex&&(c.grid.isGridSplit=!0),this.currentBounds.y=.5,this.Grid.repeatHeader)for(var S=0;S<this.Grid.headers.count;S++){var v=this.Grid.headers.getHeader(S);this.drawRow(v)}this.drawRow(c)}}c.grid.splitChildRowIndex=-1,c.grid.isGridSplit=!1,y.isFinish=this.checkIsFisished(c);for(var C=0;C<c.cells.count;C++)c.cells.getCell(C).value instanceof Xo&&(c.cells.getCell(C).value.splitChildRowIndex=-1)}}}if(!y.isFinish&&null!==n&&i.layout!==Y.PdfLayoutType.OnePage&&f){if(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(i),this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex).returnValue)break;if(null!==t.format&&!t.format.usePaginateBounds&&null!==t.bounds&&0<t.bounds.height&&!this.Grid.isChildGrid&&(this.currentBounds.height=t.bounds.height),void 0===t.format||null==t.format||void 0===t.format.usePaginateBounds||t.format.usePaginateBounds||0===t.format.paginateBounds.x&&0===t.format.paginateBounds.y&&0===t.format.paginateBounds.width&&0===t.format.paginateBounds.height||0!==t.format.paginateBounds.y?(this.currentBounds.y=null==i?0:i.paginateBounds.y,null==i||0===i.paginateBounds.x&&0===i.paginateBounds.y&&0===i.paginateBounds.height&&0===i.paginateBounds.width||(this.currentBounds.x=i.paginateBounds.x,this.currentBounds.width=i.paginateBounds.width,this.currentBounds.height=i.paginateBounds.height)):this.currentBounds.y=nn.default.top.width/2,void 0!==t.format&&null!==t.format&&void 0!==t.format.usePaginateBounds&&!t.format.usePaginateBounds&&null!==t.bounds&&0<t.bounds.y&&!this.Grid.isChildGrid&&(this.currentBounds.y=t.bounds.y),this.startLocation.y=this.currentBounds.y,i.paginateBounds.x===i.paginateBounds.y&&i.paginateBounds.y===i.paginateBounds.height&&i.paginateBounds.height===i.paginateBounds.width&&0===i.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===nn.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.Grid.repeatHeader)for(var B=0;B<this.Grid.headers.count;B++){v=this.Grid.headers.getHeader(B);this.drawRow(v)}this.drawRow(c),null===this.currentPage||r.containsKey(this.currentPage)||r.add(this.currentPage,a)}if(null!=c.NestedGridLayoutResult){this.currentPage=c.NestedGridLayoutResult.page,this.currentGraphics=this.currentPage.graphics,this.startLocation=new J(c.NestedGridLayoutResult.bounds.x,c.NestedGridLayoutResult.bounds.y);m=this.ReCalculateHeight(c,c.NestedGridLayoutResult.bounds.height);if(this.currentBounds.y=m,n!=this.currentPage){for(var m=(A=this.currentPage.section).indexOf(n)+1,_=A.indexOf(this.currentPage),O=m;O<_+1;O++){var x=A.getPages()[O].graphics,L=new J(i.paginateBounds.x,i.paginateBounds.y),T=O==_?c.NestedGridLayoutResult.bounds.height-t.bounds.y:this.currentBounds.height-L.y;T<=x.clientSize.height&&(T+=t.bounds.y),L.y=null==i?.5:i.paginateBounds.y;for(var j=0;j<c.cells.count;j++){var k=c.cells.getCell(j),V=0,H=0,R=void 0;if(k.value instanceof Xo)for(var R=R||k,U=0;U<k.value.columns.count;U++)H+=k.value.columns.getColumn(U).columnWidth;else H=k.width;if(1<k.columnSpan)for(;j<k.columnSpan;j++)V+=c.grid.columns.getColumn(j).width;else V=Math.max(H,c.grid.columns.getColumn(j).width);var M=void 0,R=("number"==typeof(M=(R&&R.style&&R.style.cellPadding?R:this.Grid).style.cellPadding.bottom)&&T+M<x.clientSize.height&&(T+=M,this.currentBounds.y+=M),k.drawCellBorders(x,new Z(L,new X(V,T))),this.Grid.rows.getRow(this.Grid.rows.count-1).width);V!==R&&k.drawCellBorders(x,new Z(L,new X(R,T))),L.x+=V,j+=k.columnSpan-1}}n=this.currentPage}}}for(var K,A,q=!1,D=0,h=(0<o.length&&(D=o[0]),[[1,2]]),j=0;j<this.Grid.rows.count;j++)-1!=this.cellEndIndex&&this.Grid.rows.getRow(j).cells.getCell(this.cellEndIndex).value instanceof Xo&&(K=this.Grid.rows.getRow(j).cells.getCell(this.cellEndIndex).value,this.rowLayoutBoundsWidth=K.rowLayoutBoundsWidth,q=!0);if(!q&&0<o.length){for(j=0;j<d-1;j++)D<o[j]&&(D=o[j]);this.rowLayoutBoundsWidth=D}else this.rowLayoutBoundsWidth=h[0][1];this.columnRanges.indexOf(a)<this.columnRanges.length-1&&null!=n&&i.layout!=Y.PdfLayoutType.OnePage&&(this.Grid.isChildGrid,0!=h[0][0]?((A=this.currentPage.section).indexOf(this.currentPage),this.currentGraphics=this.currentPage.graphics,this.currentBounds=new Z(new J(0,0),this.currentPage.getClientSize()),this.currentGraphics.page.section.indexOf(this.currentGraphics.page)):this.currentPage=this.getNextPageformat(i)),this.columnRanges.length-1!==s&&1<this.columnRanges.length&&i.layout!==Y.PdfLayoutType.OnePage&&(this.currentPage=this.getNextPageformat(i),i.paginateBounds.x===i.paginateBounds.y)&&i.paginateBounds.y===i.paginateBounds.height&&i.paginateBounds.height===i.paginateBounds.width&&0===i.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y)}return e=this.getLayoutResult(),this.Grid.style.allowHorizontalOverflow&&this.Grid.style.horizontalOverflowType==Y.PdfHorizontalOverflowType.NextPage&&this.reArrangePages(r),this.raisePageLayouted(e),e},$.prototype.checkIsFisished=function(t){for(var e=!0,i=0;i<t.cells.count;i++)t.cells.getCell(i).FinishedDrawingCell||(e=!1);return e},$.prototype.getNextPageformat=function(t){var e=this.currentPage.section,i=null,r=e.indexOf(this.currentPage),e=(this.flag=!1,i=r===e.count-1?e.add():e.getPages()[r+1],this.currentGraphics=i.graphics,this.currentGraphics.page.section.indexOf(this.currentGraphics.page));return-1===this.listOfNavigatePages.indexOf(e)&&this.listOfNavigatePages.push(e),this.currentBounds=new Z(new J(0,0),i.getClientSize()),void 0!==t&&null!=t&&t.usePaginateBounds&&void 0!==t.paginateBounds&&null!=t.paginateBounds&&t.paginateBounds.x!==t.paginateBounds.y&&t.paginateBounds.y!==t.paginateBounds.height&&t.paginateBounds.height!==t.paginateBounds.width&&0!==t.paginateBounds.width&&(this.currentBounds.x=t.paginateBounds.x,this.currentBounds.y=t.paginateBounds.y,this.currentBounds.height=t.paginateBounds.height),i},$.prototype.CheckIfDefaultFormat=function(t){var e=new bt;return t.alignment===e.alignment&&t.characterSpacing===e.characterSpacing&&t.clipPath===e.clipPath&&t.firstLineIndent===e.firstLineIndent&&t.horizontalScalingFactor===e.horizontalScalingFactor&&t.lineAlignment===e.lineAlignment&&t.lineLimit===e.lineLimit&&t.lineSpacing===e.lineSpacing&&t.measureTrailingSpaces===e.measureTrailingSpaces&&t.noClip===e.noClip&&t.paragraphIndent===e.paragraphIndent&&t.rightToLeft===e.rightToLeft&&t.subSuperScript===e.subSuperScript&&t.wordSpacing===e.wordSpacing&&t.wordWrap===e.wordWrap},$.prototype.RaiseBeforeCellDraw=function(t,e,i,r,n,o){return this.Grid.raiseBeginCellDraw&&(t=new us(t,e,i,r,n,o),this.Grid.onBeginCellDraw(t),o=t.style),o},$.prototype.raiseAfterCellDraw=function(t,e,i,r,n,o){this.Grid.raiseEndCellDraw&&(t=new ds(t,e,i,r,n,o),this.Grid.onEndCellDraw(t))},$.prototype.reArrangePages=function(t){for(var e=this.currentPage.document,i=[],r=t.keys(),n=(t.values(),0);n<r.length;n++)(o=r[n]).section=null,i.push(o),e.pages.remove(o);for(n=0;n<t.size();n++)for(var o,s=n,a=t.size()/this.columnRanges.length;s<t.size();s+=a)void 0!==(o=i[s])&&-1===e.pages.indexOf(o)&&e.pages.add(o)},$.prototype.getLayoutResult=function(){if(this.Grid.isChildGrid&&this.Grid.allowRowBreakAcrossPages)for(var t=0;t<this.Grid.rows.count;t++){var e=this.Grid.rows.getRow(t);0<e.rowBreakHeight&&e.repeatFlag&&(this.startLocation.y=this.currentPage.origin.y)}var i;return this.isChanged||(i=new Z(this.startLocation,new X(this.currentBounds.width,this.currentBounds.y-this.startLocation.y))),new is(this.currentPage,i)},$.prototype.ReCalculateHeight=function(t,e){for(var i=0,r=this.cellStartIndex;r<=this.cellEndIndex;r++)null!==t.cells.getCell(r).remainingString&&""!==t.cells.getCell(r).remainingString&&void 0!==t.cells.getCell(r).remainingString&&(i=Math.max(i,t.cells.getCell(r).measureHeight()));return Math.max(e,i)},$.prototype.raiseBeforePageLayout=function(t,e,i){var r=!1;return this.Grid.raiseBeginPageLayout&&(t=new Bs(e,t,i),this.Grid.onBeginPageLayout(t),r=void 0!==t.cancel&&t.cancel,e=t.bounds,i=t.startRowIndex),{returnValue:r,currentBounds:e,currentRowIndex:i}},$.prototype.raisePageLayouted=function(t){t=new Ls(t);return this.Grid.raiseEndPageLayout&&this.Grid.onEndPageLayout(t),t},$.prototype.drawRow=function(t,e,i){if(void 0===e){var r=new js,n=0,o=new X(0,0),s=!1;if(t.rowSpanExists){var a=0,h=this.Grid.rows.rowCollection.indexOf(t);-1===h&&-1!==(h=this.Grid.headers.indexOf(t))&&(s=!0);for(var l=0;l<t.cells.count;l++)var u=t.cells.getCell(l),a=Math.max(a,u.rowSpan);for(l=h;l<h+a;l++)n+=(s?this.Grid.headers.getHeader(l):this.Grid.rows.getRow(l)).height}var c,p=0<t.rowBreakHeight?t.rowBreakHeight:t.height;return void 0!==this.Grid.isChildGrid&&this.Grid.isChildGrid&&void 0!==this.Grid.ParentCell&&null!=this.Grid.ParentCell?this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+p>this.currentPageBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+p>this.currentBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+n>this.currentPageBounds.height?(void 0!==this.Grid.ParentCell.row.grid.LayoutFormat&&this.Grid.ParentCell.row.grid.LayoutFormat.break===Y.PdfLayoutBreakType.FitPage&&($.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(t),this.Grid.splitChildRowIndex=this.Grid.rows.rowCollection.indexOf(t)),-1<$.repeatRowIndex&&$.repeatRowIndex===t.rowIndex&&this.Grid.allowRowBreakAcrossPages&&(r.isFinish=!0,r.bounds=this.currentBounds,this.drawRowWithBreak(r,t,p),t.repeatFlag=!0,t.repeatRowNumber=$.repeatRowIndex)):(r.isFinish=!0,0<t.grid.ParentCell.row.rowBreakHeightValue?t.repeatFlag=!0:(t.repeatFlag=!1,p=t.height),this.Grid.isChildGrid&&0<t.rowBreakHeight&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&(p+=this.Grid.ParentCell.row.grid.style.cellPadding.bottom),this.drawRow(t,r,p)):p>this.currentPageBounds.height?this.Grid.allowRowBreakAcrossPages&&(r.isFinish=!0,this.drawRowWithBreak(r,t,p),t.isrowFinish=!0,t.repeatFlag=!0,-1!==t.grid.splitChildRowIndex)&&(r.isFinish=!1):this.currentBounds.y+p>this.currentPageBounds.height||this.currentBounds.y+p>this.currentBounds.height+this.startLocation.y||this.currentBounds.y+n>this.currentPageBounds.height?(c=!1,!this.Grid.allowRowBreakAcrossPages||this.Grid.repeatHeader||t.isRowHeightSet||t.rowMergeComplete?this.Grid.allowRowBreakAcrossPages&&null!=this.Grid.LayoutFormat&&this.Grid.LayoutFormat.layout==Y.PdfLayoutType.Paginate&&this.Grid.LayoutFormat.break!=Y.PdfLayoutBreakType.FitElement&&t.isRowHeightSet&&this.currentBounds.y+i>this.currentPageBounds.height&&((c=(c=this.isFitToCell(this.currentPageBounds.height-this.currentBounds.y,this.Grid,t))||!(null!==this.slr&&0==this.slr.actualSize.height&&null!=this.slr.remainder&&0<this.slr.remainder.length&&this.remainderText==this.slr.remainder))&&null!=this.slr&&1<this.slr.lineCount&&(c=!1),this.remainderText=null):(c=null!==this.Grid.LayoutFormat&&0<this.Grid.LayoutFormat.paginateBounds.height?this.isFitToCell(this.currentBounds.height+this.startLocation.y-this.currentBounds.y,this.Grid,t):this.isFitToCell(this.currentPageBounds.height-this.currentBounds.y,this.Grid,t))&&(this.isPaginate=!0),-1<$.repeatRowIndex&&$.repeatRowIndex===t.rowIndex||c?this.Grid.allowRowBreakAcrossPages?(r.isFinish=!0,this.drawRowWithBreak(r,t,p),t.repeatFlag=!0,t.repeatRowNumber=$.repeatRowIndex,-1!==t.grid.splitChildRowIndex&&(r.isFinish=!1)):(r.isFinish=!1,this.drawRow(t,r,p)):r.isFinish=!1):(r.isFinish=!0,this.drawRow(t,r,p),t.repeatFlag=!1),r}var d=new J(this.currentBounds.x,this.currentBounds.y);e.bounds=new Z(d,new X(0,0)),i=this.ReCalculateHeight(t,i);for(l=this.cellStartIndex;l<=this.cellEndIndex;l++){var f=l>this.cellEndIndex+1&&1<t.cells.getCell(l).columnSpan;if(!f)for(var g=1;g<t.cells.getCell(l).columnSpan;g++)t.cells.getCell(l+g).isCellMergeContinue=!0;var o=new X(this.Grid.columns.getColumn(l).width,i),m=(!this.CheckIfDefaultFormat(this.Grid.columns.getColumn(l).format)&&this.CheckIfDefaultFormat(t.cells.getCell(l).stringFormat)&&(t.cells.getCell(l).stringFormat=this.Grid.columns.getColumn(l).format),t.cells.getCell(l).style),y="string"==typeof t.cells.getCell(l).value&&null!==t.cells.getCell(l).value?t.cells.getCell(l).value:"";t.cells.getCell(l).style=this.RaiseBeforeCellDraw(this.currentGraphics,this.currentRowIndex,l,new Z(d,o),y,m);t.cells.getCell(l).value instanceof Xo&&((b=t.cells.getCell(l).value).parentCellIndex=l);var b,m=t.cells.getCell(l).draw(this.currentGraphics,new Z(d,o),f);t.grid.style.allowHorizontalOverflow&&(t.cells.getCell(l).columnSpan>this.cellEndIndex||l+t.cells.getCell(l).columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<t.cells.count-1&&(t.rowOverflowIndex=this.cellEndIndex),t.grid.style.allowHorizontalOverflow&&0<t.rowOverflowIndex&&(t.cells.getCell(l).columnSpan>this.cellEndIndex||l+t.cells.getCell(l).columnSpan>this.cellEndIndex+1)&&0<t.cells.getCell(l).columnSpan-this.cellEndIndex+l-1&&(t.cells.getCell(t.rowOverflowIndex+1).value=null!==m&&void 0!==m.remainder?m.remainder:"",t.cells.getCell(t.rowOverflowIndex+1).stringFormat=t.cells.getCell(l).stringFormat,t.cells.getCell(t.rowOverflowIndex+1).style=t.cells.getCell(l).style,t.cells.getCell(t.rowOverflowIndex+1).columnSpan=t.cells.getCell(l).columnSpan-this.cellEndIndex+l-1),y="string"==typeof t.cells.getCell(l).value&&null!==t.cells.getCell(l).value?t.cells.getCell(l).value:"",f||this.raiseAfterCellDraw(this.currentGraphics,this.currentRowIndex,l,new Z(d,o),y,t.cells.getCell(l).style),t.cells.getCell(l).value instanceof Xo&&(b=t.cells.getCell(l).value,this.Grid.columns.getColumn(l).width>=this.currentGraphics.clientSize.width)?(d.x=b.rowLayoutBoundsWidth,d.x+=b.style.cellSpacing):d.x+=this.Grid.columns.getColumn(l).width}t.rowMergeComplete&&!t.isRowHeightSet||(this.currentBounds.y+=i),e.bounds=new Z(new J(e.bounds.x,e.bounds.y),new X(d.x,d.y))},$.prototype.isFitToCell=function(t,e,i){for(var r=!1,n=new vt,o=0;o<i.cells.count;o++){var s=i.cells.getCell(o);if(void 0!==s.value&&null!==s.value&&"string"==typeof s.value){var a=null,a=void 0!==s.style.font&&null!=s.style.font?s.style.font:void 0!==s.row.style.font&&null!=s.row.style.font?s.row.style.font:void 0!==s.row.grid.style.font&&null!=s.row.grid.style.font?s.row.grid.style.font:Tr.defaultFont,h=(this.remainderText=s.value,s.width),l=e.columns.getColumn(o),l=(l.isCustomWidth&&s.width>l.width&&(h=l.width),this.slr=n.layout(s.value,a,s.stringFormat,new X(h,t),!1,this.currentPageBounds),this.slr.actualSize.height);if(""!==s.value&&0===l){r=!1;break}if(null!==s.style&&null!==s.style.borders&&null!==s.style.borders.top&&null!==s.style.borders.bottom&&(l+=2*(s.style.borders.top.width+s.style.borders.bottom.width)),1<this.slr.lineCount&&null!=s.stringFormat&&0!=s.stringFormat.lineSpacing&&(l+=(this.slr.lineCount-1)*s.style.stringFormat.lineSpacing),s.style.cellPadding,(l=(l+=e.style.cellPadding.top+e.style.cellPadding.bottom)+e.style.cellSpacing)<t||void 0!==this.slr.remainder&&null!==this.slr.remainder){r=!0;break}}}return r},$.prototype.drawRowWithBreak=function(t,e,i){var r=new J(this.currentBounds.x,this.currentBounds.y);e.grid.isChildGrid&&e.grid.allowRowBreakAcrossPages&&this.startLocation.x!==this.currentBounds.x&&(r.x=this.startLocation.x),t.bounds=new Z(r,new X(0,0)),this.gridHeight=0<e.rowBreakHeight?this.currentPageBounds.height:0,e.grid.style.cellPadding.top+this.currentBounds.y+e.grid.style.cellPadding.bottom<this.currentPageBounds.height&&(e.rowBreakHeight=this.currentBounds.y+i-this.currentPageBounds.height);for(var n=0;n<e.cells.count;n++){var o=e.cells.getCell(n);o.measureHeight()===i&&o.value instanceof Xo&&(e.rowBreakHeight=0)}for(n=this.cellStartIndex;n<=this.cellEndIndex;n++){var s=this.Grid.columns.getColumn(n).width,a=e.cells.getCell(n).columnSpan+n>this.cellEndIndex+1&&1<e.cells.getCell(n).columnSpan;if(!a)for(var h=1;h<e.cells.getCell(n).columnSpan;h++)e.cells.getCell(n+h).isCellMergeContinue=!0,s+=this.Grid.columns.getColumn(n+h).width;var l=new X(s,0<this.gridHeight?this.gridHeight:this.currentPageBounds.height),u=e.cells.getCell(n).style,u=(e.cells.getCell(n).style=u,null);e.cells.getCell(n)._rowHeight=e.height,u=e.cells.getCell(n).draw(this.currentGraphics,new Z(r,l),a),0<e.rowBreakHeight&&null!=u&&void 0!==u.remainder&&(e.cells.getCell(n).FinishedDrawingCell=!1,e.cells.getCell(n).remainingString=null==u.remainder?" ":u.remainder,e.rowBreakHeight=i-u.actualSize.height),t.isFinish=t.isFinish&&e.cells.getCell(n).FinishedDrawingCell,e.cells.getCell(n).value instanceof Xo&&(l=e.cells.getCell(n).value,this.rowBreakPageHeightCellIndex=n,this.Grid.columns.getColumn(n).width>=this.currentGraphics.clientSize.width)?(r.x=this.rowLayoutBoundsWidth,r.x+=l.style.cellSpacing):r.x+=this.Grid.columns.getColumn(n).width}this.currentBounds.y+=0<this.gridHeight?this.gridHeight:i,t.bounds=new Z(new J(t.bounds.x,t.bounds.y),new X(r.x,r.y))},$.repeatRowIndex=-1,$);function $(t){t=Qo.call(this,t)||this;return t.gridInitialWidth=0,t.gridSize=new X(0,0),t.parentCellIndex=0,t.tempWidth=0,t.childheight=0,t.isChildGrid=!1,t.hasRowSpanSpan=!1,t.isRearranged=!1,t.pageBounds=new Z,t.listOfNavigatePages=[],t.flag=!0,t.columnRanges=[],t.currentLocation=new J(0,0),t.breakRow=!0,t.slr=null,t.remainderText=null,t.isPaginate=!1,t.isOverloadWithPosition=!1,t}L(rs,es=en);var es,is=rs;function rs(t,e){return es.call(this,t,e)||this}L(ss,ns=Zr);var ns,os=ss;function ss(t){return ns.call(this,t)||this}Object.defineProperty(hs.prototype,"rowIndex",{get:function(){return this.gridRowIndex},enumerable:!0,configurable:!0}),Object.defineProperty(hs.prototype,"cellIndex",{get:function(){return this.gridCellIndex},enumerable:!0,configurable:!0}),Object.defineProperty(hs.prototype,"value",{get:function(){return this.internalValue},enumerable:!0,configurable:!0}),Object.defineProperty(hs.prototype,"bounds",{get:function(){return this.gridBounds},enumerable:!0,configurable:!0}),Object.defineProperty(hs.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0});var as=hs;function hs(t,e,i,r,n){this.gridRowIndex=e,this.gridCellIndex=i,this.internalValue=n,this.gridBounds=r,this.pdfGraphics=t}L(cs,ls=as),Object.defineProperty(cs.prototype,"skip",{get:function(){return this.bSkip},set:function(t){this.bSkip=t},enumerable:!0,configurable:!0}),Object.defineProperty(cs.prototype,"style",{get:function(){return this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0});var ls,us=cs;function cs(t,e,i,r,n,o){t=ls.call(this,t,e,i,r,n)||this;return t.style=o,t}L(fs,ps=as),Object.defineProperty(fs.prototype,"style",{get:function(){return this.cellStyle},enumerable:!0,configurable:!0});var ps,ds=fs;function fs(t,e,i,r,n,o){t=ps.call(this,t,e,i,r,n)||this;return t.cellStyle=o,t}Object.defineProperty(ms.prototype,"cancel",{get:function(){return this.isCancel},set:function(t){this.isCancel=t},enumerable:!0,configurable:!0});var gs=ms;function ms(){}L(ws,ys=gs),Object.defineProperty(ws.prototype,"bounds",{get:function(){return this.cellBounds},set:function(t){this.cellBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(ws.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0});var ys,bs=ws;function ws(t,e){var i=ys.call(this)||this;return i.bounds=t,i.pdfPage=e,i}L(vs,Ps=gs),Object.defineProperty(vs.prototype,"result",{get:function(){return this.layoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(vs.prototype,"nextPage",{get:function(){return this.nextPdfPage},set:function(t){this.nextPdfPage=t},enumerable:!0,configurable:!0});var Ps,Ss=vs;function vs(t){var e=Ps.call(this)||this;return e.layoutResult=t,e}L(Os,Cs=bs),Object.defineProperty(Os.prototype,"startRowIndex",{get:function(){return this.startRow},enumerable:!0,configurable:!0});var Cs,Bs=Os;function Os(t,e,i){t=Cs.call(this,t,e)||this;return t.startRow=i,t}L(Ts,xs=Ss);var xs,Ls=Ts;function Ts(t){return xs.call(this,t)||this}Object.defineProperty(ks.prototype,"isFinish",{get:function(){return this.bIsFinished},set:function(t){this.bIsFinished=t},enumerable:!0,configurable:!0}),Object.defineProperty(ks.prototype,"bounds",{get:function(){return this.layoutedBounds},set:function(t){this.layoutedBounds=t},enumerable:!0,configurable:!0});var js=ks;function ks(){this.layoutedBounds=new Z(0,0,0,0)}Vs=function(t,e){return(Vs=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Vs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(As,Rs=Jr),Object.defineProperty(As.prototype,"element",{get:function(){return this.elements},enumerable:!0,configurable:!0}),As.prototype.layoutInternal=function(t){var e=t.page,i=t.bounds,r=this.element.getBounds(),n=(r.x=0,r.y=0,this.shapeBounds.x===this.shapeBounds.y&&this.shapeBounds.y===this.shapeBounds.width&&this.shapeBounds.width===this.shapeBounds.height&&0===this.shapeBounds.height),o=(this.isPdfGrid&&!n&&(r=this.shapeBounds),null),s=new Ds;for(s.page=e;;){var a=this.raiseBeforePageLayout(e,i),i=a.currentBounds,h=null;if(a.cancel||(s=this.layoutOnPage(e,i,r,t),h=this.raiseEndPageLayout(s),a.cancel=null!==h&&h.cancel),s.end||a.cancel){o=this.getLayoutResult(s);break}if(i=this.getPaginateBounds(t),r=this.getNextShapeBounds(r,s),e=null===h||null===h.nextPage?this.getNextPage(e):h.nextPage,this.isPdfGrid){o=this.getLayoutResult(s);break}}return o},As.prototype.raiseBeforePageLayout=function(t,e){var i=!1;return this.element.raiseBeginPageLayout&&(t=new bs(e,t),this.element.onBeginPageLayout(t),i=t.cancel,e=t.bounds),{currentBounds:e,cancel:i}},As.prototype.raiseEndPageLayout=function(t){var e=null;return this.element.raiseEndPageLayout&&(t=this.getLayoutResult(t),e=new Ss(t),this.element.onEndPageLayout(e)),e},As.prototype.getLayoutResult=function(t){return new en(t.page,t.bounds)},As.prototype.getNextShapeBounds=function(t,e){e=e.bounds;return t.y=t.y+e.height,t.height=t.height-e.height,t},As.prototype.layoutOnPage=function(t,e,i,r){var n=new Ds,o=(e=this.checkCorrectCurrentBounds(t,e,r),this.fitsToBounds(e,i)),s=!1;return!(r.format.break===Y.PdfLayoutBreakType.FitElement&&!o&&t===r.page)&&(o=this.getDrawBounds(e,i),this.drawShape(t.graphics,e,o),n.bounds=this.getPageResultBounds(e,i),s=e.height>=i.height),n.end=s||r.format.layout===Y.PdfLayoutType.OnePage,n.page=t,n},As.prototype.getDrawBounds=function(t,e){return t.y=t.y-e.y,t.height=t.height+e.y,t},As.prototype.drawShape=function(t,e,i){var r=t.save();try{t.setClip(e),this.element.drawGraphicsHelper(t,new J(i.x,i.y))}finally{t.restore(r)}},As.prototype.checkCorrectCurrentBounds=function(t,e,i){t=t.graphics.clientSize;return e.width=0<e.width?e.width:t.width-e.x,e.height=0<e.height?e.height:t.height-e.y,this.isPdfGrid&&(e.height=e.height-this.bottomCellPadding),e},As.prototype.getPageResultBounds=function(t,e){return t.height=Math.min(t.height,e.height),t},As.prototype.fitsToBounds=function(t,e){return e.height<=t.height},As.index=0,As.splitDiff=0,As.last=!1,As.borderWidth=0;var Vs,Rs,Ms=As;function As(t){t=Rs.call(this,t)||this;return t.olderPdfForm=0,t.shapeBounds=new Z,t.totalPageSize=0,t}var Ds=function(){};Ns=function(t,e){return(Ns=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ns(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Is,Fs=hn),Is.prototype.getBounds=function(){return this.getBoundsInternal()},Is.prototype.drawGraphicsHelper=function(t,e){if(null==t)throw new Error("ArgumentNullException :graphics");this.drawShapeHelper(t,e.x,e.y)},Is.prototype.drawShapeHelper=function(t,e,i){var r=.5!==e||.5!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},Is.prototype.layout=function(t){return new Ms(this).layout(t)};var Ns,Fs,L=Is;function Is(){return null!==Fs&&Fs.apply(this,arguments)||this}Es=function(t,e){return(Es=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Es(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(zs,Gs=L),Object.defineProperty(zs.prototype,"pen",{get:function(){return this.mpen},set:function(t){this.mpen=t},enumerable:!0,configurable:!0});var Es,Gs,L=zs;function zs(t){var e=Gs.call(this)||this;return void 0!==t&&(e.mpen=t),e}Ws=function(t,e){return(Ws=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ws(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Hs,_s=L),Object.defineProperty(Hs.prototype,"brush",{get:function(){return this.mbrush},set:function(t){this.mbrush=t},enumerable:!0,configurable:!0}),Hs.prototype.obtainPen=function(){return null==this.mbrush&&null==this.pen?new ne(new f(0,0,0)):this.pen};var Ws,_s,L=Hs;function Hs(t,e){var i=_s.call(this)||this;return i.mbrush=null,void 0!==t&&(t instanceof ne?i=_s.call(this,t)||this:i.mbrush=e),i}Us=function(t,e){return(Us=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Us(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(j,Ks=L),Object.defineProperty(j.prototype,"fillMode",{get:function(){return this.mfillMode},set:function(t){this.mfillMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"pathPoints",{get:function(){return this.points},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"pathTypes",{get:function(){return this.types},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"pointCount",{get:function(){var t=0;return t=null!=this.mpoints?this.mpoints.length:t},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"lastPoint",{get:function(){return this.getLastPoint()},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"points",{get:function(){return null==this.mpoints&&(this.mpoints=[]),this.mpoints},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"types",{get:function(){return null==this.mpathTypes&&(this.mpathTypes=[]),this.mpathTypes},enumerable:!0,configurable:!0}),j.prototype.draw=function(t,e,i,r){var n;return e instanceof J&&void 0===e.width&&void 0===i?this.drawHelper(t,e.x,e.y):e instanceof Z&&void 0!==e.width&&void 0===i?this.drawHelper(t,e,null):"number"==typeof e&&"number"==typeof i&&void 0===r?this.drawHelper(t,e,i,null):e instanceof J&&i instanceof Zr?this.drawHelper(t,e.x,e.y,i):"number"==typeof e&&(r instanceof Zr||null==r)&&"number"==typeof i?(n=t.graphics.clientSize.width-e,n=new Z(e,i,n,0),this.drawHelper(t,n,r)):(e instanceof Z&&0 instanceof Zr,this.drawHelper(t,e,i))},j.prototype.addArc=function(t,e,i,r,n,o){if(t instanceof Z)this.addArc(t.x,t.y,t.width,t.height,e,i);else for(var s=this.getBezierArcPoints(t,e,e+i,e+r,n,o),a=0;a<s.length;a+=8){var h=[s[a],s[a+1],s[a+2],s[a+3],s[a+4],s[a+5],s[a+6],s[a+7]];this.addPoints(h,Y.PathPointType.Bezier3)}},j.prototype.addBezier=function(t,e,i,r,n,o,s,a){var h;t instanceof J&&e instanceof J&&i instanceof J&&r instanceof J?this.addBezier(t.x,t.y,e.x,e.y,i.x,i.y,r.x,r.y):((h=[]).push(t),h.push(e),h.push(i),h.push(r),h.push(n),h.push(o),h.push(s),h.push(a),this.addPoints(h,Y.PathPointType.Bezier3))},j.prototype.addEllipse=function(t,e,i,r){t instanceof Z?this.addEllipse(t.x,t.y,t.width,t.height):(this.startFigure(),this.addArc(t,e,i,r,0,360),this.closeFigure())},j.prototype.addLine=function(t,e,i,r){var n;t instanceof J&&e instanceof J?this.addLine(t.x,t.y,e.x,e.y):((n=[]).push(t),n.push(e),n.push(i),n.push(r),this.addPoints(n,Y.PathPointType.Line))},j.prototype.addPath=function(t,e){if(t instanceof j)this.addPath(t.pathPoints,t.pathTypes);else{if(null==t)throw new Error("ArgumentNullException:pathPoints");if(null==e)throw new Error("ArgumentNullException:pathTypes");if(t.length!==e.length)throw new Error("The argument arrays should be of equal length.")}},j.prototype.addPie=function(t,e,i,r,n,o){t instanceof Z?this.addPie(t.x,t.y,t.width,t.height,e,i):(this.startFigure(),this.addArc(t,e,i,r,n,o),this.addPoint(new J(t+i/2,e+r/2),Y.PathPointType.Line),this.closeFigure())},j.prototype.addPolygon=function(t){t.length;var e=[];this.startFigure();for(var i=0;i<t.length;i++)e.push(t[i].x),e.push(t[i].y);this.addPoints(e,Y.PathPointType.Line),this.closeFigure()},j.prototype.addRectangle=function(t,e,i,r){var n;t instanceof Z?this.addRectangle(t.x,t.y,t.width,t.height):(n=[],this.startFigure(),n.push(t),n.push(e),n.push(t+i),n.push(e),n.push(t+i),n.push(e+r),n.push(t),n.push(e+r),this.addPoints(n,Y.PathPointType.Line),this.closeFigure())},j.prototype.startFigure=function(){this.mStartFigure=!0},j.prototype.closeAllFigures=function(){for(var t=this.pathPoints[0],e=0;e<this.mpathTypes.length;e++){var i=this.types[e],r=!1;0!==e&&i===Y.PathPointType.Start?(this.closeFigure(e-1),r=!0):e===this.mpathTypes.length-1&&!r&&this.isXps&&t.x===this.pathPoints[e].y&&this.closeFigure(e)}},j.prototype.getLastPoint=function(){var t=new J(0,0),e=this.pointCount;return 0<e&&null!=this.mpoints&&(t.x=this.mpoints[e-1].x,t.y=this.mpoints[e-1].y),t},j.prototype.getBezierArcPoints=function(t,e,i,r,n,o){i<t&&(p=void 0,p=t,t=i,i=p),e<r&&(p=void 0,p=e,e=r,r=p),Math.abs(o)<=90?(s=o,a=1):s=o/(a=Math.ceil(Math.abs(o)/90));for(var s,a,h=(t+i)/2,l=(e+r)/2,u=(i-t)/2,c=(r-e)/2,p=s*(Math.PI/360),d=Math.abs(4/3*(1-Math.cos(p))/Math.sin(p)),f=[],g=0;g<a;g++){var m=(n+g*s)*(Math.PI/180),y=(n+(g+1)*s)*(Math.PI/180),b=Math.cos(m),w=Math.cos(y),m=Math.sin(m),y=Math.sin(y);0<s?f.push(h+u*b,l-c*m,h+u*(b-d*m),l-c*(m+d*b),h+u*(w+d*y),l-c*(y-d*w),h+u*w,l-c*y):f.push(h+u*b,l-c*m,h+u*(b+d*m),l-c*(m-d*b),h+u*(w-d*y),l-c*(y+d*w),h+u*w,l-c*y)}return f},j.prototype.getBoundsInternal=function(){var t=this.pathPoints,e=new Z(0,0,0,0);if(0<t.length){for(var i=t[0].x,r=t[0].x,n=t[0].y,o=t[0].y,s=1;s<t.length;s++)var a=t[s],i=Math.min(a.x,i),r=Math.max(a.x,r),n=Math.min(a.y,n),o=Math.max(a.y,o);e=new Z(i,n,r-i,o-n)}return e},j.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException :graphics");t.drawPath(this.obtainPen(),this.brush,this)},j.prototype.addPoints=function(t,e,i,r){if(void 0===i&&void 0===r)this.addPoints(t,e,0,t.length);else for(var n=i;n<r;n++){var o=new J(t[n],t[n+1]);n===i?this.pointCount<=0||this.mStartFigure?(this.addPoint(o,Y.PathPointType.Start),this.mStartFigure=!1):o.x===this.lastPoint.x||o.y===this.lastPoint.y||this.isBeziers3?o.x!==this.lastPoint.x&&o.y!==this.lastPoint.y&&this.addPoint(o,Y.PathPointType.Bezier3):this.addPoint(o,Y.PathPointType.Line):this.addPoint(o,e),n++}},j.prototype.addPoint=function(t,e){this.points.push(t),this.types.push(e)},j.prototype.closeFigure=function(t){if(void 0===t)0<this.pointCount&&this.closeFigure(this.pointCount-1),this.startFigure();else{if(t<0)throw new Error("IndexOutOfRangeException()");var e=this.types[t];e|=Y.PathPointType.CloseSubpath,this.types[t]=e}};var Us,Ks,qs=j;function j(t,e,i,r){var n=Ks.call(this)||this;return n.mpoints=null,n.mpathTypes=null,n.mStartFigure=!0,n.mfillMode=Y.PdfFillMode.Alternate,n.isBeziers3=!1,n.isXps=!1,void 0!==t&&(t instanceof ne?(n=Ks.call(this,t)||this,e instanceof pt?(n=Ks.call(this,t,e)||this).fillMode=i:null!=e&&null!=i&&n.addPath(e,i)):t instanceof pt?(n=Ks.call(this,t)||this,null!=e&&(n.fillMode=e),null!=i&&null!=r&&n.addPath(i,r)):n.addPath(t,e)),n}Ys=function(t,e){return(Ys=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Ys(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Xs,Js=L),Object.defineProperty(Xs.prototype,"x",{get:function(){return this.bounds.x},set:function(t){this.bounds.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(Xs.prototype,"y",{get:function(){return this.bounds.y},set:function(t){this.bounds.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(Xs.prototype,"width",{get:function(){return this.bounds.width},set:function(t){this.bounds.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(Xs.prototype,"height",{get:function(){return this.bounds.height},set:function(t){this.bounds.height=t},enumerable:!0,configurable:!0}),Xs.prototype.getBoundsInternal=function(){return this.bounds};var Ys,Js,L=Xs;function Xs(t,e,i,r,n,o){var s=Js.call(this)||this;return s.bounds=new Z(0,0,0,0),void 0!==t&&(t instanceof ne?(s=Js.call(this,t,e)||this,i instanceof Z?s.bounds=i:s.bounds=new Z(i,r,n,o)):t instanceof Z?s.bounds=t:s.bounds=new Z(t,e,i,r)),s}Zs=function(t,e){return(Zs=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}Zs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(Qs,$s=L);var Zs,$s,L=Qs;function Qs(t,e,i,r,n,o,s,a){var h=$s.call(this)||this;return h.startAngle=0,void(h.sweepAngle=0)!==t&&(t instanceof Z&&void 0!==e&&void 0!==i?((h=$s.call(this,t)||this).startAngle=e,h.sweepAngle=i):t instanceof ne?i instanceof Z?((h=$s.call(this,t,e,i)||this).startAngle=r,h.sweepAngle=n):((h=$s.call(this,t,e,i,r,n,o)||this).startAngle=s,h.sweepAngle=a):((h=$s.call(this,t,e,i,r)||this).startAngle=n,h.sweepAngle=o)),h}ta=function(t,e){return(ta=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}ta(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(ia,ea=L),ia.prototype.draw=function(t,e,i,r){var n;return e instanceof J&&void 0===e.width&&void 0===i?this.drawHelper(t,e.x,e.y):e instanceof Z&&void 0!==e.width&&void 0===i?this.drawHelper(t,e,null):"number"==typeof e&&"number"==typeof i&&void 0===r?this.drawHelper(t,e,i,null):e instanceof J&&i instanceof Zr?this.drawHelper(t,e.x,e.y,i):"number"==typeof e&&(r instanceof Zr||null==r)&&"number"==typeof i?(n=t.graphics.clientSize.width-e,n=new Z(e,i,n,0),this.drawHelper(t,n,r)):this.drawHelper(t,e,i)},ia.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException : graphics");t.drawArc(this.obtainPen(),this.bounds,this.startAngle,this.sweepAngle)};var ta,ea,L=ia;function ia(t,e,i,r,n,o,s){var a=this;return void 0===t?a=ea.call(this)||this:t instanceof Z?a=ea.call(this,t,e,i)||this:t instanceof ne?e instanceof Z?a=ea.call(this,t,null,e,i,r)||this:void 0===o&&void 0===s?a=ea.call(this,t,null,0,0,e,i,r,n)||this:void 0!==o&&void 0!==s&&(a=ea.call(this,t,null,e,i,r,n,o,s)||this):void 0!==t&&void 0===n&&void 0===o?a=ea.call(this,0,0,t,e,i,r)||this:void 0!==t&&void 0!==n&&void 0!==o&&(a=ea.call(this,t,e,i,r,n,o)||this),a}ra=function(t,e){return(ra=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}ra(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(sa,na=Tt),sa.prototype.equalsToFont=function(t){return!1},sa.prototype.getLineWidth=function(t,e){var i=0,r=(i=null!=e&&e.textDirection!==Y.PdfTextDirection.None?this.getUnicodeLineWidth(t,i,e).width:this.fontInternal.getLineWidth(t),this.metrics.getSize(e));return i=this.applyFormatSettings(t,e,i*=Tt.charSizeMultiplier*r)},sa.prototype.getCharWidth=function(t,e){t=this.fontInternal.getCharWidth(t);return t*=.001*this.metrics.getSize(e)},sa.prototype.createFontInternal=function(t,e){this.fontInternal=new di(t,this.size),this.calculateStyle(e),this.initializeInternals()},sa.prototype.calculateStyle=function(t){var e=this.fontInternal.ttfMetrics.macStyle;0!=(t&Y.PdfFontStyle.Underline)&&(e|=Y.PdfFontStyle.Underline),0!=(t&Y.PdfFontStyle.Strikeout)&&(e|=Y.PdfFontStyle.Strikeout),this.setStyle(e)},sa.prototype.initializeInternals=function(){var t,e=null,i=null;null!=(e=Tr.enableCache?Tr.cache.search(this):e)?(i=e.getInternals(),(t=(t=e.metrics).clone()).size=this.size,this.metrics=t,this.fontInternal=e.fontInternal):null==e&&(this.fontInternal instanceof di&&(this.fontInternal.isEmbed=this.isEmbedFont),this.fontInternal.createInternals(),i=this.fontInternal.getInternals(),this.metrics=this.fontInternal.metrics),this.metrics.isUnicodeFont=!0,this.setInternals(i)},sa.prototype.setSymbols=function(t){var e=this.fontInternal;null!=e&&e.setSymbols(t)},Object.defineProperty(sa.prototype,"Unicode",{get:function(){return this.isUnicode},enumerable:!0,configurable:!0}),sa.prototype.getUnicodeLineWidth=function(t,e,i){e=0;var t=(new vi).getGlyphIndex(t,this,i.textDirection===Y.PdfTextDirection.RightToLeft,null,!0),i=t.success,r=t.glyphs;if(i&&null!==r)for(var n=this.fontInternal.ttfReader,o=0,s=r.length;o<s;o++){var a=r[o],a=n.getGlyph(a);null!=a&&(e+=a.width)}return{success:i,width:e}};var ra,na,oa=sa;function sa(t,e,i){e=na.call(this,e)||this;return e.isEmbedFont=!1,e.isUnicode=!0,void 0!==i?e.createFontInternal(t,i):e.createFontInternal(t,Y.PdfFontStyle.Regular),e}Object.defineProperty(k.prototype,"dock",{get:function(){return this.dockStyle},set:function(t){this.dockStyle=t,this.resetAlignment()},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"alignment",{get:function(){return this.alignmentStyle},set:function(t){this.setAlignment(t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"foreground",{get:function(){return this.isForeground},set:function(t){this.isForeground=t},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"background",{get:function(){return!this.isForeground},set:function(t){this.isForeground=!t},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"location",{get:function(){return this.currentLocation},set:function(t){this.type===Y.TemplateType.None&&(this.currentLocation=t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"x",{get:function(){return void 0!==this.currentLocation?this.currentLocation.x:0},set:function(t){this.type===Y.TemplateType.None&&(this.currentLocation.x=t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"y",{get:function(){return void 0!==this.currentLocation?this.currentLocation.y:0},set:function(t){this.type===Y.TemplateType.None&&(this.currentLocation.y=t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"size",{get:function(){return this.template.size},set:function(t){this.type===Y.TemplateType.None&&this.template.reset(t)},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"width",{get:function(){return this.template.width},set:function(t){var e;this.template.width!==t&&this.type===Y.TemplateType.None&&((e=this.template.size).width=t,this.template.reset(e))},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"height",{get:function(){return this.template.height},set:function(t){var e;this.template.height!==t&&this.type===Y.TemplateType.None&&((e=this.template.size).height=t,this.template.reset(e))},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"graphics",{get:function(){return this.template.graphics},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"template",{get:function(){return this.pdfTemplate},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"type",{get:function(){return this.templateType},set:function(t){this.updateDocking(t),this.templateType=t},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"bounds",{get:function(){return new Z(new J(this.x,this.y),this.size)},set:function(t){this.type===Y.TemplateType.None&&(this.location=new J(t.x,t.y),this.size=new X(t.width,t.height))},enumerable:!0,configurable:!0}),k.prototype.InitiateBounds=function(t,e,i,r,n){this.x=t,this.y=e,this.pdfTemplate=new Ti(i,r)},k.prototype.updateDocking=function(t){if(t!==Y.TemplateType.None){switch(t){case Y.TemplateType.Top:this.dock=Y.PdfDockStyle.Top;break;case Y.TemplateType.Bottom:this.dock=Y.PdfDockStyle.Bottom;break;case Y.TemplateType.Left:this.dock=Y.PdfDockStyle.Left;break;case Y.TemplateType.Right:this.dock=Y.PdfDockStyle.Right}this.resetAlignment()}},k.prototype.resetAlignment=function(){this.alignment=Y.PdfAlignmentStyle.None},k.prototype.setAlignment=function(t){if(this.dock===Y.PdfDockStyle.None)this.alignmentStyle=t;else{var e=!1;switch(this.dock){case Y.PdfDockStyle.Left:e=t===Y.PdfAlignmentStyle.TopLeft||t===Y.PdfAlignmentStyle.MiddleLeft||t===Y.PdfAlignmentStyle.BottomLeft||t===Y.PdfAlignmentStyle.None;break;case Y.PdfDockStyle.Top:e=t===Y.PdfAlignmentStyle.TopLeft||t===Y.PdfAlignmentStyle.TopCenter||t===Y.PdfAlignmentStyle.TopRight||t===Y.PdfAlignmentStyle.None;break;case Y.PdfDockStyle.Right:e=t===Y.PdfAlignmentStyle.TopRight||t===Y.PdfAlignmentStyle.MiddleRight||t===Y.PdfAlignmentStyle.BottomRight||t===Y.PdfAlignmentStyle.None;break;case Y.PdfDockStyle.Bottom:e=t===Y.PdfAlignmentStyle.BottomLeft||t===Y.PdfAlignmentStyle.BottomCenter||t===Y.PdfAlignmentStyle.BottomRight||t===Y.PdfAlignmentStyle.None;break;case Y.PdfDockStyle.Fill:e=t===Y.PdfAlignmentStyle.MiddleCenter||t===Y.PdfAlignmentStyle.None}e&&(this.alignmentStyle=t)}},k.prototype.draw=function(t,e){var i=t.page,i=this.calculateBounds(i,e);t.graphics.drawPdfTemplate(this.template,new J(i.x,i.y),new X(i.width,i.height))},k.prototype.calculateBounds=function(t,e){var i=this.bounds;return this.alignmentStyle!==Y.PdfAlignmentStyle.None?i=this.getAlignmentBounds(t,e):this.dockStyle!==Y.PdfDockStyle.None&&(i=this.getDockBounds(t,e)),i},k.prototype.getAlignmentBounds=function(t,e){this.bounds;return this.type===Y.TemplateType.None?this.getSimpleAlignmentBounds(t,e):this.getTemplateAlignmentBounds(t,e)},k.prototype.getSimpleAlignmentBounds=function(t,e){var i=this.bounds,r=t.section.getActualBounds(e,t,!1),n=this.x,o=this.y;switch(this.alignmentStyle){case Y.PdfAlignmentStyle.TopLeft:o=n=0;break;case Y.PdfAlignmentStyle.TopCenter:n=(r.width-this.width)/2,o=0;break;case Y.PdfAlignmentStyle.TopRight:n=r.width-this.width,o=0;break;case Y.PdfAlignmentStyle.MiddleLeft:n=0,o=(r.height-this.height)/2;break;case Y.PdfAlignmentStyle.MiddleCenter:n=(r.width-this.width)/2,o=(r.height-this.height)/2;break;case Y.PdfAlignmentStyle.MiddleRight:n=r.width-this.width,o=(r.height-this.height)/2;break;case Y.PdfAlignmentStyle.BottomLeft:n=0,o=r.height-this.height;break;case Y.PdfAlignmentStyle.BottomCenter:n=(r.width-this.width)/2,o=r.height-this.height;break;case Y.PdfAlignmentStyle.BottomRight:n=r.width-this.width,o=r.height-this.height}return i.x=n,i.y=o,i},k.prototype.getTemplateAlignmentBounds=function(t,e){var i=this.bounds,r=t.section,n=r.getActualBounds(e,t,!1),o=this.x,s=this.y;switch(this.alignmentStyle){case Y.PdfAlignmentStyle.TopLeft:this.type===Y.TemplateType.Left?(o=this.convertSign(n.x),s=0):this.type===Y.TemplateType.Top&&(o=this.convertSign(n.x),s=this.convertSign(n.y));break;case Y.PdfAlignmentStyle.TopCenter:o=(n.width-this.width)/2,s=this.convertSign(n.y);break;case Y.PdfAlignmentStyle.TopRight:this.type===Y.TemplateType.Right?(o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=0):this.type===Y.TemplateType.Top&&(o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=this.convertSign(n.y));break;case Y.PdfAlignmentStyle.MiddleLeft:o=this.convertSign(n.x),s=(n.height-this.height)/2;break;case Y.PdfAlignmentStyle.MiddleCenter:o=(n.width-this.width)/2,s=(n.height-this.height)/2;break;case Y.PdfAlignmentStyle.MiddleRight:o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=(n.height-this.height)/2;break;case Y.PdfAlignmentStyle.BottomLeft:this.type===Y.TemplateType.Left?(o=this.convertSign(n.x),s=n.height-this.height):this.type===Y.TemplateType.Bottom&&(o=this.convertSign(n.x),s=n.height+r.getBottomIndentHeight(e,t,!1)-this.height);break;case Y.PdfAlignmentStyle.BottomCenter:o=(n.width-this.width)/2,s=n.height+r.getBottomIndentHeight(e,t,!1)-this.height;break;case Y.PdfAlignmentStyle.BottomRight:this.type===Y.TemplateType.Right?(o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=n.height-this.height):this.type===Y.TemplateType.Bottom&&(o=n.width+r.getRightIndentWidth(e,t,!1)-this.width,s=n.height+r.getBottomIndentHeight(e,t,!1)-this.height)}return i.x=o,i.y=s,i},k.prototype.getDockBounds=function(t,e){this.bounds;return this.type===Y.TemplateType.None?this.getSimpleDockBounds(t,e):this.getTemplateDockBounds(t,e)},k.prototype.getSimpleDockBounds=function(t,e){this.bounds;var i=t.section.getActualBounds(e,t,!1),r=this.x,n=this.y,o=this.width,s=this.height;switch(this.dockStyle){case Y.PdfDockStyle.Left:n=r=0,o=this.width,s=i.height;break;case Y.PdfDockStyle.Top:n=r=0,o=i.width,s=this.height;break;case Y.PdfDockStyle.Right:r=i.width-this.width,n=0,o=this.width,s=i.height;break;case Y.PdfDockStyle.Bottom:r=0,n=i.height-this.height,o=i.width,s=this.height;break;case Y.PdfDockStyle.Fill:r=r=0,o=i.width,s=i.height}return new Z(r,n,o,s)},k.prototype.getTemplateDockBounds=function(t,e){this.bounds;var i=t.section,r=i.getActualBounds(e,t,!1),n=i.pageSettings.getActualSize(),o=this.x,s=this.y,a=this.width,h=this.height;switch(this.dockStyle){case Y.PdfDockStyle.Left:o=this.convertSign(r.x),s=0,a=this.width,h=r.height;break;case Y.PdfDockStyle.Top:o=this.convertSign(r.x),s=this.convertSign(r.y),a=n.width,h=this.height,r.height<0&&(s=n.height-r.y);break;case Y.PdfDockStyle.Right:o=r.width+i.getRightIndentWidth(e,t,!1)-this.width,s=0,a=this.width,h=r.height;break;case Y.PdfDockStyle.Bottom:o=this.convertSign(r.x),s=r.height+i.getBottomIndentHeight(e,t,!1)-this.height,a=n.width,h=this.height,r.height<0&&(s-=n.height);break;case Y.PdfDockStyle.Fill:o=o=0,a=r.width,h=r.height}return new Z(o,s,a,h)},k.prototype.convertSign=function(t){return 0!==t||0===t&&1/t==-1/0?-t:t};var aa=k;function k(t,e,i,r,n){t instanceof Z&&void 0===e?this.InitiateBounds(t.x,t.y,t.width,t.height,null):t instanceof Z&&e instanceof or&&void 0===i?this.InitiateBounds(t.x,t.y,t.width,t.height,e):t instanceof J&&e instanceof X&&void 0===i?this.InitiateBounds(t.x,t.y,e.width,e.height,null):t instanceof J&&e instanceof X&&i instanceof or&&void 0===r?this.InitiateBounds(t.x,t.y,e.width,e.height,i):t instanceof X&&void 0===e?this.InitiateBounds(0,0,t.width,t.height,null):"number"==typeof t&&"number"==typeof e&&void 0===i?this.InitiateBounds(0,0,t,e,null):"number"==typeof t&&"number"==typeof e&&i instanceof or&&void 0===r?this.InitiateBounds(0,0,t,e,i):this.InitiateBounds(t,e,i,r,null)}Y.ArabicShape=mi,Y.ArabicShapeRenderer=fi,Y.BeginPageLayoutEventArgs=bs,Y.Bidi=bi,Y.ByteArray=Be,Y.Dictionary=a,Y.DictionaryProperties=l,Y.ElementLayouter=Jr,Y.EndPageLayoutEventArgs=Ss,Y.GetResourceEventHandler=zi,Y.GridCellEventArgs=as,Y.Guid=Ai,Y.ImageDecoder=xe,Y.LineInfo=xt,Y.Matrix=he,Y.ObjectInfo=It,Y.Operators=h,Y.PageAddedEventArgs=ar,Y.PageSettingsState=br,Y.PdfAction=nt,Y.PdfActionLinkAnnotation=_r,Y.PdfAnnotation=Dr,Y.PdfAnnotationCollection=er,Y.PdfArc=L,Y.PdfArray=p,Y.PdfArrayBuffer=At,Y.PdfBitmap=Ae,Y.PdfBlend=lo,Y.PdfBorders=nn,Y.PdfBrush=pt,Y.PdfBrushes=O,Y.PdfCacheCollection=Br,Y.PdfCancelEventArgs=gs,Y.PdfCatalog=qt,Y.PdfCollection=w,Y.PdfColor=f,Y.PdfColorBlend=fo,Y.PdfCompositeField=pn,Y.PdfCrossTable=Jt,Y.PdfDestination=$n,Y.PdfDictionary=c,Y.PdfDocument=Tr,Y.PdfDocumentBase=i,Y.PdfDocumentLinkAnnotation=qr,Y.PdfDocumentPageCollection=vr,Y.PdfDocumentTemplate=cr,Y.PdfFont=Tt,Y.PdfFontMetrics=si,Y.PdfFunction=to,Y.PdfGradientBrush=xi,Y.PdfGraphics=Gi,Y.PdfGraphicsState=_i,Y.PdfGrid=Xo,Y.PdfGridBeginCellDrawEventArgs=us,Y.PdfGridBeginPageLayoutEventArgs=Bs,Y.PdfGridCell=Do,Y.PdfGridCellCollection=No,Y.PdfGridCellStyle=Vo,Y.PdfGridColumn=Io,Y.PdfGridColumnCollection=Go,Y.PdfGridEndCellDrawEventArgs=ds,Y.PdfGridEndPageLayoutEventArgs=Ls,Y.PdfGridHeaderCollection=Ko,Y.PdfGridLayoutFormat=os,Y.PdfGridLayoutResult=is,Y.PdfGridLayouter=ts,Y.PdfGridRow=Wo,Y.PdfGridRowCollection=Ho,Y.PdfGridRowStyle=Mo,Y.PdfGridStyle=To,Y.PdfGridStyleBase=Oo,Y.PdfImage=ke,Y.PdfLayoutElement=hn,Y.PdfLayoutFormat=Zr,Y.PdfLayoutParams=Qr,Y.PdfLayoutResult=en,Y.PdfLinearGradientBrush=bo,Y.PdfLinkAnnotation=Er,Y.PdfMainObjectCollection=Nt,Y.PdfMargins=Qt,Y.PdfName=o,Y.PdfNumber=u,Y.PdfPaddings=sn,Y.PdfPage=or,Y.PdfPageBase=Qi,Y.PdfPageCountField=qn,Y.PdfPageLayer=Ki,Y.PdfPageLayerCollection=Zi,Y.PdfPageNumberField=Gn,Y.PdfPageSettings=ee,Y.PdfPageSize=$t,Y.PdfPageTemplateElement=aa,Y.PdfPath=qs,Y.PdfPen=ne,Y.PdfRadialGradientBrush=vo,Y.PdfReference=et,Y.PdfReferenceHolder=d,Y.PdfResources=Ri,Y.PdfSampledFunction=ao,Y.PdfSection=yr,Y.PdfSectionCollection=Pr,Y.PdfSectionPageCollection=lr,Y.PdfSectionTemplate=gr,Y.PdfSolidBrush=mt,Y.PdfStandardFont=Mr,Y.PdfStandardFontMetricsFactory=kr,Y.PdfStream=U,Y.PdfStreamWriter=re,Y.PdfString=tt,Y.PdfStringFormat=bt,Y.PdfStringLayoutResult=Bt,Y.PdfStringLayouter=vt,Y.PdfTemplate=Ti,Y.PdfTextElement=Sn,Y.PdfTextLayoutResult=yn,Y.PdfTextWebLink=jn,Y.PdfTilingBrush=Ii,Y.PdfTransformationMatrix=se,Y.PdfTransparency=de,Y.PdfTrueTypeFont=oa,Y.PdfUriAction=ht,Y.PdfUriAnnotation=On,Y.PdfViewerPreferences=_t,Y.PdfWriter=kt,Y.PdfWriterHelper=Rt,Y.PointF=J,Y.ProcedureSets=ue,Y.Rectangle=ut,Y.RectangleF=Z,Y.RegisteredObject=Xt,Y.RowLayoutResult=js,Y.RtlCharacters=Pi,Y.RtlRenderer=vi,Y.SaveAnnotationEventHandler=E,Y.SaveCmapEventHandler=q,Y.SaveDescendantFontEventHandler=F,Y.SaveFontDictionaryEventHandler=I,Y.SaveFontProgramEventHandler=Q,Y.SaveSectionCollectionEventHandler=N,Y.SaveSectionEventHandler=G,Y.SaveTemplateEventHandler=z,Y.SizeF=X,Y.StandardWidthTable=ci,Y.StringTokenizer=Pt,Y.TextLayouter=dn,Y.TextPageLayoutResult=mn,Y.WidthTable=hi,Y.defaultToString=M,Object.defineProperty(Y,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-pdf-export.umd.min.js.map
|