363 lines
386 KiB
JavaScript
363 lines
386 KiB
JavaScript
|
!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";
|
||
|
/** @license
|
||
|
*
|
||
|
* jsPDF - PDF Document creation from JavaScript
|
||
|
* Version 2.1.1 Built on 2019-10-11T08:56:17.234Z
|
||
|
* CommitID 0dd01f177e
|
||
|
*
|
||
|
* Copyright (c) 2010-2018 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
|
||
|
* 2015-2018 yWorks GmbH, http://www.yworks.com
|
||
|
* 2015-2018 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX
|
||
|
* 2016-2018 Aras Abbasi <aras.abbasi@gmail.com>
|
||
|
* 2010 Aaron Spike, https://github.com/acspike
|
||
|
* 2012 Willow Systems Corporation, willow-systems.com
|
||
|
* 2012 Pablo Hess, https://github.com/pablohess
|
||
|
* 2012 Florian Jenett, https://github.com/fjenett
|
||
|
* 2013 Warren Weckesser, https://github.com/warrenweckesser
|
||
|
* 2013 Youssef Beddad, https://github.com/lifof
|
||
|
* 2013 Lee Driscoll, https://github.com/lsdriscoll
|
||
|
* 2013 Stefan Slonevskiy, https://github.com/stefslon
|
||
|
* 2013 Jeremy Morel, https://github.com/jmorel
|
||
|
* 2013 Christoph Hartmann, https://github.com/chris-rock
|
||
|
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
|
||
|
* 2014 James Makes, https://github.com/dollaruw
|
||
|
* 2014 Diego Casorran, https://github.com/diegocr
|
||
|
* 2014 Steven Spungin, https://github.com/Flamenco
|
||
|
* 2014 Kenneth Glassey, https://github.com/Gavvers
|
||
|
*
|
||
|
* Licensed under the MIT License
|
||
|
*
|
||
|
* Contributor(s):
|
||
|
* siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
|
||
|
* kim3er, mfo, alnorth, Flamenco
|
||
|
*/function on(t){return(on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){if("object"!==on(t.console)){t.console={};for(var e,n,r=t.console,i=function(){},a=["memory"],o="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=a.pop();)r[e]||(r[e]={});for(;n=o.pop();)r[n]||(r[n]=i)}var s,u,l,c,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function f(){}void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,a,o=0,s=0,u="",l=[];if(!t)return t;for(;e=(a=t.charCodeAt(o++)<<16|t.charCodeAt(o++)<<8|t.charCodeAt(o++))>>18&63,n=a>>12&63,r=a>>6&63,i=63&a,l[s++]=h.charAt(e)+h.charAt(n)+h.charAt(r)+h.charAt(i),o<t.length;);u=l.join("");var c=t.length%3;return(c?u.slice(0,c-3):u)+"===".slice(c||3)}),void 0===t.atob&&(t.atob=function(t){var e,n,r,i,a,o,s=0,u=0,l=[];if(!t)return t;for(t+="";e=(o=h.indexOf(t.charAt(s++))<<18|h.indexOf(t.charAt(s++))<<12|(i=h.indexOf(t.charAt(s++)))<<6|(a=h.indexOf(t.charAt(s++))))>>16&255,n=o>>8&255,r=255&o,l[u++]=64==i?String.fromCharCode(e):64==a?String.fromCharCode(e,n):String.fromCharCode(e,n,r),s<t.length;);return l.join("")}),Array.prototype.map||(Array.prototype.map=function(t){if(null==this||"function"!=typeof t)throw new TypeError;for(var e=Object(this),n=e.length>>>0,r=new Array(n),i=1<arguments.length?arguments[1]:void 0,a=0;a<n;a++)a in e&&(r[a]=t.call(i,e[a],a,e));return r}),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Array.prototype.reduce||Object.defineProperty(Array.prototype,"reduce",{value:function(t){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof t)throw new TypeError(t+" is not a function");var e,n=Object(this),r=n.length>>>0,i=0;if(2<=arguments.length)e=arguments[1];else{for(;i<r&&!(i in n);)i++;if(r<=i)throw new TypeError("Reduce of empty array with no initial value");e=n[i++]}for(;i<r;)i in n&&(e=t(e,n[i],i,n)),i++;return e}}),Uint8Array.prototype.reduce||Object.defineProperty(Uint8Array.prototype,"reduce",{value:function(t){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof t)throw new TypeError(t+" is not a function");var e,n=Object(this),r=n.length>>>0,i=0;if(2<=arguments.length)e=arguments[1];else{for(;i<r&&!(i in n);)i++;if(r<=i)throw new TypeError("Reduce of empty array with no initial value");e=n[i++]}for(;i<r;)i in n&&(e=t(e,n[i],i,n)),i++;return e}}),Array.prototype.forEach||(Array.prototype.forEach=function(t,e){if(null==this||"function"!=typeof t)throw new TypeError;for(var n=Object(this),r=n.length>>>0,i=0;i<r;i++)i in n&&t.call(e,n[i],i,n)}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var a=e[i];if(t.call(r,a,i,e))return a;i++}},configurable:!0,writable:!0}),"function"!=typeof Object.create&&(Object.create=function(t,e){if(t!==Object(t)&&null!==t)throw TypeError("Argument must be an object, or null");f.prototype=t||{},void 0!==e&&Object.defineProperties(f.prototype,e);var n=new f;return(f.prototype=null)===t&&(n.__proto__=null),n}),Object.keys||(Object.keys=(s=Object.prototype.hasOwnProperty,u=!{toString:null}.propertyIsEnumerable("toString"),c=(l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(t){if("object"!==on(t)&&("function"!=typeof t||null===t))throw new TypeError;var e,n,r=[];for(e in t)s.call(t,e)&&r.push(e);if(u)for(n=0;n<c;n++)s.call(t,l[n])&&r.push(l[n]);return r})),Object.values||(Object.values=function(t){v
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2016 Alexander Weidt,
|
||
|
* https://github.com/BiggA94
|
||
|
*
|
||
|
* Licensed under the MIT License. http://opensource.org/licenses/mit-license
|
||
|
*/function un(a){if("object"!==on(a))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var o={};this.subscribe=function(t,e,n){if(n=n||!1,"string"!=typeof t||"function"!=typeof e||"boolean"!=typeof n)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");o.hasOwnProperty(t)||(o[t]={});var r=Math.random().toString(35);return o[t][r]=[e,!!n],r},this.unsubscribe=function(t){for(var e in o)if(o[e][t])return delete o[e][t],0===Object.keys(o[e]).length&&delete o[e],!0;return!1},this.publish=function(t){if(o.hasOwnProperty(t)){var e=Array.prototype.slice.call(arguments,1),n=[];for(var r in o[t]){var i=o[t][r];try{i[0].apply(a,e)}catch(t){sn.console&&console.error("jsPDF PubSub Error",t.message,t)}i[1]&&n.push(r)}n.length&&n.forEach(this.unsubscribe)}},this.getTopics=function(){return o}}function ln(t){var r,a="string"==typeof arguments[0]?arguments[0]:"p",e=arguments[1],o=arguments[2],n=arguments[3],i=[],s=1,u=16,l="S";"object"===on(t=t||{})&&(a=t.orientation,e=t.unit||e,o=t.format||o,n=t.compress||t.compressPdf||n,s="number"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(r=t.precision),void 0!==t.floatPrecision&&(u=t.floatPrecision),l=t.defaultPathOperation||"S"),i=t.filters||(!0===n?["FlateEncode"]:i),e=e||"mm",a=(""+(a||"P")).toLowerCase();var c=t.putOnlyUsedFonts||!1,et={},h={internal:{},__private__:{}};h.__private__.PubSub=un;var f="1.3",d=h.__private__.getPdfVersion=function(){return f};h.__private__.setPdfVersion=function(t){f=t};var p={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};h.__private__.getPageFormats=function(){return p};var g=h.__private__.getPageFormat=function(t){return p[t]};o=o||"a4";var m="compat",nt="advanced",rt=m;function b(){this.saveGraphicsState(),st(new Ft(tt,0,0,-tt,0,rn()*tt).toString()+" cm"),this.setFontSize(this.getFontSize()/tt),l="n",rt=nt}function v(){this.restoreGraphicsState(),l="S",rt=m}h.advancedAPI=function(t){var e=rt===m;return e&&b.call(this),"function"!=typeof t||(t(this),e&&v.call(this)),this},h.compatAPI=function(t){var e=rt===nt;return e&&v.call(this),"function"!=typeof t||(t(this),e&&b.call(this)),this},h.isAdvancedAPI=function(){return rt===nt};function it(t){if(rt!==nt)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")}var at,y=h.roundToPrecision=h.__private__.roundToPrecision=function(t,e){var n=r||e;if(isNaN(t)||isNaN(n))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(n).replace(/0+$/,"")};at=h.hpf=h.__private__.hpf="number"==typeof u?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return y(t,u)}:"smart"===u?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return y(t,-1<t&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return y(t,16)};function w(t){return ot(function(t){return rt===m?rn()-t:rt===nt?t:void 0}(t))}var x=h.f2=h.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return y(t,2)},N=h.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return y(t,3)},ot=h.scale=h.__private__.scale=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.scale");r
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2016 Alexander Weidt,
|
||
|
* https://github.com/BiggA94
|
||
|
*
|
||
|
* Licensed under the MIT License. http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
!function(t,e){function A(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function b(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function _(t){return t.toFixed(2)}function s(t){return t.toFixed(5)}var h,n=t.API,r=1;n.__acroform__={};function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t}function v(t){return t*r}function y(t){return t/r}function u(t){var e=new O,n=J.internal.getHeight(t)||0,r=J.internal.getWidth(t)||0;return e.BBox=[0,0,Number(_(r)),Number(_(n))],e}function f(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t.V||t.DV,r=L(t,n),i=h.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(h.__private__.encodeColorString(t.color)),e.push("/"+i+" "+_(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var a=new u(t);return a.stream=e.join("\n"),a}}function a(){h.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=h.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.objId=void 0,n.hasAnnotation&&k.call(h,n)}}function o(){if(void 0===h.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");h.internal.write("/AcroForm "+h.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")}function l(){h.internal.events.unsubscribe(h.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete h.internal.acroformPlugin.acroFormDictionaryRoot._eventID,h.internal.acroformPlugin.printedOut=!0}function c(t){var e=!t;for(var n in t||(h.internal.newObjectDeferredBegin(h.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),h.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||h.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(n)){var r=t[n],i=[],a=r.Rect;if(r.Rect&&(r.Rect=m.call(this,r.Rect)),h.internal.newObjectDeferredBegin(r.objId,!0),r.DA=J.createDefaultAppearanceStream(r),"object"===on(r)&&"function"==typeof r.getKeyValueListForStream&&(i=r.getKeyValueListForStream()),r.Rect=a,r.hasAppearanceStream&&!r.appearanceStreamContent){var o=f.call(this,r);i.push({key:"AP",value:"<</N "+o+">>"}),h.internal.acroformPlugin.xForms.push(o)}if(r.appearanceStreamContent){var s="";for(var u in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(u)){var l=r.appearanceStreamContent[u];if(s+="/"+u+" ",s+="<<",1<=Object.keys(l).length||Array.isArray(l)){for(var n in l)if(l.hasOwnProperty(n)){var c=l[n];"function"==typeof c&&(c=c.call(this,r)),s+="/"+n+" "+c+" ",0<=h.internal.acroformPlugin.xForms.indexOf(c)||h.internal.acroformPlugin.xForms.push(c)}}else"function"==typeof(c=l)&&(c=c.call(this,r)),s+="/"+n+" "+c,0<=h.internal.acroformPlugin.xForms.indexOf(c)||h.internal.acroformPlugin.xForms.push(c);s+=">>"}i.push({key:"AP",value:"<<\n"+s+">>"})}h.internal.putStream({additionalKeyValues:i}),h.internal.out("endobj")}e&&F.call(this,h.internal.acroformPlugin.xForms)}var d=n.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|=1<<e},p=n.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&=~(1<<e)},g=n.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return 0==(t&1<<e)?0:1},w=n.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return g(t,e-1)},x=n.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return d(t,e-1)},N=n.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return p(t,e-1)},m=n.__acrofo
|
||
|
/** @license
|
||
|
* jsPDF addImage plugin
|
||
|
* Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/
|
||
|
* 2013 Chris Dowling, https://github.com/gingerchris
|
||
|
* 2013 Trinh Ho, https://github.com/ineedfat
|
||
|
* 2013 Edwin Alejandro Perez, https://github.com/eaparango
|
||
|
* 2013 Norah Smith, https://github.com/burnburnrocket
|
||
|
* 2014 Diego Casorran, https://github.com/diegocr
|
||
|
* 2014 James Robb, https://github.com/jamesbrobb
|
||
|
*
|
||
|
*
|
||
|
*/
|
||
|
function(s){var p="addImage_";s.__addimage__={};function h(t){for(var e=this.internal.write,n=this.internal.putStream,r=(0,this.internal.getFilters)();-1!==r.indexOf("FlateEncode");)r.splice(r.indexOf("FlateEncode"),1);t.objectId=this.internal.newObject();var i=[];if(i.push({key:"Type",value:"/XObject"}),i.push({key:"Subtype",value:"/Image"}),i.push({key:"Width",value:t.width}),i.push({key:"Height",value:t.height}),t.colorSpace===v.INDEXED?i.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(t.palette.length/3-1)+" "+("sMask"in t&&void 0!==t.sMask?t.objectId+2:t.objectId+1)+" 0 R]"}):(i.push({key:"ColorSpace",value:"/"+t.colorSpace}),t.colorSpace===v.DEVICE_CMYK&&i.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),i.push({key:"BitsPerComponent",value:t.bitsPerComponent}),"decodeParameters"in t&&void 0!==t.decodeParameters&&i.push({key:"DecodeParms",value:"<<"+t.decodeParameters+">>"}),"transparency"in t&&Array.isArray(t.transparency)){for(var a="",o=0,s=t.transparency.length;o<s;o++)a+=t.transparency[o]+" "+t.transparency[o]+" ";i.push({key:"Mask",value:"["+a+"]"})}void 0!==t.sMask&&i.push({key:"SMask",value:t.objectId+1+" 0 R"});var u=void 0!==t.filter?["/"+t.filter]:void 0;if(n({data:t.data,additionalKeyValues:i,alreadyAppliedFilters:u}),e("endobj"),"sMask"in t&&void 0!==t.sMask){var l="/Predictor "+t.predictor+" /Colors 1 /BitsPerComponent "+t.bitsPerComponent+" /Columns "+t.width,c={width:t.width,height:t.height,colorSpace:"DeviceGray",bitsPerComponent:t.bitsPerComponent,decodeParameters:l,data:t.sMask};"filter"in t&&(c.filter=t.filter),h.call(this,c)}t.colorSpace===v.INDEXED&&(this.internal.newObject(),n({data:A(new Uint8Array(t.palette))}),e("endobj"))}function t(){var t=this.internal.collections[p+"images"];for(var e in t)h.call(this,t[e])}function e(){var t,e=this.internal.collections[p+"images"],n=this.internal.write;for(var r in e)n("/I"+(t=e[r]).index,t.objectId,"0","R")}function g(){this.internal.collections[p+"images"]||(this.internal.collections[p+"images"]={},this.internal.events.subscribe("putResources",t),this.internal.events.subscribe("putXobjectDict",e))}function u(t){return"function"==typeof s["process"+t.toUpperCase()]}function f(t){return"object"===on(t)&&1===t.nodeType}function l(t,e){if("IMG"===t.nodeName&&t.hasAttribute("src")){var n=""+t.getAttribute("src");if(0===n.indexOf("data:image/"))return atob(unescape(n).split("base64,").pop());var r=s.loadFile(n,!0);if(void 0!==r)return r}if("CANVAS"===t.nodeName){var i;switch(e){case"PNG":i="image/png";break;case"WEBP":i="image/webp";break;case"JPEG":case"JPG":default:i="image/jpeg"}return atob(t.toDataURL(i,1).split("base64,").pop())}}function d(t,e,n,r,i,a){var o=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.width*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.height*72/e/this.internal.scaleFactor),0===t&&(t=e*n.width/n.height),0===e&&(e=t*n.height/n.width),[t,e]}.call(this,n,r,i),s=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString,l=function(){var t=this.internal.collections[p+"images"];return g.call(this),t}.call(this);if(n=o[0],r=o[1],l[i.index]=i,a){a*=Math.PI/180;var c=Math.cos(a),h=Math.sin(a),f=function(t){return t.toFixed(4)},d=[f(c),f(h),f(-1*h),f(c),0,0,"cm"]}this.internal.write("q"),a?(this.internal.write([1,"0","0",1,s(t),u(e+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([s(n),"0","0",s(r),"0","0","cm"].join(" "))):this.internal.write([s(n),"0","0",s(r),s(t),u(e+r),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+i.index+" Do"),this.internal.write("Q")}var m="UNKNOWN",c={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},b=s.__addimage__.getImageFileTypeByImageData=fun
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
|
||
|
*
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
t=U.API,U.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(t){for(var e,n,r,i=this.internal.getCoordinateString,a=this.internal.getVerticalCoordinateString,o=this.internal.getPageInfoByObjId(t.objId),s=t.pageContext.annotations,u=!1,l=0;l<s.length&&!u;l++)switch((e=s[l]).type){case"link":(z(e.options.url)||z(e.options.pageNumber))&&(u=!0);break;case"reference":case"text":case"freetext":u=!0}if(0!=u){this.internal.write("/Annots [");for(var c=0;c<s.length;c++)switch((e=s[c]).type){case"reference":this.internal.write(" "+e.object.objId+" 0 R ");break;case"text":var h=this.internal.newAdditionalObject(),f=this.internal.newAdditionalObject(),d=e.title||"Note";r="<</Type /Annot /Subtype /Text "+(n="/Rect ["+i(e.bounds.x)+" "+a(e.bounds.y+e.bounds.h)+" "+i(e.bounds.x+e.bounds.w)+" "+a(e.bounds.y)+"] ")+"/Contents ("+e.contents+")",r+=" /Popup "+f.objId+" 0 R",r+=" /P "+o.objId+" 0 R",r+=" /T ("+d+") >>",h.content=r;var p=h.objId+" 0 R";r="<</Type /Annot /Subtype /Popup "+(n="/Rect ["+i(e.bounds.x+30)+" "+a(e.bounds.y+e.bounds.h)+" "+i(e.bounds.x+e.bounds.w+30)+" "+a(e.bounds.y)+"] ")+" /Parent "+p,e.open&&(r+=" /Open true"),r+=" >>",f.content=r,this.internal.write(h.objId,"0 R",f.objId,"0 R");break;case"freetext":n="/Rect ["+i(e.bounds.x)+" "+a(e.bounds.y)+" "+i(e.bounds.x+e.bounds.w)+" "+a(e.bounds.y+e.bounds.h)+"] ";var g=e.color||"#000000";r="<</Type /Annot /Subtype /FreeText "+n+"/Contents ("+e.contents+")",r+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+g+")",r+=" /Border [0 0 0]",r+=" >>",this.internal.write(r);break;case"link":if(e.options.name){var m=this.annotations._nameMap[e.options.name];e.options.pageNumber=m.page,e.options.top=m.y}else e.options.top||(e.options.top=0);if(n="/Rect ["+i(e.x)+" "+a(e.y)+" "+i(e.x+e.w)+" "+a(e.y+e.h)+"] ",r="",e.options.url)r="<</Type /Annot /Subtype /Link "+n+"/Border [0 0 0] /A <</S /URI /URI ("+e.options.url+") >>";else if(e.options.pageNumber)switch(r="<</Type /Annot /Subtype /Link "+n+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(e.options.pageNumber).objId+" 0 R",e.options.magFactor=e.options.magFactor||"XYZ",e.options.magFactor){case"Fit":r+=" /Fit]";break;case"FitH":r+=" /FitH "+e.options.top+"]";break;case"FitV":e.options.left=e.options.left||0,r+=" /FitV "+e.options.left+"]";break;case"XYZ":default:var b=a(e.options.top);e.options.left=e.options.left||0,void 0===e.options.zoom&&(e.options.zoom=0),r+=" /XYZ "+e.options.left+" "+b+" "+e.options.zoom+"]"}""!=r&&(r+=" >>",this.internal.write(r))}this.internal.write("]")}}]),t.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},t.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),a=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n,r),n+=.2*a,this.link(e,n-a,i,a,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 Aras Abbasi
|
||
|
*
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
function(t){var l={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},a={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},e={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},n=[1570,1571,1573,1575];t.__arabicParser__={};var r=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==l[t.charCodeAt(0)]},c=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},i=t.__arabicParser__.isArabicEndLetter=function(t){return c(t)&&r(t)&&l[t.charCodeAt(0)].length<=2},o=t.__arabicParser__.isArabicAlfLetter=function(t){return c(t)&&0<=n.indexOf(t.charCodeAt(0))};t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return c(t)&&r(t)&&1<=l[t.charCodeAt(0)].length};var s=t.__arabicParser__.arabicLetterHasFinalForm=function(t){return c(t)&&r(t)&&2<=l[t.charCodeAt(0)].length};t.__arabicParser__.arabicLetterHasInitialForm=function(t){return c(t)&&r(t)&&3<=l[t.charCodeAt(0)].length};var u=t.__arabicParser__.arabicLetterHasMedialForm=function(t){return c(t)&&r(t)&&4==l[t.charCodeAt(0)].length},h=t.__arabicParser__.resolveLigatures=function(t){var e=0,n=a,r="",i=0;for(e=0;e<t.length;e+=1)void 0!==n[t.charCodeAt(e)]?(i++,"number"==typeof(n=n[t.charCodeAt(e)])&&(r+=String.fromCharCode(n),n=a,i=0),e===t.length-1&&(n=a,r+=t.charAt(e-(i-1)),e-=i-1,i=0)):(n=a,r+=t.charAt(e-i),e-=i,i=0);return r};t.__arabicParser__.isArabicDiacritic=function(t){return void 0!==t&&void 0!==e[t.charCodeAt(0)]};function f(t){var e=0,n=0,r=0,i="",a="",o="",s=(t=t||"").split("\\s+"),u=[];for(e=0;e<s.length;e+=1){for(u.push(""),n=0;n<s[e].length;n+=1)i=s[e][n],a=s[e][n-1],o=s[e][n+1],c(i)?(r=d(i,a,o),u[e]+=-1!==r?String.fromCharCode(l[i.charCodeAt(0)][r]):i):u[e]+=i;u[e]=h(u[e])}return u.join(" ")}var d=t.__arabicParser__.getCorrectForm=function(t,e,n){return c(t)?!1===r(t)?-1:!s(t)||!c(e)&&!c(n)||!c(n)&&i(e)||i(t)&&!c(e)||i(t)&&o(e)||i(t)&&i(e)?0:u(t)&&c(e)&&!i(e)&&c(n)&&s(n)?3:i(t)||!c(n)?1:
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
|
||
|
*
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
e=U.API,H.prototype.getContext=function(t,e){var n;if("2d"!==(t=t||"2d"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return(this.pdf.context2d._canvas=this).pdf.context2d},H.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new H,this.canvas.pdf=this}]),
|
||
|
/**
|
||
|
* @license
|
||
|
* ====================================================================
|
||
|
* Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
|
||
|
* 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
|
||
|
* 2013 Lee Driscoll, https://github.com/lsdriscoll
|
||
|
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
|
||
|
* 2014 James Hall, james@parall.ax
|
||
|
* 2014 Diego Casorran, https://github.com/diegocr
|
||
|
*
|
||
|
*
|
||
|
* ====================================================================
|
||
|
*/
|
||
|
function(t){function S(){void 0===this.internal.__cell__&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},P),this.internal.__cell__.margins.width=this.getPageWidth(),k.call(this))}var P={left:0,top:0,bottom:0,right:0},o=!1,k=function(){this.internal.__cell__.lastCell=new F,this.internal.__cell__.pages=1},F=function(){var e=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return e},set:function(t){e=t}});var n=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return n},set:function(t){n=t}});var r=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return r},set:function(t){r=t}});var i=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return i},set:function(t){i=t}});var a=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return a},set:function(t){a=t}});var o=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return o},set:function(t){o=t}});var s=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return s},set:function(t){s=t}}),this};F.prototype.clone=function(){return new F(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},F.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(t){return S.call(this),this.internal.__cell__.headerFunction="function"==typeof t?t:void 0,this},t.getTextDimensions=function(t,e){S.call(this);var n=(e=e||{}).fontSize||this.getFontSize(),r=e.font||this.getFont(),i=e.scaleFactor||this.internal.scaleFactor,a=0,o=0,s=0;if(!Array.isArray(t)&&"string"!=typeof t)throw new Error("getTextDimensions expects text-parameter to be of type String or an Array of Strings.");t=Array.isArray(t)?t:[t];for(var u=0;u<t.length;u++)a<(s=this.getStringUnitWidth(t[u],{font:r})*n)&&(a=s),0!==a&&(o=t.length);return{w:a/=i,h:Math.max((o*n*this.getLineHeightFactor()-n*(this.getLineHeightFactor()-1))/i,0)}},t.cellAddPage=function(){S.call(this),this.addPage();var t=this.internal.__cell__.margins||P;return this.internal.__cell__.lastCell=new F(t.left,t.top,void 0,void 0),this.internal.__cell__.pages+=1,this},t.cellInitialize=function(){S.call(this),k.call(this)};var C=t.cell=function(){var t;t=arguments[0]instanceof F?arguments[0]:new F(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),S.call(this);var e=this.internal.__cell__.lastCell,n=this.internal.__cell__.padding,r=this.internal.__cell__.margins||P,i=this.internal.__cell__.tableHeaderRow,a=this.internal.__cell__.printHeaders;return void 0!==e.lineNumber&&(e.lineNumber===t.lineNumber?(t.x=(e.x||0)+(e.width||0),t.y=e.y||0):e.y+e.height+t.height+r.bottom>this.getPageHeight()?(this.cellAddPage(),t.y=r.top,a&&i&&(this.printHeaderRow(t.lineNumber,!0),t.y+=i[0].height)):t.y=e.y+e.height||t.y),void 0!==t.text[0]&&(this.rect(t.x,t.y,t.width,t.height,!0===o?"FD":void 0),"right"===t.align?this.text(t.text,t.x+t.width-n,t.y+n,{align:"right",baseline:"top"}):"center"===t.align?this.text(t.text,t.x+t.width/2,t.y+n,{align:"center",baseline:"top",maxWidth:t.width-n-n}):this.text(t.text,t.x+n,t.y+n,{align:"left",baseline:"top",maxWidth:t.width-n-n})),this.internal.__cell__.lastCell=t,this};t.table=function(e,n,t,r,i){if(S.call(this),!t)throw new Error("No data for PDF table.");var a,o,s,u,l=[],c=[],h=[],f={},d={},p=[],g=[],m=(i=i||{}).autoSize||!1,b=!1!==i.printHeaders,v=i.css&&void 0!==i.css["font-size"]?16*i.css["font-size"]:i.fontSize||12,y=i.margins||Object.assign({width:this.getPageWidth()},P),w="number"==typeof i.padding?i.padding:3,x=i.headerBackgroundColor||"#c8c8c8";if(k.call(this),this.internal.__cell__.printHeaders=b,this.internal.__cell__.margins=y,this.internal.__cell__.table_font_size=v,this.internal.__cell__.padding=w,this.internal.__cell__.headerBackgroundColor=x,this.setFontSize(v),null==r)h=(c=l=Object.keys(t[0])).map(function()
|
||
|
/**
|
||
|
* jsPDF Context2D PlugIn Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
|
||
|
*
|
||
|
* Licensed under the MIT License. http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
function(t){function c(t){return t=t||{},this.isStrokeTransparent=t.isStrokeTransparent||!1,this.strokeOpacity=t.strokeOpacity||1,this.strokeStyle=t.strokeStyle||"#000000",this.fillStyle=t.fillStyle||"#000000",this.isFillTransparent=t.isFillTransparent||!1,this.fillOpacity=t.fillOpacity||1,this.font=t.font||"10px sans-serif",this.textBaseline=t.textBaseline||"alphabetic",this.textAlign=t.textAlign||"left",this.lineWidth=t.lineWidth||1,this.lineJoin=t.lineJoin||"miter",this.lineCap=t.lineCap||"butt",this.path=t.path||[],this.transform=void 0!==t.transform?t.transform.clone():new P,this.globalCompositeOperation=t.globalCompositeOperation||"normal",this.globalAlpha=t.globalAlpha||1,this.clip_path=t.clip_path||[],this.currentPoint=t.currentPoint||new v,this.miterLimit=t.miterLimit||10,this.lastPoint=t.lastPoint||new v,this.ignoreClearRect="boolean"!=typeof t.ignoreClearRect||t.ignoreClearRect,this}var u,i,a,l,h,v,k,P,f;t.events.push(["initialized",function(){this.context2d=new e(this),u=this.internal.f2,i=this.internal.getCoordinateString,a=this.internal.getVerticalCoordinateString,l=this.internal.getHorizontalCoordinate,h=this.internal.getVerticalCoordinate,v=this.internal.Point,k=this.internal.Rectangle,P=this.internal.Matrix,f=new c}]);var e=function(t){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var e=t;Object.defineProperty(this,"pdf",{get:function(){return e}});var n=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return n},set:function(t){n=Boolean(t)}});var r=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return r},set:function(t){r=Boolean(t)}});var i=0;Object.defineProperty(this,"posX",{get:function(){return i},set:function(t){isNaN(t)||(i=t)}});var a=0;Object.defineProperty(this,"posY",{get:function(){return a},set:function(t){isNaN(t)||(a=t)}});var o=!1;Object.defineProperty(this,"autoPaging",{get:function(){return o},set:function(t){o=Boolean(t)}});var s=0;Object.defineProperty(this,"lastBreak",{get:function(){return s},set:function(t){s=t}});var u=[];Object.defineProperty(this,"pageBreaks",{get:function(){return u},set:function(t){u=t}}),Object.defineProperty(this,"ctx",{get:function(){return f},set:function(t){t instanceof c&&(f=t)}}),Object.defineProperty(this,"path",{get:function(){return f.path},set:function(t){f.path=t}});var l=[];Object.defineProperty(this,"ctxStack",{get:function(){return l},set:function(t){l=t}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(t){var e;e=d(t),this.ctx.fillStyle=e.style,this.ctx.isFillTransparent=0===e.a,this.ctx.fillOpacity=e.a,this.pdf.setFillColor(e.r,e.g,e.b,{a:e.a}),this.pdf.setTextColor(e.r,e.g,e.b,{a:e.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(t){var e=d(t);this.ctx.strokeStyle=e.style,this.ctx.isStrokeTransparent=0===e.a,this.ctx.strokeOpacity=e.a,0===e.a?this.pdf.setDrawColor(255,255,255):(e.a,this.pdf.setDrawColor(e.r,e.g,e.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(t){-1!==["butt","round","square"].indexOf(t)&&(this.ctx.lineCap=t,this.pdf.setLineCap(t))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(t){isNaN(t)||(this.ctx.lineWidth=t,this.pdf.setLineWidth(t))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(t){-1!==["bevel","round","miter"].indexOf(t)&&(this.ctx.lineJoin=t,this.pdf.setLineJoin(t))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(t){isNaN(t)||(this.ctx.miterLimit=t,this.pdf.setMiterLimit(t))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(t){this.ctx.textBaseline=t}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(t){-1!==["right","end","center","left","start"].indexOf(t)&&(this.ctx.textAlign=t)}}),Object.defineProperty(this,"font",{get:function(){return th
|
||
|
/**
|
||
|
* jsPDF filters PlugIn
|
||
|
* Copyright (c) 2014 Aras Abbasi
|
||
|
*
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
a=U.API).processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n<e.length;n+=1)switch(e[n]){case"ASCII85Decode":case"/ASCII85Decode":r=V(r),i.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":r=W(r),i.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":r=G(r),i.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":r=r.split("").map(function(t){return("0"+t.charCodeAt().toString(16)).slice(-2)}).join("")+">",i.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":r=Y(r),i.push("/FlateDecode");break;default:throw new Error('The filter: "'+e[n]+'" is not implemented')}return{data:r,reverseChain:i.reverse().join(" ")}},(
|
||
|
/**
|
||
|
* jsPDF fileloading PlugIn
|
||
|
* Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
|
||
|
*
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
n=U.API).loadFile=function(t,e,n){e=!1!==e,n="function"==typeof n?n:function(){};var r=void 0;try{r=function(t,e,n){function r(t){var e=t.length,n=[],r=String.fromCharCode;for(a=0;a<e;a+=1)n.push(r(255&t.charCodeAt(a)));return n.join("")}var i=new XMLHttpRequest,a=0;if(i.open("GET",t,!e),i.overrideMimeType("text/plain; charset=x-user-defined"),!1===e&&(i.onload=function(){200===i.status?n(r(this.responseText)):n(void 0)}),i.send(null),e&&200===i.status)return r(i.responseText)}(t,e,n)}catch(t){}return r},n.loadImageFile=n.loadFile,
|
||
|
/**
|
||
|
* Copyright (c) 2018 Erik Koopmans
|
||
|
* Released under the MIT License.
|
||
|
*
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
function(t,e){if("undefined"!=typeof Promise){var n=function(t){var e=on(t);return"undefined"===e?"undefined":"string"===e||t instanceof String?"string":"number"===e||t instanceof Number?"number":"function"===e||t instanceof Function?"function":t&&t.constructor===Array?"array":t&&1===t.nodeType?"element":"object"===e?"object":"unknown"},r=function(t,e){var n=document.createElement(t);if(e.className&&(n.className=e.className),e.innerHTML){n.innerHTML=e.innerHTML;for(var r=n.getElementsByTagName("script"),i=r.length;0<i--;)r[i].parentNode.removeChild(r[i])}for(var a in e.style)n.style[a]=e.style[a];return n},o=function t(e){var n=Object.assign(t.convert(Promise.resolve()),JSON.parse(JSON.stringify(t.template))),r=t.convert(Promise.resolve(),n);return r=(r=r.setProgress(1,t,1,[t])).set(e)};((o.prototype=Object.create(Promise.prototype)).constructor=o).convert=function(t,e){return t.__proto__=e||o.prototype,t},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{}}},o.prototype.from=function(t,e){return this.then(function(){switch(e=e||function(t){switch(n(t)){case"string":return"string";case"element":return"canvas"===t.nodeName.toLowerCase?"canvas":"element";default:return"unknown"}}(t)){case"string":return this.set({src:r("div",{innerHTML:t})});case"element":return this.set({src:t});case"canvas":return this.set({canvas:t});case"img":return this.set({img:t});default:return this.error("Unknown source type.")}})},o.prototype.to=function(t){switch(t){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var t={position:"relative",display:"inline-block",width:Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:"white"},e=function t(e,n){for(var r=3===e.nodeType?document.createTextNode(e.nodeValue):e.cloneNode(!1),i=e.firstChild;i;i=i.nextSibling)!0!==n&&1===i.nodeType&&"SCRIPT"===i.nodeName||r.appendChild(t(i,n));return 1===e.nodeType&&("CANVAS"===e.nodeName?(r.width=e.width,r.height=e.height,r.getContext("2d").drawImage(e,0,0)):"TEXTAREA"!==e.nodeName&&"SELECT"!==e.nodeName||(r.value=e.value),r.addEventListener("load",function(){r.scrollTop=e.scrollTop,r.scrollLeft=e.scrollLeft},!0)),r}(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===e.tagName&&(t.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=r("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=r("div",{className:"html2pdf__container",style:t}),this.prop.container.appendChild(e),this.prop.container.firstChild.appendChild(r("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},o.prototype.toCanvas=function(){var t=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(t).then(function(){var t=Object.assign({},this.opt.html2canvas);if(delete t.onrendered,this.isHtml2CanvasLoaded())return html2canvas(this.prop.container,t)}).then(functi
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
|
||
|
*
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
s=U.API).events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(0<this.outline.root.children.length)for(var n=t.outline.render().split(/\r\n/),r=0;r<n.length;r++){var i=n[r],a=e.exec(i);if(null!=a){var o=a[1];t.internal.newObjectDeferredBegin(o,!1)}t.internal.write(i)}if(this.outline.createNamedDestinations){var s=this.internal.pages.length,u=[];for(r=0;r<s;r++){var l=t.internal.newObject();u.push(l);var c=t.internal.getPageInfo(r+1);t.internal.write("<< /D["+c.objId+" 0 R /XYZ null null null]>> endobj")}var h=t.internal.newObject();for(t.internal.write("<< /Names [ "),r=0;r<u.length;r++)t.internal.write("(page_"+(r+1)+")"+u[r]+" 0 R");t.internal.write(" ] >>","endobj"),f=t.internal.newObject(),t.internal.write("<< /Dests "+h+" 0 R"),t.internal.write(">>","endobj")}}]),s.events.push(["putCatalog",function(){0<this.outline.root.children.length&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+f+" 0 R"))}]),s.events.push(["initialized",function(){var s=this;s.outline={createNamedDestinations:!1,root:{children:[]}},s.outline.add=function(t,e,n){var r={title:e,options:n,children:[]};return null==t&&(t=this.root),t.children.push(r),r},s.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=s,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},s.outline.genIds_r=function(t){t.id=s.internal.newObjectDeferred();for(var e=0;e<t.children.length;e++)this.genIds_r(t.children[e])},s.outline.renderRoot=function(t){this.objStart(t),this.line("/Type /Outlines"),0<t.children.length&&(this.line("/First "+this.makeRef(t.children[0])),this.line("/Last "+this.makeRef(t.children[t.children.length-1]))),this.line("/Count "+this.count_r({count:0},t)),this.objEnd()},s.outline.renderItems=function(t){for(var e=this.ctx.pdf.internal.getVerticalCoordinateString,n=0;n<t.children.length;n++){var r=t.children[n];this.objStart(r),this.line("/Title "+this.makeString(r.title)),this.line("/Parent "+this.makeRef(t)),0<n&&this.line("/Prev "+this.makeRef(t.children[n-1])),n<t.children.length-1&&this.line("/Next "+this.makeRef(t.children[n+1])),0<r.children.length&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1])));var i=this.count=this.count_r({count:0},r);if(0<i&&this.line("/Count "+i),r.options&&r.options.pageNumber){var a=s.internal.getPageInfo(r.options.pageNumber);this.line("/Dest ["+a.objId+" 0 R /XYZ 0 "+e(0)+" 0]")}this.objEnd()}for(var o=0;o<t.children.length;o++)this.renderItems(t.children[o])},s.outline.line=function(t){this.ctx.val+=t+"\r\n"},s.outline.makeRef=function(t){return t.id+" 0 R"},s.outline.makeString=function(t){return"("+s.internal.pdfEscape(t)+")"},s.outline.objStart=function(t){this.ctx.val+="\r\n"+t.id+" 0 obj\r\n<<\r\n"},s.outline.objEnd=function(){this.ctx.val+=">> \r\nendobj\r\n"},s.outline.count_r=function(t,e){for(var n=0;n<e.children.length;n++)t.count++,this.count_r(t,e.children[n]);return t.count}}]),
|
||
|
/**
|
||
|
* @license
|
||
|
*
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
u=U.API,l=[192,193,194,195,196,197,198,199],u.processJPEG=function(t,e,n,r,i,a){var o,s=this.decode.DCT_DECODE,u=null;if("string"==typeof t||this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t)){switch(t=i||t,t=this.__addimage__.isArrayBuffer(t)?new Uint8Array(t):t,(o=function(t){for(var e,n=256*t.charCodeAt(4)+t.charCodeAt(5),r=t.length,i={width:0,height:0,numcomponents:1},a=4;a<r;a+=2){if(a+=n,-1!==l.indexOf(t.charCodeAt(a+1))){e=256*t.charCodeAt(a+5)+t.charCodeAt(a+6),i={width:256*t.charCodeAt(a+7)+t.charCodeAt(a+8),height:e,numcomponents:t.charCodeAt(a+9)};break}n=256*t.charCodeAt(a+2)+t.charCodeAt(a+3)}return i}(t=this.__addimage__.isArrayBufferView(t)?this.__addimage__.arrayBufferToBinaryString(t):t)).numcomponents){case 1:a=this.color_spaces.DEVICE_GRAY;break;case 4:a=this.color_spaces.DEVICE_CMYK;break;case 3:a=this.color_spaces.DEVICE_RGB}u={data:t,width:o.width,height:o.height,colorSpace:a,bitsPerComponent:8,filter:s,index:e,alias:n}}return u},
|
||
|
/**
|
||
|
* @license
|
||
|
*
|
||
|
* Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
|
||
|
*
|
||
|
*
|
||
|
* ====================================================================
|
||
|
*/
|
||
|
P=U.API,k="undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")(),F=function(){return"function"==typeof Deflater},d=function(t){var e=30720;return e|=Math.min(3,(t-1&255)>>1)<<6,e|=0,[120,255&(e+=31-e%31)]},p=function(t,e,n,r){for(var i,a,o,s=t.length/e,u=new Uint8Array(t.length+s),l=y(),c=0;c<s;c+=1){if(o=c*e,i=t.subarray(o,o+e),r)u.set(r(i,n,a),o+c);else{for(var h,f=l.length,d=[];h<f;h+=1)d[h]=l[h](i,n,a);var p=w(d.concat());u.set(d[p],o+c)}a=i}return u},g=function(t,e){var n,r=[],i=t.length;r[0]=1;for(var a=0;a<i;a+=1)n=t[a-e]||0,r[a+1]=t[a]-n+256&255;return r},m=function(t,e,n){var r,i=[],a=t.length;i[0]=2;for(var o=0;o<a;o+=1)r=n&&n[o]||0,i[o+1]=t[o]-r+256&255;return i},b=function(t,e,n){var r,i,a=[],o=t.length;a[0]=3;for(var s=0;s<o;s+=1)r=t[s-e]||0,i=n&&n[s]||0,a[s+1]=t[s]+256-(r+i>>>1)&255;return a},v=function(t,e,n){var r,i,a,o,s=[],u=t.length;s[0]=4;for(var l=0;l<u;l+=1)r=t[l-e]||0,i=n&&n[l]||0,a=n&&n[l-e]||0,o=c(r,i,a),s[l+1]=t[l]-o+256&255;return s},c=function(t,e,n){if(t===e&&e===n)return t;var r=Math.abs(e-n),i=Math.abs(t-n),a=Math.abs(t+e-n-n);return r<=i&&r<=a?t:i<=a?e:n},y=function(){return[X,g,m,b,v]},w=function(t){var e=t.map(function(t){return t.reduce(function(t,e){return t+Math.abs(e)},0)});return e.indexOf(Math.min.apply(null,e))},P.processPNG=function(t,e,n,r){var i,a,o,s,u,l,c,h,f,d,p,g,m,b,v,y=this.decode.FLATE_DECODE,w="";if(this.__addimage__.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.__addimage__.isArrayBufferView(t)){if("function"!=typeof k.PNG||"function"!=typeof k.FlateStream)throw new Error("PNG support requires png.js and zlib.js");if(t=(o=new PNG(t)).imgData,a=o.bits,i=o.colorSpace,u=o.colors,-1!==[4,6].indexOf(o.colorType)){if(8===o.bits){f=(h=32==o.pixelBitlength?new Uint32Array(o.decodePixels().buffer):16==o.pixelBitlength?new Uint16Array(o.decodePixels().buffer):new Uint8Array(o.decodePixels().buffer)).length,p=new Uint8Array(f*o.colors),d=new Uint8Array(f);var x,N=o.pixelBitlength-o.bits;for(v=b=0;b<f;b++){for(m=h[b],x=0;x<N;)p[v++]=m>>>x&255,x+=o.bits;d[b]=m>>>x&255}}if(16===o.bits){f=(h=new Uint32Array(o.decodePixels().buffer)).length,p=new Uint8Array(f*(32/o.pixelBitlength)*o.colors),d=new Uint8Array(f*(32/o.pixelBitlength)),g=1<o.colors;for(var L=v=b=0;b<f;)m=h[b++],p[v++]=m>>>0&255,g&&(p[v++]=m>>>16&255,m=h[b++],p[v++]=m>>>0&255),d[L++]=m>>>16&255;a=8}!function(t){return t!==P.image_compression.NONE&&F()}(r)?(t=p,c=d,y=void 0):(t=J(p,o.width*o.colors,o.colors,r),c=J(d,o.width,1,r))}if(3===o.colorType&&(i=this.color_spaces.INDEXED,l=o.palette,o.transparency.indexed)){var A=o.transparency.indexed,_=0;for(b=0,f=A.length;b<f;++b)_+=A[b];if((_/=255)==f-1&&-1!==A.indexOf(0))s=[A.indexOf(0)];else if(_!==f){for(h=o.decodePixels(),d=new Uint8Array(h.length),b=0,f=h.length;b<f;b++)d[b]=A[h[b]];c=J(d,o.width,1)}}var S=function(t){var e;switch(t){case P.image_compression.FAST:e=11;break;case P.image_compression.MEDIUM:e=13;break;case P.image_compression.SLOW:e=14;break;default:e=12}return e}(r);return y===this.decode.FLATE_DECODE&&(w="/Predictor "+S+" "),w+="/Colors "+u+" /BitsPerComponent "+a+" /Columns "+o.width,(this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t))&&(t=this.__addimage__.arrayBufferToBinaryString(t)),(c&&this.__addimage__.isArrayBuffer(c)||this.__addimage__.isArrayBufferView(c))&&(c=this.__addimage__.arrayBufferToBinaryString(c)),{alias:n,data:t,index:e,filter:y,decodeParameters:w,transparency:s,palette:l,sMask:c,predictor:S,width:o.width,height:o.height,bitsPerComponent:a,colorSpace:i}}},(
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 Aras Abbasi
|
||
|
*
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
h=U.API).processGIF89A=function(t,e,n,r){var i=new nt(t),a=i.width,o=i.height,s=[];i.decodeAndBlitFrameRGBA(0,s);var u={data:s,width:a,height:o},l=new it(100).encode(u,100);return h.processJPEG.call(this,l,e,n,r)},h.processGIF87A=h.processGIF89A,(
|
||
|
/**
|
||
|
* Copyright (c) 2018 Aras Abbasi
|
||
|
*
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
x=U.API).processBMP=function(t,e,n,r){var i=new at(t,!1),a=i.width,o=i.height,s={data:i.getData(),width:a,height:o},u=new it(100).encode(s,100);return x.processJPEG.call(this,u,e,n,r)},(
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2019 Aras Abbasi
|
||
|
*
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
N=U.API).processWEBP=function(t,e,n,r){var i=new ot(t,!1),a=i.width,o=i.height,s={data:i.getData(),width:a,height:o},u=new it(100).encode(s,100);return N.processJPEG.call(this,u,e,n,r)},U.API.setLanguage=function(t){return void 0===this.internal.languageSettings&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),void 0!=={af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"FYRO Macedonian",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Ve
|
||
|
/** @license
|
||
|
* MIT license.
|
||
|
* Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
|
||
|
* 2014 Diego Casorran, https://github.com/diegocr
|
||
|
*
|
||
|
*
|
||
|
* ====================================================================
|
||
|
*/
|
||
|
L=U.API,A=L.getCharWidthsArray=function(t,e){var n,r,i=(e=e||{}).font||this.internal.getFont(),a=e.fontSize||this.internal.getFontSize(),o=e.charSpace||this.internal.getCharSpace(),s=e.widths?e.widths:i.metadata.Unicode.widths,u=s.fof?s.fof:1,l=e.kerning?e.kerning:i.metadata.Unicode.kerning,c=l.fof?l.fof:1,h=!1!==e.doKerning,f=0,d=t.length,p=0,g=s[0]||u,m=[];for(n=0;n<d;n++)r=t.charCodeAt(n),"function"==typeof i.metadata.widthOfString?m.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+o*(1e3/a)||0)/1e3):(h&&"object"===on(l[r])&&!isNaN(parseInt(l[r][p],10))&&(f=l[r][p]/c),m.push((s[r]||g)/u+f)),p=r;return m},_=L.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return L.processArabic&&(t=L.processArabic(t)),"function"==typeof r.metadata.widthOfString?r.metadata.widthOfString(t,n,i)/n:A.apply(this,arguments).reduce(function(t,e){return t+e},0)},L.splitTextToSize=function(t,e,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),a=function(t){if(t.widths&&t.kerning)return{widths:t.widths,kerning:t.kerning};var e=this.internal.getFont(t.fontName,t.fontStyle),n="Unicode";return e.metadata[n]?{widths:e.metadata[n].widths||{0:1},kerning:e.metadata[n].kerning||{}}:{font:e.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,n);r=Array.isArray(t)?t:t.split(/\r?\n/);var o=1*this.internal.scaleFactor*e/i;a.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=n.lineIndent;var s,u,l=[];for(s=0,u=r.length;s<u;s++)l=l.concat(Z.apply(this,[r[s],o,a]));return l},
|
||
|
/** @license
|
||
|
jsPDF standard_fonts_metrics plugin
|
||
|
* Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
|
||
|
* MIT license.
|
||
|
*
|
||
|
* ====================================================================
|
||
|
*/
|
||
|
/**
|
||
|
* This file adds the standard font metrics to jsPDF.
|
||
|
*
|
||
|
* Font metrics data is reprocessed derivative of contents of
|
||
|
* "Font Metrics for PDF Core 14 Fonts" package, which exhibits the following copyright and license:
|
||
|
*
|
||
|
* Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
|
||
|
*
|
||
|
* This file and the 14 PostScript(R) AFM files it accompanies may be used,
|
||
|
* copied, and distributed for any purpose and without charge, with or without
|
||
|
* modification, provided that all copyright notices are retained; that the AFM
|
||
|
* files are not distributed without this file; that all modifications to this
|
||
|
* file or any of the AFM files are prominently noted in the modified file(s);
|
||
|
* and that this paragraph is not modified. Adobe Systems has no responsibility
|
||
|
* or obligation to support the use of the AFM files.
|
||
|
*
|
||
|
* @name standard_fonts_metrics
|
||
|
* @module
|
||
|
*/
|
||
|
function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="0123456789abcdef",n="klmnopqrstuvwxyz",d={},o={},r=0;r<n.length;r++)d[n[r]]=e[r],o[e[r]]=n[r];function s(t){return"0x"+parseInt(t,10).toString(16)}var u=t.__fontmetrics__.compress=function(t){var e,n,r,i=["{"];for(var a in t){if(e=t[a],n=isNaN(parseInt(a,10))?"'"+a+"'":(a=parseInt(a,10),(n=s(a).slice(2)).slice(0,-1)+o[n.slice(-1)]),"number"==typeof e)r=(e<0?(r=s(e).slice(3),"-"):(r=s(e).slice(2),""))+r.slice(0,-1)+o[r.slice(-1)];else{if("object"!==on(e))throw new Error("Don't know what to do with value type "+on(e)+".");r=u(e)}i.push(n+r)}return i.push("}"),i.join("")},i=t.__fontmetrics__.uncompress=function(t){if("string"!=typeof t)throw new Error("Invalid argument passed to uncompress.");for(var e,n,r,i,a={},o=1,s=a,u=[],l="",c="",h=t.length-1,f=1;f<h;f+=1)"'"==(i=t[f])?e=e?void(r=e.join("")):[]:e?e.push(i):"{"==i?(u.push([s,r]),s={},r=void 0):"}"==i?((n=u.pop())[0][n[1]]=s,r=void 0,s=n[0]):"-"==i?o=-1:void 0===r?d.hasOwnProperty(i)?(l+=d[i],r=parseInt(l,16)*o,o=1,l=""):l+=i:d.hasOwnProperty(i)?(c+=d[i],s[r]=parseInt(c,16)*o,o=1,r=void 0,c=""):c+=i;return a},a={codePages:["WinAnsiEncoding"],WinAnsiEncoding:i("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},l={Unicode:{Courier:a,"Courier-Bold":a,"Courier-BoldOblique":a,"Courier-Oblique":a,Helvetica:a,"Helvetica-Bold":a,"Helvetica-BoldOblique":a,"Helvetica-Oblique":a,"Times-Roman":a,"Times-Bold":a,"Times-BoldItalic":a,"Times-Italic":a}},c={Unicode:{"Courier-Oblique":i("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":i("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":i("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4s
|
||
|
/**
|
||
|
* @license
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
S=U).API.events.push(["addFont",function(t){var e=void 0,n=t.font,r=t.instance;if(void 0!==r){if("string"!=typeof(e=!1===r.existsFileInVFS(n.postScriptName)?r.loadFile(n.postScriptName):r.getFileFromVFS(n.postScriptName)))throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+n.postScriptName+"').");!function(t,e){e=/^\x00\x01\x00\x00/.test(e)?$(e):$(atob(e)),t.metadata=S.API.TTFFont.open(e),t.metadata.Unicode=t.metadata.Unicode||{encoding:{},kerning:{},widths:[]},t.metadata.glyIdsUsed=[0]}(n,e)}else if(!1===n.isStandardFont)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+n.postScriptName+"').")}]),(
|
||
|
/** @license
|
||
|
* Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
|
||
|
*
|
||
|
*
|
||
|
* ====================================================================
|
||
|
*/
|
||
|
C=U.API).addSvg=function(t,e,n,r,i){if(void 0===e||void 0===n)throw new Error("addSVG needs values for 'x' and 'y'");function a(t){for(var e=parseFloat(t[1]),n=parseFloat(t[2]),r=[],i=3,a=t.length;i<a;)"c"===t[i]?(r.push([parseFloat(t[i+1]),parseFloat(t[i+2]),parseFloat(t[i+3]),parseFloat(t[i+4]),parseFloat(t[i+5]),parseFloat(t[i+6])]),i+=7):"l"===t[i]?(r.push([parseFloat(t[i+1]),parseFloat(t[i+2])]),i+=3):i+=1;return[e,n,r]}var o,s,u,l,c,h,f,d,p=(f=document,d=f.createElement("iframe"),l=".jsPDF_sillysvg_iframe {display:none;position:absolute;}",(h=(c=f).createElement("style")).type="text/css",h.styleSheet?h.styleSheet.cssText=l:h.appendChild(c.createTextNode(l)),c.getElementsByTagName("head")[0].appendChild(h),d.name="childframe",d.setAttribute("width",0),d.setAttribute("height",0),d.setAttribute("frameborder","0"),d.setAttribute("scrolling","no"),d.setAttribute("seamless","seamless"),d.setAttribute("class","jsPDF_sillysvg_iframe"),f.body.appendChild(d),d),g=(o=t,(u=((s=p).contentWindow||s.contentDocument).document).write(o),u.close(),u.getElementsByTagName("svg")[0]),m=[1,1],b=parseFloat(g.getAttribute("width")),v=parseFloat(g.getAttribute("height"));b&&v&&(r&&i?m=[r/b,i/v]:r?m=[r/b,r/b]:i&&(m=[i/v,i/v]));var y,w,x,N,L=g.childNodes;for(y=0,w=L.length;y<w;y++)(x=L[y]).tagName&&"PATH"===x.tagName.toUpperCase()&&((N=a(x.getAttribute("d").split(-1===x.getAttribute("d").indexOf(",")?" ":",")))[0]=N[0]*m[0]+e,N[1]=N[1]*m[1]+n,this.lines.call(this,N[2],N[0],N[1],m));return this},C.addSVG=C.addSvg,C.addSvgAsImage=function(t,e,n,r,i,a,o,s){if(isNaN(e)||isNaN(n))throw console.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw console.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var u=document.createElement("canvas");u.width=r,u.height=i;var l=u.getContext("2d");return l.fillStyle="#fff",l.fillRect(0,0,u.width,u.height),canvg(u,t,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0}),this.addImage(u.toDataURL("image/jpeg",1),e,n,r,i,o,s),this},U.API.putTotalPages=function(t){var e,n=0;n=parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(e,n);return this},U.API.viewerPreferences=function(t,e){var n;t=t||{},e=e||!1;var r,i,a,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultVal
|
||
|
/**
|
||
|
* jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser
|
||
|
* Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
|
||
|
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
|
||
|
* 2014 Diego Casorran, https://github.com/diegocr
|
||
|
* 2014 Daniel Husar, https://github.com/danielhusar
|
||
|
* 2014 Wolfgang Gassler, https://github.com/woolfg
|
||
|
* 2014 Steven Spungin, https://github.com/flamenco
|
||
|
*
|
||
|
* @license
|
||
|
*
|
||
|
* ====================================================================
|
||
|
*/
|
||
|
function(t){var k,F,i,o,s,u,l,c,C,y,f,h,d,n,I,j,p,g,m,B;function e(){}k=function(t){return e.prototype=t,new e},y=function(t){var e,n,r,i,a,o,s;for(n=0,r=t.length,e=void 0,o=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0),n++;for(n=r-1;r&&!o&&-1!==n;)(e=t[n]=t[n].trimRight())&&(o=!0),n--;for(a=/\s+$/g,s=!0,n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),s&&(e=e.trimLeft()),e&&(s=a.test(e)),t[n]=e),n++;return t},h=function(t){var e,n,r;for(e=void 0,n=(r=t.split(",")).shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},d=function(t){var e;return-1<(t="auto"===t?"0px":t).indexOf("em")&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),-1<t.indexOf("pt")&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px"),void 0,16,(e=n[t])?e:void 0!==(e={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[t])?n[t]=e/16:(e=parseFloat(t))?n[t]=e/16:(e=t.match(/([\d\.]+)(px)/),Array.isArray(e)&&3===e.length?n[t]=parseFloat(e[1])/16:n[t]=1)},C=function(t){var e,n,r,i,a;return a=t,i=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null):a.currentStyle?a.currentStyle:a.style,n=void 0,(e={})["font-family"]=h((r=function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}),i[t]})("font-family"))||"times",e["font-style"]=o[r("font-style")]||"normal",e["text-align"]=s[r("text-align")]||"left","bold"===(n=u[r("font-weight")]||"normal")&&("normal"===e["font-style"]?e["font-style"]=n:e["font-style"]=n+e["font-style"]),e["font-size"]=d(r("font-size"))||1,e["line-height"]=d(r("line-height"))||1,e.display="inline"===r("display")?"inline":"block",n="block"===e.display,e["margin-top"]=n&&d(r("margin-top"))||0,e["margin-bottom"]=n&&d(r("margin-bottom"))||0,e["padding-top"]=n&&d(r("padding-top"))||0,e["padding-bottom"]=n&&d(r("padding-bottom"))||0,e["margin-left"]=n&&d(r("margin-left"))||0,e["margin-right"]=n&&d(r("margin-right"))||0,e["padding-left"]=n&&d(r("padding-left"))||0,e["padding-right"]=n&&d(r("padding-right"))||0,e["page-break-before"]=r("page-break-before")||"auto",e.float=l[r("cssFloat")]||"none",e.clear=c[r("clear")]||"none",e.color=r("color"),e},I=function(t,e,n){var r,i,a,o,s;if(a=!1,o=i=void 0,r=n["#"+t.id])if("function"==typeof r)a=r(t,e);else for(i=0,o=r.length;!a&&i!==o;)a=r[i](t,e),i++;if(r=n[t.nodeName],!a&&r)if("function"==typeof r)a=r(t,e);else for(i=0,o=r.length;!a&&i!==o;)a=r[i](t,e),i++;for(s="string"==typeof t.className?t.className.split(" "):[],i=0;i<s.length;i++)if(r=n["."+s[i]],!a&&r)if("function"==typeof r)a=r(t,e);else for(i=0,o=r.length;!a&&i!==o;)a=r[i](t,e),i++;return a},B=function(t,e){var n,r,i,a,o,s,u,l,c;for(n=[],r=[],i=0,c=t.rows[0].cells.length,u=t.clientWidth;i<c;)l=t.rows[0].cells[i],r[i]={name:l.textContent.toLowerCase().replace(/\s+/g,""),prompt:l.textContent.replace(/\r?\n/g,""),width:l.clientWidth/u*e.pdf.internal.pageSize.getWidth()},i++;for(i=1;i<t.rows.length;){for(s=t.rows[i],o={},a=0;a<s.cells.length;)o[r[a].name]=s.cells[a].textContent.replace(/\r?\n/g,""),a++;n.push(o),i++}return{rows:n,headers:r}};var O={SCRIPT:1,STYLE:1,NOSCRIPT:1,OBJECT:1,EMBED:1,SELECT:1},E=1;F=function(t,i,e){var n,r,a,o,s,u,l,c;for(r=t.childNodes,n=void 0,(s="block"===(a=C(t)).display)&&(i.setBlockBoundary(),i.setBlockStyle(a)),o=0,u=r.length;o<u;){if("object"===on(n=r[o])){if(i.executeWatchFunctions(n),1===n.nodeType&&"HEADER"===n.nodeName){var h=n,f=i.pdf.margins_doc.top;i.pdf.internal.events.subscribe("addPage",function(t){i.y=f,F(h,i,e),i.pdf.margins_doc.top=i.y+10,i.y+=10},!1)}if(8===n.nodeType&&"#comment"===n.nodeName)~n.textContent.indexOf("ADD_PAGE")&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top);else if(1!==n.nodeType||O[n.nodeName])if(3===n.nodeType){var d=n.nodeValue;if(n.nodeValue&&"LI"===n.parentNode.nodeName)if("OL"===n.parentNode.parentNode.nodeName)d=E+++". "+d;else{var p=a["font-size"],g=(3-.75*p)*i.pdf.internal.scaleFactor,m=.75*p*i.pdf.internal.scaleFactor,b=1.74*p/i.pdf.internal.scaleFactor;c=function(t,e){this.pdf.circle(t+g,e+m,
|
||
|
/*
|
||
|
* Copyright (c) 2012 chick307 <chick307@gmail.com>
|
||
|
*
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
/*
|
||
|
Copyright (c) 2008, Adobe Systems Incorporated
|
||
|
All rights reserved.
|
||
|
|
||
|
Redistribution and use in source and binary forms, with or without
|
||
|
modification, are permitted provided that the following conditions are
|
||
|
met:
|
||
|
|
||
|
* Redistributions of source code must retain the above copyright notice,
|
||
|
this list of conditions and the following disclaimer.
|
||
|
|
||
|
* Redistributions in binary form must reproduce the above copyright
|
||
|
notice, this list of conditions and the following disclaimer in the
|
||
|
documentation and/or other materials provided with the distribution.
|
||
|
|
||
|
* Neither the name of Adobe Systems Incorporated nor the names of its
|
||
|
contributors may be used to endorse or promote products derived from
|
||
|
this software without specific prior written permission.
|
||
|
|
||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||
|
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||
|
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
|
*/
|
||
|
function it(t){var w,x,N,L,e,h=Math.floor,A=new Array(64),_=new Array(64),S=new Array(64),P=new Array(64),b=new Array(65535),v=new Array(65535),Z=new Array(64),y=new Array(64),k=[],F=0,C=7,I=new Array(64),j=new Array(64),B=new Array(64),n=new Array(256),O=new Array(2048),E=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],M=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],q=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],R=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],D=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],U=[0,1,2,3,4,5,6,7,8,9,10,11],z=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],H=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,a=1;a<=16;a++){for(var o=1;o<=t[a];o++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=a,r++,n++;n*=2}return i}function W(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(F|=1<<C),n--,--C<0&&(255==F?(V(255),V(0)):V(F),C=7,F=0)}function V(t){k.push(t)}function G(t){V(t>>8&255),V(255&t)}function Y(t,e,n,r,i){for(var a,o=i[0],s=i[240],u=function(t,e){var n,r,i,a,o,s,u,l,c,h,f=0;for(c=0;c<8;++c){n=t[f],r=t[f+1],i=t[f+2],a=t[f+3],o=t[f+4],s=t[f+5],u=t[f+6];var d=n+(l=t[f+7]),p=n-l,g=r+u,m=r-u,b=i+s,v=i-s,y=a+o,w=a-o,x=d+y,N=d-y,L=g+b,A=g-b;t[f]=x+L,t[f+4]=x-L;var _=.707106781*(A+N);t[f+2]=N+_,t[f+6]=N-_;var S=.382683433*((x=w+v)-(A=m+p)),P=.5411961*x+S,k=1.306562965*A+S,F=.707106781*(L=v+m),C=p+F,I=p-F;t[f+5]=I+P,t[f+3]=I-P,t[f+1]=C+k,t[f+7]=C-k,f+=8}for(c=f=0;c<8;++c){n=t[f],r=t[f+8],i=t[f+16],a=t[f+24],o=t[f+32],s=t[f+40],u=t[f+48];var j=n+(l=t[f+56]),B=n-l,O=r+u,E=r-u,M=i+s,T=i-s,q=a+o,R=a-o,D=j+q,U=j-q,z=O+M,H=O-M;t[f]=D+z,t[f+32]=D-z;var W=.707106781*(H+U);t[f+16]=U+W,t[f+48]=U-W;var V=.382683433*((D=R+T)-(H=E+B)),G=.5411961*D+V,Y=1.306562965*H+V,J=.707106781*(z=T+E),X=B+J,K=B-J;t[f+40]=K+G,t[f+24]=K-G,t[f+8]=X+Y,t[f+56]=X-Y,f++}for(c=0;c<64;++c)h=t[c]*e[c],Z[c]=0<h?.5+h|0:h-.5|0;return Z}(t,e),l=0;l<64;++l)y[E[l]]=u[l];var c=y[0]-n;n=y[0],0==c?W(r[0]):(W(r[v[a=32767+c]]),W(b[a]));for(var h=63;0<h&&0==y[h];)h--;if(0==h)return W(o),n;for(var f,d=1;d<=h;){for(var p=d;0==y[d]&&d<=h;)++d;var g=d-p;if(16<=g){f=g>>4;for(var m=1;m<=f;++m)W(s);g&=15}a=32767+y[d],W(i[(g<<4)+v[a]]),W(b[a]),d++}return 63!=h&&W(o),n}function J(t){(t=Math.min(Math.max(t,1),100),e!=t)&&(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=h((e[n]*t+50)/100);r=Math.min(Math.max(r,1),255),A[E[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],a=0;a<64;a++){var o=h((i[a]*t+50)/100);o=Math.min(Math.max(o,1),255),_[E[a]]=o}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.541196
|
||
|
/*Copyright (c) 2017 Dominik Homberger
|
||
|
|
||
|
https://webpjs.appspot.com
|
||
|
WebPRiffParser dominikhlbg@gmail.com
|
||
|
*/
|
||
|
function(t,e,n,r){for(var i=0;i<r;i++)if(t[e+i]!=n.charCodeAt(i))return!0;return!1}(t,e,"RIFF",4)){var s,u;for(b(t,e+=4),e+=8;e<t.length;){var l=g(t,e),c=b(t,e+=4);e+=4;var h=c+(1&c);switch(l){case"VP8 ":case"VP8L":void 0===n.frames[r]&&(n.frames[r]={}),(p=n.frames[r]).src_off=i?o:e-8,p.src_size=a+c+8,r++,i&&(i=!1,o=a=0);break;case"VP8X":(p=n.header={}).feature_flags=t[e];var f=e+4;p.canvas_width=1+m(t,f),f+=3,p.canvas_height=1+m(t,f),f+=3;break;case"ALPH":i=!0,a=h+8,o=e-8;break;case"ANIM":(p=n.header).bgcolor=b(t,e),f=e+4,p.loop_count=(s=t)[(u=f)+0]<<0|s[u+1]<<8,f+=2;break;case"ANMF":var d,p;(p=n.frames[r]={}).offset_x=2*m(t,e),e+=3,p.offset_y=2*m(t,e),e+=3,p.width=1+m(t,e),e+=3,p.height=1+m(t,e),e+=3,p.duration=m(t,e),e+=3,d=t[e++],p.dispose=1&d,p.blend=d>>1&1}"ANMF"!=l&&(e+=h)}return n}}(a,0);o.response=a,o.rgbaoutput=!0,o.dataurl=!1;var s=o.header?o.header:null,u=o.frames?o.frames:null;if(s){s.loop_counter=s.loop_count,e=s.canvas_height,n=s.canvas_width;for(var l=0;l<u.length&&0!=u[l].blend;l++);}var c=u[0],h=i.WebPDecodeRGBA(a,c.src_off,c.src_size,n,e);c.rgba=h,c.imgwidth=n[0],c.imgheight=e[0];for(var f=0;f<n[0]*e[0]*4;f++)r[f]=h[f];return this.width=n,this.height=e,this.data=r,this}ot.prototype.getData=function(){return this.data};try{exports.WebPDecoder=ot}catch(t){}
|
||
|
/*
|
||
|
Copyright (c) 2013 Gildas Lormeau. All rights reserved.
|
||
|
|
||
|
Redistribution and use in source and binary forms, with or without
|
||
|
modification, are permitted provided that the following conditions are met:
|
||
|
|
||
|
1. Redistributions of source code must retain the above copyright notice,
|
||
|
this list of conditions and the following disclaimer.
|
||
|
|
||
|
2. Redistributions in binary form must reproduce the above copyright
|
||
|
notice, this list of conditions and the following disclaimer in
|
||
|
the documentation and/or other materials provided with the distribution.
|
||
|
|
||
|
3. The names of the authors may not be used to endorse or promote products
|
||
|
derived from this software without specific prior written permission.
|
||
|
|
||
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
|
||
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||
|
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
|
||
|
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||
|
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
|
*/
|
||
|
/*
|
||
|
Copyright (c) 2013 Gildas Lormeau. All rights reserved.
|
||
|
|
||
|
Redistribution and use in source and binary forms, with or without
|
||
|
modification, are permitted provided that the following conditions are met:
|
||
|
|
||
|
1. Redistributions of source code must retain the above copyright notice,
|
||
|
this list of conditions and the following disclaimer.
|
||
|
|
||
|
2. Redistributions in binary form must reproduce the above copyright
|
||
|
notice, this list of conditions and the following disclaimer in
|
||
|
the documentation and/or other materials provided with the distribution.
|
||
|
|
||
|
3. The names of the authors may not be used to endorse or promote products
|
||
|
derived from this software without specific prior written permission.
|
||
|
|
||
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
|
||
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||
|
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
|
||
|
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||
|
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
|
*/
|
||
|
!function(t){var p=15,g=573,e=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function ht(){var d=this;function u(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}d.build_tree=function(t){var e,n,r,i=d.dyn_tree,a=d.stat_desc.static_tree,o=d.stat_desc.elems,s=-1;for(t.heap_len=0,t.heap_max=g,e=0;e<o;e++)0!==i[2*e]?(t.heap[++t.heap_len]=s=e,t.depth[e]=0):i[2*e+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=s<2?++s:0)]=1,t.depth[r]=0,t.opt_len--,a&&(t.static_len-=a[2*r+1]);for(d.max_code=s,e=Math.floor(t.heap_len/2);1<=e;e--)t.pqdownheap(i,e);for(r=o;e=t.heap[1],t.heap[1]=t.heap[t.heap_len--],t.pqdownheap(i,1),n=t.heap[1],t.heap[--t.heap_max]=e,t.heap[--t.heap_max]=n,i[2*r]=i[2*e]+i[2*n],t.depth[r]=Math.max(t.depth[e],t.depth[n])+1,i[2*e+1]=i[2*n+1]=r,t.heap[1]=r++,t.pqdownheap(i,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t){var e,n,r,i,a,o,s=d.dyn_tree,u=d.stat_desc.static_tree,l=d.stat_desc.extra_bits,c=d.stat_desc.extra_base,h=d.stat_desc.max_length,f=0;for(i=0;i<=p;i++)t.bl_count[i]=0;for(s[2*t.heap[t.heap_max]+1]=0,e=t.heap_max+1;e<g;e++)h<(i=s[2*s[2*(n=t.heap[e])+1]+1]+1)&&(i=h,f++),s[2*n+1]=i,n>d.max_code||(t.bl_count[i]++,a=0,c<=n&&(a=l[n-c]),o=s[2*n],t.opt_len+=o*(i+a),u&&(t.static_len+=o*(u[2*n+1]+a)));if(0!==f){do{for(i=h-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[h]--,f-=2}while(0<f);for(i=h;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--e])>d.max_code||(s[2*r+1]!==i&&(t.opt_len+=(i-s[2*r+1])*s[2*r],s[2*r+1]=i),n--)}}(t),function(t,e,n){var r,i,a,o=[],s=0;for(r=1;r<=p;r++)o[r]=s=s+n[r-1]<<1;for(i=0;i<=e;i++)0!==(a=t[2*i+1])&&(t[2*i]=u(o[a]++,a))}(i,d.max_code,t.bl_count)}}function ft(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i}ht._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],ht.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,
|
||
|
/* comment : Store copyright information, platformID, encodingID, and languageID in the NameEntry object.*/function x(){return x.__super__.constructor.apply(this,arguments)}var N=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},L=(a(A,o),A.prototype.tag="name",A.prototype.parse=function(t){var e,n,r,i,a,o,s,u,l,c,h;for(t.pos=this.offset,t.readShort(),e=t.readShort(),o=t.readShort(),n=[],i=0;0<=e?i<e:e<i;i=0<=e?++i:--i)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+o+t.readShort()});for(s={},i=l=0,c=n.length;l<c;i=++l)r=n[i],t.pos=r.offset,u=t.readString(r.length),a=new N(u,r),null==s[h=r.nameID]&&(s[h]=[]),s[r.nameID].push(a);this.strings=s,this.copyright=s[0],this.fontFamily=s[1],this.fontSubfamily=s[2],this.uniqueSubfamily=s[3],this.fontName=s[4],this.version=s[5];try{this.postscriptName=s[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(t){this.postscriptName=s[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=s[7],this.manufacturer=s[8],this.designer=s[9],this.description=s[10],this.vendorUrl=s[11],this.designerUrl=s[12],this.license=s[13],this.licenseUrl=s[14],this.preferredFamily=s[15],this.preferredSubfamily=s[17],this.compatibleFull=s[18],this.sampleText=s[19]},A);function A(){return A.__super__.constructor.apply(this,arguments)}var _=(a(S,o),S.prototype.tag="maxp",S.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},S);function S(){return S.__super__.constructor.apply(this,arguments)}var P=(a(k,o),k.prototype.tag="hmtx",k.prototype.parse=function(n){var r,t,i,a,e,o,s;for(n.pos=this.offset,this.metrics=[],r=0,o=this.file.hhea.numberOfMetrics;0<=o?r<o:o<r;r=0<=o?++r:--r)this.metrics.push({advance:n.readUInt16(),lsb:n.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var t,e;for(e=[],r=t=0;0<=i?t<i:i<t;r=0<=i?++t:--t)e.push(n.readInt16());return e}(),this.widths=function(){var t,e,n,r;for(r=[],t=0,e=(n=this.metrics).length;t<e;t++)a=n[t],r.push(a.advance);return r}.call(this),t=this.widths[this.widths.length-1],s=[],r=e=0;0<=i?e<i:i<e;r=0<=i?++e:--e)s.push(this.widths.push(t));return s},k.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},k);function k(){return k.__super__.constructor.apply(this,arguments)}var F=[].slice,C=(a(I,o),I.prototype.tag="glyf",I.prototype.parse=function(){return this.cache={}},I.prototype.glyphFor=function(t){var e,n,r,i,a,o,s,u,l,c;return t in this.cache?this.cache[t]:(i=this.file.loca,e=this.file.contents,n=i.indexOf(t),0===(r=i.lengthOf(t))?this.cache[t]=null:(e.pos=this.offset+n,a=(o=new J(e.read(r))).readShort(),u=o.readShort(),c=o.readShort(),s=o.readShort(),l=o.readShort(),this.cache[t]=-1===a?new O(o,u,c,s,l):new j(o,a,u,c,s,l),this.cache[t]))},I.prototype.encode=function(t,e,n){var r,i,a,o,s;for(a=[],i=[],o=0,s=e.length;o<s;o++)r=t[e[o]],i.push(a.length),r&&(a=a.concat(r.encode(n)));return i.push(a.length),{table:a,offsets:i}},I);function I(){return I.__super__.constructor.apply(this,arguments)}var j=(B.prototype.encode=function(){return this.raw.data},B);function B(t,e,n,r,i,a){this.raw=t,this.numberOfContours=e,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=a,this.compound=!1}var O=(E.prototype.encode=function(){var t,e,n;for(e=new J(F.call(this.raw.data)),t=0,n=this.glyphIDs.l
|
||
|
/*
|
||
|
# PNG.js
|
||
|
# Copyright (c) 2011 Devon Govett
|
||
|
# MIT LICENSE
|
||
|
#
|
||
|
#
|
||
|
*/
|
||
|
D="undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")()).PNG=function(){var l,n,r;function t(t){var e,n,r,i,a,o,s,u,l,c,h,f,d,p;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},o=null;;){switch(e=this.readUInt32(),l=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(String.fromCharCode(this.data[this.pos++]));return e}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":o&&this.animation.frames.push(o),this.pos+=4,o={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},a=this.readUInt16(),i=this.readUInt16()||100,o.delay=1e3*a/i,o.disposeOp=this.data[this.pos++],o.blendOp=this.data[this.pos++],o.data=[];break;case"IDAT":case"fdAT":for("fdAT"===l&&(this.pos+=4,e-=4),t=(null!=o?o.data:void 0)||this.imgData,f=0;0<=e?f<e:e<f;0<=e?++f:--f)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(r=this.palette.length/3,this.transparency.indexed=this.read(e),this.transparency.indexed.length>r)throw new Error("More transparent colors than palette size");if(0<(c=r-this.transparency.indexed.length))for(d=0;0<=c?d<c:c<d;0<=c?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e)}break;case"tEXt":s=(h=this.read(e)).indexOf(0),u=String.fromCharCode.apply(String,h.slice(0,s)),this.text[u]=String.fromCharCode.apply(String,h.slice(s+1));break;case"IEND":return o&&this.animation.frames.push(o),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(p=this.colorType)||6===p,n=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*n,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=e}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}function i(){if("[object Window]"!==Object.prototype.toString.call(D))return!1;try{n=D.document.createElement("canvas"),r=n.getContext("2d")}catch(t){return!1}return!0}return t.prototype.read=function(t){var e,n;for(n=[],e=0;0<=t?e<t:t<e;0<=t?++e:--e)n.push(this.data[this.pos++]);return n},t.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},t.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},t.prototype.decodePixels=function(I){var j=this.pixelBitlength/8,B=new Uint8Array(this.width*this.height*j),O=0,E=this;if(null==I&&(I=this.imgData),0===I.length)return new Uint8Array(0);function t(t,e,n,r){var i,a,o,s,u,l,c,h,f,d,p,g,m,b,v,y,w,x,N,L,A,_=Math.ceil((E.width-t)/n),S=Math.ceil((E.height-e)/r),P=E.width==_&&E.height==S;for(b=j*_,g=P?B:new Uint8Array(b*S),l=I.length,a=m=0;m<S&&O<l;){switch(I[O++]){case 0:for(s=w=0;w<b;s=w+=1)g[a++]=I[O++];break;case 1:for(s=x=0;x<b;s=x+=1)i=I[O++],u=s<j?0:g[a-j],g[a++]=(i+u)%256;break;case 2:for(s=N=0;N<b;s=N+=1)i=I[O++],o=(s-s%j)/j,v=m&&g[(m-1)*b+o*j+s%j],g[a++]=(v+i)%256;break;case 3:for(s=L=0;L<b;s=L+=1)i=I[O++],o=(s-s%j)/j,u=s<j?0:g[a-j],v=m&&g[(m-1)*b+o*j+s%j],g[a++]=(i+Math.floor((u+v)/2))%256;break;case 4:for(s=A=0;A<b;s=A+=1)i=I[O++],o=(s-s%j)/j,u=s<j?0:g[a-j],0===m?v=y=0:(v=g[(m-1)*b+o*j+s%j],y=o&&g[(m-1)*b+(o-1)*j+s%j]),c=u+v-y,h=Math.abs(c-u),d=Math.abs(c-v),p=Math.abs(c-y),f=h<=d&&h<=p?u:d<=p?v:y,g[a++]=(i+f)%256
|
||
|
/*
|
||
|
* Extracted from pdf.js
|
||
|
* https://github.com/andreasgal/pdf.js
|
||
|
*
|
||
|
* Copyright (c) 2011 Mozilla Foundation
|
||
|
*
|
||
|
* Contributors: Andreas Gal <gal@mozilla.com>
|
||
|
* Chris G Jones <cjones@mozilla.com>
|
||
|
* Shaon Barman <shaon.barman@gmail.com>
|
||
|
* Vivien Nicolas <21@vingtetun.org>
|
||
|
* Justin D'Arcangelo <justindarc@gmail.com>
|
||
|
* Yury Delendik
|
||
|
*
|
||
|
*
|
||
|
*/
|
||
|
var st=(ut.prototype={ensureBuffer:function(t){var e=this.buffer,n=e?e.byteLength:0;if(t<n)return e;for(var r=512;r<t;)r<<=1;for(var i=new Uint8Array(r),a=0;a<n;++a)i[a]=e[a];return this.buffer=i},getByte:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function(t){var e=this.pos;if(t){this.ensureBuffer(e+t);for(var n=e+t;!this.eof&&this.bufferLength<n;)this.readBlock();var r=this.bufferLength;r<n&&(n=r)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}return this.pos=n,this.buffer.subarray(e,n)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,e,n){for(var r=t+e;this.bufferLength<=r&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,e,n)},skip:function(t){t||(t=1),this.pos+=t},reset:function(){this.pos=0}},ut);function ut(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}var lt=("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")()).FlateStream=function(){if("undefined"!=typeof Uint32Array){var F=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),C=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),I=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),j=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,5
|